8805{
8807 {
8808 return true;
8809 }
8810};
8811
8812
8813
8815{
8819
8821
8824
8825
8826
8827
8828
8837
8843
8848
8853
8874 protected bool m_IsResultOfSplit
8875
8877
8882
8883
8884
8886
8890
8891
8892
8894
8897
8898
8899
8905
8906
8914
8917
8918
8920
8921
8923
8924
8929
8930
8935
8936
8938
8939
8941 {
8946
8947 if (!
GetGame().IsDedicatedServer())
8948 {
8950 {
8952
8954 {
8956 }
8957 }
8958
8961 }
8962
8963 m_OldLocation = null;
8964
8966 {
8968 }
8969
8970 if (ConfigIsExisting("headSelectionsToHide"))
8971 {
8974 }
8975
8977 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8978 {
8980 }
8981
8983
8984 m_IsResultOfSplit = false;
8985
8987 }
8988
8990 {
8991 super.InitItemVariables();
8992
8998 m_Count = ConfigGetInt(
"count");
8999
9002
9007
9010
9015
9027
9031
9032
9035 if (ConfigIsExisting("canBeSplit"))
9036 {
9039 }
9040
9042 if (ConfigIsExisting("itemBehaviour"))
9044
9045
9048 RegisterNetSyncVariableInt("m_VarLiquidType");
9049 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9050
9051 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9052 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9053 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9054
9055 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9056 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9057 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9058 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9059
9060 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9061 RegisterNetSyncVariableBool("m_IsTakeable");
9062 RegisterNetSyncVariableBool("m_IsHologram");
9063
9066 {
9069 }
9070
9072
9074 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9076
9077 }
9078
9080 {
9082 }
9083
9085 {
9088 {
9093 }
9094 }
9095
9096 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9097 {
9099 {
9102 }
9103
9105 }
9106
9108 {
9114 }
9115
9117
9119 {
9121
9122 if (!action)
9123 {
9124 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9125 return;
9126 }
9127
9129 if (!ai)
9130 {
9132 return;
9133 }
9134
9136 if (!action_array)
9137 {
9138 action_array = new array<ActionBase_Basic>;
9140 }
9141 if (LogManager.IsActionLogEnable())
9142 {
9143 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9144 }
9145
9146 if (action_array.Find(action) != -1)
9147 {
9148 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9149 }
9150 else
9151 {
9152 action_array.Insert(action);
9153 }
9154 }
9155
9157 {
9159 ActionBase action = player.GetActionManager().GetAction(actionName);
9162
9163 if (action_array)
9164 {
9165 action_array.RemoveItem(action);
9166 }
9167 }
9168
9169
9170
9172 {
9173 ActionOverrideData overrideData = new ActionOverrideData();
9177
9179 if (!actionMap)
9180 {
9183 }
9184
9185 actionMap.Insert(this.
Type(), overrideData);
9186
9187 }
9188
9190
9192
9193
9195 {
9198
9201
9202 string config_to_search = "CfgVehicles";
9203 string muzzle_owner_config;
9204
9206 {
9207 if (IsInherited(Weapon))
9208 config_to_search = "CfgWeapons";
9209
9210 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9211
9212 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9213
9215
9216 if (config_OnFire_subclass_count > 0)
9217 {
9218 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9219
9220 for (int i = 0; i < config_OnFire_subclass_count; i++)
9221 {
9222 string particle_class = "";
9224 string config_OnFire_entry = config_OnFire_class + particle_class;
9225 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9226 WPOF_array.Insert(WPOF);
9227 }
9228
9229
9231 }
9232 }
9233
9235 {
9236 config_to_search = "CfgWeapons";
9237 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9238
9239 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9240
9242
9243 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9244 {
9245 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9246
9247 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9248 {
9249 string particle_class2 = "";
9251 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9252 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9253 WPOBE_array.Insert(WPOBE);
9254 }
9255
9256
9258 }
9259 }
9260 }
9261
9262
9264 {
9267
9269 {
9270 string config_to_search = "CfgVehicles";
9271
9272 if (IsInherited(Weapon))
9273 config_to_search = "CfgWeapons";
9274
9275 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9276 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9277
9278 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9279 {
9280
9282
9284 {
9286 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9288 return;
9289 }
9290
9293
9294
9295
9297 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9298
9299 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9300 {
9301 string particle_class = "";
9303 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9305
9306 if (entry_type == CT_CLASS)
9307 {
9308 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9309 WPOOH_array.Insert(WPOF);
9310 }
9311 }
9312
9313
9315 }
9316 }
9317 }
9318
9320 {
9322 }
9323
9325 {
9327 {
9329
9332
9335
9336 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9337 }
9338 }
9339
9341 {
9343 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9344
9346 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9347
9349 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9350
9352 {
9354 }
9355 }
9356
9358 {
9360 }
9361
9363 {
9366 else
9368
9370 {
9373 }
9374 else
9375 {
9378
9381 }
9382
9384 }
9385
9387 {
9389 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9390 }
9391
9393 {
9395 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9397 }
9398
9400 {
9402 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9403 }
9404
9406 {
9409
9410 OverheatingParticle OP = new OverheatingParticle();
9415
9417 }
9418
9420 {
9423
9424 return -1;
9425 }
9426
9428 {
9430 {
9433
9434 for (int i = count; i > 0; --i)
9435 {
9436 int id = i - 1;
9439
9442
9443 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9444 {
9445 if (p)
9446 {
9449 }
9450 }
9451 }
9452 }
9453 }
9454
9456 {
9458 {
9460 {
9461 int id = i - 1;
9463
9464 if (OP)
9465 {
9467
9468 if (p)
9469 {
9471 }
9472
9473 delete OP;
9474 }
9475 }
9476
9479 }
9480 }
9481
9484 {
9485 return 0.0;
9486 }
9487
9488
9490 {
9491 return 250;
9492 }
9493
9495 {
9496 return 0;
9497 }
9498
9501 {
9503 return true;
9504
9505 return false;
9506 }
9507
9510 {
9513
9515 {
9517 }
9518 else
9519 {
9520
9522 }
9523
9525 }
9526
9533 {
9534 return -1;
9535 }
9536
9537
9538
9539
9541 {
9543 {
9545 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9546
9547 if (r_index >= 0)
9548 {
9549 InventoryLocation r_il = new InventoryLocation;
9550 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9551
9552 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9555 {
9556 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9557 }
9559 {
9560 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9561 }
9562
9563 }
9564
9565 player.GetHumanInventory().ClearUserReservedLocation(this);
9566 }
9567
9570 }
9571
9572
9573
9574
9576 {
9577 return ItemBase.m_DebugActionsMask;
9578 }
9579
9581 {
9582 return ItemBase.m_DebugActionsMask & mask;
9583 }
9584
9586 {
9587 ItemBase.m_DebugActionsMask = mask;
9588 }
9589
9591 {
9592 ItemBase.m_DebugActionsMask |= mask;
9593 }
9594
9596 {
9597 ItemBase.m_DebugActionsMask &= ~mask;
9598 }
9599
9601 {
9603 {
9605 }
9606 else
9607 {
9609 }
9610 }
9611
9612
9614 {
9615 if (GetEconomyProfile())
9616 {
9617 float q_max = GetEconomyProfile().GetQuantityMax();
9618 if (q_max > 0)
9619 {
9620 float q_min = GetEconomyProfile().GetQuantityMin();
9621 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9622
9624 {
9625 ComponentEnergyManager comp = GetCompEM();
9627 {
9629 }
9630 }
9632 {
9634
9635 }
9636
9637 }
9638 }
9639 }
9640
9643 {
9644 EntityAI parent = GetHierarchyParent();
9645
9646 if (parent)
9647 {
9648 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9649 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9650 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9651 }
9652 }
9653
9656 {
9657 EntityAI parent = GetHierarchyParent();
9658
9659 if (parent)
9660 {
9661 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9662 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9663 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9664 }
9665 }
9666
9668 {
9669
9670
9671
9672
9674
9676 {
9677 if (ScriptInputUserData.CanStoreInputUserData())
9678 {
9679 ScriptInputUserData ctx = new ScriptInputUserData;
9685 ctx.
Write(use_stack_max);
9688
9690 {
9691 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9692 }
9693 }
9694 }
9695 else if (!
GetGame().IsMultiplayer())
9696 {
9698 }
9699 }
9700
9702 {
9704 }
9705
9707 {
9709 }
9710
9712 {
9714 }
9715
9717 {
9718
9719 return false;
9720 }
9721
9723 {
9724 return false;
9725 }
9726
9730 {
9731 return false;
9732 }
9733
9735 {
9736 return "";
9737 }
9738
9740
9742 {
9743 return false;
9744 }
9745
9747 {
9748 return true;
9749 }
9750
9751
9752
9754 {
9755 return true;
9756 }
9757
9759 {
9760 return true;
9761 }
9762
9764 {
9765 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9767 }
9768
9770 {
9772 }
9773
9775 {
9777 if (!is_being_placed)
9779 SetSynchDirty();
9780 }
9781
9782
9784
9786 {
9788 }
9789
9791 {
9793 }
9794
9796 {
9797 return 1;
9798 }
9799
9801 {
9802 return false;
9803 }
9804
9806 {
9808 SetSynchDirty();
9809 }
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9846 {
9847 super.OnMovedInsideCargo(container);
9848
9849 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9850 }
9851
9852 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9853 {
9854 super.EEItemLocationChanged(oldLoc,newLoc);
9855
9856 PlayerBase new_player = null;
9857 PlayerBase old_player = null;
9858
9859 if (newLoc.GetParent())
9860 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9861
9862 if (oldLoc.GetParent())
9863 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9864
9866 {
9867 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9868
9869 if (r_index >= 0)
9870 {
9871 InventoryLocation r_il = new InventoryLocation;
9872 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9873
9874 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9877 {
9878 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9879 }
9881 {
9882 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9883 }
9884
9885 }
9886 }
9887
9889 {
9890 if (new_player)
9891 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9892
9893 if (new_player == old_player)
9894 {
9895
9896 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9897 {
9899 {
9900 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9901 {
9902 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9903 }
9904 }
9905 else
9906 {
9907 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9908 }
9909 }
9910
9911 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9912 {
9913 int type = oldLoc.GetType();
9915 {
9916 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9917 }
9919 {
9920 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9921 }
9922 }
9923 if (!m_OldLocation)
9924 {
9925 m_OldLocation = new InventoryLocation;
9926 }
9927 m_OldLocation.Copy(oldLoc);
9928 }
9929 else
9930 {
9931 if (m_OldLocation)
9932 {
9933 m_OldLocation.Reset();
9934 }
9935 }
9936
9938 }
9939 else
9940 {
9941 if (new_player)
9942 {
9943 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9944 if (res_index >= 0)
9945 {
9946 InventoryLocation il = new InventoryLocation;
9947 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9949 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9952 {
9953 il.
GetParent().GetOnReleaseLock().Invoke(it);
9954 }
9956 {
9958 }
9959
9960 }
9961 }
9963 {
9964
9966 }
9967
9968 if (m_OldLocation)
9969 {
9970 m_OldLocation.Reset();
9971 }
9972 }
9973 }
9974
9975 override void EOnContact(IEntity other, Contact extra)
9976 {
9978 {
9979 int liquidType = -1;
9981 if (impactSpeed > 0.0)
9982 {
9984 #ifndef SERVER
9986 #else
9988 SetSynchDirty();
9989 #endif
9991 }
9992 }
9993
9994 #ifdef SERVER
9995 if (GetCompEM() && GetCompEM().IsPlugged())
9996 {
9997 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9998 GetCompEM().UnplugThis();
9999 }
10000 #endif
10001 }
10002
10004
10006 {
10008 }
10009
10011 {
10012
10013 }
10014
10016 {
10017 super.OnItemLocationChanged(old_owner, new_owner);
10018
10019 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10020 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10021
10022 if (!relatedPlayer && playerNew)
10023 relatedPlayer = playerNew;
10024
10025 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10026 {
10028 if (actionMgr)
10029 {
10030 ActionBase currentAction = actionMgr.GetRunningAction();
10031 if (currentAction)
10033 }
10034 }
10035
10036 Man ownerPlayerOld = null;
10037 Man ownerPlayerNew = null;
10038
10039 if (old_owner)
10040 {
10041 if (old_owner.
IsMan())
10042 {
10043 ownerPlayerOld = Man.Cast(old_owner);
10044 }
10045 else
10046 {
10047 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10048 }
10049 }
10050 else
10051 {
10053 {
10055
10056 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10057 {
10058 GetCompEM().UnplugThis();
10059 }
10060 }
10061 }
10062
10063 if (new_owner)
10064 {
10065 if (new_owner.
IsMan())
10066 {
10067 ownerPlayerNew = Man.Cast(new_owner);
10068 }
10069 else
10070 {
10071 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10072 }
10073 }
10074
10075 if (ownerPlayerOld != ownerPlayerNew)
10076 {
10077 if (ownerPlayerOld)
10078 {
10079 array<EntityAI> subItemsExit = new array<EntityAI>;
10081 for (int i = 0; i < subItemsExit.Count(); i++)
10082 {
10085 }
10086 }
10087
10088 if (ownerPlayerNew)
10089 {
10090 array<EntityAI> subItemsEnter = new array<EntityAI>;
10092 for (int j = 0; j < subItemsEnter.Count(); j++)
10093 {
10096 }
10097 }
10098 }
10099 else if (ownerPlayerNew != null)
10100 {
10101 PlayerBase nplayer;
10102 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10103 {
10104 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10106 for (int k = 0; k < subItemsUpdate.Count(); k++)
10107 {
10109 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10110 }
10111 }
10112 }
10113
10114 if (old_owner)
10115 old_owner.OnChildItemRemoved(this);
10116 if (new_owner)
10117 new_owner.OnChildItemReceived(this);
10118 }
10119
10120
10122 {
10123 super.EEDelete(parent);
10124 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10125 if (player)
10126 {
10128
10129 if (player.IsAlive())
10130 {
10131 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10132 if (r_index >= 0)
10133 {
10134 InventoryLocation r_il = new InventoryLocation;
10135 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10136
10137 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10140 {
10141 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10142 }
10144 {
10145 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10146 }
10147
10148 }
10149
10150 player.RemoveQuickBarEntityShortcut(this);
10151 }
10152 }
10153 }
10154
10156 {
10157 super.EEKilled(killer);
10158
10161 {
10162 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10163 {
10164 if (IsMagazine())
10165 {
10166 if (Magazine.Cast(this).GetAmmoCount() > 0)
10167 {
10169 }
10170 }
10171 else
10172 {
10174 }
10175 }
10176 }
10177 }
10178
10180 {
10181 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10182
10183 super.OnWasAttached(parent, slot_id);
10184
10187
10189 }
10190
10192 {
10193 super.OnWasDetached(parent, slot_id);
10194
10197 }
10198
10200 {
10201 int idx;
10204
10205 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10206 if (inventory_slots.Count() < 1)
10207 {
10208 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10209 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10210 }
10211 else
10212 {
10213 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10214 }
10215
10216 idx = inventory_slots.Find(slot);
10217 if (idx < 0)
10218 return "";
10219
10220 return attach_types.Get(idx);
10221 }
10222
10224 {
10225 int idx = -1;
10226 string slot;
10227
10230
10231 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10232 if (inventory_slots.Count() < 1)
10233 {
10234 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10235 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10236 }
10237 else
10238 {
10239 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10240 if (detach_types.Count() < 1)
10241 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10242 }
10243
10244 for (int i = 0; i < inventory_slots.Count(); i++)
10245 {
10246 slot = inventory_slots.Get(i);
10247 }
10248
10249 if (slot != "")
10250 {
10251 if (detach_types.Count() == 1)
10252 idx = 0;
10253 else
10254 idx = inventory_slots.Find(slot);
10255 }
10256 if (idx < 0)
10257 return "";
10258
10259 return detach_types.Get(idx);
10260 }
10261
10263 {
10264
10266
10267
10268 float min_time = 1;
10269 float max_time = 3;
10270 float delay = Math.RandomFloat(min_time, max_time);
10271
10272 explode_timer.Run(delay, this, "DoAmmoExplosion");
10273 }
10274
10276 {
10277 Magazine magazine = Magazine.Cast(this);
10278 int pop_sounds_count = 6;
10279 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10280
10281
10282 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10283 string sound_name = pop_sounds[ sound_idx ];
10285
10286
10287 magazine.ServerAddAmmoCount(-1);
10288
10289
10290 float min_temp_to_explode = 100;
10291
10292 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10293 {
10295 }
10296 }
10297
10298
10299 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10300 {
10301 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10302
10303 const int CHANCE_DAMAGE_CARGO = 4;
10304 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10305 const int CHANCE_DAMAGE_NOTHING = 2;
10306
10308 {
10309 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10310 int chances;
10311 int rnd;
10312
10313 if (GetInventory().GetCargo())
10314 {
10315 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10316 rnd = Math.RandomInt(0,chances);
10317
10318 if (rnd < CHANCE_DAMAGE_CARGO)
10319 {
10321 }
10322 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10323 {
10325 }
10326 }
10327 else
10328 {
10329 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10330 rnd = Math.RandomInt(0,chances);
10331
10332 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10333 {
10335 }
10336 }
10337 }
10338 }
10339
10341 {
10342 if (GetInventory().GetCargo())
10343 {
10344 int item_count = GetInventory().GetCargo().GetItemCount();
10345 if (item_count > 0)
10346 {
10347 int random_pick = Math.RandomInt(0, item_count);
10349 if (!item.IsExplosive())
10350 {
10351 item.AddHealth("","",damage);
10352 return true;
10353 }
10354 }
10355 }
10356 return false;
10357 }
10358
10360 {
10361 int attachment_count = GetInventory().AttachmentCount();
10362 if (attachment_count > 0)
10363 {
10364 int random_pick = Math.RandomInt(0, attachment_count);
10365 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10366 if (!attachment.IsExplosive())
10367 {
10368 attachment.AddHealth("","",damage);
10369 return true;
10370 }
10371 }
10372 return false;
10373 }
10374
10376 {
10378 }
10379
10381 {
10383 return GetInventory().CanRemoveEntity();
10384
10385 return false;
10386 }
10387
10389 {
10391 return;
10392
10394 {
10395 if (ScriptInputUserData.CanStoreInputUserData())
10396 {
10397 ScriptInputUserData ctx = new ScriptInputUserData;
10402 ctx.
Write(destination_entity);
10404 ctx.
Write(slot_id);
10406 }
10407 }
10408 else if (!
GetGame().IsMultiplayer())
10409 {
10411 }
10412 }
10413
10415 {
10417 return;
10418
10419 float split_quantity_new;
10423 InventoryLocation loc = new InventoryLocation;
10424
10425 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10426 {
10428 split_quantity_new = stack_max;
10429 else
10431
10432 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10433 if (new_item)
10434 {
10435 new_item.SetResultOfSplit(true);
10436 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10438 new_item.SetQuantity(split_quantity_new);
10439 }
10440 }
10441 else if (destination_entity && slot_id == -1)
10442 {
10443 if (quantity > stack_max)
10444 split_quantity_new = stack_max;
10445 else
10446 split_quantity_new = quantity;
10447
10449 {
10452 }
10453
10454 if (new_item)
10455 {
10456 new_item.SetResultOfSplit(true);
10457 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10459 new_item.SetQuantity(split_quantity_new);
10460 }
10461 }
10462 else
10463 {
10464 if (stack_max != 0)
10465 {
10467 {
10469 }
10470
10471 if (split_quantity_new == 0)
10472 {
10473 if (!
GetGame().IsMultiplayer())
10474 player.PhysicalPredictiveDropItem(this);
10475 else
10476 player.ServerDropEntity(this);
10477 return;
10478 }
10479
10481
10482 if (new_item)
10483 {
10484 new_item.SetResultOfSplit(true);
10485 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10487 new_item.SetQuantity(stack_max);
10488 new_item.PlaceOnSurface();
10489 }
10490 }
10491 }
10492 }
10493
10495 {
10497 return;
10498
10499 float split_quantity_new;
10503 InventoryLocation loc = new InventoryLocation;
10504
10505 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10506 {
10508 split_quantity_new = stack_max;
10509 else
10511
10512 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10513 if (new_item)
10514 {
10515 new_item.SetResultOfSplit(true);
10516 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10518 new_item.SetQuantity(split_quantity_new);
10519 }
10520 }
10521 else if (destination_entity && slot_id == -1)
10522 {
10523 if (quantity > stack_max)
10524 split_quantity_new = stack_max;
10525 else
10526 split_quantity_new = quantity;
10527
10529 {
10532 }
10533
10534 if (new_item)
10535 {
10536 new_item.SetResultOfSplit(true);
10537 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10539 new_item.SetQuantity(split_quantity_new);
10540 }
10541 }
10542 else
10543 {
10544 if (stack_max != 0)
10545 {
10547 {
10549 }
10550
10552
10553 if (new_item)
10554 {
10555 new_item.SetResultOfSplit(true);
10556 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10558 new_item.SetQuantity(stack_max);
10559 new_item.PlaceOnSurface();
10560 }
10561 }
10562 }
10563 }
10564
10566 {
10568 return;
10569
10571 {
10572 if (ScriptInputUserData.CanStoreInputUserData())
10573 {
10574 ScriptInputUserData ctx = new ScriptInputUserData;
10579 dst.WriteToContext(ctx);
10581 }
10582 }
10583 else if (!
GetGame().IsMultiplayer())
10584 {
10586 }
10587 }
10588
10590 {
10592 return;
10593
10595 {
10596 if (ScriptInputUserData.CanStoreInputUserData())
10597 {
10598 ScriptInputUserData ctx = new ScriptInputUserData;
10603 ctx.
Write(destination_entity);
10609 }
10610 }
10611 else if (!
GetGame().IsMultiplayer())
10612 {
10614 }
10615 }
10616
10618 {
10620 }
10621
10623 {
10625 return this;
10626
10628 float split_quantity_new;
10630 if (dst.IsValid())
10631 {
10632 int slot_id = dst.GetSlot();
10634
10635 if (quantity > stack_max)
10636 split_quantity_new = stack_max;
10637 else
10638 split_quantity_new = quantity;
10639
10641
10642 if (new_item)
10643 {
10644 new_item.SetResultOfSplit(true);
10645 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10648 }
10649
10650 return new_item;
10651 }
10652
10653 return null;
10654 }
10655
10657 {
10659 return;
10660
10662 float split_quantity_new;
10664 if (destination_entity)
10665 {
10667 if (quantity > stackable)
10668 split_quantity_new = stackable;
10669 else
10670 split_quantity_new = quantity;
10671
10672 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10673 if (new_item)
10674 {
10675 new_item.SetResultOfSplit(true);
10676 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10678 new_item.SetQuantity(split_quantity_new);
10679 }
10680 }
10681 }
10682
10684 {
10686 return;
10687
10689 {
10690 if (ScriptInputUserData.CanStoreInputUserData())
10691 {
10692 ScriptInputUserData ctx = new ScriptInputUserData;
10697 ItemBase destination_entity =
this;
10698 ctx.
Write(destination_entity);
10702 }
10703 }
10704 else if (!
GetGame().IsMultiplayer())
10705 {
10707 }
10708 }
10709
10711 {
10713 return;
10714
10716 float split_quantity_new;
10718 if (player)
10719 {
10721 if (quantity > stackable)
10722 split_quantity_new = stackable;
10723 else
10724 split_quantity_new = quantity;
10725
10726 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10727 new_item =
ItemBase.Cast(in_hands);
10728 if (new_item)
10729 {
10730 new_item.SetResultOfSplit(true);
10731 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10733 new_item.SetQuantity(split_quantity_new);
10734 }
10735 }
10736 }
10737
10739 {
10741 return;
10742
10744 float split_quantity_new = Math.Floor(quantity * 0.5);
10745
10747
10748 if (new_item)
10749 {
10750 if (new_item.GetQuantityMax() < split_quantity_new)
10751 {
10752 split_quantity_new = new_item.GetQuantityMax();
10753 }
10754
10755 new_item.SetResultOfSplit(true);
10756 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10757
10759 {
10762 }
10763 else
10764 {
10767 }
10768 }
10769 }
10770
10772 {
10774 return;
10775
10777 float split_quantity_new = Math.Floor(quantity / 2);
10778
10779 InventoryLocation invloc = new InventoryLocation;
10781
10783 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10784
10785 if (new_item)
10786 {
10787 if (new_item.GetQuantityMax() < split_quantity_new)
10788 {
10789 split_quantity_new = new_item.GetQuantityMax();
10790 }
10792 {
10795 }
10796 else
10797 {
10800 }
10801 }
10802 }
10803
10806 {
10807 SetWeightDirty();
10809
10810 if (parent)
10811 parent.OnAttachmentQuantityChangedEx(this, delta);
10812
10814 {
10816 {
10818 }
10820 {
10821 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10823 }
10824 }
10825
10826 }
10827
10830 {
10831
10832 }
10833
10836 {
10838 }
10839
10841 {
10842 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10843
10845 {
10846 if (newLevel == GameConstants.STATE_RUINED)
10847 {
10849 EntityAI parent = GetHierarchyParent();
10850 if (parent && parent.IsFireplace())
10851 {
10852 CargoBase cargo = GetInventory().GetCargo();
10853 if (cargo)
10854 {
10856 {
10858 }
10859 }
10860 }
10861 }
10862
10864 {
10865
10867 return;
10868 }
10869
10870 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10871 {
10873 }
10874 }
10875 }
10876
10877
10879 {
10880 super.OnRightClick();
10881
10883 {
10885 {
10886 if (ScriptInputUserData.CanStoreInputUserData())
10887 {
10888 vector m4[4];
10890
10891 EntityAI root = GetHierarchyRoot();
10892
10893 InventoryLocation dst = new InventoryLocation;
10895 {
10896 if (root)
10897 {
10898 root.GetTransform(m4);
10900 }
10901 else
10902 GetInventory().GetCurrentInventoryLocation(dst);
10903 }
10904 else
10905 {
10907
10908
10909 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10910 {
10911 if (root)
10912 {
10913 root.GetTransform(m4);
10915 }
10916 else
10917 GetInventory().GetCurrentInventoryLocation(dst);
10918 }
10919 else
10920 {
10921 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10922 }
10923 }
10924
10925 ScriptInputUserData ctx = new ScriptInputUserData;
10933 }
10934 }
10935 else if (!
GetGame().IsMultiplayer())
10936 {
10938 }
10939 }
10940 }
10941
10942 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10943 {
10944
10945 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10946 return false;
10947
10948 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10949 return false;
10950
10951
10953 return false;
10954
10955
10956 Magazine mag = Magazine.Cast(this);
10957 if (mag)
10958 {
10959 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10960 return false;
10961
10962 if (stack_max_limit)
10963 {
10964 Magazine other_mag = Magazine.Cast(other_item);
10965 if (other_item)
10966 {
10967 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10968 return false;
10969 }
10970
10971 }
10972 }
10973 else
10974 {
10975
10977 return false;
10978
10980 return false;
10981 }
10982
10983 PlayerBase player = null;
10984 if (CastTo(player, GetHierarchyRootPlayer()))
10985 {
10986 if (player.GetInventory().HasAttachment(this))
10987 return false;
10988
10989 if (player.IsItemsToDelete())
10990 return false;
10991 }
10992
10993 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10994 return false;
10995
10996 int slotID;
10998 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10999 return false;
11000
11001 return true;
11002 }
11003
11005 {
11007 }
11008
11010 {
11011 return m_IsResultOfSplit;
11012 }
11013
11015 {
11016 m_IsResultOfSplit = value;
11017 }
11018
11020 {
11022 }
11023
11025 {
11026 float other_item_quantity = other_item.GetQuantity();
11027 float this_free_space;
11028
11030
11032
11033 if (other_item_quantity > this_free_space)
11034 {
11035 return this_free_space;
11036 }
11037 else
11038 {
11039 return other_item_quantity;
11040 }
11041 }
11042
11044 {
11046 }
11047
11049 {
11051 return;
11052
11053 if (!IsMagazine() && other_item)
11054 {
11056 if (quantity_used != 0)
11057 {
11058 float hp1 = GetHealth01("","");
11059 float hp2 = other_item.GetHealth01("","");
11060 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11061 hpResult = hpResult / (
GetQuantity() + quantity_used);
11062
11063 hpResult *= GetMaxHealth();
11064 Math.Round(hpResult);
11065 SetHealth("", "Health", hpResult);
11066
11068 other_item.AddQuantity(-quantity_used);
11069 }
11070 }
11072 }
11073
11075 {
11076 #ifdef SERVER
11077 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11078 GetHierarchyParent().IncreaseLifetimeUp();
11079 #endif
11080 };
11081
11083 {
11084 PlayerBase p = PlayerBase.Cast(player);
11085
11086 array<int> recipesIds = p.m_Recipes;
11087 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11088 if (moduleRecipesManager)
11089 {
11090 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11091 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11092 }
11093
11094 for (int i = 0;i < recipesIds.Count(); i++)
11095 {
11096 int key = recipesIds.Get(i);
11097 string recipeName = moduleRecipesManager.GetRecipeName(key);
11099 }
11100 }
11101
11102
11103 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11104 {
11105 super.GetDebugActions(outputList);
11106
11107
11112
11113
11117
11121
11122
11125
11126
11128 {
11131 }
11132
11134
11137
11141 }
11142
11143
11144
11145
11147 {
11148 super.OnAction(action_id, player, ctx);
11149 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11150 {
11151 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11152 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11153 PlayerBase p = PlayerBase.Cast(player);
11154 if (
EActions.RECIPES_RANGE_START < 1000)
11155 {
11156 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11157 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11158 }
11159 }
11160 #ifndef SERVER
11161 else if (action_id ==
EActions.WATCH_PLAYER)
11162 {
11163 PluginDeveloper.SetDeveloperItemClientEx(player);
11164 }
11165 #endif
11167 {
11168 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11169 {
11170 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11171 OnDebugButtonPressServer(id + 1);
11172 }
11173
11174 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11175 {
11176 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11178 }
11179
11180 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11181 {
11182 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11184 }
11185
11186 else if (action_id ==
EActions.ADD_QUANTITY)
11187 {
11188 if (IsMagazine())
11189 {
11190 Magazine mag = Magazine.Cast(this);
11191 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11192 }
11193 else
11194 {
11196 }
11197
11198 if (m_EM)
11199 {
11200 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11201 }
11202
11203 }
11204
11205 else if (action_id ==
EActions.REMOVE_QUANTITY)
11206 {
11207 if (IsMagazine())
11208 {
11209 Magazine mag2 = Magazine.Cast(this);
11210 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11211 }
11212 else
11213 {
11215 }
11216 if (m_EM)
11217 {
11218 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11219 }
11220
11221 }
11222
11223 else if (action_id ==
EActions.SET_QUANTITY_0)
11224 {
11226
11227 if (m_EM)
11228 {
11229 m_EM.SetEnergy(0);
11230 }
11231 }
11232
11233 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11234 {
11236
11237 if (m_EM)
11238 {
11239 m_EM.SetEnergy(m_EM.GetEnergyMax());
11240 }
11241 }
11242
11243 else if (action_id ==
EActions.ADD_HEALTH)
11244 {
11245 AddHealth("","",GetMaxHealth("","Health")/5);
11246 }
11247 else if (action_id ==
EActions.REMOVE_HEALTH)
11248 {
11249 AddHealth("","",-GetMaxHealth("","Health")/5);
11250 }
11251 else if (action_id ==
EActions.DESTROY_HEALTH)
11252 {
11253 SetHealth01("","",0);
11254 }
11255 else if (action_id ==
EActions.WATCH_ITEM)
11256 {
11258 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11259 #ifdef DEVELOPER
11260 SetDebugDeveloper_item(this);
11261 #endif
11262 }
11263
11264 else if (action_id ==
EActions.ADD_TEMPERATURE)
11265 {
11266 AddTemperature(20);
11267
11268 }
11269
11270 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11271 {
11272 AddTemperature(-20);
11273
11274 }
11275
11276 else if (action_id ==
EActions.FLIP_FROZEN)
11277 {
11278 SetFrozen(!GetIsFrozen());
11279
11280 }
11281
11282 else if (action_id ==
EActions.ADD_WETNESS)
11283 {
11285
11286 }
11287
11288 else if (action_id ==
EActions.REMOVE_WETNESS)
11289 {
11291
11292 }
11293
11294 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11295 {
11298
11299
11300 }
11301
11302 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11303 {
11306 }
11307
11308 else if (action_id ==
EActions.MAKE_SPECIAL)
11309 {
11310 auto debugParams = DebugSpawnParams.WithPlayer(player);
11311 OnDebugSpawnEx(debugParams);
11312 }
11313
11314 else if (action_id ==
EActions.DELETE)
11315 {
11316 Delete();
11317 }
11318
11319 }
11320
11321
11322 return false;
11323 }
11324
11325
11326
11327
11331
11334
11335
11336
11338 {
11339 return false;
11340 }
11341
11342
11344 {
11345 return true;
11346 }
11347
11348
11350 {
11351 return true;
11352 }
11353
11354
11355
11357 {
11358 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11360 }
11361
11364 {
11365 return null;
11366 }
11367
11369 {
11370 return false;
11371 }
11372
11374 {
11375 return false;
11376 }
11377
11381
11382
11384 {
11385 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11386 return module_repairing.CanRepair(this, item_repair_kit);
11387 }
11388
11389
11390 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11391 {
11392 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11393 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11394 }
11395
11396
11398 {
11399
11400
11401
11402
11403
11404
11405
11406
11407 return 1;
11408 }
11409
11410
11411
11413 {
11415 }
11416
11417
11418
11420 {
11422 }
11423
11424
11433 {
11434 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11435
11436 if (player)
11437 {
11438 player.MessageStatus(text);
11439 }
11440 }
11441
11442
11451 {
11452 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11453
11454 if (player)
11455 {
11456 player.MessageAction(text);
11457 }
11458 }
11459
11460
11469 {
11470 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11471
11472 if (player)
11473 {
11474 player.MessageFriendly(text);
11475 }
11476 }
11477
11478
11487 {
11488 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11489
11490 if (player)
11491 {
11492 player.MessageImportant(text);
11493 }
11494 }
11495
11497 {
11498 return true;
11499 }
11500
11501
11502 override bool KindOf(
string tag)
11503 {
11504 bool found = false;
11505 string item_name = this.
GetType();
11508
11509 int array_size = item_tag_array.Count();
11510 for (int i = 0; i < array_size; i++)
11511 {
11512 if (item_tag_array.Get(i) == tag)
11513 {
11514 found = true;
11515 break;
11516 }
11517 }
11518 return found;
11519 }
11520
11521
11523 {
11524
11525 super.OnRPC(sender, rpc_type,ctx);
11526
11527
11528 switch (rpc_type)
11529 {
11530 #ifndef SERVER
11531 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11532 Param2<bool, string> p = new Param2<bool, string>(false, "");
11533
11535 return;
11536
11537 bool play = p.param1;
11538 string soundSet = p.param2;
11539
11540 if (play)
11541 {
11543 {
11545 {
11547 }
11548 }
11549 else
11550 {
11552 }
11553 }
11554 else
11555 {
11557 }
11558
11559 break;
11560 #endif
11561
11562 }
11563
11565 {
11567 }
11568 }
11569
11570
11571
11572
11574 {
11575 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11576 return plugin.GetID(
name);
11577 }
11578
11580 {
11581 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11582 return plugin.GetName(id);
11583 }
11584
11587 {
11588
11589
11590 int varFlags;
11591 if (!ctx.
Read(varFlags))
11592 return;
11593
11594 if (varFlags & ItemVariableFlags.FLOAT)
11595 {
11597 }
11598 }
11599
11601 {
11602
11603 super.SerializeNumericalVars(floats_out);
11604
11605
11606
11608 {
11610 }
11611
11613 {
11615 }
11616
11618 {
11620 }
11621
11623 {
11628 }
11629
11631 {
11633 }
11634 }
11635
11637 {
11638
11639 super.DeSerializeNumericalVars(floats);
11640
11641
11642 int index = 0;
11643 int mask = Math.Round(floats.Get(index));
11644
11645 index++;
11646
11648 {
11650 {
11652 }
11653 else
11654 {
11655 float quantity = floats.Get(index);
11656 SetQuantity(quantity,
true,
false,
false,
false);
11657 }
11658 index++;
11659 }
11660
11662 {
11663 float wet = floats.Get(index);
11665 index++;
11666 }
11667
11669 {
11670 int liquidtype = Math.Round(floats.Get(index));
11672 index++;
11673 }
11674
11676 {
11678 index++;
11680 index++;
11682 index++;
11684 index++;
11685 }
11686
11688 {
11689 int cleanness = Math.Round(floats.Get(index));
11691 index++;
11692 }
11693 }
11694
11696 {
11697 super.WriteVarsToCTX(ctx);
11698
11699
11701 {
11703 }
11704
11706 {
11708 }
11709
11711 {
11713 }
11714
11716 {
11717 int r,g,b,a;
11723 }
11724
11726 {
11728 }
11729 }
11730
11732 {
11733 if (!super.ReadVarsFromCTX(ctx,version))
11734 return false;
11735
11736 int intValue;
11737 float value;
11738
11739 if (version < 140)
11740 {
11741 if (!ctx.
Read(intValue))
11742 return false;
11743
11744 m_VariablesMask = intValue;
11745 }
11746
11748 {
11749 if (!ctx.
Read(value))
11750 return false;
11751
11753 {
11755 }
11756 else
11757 {
11759 }
11760 }
11761
11762 if (version < 140)
11763 {
11765 {
11766 if (!ctx.
Read(value))
11767 return false;
11768 SetTemperatureDirect(value);
11769 }
11770 }
11771
11773 {
11774 if (!ctx.
Read(value))
11775 return false;
11777 }
11778
11780 {
11781 if (!ctx.
Read(intValue))
11782 return false;
11784 }
11785
11787 {
11788 int r,g,b,a;
11790 return false;
11792 return false;
11794 return false;
11796 return false;
11797
11799 }
11800
11802 {
11803 if (!ctx.
Read(intValue))
11804 return false;
11806 }
11807
11808 if (version >= 138 && version < 140)
11809 {
11811 {
11812 if (!ctx.
Read(intValue))
11813 return false;
11814 SetFrozen(intValue);
11815 }
11816 }
11817
11818 return true;
11819 }
11820
11821
11823 {
11826 {
11828 }
11829
11830 if (!super.OnStoreLoad(ctx, version))
11831 {
11833 return false;
11834 }
11835
11836 if (version >= 114)
11837 {
11838 bool hasQuickBarIndexSaved;
11839
11840 if (!ctx.
Read(hasQuickBarIndexSaved))
11841 {
11843 return false;
11844 }
11845
11846 if (hasQuickBarIndexSaved)
11847 {
11848 int itmQBIndex;
11849
11850
11851 if (!ctx.
Read(itmQBIndex))
11852 {
11854 return false;
11855 }
11856
11857 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11858 if (itmQBIndex != -1 && parentPlayer)
11859 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11860 }
11861 }
11862 else
11863 {
11864
11865 PlayerBase player;
11866 int itemQBIndex;
11867 if (version ==
int.
MAX)
11868 {
11869 if (!ctx.
Read(itemQBIndex))
11870 {
11872 return false;
11873 }
11874 }
11875 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11876 {
11877
11878 if (!ctx.
Read(itemQBIndex))
11879 {
11881 return false;
11882 }
11883 if (itemQBIndex != -1 && player)
11884 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11885 }
11886 }
11887
11888 if (version < 140)
11889 {
11890
11891 if (!LoadVariables(ctx, version))
11892 {
11894 return false;
11895 }
11896 }
11897
11898
11900 {
11902 return false;
11903 }
11904 if (version >= 132)
11905 {
11907 if (raib)
11908 {
11910 {
11912 return false;
11913 }
11914 }
11915 }
11916
11918 return true;
11919 }
11920
11921
11922
11924 {
11925 super.OnStoreSave(ctx);
11926
11927 PlayerBase player;
11928 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11929 {
11931
11932 int itemQBIndex = -1;
11933 itemQBIndex = player.FindQuickBarEntityIndex(this);
11934 ctx.
Write(itemQBIndex);
11935 }
11936 else
11937 {
11939 }
11940
11942
11944 if (raib)
11945 {
11947 }
11948 }
11949
11950
11952 {
11953 super.AfterStoreLoad();
11954
11956 {
11958 }
11959
11961 {
11964 }
11965 }
11966
11968 {
11969 super.EEOnAfterLoad();
11970
11972 {
11974 }
11975
11978 }
11979
11981 {
11982 return false;
11983 }
11984
11985
11986
11988 {
11990 {
11991 #ifdef PLATFORM_CONSOLE
11992
11994 {
11996 if (menu)
11997 {
11999 }
12000 }
12001 #endif
12002 }
12003
12005 {
12008 }
12009
12011 {
12012 SetWeightDirty();
12014 }
12016 {
12019 }
12020
12022 {
12025 }
12027 {
12030 }
12031
12032 super.OnVariablesSynchronized();
12033 }
12034
12035
12036
12038 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12039 {
12040 if (!IsServerCheck(allow_client))
12041 return false;
12042
12044 return false;
12045
12048
12049 if (value <= (min + 0.001))
12050 value = min;
12051
12052 if (value == min)
12053 {
12054 if (destroy_config)
12055 {
12056 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12057 if (dstr)
12058 {
12060 this.Delete();
12061 return true;
12062 }
12063 }
12064 else if (destroy_forced)
12065 {
12067 this.Delete();
12068 return true;
12069 }
12070
12072 }
12073
12076
12078 {
12080
12081 if (delta)
12083 }
12084
12086
12087 return false;
12088 }
12089
12090
12092 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12093 {
12095 }
12096
12098 {
12101 }
12102
12104 {
12107 }
12108
12111 {
12112 float value_clamped = Math.Clamp(value, 0, 1);
12114 SetQuantity(result, destroy_config, destroy_forced);
12115 }
12116
12117
12120 {
12122 }
12123
12125 {
12127 }
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12139 {
12140 int slot = -1;
12141 if (GetInventory())
12142 {
12143 InventoryLocation il = new InventoryLocation;
12144 GetInventory().GetCurrentInventoryLocation(il);
12146 }
12147
12149 }
12150
12152 {
12153 float quantity_max = 0;
12154
12156 {
12157 if (attSlotID != -1)
12158 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12159
12160 if (quantity_max <= 0)
12162 }
12163
12164 if (quantity_max <= 0)
12166
12167 return quantity_max;
12168 }
12169
12171 {
12173 }
12174
12176 {
12178 }
12179
12180
12182 {
12184 }
12185
12187 {
12189 }
12190
12192 {
12194 }
12195
12196
12198 {
12199
12200 float weightEx = GetWeightEx();
12201 float special = GetInventoryAndCargoWeight();
12202 return weightEx - special;
12203 }
12204
12205
12207 {
12209 }
12210
12212 {
12214 {
12215 #ifdef DEVELOPER
12216 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12217 {
12218 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12220 }
12221 #endif
12222
12223 return GetQuantity() * GetConfigWeightModified();
12224 }
12225 else if (HasEnergyManager())
12226 {
12227 #ifdef DEVELOPER
12228 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12229 {
12230 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12231 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12232 }
12233 #endif
12234 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12235 }
12236 else
12237 {
12238 #ifdef DEVELOPER
12239 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12240 {
12241 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12242 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12243 }
12244 #endif
12245 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12246 }
12247 }
12248
12251 {
12252 int item_count = 0;
12254
12255 if (GetInventory().GetCargo() != NULL)
12256 {
12257 item_count = GetInventory().GetCargo().GetItemCount();
12258 }
12259
12260 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12261 {
12262 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12263 if (item)
12264 item_count += item.GetNumberOfItems();
12265 }
12266 return item_count;
12267 }
12268
12271 {
12272 float weight = 0;
12273 float wetness = 1;
12274 if (include_wetness)
12277 {
12278 weight = wetness * m_ConfigWeight;
12279 }
12281 {
12282 weight = 1;
12283 }
12284 return weight;
12285 }
12286
12287
12288
12290 {
12291 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12292 {
12293 GameInventory inv = GetInventory();
12294 array<EntityAI> items = new array<EntityAI>;
12296 for (int i = 0; i < items.Count(); i++)
12297 {
12299 if (item)
12300 {
12302 }
12303 }
12304 }
12305 }
12306
12307
12308
12309
12311 {
12312 float energy = 0;
12313 if (HasEnergyManager())
12314 {
12315 energy = GetCompEM().GetEnergy();
12316 }
12317 return energy;
12318 }
12319
12320
12322 {
12323 super.OnEnergyConsumed();
12324
12326 }
12327
12329 {
12330 super.OnEnergyAdded();
12331
12333 }
12334
12335
12337 {
12338 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12339 {
12341 {
12342 float energy_0to1 = GetCompEM().GetEnergy0To1();
12344 }
12345 }
12346 }
12347
12348
12350 {
12351 return ConfigGetFloat("heatIsolation");
12352 }
12353
12355 {
12357 }
12358
12360 {
12361 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12362 if (
GetGame().ConfigIsExisting(paramPath))
12364
12365 return 0.0;
12366 }
12367
12369 {
12370 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12371 if (
GetGame().ConfigIsExisting(paramPath))
12373
12374 return 0.0;
12375 }
12376
12377 override void SetWet(
float value,
bool allow_client =
false)
12378 {
12379 if (!IsServerCheck(allow_client))
12380 return;
12381
12384
12386
12387 m_VarWet = Math.Clamp(value, min, max);
12388
12390 {
12393 }
12394 }
12395
12396 override void AddWet(
float value)
12397 {
12399 }
12400
12402 {
12404 }
12405
12407 {
12409 }
12410
12412 {
12414 }
12415
12417 {
12419 }
12420
12422 {
12424 }
12425
12426 override void OnWetChanged(
float newVal,
float oldVal)
12427 {
12430 if (newLevel != oldLevel)
12431 {
12433 }
12434 }
12435
12437 {
12438 SetWeightDirty();
12439 }
12440
12442 {
12443 return GetWetLevelInternal(
m_VarWet);
12444 }
12445
12446
12447
12449 {
12451 }
12452
12454 {
12456 }
12457
12459 {
12461 }
12462
12464 {
12466 }
12467
12468
12469
12471 {
12472 if (ConfigIsExisting("itemModelLength"))
12473 {
12474 return ConfigGetFloat("itemModelLength");
12475 }
12476 return 0;
12477 }
12478
12480 {
12481 if (ConfigIsExisting("itemAttachOffset"))
12482 {
12483 return ConfigGetFloat("itemAttachOffset");
12484 }
12485 return 0;
12486 }
12487
12488 override void SetCleanness(
int value,
bool allow_client =
false)
12489 {
12490 if (!IsServerCheck(allow_client))
12491 return;
12492
12494
12496
12499 }
12500
12502 {
12504 }
12505
12507 {
12508 return true;
12509 }
12510
12511
12512
12513
12515 {
12517 }
12518
12520 {
12522 }
12523
12524
12525
12526
12527 override void SetColor(
int r,
int g,
int b,
int a)
12528 {
12534 }
12536 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12537 {
12542 }
12543
12545 {
12547 }
12548
12551 {
12552 int r,g,b,a;
12554 r = r/255;
12555 g = g/255;
12556 b = b/255;
12557 a = a/255;
12558 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12559 }
12560
12561
12562
12563 override void SetLiquidType(
int value,
bool allow_client =
false)
12564 {
12565 if (!IsServerCheck(allow_client))
12566 return;
12567
12572 }
12573
12575 {
12576 return ConfigGetInt("varLiquidTypeInit");
12577 }
12578
12580 {
12582 }
12583
12585 {
12587 SetFrozen(false);
12588 }
12589
12592 {
12593 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12594 }
12595
12596
12599 {
12600 PlayerBase nplayer;
12601 if (PlayerBase.CastTo(nplayer, player))
12602 {
12604
12605 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12606 }
12607 }
12608
12609
12612 {
12613 PlayerBase nplayer;
12614 if (PlayerBase.CastTo(nplayer,player))
12615 {
12616
12617 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12618
12619 }
12620
12621
12622 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12623
12624
12625 if (HasEnergyManager())
12626 {
12627 GetCompEM().UpdatePlugState();
12628 }
12629 }
12630
12631
12633 {
12634 super.OnPlacementStarted(player);
12635
12637 }
12638
12639 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12640 {
12642 {
12643 m_AdminLog.OnPlacementComplete(player,
this);
12644 }
12645
12646 super.OnPlacementComplete(player, position, orientation);
12647 }
12648
12649
12650
12651
12652
12654 {
12656 {
12657 return true;
12658 }
12659 else
12660 {
12661 return false;
12662 }
12663 }
12664
12665
12667 {
12669 {
12671 }
12672 }
12673
12674
12676 {
12678 }
12679
12681 {
12683 }
12684
12685 override void InsertAgent(
int agent,
float count = 1)
12686 {
12687 if (count < 1)
12688 return;
12689
12691 }
12692
12695 {
12697 }
12698
12699
12701 {
12703 }
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12747 {
12749 return false;
12750 return true;
12751 }
12752
12754 {
12755
12757 }
12758
12759
12762 {
12763 super.CheckForRoofLimited(timeTresholdMS);
12764
12766 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12767 {
12768 m_PreviousRoofTestTime = time;
12769 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12770 }
12771 }
12772
12773
12775 {
12777 {
12778 return 0;
12779 }
12780
12781 if (GetInventory().GetAttachmentSlotsCount() != 0)
12782 {
12783 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12784 if (filter)
12785 return filter.GetProtectionLevel(type, false, system);
12786 else
12787 return 0;
12788 }
12789
12790 string subclassPath, entryName;
12791
12792 switch (type)
12793 {
12795 entryName = "biological";
12796 break;
12798 entryName = "chemical";
12799 break;
12800 default:
12801 entryName = "biological";
12802 break;
12803 }
12804
12805 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12806
12808 }
12809
12810
12811
12814 {
12815 if (!IsMagazine())
12817
12819 }
12820
12821
12822
12823
12824
12829 {
12830 return true;
12831 }
12832
12834 {
12836 }
12837
12838
12839
12840
12841
12843 {
12844 if (parent)
12845 {
12846 if (parent.IsInherited(DayZInfected))
12847 return true;
12848
12849 if (!parent.IsRuined())
12850 return true;
12851 }
12852
12853 return true;
12854 }
12855
12857 {
12858 if (!super.CanPutAsAttachment(parent))
12859 {
12860 return false;
12861 }
12862
12863 if (!IsRuined() && !parent.IsRuined())
12864 {
12865 return true;
12866 }
12867
12868 return false;
12869 }
12870
12872 {
12873
12874
12875
12876
12877 return super.CanReceiveItemIntoCargo(item);
12878 }
12879
12881 {
12882
12883
12884
12885
12886 GameInventory attachmentInv = attachment.GetInventory();
12888 {
12889 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12890 return false;
12891 }
12892
12893 InventoryLocation loc = new InventoryLocation();
12894 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12895 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12896 return false;
12897
12898 return super.CanReceiveAttachment(attachment, slotId);
12899 }
12900
12902 {
12903 if (!super.CanReleaseAttachment(attachment))
12904 return false;
12905
12906 return GetInventory().AreChildrenAccessible();
12907 }
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12930 {
12931 int id = muzzle_owner.GetMuzzleID();
12932 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12933
12934 if (WPOF_array)
12935 {
12936 for (int i = 0; i < WPOF_array.Count(); i++)
12937 {
12938 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12939
12940 if (WPOF)
12941 {
12942 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12943 }
12944 }
12945 }
12946 }
12947
12948
12950 {
12951 int id = muzzle_owner.GetMuzzleID();
12953
12954 if (WPOBE_array)
12955 {
12956 for (int i = 0; i < WPOBE_array.Count(); i++)
12957 {
12958 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12959
12960 if (WPOBE)
12961 {
12962 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12963 }
12964 }
12965 }
12966 }
12967
12968
12970 {
12971 int id = muzzle_owner.GetMuzzleID();
12972 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12973
12974 if (WPOOH_array)
12975 {
12976 for (int i = 0; i < WPOOH_array.Count(); i++)
12977 {
12978 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12979
12980 if (WPOOH)
12981 {
12982 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12983 }
12984 }
12985 }
12986 }
12987
12988
12990 {
12991 int id = muzzle_owner.GetMuzzleID();
12992 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12993
12994 if (WPOOH_array)
12995 {
12996 for (int i = 0; i < WPOOH_array.Count(); i++)
12997 {
12998 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12999
13000 if (WPOOH)
13001 {
13002 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13003 }
13004 }
13005 }
13006 }
13007
13008
13010 {
13011 int id = muzzle_owner.GetMuzzleID();
13012 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13013
13014 if (WPOOH_array)
13015 {
13016 for (int i = 0; i < WPOOH_array.Count(); i++)
13017 {
13018 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13019
13020 if (WPOOH)
13021 {
13022 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13023 }
13024 }
13025 }
13026 }
13027
13028
13029
13031 {
13033 {
13034 return true;
13035 }
13036
13037 return false;
13038 }
13039
13041 {
13043 {
13044 return true;
13045 }
13046
13047 return false;
13048 }
13049
13051 {
13053 {
13054 return true;
13055 }
13056
13057 return false;
13058 }
13059
13061 {
13062 return false;
13063 }
13064
13067 {
13068 return UATimeSpent.DEFAULT_DEPLOY;
13069 }
13070
13071
13072
13073
13075 {
13077 SetSynchDirty();
13078 }
13079
13081 {
13083 }
13084
13085
13087 {
13088 return false;
13089 }
13090
13093 {
13094 string att_type = "None";
13095
13096 if (ConfigIsExisting("soundAttType"))
13097 {
13098 att_type = ConfigGetString("soundAttType");
13099 }
13100
13102 }
13103
13105 {
13107 }
13108
13109
13110
13111
13112
13116
13118 {
13121
13123 }
13124
13125
13127 {
13129 return;
13130
13132
13135
13138
13139 SoundParameters params = new SoundParameters();
13143 }
13144
13145
13147 {
13149 return;
13150
13152 SetSynchDirty();
13153
13156 }
13157
13158
13160 {
13162 return;
13163
13165 SetSynchDirty();
13166
13169 }
13170
13172 {
13174 }
13175
13177 {
13179 }
13180
13183 {
13184 if (!
GetGame().IsDedicatedServer())
13185 {
13186 if (ConfigIsExisting("attachSoundSet"))
13187 {
13188 string cfg_path = "";
13189 string soundset = "";
13190 string type_name =
GetType();
13191
13194 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13195 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13196
13197 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13198 {
13199 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13200 {
13201 if (cfg_slot_array[i] == slot_type)
13202 {
13203 soundset = cfg_soundset_array[i];
13204 break;
13205 }
13206 }
13207 }
13208
13209 if (soundset != "")
13210 {
13211 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13213 }
13214 }
13215 }
13216 }
13217
13219 {
13220
13221 }
13222
13223 void OnApply(PlayerBase player);
13224
13226 {
13227 return 1.0;
13228 };
13229
13231 {
13233 }
13234
13236 {
13238 }
13239
13241
13243 {
13244 SetDynamicPhysicsLifeTime(0.01);
13246 }
13247
13249 {
13250 array<string> zone_names = new array<string>;
13251 GetDamageZones(zone_names);
13252 for (int i = 0; i < zone_names.Count(); i++)
13253 {
13254 SetHealthMax(zone_names.Get(i),"Health");
13255 }
13256 SetHealthMax("","Health");
13257 }
13258
13261 {
13262 float global_health = GetHealth01("","Health");
13263 array<string> zones = new array<string>;
13264 GetDamageZones(zones);
13265
13266 for (int i = 0; i < zones.Count(); i++)
13267 {
13268 SetHealth01(zones.Get(i),"Health",global_health);
13269 }
13270 }
13271
13274 {
13275 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13276 }
13277
13279 {
13280 if (!hasRootAsPlayer)
13281 {
13282 if (refParentIB)
13283 {
13284
13285 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13286 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13287
13288 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13289 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13290
13293 }
13294 else
13295 {
13296
13299 }
13300 }
13301 }
13302
13304 {
13306 {
13307 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13308 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13309 {
13310 float heatPermCoef = 1.0;
13312 while (ent)
13313 {
13314 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13315 ent = ent.GetHierarchyParent();
13316 }
13317
13318 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13319 }
13320 }
13321 }
13322
13324 {
13325
13326 EntityAI parent = GetHierarchyParent();
13327 if (!parent)
13328 {
13329 hasParent = false;
13330 hasRootAsPlayer = false;
13331 }
13332 else
13333 {
13334 hasParent = true;
13335 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13336 refParentIB =
ItemBase.Cast(parent);
13337 }
13338 }
13339
13340 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13341 {
13342
13343 }
13344
13346 {
13347
13348 return false;
13349 }
13350
13352 {
13353
13354
13355 return false;
13356 }
13357
13359 {
13360
13361 return false;
13362 }
13363
13366 {
13367 return !GetIsFrozen() &&
IsOpen();
13368 }
13369
13371 {
13372 bool hasParent = false, hasRootAsPlayer = false;
13374
13375 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13376 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13377
13378 if (wwtu || foodDecay)
13379 {
13383
13384 if (processWetness || processTemperature || processDecay)
13385 {
13387
13388 if (processWetness)
13389 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13390
13391 if (processTemperature)
13393
13394 if (processDecay)
13395 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13396 }
13397 }
13398 }
13399
13402 {
13404 }
13405
13407 {
13410
13411 return super.GetTemperatureFreezeThreshold();
13412 }
13413
13415 {
13418
13419 return super.GetTemperatureThawThreshold();
13420 }
13421
13423 {
13426
13427 return super.GetItemOverheatThreshold();
13428 }
13429
13431 {
13433 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13434
13435 return super.GetTemperatureFreezeTime();
13436 }
13437
13439 {
13441 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13442
13443 return super.GetTemperatureThawTime();
13444 }
13445
13450
13452 {
13453 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13454 }
13455
13457 {
13458 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13459 }
13460
13463 {
13465 }
13466
13468 {
13470 }
13471
13473 {
13475 }
13476
13479 {
13480 return null;
13481 }
13482
13485 {
13486 return false;
13487 }
13488
13490 {
13492 {
13495 if (!trg)
13496 {
13498 explosive = this;
13499 }
13500
13501 explosive.PairRemote(trg);
13503
13504 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13505 trg.SetPersistentPairID(persistentID);
13506 explosive.SetPersistentPairID(persistentID);
13507
13508 return true;
13509 }
13510 return false;
13511 }
13512
13515 {
13516 float ret = 1.0;
13519 ret *= GetHealth01();
13520
13521 return ret;
13522 }
13523
13524 #ifdef DEVELOPER
13525 override void SetDebugItem()
13526 {
13527 super.SetDebugItem();
13528 _itemBase = this;
13529 }
13530
13532 {
13533 string text = super.GetDebugText();
13534
13536 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13537
13538 return text;
13539 }
13540 #endif
13541
13543 {
13544 return true;
13545 }
13546
13548
13550
13552 {
13555 }
13556
13557
13565
13581}
13582
13584{
13586 if (entity)
13587 {
13588 bool is_item = entity.IsInherited(
ItemBase);
13589 if (is_item && full_quantity)
13590 {
13593 }
13594 }
13595 else
13596 {
13598 return NULL;
13599 }
13600 return entity;
13601}
13602
13604{
13605 if (item)
13606 {
13607 if (health > 0)
13608 item.SetHealth("", "", health);
13609
13610 if (item.CanHaveTemperature())
13611 {
13613 if (item.CanFreeze())
13614 item.SetFrozen(false);
13615 }
13616
13617 if (item.HasEnergyManager())
13618 {
13619 if (quantity >= 0)
13620 {
13621 item.GetCompEM().SetEnergy0To1(quantity);
13622 }
13623 else
13624 {
13626 }
13627 }
13628 else if (item.IsMagazine())
13629 {
13630 Magazine mag = Magazine.Cast(item);
13631 if (quantity >= 0)
13632 {
13633 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13634 }
13635 else
13636 {
13638 }
13639
13640 }
13641 else
13642 {
13643 if (quantity >= 0)
13644 {
13645 item.SetQuantityNormalized(quantity, false);
13646 }
13647 else
13648 {
13650 }
13651
13652 }
13653 }
13654}
13655
13656#ifdef DEVELOPER
13658#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.