8718{
8720 {
8721 return true;
8722 }
8723};
8724
8725
8726
8728{
8732
8734
8737
8738
8739
8740
8741
8750
8756
8761
8766
8787 protected bool m_IsResultOfSplit
8788
8790
8795
8796
8797
8799
8803
8804
8805
8807
8810
8811
8812
8818
8819
8827
8830
8831
8833
8834
8836
8837
8842
8843
8848
8849
8851
8852
8854 {
8859
8860 if (!
GetGame().IsDedicatedServer())
8861 {
8863 {
8865
8867 {
8869 }
8870 }
8871
8874 }
8875
8876 m_OldLocation = null;
8877
8879 {
8881 }
8882
8883 if (ConfigIsExisting("headSelectionsToHide"))
8884 {
8887 }
8888
8890 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8891 {
8893 }
8894
8896
8897 m_IsResultOfSplit = false;
8898
8900 }
8901
8903 {
8904 super.InitItemVariables();
8905
8911 m_Count = ConfigGetInt(
"count");
8912
8915
8920
8923
8928
8940
8944
8945
8948 if (ConfigIsExisting("canBeSplit"))
8949 {
8952 }
8953
8955 if (ConfigIsExisting("itemBehaviour"))
8957
8958
8961 RegisterNetSyncVariableInt("m_VarLiquidType");
8962 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8963
8964 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8965 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8966 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8967
8968 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8969 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8970 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8971 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8972
8973 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8974 RegisterNetSyncVariableBool("m_IsTakeable");
8975 RegisterNetSyncVariableBool("m_IsHologram");
8976
8979 {
8982 }
8983
8985
8987 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8989
8990 }
8991
8993 {
8995 }
8996
8998 {
9001 {
9006 }
9007 }
9008
9009 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9010 {
9012 {
9015 }
9016
9018 }
9019
9021 {
9027 }
9028
9030
9032 {
9034
9035 if (!action)
9036 {
9037 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9038 return;
9039 }
9040
9042 if (!ai)
9043 {
9045 return;
9046 }
9047
9049 if (!action_array)
9050 {
9051 action_array = new array<ActionBase_Basic>;
9053 }
9054 if (LogManager.IsActionLogEnable())
9055 {
9056 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9057 }
9058
9059 if (action_array.Find(action) != -1)
9060 {
9061 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9062 }
9063 else
9064 {
9065 action_array.Insert(action);
9066 }
9067 }
9068
9070 {
9072 ActionBase action = player.GetActionManager().GetAction(actionName);
9075
9076 if (action_array)
9077 {
9078 action_array.RemoveItem(action);
9079 }
9080 }
9081
9082
9083
9085 {
9086 ActionOverrideData overrideData = new ActionOverrideData();
9090
9092 if (!actionMap)
9093 {
9096 }
9097
9098 actionMap.Insert(this.
Type(), overrideData);
9099
9100 }
9101
9103
9105
9106
9108 {
9111
9114
9115 string config_to_search = "CfgVehicles";
9116 string muzzle_owner_config;
9117
9119 {
9120 if (IsInherited(Weapon))
9121 config_to_search = "CfgWeapons";
9122
9123 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9124
9125 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9126
9128
9129 if (config_OnFire_subclass_count > 0)
9130 {
9131 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9132
9133 for (int i = 0; i < config_OnFire_subclass_count; i++)
9134 {
9135 string particle_class = "";
9137 string config_OnFire_entry = config_OnFire_class + particle_class;
9138 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9139 WPOF_array.Insert(WPOF);
9140 }
9141
9142
9144 }
9145 }
9146
9148 {
9149 config_to_search = "CfgWeapons";
9150 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9151
9152 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9153
9155
9156 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9157 {
9158 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9159
9160 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9161 {
9162 string particle_class2 = "";
9164 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9165 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9166 WPOBE_array.Insert(WPOBE);
9167 }
9168
9169
9171 }
9172 }
9173 }
9174
9175
9177 {
9180
9182 {
9183 string config_to_search = "CfgVehicles";
9184
9185 if (IsInherited(Weapon))
9186 config_to_search = "CfgWeapons";
9187
9188 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9189 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9190
9191 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9192 {
9193
9195
9197 {
9199 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9201 return;
9202 }
9203
9206
9207
9208
9210 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9211
9212 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9213 {
9214 string particle_class = "";
9216 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9218
9219 if (entry_type == CT_CLASS)
9220 {
9221 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9222 WPOOH_array.Insert(WPOF);
9223 }
9224 }
9225
9226
9228 }
9229 }
9230 }
9231
9233 {
9235 }
9236
9238 {
9240 {
9242
9245
9248
9249 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9250 }
9251 }
9252
9254 {
9256 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9257
9259 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9260
9262 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9263
9265 {
9267 }
9268 }
9269
9271 {
9273 }
9274
9276 {
9279 else
9281
9283 {
9286 }
9287 else
9288 {
9291
9294 }
9295
9297 }
9298
9300 {
9302 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9303 }
9304
9306 {
9308 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9310 }
9311
9313 {
9315 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9316 }
9317
9319 {
9322
9323 OverheatingParticle OP = new OverheatingParticle();
9328
9330 }
9331
9333 {
9336
9337 return -1;
9338 }
9339
9341 {
9343 {
9346
9347 for (int i = count; i > 0; --i)
9348 {
9349 int id = i - 1;
9352
9355
9356 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9357 {
9358 if (p)
9359 {
9362 }
9363 }
9364 }
9365 }
9366 }
9367
9369 {
9371 {
9373 {
9374 int id = i - 1;
9376
9377 if (OP)
9378 {
9380
9381 if (p)
9382 {
9384 }
9385
9386 delete OP;
9387 }
9388 }
9389
9392 }
9393 }
9394
9397 {
9398 return 0.0;
9399 }
9400
9401
9403 {
9404 return 250;
9405 }
9406
9408 {
9409 return 0;
9410 }
9411
9414 {
9416 return true;
9417
9418 return false;
9419 }
9420
9423 {
9426
9428 {
9430 }
9431 else
9432 {
9433
9435 }
9436
9438 }
9439
9446 {
9447 return -1;
9448 }
9449
9450
9451
9452
9454 {
9456 {
9458 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9459
9460 if (r_index >= 0)
9461 {
9462 InventoryLocation r_il = new InventoryLocation;
9463 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9464
9465 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9468 {
9469 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9470 }
9472 {
9473 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9474 }
9475
9476 }
9477
9478 player.GetHumanInventory().ClearUserReservedLocation(this);
9479 }
9480
9483 }
9484
9485
9486
9487
9489 {
9490 return ItemBase.m_DebugActionsMask;
9491 }
9492
9494 {
9495 return ItemBase.m_DebugActionsMask & mask;
9496 }
9497
9499 {
9500 ItemBase.m_DebugActionsMask = mask;
9501 }
9502
9504 {
9505 ItemBase.m_DebugActionsMask |= mask;
9506 }
9507
9509 {
9510 ItemBase.m_DebugActionsMask &= ~mask;
9511 }
9512
9514 {
9516 {
9518 }
9519 else
9520 {
9522 }
9523 }
9524
9525
9527 {
9528 if (GetEconomyProfile())
9529 {
9530 float q_max = GetEconomyProfile().GetQuantityMax();
9531 if (q_max > 0)
9532 {
9533 float q_min = GetEconomyProfile().GetQuantityMin();
9534 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9535
9537 {
9538 ComponentEnergyManager comp = GetCompEM();
9540 {
9542 }
9543 }
9545 {
9547
9548 }
9549
9550 }
9551 }
9552 }
9553
9556 {
9557 EntityAI parent = GetHierarchyParent();
9558
9559 if (parent)
9560 {
9561 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9562 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9563 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9564 }
9565 }
9566
9569 {
9570 EntityAI parent = GetHierarchyParent();
9571
9572 if (parent)
9573 {
9574 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9575 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9576 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9577 }
9578 }
9579
9581 {
9582
9583
9584
9585
9587
9589 {
9590 if (ScriptInputUserData.CanStoreInputUserData())
9591 {
9592 ScriptInputUserData ctx = new ScriptInputUserData;
9598 ctx.
Write(use_stack_max);
9601
9603 {
9604 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9605 }
9606 }
9607 }
9608 else if (!
GetGame().IsMultiplayer())
9609 {
9611 }
9612 }
9613
9615 {
9617 }
9618
9620 {
9622 }
9623
9625 {
9627 }
9628
9630 {
9631
9632 return false;
9633 }
9634
9636 {
9637 return false;
9638 }
9639
9643 {
9644 return false;
9645 }
9646
9648 {
9649 return "";
9650 }
9651
9653
9655 {
9656 return false;
9657 }
9658
9660 {
9661 return true;
9662 }
9663
9664
9665
9667 {
9668 return true;
9669 }
9670
9672 {
9673 return true;
9674 }
9675
9677 {
9678 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9680 }
9681
9683 {
9685 }
9686
9688 {
9690 if (!is_being_placed)
9692 SetSynchDirty();
9693 }
9694
9695
9697
9699 {
9701 }
9702
9704 {
9706 }
9707
9709 {
9710 return 1;
9711 }
9712
9714 {
9715 return false;
9716 }
9717
9719 {
9721 SetSynchDirty();
9722 }
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9759 {
9760 super.OnMovedInsideCargo(container);
9761
9762 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9763 }
9764
9765 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9766 {
9767 super.EEItemLocationChanged(oldLoc,newLoc);
9768
9769 PlayerBase new_player = null;
9770 PlayerBase old_player = null;
9771
9772 if (newLoc.GetParent())
9773 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9774
9775 if (oldLoc.GetParent())
9776 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9777
9779 {
9780 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9781
9782 if (r_index >= 0)
9783 {
9784 InventoryLocation r_il = new InventoryLocation;
9785 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9786
9787 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9790 {
9791 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9792 }
9794 {
9795 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9796 }
9797
9798 }
9799 }
9800
9802 {
9803 if (new_player)
9804 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9805
9806 if (new_player == old_player)
9807 {
9808
9809 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9810 {
9812 {
9813 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9814 {
9815 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9816 }
9817 }
9818 else
9819 {
9820 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9821 }
9822 }
9823
9824 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9825 {
9826 int type = oldLoc.GetType();
9828 {
9829 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9830 }
9832 {
9833 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9834 }
9835 }
9836 if (!m_OldLocation)
9837 {
9838 m_OldLocation = new InventoryLocation;
9839 }
9840 m_OldLocation.Copy(oldLoc);
9841 }
9842 else
9843 {
9844 if (m_OldLocation)
9845 {
9846 m_OldLocation.Reset();
9847 }
9848 }
9849
9851 }
9852 else
9853 {
9854 if (new_player)
9855 {
9856 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9857 if (res_index >= 0)
9858 {
9859 InventoryLocation il = new InventoryLocation;
9860 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9862 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9865 {
9866 il.
GetParent().GetOnReleaseLock().Invoke(it);
9867 }
9869 {
9871 }
9872
9873 }
9874 }
9876 {
9877
9879 }
9880
9881 if (m_OldLocation)
9882 {
9883 m_OldLocation.Reset();
9884 }
9885 }
9886 }
9887
9888 override void EOnContact(IEntity other, Contact extra)
9889 {
9891 {
9892 int liquidType = -1;
9894 if (impactSpeed > 0.0)
9895 {
9897 #ifndef SERVER
9899 #else
9901 SetSynchDirty();
9902 #endif
9904 }
9905 }
9906
9907 #ifdef SERVER
9908 if (GetCompEM() && GetCompEM().IsPlugged())
9909 {
9910 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9911 GetCompEM().UnplugThis();
9912 }
9913 #endif
9914 }
9915
9917
9919 {
9921 }
9922
9924 {
9925
9926 }
9927
9929 {
9930 super.OnItemLocationChanged(old_owner, new_owner);
9931
9932 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9933 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9934
9935 if (!relatedPlayer && playerNew)
9936 relatedPlayer = playerNew;
9937
9938 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9939 {
9941 if (actionMgr)
9942 {
9943 ActionBase currentAction = actionMgr.GetRunningAction();
9944 if (currentAction)
9946 }
9947 }
9948
9949 Man ownerPlayerOld = null;
9950 Man ownerPlayerNew = null;
9951
9952 if (old_owner)
9953 {
9954 if (old_owner.
IsMan())
9955 {
9956 ownerPlayerOld = Man.Cast(old_owner);
9957 }
9958 else
9959 {
9960 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9961 }
9962 }
9963 else
9964 {
9966 {
9968
9969 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9970 {
9971 GetCompEM().UnplugThis();
9972 }
9973 }
9974 }
9975
9976 if (new_owner)
9977 {
9978 if (new_owner.
IsMan())
9979 {
9980 ownerPlayerNew = Man.Cast(new_owner);
9981 }
9982 else
9983 {
9984 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9985 }
9986 }
9987
9988 if (ownerPlayerOld != ownerPlayerNew)
9989 {
9990 if (ownerPlayerOld)
9991 {
9992 array<EntityAI> subItemsExit = new array<EntityAI>;
9994 for (int i = 0; i < subItemsExit.Count(); i++)
9995 {
9998 }
9999 }
10000
10001 if (ownerPlayerNew)
10002 {
10003 array<EntityAI> subItemsEnter = new array<EntityAI>;
10005 for (int j = 0; j < subItemsEnter.Count(); j++)
10006 {
10009 }
10010 }
10011 }
10012 else if (ownerPlayerNew != null)
10013 {
10014 PlayerBase nplayer;
10015 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10016 {
10017 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10019 for (int k = 0; k < subItemsUpdate.Count(); k++)
10020 {
10022 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10023 }
10024 }
10025 }
10026
10027 if (old_owner)
10028 old_owner.OnChildItemRemoved(this);
10029 if (new_owner)
10030 new_owner.OnChildItemReceived(this);
10031 }
10032
10033
10035 {
10036 super.EEDelete(parent);
10037 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10038 if (player)
10039 {
10041
10042 if (player.IsAlive())
10043 {
10044 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10045 if (r_index >= 0)
10046 {
10047 InventoryLocation r_il = new InventoryLocation;
10048 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10049
10050 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10053 {
10054 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10055 }
10057 {
10058 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10059 }
10060
10061 }
10062
10063 player.RemoveQuickBarEntityShortcut(this);
10064 }
10065 }
10066 }
10067
10069 {
10070 super.EEKilled(killer);
10071
10074 {
10075 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10076 {
10077 if (IsMagazine())
10078 {
10079 if (Magazine.Cast(this).GetAmmoCount() > 0)
10080 {
10082 }
10083 }
10084 else
10085 {
10087 }
10088 }
10089 }
10090 }
10091
10093 {
10094 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10095
10096 super.OnWasAttached(parent, slot_id);
10097
10100
10102 }
10103
10105 {
10106 super.OnWasDetached(parent, slot_id);
10107
10110 }
10111
10113 {
10114 int idx;
10117
10118 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10119 if (inventory_slots.Count() < 1)
10120 {
10121 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10122 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10123 }
10124 else
10125 {
10126 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10127 }
10128
10129 idx = inventory_slots.Find(slot);
10130 if (idx < 0)
10131 return "";
10132
10133 return attach_types.Get(idx);
10134 }
10135
10137 {
10138 int idx = -1;
10139 string slot;
10140
10143
10144 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10145 if (inventory_slots.Count() < 1)
10146 {
10147 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10148 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10149 }
10150 else
10151 {
10152 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10153 if (detach_types.Count() < 1)
10154 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10155 }
10156
10157 for (int i = 0; i < inventory_slots.Count(); i++)
10158 {
10159 slot = inventory_slots.Get(i);
10160 }
10161
10162 if (slot != "")
10163 {
10164 if (detach_types.Count() == 1)
10165 idx = 0;
10166 else
10167 idx = inventory_slots.Find(slot);
10168 }
10169 if (idx < 0)
10170 return "";
10171
10172 return detach_types.Get(idx);
10173 }
10174
10176 {
10177
10179
10180
10181 float min_time = 1;
10182 float max_time = 3;
10183 float delay = Math.RandomFloat(min_time, max_time);
10184
10185 explode_timer.Run(delay, this, "DoAmmoExplosion");
10186 }
10187
10189 {
10190 Magazine magazine = Magazine.Cast(this);
10191 int pop_sounds_count = 6;
10192 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10193
10194
10195 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10196 string sound_name = pop_sounds[ sound_idx ];
10198
10199
10200 magazine.ServerAddAmmoCount(-1);
10201
10202
10203 float min_temp_to_explode = 100;
10204
10205 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10206 {
10208 }
10209 }
10210
10211
10212 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10213 {
10214 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10215
10216 const int CHANCE_DAMAGE_CARGO = 4;
10217 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10218 const int CHANCE_DAMAGE_NOTHING = 2;
10219
10221 {
10222 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10223 int chances;
10224 int rnd;
10225
10226 if (GetInventory().GetCargo())
10227 {
10228 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10229 rnd = Math.RandomInt(0,chances);
10230
10231 if (rnd < CHANCE_DAMAGE_CARGO)
10232 {
10234 }
10235 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10236 {
10238 }
10239 }
10240 else
10241 {
10242 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10243 rnd = Math.RandomInt(0,chances);
10244
10245 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10246 {
10248 }
10249 }
10250 }
10251 }
10252
10254 {
10255 if (GetInventory().GetCargo())
10256 {
10257 int item_count = GetInventory().GetCargo().GetItemCount();
10258 if (item_count > 0)
10259 {
10260 int random_pick = Math.RandomInt(0, item_count);
10262 if (!item.IsExplosive())
10263 {
10264 item.AddHealth("","",damage);
10265 return true;
10266 }
10267 }
10268 }
10269 return false;
10270 }
10271
10273 {
10274 int attachment_count = GetInventory().AttachmentCount();
10275 if (attachment_count > 0)
10276 {
10277 int random_pick = Math.RandomInt(0, attachment_count);
10278 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10279 if (!attachment.IsExplosive())
10280 {
10281 attachment.AddHealth("","",damage);
10282 return true;
10283 }
10284 }
10285 return false;
10286 }
10287
10289 {
10291 }
10292
10294 {
10296 return GetInventory().CanRemoveEntity();
10297
10298 return false;
10299 }
10300
10302 {
10304 return;
10305
10307 {
10308 if (ScriptInputUserData.CanStoreInputUserData())
10309 {
10310 ScriptInputUserData ctx = new ScriptInputUserData;
10315 ctx.
Write(destination_entity);
10317 ctx.
Write(slot_id);
10319 }
10320 }
10321 else if (!
GetGame().IsMultiplayer())
10322 {
10324 }
10325 }
10326
10328 {
10330 return;
10331
10332 float split_quantity_new;
10336 InventoryLocation loc = new InventoryLocation;
10337
10338 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10339 {
10341 split_quantity_new = stack_max;
10342 else
10344
10345 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10346 if (new_item)
10347 {
10348 new_item.SetResultOfSplit(true);
10349 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10351 new_item.SetQuantity(split_quantity_new);
10352 }
10353 }
10354 else if (destination_entity && slot_id == -1)
10355 {
10356 if (quantity > stack_max)
10357 split_quantity_new = stack_max;
10358 else
10359 split_quantity_new = quantity;
10360
10362 {
10365 }
10366
10367 if (new_item)
10368 {
10369 new_item.SetResultOfSplit(true);
10370 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10372 new_item.SetQuantity(split_quantity_new);
10373 }
10374 }
10375 else
10376 {
10377 if (stack_max != 0)
10378 {
10380 {
10382 }
10383
10384 if (split_quantity_new == 0)
10385 {
10386 if (!
GetGame().IsMultiplayer())
10387 player.PhysicalPredictiveDropItem(this);
10388 else
10389 player.ServerDropEntity(this);
10390 return;
10391 }
10392
10394
10395 if (new_item)
10396 {
10397 new_item.SetResultOfSplit(true);
10398 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10400 new_item.SetQuantity(stack_max);
10401 new_item.PlaceOnSurface();
10402 }
10403 }
10404 }
10405 }
10406
10408 {
10410 return;
10411
10412 float split_quantity_new;
10416 InventoryLocation loc = new InventoryLocation;
10417
10418 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10419 {
10421 split_quantity_new = stack_max;
10422 else
10424
10425 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10426 if (new_item)
10427 {
10428 new_item.SetResultOfSplit(true);
10429 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10431 new_item.SetQuantity(split_quantity_new);
10432 }
10433 }
10434 else if (destination_entity && slot_id == -1)
10435 {
10436 if (quantity > stack_max)
10437 split_quantity_new = stack_max;
10438 else
10439 split_quantity_new = quantity;
10440
10442 {
10445 }
10446
10447 if (new_item)
10448 {
10449 new_item.SetResultOfSplit(true);
10450 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10452 new_item.SetQuantity(split_quantity_new);
10453 }
10454 }
10455 else
10456 {
10457 if (stack_max != 0)
10458 {
10460 {
10462 }
10463
10465
10466 if (new_item)
10467 {
10468 new_item.SetResultOfSplit(true);
10469 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10471 new_item.SetQuantity(stack_max);
10472 new_item.PlaceOnSurface();
10473 }
10474 }
10475 }
10476 }
10477
10479 {
10481 return;
10482
10484 {
10485 if (ScriptInputUserData.CanStoreInputUserData())
10486 {
10487 ScriptInputUserData ctx = new ScriptInputUserData;
10492 dst.WriteToContext(ctx);
10494 }
10495 }
10496 else if (!
GetGame().IsMultiplayer())
10497 {
10499 }
10500 }
10501
10503 {
10505 return;
10506
10508 {
10509 if (ScriptInputUserData.CanStoreInputUserData())
10510 {
10511 ScriptInputUserData ctx = new ScriptInputUserData;
10516 ctx.
Write(destination_entity);
10522 }
10523 }
10524 else if (!
GetGame().IsMultiplayer())
10525 {
10527 }
10528 }
10529
10531 {
10533 }
10534
10536 {
10538 return this;
10539
10541 float split_quantity_new;
10543 if (dst.IsValid())
10544 {
10545 int slot_id = dst.GetSlot();
10547
10548 if (quantity > stack_max)
10549 split_quantity_new = stack_max;
10550 else
10551 split_quantity_new = quantity;
10552
10554
10555 if (new_item)
10556 {
10557 new_item.SetResultOfSplit(true);
10558 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10561 }
10562
10563 return new_item;
10564 }
10565
10566 return null;
10567 }
10568
10570 {
10572 return;
10573
10575 float split_quantity_new;
10577 if (destination_entity)
10578 {
10580 if (quantity > stackable)
10581 split_quantity_new = stackable;
10582 else
10583 split_quantity_new = quantity;
10584
10585 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10586 if (new_item)
10587 {
10588 new_item.SetResultOfSplit(true);
10589 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10591 new_item.SetQuantity(split_quantity_new);
10592 }
10593 }
10594 }
10595
10597 {
10599 return;
10600
10602 {
10603 if (ScriptInputUserData.CanStoreInputUserData())
10604 {
10605 ScriptInputUserData ctx = new ScriptInputUserData;
10610 ItemBase destination_entity =
this;
10611 ctx.
Write(destination_entity);
10615 }
10616 }
10617 else if (!
GetGame().IsMultiplayer())
10618 {
10620 }
10621 }
10622
10624 {
10626 return;
10627
10629 float split_quantity_new;
10631 if (player)
10632 {
10634 if (quantity > stackable)
10635 split_quantity_new = stackable;
10636 else
10637 split_quantity_new = quantity;
10638
10639 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10640 new_item =
ItemBase.Cast(in_hands);
10641 if (new_item)
10642 {
10643 new_item.SetResultOfSplit(true);
10644 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10646 new_item.SetQuantity(split_quantity_new);
10647 }
10648 }
10649 }
10650
10652 {
10654 return;
10655
10657 float split_quantity_new = Math.Floor(quantity * 0.5);
10658
10660
10661 if (new_item)
10662 {
10663 if (new_item.GetQuantityMax() < split_quantity_new)
10664 {
10665 split_quantity_new = new_item.GetQuantityMax();
10666 }
10667
10668 new_item.SetResultOfSplit(true);
10669 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10670
10672 {
10675 }
10676 else
10677 {
10680 }
10681 }
10682 }
10683
10685 {
10687 return;
10688
10690 float split_quantity_new = Math.Floor(quantity / 2);
10691
10692 InventoryLocation invloc = new InventoryLocation;
10694
10696 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10697
10698 if (new_item)
10699 {
10700 if (new_item.GetQuantityMax() < split_quantity_new)
10701 {
10702 split_quantity_new = new_item.GetQuantityMax();
10703 }
10705 {
10708 }
10709 else
10710 {
10713 }
10714 }
10715 }
10716
10719 {
10720 SetWeightDirty();
10722
10723 if (parent)
10724 parent.OnAttachmentQuantityChangedEx(this, delta);
10725
10727 {
10729 {
10731 }
10733 {
10734 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10736 }
10737 }
10738
10739 }
10740
10743 {
10744
10745 }
10746
10749 {
10751 }
10752
10754 {
10755 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10756
10758 {
10759 if (newLevel == GameConstants.STATE_RUINED)
10760 {
10762 EntityAI parent = GetHierarchyParent();
10763 if (parent && parent.IsFireplace())
10764 {
10765 CargoBase cargo = GetInventory().GetCargo();
10766 if (cargo)
10767 {
10769 {
10771 }
10772 }
10773 }
10774 }
10775
10777 {
10778
10780 return;
10781 }
10782
10783 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10784 {
10786 }
10787 }
10788 }
10789
10790
10792 {
10793 super.OnRightClick();
10794
10796 {
10798 {
10799 if (ScriptInputUserData.CanStoreInputUserData())
10800 {
10801 vector m4[4];
10803
10804 EntityAI root = GetHierarchyRoot();
10805
10806 InventoryLocation dst = new InventoryLocation;
10808 {
10809 if (root)
10810 {
10811 root.GetTransform(m4);
10813 }
10814 else
10815 GetInventory().GetCurrentInventoryLocation(dst);
10816 }
10817 else
10818 {
10820
10821
10822 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10823 {
10824 if (root)
10825 {
10826 root.GetTransform(m4);
10828 }
10829 else
10830 GetInventory().GetCurrentInventoryLocation(dst);
10831 }
10832 else
10833 {
10834 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10835 }
10836 }
10837
10838 ScriptInputUserData ctx = new ScriptInputUserData;
10846 }
10847 }
10848 else if (!
GetGame().IsMultiplayer())
10849 {
10851 }
10852 }
10853 }
10854
10855 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10856 {
10857
10858 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10859 return false;
10860
10861 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10862 return false;
10863
10864
10866 return false;
10867
10868
10869 Magazine mag = Magazine.Cast(this);
10870 if (mag)
10871 {
10872 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10873 return false;
10874
10875 if (stack_max_limit)
10876 {
10877 Magazine other_mag = Magazine.Cast(other_item);
10878 if (other_item)
10879 {
10880 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10881 return false;
10882 }
10883
10884 }
10885 }
10886 else
10887 {
10888
10890 return false;
10891
10893 return false;
10894 }
10895
10896 PlayerBase player = null;
10897 if (CastTo(player, GetHierarchyRootPlayer()))
10898 {
10899 if (player.GetInventory().HasAttachment(this))
10900 return false;
10901
10902 if (player.IsItemsToDelete())
10903 return false;
10904 }
10905
10906 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10907 return false;
10908
10909 int slotID;
10911 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10912 return false;
10913
10914 return true;
10915 }
10916
10918 {
10920 }
10921
10923 {
10924 return m_IsResultOfSplit;
10925 }
10926
10928 {
10929 m_IsResultOfSplit = value;
10930 }
10931
10933 {
10935 }
10936
10938 {
10939 float other_item_quantity = other_item.GetQuantity();
10940 float this_free_space;
10941
10943
10945
10946 if (other_item_quantity > this_free_space)
10947 {
10948 return this_free_space;
10949 }
10950 else
10951 {
10952 return other_item_quantity;
10953 }
10954 }
10955
10957 {
10959 }
10960
10962 {
10964 return;
10965
10966 if (!IsMagazine() && other_item)
10967 {
10969 if (quantity_used != 0)
10970 {
10971 float hp1 = GetHealth01("","");
10972 float hp2 = other_item.GetHealth01("","");
10973 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10974 hpResult = hpResult / (
GetQuantity() + quantity_used);
10975
10976 hpResult *= GetMaxHealth();
10977 Math.Round(hpResult);
10978 SetHealth("", "Health", hpResult);
10979
10981 other_item.AddQuantity(-quantity_used);
10982 }
10983 }
10985 }
10986
10988 {
10989 #ifdef SERVER
10990 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10991 GetHierarchyParent().IncreaseLifetimeUp();
10992 #endif
10993 };
10994
10996 {
10997 PlayerBase p = PlayerBase.Cast(player);
10998
10999 array<int> recipesIds = p.m_Recipes;
11000 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11001 if (moduleRecipesManager)
11002 {
11003 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11004 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11005 }
11006
11007 for (int i = 0;i < recipesIds.Count(); i++)
11008 {
11009 int key = recipesIds.Get(i);
11010 string recipeName = moduleRecipesManager.GetRecipeName(key);
11012 }
11013 }
11014
11015
11016 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11017 {
11018 super.GetDebugActions(outputList);
11019
11020
11025
11026
11030
11034
11035
11038
11039
11041 {
11044 }
11045
11047
11050
11054 }
11055
11056
11057
11058
11060 {
11061 super.OnAction(action_id, player, ctx);
11062 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11063 {
11064 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11065 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11066 PlayerBase p = PlayerBase.Cast(player);
11067 if (
EActions.RECIPES_RANGE_START < 1000)
11068 {
11069 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11070 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11071 }
11072 }
11073 #ifndef SERVER
11074 else if (action_id ==
EActions.WATCH_PLAYER)
11075 {
11076 PluginDeveloper.SetDeveloperItemClientEx(player);
11077 }
11078 #endif
11080 {
11081 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11082 {
11083 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11084 OnDebugButtonPressServer(id + 1);
11085 }
11086
11087 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11088 {
11089 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11091 }
11092
11093 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11094 {
11095 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11097 }
11098
11099 else if (action_id ==
EActions.ADD_QUANTITY)
11100 {
11101 if (IsMagazine())
11102 {
11103 Magazine mag = Magazine.Cast(this);
11104 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11105 }
11106 else
11107 {
11109 }
11110
11111 if (m_EM)
11112 {
11113 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11114 }
11115
11116 }
11117
11118 else if (action_id ==
EActions.REMOVE_QUANTITY)
11119 {
11120 if (IsMagazine())
11121 {
11122 Magazine mag2 = Magazine.Cast(this);
11123 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11124 }
11125 else
11126 {
11128 }
11129 if (m_EM)
11130 {
11131 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11132 }
11133
11134 }
11135
11136 else if (action_id ==
EActions.SET_QUANTITY_0)
11137 {
11139
11140 if (m_EM)
11141 {
11142 m_EM.SetEnergy(0);
11143 }
11144 }
11145
11146 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11147 {
11149
11150 if (m_EM)
11151 {
11152 m_EM.SetEnergy(m_EM.GetEnergyMax());
11153 }
11154 }
11155
11156 else if (action_id ==
EActions.ADD_HEALTH)
11157 {
11158 AddHealth("","",GetMaxHealth("","Health")/5);
11159 }
11160 else if (action_id ==
EActions.REMOVE_HEALTH)
11161 {
11162 AddHealth("","",-GetMaxHealth("","Health")/5);
11163 }
11164 else if (action_id ==
EActions.DESTROY_HEALTH)
11165 {
11166 SetHealth01("","",0);
11167 }
11168 else if (action_id ==
EActions.WATCH_ITEM)
11169 {
11171 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11172 #ifdef DEVELOPER
11173 SetDebugDeveloper_item(this);
11174 #endif
11175 }
11176
11177 else if (action_id ==
EActions.ADD_TEMPERATURE)
11178 {
11179 AddTemperature(20);
11180
11181 }
11182
11183 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11184 {
11185 AddTemperature(-20);
11186
11187 }
11188
11189 else if (action_id ==
EActions.FLIP_FROZEN)
11190 {
11191 SetFrozen(!GetIsFrozen());
11192
11193 }
11194
11195 else if (action_id ==
EActions.ADD_WETNESS)
11196 {
11198
11199 }
11200
11201 else if (action_id ==
EActions.REMOVE_WETNESS)
11202 {
11204
11205 }
11206
11207 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11208 {
11211
11212
11213 }
11214
11215 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11216 {
11219 }
11220
11221 else if (action_id ==
EActions.MAKE_SPECIAL)
11222 {
11223 auto debugParams = DebugSpawnParams.WithPlayer(player);
11224 OnDebugSpawnEx(debugParams);
11225 }
11226
11227 else if (action_id ==
EActions.DELETE)
11228 {
11229 Delete();
11230 }
11231
11232 }
11233
11234
11235 return false;
11236 }
11237
11238
11239
11240
11244
11247
11248
11249
11251 {
11252 return false;
11253 }
11254
11255
11257 {
11258 return true;
11259 }
11260
11261
11263 {
11264 return true;
11265 }
11266
11267
11268
11270 {
11271 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11273 }
11274
11277 {
11278 return null;
11279 }
11280
11282 {
11283 return false;
11284 }
11285
11287 {
11288 return false;
11289 }
11290
11294
11295
11297 {
11298 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11299 return module_repairing.CanRepair(this, item_repair_kit);
11300 }
11301
11302
11303 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11304 {
11305 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11306 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11307 }
11308
11309
11311 {
11312
11313
11314
11315
11316
11317
11318
11319
11320 return 1;
11321 }
11322
11323
11324
11326 {
11328 }
11329
11330
11331
11333 {
11335 }
11336
11337
11346 {
11347 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11348
11349 if (player)
11350 {
11351 player.MessageStatus(text);
11352 }
11353 }
11354
11355
11364 {
11365 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11366
11367 if (player)
11368 {
11369 player.MessageAction(text);
11370 }
11371 }
11372
11373
11382 {
11383 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11384
11385 if (player)
11386 {
11387 player.MessageFriendly(text);
11388 }
11389 }
11390
11391
11400 {
11401 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11402
11403 if (player)
11404 {
11405 player.MessageImportant(text);
11406 }
11407 }
11408
11410 {
11411 return true;
11412 }
11413
11414
11415 override bool KindOf(
string tag)
11416 {
11417 bool found = false;
11418 string item_name = this.
GetType();
11421
11422 int array_size = item_tag_array.Count();
11423 for (int i = 0; i < array_size; i++)
11424 {
11425 if (item_tag_array.Get(i) == tag)
11426 {
11427 found = true;
11428 break;
11429 }
11430 }
11431 return found;
11432 }
11433
11434
11436 {
11437
11438 super.OnRPC(sender, rpc_type,ctx);
11439
11440
11441 switch (rpc_type)
11442 {
11443 #ifndef SERVER
11444 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11445 Param2<bool, string> p = new Param2<bool, string>(false, "");
11446
11448 return;
11449
11450 bool play = p.param1;
11451 string soundSet = p.param2;
11452
11453 if (play)
11454 {
11456 {
11458 {
11460 }
11461 }
11462 else
11463 {
11465 }
11466 }
11467 else
11468 {
11470 }
11471
11472 break;
11473 #endif
11474
11475 }
11476
11478 {
11480 }
11481 }
11482
11483
11484
11485
11487 {
11488 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11489 return plugin.GetID(
name);
11490 }
11491
11493 {
11494 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11495 return plugin.GetName(id);
11496 }
11497
11500 {
11501
11502
11503 int varFlags;
11504 if (!ctx.
Read(varFlags))
11505 return;
11506
11507 if (varFlags & ItemVariableFlags.FLOAT)
11508 {
11510 }
11511 }
11512
11514 {
11515
11516 super.SerializeNumericalVars(floats_out);
11517
11518
11519
11521 {
11523 }
11524
11526 {
11528 }
11529
11531 {
11533 }
11534
11536 {
11541 }
11542
11544 {
11546 }
11547 }
11548
11550 {
11551
11552 super.DeSerializeNumericalVars(floats);
11553
11554
11555 int index = 0;
11556 int mask = Math.Round(floats.Get(index));
11557
11558 index++;
11559
11561 {
11563 {
11565 }
11566 else
11567 {
11568 float quantity = floats.Get(index);
11569 SetQuantity(quantity,
true,
false,
false,
false);
11570 }
11571 index++;
11572 }
11573
11575 {
11576 float wet = floats.Get(index);
11578 index++;
11579 }
11580
11582 {
11583 int liquidtype = Math.Round(floats.Get(index));
11585 index++;
11586 }
11587
11589 {
11591 index++;
11593 index++;
11595 index++;
11597 index++;
11598 }
11599
11601 {
11602 int cleanness = Math.Round(floats.Get(index));
11604 index++;
11605 }
11606 }
11607
11609 {
11610 super.WriteVarsToCTX(ctx);
11611
11612
11614 {
11616 }
11617
11619 {
11621 }
11622
11624 {
11626 }
11627
11629 {
11630 int r,g,b,a;
11636 }
11637
11639 {
11641 }
11642 }
11643
11645 {
11646 if (!super.ReadVarsFromCTX(ctx,version))
11647 return false;
11648
11649 int intValue;
11650 float value;
11651
11652 if (version < 140)
11653 {
11654 if (!ctx.
Read(intValue))
11655 return false;
11656
11657 m_VariablesMask = intValue;
11658 }
11659
11661 {
11662 if (!ctx.
Read(value))
11663 return false;
11664
11666 {
11668 }
11669 else
11670 {
11672 }
11673 }
11674
11675 if (version < 140)
11676 {
11678 {
11679 if (!ctx.
Read(value))
11680 return false;
11681 SetTemperatureDirect(value);
11682 }
11683 }
11684
11686 {
11687 if (!ctx.
Read(value))
11688 return false;
11690 }
11691
11693 {
11694 if (!ctx.
Read(intValue))
11695 return false;
11697 }
11698
11700 {
11701 int r,g,b,a;
11703 return false;
11705 return false;
11707 return false;
11709 return false;
11710
11712 }
11713
11715 {
11716 if (!ctx.
Read(intValue))
11717 return false;
11719 }
11720
11721 if (version >= 138 && version < 140)
11722 {
11724 {
11725 if (!ctx.
Read(intValue))
11726 return false;
11727 SetFrozen(intValue);
11728 }
11729 }
11730
11731 return true;
11732 }
11733
11734
11736 {
11739 {
11741 }
11742
11743 if (!super.OnStoreLoad(ctx, version))
11744 {
11746 return false;
11747 }
11748
11749 if (version >= 114)
11750 {
11751 bool hasQuickBarIndexSaved;
11752
11753 if (!ctx.
Read(hasQuickBarIndexSaved))
11754 {
11756 return false;
11757 }
11758
11759 if (hasQuickBarIndexSaved)
11760 {
11761 int itmQBIndex;
11762
11763
11764 if (!ctx.
Read(itmQBIndex))
11765 {
11767 return false;
11768 }
11769
11770 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11771 if (itmQBIndex != -1 && parentPlayer)
11772 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11773 }
11774 }
11775 else
11776 {
11777
11778 PlayerBase player;
11779 int itemQBIndex;
11780 if (version ==
int.
MAX)
11781 {
11782 if (!ctx.
Read(itemQBIndex))
11783 {
11785 return false;
11786 }
11787 }
11788 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11789 {
11790
11791 if (!ctx.
Read(itemQBIndex))
11792 {
11794 return false;
11795 }
11796 if (itemQBIndex != -1 && player)
11797 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11798 }
11799 }
11800
11801 if (version < 140)
11802 {
11803
11804 if (!LoadVariables(ctx, version))
11805 {
11807 return false;
11808 }
11809 }
11810
11811
11813 {
11815 return false;
11816 }
11817 if (version >= 132)
11818 {
11820 if (raib)
11821 {
11823 {
11825 return false;
11826 }
11827 }
11828 }
11829
11831 return true;
11832 }
11833
11834
11835
11837 {
11838 super.OnStoreSave(ctx);
11839
11840 PlayerBase player;
11841 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11842 {
11844
11845 int itemQBIndex = -1;
11846 itemQBIndex = player.FindQuickBarEntityIndex(this);
11847 ctx.
Write(itemQBIndex);
11848 }
11849 else
11850 {
11852 }
11853
11855
11857 if (raib)
11858 {
11860 }
11861 }
11862
11863
11865 {
11866 super.AfterStoreLoad();
11867
11869 {
11871 }
11872
11874 {
11877 }
11878 }
11879
11881 {
11882 super.EEOnAfterLoad();
11883
11885 {
11887 }
11888
11891 }
11892
11894 {
11895 return false;
11896 }
11897
11898
11899
11901 {
11903 {
11904 #ifdef PLATFORM_CONSOLE
11905
11907 {
11909 if (menu)
11910 {
11912 }
11913 }
11914 #endif
11915 }
11916
11918 {
11921 }
11922
11924 {
11925 SetWeightDirty();
11927 }
11929 {
11932 }
11933
11935 {
11938 }
11940 {
11943 }
11944
11945 super.OnVariablesSynchronized();
11946 }
11947
11948
11949
11951 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11952 {
11953 if (!IsServerCheck(allow_client))
11954 return false;
11955
11957 return false;
11958
11961
11962 if (value <= (min + 0.001))
11963 value = min;
11964
11965 if (value == min)
11966 {
11967 if (destroy_config)
11968 {
11969 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11970 if (dstr)
11971 {
11973 this.Delete();
11974 return true;
11975 }
11976 }
11977 else if (destroy_forced)
11978 {
11980 this.Delete();
11981 return true;
11982 }
11983
11985 }
11986
11989
11991 {
11993
11994 if (delta)
11996 }
11997
11999
12000 return false;
12001 }
12002
12003
12005 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12006 {
12008 }
12009
12011 {
12014 }
12015
12017 {
12020 }
12021
12024 {
12025 float value_clamped = Math.Clamp(value, 0, 1);
12027 SetQuantity(result, destroy_config, destroy_forced);
12028 }
12029
12030
12033 {
12035 }
12036
12038 {
12040 }
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12052 {
12053 int slot = -1;
12054 if (GetInventory())
12055 {
12056 InventoryLocation il = new InventoryLocation;
12057 GetInventory().GetCurrentInventoryLocation(il);
12059 }
12060
12062 }
12063
12065 {
12066 float quantity_max = 0;
12067
12069 {
12070 if (attSlotID != -1)
12071 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12072
12073 if (quantity_max <= 0)
12075 }
12076
12077 if (quantity_max <= 0)
12079
12080 return quantity_max;
12081 }
12082
12084 {
12086 }
12087
12089 {
12091 }
12092
12093
12095 {
12097 }
12098
12100 {
12102 }
12103
12105 {
12107 }
12108
12109
12111 {
12112
12113 float weightEx = GetWeightEx();
12114 float special = GetInventoryAndCargoWeight();
12115 return weightEx - special;
12116 }
12117
12118
12120 {
12122 }
12123
12125 {
12127 {
12128 #ifdef DEVELOPER
12129 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12130 {
12131 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12133 }
12134 #endif
12135
12136 return GetQuantity() * GetConfigWeightModified();
12137 }
12138 else if (HasEnergyManager())
12139 {
12140 #ifdef DEVELOPER
12141 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12142 {
12143 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12144 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12145 }
12146 #endif
12147 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12148 }
12149 else
12150 {
12151 #ifdef DEVELOPER
12152 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12153 {
12154 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12155 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12156 }
12157 #endif
12158 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12159 }
12160 }
12161
12164 {
12165 int item_count = 0;
12167
12168 if (GetInventory().GetCargo() != NULL)
12169 {
12170 item_count = GetInventory().GetCargo().GetItemCount();
12171 }
12172
12173 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12174 {
12175 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12176 if (item)
12177 item_count += item.GetNumberOfItems();
12178 }
12179 return item_count;
12180 }
12181
12184 {
12185 float weight = 0;
12186 float wetness = 1;
12187 if (include_wetness)
12190 {
12191 weight = wetness * m_ConfigWeight;
12192 }
12194 {
12195 weight = 1;
12196 }
12197 return weight;
12198 }
12199
12200
12201
12203 {
12204 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12205 {
12206 GameInventory inv = GetInventory();
12207 array<EntityAI> items = new array<EntityAI>;
12209 for (int i = 0; i < items.Count(); i++)
12210 {
12212 if (item)
12213 {
12215 }
12216 }
12217 }
12218 }
12219
12220
12221
12222
12224 {
12225 float energy = 0;
12226 if (HasEnergyManager())
12227 {
12228 energy = GetCompEM().GetEnergy();
12229 }
12230 return energy;
12231 }
12232
12233
12235 {
12236 super.OnEnergyConsumed();
12237
12239 }
12240
12242 {
12243 super.OnEnergyAdded();
12244
12246 }
12247
12248
12250 {
12251 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12252 {
12254 {
12255 float energy_0to1 = GetCompEM().GetEnergy0To1();
12257 }
12258 }
12259 }
12260
12261
12263 {
12264 return ConfigGetFloat("heatIsolation");
12265 }
12266
12268 {
12270 }
12271
12273 {
12274 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12275 if (
GetGame().ConfigIsExisting(paramPath))
12277
12278 return 0.0;
12279 }
12280
12282 {
12283 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12284 if (
GetGame().ConfigIsExisting(paramPath))
12286
12287 return 0.0;
12288 }
12289
12290 override void SetWet(
float value,
bool allow_client =
false)
12291 {
12292 if (!IsServerCheck(allow_client))
12293 return;
12294
12297
12299
12300 m_VarWet = Math.Clamp(value, min, max);
12301
12303 {
12306 }
12307 }
12308
12309 override void AddWet(
float value)
12310 {
12312 }
12313
12315 {
12317 }
12318
12320 {
12322 }
12323
12325 {
12327 }
12328
12330 {
12332 }
12333
12335 {
12337 }
12338
12339 override void OnWetChanged(
float newVal,
float oldVal)
12340 {
12343 if (newLevel != oldLevel)
12344 {
12346 }
12347 }
12348
12350 {
12351 SetWeightDirty();
12352 }
12353
12355 {
12356 return GetWetLevelInternal(
m_VarWet);
12357 }
12358
12359
12360
12362 {
12364 }
12365
12367 {
12369 }
12370
12372 {
12374 }
12375
12377 {
12379 }
12380
12381
12382
12384 {
12385 if (ConfigIsExisting("itemModelLength"))
12386 {
12387 return ConfigGetFloat("itemModelLength");
12388 }
12389 return 0;
12390 }
12391
12393 {
12394 if (ConfigIsExisting("itemAttachOffset"))
12395 {
12396 return ConfigGetFloat("itemAttachOffset");
12397 }
12398 return 0;
12399 }
12400
12401 override void SetCleanness(
int value,
bool allow_client =
false)
12402 {
12403 if (!IsServerCheck(allow_client))
12404 return;
12405
12407
12409
12412 }
12413
12415 {
12417 }
12418
12420 {
12421 return true;
12422 }
12423
12424
12425
12426
12428 {
12430 }
12431
12433 {
12435 }
12436
12437
12438
12439
12440 override void SetColor(
int r,
int g,
int b,
int a)
12441 {
12447 }
12449 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12450 {
12455 }
12456
12458 {
12460 }
12461
12464 {
12465 int r,g,b,a;
12467 r = r/255;
12468 g = g/255;
12469 b = b/255;
12470 a = a/255;
12471 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12472 }
12473
12474
12475
12476 override void SetLiquidType(
int value,
bool allow_client =
false)
12477 {
12478 if (!IsServerCheck(allow_client))
12479 return;
12480
12485 }
12486
12488 {
12489 return ConfigGetInt("varLiquidTypeInit");
12490 }
12491
12493 {
12495 }
12496
12498 {
12500 SetFrozen(false);
12501 }
12502
12505 {
12506 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12507 }
12508
12509
12512 {
12513 PlayerBase nplayer;
12514 if (PlayerBase.CastTo(nplayer, player))
12515 {
12517
12518 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12519 }
12520 }
12521
12522
12525 {
12526 PlayerBase nplayer;
12527 if (PlayerBase.CastTo(nplayer,player))
12528 {
12529
12530 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12531
12532 }
12533
12534
12535 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12536
12537
12538 if (HasEnergyManager())
12539 {
12540 GetCompEM().UpdatePlugState();
12541 }
12542 }
12543
12544
12546 {
12547 super.OnPlacementStarted(player);
12548
12550 }
12551
12552 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12553 {
12555 {
12556 m_AdminLog.OnPlacementComplete(player,
this);
12557 }
12558
12559 super.OnPlacementComplete(player, position, orientation);
12560 }
12561
12562
12563
12564
12565
12567 {
12569 {
12570 return true;
12571 }
12572 else
12573 {
12574 return false;
12575 }
12576 }
12577
12578
12580 {
12582 {
12584 }
12585 }
12586
12587
12589 {
12591 }
12592
12594 {
12596 }
12597
12598 override void InsertAgent(
int agent,
float count = 1)
12599 {
12600 if (count < 1)
12601 return;
12602
12604 }
12605
12608 {
12610 }
12611
12612
12614 {
12616 }
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12660 {
12662 return false;
12663 return true;
12664 }
12665
12667 {
12668
12670 }
12671
12672
12675 {
12676 super.CheckForRoofLimited(timeTresholdMS);
12677
12679 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12680 {
12681 m_PreviousRoofTestTime = time;
12682 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12683 }
12684 }
12685
12686
12688 {
12690 {
12691 return 0;
12692 }
12693
12694 if (GetInventory().GetAttachmentSlotsCount() != 0)
12695 {
12696 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12697 if (filter)
12698 return filter.GetProtectionLevel(type, false, system);
12699 else
12700 return 0;
12701 }
12702
12703 string subclassPath, entryName;
12704
12705 switch (type)
12706 {
12708 entryName = "biological";
12709 break;
12711 entryName = "chemical";
12712 break;
12713 default:
12714 entryName = "biological";
12715 break;
12716 }
12717
12718 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12719
12721 }
12722
12723
12724
12727 {
12728 if (!IsMagazine())
12730
12732 }
12733
12734
12735
12736
12737
12742 {
12743 return true;
12744 }
12745
12747 {
12749 }
12750
12751
12752
12753
12754
12756 {
12757 if (parent)
12758 {
12759 if (parent.IsInherited(DayZInfected))
12760 return true;
12761
12762 if (!parent.IsRuined())
12763 return true;
12764 }
12765
12766 return true;
12767 }
12768
12770 {
12771 if (!super.CanPutAsAttachment(parent))
12772 {
12773 return false;
12774 }
12775
12776 if (!IsRuined() && !parent.IsRuined())
12777 {
12778 return true;
12779 }
12780
12781 return false;
12782 }
12783
12785 {
12786
12787
12788
12789
12790 return super.CanReceiveItemIntoCargo(item);
12791 }
12792
12794 {
12795
12796
12797
12798
12799 GameInventory attachmentInv = attachment.GetInventory();
12801 {
12802 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12803 return false;
12804 }
12805
12806 InventoryLocation loc = new InventoryLocation();
12807 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12808 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12809 return false;
12810
12811 return super.CanReceiveAttachment(attachment, slotId);
12812 }
12813
12815 {
12816 if (!super.CanReleaseAttachment(attachment))
12817 return false;
12818
12819 return GetInventory().AreChildrenAccessible();
12820 }
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12843 {
12844 int id = muzzle_owner.GetMuzzleID();
12845 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12846
12847 if (WPOF_array)
12848 {
12849 for (int i = 0; i < WPOF_array.Count(); i++)
12850 {
12851 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12852
12853 if (WPOF)
12854 {
12855 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12856 }
12857 }
12858 }
12859 }
12860
12861
12863 {
12864 int id = muzzle_owner.GetMuzzleID();
12866
12867 if (WPOBE_array)
12868 {
12869 for (int i = 0; i < WPOBE_array.Count(); i++)
12870 {
12871 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12872
12873 if (WPOBE)
12874 {
12875 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12876 }
12877 }
12878 }
12879 }
12880
12881
12883 {
12884 int id = muzzle_owner.GetMuzzleID();
12885 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12886
12887 if (WPOOH_array)
12888 {
12889 for (int i = 0; i < WPOOH_array.Count(); i++)
12890 {
12891 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12892
12893 if (WPOOH)
12894 {
12895 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12896 }
12897 }
12898 }
12899 }
12900
12901
12903 {
12904 int id = muzzle_owner.GetMuzzleID();
12905 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12906
12907 if (WPOOH_array)
12908 {
12909 for (int i = 0; i < WPOOH_array.Count(); i++)
12910 {
12911 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12912
12913 if (WPOOH)
12914 {
12915 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12916 }
12917 }
12918 }
12919 }
12920
12921
12923 {
12924 int id = muzzle_owner.GetMuzzleID();
12925 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12926
12927 if (WPOOH_array)
12928 {
12929 for (int i = 0; i < WPOOH_array.Count(); i++)
12930 {
12931 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12932
12933 if (WPOOH)
12934 {
12935 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12936 }
12937 }
12938 }
12939 }
12940
12941
12942
12944 {
12946 {
12947 return true;
12948 }
12949
12950 return false;
12951 }
12952
12954 {
12956 {
12957 return true;
12958 }
12959
12960 return false;
12961 }
12962
12964 {
12966 {
12967 return true;
12968 }
12969
12970 return false;
12971 }
12972
12974 {
12975 return false;
12976 }
12977
12980 {
12981 return UATimeSpent.DEFAULT_DEPLOY;
12982 }
12983
12984
12985
12986
12988 {
12990 SetSynchDirty();
12991 }
12992
12994 {
12996 }
12997
12998
13000 {
13001 return false;
13002 }
13003
13006 {
13007 string att_type = "None";
13008
13009 if (ConfigIsExisting("soundAttType"))
13010 {
13011 att_type = ConfigGetString("soundAttType");
13012 }
13013
13015 }
13016
13018 {
13020 }
13021
13022
13023
13024
13025
13029
13031 {
13034
13036 }
13037
13038
13040 {
13042 return;
13043
13045
13048
13051
13052 SoundParameters params = new SoundParameters();
13056 }
13057
13058
13060 {
13062 return;
13063
13065 SetSynchDirty();
13066
13069 }
13070
13071
13073 {
13075 return;
13076
13078 SetSynchDirty();
13079
13082 }
13083
13085 {
13087 }
13088
13090 {
13092 }
13093
13096 {
13097 if (!
GetGame().IsDedicatedServer())
13098 {
13099 if (ConfigIsExisting("attachSoundSet"))
13100 {
13101 string cfg_path = "";
13102 string soundset = "";
13103 string type_name =
GetType();
13104
13107 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13108 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13109
13110 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13111 {
13112 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13113 {
13114 if (cfg_slot_array[i] == slot_type)
13115 {
13116 soundset = cfg_soundset_array[i];
13117 break;
13118 }
13119 }
13120 }
13121
13122 if (soundset != "")
13123 {
13124 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13126 }
13127 }
13128 }
13129 }
13130
13132 {
13133
13134 }
13135
13136 void OnApply(PlayerBase player);
13137
13139 {
13140 return 1.0;
13141 };
13142
13144 {
13146 }
13147
13149 {
13151 }
13152
13154
13156 {
13157 SetDynamicPhysicsLifeTime(0.01);
13159 }
13160
13162 {
13163 array<string> zone_names = new array<string>;
13164 GetDamageZones(zone_names);
13165 for (int i = 0; i < zone_names.Count(); i++)
13166 {
13167 SetHealthMax(zone_names.Get(i),"Health");
13168 }
13169 SetHealthMax("","Health");
13170 }
13171
13174 {
13175 float global_health = GetHealth01("","Health");
13176 array<string> zones = new array<string>;
13177 GetDamageZones(zones);
13178
13179 for (int i = 0; i < zones.Count(); i++)
13180 {
13181 SetHealth01(zones.Get(i),"Health",global_health);
13182 }
13183 }
13184
13187 {
13188 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13189 }
13190
13192 {
13193 if (!hasRootAsPlayer)
13194 {
13195 if (refParentIB)
13196 {
13197
13198 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13199 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13200
13201 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13202 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13203
13206 }
13207 else
13208 {
13209
13212 }
13213 }
13214 }
13215
13217 {
13219 {
13220 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13221 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13222 {
13223 float heatPermCoef = 1.0;
13225 while (ent)
13226 {
13227 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13228 ent = ent.GetHierarchyParent();
13229 }
13230
13231 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13232 }
13233 }
13234 }
13235
13237 {
13238
13239 EntityAI parent = GetHierarchyParent();
13240 if (!parent)
13241 {
13242 hasParent = false;
13243 hasRootAsPlayer = false;
13244 }
13245 else
13246 {
13247 hasParent = true;
13248 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13249 refParentIB =
ItemBase.Cast(parent);
13250 }
13251 }
13252
13253 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13254 {
13255
13256 }
13257
13259 {
13260
13261 return false;
13262 }
13263
13265 {
13266
13267
13268 return false;
13269 }
13270
13272 {
13273
13274 return false;
13275 }
13276
13279 {
13280 return !GetIsFrozen() &&
IsOpen();
13281 }
13282
13284 {
13285 bool hasParent = false, hasRootAsPlayer = false;
13287
13288 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13289 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13290
13291 if (wwtu || foodDecay)
13292 {
13296
13297 if (processWetness || processTemperature || processDecay)
13298 {
13300
13301 if (processWetness)
13302 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13303
13304 if (processTemperature)
13306
13307 if (processDecay)
13308 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13309 }
13310 }
13311 }
13312
13315 {
13317 }
13318
13320 {
13323
13324 return super.GetTemperatureFreezeThreshold();
13325 }
13326
13328 {
13331
13332 return super.GetTemperatureThawThreshold();
13333 }
13334
13336 {
13339
13340 return super.GetItemOverheatThreshold();
13341 }
13342
13344 {
13346 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13347
13348 return super.GetTemperatureFreezeTime();
13349 }
13350
13352 {
13354 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13355
13356 return super.GetTemperatureThawTime();
13357 }
13358
13363
13365 {
13366 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13367 }
13368
13370 {
13371 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13372 }
13373
13376 {
13378 }
13379
13381 {
13383 }
13384
13386 {
13388 }
13389
13392 {
13393 return null;
13394 }
13395
13398 {
13399 return false;
13400 }
13401
13403 {
13405 {
13408 if (!trg)
13409 {
13411 explosive = this;
13412 }
13413
13414 explosive.PairRemote(trg);
13416
13417 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13418 trg.SetPersistentPairID(persistentID);
13419 explosive.SetPersistentPairID(persistentID);
13420
13421 return true;
13422 }
13423 return false;
13424 }
13425
13428 {
13429 float ret = 1.0;
13432 ret *= GetHealth01();
13433
13434 return ret;
13435 }
13436
13437 #ifdef DEVELOPER
13438 override void SetDebugItem()
13439 {
13440 super.SetDebugItem();
13441 _itemBase = this;
13442 }
13443
13445 {
13446 string text = super.GetDebugText();
13447
13449 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13450
13451 return text;
13452 }
13453 #endif
13454
13456 {
13457 return true;
13458 }
13459
13461
13463
13465 {
13468 }
13469
13470
13478
13494}
13495
13497{
13499 if (entity)
13500 {
13501 bool is_item = entity.IsInherited(
ItemBase);
13502 if (is_item && full_quantity)
13503 {
13506 }
13507 }
13508 else
13509 {
13511 return NULL;
13512 }
13513 return entity;
13514}
13515
13517{
13518 if (item)
13519 {
13520 if (health > 0)
13521 item.SetHealth("", "", health);
13522
13523 if (item.CanHaveTemperature())
13524 {
13526 if (item.CanFreeze())
13527 item.SetFrozen(false);
13528 }
13529
13530 if (item.HasEnergyManager())
13531 {
13532 if (quantity >= 0)
13533 {
13534 item.GetCompEM().SetEnergy0To1(quantity);
13535 }
13536 else
13537 {
13539 }
13540 }
13541 else if (item.IsMagazine())
13542 {
13543 Magazine mag = Magazine.Cast(item);
13544 if (quantity >= 0)
13545 {
13546 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13547 }
13548 else
13549 {
13551 }
13552
13553 }
13554 else
13555 {
13556 if (quantity >= 0)
13557 {
13558 item.SetQuantityNormalized(quantity, false);
13559 }
13560 else
13561 {
13563 }
13564
13565 }
13566 }
13567}
13568
13569#ifdef DEVELOPER
13571#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.