8808{
8810 {
8811 return true;
8812 }
8813};
8814
8815
8816
8818{
8822
8824
8827
8828
8829
8830
8831
8840
8846
8851
8856
8877 protected bool m_IsResultOfSplit
8878
8880
8885
8886
8887
8889
8893
8894
8895
8897
8900
8901
8902
8908
8909
8917
8920
8921
8923
8924
8926
8927
8932
8933
8938
8939
8941
8942
8944 {
8949
8950 if (!
GetGame().IsDedicatedServer())
8951 {
8953 {
8955
8957 {
8959 }
8960 }
8961
8964 }
8965
8966 m_OldLocation = null;
8967
8969 {
8971 }
8972
8973 if (ConfigIsExisting("headSelectionsToHide"))
8974 {
8977 }
8978
8980 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8981 {
8983 }
8984
8986
8987 m_IsResultOfSplit = false;
8988
8990 }
8991
8993 {
8994 super.InitItemVariables();
8995
9001 m_Count = ConfigGetInt(
"count");
9002
9005
9010
9013
9018
9030
9034
9035
9038 if (ConfigIsExisting("canBeSplit"))
9039 {
9042 }
9043
9045 if (ConfigIsExisting("itemBehaviour"))
9047
9048
9051 RegisterNetSyncVariableInt("m_VarLiquidType");
9052 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9053
9054 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9055 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9056 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9057
9058 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9059 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9060 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9061 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9062
9063 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9064 RegisterNetSyncVariableBool("m_IsTakeable");
9065 RegisterNetSyncVariableBool("m_IsHologram");
9066
9069 {
9072 }
9073
9075
9077 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9079
9080 }
9081
9083 {
9085 }
9086
9088 {
9091 {
9096 }
9097 }
9098
9099 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9100 {
9102 {
9105 }
9106
9108 }
9109
9111 {
9117 }
9118
9120
9122 {
9124
9125 if (!action)
9126 {
9127 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9128 return;
9129 }
9130
9132 if (!ai)
9133 {
9135 return;
9136 }
9137
9139 if (!action_array)
9140 {
9141 action_array = new array<ActionBase_Basic>;
9143 }
9144 if (LogManager.IsActionLogEnable())
9145 {
9146 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9147 }
9148
9149 if (action_array.Find(action) != -1)
9150 {
9151 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9152 }
9153 else
9154 {
9155 action_array.Insert(action);
9156 }
9157 }
9158
9160 {
9162 ActionBase action = player.GetActionManager().GetAction(actionName);
9165
9166 if (action_array)
9167 {
9168 action_array.RemoveItem(action);
9169 }
9170 }
9171
9172
9173
9175 {
9176 ActionOverrideData overrideData = new ActionOverrideData();
9180
9182 if (!actionMap)
9183 {
9186 }
9187
9188 actionMap.Insert(this.
Type(), overrideData);
9189
9190 }
9191
9193
9195
9196
9198 {
9201
9204
9205 string config_to_search = "CfgVehicles";
9206 string muzzle_owner_config;
9207
9209 {
9210 if (IsInherited(Weapon))
9211 config_to_search = "CfgWeapons";
9212
9213 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9214
9215 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9216
9218
9219 if (config_OnFire_subclass_count > 0)
9220 {
9221 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9222
9223 for (int i = 0; i < config_OnFire_subclass_count; i++)
9224 {
9225 string particle_class = "";
9227 string config_OnFire_entry = config_OnFire_class + particle_class;
9228 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9229 WPOF_array.Insert(WPOF);
9230 }
9231
9232
9234 }
9235 }
9236
9238 {
9239 config_to_search = "CfgWeapons";
9240 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9241
9242 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9243
9245
9246 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9247 {
9248 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9249
9250 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9251 {
9252 string particle_class2 = "";
9254 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9255 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9256 WPOBE_array.Insert(WPOBE);
9257 }
9258
9259
9261 }
9262 }
9263 }
9264
9265
9267 {
9270
9272 {
9273 string config_to_search = "CfgVehicles";
9274
9275 if (IsInherited(Weapon))
9276 config_to_search = "CfgWeapons";
9277
9278 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9279 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9280
9281 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9282 {
9283
9285
9287 {
9289 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9291 return;
9292 }
9293
9296
9297
9298
9300 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9301
9302 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9303 {
9304 string particle_class = "";
9306 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9308
9309 if (entry_type == CT_CLASS)
9310 {
9311 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9312 WPOOH_array.Insert(WPOF);
9313 }
9314 }
9315
9316
9318 }
9319 }
9320 }
9321
9323 {
9325 }
9326
9328 {
9330 {
9332
9335
9338
9339 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9340 }
9341 }
9342
9344 {
9346 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9347
9349 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9350
9352 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9353
9355 {
9357 }
9358 }
9359
9361 {
9363 }
9364
9366 {
9369 else
9371
9373 {
9376 }
9377 else
9378 {
9381
9384 }
9385
9387 }
9388
9390 {
9392 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9393 }
9394
9396 {
9398 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9400 }
9401
9403 {
9405 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9406 }
9407
9409 {
9412
9413 OverheatingParticle OP = new OverheatingParticle();
9418
9420 }
9421
9423 {
9426
9427 return -1;
9428 }
9429
9431 {
9433 {
9436
9437 for (int i = count; i > 0; --i)
9438 {
9439 int id = i - 1;
9442
9445
9446 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9447 {
9448 if (p)
9449 {
9452 }
9453 }
9454 }
9455 }
9456 }
9457
9459 {
9461 {
9463 {
9464 int id = i - 1;
9466
9467 if (OP)
9468 {
9470
9471 if (p)
9472 {
9474 }
9475
9476 delete OP;
9477 }
9478 }
9479
9482 }
9483 }
9484
9487 {
9488 return 0.0;
9489 }
9490
9491
9493 {
9494 return 250;
9495 }
9496
9498 {
9499 return 0;
9500 }
9501
9504 {
9506 return true;
9507
9508 return false;
9509 }
9510
9513 {
9516
9518 {
9520 }
9521 else
9522 {
9523
9525 }
9526
9528 }
9529
9536 {
9537 return -1;
9538 }
9539
9540
9541
9542
9544 {
9546 {
9548 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9549
9550 if (r_index >= 0)
9551 {
9552 InventoryLocation r_il = new InventoryLocation;
9553 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9554
9555 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9558 {
9559 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9560 }
9562 {
9563 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9564 }
9565
9566 }
9567
9568 player.GetHumanInventory().ClearUserReservedLocation(this);
9569 }
9570
9573 }
9574
9575
9576
9577
9579 {
9580 return ItemBase.m_DebugActionsMask;
9581 }
9582
9584 {
9585 return ItemBase.m_DebugActionsMask & mask;
9586 }
9587
9589 {
9590 ItemBase.m_DebugActionsMask = mask;
9591 }
9592
9594 {
9595 ItemBase.m_DebugActionsMask |= mask;
9596 }
9597
9599 {
9600 ItemBase.m_DebugActionsMask &= ~mask;
9601 }
9602
9604 {
9606 {
9608 }
9609 else
9610 {
9612 }
9613 }
9614
9615
9617 {
9618 if (GetEconomyProfile())
9619 {
9620 float q_max = GetEconomyProfile().GetQuantityMax();
9621 if (q_max > 0)
9622 {
9623 float q_min = GetEconomyProfile().GetQuantityMin();
9624 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9625
9627 {
9628 ComponentEnergyManager comp = GetCompEM();
9630 {
9632 }
9633 }
9635 {
9637
9638 }
9639
9640 }
9641 }
9642 }
9643
9646 {
9647 EntityAI parent = GetHierarchyParent();
9648
9649 if (parent)
9650 {
9651 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9652 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9653 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9654 }
9655 }
9656
9659 {
9660 EntityAI parent = GetHierarchyParent();
9661
9662 if (parent)
9663 {
9664 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9665 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9666 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9667 }
9668 }
9669
9671 {
9672
9673
9674
9675
9677
9679 {
9680 if (ScriptInputUserData.CanStoreInputUserData())
9681 {
9682 ScriptInputUserData ctx = new ScriptInputUserData;
9688 ctx.
Write(use_stack_max);
9691
9693 {
9694 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9695 }
9696 }
9697 }
9698 else if (!
GetGame().IsMultiplayer())
9699 {
9701 }
9702 }
9703
9705 {
9707 }
9708
9710 {
9712 }
9713
9715 {
9717 }
9718
9720 {
9721
9722 return false;
9723 }
9724
9726 {
9727 return false;
9728 }
9729
9733 {
9734 return false;
9735 }
9736
9738 {
9739 return "";
9740 }
9741
9743
9745 {
9746 return false;
9747 }
9748
9750 {
9751 return true;
9752 }
9753
9754
9755
9757 {
9758 return true;
9759 }
9760
9762 {
9763 return true;
9764 }
9765
9767 {
9768 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9770 }
9771
9773 {
9775 }
9776
9778 {
9780 if (!is_being_placed)
9782 SetSynchDirty();
9783 }
9784
9785
9787
9789 {
9791 }
9792
9794 {
9796 }
9797
9799 {
9800 return 1;
9801 }
9802
9804 {
9805 return false;
9806 }
9807
9809 {
9811 SetSynchDirty();
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
9845
9846
9847
9849 {
9850 super.OnMovedInsideCargo(container);
9851
9852 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9853 }
9854
9855 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9856 {
9857 super.EEItemLocationChanged(oldLoc,newLoc);
9858
9859 PlayerBase new_player = null;
9860 PlayerBase old_player = null;
9861
9862 if (newLoc.GetParent())
9863 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9864
9865 if (oldLoc.GetParent())
9866 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9867
9869 {
9870 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9871
9872 if (r_index >= 0)
9873 {
9874 InventoryLocation r_il = new InventoryLocation;
9875 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9876
9877 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9880 {
9881 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9882 }
9884 {
9885 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9886 }
9887
9888 }
9889 }
9890
9892 {
9893 if (new_player)
9894 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9895
9896 if (new_player == old_player)
9897 {
9898
9899 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9900 {
9902 {
9903 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9904 {
9905 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9906 }
9907 }
9908 else
9909 {
9910 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9911 }
9912 }
9913
9914 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9915 {
9916 int type = oldLoc.GetType();
9918 {
9919 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9920 }
9922 {
9923 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9924 }
9925 }
9926 if (!m_OldLocation)
9927 {
9928 m_OldLocation = new InventoryLocation;
9929 }
9930 m_OldLocation.Copy(oldLoc);
9931 }
9932 else
9933 {
9934 if (m_OldLocation)
9935 {
9936 m_OldLocation.Reset();
9937 }
9938 }
9939
9941 }
9942 else
9943 {
9944 if (new_player)
9945 {
9946 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9947 if (res_index >= 0)
9948 {
9949 InventoryLocation il = new InventoryLocation;
9950 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9952 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9955 {
9956 il.
GetParent().GetOnReleaseLock().Invoke(it);
9957 }
9959 {
9961 }
9962
9963 }
9964 }
9966 {
9967
9969 }
9970
9971 if (m_OldLocation)
9972 {
9973 m_OldLocation.Reset();
9974 }
9975 }
9976 }
9977
9978 override void EOnContact(IEntity other, Contact extra)
9979 {
9981 {
9982 int liquidType = -1;
9984 if (impactSpeed > 0.0)
9985 {
9987 #ifndef SERVER
9989 #else
9991 SetSynchDirty();
9992 #endif
9994 }
9995 }
9996
9997 #ifdef SERVER
9998 if (GetCompEM() && GetCompEM().IsPlugged())
9999 {
10000 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10001 GetCompEM().UnplugThis();
10002 }
10003 #endif
10004 }
10005
10007
10009 {
10011 }
10012
10014 {
10015
10016 }
10017
10019 {
10020 super.OnItemLocationChanged(old_owner, new_owner);
10021
10022 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10023 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10024
10025 if (!relatedPlayer && playerNew)
10026 relatedPlayer = playerNew;
10027
10028 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10029 {
10031 if (actionMgr)
10032 {
10033 ActionBase currentAction = actionMgr.GetRunningAction();
10034 if (currentAction)
10036 }
10037 }
10038
10039 Man ownerPlayerOld = null;
10040 Man ownerPlayerNew = null;
10041
10042 if (old_owner)
10043 {
10044 if (old_owner.
IsMan())
10045 {
10046 ownerPlayerOld = Man.Cast(old_owner);
10047 }
10048 else
10049 {
10050 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10051 }
10052 }
10053 else
10054 {
10056 {
10058
10059 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10060 {
10061 GetCompEM().UnplugThis();
10062 }
10063 }
10064 }
10065
10066 if (new_owner)
10067 {
10068 if (new_owner.
IsMan())
10069 {
10070 ownerPlayerNew = Man.Cast(new_owner);
10071 }
10072 else
10073 {
10074 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10075 }
10076 }
10077
10078 if (ownerPlayerOld != ownerPlayerNew)
10079 {
10080 if (ownerPlayerOld)
10081 {
10082 array<EntityAI> subItemsExit = new array<EntityAI>;
10084 for (int i = 0; i < subItemsExit.Count(); i++)
10085 {
10088 }
10089 }
10090
10091 if (ownerPlayerNew)
10092 {
10093 array<EntityAI> subItemsEnter = new array<EntityAI>;
10095 for (int j = 0; j < subItemsEnter.Count(); j++)
10096 {
10099 }
10100 }
10101 }
10102 else if (ownerPlayerNew != null)
10103 {
10104 PlayerBase nplayer;
10105 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10106 {
10107 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10109 for (int k = 0; k < subItemsUpdate.Count(); k++)
10110 {
10112 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10113 }
10114 }
10115 }
10116
10117 if (old_owner)
10118 old_owner.OnChildItemRemoved(this);
10119 if (new_owner)
10120 new_owner.OnChildItemReceived(this);
10121 }
10122
10123
10125 {
10126 super.EEDelete(parent);
10127 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10128 if (player)
10129 {
10131
10132 if (player.IsAlive())
10133 {
10134 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10135 if (r_index >= 0)
10136 {
10137 InventoryLocation r_il = new InventoryLocation;
10138 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10139
10140 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10143 {
10144 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10145 }
10147 {
10148 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10149 }
10150
10151 }
10152
10153 player.RemoveQuickBarEntityShortcut(this);
10154 }
10155 }
10156 }
10157
10159 {
10160 super.EEKilled(killer);
10161
10164 {
10165 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10166 {
10167 if (IsMagazine())
10168 {
10169 if (Magazine.Cast(this).GetAmmoCount() > 0)
10170 {
10172 }
10173 }
10174 else
10175 {
10177 }
10178 }
10179 }
10180 }
10181
10183 {
10184 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10185
10186 super.OnWasAttached(parent, slot_id);
10187
10190
10192 }
10193
10195 {
10196 super.OnWasDetached(parent, slot_id);
10197
10200 }
10201
10203 {
10204 int idx;
10207
10208 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10209 if (inventory_slots.Count() < 1)
10210 {
10211 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10212 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10213 }
10214 else
10215 {
10216 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10217 }
10218
10219 idx = inventory_slots.Find(slot);
10220 if (idx < 0)
10221 return "";
10222
10223 return attach_types.Get(idx);
10224 }
10225
10227 {
10228 int idx = -1;
10229 string slot;
10230
10233
10234 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10235 if (inventory_slots.Count() < 1)
10236 {
10237 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10238 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10239 }
10240 else
10241 {
10242 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10243 if (detach_types.Count() < 1)
10244 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10245 }
10246
10247 for (int i = 0; i < inventory_slots.Count(); i++)
10248 {
10249 slot = inventory_slots.Get(i);
10250 }
10251
10252 if (slot != "")
10253 {
10254 if (detach_types.Count() == 1)
10255 idx = 0;
10256 else
10257 idx = inventory_slots.Find(slot);
10258 }
10259 if (idx < 0)
10260 return "";
10261
10262 return detach_types.Get(idx);
10263 }
10264
10266 {
10267
10269
10270
10271 float min_time = 1;
10272 float max_time = 3;
10273 float delay = Math.RandomFloat(min_time, max_time);
10274
10275 explode_timer.Run(delay, this, "DoAmmoExplosion");
10276 }
10277
10279 {
10280 Magazine magazine = Magazine.Cast(this);
10281 int pop_sounds_count = 6;
10282 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10283
10284
10285 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10286 string sound_name = pop_sounds[ sound_idx ];
10288
10289
10290 magazine.ServerAddAmmoCount(-1);
10291
10292
10293 float min_temp_to_explode = 100;
10294
10295 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10296 {
10298 }
10299 }
10300
10301
10302 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10303 {
10304 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10305
10306 const int CHANCE_DAMAGE_CARGO = 4;
10307 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10308 const int CHANCE_DAMAGE_NOTHING = 2;
10309
10311 {
10312 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10313 int chances;
10314 int rnd;
10315
10316 if (GetInventory().GetCargo())
10317 {
10318 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10319 rnd = Math.RandomInt(0,chances);
10320
10321 if (rnd < CHANCE_DAMAGE_CARGO)
10322 {
10324 }
10325 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10326 {
10328 }
10329 }
10330 else
10331 {
10332 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10333 rnd = Math.RandomInt(0,chances);
10334
10335 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10336 {
10338 }
10339 }
10340 }
10341 }
10342
10344 {
10345 if (GetInventory().GetCargo())
10346 {
10347 int item_count = GetInventory().GetCargo().GetItemCount();
10348 if (item_count > 0)
10349 {
10350 int random_pick = Math.RandomInt(0, item_count);
10352 if (!item.IsExplosive())
10353 {
10354 item.AddHealth("","",damage);
10355 return true;
10356 }
10357 }
10358 }
10359 return false;
10360 }
10361
10363 {
10364 int attachment_count = GetInventory().AttachmentCount();
10365 if (attachment_count > 0)
10366 {
10367 int random_pick = Math.RandomInt(0, attachment_count);
10368 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10369 if (!attachment.IsExplosive())
10370 {
10371 attachment.AddHealth("","",damage);
10372 return true;
10373 }
10374 }
10375 return false;
10376 }
10377
10379 {
10381 }
10382
10384 {
10386 return GetInventory().CanRemoveEntity();
10387
10388 return false;
10389 }
10390
10392 {
10393
10395 return false;
10396
10397
10399 return false;
10400
10401
10402
10404 if (delta == 0)
10405 return false;
10406
10407
10408 return true;
10409 }
10410
10412 {
10414 {
10415 if (ScriptInputUserData.CanStoreInputUserData())
10416 {
10417 ScriptInputUserData ctx = new ScriptInputUserData;
10422 ctx.
Write(destination_entity);
10424 ctx.
Write(slot_id);
10426 }
10427 }
10428 else if (!
GetGame().IsMultiplayer())
10429 {
10431 }
10432 }
10433
10435 {
10436 float split_quantity_new;
10440 InventoryLocation loc = new InventoryLocation;
10441
10442 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10443 {
10445 split_quantity_new = stack_max;
10446 else
10448
10450 {
10451 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10452 if (new_item)
10453 {
10454 new_item.SetResultOfSplit(true);
10455 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10457 new_item.
SetQuantity(split_quantity_new,
false,
true);
10458 }
10459 }
10460 }
10461 else if (destination_entity && slot_id == -1)
10462 {
10463 if (quantity > stack_max)
10464 split_quantity_new = stack_max;
10465 else
10466 split_quantity_new = quantity;
10467
10469 {
10471 {
10474 }
10475
10476 if (new_item)
10477 {
10478 new_item.SetResultOfSplit(true);
10479 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10481 new_item.
SetQuantity(split_quantity_new,
false,
true);
10482 }
10483 }
10484 }
10485 else
10486 {
10487 if (stack_max != 0)
10488 {
10490 {
10492 }
10493
10494 if (split_quantity_new == 0)
10495 {
10496 if (!
GetGame().IsMultiplayer())
10497 player.PhysicalPredictiveDropItem(this);
10498 else
10499 player.ServerDropEntity(this);
10500 return;
10501 }
10502
10504 {
10506
10507 if (new_item)
10508 {
10509 new_item.SetResultOfSplit(true);
10510 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10513 new_item.PlaceOnSurface();
10514 }
10515 }
10516 }
10517 }
10518 }
10519
10521 {
10522 float split_quantity_new;
10526 InventoryLocation loc = new InventoryLocation;
10527
10528 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10529 {
10531 split_quantity_new = stack_max;
10532 else
10534
10536 {
10537 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10538 if (new_item)
10539 {
10540 new_item.SetResultOfSplit(true);
10541 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10543 new_item.
SetQuantity(split_quantity_new,
false,
true);
10544 }
10545 }
10546 }
10547 else if (destination_entity && slot_id == -1)
10548 {
10549 if (quantity > stack_max)
10550 split_quantity_new = stack_max;
10551 else
10552 split_quantity_new = quantity;
10553
10555 {
10557 {
10560 }
10561
10562 if (new_item)
10563 {
10564 new_item.SetResultOfSplit(true);
10565 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10567 new_item.
SetQuantity(split_quantity_new,
false,
true);
10568 }
10569 }
10570 }
10571 else
10572 {
10573 if (stack_max != 0)
10574 {
10576 {
10578 }
10579
10581 {
10583
10584 if (new_item)
10585 {
10586 new_item.SetResultOfSplit(true);
10587 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10590 new_item.PlaceOnSurface();
10591 }
10592 }
10593 }
10594 }
10595 }
10596
10598 {
10600 {
10601 if (ScriptInputUserData.CanStoreInputUserData())
10602 {
10603 ScriptInputUserData ctx = new ScriptInputUserData;
10608 dst.WriteToContext(ctx);
10610 }
10611 }
10612 else if (!
GetGame().IsMultiplayer())
10613 {
10615 }
10616 }
10617
10619 {
10621 {
10622 if (ScriptInputUserData.CanStoreInputUserData())
10623 {
10624 ScriptInputUserData ctx = new ScriptInputUserData;
10629 ctx.
Write(destination_entity);
10635 }
10636 }
10637 else if (!
GetGame().IsMultiplayer())
10638 {
10640 }
10641 }
10642
10644 {
10646 }
10647
10649 {
10651 float split_quantity_new;
10653 if (dst.IsValid())
10654 {
10655 int slot_id = dst.GetSlot();
10657
10658 if (quantity > stack_max)
10659 split_quantity_new = stack_max;
10660 else
10661 split_quantity_new = quantity;
10662
10664 {
10666
10667 if (new_item)
10668 {
10669 new_item.SetResultOfSplit(true);
10670 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10672 new_item.
SetQuantity(split_quantity_new,
false,
true);
10673 }
10674
10675 return new_item;
10676 }
10677 }
10678
10679 return null;
10680 }
10681
10683 {
10685 float split_quantity_new;
10687 if (destination_entity)
10688 {
10690 if (quantity > stackable)
10691 split_quantity_new = stackable;
10692 else
10693 split_quantity_new = quantity;
10694
10696 {
10697 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10698 if (new_item)
10699 {
10700 new_item.SetResultOfSplit(true);
10701 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10703 new_item.
SetQuantity(split_quantity_new,
false,
true);
10704 }
10705 }
10706 }
10707 }
10708
10710 {
10712 {
10713 if (ScriptInputUserData.CanStoreInputUserData())
10714 {
10715 ScriptInputUserData ctx = new ScriptInputUserData;
10720 ItemBase destination_entity =
this;
10721 ctx.
Write(destination_entity);
10725 }
10726 }
10727 else if (!
GetGame().IsMultiplayer())
10728 {
10730 }
10731 }
10732
10734 {
10736 float split_quantity_new;
10738 if (player)
10739 {
10741 if (quantity > stackable)
10742 split_quantity_new = stackable;
10743 else
10744 split_quantity_new = quantity;
10745
10747 {
10748 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10749 new_item =
ItemBase.Cast(in_hands);
10750 if (new_item)
10751 {
10752 new_item.SetResultOfSplit(true);
10753 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10755 new_item.SetQuantity(split_quantity_new, false, true);
10756 }
10757 }
10758 }
10759 }
10760
10762 {
10764 float split_quantity_new = Math.Floor(quantity * 0.5);
10765
10767 return;
10768
10770
10771 if (new_item)
10772 {
10773 if (new_item.GetQuantityMax() < split_quantity_new)
10774 {
10775 split_quantity_new = new_item.GetQuantityMax();
10776 }
10777
10778 new_item.SetResultOfSplit(true);
10779 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10780
10782 {
10785 }
10786 else
10787 {
10789 new_item.
SetQuantity(split_quantity_new,
false,
true);
10790 }
10791 }
10792 }
10793
10795 {
10797 float split_quantity_new = Math.Floor(quantity / 2);
10798
10800 return;
10801
10802 InventoryLocation invloc = new InventoryLocation;
10804
10806 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10807
10808 if (new_item)
10809 {
10810 if (new_item.GetQuantityMax() < split_quantity_new)
10811 {
10812 split_quantity_new = new_item.GetQuantityMax();
10813 }
10815 {
10818 }
10819 else if (split_quantity_new > 1)
10820 {
10822 new_item.
SetQuantity(split_quantity_new,
false,
true);
10823 }
10824 }
10825 }
10826
10829 {
10830 SetWeightDirty();
10832
10833 if (parent)
10834 parent.OnAttachmentQuantityChangedEx(this, delta);
10835
10837 {
10839 {
10841 }
10843 {
10844 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10846 }
10847 }
10848
10849 }
10850
10853 {
10854
10855 }
10856
10859 {
10861 }
10862
10864 {
10865 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10866
10868 {
10869 if (newLevel == GameConstants.STATE_RUINED)
10870 {
10872 EntityAI parent = GetHierarchyParent();
10873 if (parent && parent.IsFireplace())
10874 {
10875 CargoBase cargo = GetInventory().GetCargo();
10876 if (cargo)
10877 {
10879 {
10881 }
10882 }
10883 }
10884 }
10885
10887 {
10888
10890 return;
10891 }
10892
10893 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10894 {
10896 }
10897 }
10898 }
10899
10900
10902 {
10903 super.OnRightClick();
10904
10906 {
10908 {
10909 if (ScriptInputUserData.CanStoreInputUserData())
10910 {
10911 EntityAI root = GetHierarchyRoot();
10912 Man playerOwner = GetHierarchyRootPlayer();
10913 InventoryLocation dst = new InventoryLocation;
10914
10915
10916 if (!playerOwner && root && root == this)
10917 {
10919 }
10920 else
10921 {
10922
10923 GetInventory().GetCurrentInventoryLocation(dst);
10925 {
10928 {
10930 }
10931 else
10932 {
10934
10935
10936 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10937 {
10939 }
10940 else
10941 {
10942 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10943 }
10944 }
10945 }
10946 }
10947
10948 ScriptInputUserData ctx = new ScriptInputUserData;
10956 }
10957 }
10958 else if (!
GetGame().IsMultiplayer())
10959 {
10961 }
10962 }
10963 }
10964
10966 {
10967 if (root)
10968 {
10969 vector m4[4];
10970 root.GetTransform(m4);
10971 dst.SetGround(this, m4);
10972 }
10973 else
10974 {
10975 GetInventory().GetCurrentInventoryLocation(dst);
10976 }
10977 }
10978
10979 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10980 {
10981
10982 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10983 return false;
10984
10985 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10986 return false;
10987
10988
10990 return false;
10991
10992
10993 Magazine mag = Magazine.Cast(this);
10994 if (mag)
10995 {
10996 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10997 return false;
10998
10999 if (stack_max_limit)
11000 {
11001 Magazine other_mag = Magazine.Cast(other_item);
11002 if (other_item)
11003 {
11004 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11005 return false;
11006 }
11007
11008 }
11009 }
11010 else
11011 {
11012
11014 return false;
11015
11017 return false;
11018 }
11019
11020 PlayerBase player = null;
11021 if (CastTo(player, GetHierarchyRootPlayer()))
11022 {
11023 if (player.GetInventory().HasAttachment(this))
11024 return false;
11025
11026 if (player.IsItemsToDelete())
11027 return false;
11028 }
11029
11030 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11031 return false;
11032
11033 int slotID;
11035 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11036 return false;
11037
11038 return true;
11039 }
11040
11042 {
11044 }
11045
11047 {
11048 return m_IsResultOfSplit;
11049 }
11050
11052 {
11053 m_IsResultOfSplit = value;
11054 }
11055
11057 {
11059 }
11060
11062 {
11063 float other_item_quantity = other_item.GetQuantity();
11064 float this_free_space;
11065
11067
11069
11070 if (other_item_quantity > this_free_space)
11071 {
11072 return this_free_space;
11073 }
11074 else
11075 {
11076 return other_item_quantity;
11077 }
11078 }
11079
11081 {
11083 }
11084
11086 {
11088 return;
11089
11090 if (!IsMagazine() && other_item)
11091 {
11093 if (quantity_used != 0)
11094 {
11095 float hp1 = GetHealth01("","");
11096 float hp2 = other_item.GetHealth01("","");
11097 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11098 hpResult = hpResult / (
GetQuantity() + quantity_used);
11099
11100 hpResult *= GetMaxHealth();
11101 Math.Round(hpResult);
11102 SetHealth("", "Health", hpResult);
11103
11105 other_item.AddQuantity(-quantity_used);
11106 }
11107 }
11109 }
11110
11112 {
11113 #ifdef SERVER
11114 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11115 GetHierarchyParent().IncreaseLifetimeUp();
11116 #endif
11117 };
11118
11120 {
11121 PlayerBase p = PlayerBase.Cast(player);
11122
11123 array<int> recipesIds = p.m_Recipes;
11124 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11125 if (moduleRecipesManager)
11126 {
11127 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11128 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11129 }
11130
11131 for (int i = 0;i < recipesIds.Count(); i++)
11132 {
11133 int key = recipesIds.Get(i);
11134 string recipeName = moduleRecipesManager.GetRecipeName(key);
11136 }
11137 }
11138
11139
11140 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11141 {
11142 super.GetDebugActions(outputList);
11143
11144
11150
11151
11156
11161
11162
11166
11167
11169 {
11173 }
11174
11177
11178
11182
11184
11185 InventoryLocation loc = new InventoryLocation();
11186 GetInventory().GetCurrentInventoryLocation(loc);
11188 {
11189 if (Gizmo_IsSupported())
11192 }
11193
11195 }
11196
11197
11198
11199
11201 {
11202 super.OnAction(action_id, player, ctx);
11203
11205 {
11206 switch (action_id)
11207 {
11210 return true;
11213 return true;
11214 }
11215 }
11216
11218 {
11219 switch (action_id)
11220 {
11222 Delete();
11223 return true;
11224 }
11225 }
11226
11227 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11228 {
11229 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11230 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11231 PlayerBase p = PlayerBase.Cast(player);
11232 if (
EActions.RECIPES_RANGE_START < 1000)
11233 {
11234 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11235 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11236 }
11237 }
11238 #ifndef SERVER
11239 else if (action_id ==
EActions.WATCH_PLAYER)
11240 {
11241 PluginDeveloper.SetDeveloperItemClientEx(player);
11242 }
11243 #endif
11245 {
11246 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11247 {
11248 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11249 OnDebugButtonPressServer(id + 1);
11250 }
11251
11252 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11253 {
11254 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11256 }
11257
11258 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11259 {
11260 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11262 }
11263
11264 else if (action_id ==
EActions.ADD_QUANTITY)
11265 {
11266 if (IsMagazine())
11267 {
11268 Magazine mag = Magazine.Cast(this);
11269 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11270 }
11271 else
11272 {
11274 }
11275
11276 if (m_EM)
11277 {
11278 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11279 }
11280
11281 }
11282
11283 else if (action_id ==
EActions.REMOVE_QUANTITY)
11284 {
11285 if (IsMagazine())
11286 {
11287 Magazine mag2 = Magazine.Cast(this);
11288 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11289 }
11290 else
11291 {
11293 }
11294 if (m_EM)
11295 {
11296 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11297 }
11298
11299 }
11300
11301 else if (action_id ==
EActions.SET_QUANTITY_0)
11302 {
11304
11305 if (m_EM)
11306 {
11307 m_EM.SetEnergy(0);
11308 }
11309 }
11310
11311 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11312 {
11314
11315 if (m_EM)
11316 {
11317 m_EM.SetEnergy(m_EM.GetEnergyMax());
11318 }
11319 }
11320
11321 else if (action_id ==
EActions.ADD_HEALTH)
11322 {
11323 AddHealth("","",GetMaxHealth("","Health")/5);
11324 }
11325 else if (action_id ==
EActions.REMOVE_HEALTH)
11326 {
11327 AddHealth("","",-GetMaxHealth("","Health")/5);
11328 }
11329 else if (action_id ==
EActions.DESTROY_HEALTH)
11330 {
11331 SetHealth01("","",0);
11332 }
11333 else if (action_id ==
EActions.WATCH_ITEM)
11334 {
11336 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11337 #ifdef DEVELOPER
11338 SetDebugDeveloper_item(this);
11339 #endif
11340 }
11341
11342 else if (action_id ==
EActions.ADD_TEMPERATURE)
11343 {
11344 AddTemperature(20);
11345
11346 }
11347
11348 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11349 {
11350 AddTemperature(-20);
11351
11352 }
11353
11354 else if (action_id ==
EActions.FLIP_FROZEN)
11355 {
11356 SetFrozen(!GetIsFrozen());
11357
11358 }
11359
11360 else if (action_id ==
EActions.ADD_WETNESS)
11361 {
11363
11364 }
11365
11366 else if (action_id ==
EActions.REMOVE_WETNESS)
11367 {
11369
11370 }
11371
11372 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11373 {
11376
11377
11378 }
11379
11380 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11381 {
11384 }
11385
11386 else if (action_id ==
EActions.MAKE_SPECIAL)
11387 {
11388 auto debugParams = DebugSpawnParams.WithPlayer(player);
11389 OnDebugSpawnEx(debugParams);
11390 }
11391
11392 }
11393
11394
11395 return false;
11396 }
11397
11398
11399
11400
11404
11407
11408
11409
11411 {
11412 return false;
11413 }
11414
11415
11417 {
11418 return true;
11419 }
11420
11421
11423 {
11424 return true;
11425 }
11426
11427
11428
11430 {
11431 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11433 }
11434
11437 {
11438 return null;
11439 }
11440
11442 {
11443 return false;
11444 }
11445
11447 {
11448 return false;
11449 }
11450
11454
11455
11457 {
11458 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11459 return module_repairing.CanRepair(this, item_repair_kit);
11460 }
11461
11462
11463 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11464 {
11465 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11466 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11467 }
11468
11469
11471 {
11472
11473
11474
11475
11476
11477
11478
11479
11480 return 1;
11481 }
11482
11483
11484
11486 {
11488 }
11489
11490
11491
11493 {
11495 }
11496
11497
11506 {
11507 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11508
11509 if (player)
11510 {
11511 player.MessageStatus(text);
11512 }
11513 }
11514
11515
11524 {
11525 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11526
11527 if (player)
11528 {
11529 player.MessageAction(text);
11530 }
11531 }
11532
11533
11542 {
11543 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11544
11545 if (player)
11546 {
11547 player.MessageFriendly(text);
11548 }
11549 }
11550
11551
11560 {
11561 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11562
11563 if (player)
11564 {
11565 player.MessageImportant(text);
11566 }
11567 }
11568
11570 {
11571 return true;
11572 }
11573
11574
11575 override bool KindOf(
string tag)
11576 {
11577 bool found = false;
11578 string item_name = this.
GetType();
11581
11582 int array_size = item_tag_array.Count();
11583 for (int i = 0; i < array_size; i++)
11584 {
11585 if (item_tag_array.Get(i) == tag)
11586 {
11587 found = true;
11588 break;
11589 }
11590 }
11591 return found;
11592 }
11593
11594
11596 {
11597
11598 super.OnRPC(sender, rpc_type,ctx);
11599
11600
11601 switch (rpc_type)
11602 {
11603 #ifndef SERVER
11604 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11605 Param2<bool, string> p = new Param2<bool, string>(false, "");
11606
11608 return;
11609
11610 bool play = p.param1;
11611 string soundSet = p.param2;
11612
11613 if (play)
11614 {
11616 {
11618 {
11620 }
11621 }
11622 else
11623 {
11625 }
11626 }
11627 else
11628 {
11630 }
11631
11632 break;
11633 #endif
11634
11635 }
11636
11638 {
11640 }
11641 }
11642
11643
11644
11645
11647 {
11648 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11649 return plugin.GetID(
name);
11650 }
11651
11653 {
11654 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11655 return plugin.GetName(id);
11656 }
11657
11660 {
11661
11662
11663 int varFlags;
11664 if (!ctx.
Read(varFlags))
11665 return;
11666
11667 if (varFlags & ItemVariableFlags.FLOAT)
11668 {
11670 }
11671 }
11672
11674 {
11675
11676 super.SerializeNumericalVars(floats_out);
11677
11678
11679
11681 {
11683 }
11684
11686 {
11688 }
11689
11691 {
11693 }
11694
11696 {
11701 }
11702
11704 {
11706 }
11707 }
11708
11710 {
11711
11712 super.DeSerializeNumericalVars(floats);
11713
11714
11715 int index = 0;
11716 int mask = Math.Round(floats.Get(index));
11717
11718 index++;
11719
11721 {
11723 {
11725 }
11726 else
11727 {
11728 float quantity = floats.Get(index);
11729 SetQuantity(quantity,
true,
false,
false,
false);
11730 }
11731 index++;
11732 }
11733
11735 {
11736 float wet = floats.Get(index);
11738 index++;
11739 }
11740
11742 {
11743 int liquidtype = Math.Round(floats.Get(index));
11745 index++;
11746 }
11747
11749 {
11751 index++;
11753 index++;
11755 index++;
11757 index++;
11758 }
11759
11761 {
11762 int cleanness = Math.Round(floats.Get(index));
11764 index++;
11765 }
11766 }
11767
11769 {
11770 super.WriteVarsToCTX(ctx);
11771
11772
11774 {
11776 }
11777
11779 {
11781 }
11782
11784 {
11786 }
11787
11789 {
11790 int r,g,b,a;
11796 }
11797
11799 {
11801 }
11802 }
11803
11805 {
11806 if (!super.ReadVarsFromCTX(ctx,version))
11807 return false;
11808
11809 int intValue;
11810 float value;
11811
11812 if (version < 140)
11813 {
11814 if (!ctx.
Read(intValue))
11815 return false;
11816
11817 m_VariablesMask = intValue;
11818 }
11819
11821 {
11822 if (!ctx.
Read(value))
11823 return false;
11824
11826 {
11828 }
11829 else
11830 {
11832 }
11833 }
11834
11835 if (version < 140)
11836 {
11838 {
11839 if (!ctx.
Read(value))
11840 return false;
11841 SetTemperatureDirect(value);
11842 }
11843 }
11844
11846 {
11847 if (!ctx.
Read(value))
11848 return false;
11850 }
11851
11853 {
11854 if (!ctx.
Read(intValue))
11855 return false;
11857 }
11858
11860 {
11861 int r,g,b,a;
11863 return false;
11865 return false;
11867 return false;
11869 return false;
11870
11872 }
11873
11875 {
11876 if (!ctx.
Read(intValue))
11877 return false;
11879 }
11880
11881 if (version >= 138 && version < 140)
11882 {
11884 {
11885 if (!ctx.
Read(intValue))
11886 return false;
11887 SetFrozen(intValue);
11888 }
11889 }
11890
11891 return true;
11892 }
11893
11894
11896 {
11899 {
11901 }
11902
11903 if (!super.OnStoreLoad(ctx, version))
11904 {
11906 return false;
11907 }
11908
11909 if (version >= 114)
11910 {
11911 bool hasQuickBarIndexSaved;
11912
11913 if (!ctx.
Read(hasQuickBarIndexSaved))
11914 {
11916 return false;
11917 }
11918
11919 if (hasQuickBarIndexSaved)
11920 {
11921 int itmQBIndex;
11922
11923
11924 if (!ctx.
Read(itmQBIndex))
11925 {
11927 return false;
11928 }
11929
11930 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11931 if (itmQBIndex != -1 && parentPlayer)
11932 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11933 }
11934 }
11935 else
11936 {
11937
11938 PlayerBase player;
11939 int itemQBIndex;
11940 if (version ==
int.
MAX)
11941 {
11942 if (!ctx.
Read(itemQBIndex))
11943 {
11945 return false;
11946 }
11947 }
11948 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11949 {
11950
11951 if (!ctx.
Read(itemQBIndex))
11952 {
11954 return false;
11955 }
11956 if (itemQBIndex != -1 && player)
11957 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11958 }
11959 }
11960
11961 if (version < 140)
11962 {
11963
11964 if (!LoadVariables(ctx, version))
11965 {
11967 return false;
11968 }
11969 }
11970
11971
11973 {
11975 return false;
11976 }
11977 if (version >= 132)
11978 {
11980 if (raib)
11981 {
11983 {
11985 return false;
11986 }
11987 }
11988 }
11989
11991 return true;
11992 }
11993
11994
11995
11997 {
11998 super.OnStoreSave(ctx);
11999
12000 PlayerBase player;
12001 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12002 {
12004
12005 int itemQBIndex = -1;
12006 itemQBIndex = player.FindQuickBarEntityIndex(this);
12007 ctx.
Write(itemQBIndex);
12008 }
12009 else
12010 {
12012 }
12013
12015
12017 if (raib)
12018 {
12020 }
12021 }
12022
12023
12025 {
12026 super.AfterStoreLoad();
12027
12029 {
12031 }
12032
12034 {
12037 }
12038 }
12039
12041 {
12042 super.EEOnAfterLoad();
12043
12045 {
12047 }
12048
12051 }
12052
12054 {
12055 return false;
12056 }
12057
12058
12059
12061 {
12063 {
12064 #ifdef PLATFORM_CONSOLE
12065
12067 {
12069 if (menu)
12070 {
12072 }
12073 }
12074 #endif
12075 }
12076
12078 {
12081 }
12082
12084 {
12085 SetWeightDirty();
12087 }
12089 {
12092 }
12093
12095 {
12098 }
12100 {
12103 }
12104
12105 super.OnVariablesSynchronized();
12106 }
12107
12108
12109
12111 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12112 {
12113 if (!IsServerCheck(allow_client))
12114 return false;
12115
12117 return false;
12118
12121
12122 if (value <= (min + 0.001))
12123 value = min;
12124
12125 if (value == min)
12126 {
12127 if (destroy_config)
12128 {
12129 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12130 if (dstr)
12131 {
12133 this.Delete();
12134 return true;
12135 }
12136 }
12137 else if (destroy_forced)
12138 {
12140 this.Delete();
12141 return true;
12142 }
12143
12145 }
12146
12149
12151 {
12153
12154 if (delta)
12156 }
12157
12159
12160 return false;
12161 }
12162
12163
12165 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12166 {
12168 }
12169
12171 {
12174 }
12175
12177 {
12180 }
12181
12183 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12184 {
12185 float value_clamped = Math.Clamp(value, 0, 1);
12187 SetQuantity(result, destroy_config, destroy_forced);
12188 }
12189
12190
12193 {
12195 }
12196
12198 {
12200 }
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12212 {
12213 int slot = -1;
12214 if (GetInventory())
12215 {
12216 InventoryLocation il = new InventoryLocation;
12217 GetInventory().GetCurrentInventoryLocation(il);
12219 }
12220
12222 }
12223
12225 {
12226 float quantity_max = 0;
12227
12229 {
12230 if (attSlotID != -1)
12231 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12232
12233 if (quantity_max <= 0)
12235 }
12236
12237 if (quantity_max <= 0)
12239
12240 return quantity_max;
12241 }
12242
12244 {
12246 }
12247
12249 {
12251 }
12252
12253
12255 {
12257 }
12258
12260 {
12262 }
12263
12265 {
12267 }
12268
12269
12271 {
12272
12273 float weightEx = GetWeightEx();
12274 float special = GetInventoryAndCargoWeight();
12275 return weightEx - special;
12276 }
12277
12278
12280 {
12282 }
12283
12285 {
12287 {
12288 #ifdef DEVELOPER
12289 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12290 {
12291 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12293 }
12294 #endif
12295
12296 return GetQuantity() * GetConfigWeightModified();
12297 }
12298 else if (HasEnergyManager())
12299 {
12300 #ifdef DEVELOPER
12301 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12302 {
12303 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12304 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12305 }
12306 #endif
12307 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12308 }
12309 else
12310 {
12311 #ifdef DEVELOPER
12312 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12313 {
12314 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12315 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12316 }
12317 #endif
12318 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12319 }
12320 }
12321
12324 {
12325 int item_count = 0;
12327
12328 if (GetInventory().GetCargo() != NULL)
12329 {
12330 item_count = GetInventory().GetCargo().GetItemCount();
12331 }
12332
12333 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12334 {
12335 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12336 if (item)
12337 item_count += item.GetNumberOfItems();
12338 }
12339 return item_count;
12340 }
12341
12344 {
12345 float weight = 0;
12346 float wetness = 1;
12347 if (include_wetness)
12350 {
12351 weight = wetness * m_ConfigWeight;
12352 }
12354 {
12355 weight = 1;
12356 }
12357 return weight;
12358 }
12359
12360
12361
12363 {
12364 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12365 {
12366 GameInventory inv = GetInventory();
12367 array<EntityAI> items = new array<EntityAI>;
12369 for (int i = 0; i < items.Count(); i++)
12370 {
12372 if (item)
12373 {
12375 }
12376 }
12377 }
12378 }
12379
12380
12381
12382
12384 {
12385 float energy = 0;
12386 if (HasEnergyManager())
12387 {
12388 energy = GetCompEM().GetEnergy();
12389 }
12390 return energy;
12391 }
12392
12393
12395 {
12396 super.OnEnergyConsumed();
12397
12399 }
12400
12402 {
12403 super.OnEnergyAdded();
12404
12406 }
12407
12408
12410 {
12411 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12412 {
12414 {
12415 float energy_0to1 = GetCompEM().GetEnergy0To1();
12417 }
12418 }
12419 }
12420
12421
12423 {
12424 return ConfigGetFloat("heatIsolation");
12425 }
12426
12428 {
12430 }
12431
12433 {
12434 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12435 if (
GetGame().ConfigIsExisting(paramPath))
12437
12438 return 0.0;
12439 }
12440
12442 {
12443 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12444 if (
GetGame().ConfigIsExisting(paramPath))
12446
12447 return 0.0;
12448 }
12449
12450 override void SetWet(
float value,
bool allow_client =
false)
12451 {
12452 if (!IsServerCheck(allow_client))
12453 return;
12454
12457
12459
12460 m_VarWet = Math.Clamp(value, min, max);
12461
12463 {
12466 }
12467 }
12468
12469 override void AddWet(
float value)
12470 {
12472 }
12473
12475 {
12477 }
12478
12480 {
12482 }
12483
12485 {
12487 }
12488
12490 {
12492 }
12493
12495 {
12497 }
12498
12499 override void OnWetChanged(
float newVal,
float oldVal)
12500 {
12503 if (newLevel != oldLevel)
12504 {
12506 }
12507 }
12508
12510 {
12511 SetWeightDirty();
12512 }
12513
12515 {
12516 return GetWetLevelInternal(
m_VarWet);
12517 }
12518
12519
12520
12522 {
12524 }
12525
12527 {
12529 }
12530
12532 {
12534 }
12535
12537 {
12539 }
12540
12541
12542
12544 {
12545 if (ConfigIsExisting("itemModelLength"))
12546 {
12547 return ConfigGetFloat("itemModelLength");
12548 }
12549 return 0;
12550 }
12551
12553 {
12554 if (ConfigIsExisting("itemAttachOffset"))
12555 {
12556 return ConfigGetFloat("itemAttachOffset");
12557 }
12558 return 0;
12559 }
12560
12561 override void SetCleanness(
int value,
bool allow_client =
false)
12562 {
12563 if (!IsServerCheck(allow_client))
12564 return;
12565
12567
12569
12572 }
12573
12575 {
12577 }
12578
12580 {
12581 return true;
12582 }
12583
12584
12585
12586
12588 {
12590 }
12591
12593 {
12595 }
12596
12597
12598
12599
12600 override void SetColor(
int r,
int g,
int b,
int a)
12601 {
12607 }
12609 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12610 {
12615 }
12616
12618 {
12620 }
12621
12624 {
12625 int r,g,b,a;
12627 r = r/255;
12628 g = g/255;
12629 b = b/255;
12630 a = a/255;
12631 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12632 }
12633
12634
12635
12636 override void SetLiquidType(
int value,
bool allow_client =
false)
12637 {
12638 if (!IsServerCheck(allow_client))
12639 return;
12640
12645 }
12646
12648 {
12649 return ConfigGetInt("varLiquidTypeInit");
12650 }
12651
12653 {
12655 }
12656
12658 {
12660 SetFrozen(false);
12661 }
12662
12665 {
12666 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12667 }
12668
12669
12672 {
12673 PlayerBase nplayer;
12674 if (PlayerBase.CastTo(nplayer, player))
12675 {
12677
12678 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12679 }
12680 }
12681
12682
12685 {
12686 PlayerBase nplayer;
12687 if (PlayerBase.CastTo(nplayer,player))
12688 {
12689
12690 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12691
12692 }
12693
12694
12695 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12696
12697
12698 if (HasEnergyManager())
12699 {
12700 GetCompEM().UpdatePlugState();
12701 }
12702 }
12703
12704
12706 {
12707 super.OnPlacementStarted(player);
12708
12710 }
12711
12712 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12713 {
12715 {
12716 m_AdminLog.OnPlacementComplete(player,
this);
12717 }
12718
12719 super.OnPlacementComplete(player, position, orientation);
12720 }
12721
12722
12723
12724
12725
12727 {
12729 {
12730 return true;
12731 }
12732 else
12733 {
12734 return false;
12735 }
12736 }
12737
12738
12740 {
12742 {
12744 }
12745 }
12746
12747
12749 {
12751 }
12752
12754 {
12756 }
12757
12758 override void InsertAgent(
int agent,
float count = 1)
12759 {
12760 if (count < 1)
12761 return;
12762
12764 }
12765
12768 {
12770 }
12771
12772
12774 {
12776 }
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12820 {
12822 return false;
12823 return true;
12824 }
12825
12827 {
12828
12830 }
12831
12832
12835 {
12836 super.CheckForRoofLimited(timeTresholdMS);
12837
12839 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12840 {
12841 m_PreviousRoofTestTime = time;
12842 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12843 }
12844 }
12845
12846
12848 {
12850 {
12851 return 0;
12852 }
12853
12854 if (GetInventory().GetAttachmentSlotsCount() != 0)
12855 {
12856 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12857 if (filter)
12858 return filter.GetProtectionLevel(type, false, system);
12859 else
12860 return 0;
12861 }
12862
12863 string subclassPath, entryName;
12864
12865 switch (type)
12866 {
12868 entryName = "biological";
12869 break;
12871 entryName = "chemical";
12872 break;
12873 default:
12874 entryName = "biological";
12875 break;
12876 }
12877
12878 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12879
12881 }
12882
12883
12884
12887 {
12888 if (!IsMagazine())
12890
12892 }
12893
12894
12895
12896
12897
12902 {
12903 return true;
12904 }
12905
12907 {
12909 }
12910
12911
12912
12913
12914
12916 {
12917 if (parent)
12918 {
12919 if (parent.IsInherited(DayZInfected))
12920 return true;
12921
12922 if (!parent.IsRuined())
12923 return true;
12924 }
12925
12926 return true;
12927 }
12928
12930 {
12931 if (!super.CanPutAsAttachment(parent))
12932 {
12933 return false;
12934 }
12935
12936 if (!IsRuined() && !parent.IsRuined())
12937 {
12938 return true;
12939 }
12940
12941 return false;
12942 }
12943
12945 {
12946
12947
12948
12949
12950 return super.CanReceiveItemIntoCargo(item);
12951 }
12952
12954 {
12955
12956
12957
12958
12959 GameInventory attachmentInv = attachment.GetInventory();
12961 {
12962 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12963 return false;
12964 }
12965
12966 InventoryLocation loc = new InventoryLocation();
12967 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12968 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12969 return false;
12970
12971 return super.CanReceiveAttachment(attachment, slotId);
12972 }
12973
12975 {
12976 if (!super.CanReleaseAttachment(attachment))
12977 return false;
12978
12979 return GetInventory().AreChildrenAccessible();
12980 }
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13003 {
13004 int id = muzzle_owner.GetMuzzleID();
13005 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13006
13007 if (WPOF_array)
13008 {
13009 for (int i = 0; i < WPOF_array.Count(); i++)
13010 {
13011 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13012
13013 if (WPOF)
13014 {
13015 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13016 }
13017 }
13018 }
13019 }
13020
13021
13023 {
13024 int id = muzzle_owner.GetMuzzleID();
13026
13027 if (WPOBE_array)
13028 {
13029 for (int i = 0; i < WPOBE_array.Count(); i++)
13030 {
13031 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13032
13033 if (WPOBE)
13034 {
13035 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13036 }
13037 }
13038 }
13039 }
13040
13041
13043 {
13044 int id = muzzle_owner.GetMuzzleID();
13045 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13046
13047 if (WPOOH_array)
13048 {
13049 for (int i = 0; i < WPOOH_array.Count(); i++)
13050 {
13051 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13052
13053 if (WPOOH)
13054 {
13055 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13056 }
13057 }
13058 }
13059 }
13060
13061
13063 {
13064 int id = muzzle_owner.GetMuzzleID();
13065 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13066
13067 if (WPOOH_array)
13068 {
13069 for (int i = 0; i < WPOOH_array.Count(); i++)
13070 {
13071 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13072
13073 if (WPOOH)
13074 {
13075 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13076 }
13077 }
13078 }
13079 }
13080
13081
13083 {
13084 int id = muzzle_owner.GetMuzzleID();
13085 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13086
13087 if (WPOOH_array)
13088 {
13089 for (int i = 0; i < WPOOH_array.Count(); i++)
13090 {
13091 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13092
13093 if (WPOOH)
13094 {
13095 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13096 }
13097 }
13098 }
13099 }
13100
13101
13102
13104 {
13106 {
13107 return true;
13108 }
13109
13110 return false;
13111 }
13112
13114 {
13116 {
13117 return true;
13118 }
13119
13120 return false;
13121 }
13122
13124 {
13126 {
13127 return true;
13128 }
13129
13130 return false;
13131 }
13132
13134 {
13135 return false;
13136 }
13137
13140 {
13141 return UATimeSpent.DEFAULT_DEPLOY;
13142 }
13143
13144
13145
13146
13148 {
13150 SetSynchDirty();
13151 }
13152
13154 {
13156 }
13157
13158
13160 {
13161 return false;
13162 }
13163
13166 {
13167 string att_type = "None";
13168
13169 if (ConfigIsExisting("soundAttType"))
13170 {
13171 att_type = ConfigGetString("soundAttType");
13172 }
13173
13175 }
13176
13178 {
13180 }
13181
13182
13183
13184
13185
13191
13193 {
13196
13198 }
13199
13200
13202 {
13204 return;
13205
13207
13210
13213
13214 SoundParameters params = new SoundParameters();
13218 }
13219
13220
13222 {
13224 return;
13225
13227 SetSynchDirty();
13228
13231 }
13232
13233
13235 {
13237 return;
13238
13240 SetSynchDirty();
13241
13244 }
13245
13247 {
13249 }
13250
13252 {
13254 }
13255
13258 {
13259 if (!
GetGame().IsDedicatedServer())
13260 {
13261 if (ConfigIsExisting("attachSoundSet"))
13262 {
13263 string cfg_path = "";
13264 string soundset = "";
13265 string type_name =
GetType();
13266
13269 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13270 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13271
13272 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13273 {
13274 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13275 {
13276 if (cfg_slot_array[i] == slot_type)
13277 {
13278 soundset = cfg_soundset_array[i];
13279 break;
13280 }
13281 }
13282 }
13283
13284 if (soundset != "")
13285 {
13286 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13288 }
13289 }
13290 }
13291 }
13292
13294 {
13295
13296 }
13297
13298 void OnApply(PlayerBase player);
13299
13301 {
13302 return 1.0;
13303 };
13304
13306 {
13308 }
13309
13311 {
13313 }
13314
13316
13318 {
13319 SetDynamicPhysicsLifeTime(0.01);
13321 }
13322
13324 {
13325 array<string> zone_names = new array<string>;
13326 GetDamageZones(zone_names);
13327 for (int i = 0; i < zone_names.Count(); i++)
13328 {
13329 SetHealthMax(zone_names.Get(i),"Health");
13330 }
13331 SetHealthMax("","Health");
13332 }
13333
13336 {
13337 float global_health = GetHealth01("","Health");
13338 array<string> zones = new array<string>;
13339 GetDamageZones(zones);
13340
13341 for (int i = 0; i < zones.Count(); i++)
13342 {
13343 SetHealth01(zones.Get(i),"Health",global_health);
13344 }
13345 }
13346
13349 {
13350 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13351 }
13352
13354 {
13355 if (!hasRootAsPlayer)
13356 {
13357 if (refParentIB)
13358 {
13359
13360 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13361 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13362
13363 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13364 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13365
13368 }
13369 else
13370 {
13371
13374 }
13375 }
13376 }
13377
13379 {
13381 {
13382 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13383 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13384 {
13385 float heatPermCoef = 1.0;
13387 while (ent)
13388 {
13389 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13390 ent = ent.GetHierarchyParent();
13391 }
13392
13393 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13394 }
13395 }
13396 }
13397
13399 {
13400
13401 EntityAI parent = GetHierarchyParent();
13402 if (!parent)
13403 {
13404 hasParent = false;
13405 hasRootAsPlayer = false;
13406 }
13407 else
13408 {
13409 hasParent = true;
13410 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13411 refParentIB =
ItemBase.Cast(parent);
13412 }
13413 }
13414
13415 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13416 {
13417
13418 }
13419
13421 {
13422
13423 return false;
13424 }
13425
13427 {
13428
13429
13430 return false;
13431 }
13432
13434 {
13435
13436 return false;
13437 }
13438
13441 {
13442 return !GetIsFrozen() &&
IsOpen();
13443 }
13444
13446 {
13447 bool hasParent = false, hasRootAsPlayer = false;
13449
13450 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13451 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13452
13453 if (wwtu || foodDecay)
13454 {
13458
13459 if (processWetness || processTemperature || processDecay)
13460 {
13462
13463 if (processWetness)
13464 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13465
13466 if (processTemperature)
13468
13469 if (processDecay)
13470 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13471 }
13472 }
13473 }
13474
13477 {
13479 }
13480
13482 {
13485
13486 return super.GetTemperatureFreezeThreshold();
13487 }
13488
13490 {
13493
13494 return super.GetTemperatureThawThreshold();
13495 }
13496
13498 {
13501
13502 return super.GetItemOverheatThreshold();
13503 }
13504
13506 {
13508 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13509
13510 return super.GetTemperatureFreezeTime();
13511 }
13512
13514 {
13516 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13517
13518 return super.GetTemperatureThawTime();
13519 }
13520
13525
13527 {
13528 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13529 }
13530
13532 {
13533 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13534 }
13535
13538 {
13540 }
13541
13543 {
13545 }
13546
13548 {
13550 }
13551
13554 {
13555 return null;
13556 }
13557
13560 {
13561 return false;
13562 }
13563
13565 {
13567 {
13570 if (!trg)
13571 {
13573 explosive = this;
13574 }
13575
13576 explosive.PairRemote(trg);
13578
13579 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13580 trg.SetPersistentPairID(persistentID);
13581 explosive.SetPersistentPairID(persistentID);
13582
13583 return true;
13584 }
13585 return false;
13586 }
13587
13590 {
13591 float ret = 1.0;
13594 ret *= GetHealth01();
13595
13596 return ret;
13597 }
13598
13599 #ifdef DEVELOPER
13600 override void SetDebugItem()
13601 {
13602 super.SetDebugItem();
13603 _itemBase = this;
13604 }
13605
13607 {
13608 string text = super.GetDebugText();
13609
13611 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13612
13613 return text;
13614 }
13615 #endif
13616
13618 {
13619 return true;
13620 }
13621
13623
13625
13627 {
13630 }
13631
13632
13640
13656}
13657
13659{
13661 if (entity)
13662 {
13663 bool is_item = entity.IsInherited(
ItemBase);
13664 if (is_item && full_quantity)
13665 {
13668 }
13669 }
13670 else
13671 {
13673 return NULL;
13674 }
13675 return entity;
13676}
13677
13679{
13680 if (item)
13681 {
13682 if (health > 0)
13683 item.SetHealth("", "", health);
13684
13685 if (item.CanHaveTemperature())
13686 {
13688 if (item.CanFreeze())
13689 item.SetFrozen(false);
13690 }
13691
13692 if (item.HasEnergyManager())
13693 {
13694 if (quantity >= 0)
13695 {
13696 item.GetCompEM().SetEnergy0To1(quantity);
13697 }
13698 else
13699 {
13701 }
13702 }
13703 else if (item.IsMagazine())
13704 {
13705 Magazine mag = Magazine.Cast(item);
13706 if (quantity >= 0)
13707 {
13708 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13709 }
13710 else
13711 {
13713 }
13714
13715 }
13716 else
13717 {
13718 if (quantity >= 0)
13719 {
13720 item.SetQuantityNormalized(quantity, false);
13721 }
13722 else
13723 {
13725 }
13726
13727 }
13728 }
13729}
13730
13731#ifdef DEVELOPER
13733#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.