8733{
8735 {
8736 return true;
8737 }
8738};
8739
8740
8741
8743{
8747
8749
8752
8753
8754
8755
8756
8765
8771
8776
8781
8802 protected bool m_IsResultOfSplit
8803
8805
8810
8811
8812
8814
8818
8819
8820
8822
8825
8826
8827
8833
8834
8842
8845
8846
8848
8849
8851
8852
8857
8858
8863
8864
8866
8867
8869 {
8874
8875 if (!
GetGame().IsDedicatedServer())
8876 {
8878 {
8880
8882 {
8884 }
8885 }
8886
8889 }
8890
8891 m_OldLocation = null;
8892
8894 {
8896 }
8897
8898 if (ConfigIsExisting("headSelectionsToHide"))
8899 {
8902 }
8903
8905 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8906 {
8908 }
8909
8911
8912 m_IsResultOfSplit = false;
8913
8915 }
8916
8918 {
8919 super.InitItemVariables();
8920
8926 m_Count = ConfigGetInt(
"count");
8927
8930
8935
8938
8943
8955
8959
8960
8963 if (ConfigIsExisting("canBeSplit"))
8964 {
8967 }
8968
8970 if (ConfigIsExisting("itemBehaviour"))
8972
8973
8976 RegisterNetSyncVariableInt("m_VarLiquidType");
8977 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8978
8979 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8980 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8981 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8982
8983 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8984 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8985 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8986 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8987
8988 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8989 RegisterNetSyncVariableBool("m_IsTakeable");
8990 RegisterNetSyncVariableBool("m_IsHologram");
8991
8994 {
8997 }
8998
9000
9002 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9004
9005 }
9006
9008 {
9010 }
9011
9013 {
9016 {
9021 }
9022 }
9023
9024 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9025 {
9027 {
9030 }
9031
9033 }
9034
9036 {
9042 }
9043
9045
9047 {
9049
9050 if (!action)
9051 {
9052 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9053 return;
9054 }
9055
9057 if (!ai)
9058 {
9060 return;
9061 }
9062
9064 if (!action_array)
9065 {
9066 action_array = new array<ActionBase_Basic>;
9068 }
9069 if (LogManager.IsActionLogEnable())
9070 {
9071 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9072 }
9073
9074 if (action_array.Find(action) != -1)
9075 {
9076 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9077 }
9078 else
9079 {
9080 action_array.Insert(action);
9081 }
9082 }
9083
9085 {
9087 ActionBase action = player.GetActionManager().GetAction(actionName);
9090
9091 if (action_array)
9092 {
9093 action_array.RemoveItem(action);
9094 }
9095 }
9096
9097
9098
9100 {
9101 ActionOverrideData overrideData = new ActionOverrideData();
9105
9107 if (!actionMap)
9108 {
9111 }
9112
9113 actionMap.Insert(this.
Type(), overrideData);
9114
9115 }
9116
9118
9120
9121
9123 {
9126
9129
9130 string config_to_search = "CfgVehicles";
9131 string muzzle_owner_config;
9132
9134 {
9135 if (IsInherited(Weapon))
9136 config_to_search = "CfgWeapons";
9137
9138 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9139
9140 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9141
9143
9144 if (config_OnFire_subclass_count > 0)
9145 {
9146 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9147
9148 for (int i = 0; i < config_OnFire_subclass_count; i++)
9149 {
9150 string particle_class = "";
9152 string config_OnFire_entry = config_OnFire_class + particle_class;
9153 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9154 WPOF_array.Insert(WPOF);
9155 }
9156
9157
9159 }
9160 }
9161
9163 {
9164 config_to_search = "CfgWeapons";
9165 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9166
9167 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9168
9170
9171 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9172 {
9173 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9174
9175 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9176 {
9177 string particle_class2 = "";
9179 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9180 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9181 WPOBE_array.Insert(WPOBE);
9182 }
9183
9184
9186 }
9187 }
9188 }
9189
9190
9192 {
9195
9197 {
9198 string config_to_search = "CfgVehicles";
9199
9200 if (IsInherited(Weapon))
9201 config_to_search = "CfgWeapons";
9202
9203 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9204 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9205
9206 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9207 {
9208
9210
9212 {
9214 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9216 return;
9217 }
9218
9221
9222
9223
9225 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9226
9227 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9228 {
9229 string particle_class = "";
9231 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9233
9234 if (entry_type == CT_CLASS)
9235 {
9236 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9237 WPOOH_array.Insert(WPOF);
9238 }
9239 }
9240
9241
9243 }
9244 }
9245 }
9246
9248 {
9250 }
9251
9253 {
9255 {
9257
9260
9263
9264 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9265 }
9266 }
9267
9269 {
9271 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9272
9274 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9275
9277 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9278
9280 {
9282 }
9283 }
9284
9286 {
9288 }
9289
9291 {
9294 else
9296
9298 {
9301 }
9302 else
9303 {
9306
9309 }
9310
9312 }
9313
9315 {
9317 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9318 }
9319
9321 {
9323 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9325 }
9326
9328 {
9330 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9331 }
9332
9334 {
9337
9338 OverheatingParticle OP = new OverheatingParticle();
9343
9345 }
9346
9348 {
9351
9352 return -1;
9353 }
9354
9356 {
9358 {
9361
9362 for (int i = count; i > 0; --i)
9363 {
9364 int id = i - 1;
9367
9370
9371 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9372 {
9373 if (p)
9374 {
9377 }
9378 }
9379 }
9380 }
9381 }
9382
9384 {
9386 {
9388 {
9389 int id = i - 1;
9391
9392 if (OP)
9393 {
9395
9396 if (p)
9397 {
9399 }
9400
9401 delete OP;
9402 }
9403 }
9404
9407 }
9408 }
9409
9412 {
9413 return 0.0;
9414 }
9415
9416
9418 {
9419 return 250;
9420 }
9421
9423 {
9424 return 0;
9425 }
9426
9429 {
9431 return true;
9432
9433 return false;
9434 }
9435
9438 {
9441
9443 {
9445 }
9446 else
9447 {
9448
9450 }
9451
9453 }
9454
9461 {
9462 return -1;
9463 }
9464
9465
9466
9467
9469 {
9471 {
9473 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9474
9475 if (r_index >= 0)
9476 {
9477 InventoryLocation r_il = new InventoryLocation;
9478 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9479
9480 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9483 {
9484 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9485 }
9487 {
9488 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9489 }
9490
9491 }
9492
9493 player.GetHumanInventory().ClearUserReservedLocation(this);
9494 }
9495
9498 }
9499
9500
9501
9502
9504 {
9505 return ItemBase.m_DebugActionsMask;
9506 }
9507
9509 {
9510 return ItemBase.m_DebugActionsMask & mask;
9511 }
9512
9514 {
9515 ItemBase.m_DebugActionsMask = mask;
9516 }
9517
9519 {
9520 ItemBase.m_DebugActionsMask |= mask;
9521 }
9522
9524 {
9525 ItemBase.m_DebugActionsMask &= ~mask;
9526 }
9527
9529 {
9531 {
9533 }
9534 else
9535 {
9537 }
9538 }
9539
9540
9542 {
9543 if (GetEconomyProfile())
9544 {
9545 float q_max = GetEconomyProfile().GetQuantityMax();
9546 if (q_max > 0)
9547 {
9548 float q_min = GetEconomyProfile().GetQuantityMin();
9549 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9550
9552 {
9553 ComponentEnergyManager comp = GetCompEM();
9555 {
9557 }
9558 }
9560 {
9562
9563 }
9564
9565 }
9566 }
9567 }
9568
9571 {
9572 EntityAI parent = GetHierarchyParent();
9573
9574 if (parent)
9575 {
9576 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9577 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9578 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9579 }
9580 }
9581
9584 {
9585 EntityAI parent = GetHierarchyParent();
9586
9587 if (parent)
9588 {
9589 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9590 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9591 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9592 }
9593 }
9594
9596 {
9597
9598
9599
9600
9602
9604 {
9605 if (ScriptInputUserData.CanStoreInputUserData())
9606 {
9607 ScriptInputUserData ctx = new ScriptInputUserData;
9613 ctx.
Write(use_stack_max);
9616
9618 {
9619 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9620 }
9621 }
9622 }
9623 else if (!
GetGame().IsMultiplayer())
9624 {
9626 }
9627 }
9628
9630 {
9632 }
9633
9635 {
9637 }
9638
9640 {
9642 }
9643
9645 {
9646
9647 return false;
9648 }
9649
9651 {
9652 return false;
9653 }
9654
9658 {
9659 return false;
9660 }
9661
9663 {
9664 return "";
9665 }
9666
9668
9670 {
9671 return false;
9672 }
9673
9675 {
9676 return true;
9677 }
9678
9679
9680
9682 {
9683 return true;
9684 }
9685
9687 {
9688 return true;
9689 }
9690
9692 {
9693 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9695 }
9696
9698 {
9700 }
9701
9703 {
9705 if (!is_being_placed)
9707 SetSynchDirty();
9708 }
9709
9710
9712
9714 {
9716 }
9717
9719 {
9721 }
9722
9724 {
9725 return 1;
9726 }
9727
9729 {
9730 return false;
9731 }
9732
9734 {
9736 SetSynchDirty();
9737 }
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9774 {
9775 super.OnMovedInsideCargo(container);
9776
9777 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9778 }
9779
9780 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9781 {
9782 super.EEItemLocationChanged(oldLoc,newLoc);
9783
9784 PlayerBase new_player = null;
9785 PlayerBase old_player = null;
9786
9787 if (newLoc.GetParent())
9788 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9789
9790 if (oldLoc.GetParent())
9791 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9792
9794 {
9795 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9796
9797 if (r_index >= 0)
9798 {
9799 InventoryLocation r_il = new InventoryLocation;
9800 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9801
9802 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9805 {
9806 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9807 }
9809 {
9810 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9811 }
9812
9813 }
9814 }
9815
9817 {
9818 if (new_player)
9819 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9820
9821 if (new_player == old_player)
9822 {
9823
9824 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9825 {
9827 {
9828 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9829 {
9830 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9831 }
9832 }
9833 else
9834 {
9835 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9836 }
9837 }
9838
9839 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9840 {
9841 int type = oldLoc.GetType();
9843 {
9844 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9845 }
9847 {
9848 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9849 }
9850 }
9851 if (!m_OldLocation)
9852 {
9853 m_OldLocation = new InventoryLocation;
9854 }
9855 m_OldLocation.Copy(oldLoc);
9856 }
9857 else
9858 {
9859 if (m_OldLocation)
9860 {
9861 m_OldLocation.Reset();
9862 }
9863 }
9864
9866 }
9867 else
9868 {
9869 if (new_player)
9870 {
9871 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9872 if (res_index >= 0)
9873 {
9874 InventoryLocation il = new InventoryLocation;
9875 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9877 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9880 {
9881 il.
GetParent().GetOnReleaseLock().Invoke(it);
9882 }
9884 {
9886 }
9887
9888 }
9889 }
9891 {
9892
9894 }
9895
9896 if (m_OldLocation)
9897 {
9898 m_OldLocation.Reset();
9899 }
9900 }
9901 }
9902
9903 override void EOnContact(IEntity other, Contact extra)
9904 {
9906 {
9907 int liquidType = -1;
9909 if (impactSpeed > 0.0)
9910 {
9912 #ifndef SERVER
9914 #else
9916 SetSynchDirty();
9917 #endif
9919 }
9920 }
9921
9922 #ifdef SERVER
9923 if (GetCompEM() && GetCompEM().IsPlugged())
9924 {
9925 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9926 GetCompEM().UnplugThis();
9927 }
9928 #endif
9929 }
9930
9932
9934 {
9936 }
9937
9939 {
9940
9941 }
9942
9944 {
9945 super.OnItemLocationChanged(old_owner, new_owner);
9946
9947 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9948 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9949
9950 if (!relatedPlayer && playerNew)
9951 relatedPlayer = playerNew;
9952
9953 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9954 {
9956 if (actionMgr)
9957 {
9958 ActionBase currentAction = actionMgr.GetRunningAction();
9959 if (currentAction)
9961 }
9962 }
9963
9964 Man ownerPlayerOld = null;
9965 Man ownerPlayerNew = null;
9966
9967 if (old_owner)
9968 {
9969 if (old_owner.
IsMan())
9970 {
9971 ownerPlayerOld = Man.Cast(old_owner);
9972 }
9973 else
9974 {
9975 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9976 }
9977 }
9978 else
9979 {
9981 {
9983
9984 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9985 {
9986 GetCompEM().UnplugThis();
9987 }
9988 }
9989 }
9990
9991 if (new_owner)
9992 {
9993 if (new_owner.
IsMan())
9994 {
9995 ownerPlayerNew = Man.Cast(new_owner);
9996 }
9997 else
9998 {
9999 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10000 }
10001 }
10002
10003 if (ownerPlayerOld != ownerPlayerNew)
10004 {
10005 if (ownerPlayerOld)
10006 {
10007 array<EntityAI> subItemsExit = new array<EntityAI>;
10009 for (int i = 0; i < subItemsExit.Count(); i++)
10010 {
10013 }
10014 }
10015
10016 if (ownerPlayerNew)
10017 {
10018 array<EntityAI> subItemsEnter = new array<EntityAI>;
10020 for (int j = 0; j < subItemsEnter.Count(); j++)
10021 {
10024 }
10025 }
10026 }
10027 else if (ownerPlayerNew != null)
10028 {
10029 PlayerBase nplayer;
10030 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10031 {
10032 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10034 for (int k = 0; k < subItemsUpdate.Count(); k++)
10035 {
10037 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10038 }
10039 }
10040 }
10041
10042 if (old_owner)
10043 old_owner.OnChildItemRemoved(this);
10044 if (new_owner)
10045 new_owner.OnChildItemReceived(this);
10046 }
10047
10048
10050 {
10051 super.EEDelete(parent);
10052 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10053 if (player)
10054 {
10056
10057 if (player.IsAlive())
10058 {
10059 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10060 if (r_index >= 0)
10061 {
10062 InventoryLocation r_il = new InventoryLocation;
10063 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10064
10065 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10068 {
10069 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10070 }
10072 {
10073 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10074 }
10075
10076 }
10077
10078 player.RemoveQuickBarEntityShortcut(this);
10079 }
10080 }
10081 }
10082
10084 {
10085 super.EEKilled(killer);
10086
10089 {
10090 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10091 {
10092 if (IsMagazine())
10093 {
10094 if (Magazine.Cast(this).GetAmmoCount() > 0)
10095 {
10097 }
10098 }
10099 else
10100 {
10102 }
10103 }
10104 }
10105 }
10106
10108 {
10109 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10110
10111 super.OnWasAttached(parent, slot_id);
10112
10115
10117 }
10118
10120 {
10121 super.OnWasDetached(parent, slot_id);
10122
10125 }
10126
10128 {
10129 int idx;
10132
10133 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10134 if (inventory_slots.Count() < 1)
10135 {
10136 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10137 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10138 }
10139 else
10140 {
10141 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10142 }
10143
10144 idx = inventory_slots.Find(slot);
10145 if (idx < 0)
10146 return "";
10147
10148 return attach_types.Get(idx);
10149 }
10150
10152 {
10153 int idx = -1;
10154 string slot;
10155
10158
10159 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10160 if (inventory_slots.Count() < 1)
10161 {
10162 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10163 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10164 }
10165 else
10166 {
10167 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10168 if (detach_types.Count() < 1)
10169 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10170 }
10171
10172 for (int i = 0; i < inventory_slots.Count(); i++)
10173 {
10174 slot = inventory_slots.Get(i);
10175 }
10176
10177 if (slot != "")
10178 {
10179 if (detach_types.Count() == 1)
10180 idx = 0;
10181 else
10182 idx = inventory_slots.Find(slot);
10183 }
10184 if (idx < 0)
10185 return "";
10186
10187 return detach_types.Get(idx);
10188 }
10189
10191 {
10192
10194
10195
10196 float min_time = 1;
10197 float max_time = 3;
10198 float delay = Math.RandomFloat(min_time, max_time);
10199
10200 explode_timer.Run(delay, this, "DoAmmoExplosion");
10201 }
10202
10204 {
10205 Magazine magazine = Magazine.Cast(this);
10206 int pop_sounds_count = 6;
10207 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10208
10209
10210 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10211 string sound_name = pop_sounds[ sound_idx ];
10213
10214
10215 magazine.ServerAddAmmoCount(-1);
10216
10217
10218 float min_temp_to_explode = 100;
10219
10220 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10221 {
10223 }
10224 }
10225
10226
10227 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10228 {
10229 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10230
10231 const int CHANCE_DAMAGE_CARGO = 4;
10232 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10233 const int CHANCE_DAMAGE_NOTHING = 2;
10234
10236 {
10237 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10238 int chances;
10239 int rnd;
10240
10241 if (GetInventory().GetCargo())
10242 {
10243 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10244 rnd = Math.RandomInt(0,chances);
10245
10246 if (rnd < CHANCE_DAMAGE_CARGO)
10247 {
10249 }
10250 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10251 {
10253 }
10254 }
10255 else
10256 {
10257 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10258 rnd = Math.RandomInt(0,chances);
10259
10260 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10261 {
10263 }
10264 }
10265 }
10266 }
10267
10269 {
10270 if (GetInventory().GetCargo())
10271 {
10272 int item_count = GetInventory().GetCargo().GetItemCount();
10273 if (item_count > 0)
10274 {
10275 int random_pick = Math.RandomInt(0, item_count);
10277 if (!item.IsExplosive())
10278 {
10279 item.AddHealth("","",damage);
10280 return true;
10281 }
10282 }
10283 }
10284 return false;
10285 }
10286
10288 {
10289 int attachment_count = GetInventory().AttachmentCount();
10290 if (attachment_count > 0)
10291 {
10292 int random_pick = Math.RandomInt(0, attachment_count);
10293 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10294 if (!attachment.IsExplosive())
10295 {
10296 attachment.AddHealth("","",damage);
10297 return true;
10298 }
10299 }
10300 return false;
10301 }
10302
10304 {
10306 }
10307
10309 {
10311 return GetInventory().CanRemoveEntity();
10312
10313 return false;
10314 }
10315
10317 {
10319 return;
10320
10322 {
10323 if (ScriptInputUserData.CanStoreInputUserData())
10324 {
10325 ScriptInputUserData ctx = new ScriptInputUserData;
10330 ctx.
Write(destination_entity);
10332 ctx.
Write(slot_id);
10334 }
10335 }
10336 else if (!
GetGame().IsMultiplayer())
10337 {
10339 }
10340 }
10341
10343 {
10345 return;
10346
10347 float split_quantity_new;
10351 InventoryLocation loc = new InventoryLocation;
10352
10353 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10354 {
10356 split_quantity_new = stack_max;
10357 else
10359
10360 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10361 if (new_item)
10362 {
10363 new_item.SetResultOfSplit(true);
10364 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10366 new_item.SetQuantity(split_quantity_new);
10367 }
10368 }
10369 else if (destination_entity && slot_id == -1)
10370 {
10371 if (quantity > stack_max)
10372 split_quantity_new = stack_max;
10373 else
10374 split_quantity_new = quantity;
10375
10377 {
10380 }
10381
10382 if (new_item)
10383 {
10384 new_item.SetResultOfSplit(true);
10385 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10387 new_item.SetQuantity(split_quantity_new);
10388 }
10389 }
10390 else
10391 {
10392 if (stack_max != 0)
10393 {
10395 {
10397 }
10398
10399 if (split_quantity_new == 0)
10400 {
10401 if (!
GetGame().IsMultiplayer())
10402 player.PhysicalPredictiveDropItem(this);
10403 else
10404 player.ServerDropEntity(this);
10405 return;
10406 }
10407
10409
10410 if (new_item)
10411 {
10412 new_item.SetResultOfSplit(true);
10413 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10415 new_item.SetQuantity(stack_max);
10416 new_item.PlaceOnSurface();
10417 }
10418 }
10419 }
10420 }
10421
10423 {
10425 return;
10426
10427 float split_quantity_new;
10431 InventoryLocation loc = new InventoryLocation;
10432
10433 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10434 {
10436 split_quantity_new = stack_max;
10437 else
10439
10440 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10441 if (new_item)
10442 {
10443 new_item.SetResultOfSplit(true);
10444 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10446 new_item.SetQuantity(split_quantity_new);
10447 }
10448 }
10449 else if (destination_entity && slot_id == -1)
10450 {
10451 if (quantity > stack_max)
10452 split_quantity_new = stack_max;
10453 else
10454 split_quantity_new = quantity;
10455
10457 {
10460 }
10461
10462 if (new_item)
10463 {
10464 new_item.SetResultOfSplit(true);
10465 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10467 new_item.SetQuantity(split_quantity_new);
10468 }
10469 }
10470 else
10471 {
10472 if (stack_max != 0)
10473 {
10475 {
10477 }
10478
10480
10481 if (new_item)
10482 {
10483 new_item.SetResultOfSplit(true);
10484 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10486 new_item.SetQuantity(stack_max);
10487 new_item.PlaceOnSurface();
10488 }
10489 }
10490 }
10491 }
10492
10494 {
10496 return;
10497
10499 {
10500 if (ScriptInputUserData.CanStoreInputUserData())
10501 {
10502 ScriptInputUserData ctx = new ScriptInputUserData;
10507 dst.WriteToContext(ctx);
10509 }
10510 }
10511 else if (!
GetGame().IsMultiplayer())
10512 {
10514 }
10515 }
10516
10518 {
10520 return;
10521
10523 {
10524 if (ScriptInputUserData.CanStoreInputUserData())
10525 {
10526 ScriptInputUserData ctx = new ScriptInputUserData;
10531 ctx.
Write(destination_entity);
10537 }
10538 }
10539 else if (!
GetGame().IsMultiplayer())
10540 {
10542 }
10543 }
10544
10546 {
10548 }
10549
10551 {
10553 return this;
10554
10556 float split_quantity_new;
10558 if (dst.IsValid())
10559 {
10560 int slot_id = dst.GetSlot();
10562
10563 if (quantity > stack_max)
10564 split_quantity_new = stack_max;
10565 else
10566 split_quantity_new = quantity;
10567
10569
10570 if (new_item)
10571 {
10572 new_item.SetResultOfSplit(true);
10573 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10576 }
10577
10578 return new_item;
10579 }
10580
10581 return null;
10582 }
10583
10585 {
10587 return;
10588
10590 float split_quantity_new;
10592 if (destination_entity)
10593 {
10595 if (quantity > stackable)
10596 split_quantity_new = stackable;
10597 else
10598 split_quantity_new = quantity;
10599
10600 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10601 if (new_item)
10602 {
10603 new_item.SetResultOfSplit(true);
10604 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10606 new_item.SetQuantity(split_quantity_new);
10607 }
10608 }
10609 }
10610
10612 {
10614 return;
10615
10617 {
10618 if (ScriptInputUserData.CanStoreInputUserData())
10619 {
10620 ScriptInputUserData ctx = new ScriptInputUserData;
10625 ItemBase destination_entity =
this;
10626 ctx.
Write(destination_entity);
10630 }
10631 }
10632 else if (!
GetGame().IsMultiplayer())
10633 {
10635 }
10636 }
10637
10639 {
10641 return;
10642
10644 float split_quantity_new;
10646 if (player)
10647 {
10649 if (quantity > stackable)
10650 split_quantity_new = stackable;
10651 else
10652 split_quantity_new = quantity;
10653
10654 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10655 new_item =
ItemBase.Cast(in_hands);
10656 if (new_item)
10657 {
10658 new_item.SetResultOfSplit(true);
10659 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10661 new_item.SetQuantity(split_quantity_new);
10662 }
10663 }
10664 }
10665
10667 {
10669 return;
10670
10672 float split_quantity_new = Math.Floor(quantity * 0.5);
10673
10675
10676 if (new_item)
10677 {
10678 if (new_item.GetQuantityMax() < split_quantity_new)
10679 {
10680 split_quantity_new = new_item.GetQuantityMax();
10681 }
10682
10683 new_item.SetResultOfSplit(true);
10684 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10685
10687 {
10690 }
10691 else
10692 {
10695 }
10696 }
10697 }
10698
10700 {
10702 return;
10703
10705 float split_quantity_new = Math.Floor(quantity / 2);
10706
10707 InventoryLocation invloc = new InventoryLocation;
10709
10711 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10712
10713 if (new_item)
10714 {
10715 if (new_item.GetQuantityMax() < split_quantity_new)
10716 {
10717 split_quantity_new = new_item.GetQuantityMax();
10718 }
10720 {
10723 }
10724 else
10725 {
10728 }
10729 }
10730 }
10731
10734 {
10735 SetWeightDirty();
10737
10738 if (parent)
10739 parent.OnAttachmentQuantityChangedEx(this, delta);
10740
10742 {
10744 {
10746 }
10748 {
10749 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10751 }
10752 }
10753
10754 }
10755
10758 {
10759
10760 }
10761
10764 {
10766 }
10767
10769 {
10770 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10771
10773 {
10774 if (newLevel == GameConstants.STATE_RUINED)
10775 {
10777 EntityAI parent = GetHierarchyParent();
10778 if (parent && parent.IsFireplace())
10779 {
10780 CargoBase cargo = GetInventory().GetCargo();
10781 if (cargo)
10782 {
10784 {
10786 }
10787 }
10788 }
10789 }
10790
10792 {
10793
10795 return;
10796 }
10797
10798 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10799 {
10801 }
10802 }
10803 }
10804
10805
10807 {
10808 super.OnRightClick();
10809
10811 {
10813 {
10814 if (ScriptInputUserData.CanStoreInputUserData())
10815 {
10816 vector m4[4];
10818
10819 EntityAI root = GetHierarchyRoot();
10820
10821 InventoryLocation dst = new InventoryLocation;
10823 {
10824 if (root)
10825 {
10826 root.GetTransform(m4);
10828 }
10829 else
10830 GetInventory().GetCurrentInventoryLocation(dst);
10831 }
10832 else
10833 {
10835
10836
10837 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10838 {
10839 if (root)
10840 {
10841 root.GetTransform(m4);
10843 }
10844 else
10845 GetInventory().GetCurrentInventoryLocation(dst);
10846 }
10847 else
10848 {
10849 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10850 }
10851 }
10852
10853 ScriptInputUserData ctx = new ScriptInputUserData;
10861 }
10862 }
10863 else if (!
GetGame().IsMultiplayer())
10864 {
10866 }
10867 }
10868 }
10869
10870 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10871 {
10872
10873 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10874 return false;
10875
10876 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10877 return false;
10878
10879
10881 return false;
10882
10883
10884 Magazine mag = Magazine.Cast(this);
10885 if (mag)
10886 {
10887 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10888 return false;
10889
10890 if (stack_max_limit)
10891 {
10892 Magazine other_mag = Magazine.Cast(other_item);
10893 if (other_item)
10894 {
10895 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10896 return false;
10897 }
10898
10899 }
10900 }
10901 else
10902 {
10903
10905 return false;
10906
10908 return false;
10909 }
10910
10911 PlayerBase player = null;
10912 if (CastTo(player, GetHierarchyRootPlayer()))
10913 {
10914 if (player.GetInventory().HasAttachment(this))
10915 return false;
10916
10917 if (player.IsItemsToDelete())
10918 return false;
10919 }
10920
10921 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10922 return false;
10923
10924 int slotID;
10926 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10927 return false;
10928
10929 return true;
10930 }
10931
10933 {
10935 }
10936
10938 {
10939 return m_IsResultOfSplit;
10940 }
10941
10943 {
10944 m_IsResultOfSplit = value;
10945 }
10946
10948 {
10950 }
10951
10953 {
10954 float other_item_quantity = other_item.GetQuantity();
10955 float this_free_space;
10956
10958
10960
10961 if (other_item_quantity > this_free_space)
10962 {
10963 return this_free_space;
10964 }
10965 else
10966 {
10967 return other_item_quantity;
10968 }
10969 }
10970
10972 {
10974 }
10975
10977 {
10979 return;
10980
10981 if (!IsMagazine() && other_item)
10982 {
10984 if (quantity_used != 0)
10985 {
10986 float hp1 = GetHealth01("","");
10987 float hp2 = other_item.GetHealth01("","");
10988 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10989 hpResult = hpResult / (
GetQuantity() + quantity_used);
10990
10991 hpResult *= GetMaxHealth();
10992 Math.Round(hpResult);
10993 SetHealth("", "Health", hpResult);
10994
10996 other_item.AddQuantity(-quantity_used);
10997 }
10998 }
11000 }
11001
11003 {
11004 #ifdef SERVER
11005 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11006 GetHierarchyParent().IncreaseLifetimeUp();
11007 #endif
11008 };
11009
11011 {
11012 PlayerBase p = PlayerBase.Cast(player);
11013
11014 array<int> recipesIds = p.m_Recipes;
11015 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11016 if (moduleRecipesManager)
11017 {
11018 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11019 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11020 }
11021
11022 for (int i = 0;i < recipesIds.Count(); i++)
11023 {
11024 int key = recipesIds.Get(i);
11025 string recipeName = moduleRecipesManager.GetRecipeName(key);
11027 }
11028 }
11029
11030
11031 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11032 {
11033 super.GetDebugActions(outputList);
11034
11035
11040
11041
11045
11049
11050
11053
11054
11056 {
11059 }
11060
11062
11065
11069 }
11070
11071
11072
11073
11075 {
11076 super.OnAction(action_id, player, ctx);
11077 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11078 {
11079 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11080 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11081 PlayerBase p = PlayerBase.Cast(player);
11082 if (
EActions.RECIPES_RANGE_START < 1000)
11083 {
11084 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11085 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11086 }
11087 }
11088 #ifndef SERVER
11089 else if (action_id ==
EActions.WATCH_PLAYER)
11090 {
11091 PluginDeveloper.SetDeveloperItemClientEx(player);
11092 }
11093 #endif
11095 {
11096 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11097 {
11098 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11099 OnDebugButtonPressServer(id + 1);
11100 }
11101
11102 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11103 {
11104 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11106 }
11107
11108 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11109 {
11110 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11112 }
11113
11114 else if (action_id ==
EActions.ADD_QUANTITY)
11115 {
11116 if (IsMagazine())
11117 {
11118 Magazine mag = Magazine.Cast(this);
11119 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11120 }
11121 else
11122 {
11124 }
11125
11126 if (m_EM)
11127 {
11128 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11129 }
11130
11131 }
11132
11133 else if (action_id ==
EActions.REMOVE_QUANTITY)
11134 {
11135 if (IsMagazine())
11136 {
11137 Magazine mag2 = Magazine.Cast(this);
11138 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11139 }
11140 else
11141 {
11143 }
11144 if (m_EM)
11145 {
11146 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11147 }
11148
11149 }
11150
11151 else if (action_id ==
EActions.SET_QUANTITY_0)
11152 {
11154
11155 if (m_EM)
11156 {
11157 m_EM.SetEnergy(0);
11158 }
11159 }
11160
11161 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11162 {
11164
11165 if (m_EM)
11166 {
11167 m_EM.SetEnergy(m_EM.GetEnergyMax());
11168 }
11169 }
11170
11171 else if (action_id ==
EActions.ADD_HEALTH)
11172 {
11173 AddHealth("","",GetMaxHealth("","Health")/5);
11174 }
11175 else if (action_id ==
EActions.REMOVE_HEALTH)
11176 {
11177 AddHealth("","",-GetMaxHealth("","Health")/5);
11178 }
11179 else if (action_id ==
EActions.DESTROY_HEALTH)
11180 {
11181 SetHealth01("","",0);
11182 }
11183 else if (action_id ==
EActions.WATCH_ITEM)
11184 {
11186 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11187 #ifdef DEVELOPER
11188 SetDebugDeveloper_item(this);
11189 #endif
11190 }
11191
11192 else if (action_id ==
EActions.ADD_TEMPERATURE)
11193 {
11194 AddTemperature(20);
11195
11196 }
11197
11198 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11199 {
11200 AddTemperature(-20);
11201
11202 }
11203
11204 else if (action_id ==
EActions.FLIP_FROZEN)
11205 {
11206 SetFrozen(!GetIsFrozen());
11207
11208 }
11209
11210 else if (action_id ==
EActions.ADD_WETNESS)
11211 {
11213
11214 }
11215
11216 else if (action_id ==
EActions.REMOVE_WETNESS)
11217 {
11219
11220 }
11221
11222 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11223 {
11226
11227
11228 }
11229
11230 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11231 {
11234 }
11235
11236 else if (action_id ==
EActions.MAKE_SPECIAL)
11237 {
11238 auto debugParams = DebugSpawnParams.WithPlayer(player);
11239 OnDebugSpawnEx(debugParams);
11240 }
11241
11242 else if (action_id ==
EActions.DELETE)
11243 {
11244 Delete();
11245 }
11246
11247 }
11248
11249
11250 return false;
11251 }
11252
11253
11254
11255
11259
11262
11263
11264
11266 {
11267 return false;
11268 }
11269
11270
11272 {
11273 return true;
11274 }
11275
11276
11278 {
11279 return true;
11280 }
11281
11282
11283
11285 {
11286 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11288 }
11289
11292 {
11293 return null;
11294 }
11295
11297 {
11298 return false;
11299 }
11300
11302 {
11303 return false;
11304 }
11305
11309
11310
11312 {
11313 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11314 return module_repairing.CanRepair(this, item_repair_kit);
11315 }
11316
11317
11318 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11319 {
11320 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11321 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11322 }
11323
11324
11326 {
11327
11328
11329
11330
11331
11332
11333
11334
11335 return 1;
11336 }
11337
11338
11339
11341 {
11343 }
11344
11345
11346
11348 {
11350 }
11351
11352
11361 {
11362 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11363
11364 if (player)
11365 {
11366 player.MessageStatus(text);
11367 }
11368 }
11369
11370
11379 {
11380 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11381
11382 if (player)
11383 {
11384 player.MessageAction(text);
11385 }
11386 }
11387
11388
11397 {
11398 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11399
11400 if (player)
11401 {
11402 player.MessageFriendly(text);
11403 }
11404 }
11405
11406
11415 {
11416 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11417
11418 if (player)
11419 {
11420 player.MessageImportant(text);
11421 }
11422 }
11423
11425 {
11426 return true;
11427 }
11428
11429
11430 override bool KindOf(
string tag)
11431 {
11432 bool found = false;
11433 string item_name = this.
GetType();
11436
11437 int array_size = item_tag_array.Count();
11438 for (int i = 0; i < array_size; i++)
11439 {
11440 if (item_tag_array.Get(i) == tag)
11441 {
11442 found = true;
11443 break;
11444 }
11445 }
11446 return found;
11447 }
11448
11449
11451 {
11452
11453 super.OnRPC(sender, rpc_type,ctx);
11454
11455
11456 switch (rpc_type)
11457 {
11458 #ifndef SERVER
11459 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11460 Param2<bool, string> p = new Param2<bool, string>(false, "");
11461
11463 return;
11464
11465 bool play = p.param1;
11466 string soundSet = p.param2;
11467
11468 if (play)
11469 {
11471 {
11473 {
11475 }
11476 }
11477 else
11478 {
11480 }
11481 }
11482 else
11483 {
11485 }
11486
11487 break;
11488 #endif
11489
11490 }
11491
11493 {
11495 }
11496 }
11497
11498
11499
11500
11502 {
11503 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11504 return plugin.GetID(
name);
11505 }
11506
11508 {
11509 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11510 return plugin.GetName(id);
11511 }
11512
11515 {
11516
11517
11518 int varFlags;
11519 if (!ctx.
Read(varFlags))
11520 return;
11521
11522 if (varFlags & ItemVariableFlags.FLOAT)
11523 {
11525 }
11526 }
11527
11529 {
11530
11531 super.SerializeNumericalVars(floats_out);
11532
11533
11534
11536 {
11538 }
11539
11541 {
11543 }
11544
11546 {
11548 }
11549
11551 {
11556 }
11557
11559 {
11561 }
11562 }
11563
11565 {
11566
11567 super.DeSerializeNumericalVars(floats);
11568
11569
11570 int index = 0;
11571 int mask = Math.Round(floats.Get(index));
11572
11573 index++;
11574
11576 {
11578 {
11580 }
11581 else
11582 {
11583 float quantity = floats.Get(index);
11584 SetQuantity(quantity,
true,
false,
false,
false);
11585 }
11586 index++;
11587 }
11588
11590 {
11591 float wet = floats.Get(index);
11593 index++;
11594 }
11595
11597 {
11598 int liquidtype = Math.Round(floats.Get(index));
11600 index++;
11601 }
11602
11604 {
11606 index++;
11608 index++;
11610 index++;
11612 index++;
11613 }
11614
11616 {
11617 int cleanness = Math.Round(floats.Get(index));
11619 index++;
11620 }
11621 }
11622
11624 {
11625 super.WriteVarsToCTX(ctx);
11626
11627
11629 {
11631 }
11632
11634 {
11636 }
11637
11639 {
11641 }
11642
11644 {
11645 int r,g,b,a;
11651 }
11652
11654 {
11656 }
11657 }
11658
11660 {
11661 if (!super.ReadVarsFromCTX(ctx,version))
11662 return false;
11663
11664 int intValue;
11665 float value;
11666
11667 if (version < 140)
11668 {
11669 if (!ctx.
Read(intValue))
11670 return false;
11671
11672 m_VariablesMask = intValue;
11673 }
11674
11676 {
11677 if (!ctx.
Read(value))
11678 return false;
11679
11681 {
11683 }
11684 else
11685 {
11687 }
11688 }
11689
11690 if (version < 140)
11691 {
11693 {
11694 if (!ctx.
Read(value))
11695 return false;
11696 SetTemperatureDirect(value);
11697 }
11698 }
11699
11701 {
11702 if (!ctx.
Read(value))
11703 return false;
11705 }
11706
11708 {
11709 if (!ctx.
Read(intValue))
11710 return false;
11712 }
11713
11715 {
11716 int r,g,b,a;
11718 return false;
11720 return false;
11722 return false;
11724 return false;
11725
11727 }
11728
11730 {
11731 if (!ctx.
Read(intValue))
11732 return false;
11734 }
11735
11736 if (version >= 138 && version < 140)
11737 {
11739 {
11740 if (!ctx.
Read(intValue))
11741 return false;
11742 SetFrozen(intValue);
11743 }
11744 }
11745
11746 return true;
11747 }
11748
11749
11751 {
11754 {
11756 }
11757
11758 if (!super.OnStoreLoad(ctx, version))
11759 {
11761 return false;
11762 }
11763
11764 if (version >= 114)
11765 {
11766 bool hasQuickBarIndexSaved;
11767
11768 if (!ctx.
Read(hasQuickBarIndexSaved))
11769 {
11771 return false;
11772 }
11773
11774 if (hasQuickBarIndexSaved)
11775 {
11776 int itmQBIndex;
11777
11778
11779 if (!ctx.
Read(itmQBIndex))
11780 {
11782 return false;
11783 }
11784
11785 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11786 if (itmQBIndex != -1 && parentPlayer)
11787 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11788 }
11789 }
11790 else
11791 {
11792
11793 PlayerBase player;
11794 int itemQBIndex;
11795 if (version ==
int.
MAX)
11796 {
11797 if (!ctx.
Read(itemQBIndex))
11798 {
11800 return false;
11801 }
11802 }
11803 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11804 {
11805
11806 if (!ctx.
Read(itemQBIndex))
11807 {
11809 return false;
11810 }
11811 if (itemQBIndex != -1 && player)
11812 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11813 }
11814 }
11815
11816 if (version < 140)
11817 {
11818
11819 if (!LoadVariables(ctx, version))
11820 {
11822 return false;
11823 }
11824 }
11825
11826
11828 {
11830 return false;
11831 }
11832 if (version >= 132)
11833 {
11835 if (raib)
11836 {
11838 {
11840 return false;
11841 }
11842 }
11843 }
11844
11846 return true;
11847 }
11848
11849
11850
11852 {
11853 super.OnStoreSave(ctx);
11854
11855 PlayerBase player;
11856 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11857 {
11859
11860 int itemQBIndex = -1;
11861 itemQBIndex = player.FindQuickBarEntityIndex(this);
11862 ctx.
Write(itemQBIndex);
11863 }
11864 else
11865 {
11867 }
11868
11870
11872 if (raib)
11873 {
11875 }
11876 }
11877
11878
11880 {
11881 super.AfterStoreLoad();
11882
11884 {
11886 }
11887
11889 {
11892 }
11893 }
11894
11896 {
11897 super.EEOnAfterLoad();
11898
11900 {
11902 }
11903
11906 }
11907
11909 {
11910 return false;
11911 }
11912
11913
11914
11916 {
11918 {
11919 #ifdef PLATFORM_CONSOLE
11920
11922 {
11924 if (menu)
11925 {
11927 }
11928 }
11929 #endif
11930 }
11931
11933 {
11936 }
11937
11939 {
11940 SetWeightDirty();
11942 }
11944 {
11947 }
11948
11950 {
11953 }
11955 {
11958 }
11959
11960 super.OnVariablesSynchronized();
11961 }
11962
11963
11964
11966 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11967 {
11968 if (!IsServerCheck(allow_client))
11969 return false;
11970
11972 return false;
11973
11976
11977 if (value <= (min + 0.001))
11978 value = min;
11979
11980 if (value == min)
11981 {
11982 if (destroy_config)
11983 {
11984 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11985 if (dstr)
11986 {
11988 this.Delete();
11989 return true;
11990 }
11991 }
11992 else if (destroy_forced)
11993 {
11995 this.Delete();
11996 return true;
11997 }
11998
12000 }
12001
12004
12006 {
12008
12009 if (delta)
12011 }
12012
12014
12015 return false;
12016 }
12017
12018
12020 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12021 {
12023 }
12024
12026 {
12029 }
12030
12032 {
12035 }
12036
12039 {
12040 float value_clamped = Math.Clamp(value, 0, 1);
12042 SetQuantity(result, destroy_config, destroy_forced);
12043 }
12044
12045
12048 {
12050 }
12051
12053 {
12055 }
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12067 {
12068 int slot = -1;
12069 if (GetInventory())
12070 {
12071 InventoryLocation il = new InventoryLocation;
12072 GetInventory().GetCurrentInventoryLocation(il);
12074 }
12075
12077 }
12078
12080 {
12081 float quantity_max = 0;
12082
12084 {
12085 if (attSlotID != -1)
12086 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12087
12088 if (quantity_max <= 0)
12090 }
12091
12092 if (quantity_max <= 0)
12094
12095 return quantity_max;
12096 }
12097
12099 {
12101 }
12102
12104 {
12106 }
12107
12108
12110 {
12112 }
12113
12115 {
12117 }
12118
12120 {
12122 }
12123
12124
12126 {
12127
12128 float weightEx = GetWeightEx();
12129 float special = GetInventoryAndCargoWeight();
12130 return weightEx - special;
12131 }
12132
12133
12135 {
12137 }
12138
12140 {
12142 {
12143 #ifdef DEVELOPER
12144 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12145 {
12146 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12148 }
12149 #endif
12150
12151 return GetQuantity() * GetConfigWeightModified();
12152 }
12153 else if (HasEnergyManager())
12154 {
12155 #ifdef DEVELOPER
12156 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12157 {
12158 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12159 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12160 }
12161 #endif
12162 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12163 }
12164 else
12165 {
12166 #ifdef DEVELOPER
12167 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12168 {
12169 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12170 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12171 }
12172 #endif
12173 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12174 }
12175 }
12176
12179 {
12180 int item_count = 0;
12182
12183 if (GetInventory().GetCargo() != NULL)
12184 {
12185 item_count = GetInventory().GetCargo().GetItemCount();
12186 }
12187
12188 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12189 {
12190 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12191 if (item)
12192 item_count += item.GetNumberOfItems();
12193 }
12194 return item_count;
12195 }
12196
12199 {
12200 float weight = 0;
12201 float wetness = 1;
12202 if (include_wetness)
12205 {
12206 weight = wetness * m_ConfigWeight;
12207 }
12209 {
12210 weight = 1;
12211 }
12212 return weight;
12213 }
12214
12215
12216
12218 {
12219 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12220 {
12221 GameInventory inv = GetInventory();
12222 array<EntityAI> items = new array<EntityAI>;
12224 for (int i = 0; i < items.Count(); i++)
12225 {
12227 if (item)
12228 {
12230 }
12231 }
12232 }
12233 }
12234
12235
12236
12237
12239 {
12240 float energy = 0;
12241 if (HasEnergyManager())
12242 {
12243 energy = GetCompEM().GetEnergy();
12244 }
12245 return energy;
12246 }
12247
12248
12250 {
12251 super.OnEnergyConsumed();
12252
12254 }
12255
12257 {
12258 super.OnEnergyAdded();
12259
12261 }
12262
12263
12265 {
12266 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12267 {
12269 {
12270 float energy_0to1 = GetCompEM().GetEnergy0To1();
12272 }
12273 }
12274 }
12275
12276
12278 {
12279 return ConfigGetFloat("heatIsolation");
12280 }
12281
12283 {
12285 }
12286
12288 {
12289 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12290 if (
GetGame().ConfigIsExisting(paramPath))
12292
12293 return 0.0;
12294 }
12295
12297 {
12298 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12299 if (
GetGame().ConfigIsExisting(paramPath))
12301
12302 return 0.0;
12303 }
12304
12305 override void SetWet(
float value,
bool allow_client =
false)
12306 {
12307 if (!IsServerCheck(allow_client))
12308 return;
12309
12312
12314
12315 m_VarWet = Math.Clamp(value, min, max);
12316
12318 {
12321 }
12322 }
12323
12324 override void AddWet(
float value)
12325 {
12327 }
12328
12330 {
12332 }
12333
12335 {
12337 }
12338
12340 {
12342 }
12343
12345 {
12347 }
12348
12350 {
12352 }
12353
12354 override void OnWetChanged(
float newVal,
float oldVal)
12355 {
12358 if (newLevel != oldLevel)
12359 {
12361 }
12362 }
12363
12365 {
12366 SetWeightDirty();
12367 }
12368
12370 {
12371 return GetWetLevelInternal(
m_VarWet);
12372 }
12373
12374
12375
12377 {
12379 }
12380
12382 {
12384 }
12385
12387 {
12389 }
12390
12392 {
12394 }
12395
12396
12397
12399 {
12400 if (ConfigIsExisting("itemModelLength"))
12401 {
12402 return ConfigGetFloat("itemModelLength");
12403 }
12404 return 0;
12405 }
12406
12408 {
12409 if (ConfigIsExisting("itemAttachOffset"))
12410 {
12411 return ConfigGetFloat("itemAttachOffset");
12412 }
12413 return 0;
12414 }
12415
12416 override void SetCleanness(
int value,
bool allow_client =
false)
12417 {
12418 if (!IsServerCheck(allow_client))
12419 return;
12420
12422
12424
12427 }
12428
12430 {
12432 }
12433
12435 {
12436 return true;
12437 }
12438
12439
12440
12441
12443 {
12445 }
12446
12448 {
12450 }
12451
12452
12453
12454
12455 override void SetColor(
int r,
int g,
int b,
int a)
12456 {
12462 }
12464 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12465 {
12470 }
12471
12473 {
12475 }
12476
12479 {
12480 int r,g,b,a;
12482 r = r/255;
12483 g = g/255;
12484 b = b/255;
12485 a = a/255;
12486 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12487 }
12488
12489
12490
12491 override void SetLiquidType(
int value,
bool allow_client =
false)
12492 {
12493 if (!IsServerCheck(allow_client))
12494 return;
12495
12500 }
12501
12503 {
12504 return ConfigGetInt("varLiquidTypeInit");
12505 }
12506
12508 {
12510 }
12511
12513 {
12515 SetFrozen(false);
12516 }
12517
12520 {
12521 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12522 }
12523
12524
12527 {
12528 PlayerBase nplayer;
12529 if (PlayerBase.CastTo(nplayer, player))
12530 {
12532
12533 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12534 }
12535 }
12536
12537
12540 {
12541 PlayerBase nplayer;
12542 if (PlayerBase.CastTo(nplayer,player))
12543 {
12544
12545 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12546
12547 }
12548
12549
12550 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12551
12552
12553 if (HasEnergyManager())
12554 {
12555 GetCompEM().UpdatePlugState();
12556 }
12557 }
12558
12559
12561 {
12562 super.OnPlacementStarted(player);
12563
12565 }
12566
12567 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12568 {
12570 {
12571 m_AdminLog.OnPlacementComplete(player,
this);
12572 }
12573
12574 super.OnPlacementComplete(player, position, orientation);
12575 }
12576
12577
12578
12579
12580
12582 {
12584 {
12585 return true;
12586 }
12587 else
12588 {
12589 return false;
12590 }
12591 }
12592
12593
12595 {
12597 {
12599 }
12600 }
12601
12602
12604 {
12606 }
12607
12609 {
12611 }
12612
12613 override void InsertAgent(
int agent,
float count = 1)
12614 {
12615 if (count < 1)
12616 return;
12617
12619 }
12620
12623 {
12625 }
12626
12627
12629 {
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
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12675 {
12677 return false;
12678 return true;
12679 }
12680
12682 {
12683
12685 }
12686
12687
12690 {
12691 super.CheckForRoofLimited(timeTresholdMS);
12692
12694 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12695 {
12696 m_PreviousRoofTestTime = time;
12697 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12698 }
12699 }
12700
12701
12703 {
12705 {
12706 return 0;
12707 }
12708
12709 if (GetInventory().GetAttachmentSlotsCount() != 0)
12710 {
12711 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12712 if (filter)
12713 return filter.GetProtectionLevel(type, false, system);
12714 else
12715 return 0;
12716 }
12717
12718 string subclassPath, entryName;
12719
12720 switch (type)
12721 {
12723 entryName = "biological";
12724 break;
12726 entryName = "chemical";
12727 break;
12728 default:
12729 entryName = "biological";
12730 break;
12731 }
12732
12733 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12734
12736 }
12737
12738
12739
12742 {
12743 if (!IsMagazine())
12745
12747 }
12748
12749
12750
12751
12752
12757 {
12758 return true;
12759 }
12760
12762 {
12764 }
12765
12766
12767
12768
12769
12771 {
12772 if (parent)
12773 {
12774 if (parent.IsInherited(DayZInfected))
12775 return true;
12776
12777 if (!parent.IsRuined())
12778 return true;
12779 }
12780
12781 return true;
12782 }
12783
12785 {
12786 if (!super.CanPutAsAttachment(parent))
12787 {
12788 return false;
12789 }
12790
12791 if (!IsRuined() && !parent.IsRuined())
12792 {
12793 return true;
12794 }
12795
12796 return false;
12797 }
12798
12800 {
12801
12802
12803
12804
12805 return super.CanReceiveItemIntoCargo(item);
12806 }
12807
12809 {
12810
12811
12812
12813
12814 GameInventory attachmentInv = attachment.GetInventory();
12816 {
12817 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12818 return false;
12819 }
12820
12821 InventoryLocation loc = new InventoryLocation();
12822 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12823 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12824 return false;
12825
12826 return super.CanReceiveAttachment(attachment, slotId);
12827 }
12828
12830 {
12831 if (!super.CanReleaseAttachment(attachment))
12832 return false;
12833
12834 return GetInventory().AreChildrenAccessible();
12835 }
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12858 {
12859 int id = muzzle_owner.GetMuzzleID();
12860 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12861
12862 if (WPOF_array)
12863 {
12864 for (int i = 0; i < WPOF_array.Count(); i++)
12865 {
12866 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12867
12868 if (WPOF)
12869 {
12870 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12871 }
12872 }
12873 }
12874 }
12875
12876
12878 {
12879 int id = muzzle_owner.GetMuzzleID();
12881
12882 if (WPOBE_array)
12883 {
12884 for (int i = 0; i < WPOBE_array.Count(); i++)
12885 {
12886 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12887
12888 if (WPOBE)
12889 {
12890 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12891 }
12892 }
12893 }
12894 }
12895
12896
12898 {
12899 int id = muzzle_owner.GetMuzzleID();
12900 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12901
12902 if (WPOOH_array)
12903 {
12904 for (int i = 0; i < WPOOH_array.Count(); i++)
12905 {
12906 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12907
12908 if (WPOOH)
12909 {
12910 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12911 }
12912 }
12913 }
12914 }
12915
12916
12918 {
12919 int id = muzzle_owner.GetMuzzleID();
12920 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12921
12922 if (WPOOH_array)
12923 {
12924 for (int i = 0; i < WPOOH_array.Count(); i++)
12925 {
12926 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12927
12928 if (WPOOH)
12929 {
12930 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12931 }
12932 }
12933 }
12934 }
12935
12936
12938 {
12939 int id = muzzle_owner.GetMuzzleID();
12940 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12941
12942 if (WPOOH_array)
12943 {
12944 for (int i = 0; i < WPOOH_array.Count(); i++)
12945 {
12946 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12947
12948 if (WPOOH)
12949 {
12950 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12951 }
12952 }
12953 }
12954 }
12955
12956
12957
12959 {
12961 {
12962 return true;
12963 }
12964
12965 return false;
12966 }
12967
12969 {
12971 {
12972 return true;
12973 }
12974
12975 return false;
12976 }
12977
12979 {
12981 {
12982 return true;
12983 }
12984
12985 return false;
12986 }
12987
12989 {
12990 return false;
12991 }
12992
12995 {
12996 return UATimeSpent.DEFAULT_DEPLOY;
12997 }
12998
12999
13000
13001
13003 {
13005 SetSynchDirty();
13006 }
13007
13009 {
13011 }
13012
13013
13015 {
13016 return false;
13017 }
13018
13021 {
13022 string att_type = "None";
13023
13024 if (ConfigIsExisting("soundAttType"))
13025 {
13026 att_type = ConfigGetString("soundAttType");
13027 }
13028
13030 }
13031
13033 {
13035 }
13036
13037
13038
13039
13040
13044
13046 {
13049
13051 }
13052
13053
13055 {
13057 return;
13058
13060
13063
13066
13067 SoundParameters params = new SoundParameters();
13071 }
13072
13073
13075 {
13077 return;
13078
13080 SetSynchDirty();
13081
13084 }
13085
13086
13088 {
13090 return;
13091
13093 SetSynchDirty();
13094
13097 }
13098
13100 {
13102 }
13103
13105 {
13107 }
13108
13111 {
13112 if (!
GetGame().IsDedicatedServer())
13113 {
13114 if (ConfigIsExisting("attachSoundSet"))
13115 {
13116 string cfg_path = "";
13117 string soundset = "";
13118 string type_name =
GetType();
13119
13122 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13123 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13124
13125 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13126 {
13127 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13128 {
13129 if (cfg_slot_array[i] == slot_type)
13130 {
13131 soundset = cfg_soundset_array[i];
13132 break;
13133 }
13134 }
13135 }
13136
13137 if (soundset != "")
13138 {
13139 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13141 }
13142 }
13143 }
13144 }
13145
13147 {
13148
13149 }
13150
13151 void OnApply(PlayerBase player);
13152
13154 {
13155 return 1.0;
13156 };
13157
13159 {
13161 }
13162
13164 {
13166 }
13167
13169
13171 {
13172 SetDynamicPhysicsLifeTime(0.01);
13174 }
13175
13177 {
13178 array<string> zone_names = new array<string>;
13179 GetDamageZones(zone_names);
13180 for (int i = 0; i < zone_names.Count(); i++)
13181 {
13182 SetHealthMax(zone_names.Get(i),"Health");
13183 }
13184 SetHealthMax("","Health");
13185 }
13186
13189 {
13190 float global_health = GetHealth01("","Health");
13191 array<string> zones = new array<string>;
13192 GetDamageZones(zones);
13193
13194 for (int i = 0; i < zones.Count(); i++)
13195 {
13196 SetHealth01(zones.Get(i),"Health",global_health);
13197 }
13198 }
13199
13202 {
13203 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13204 }
13205
13207 {
13208 if (!hasRootAsPlayer)
13209 {
13210 if (refParentIB)
13211 {
13212
13213 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13214 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13215
13216 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13217 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13218
13221 }
13222 else
13223 {
13224
13227 }
13228 }
13229 }
13230
13232 {
13234 {
13235 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13236 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13237 {
13238 float heatPermCoef = 1.0;
13240 while (ent)
13241 {
13242 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13243 ent = ent.GetHierarchyParent();
13244 }
13245
13246 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13247 }
13248 }
13249 }
13250
13252 {
13253
13254 EntityAI parent = GetHierarchyParent();
13255 if (!parent)
13256 {
13257 hasParent = false;
13258 hasRootAsPlayer = false;
13259 }
13260 else
13261 {
13262 hasParent = true;
13263 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13264 refParentIB =
ItemBase.Cast(parent);
13265 }
13266 }
13267
13268 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13269 {
13270
13271 }
13272
13274 {
13275
13276 return false;
13277 }
13278
13280 {
13281
13282
13283 return false;
13284 }
13285
13287 {
13288
13289 return false;
13290 }
13291
13294 {
13295 return !GetIsFrozen() &&
IsOpen();
13296 }
13297
13299 {
13300 bool hasParent = false, hasRootAsPlayer = false;
13302
13303 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13304 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13305
13306 if (wwtu || foodDecay)
13307 {
13311
13312 if (processWetness || processTemperature || processDecay)
13313 {
13315
13316 if (processWetness)
13317 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13318
13319 if (processTemperature)
13321
13322 if (processDecay)
13323 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13324 }
13325 }
13326 }
13327
13330 {
13332 }
13333
13335 {
13338
13339 return super.GetTemperatureFreezeThreshold();
13340 }
13341
13343 {
13346
13347 return super.GetTemperatureThawThreshold();
13348 }
13349
13351 {
13354
13355 return super.GetItemOverheatThreshold();
13356 }
13357
13359 {
13361 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13362
13363 return super.GetTemperatureFreezeTime();
13364 }
13365
13367 {
13369 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13370
13371 return super.GetTemperatureThawTime();
13372 }
13373
13378
13380 {
13381 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13382 }
13383
13385 {
13386 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13387 }
13388
13391 {
13393 }
13394
13396 {
13398 }
13399
13401 {
13403 }
13404
13407 {
13408 return null;
13409 }
13410
13413 {
13414 return false;
13415 }
13416
13418 {
13420 {
13423 if (!trg)
13424 {
13426 explosive = this;
13427 }
13428
13429 explosive.PairRemote(trg);
13431
13432 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13433 trg.SetPersistentPairID(persistentID);
13434 explosive.SetPersistentPairID(persistentID);
13435
13436 return true;
13437 }
13438 return false;
13439 }
13440
13443 {
13444 float ret = 1.0;
13447 ret *= GetHealth01();
13448
13449 return ret;
13450 }
13451
13452 #ifdef DEVELOPER
13453 override void SetDebugItem()
13454 {
13455 super.SetDebugItem();
13456 _itemBase = this;
13457 }
13458
13460 {
13461 string text = super.GetDebugText();
13462
13464 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13465
13466 return text;
13467 }
13468 #endif
13469
13471 {
13472 return true;
13473 }
13474
13476
13478
13480 {
13483 }
13484
13485
13493
13509}
13510
13512{
13514 if (entity)
13515 {
13516 bool is_item = entity.IsInherited(
ItemBase);
13517 if (is_item && full_quantity)
13518 {
13521 }
13522 }
13523 else
13524 {
13526 return NULL;
13527 }
13528 return entity;
13529}
13530
13532{
13533 if (item)
13534 {
13535 if (health > 0)
13536 item.SetHealth("", "", health);
13537
13538 if (item.CanHaveTemperature())
13539 {
13541 if (item.CanFreeze())
13542 item.SetFrozen(false);
13543 }
13544
13545 if (item.HasEnergyManager())
13546 {
13547 if (quantity >= 0)
13548 {
13549 item.GetCompEM().SetEnergy0To1(quantity);
13550 }
13551 else
13552 {
13554 }
13555 }
13556 else if (item.IsMagazine())
13557 {
13558 Magazine mag = Magazine.Cast(item);
13559 if (quantity >= 0)
13560 {
13561 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13562 }
13563 else
13564 {
13566 }
13567
13568 }
13569 else
13570 {
13571 if (quantity >= 0)
13572 {
13573 item.SetQuantityNormalized(quantity, false);
13574 }
13575 else
13576 {
13578 }
13579
13580 }
13581 }
13582}
13583
13584#ifdef DEVELOPER
13586#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.