8843{
8845 {
8846 return true;
8847 }
8848};
8849
8850
8851
8853{
8857
8859
8862
8863
8864
8865
8866
8875
8881
8886
8891
8912 protected bool m_IsResultOfSplit
8913
8915
8920
8921
8922
8924
8928
8929
8930
8932
8935
8936
8937
8943
8944
8952
8955
8956
8958
8959
8961
8962
8967
8968
8973
8974
8976
8977
8979 {
8984
8985 if (!
GetGame().IsDedicatedServer())
8986 {
8988 {
8990
8992 {
8994 }
8995 }
8996
8999 }
9000
9001 m_OldLocation = null;
9002
9004 {
9006 }
9007
9008 if (ConfigIsExisting("headSelectionsToHide"))
9009 {
9012 }
9013
9015 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9016 {
9018 }
9019
9021
9022 m_IsResultOfSplit = false;
9023
9025 }
9026
9028 {
9029 super.InitItemVariables();
9030
9036 m_Count = ConfigGetInt(
"count");
9037
9040
9045
9048
9053
9065
9069
9070
9073 if (ConfigIsExisting("canBeSplit"))
9074 {
9077 }
9078
9080 if (ConfigIsExisting("itemBehaviour"))
9082
9083
9086 RegisterNetSyncVariableInt("m_VarLiquidType");
9087 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9088
9089 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9090 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9091 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9092
9093 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9094 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9095 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9096 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9097
9098 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9099 RegisterNetSyncVariableBool("m_IsTakeable");
9100 RegisterNetSyncVariableBool("m_IsHologram");
9101
9104 {
9107 }
9108
9110
9112 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9114
9115 }
9116
9118 {
9120 }
9121
9123 {
9126 {
9131 }
9132 }
9133
9134 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9135 {
9137 {
9140 }
9141
9143 }
9144
9146 {
9152 }
9153
9155
9157 {
9159
9160 if (!action)
9161 {
9162 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9163 return;
9164 }
9165
9167 if (!ai)
9168 {
9170 return;
9171 }
9172
9174 if (!action_array)
9175 {
9176 action_array = new array<ActionBase_Basic>;
9178 }
9179 if (LogManager.IsActionLogEnable())
9180 {
9181 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9182 }
9183
9184 if (action_array.Find(action) != -1)
9185 {
9186 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9187 }
9188 else
9189 {
9190 action_array.Insert(action);
9191 }
9192 }
9193
9195 {
9197 ActionBase action = player.GetActionManager().GetAction(actionName);
9200
9201 if (action_array)
9202 {
9203 action_array.RemoveItem(action);
9204 }
9205 }
9206
9207
9208
9210 {
9211 ActionOverrideData overrideData = new ActionOverrideData();
9215
9217 if (!actionMap)
9218 {
9221 }
9222
9223 actionMap.Insert(this.
Type(), overrideData);
9224
9225 }
9226
9228
9230
9231
9233 {
9236
9239
9240 string config_to_search = "CfgVehicles";
9241 string muzzle_owner_config;
9242
9244 {
9245 if (IsInherited(Weapon))
9246 config_to_search = "CfgWeapons";
9247
9248 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9249
9250 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9251
9253
9254 if (config_OnFire_subclass_count > 0)
9255 {
9256 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9257
9258 for (int i = 0; i < config_OnFire_subclass_count; i++)
9259 {
9260 string particle_class = "";
9262 string config_OnFire_entry = config_OnFire_class + particle_class;
9263 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9264 WPOF_array.Insert(WPOF);
9265 }
9266
9267
9269 }
9270 }
9271
9273 {
9274 config_to_search = "CfgWeapons";
9275 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9276
9277 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9278
9280
9281 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9282 {
9283 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9284
9285 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9286 {
9287 string particle_class2 = "";
9289 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9290 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9291 WPOBE_array.Insert(WPOBE);
9292 }
9293
9294
9296 }
9297 }
9298 }
9299
9300
9302 {
9305
9307 {
9308 string config_to_search = "CfgVehicles";
9309
9310 if (IsInherited(Weapon))
9311 config_to_search = "CfgWeapons";
9312
9313 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9314 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9315
9316 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9317 {
9318
9320
9322 {
9324 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9326 return;
9327 }
9328
9331
9332
9333
9335 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9336
9337 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9338 {
9339 string particle_class = "";
9341 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9343
9344 if (entry_type == CT_CLASS)
9345 {
9346 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9347 WPOOH_array.Insert(WPOF);
9348 }
9349 }
9350
9351
9353 }
9354 }
9355 }
9356
9358 {
9360 }
9361
9363 {
9365 {
9367
9370
9373
9374 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9375 }
9376 }
9377
9379 {
9381 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9382
9384 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9385
9387 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9388
9390 {
9392 }
9393 }
9394
9396 {
9398 }
9399
9401 {
9404 else
9406
9408 {
9411 }
9412 else
9413 {
9416
9419 }
9420
9422 }
9423
9425 {
9427 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9428 }
9429
9431 {
9433 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9435 }
9436
9438 {
9440 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9441 }
9442
9444 {
9447
9448 OverheatingParticle OP = new OverheatingParticle();
9453
9455 }
9456
9458 {
9461
9462 return -1;
9463 }
9464
9466 {
9468 {
9471
9472 for (int i = count; i > 0; --i)
9473 {
9474 int id = i - 1;
9477
9480
9481 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9482 {
9483 if (p)
9484 {
9487 }
9488 }
9489 }
9490 }
9491 }
9492
9494 {
9496 {
9498 {
9499 int id = i - 1;
9501
9502 if (OP)
9503 {
9505
9506 if (p)
9507 {
9509 }
9510
9511 delete OP;
9512 }
9513 }
9514
9517 }
9518 }
9519
9522 {
9523 return 0.0;
9524 }
9525
9526
9528 {
9529 return 250;
9530 }
9531
9533 {
9534 return 0;
9535 }
9536
9539 {
9541 return true;
9542
9543 return false;
9544 }
9545
9548 {
9551
9553 {
9555 }
9556 else
9557 {
9558
9560 }
9561
9563 }
9564
9571 {
9572 return -1;
9573 }
9574
9575
9576
9577
9579 {
9581 {
9583 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9584
9585 if (r_index >= 0)
9586 {
9587 InventoryLocation r_il = new InventoryLocation;
9588 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9589
9590 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9593 {
9594 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9595 }
9597 {
9598 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9599 }
9600
9601 }
9602
9603 player.GetHumanInventory().ClearUserReservedLocation(this);
9604 }
9605
9608 }
9609
9610
9611
9612
9614 {
9615 return ItemBase.m_DebugActionsMask;
9616 }
9617
9619 {
9620 return ItemBase.m_DebugActionsMask & mask;
9621 }
9622
9624 {
9625 ItemBase.m_DebugActionsMask = mask;
9626 }
9627
9629 {
9630 ItemBase.m_DebugActionsMask |= mask;
9631 }
9632
9634 {
9635 ItemBase.m_DebugActionsMask &= ~mask;
9636 }
9637
9639 {
9641 {
9643 }
9644 else
9645 {
9647 }
9648 }
9649
9650
9652 {
9653 if (GetEconomyProfile())
9654 {
9655 float q_max = GetEconomyProfile().GetQuantityMax();
9656 if (q_max > 0)
9657 {
9658 float q_min = GetEconomyProfile().GetQuantityMin();
9659 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9660
9662 {
9663 ComponentEnergyManager comp = GetCompEM();
9665 {
9667 }
9668 }
9670 {
9672
9673 }
9674
9675 }
9676 }
9677 }
9678
9681 {
9682 EntityAI parent = GetHierarchyParent();
9683
9684 if (parent)
9685 {
9686 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9687 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9688 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9689 }
9690 }
9691
9694 {
9695 EntityAI parent = GetHierarchyParent();
9696
9697 if (parent)
9698 {
9699 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9700 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9701 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9702 }
9703 }
9704
9706 {
9707
9708
9709
9710
9712
9714 {
9715 if (ScriptInputUserData.CanStoreInputUserData())
9716 {
9717 ScriptInputUserData ctx = new ScriptInputUserData;
9723 ctx.
Write(use_stack_max);
9726
9728 {
9729 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9730 }
9731 }
9732 }
9733 else if (!
GetGame().IsMultiplayer())
9734 {
9736 }
9737 }
9738
9740 {
9742 }
9743
9745 {
9747 }
9748
9750 {
9752 }
9753
9755 {
9756
9757 return false;
9758 }
9759
9761 {
9762 return false;
9763 }
9764
9768 {
9769 return false;
9770 }
9771
9773 {
9774 return "";
9775 }
9776
9778
9780 {
9781 return false;
9782 }
9783
9785 {
9786 return true;
9787 }
9788
9789
9790
9792 {
9793 return true;
9794 }
9795
9797 {
9798 return true;
9799 }
9800
9802 {
9803 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9805 }
9806
9808 {
9810 }
9811
9813 {
9815 if (!is_being_placed)
9817 SetSynchDirty();
9818 }
9819
9820
9822
9824 {
9826 }
9827
9829 {
9831 }
9832
9834 {
9835 return 1;
9836 }
9837
9839 {
9840 return false;
9841 }
9842
9844 {
9846 SetSynchDirty();
9847 }
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9884 {
9885 super.OnMovedInsideCargo(container);
9886
9887 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9888 }
9889
9890 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9891 {
9892 super.EEItemLocationChanged(oldLoc,newLoc);
9893
9894 PlayerBase new_player = null;
9895 PlayerBase old_player = null;
9896
9897 if (newLoc.GetParent())
9898 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9899
9900 if (oldLoc.GetParent())
9901 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9902
9904 {
9905 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9906
9907 if (r_index >= 0)
9908 {
9909 InventoryLocation r_il = new InventoryLocation;
9910 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9911
9912 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9915 {
9916 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9917 }
9919 {
9920 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9921 }
9922
9923 }
9924 }
9925
9927 {
9928 if (new_player)
9929 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9930
9931 if (new_player == old_player)
9932 {
9933
9934 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9935 {
9937 {
9938 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9939 {
9940 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9941 }
9942 }
9943 else
9944 {
9945 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9946 }
9947 }
9948
9949 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9950 {
9951 int type = oldLoc.GetType();
9953 {
9954 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9955 }
9957 {
9958 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9959 }
9960 }
9961 if (!m_OldLocation)
9962 {
9963 m_OldLocation = new InventoryLocation;
9964 }
9965 m_OldLocation.Copy(oldLoc);
9966 }
9967 else
9968 {
9969 if (m_OldLocation)
9970 {
9971 m_OldLocation.Reset();
9972 }
9973 }
9974
9976 }
9977 else
9978 {
9979 if (new_player)
9980 {
9981 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9982 if (res_index >= 0)
9983 {
9984 InventoryLocation il = new InventoryLocation;
9985 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9987 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9990 {
9991 il.
GetParent().GetOnReleaseLock().Invoke(it);
9992 }
9994 {
9996 }
9997
9998 }
9999 }
10001 {
10002
10004 }
10005
10006 if (m_OldLocation)
10007 {
10008 m_OldLocation.Reset();
10009 }
10010 }
10011 }
10012
10013 override void EOnContact(IEntity other, Contact extra)
10014 {
10016 {
10017 int liquidType = -1;
10019 if (impactSpeed > 0.0)
10020 {
10022 #ifndef SERVER
10024 #else
10026 SetSynchDirty();
10027 #endif
10029 }
10030 }
10031
10032 #ifdef SERVER
10033 if (GetCompEM() && GetCompEM().IsPlugged())
10034 {
10035 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10036 GetCompEM().UnplugThis();
10037 }
10038 #endif
10039 }
10040
10042
10044 {
10046 }
10047
10049 {
10050
10051 }
10052
10054 {
10055 super.OnItemLocationChanged(old_owner, new_owner);
10056
10057 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10058 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10059
10060 if (!relatedPlayer && playerNew)
10061 relatedPlayer = playerNew;
10062
10063 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10064 {
10066 if (actionMgr)
10067 {
10068 ActionBase currentAction = actionMgr.GetRunningAction();
10069 if (currentAction)
10071 }
10072 }
10073
10074 Man ownerPlayerOld = null;
10075 Man ownerPlayerNew = null;
10076
10077 if (old_owner)
10078 {
10079 if (old_owner.
IsMan())
10080 {
10081 ownerPlayerOld = Man.Cast(old_owner);
10082 }
10083 else
10084 {
10085 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10086 }
10087 }
10088 else
10089 {
10091 {
10093
10094 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10095 {
10096 GetCompEM().UnplugThis();
10097 }
10098 }
10099 }
10100
10101 if (new_owner)
10102 {
10103 if (new_owner.
IsMan())
10104 {
10105 ownerPlayerNew = Man.Cast(new_owner);
10106 }
10107 else
10108 {
10109 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10110 }
10111 }
10112
10113 if (ownerPlayerOld != ownerPlayerNew)
10114 {
10115 if (ownerPlayerOld)
10116 {
10117 array<EntityAI> subItemsExit = new array<EntityAI>;
10119 for (int i = 0; i < subItemsExit.Count(); i++)
10120 {
10123 }
10124 }
10125
10126 if (ownerPlayerNew)
10127 {
10128 array<EntityAI> subItemsEnter = new array<EntityAI>;
10130 for (int j = 0; j < subItemsEnter.Count(); j++)
10131 {
10134 }
10135 }
10136 }
10137 else if (ownerPlayerNew != null)
10138 {
10139 PlayerBase nplayer;
10140 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10141 {
10142 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10144 for (int k = 0; k < subItemsUpdate.Count(); k++)
10145 {
10147 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10148 }
10149 }
10150 }
10151
10152 if (old_owner)
10153 old_owner.OnChildItemRemoved(this);
10154 if (new_owner)
10155 new_owner.OnChildItemReceived(this);
10156 }
10157
10158
10160 {
10161 super.EEDelete(parent);
10162 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10163 if (player)
10164 {
10166
10167 if (player.IsAlive())
10168 {
10169 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10170 if (r_index >= 0)
10171 {
10172 InventoryLocation r_il = new InventoryLocation;
10173 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10174
10175 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10178 {
10179 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10180 }
10182 {
10183 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10184 }
10185
10186 }
10187
10188 player.RemoveQuickBarEntityShortcut(this);
10189 }
10190 }
10191 }
10192
10194 {
10195 super.EEKilled(killer);
10196
10199 {
10200 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10201 {
10202 if (IsMagazine())
10203 {
10204 if (Magazine.Cast(this).GetAmmoCount() > 0)
10205 {
10207 }
10208 }
10209 else
10210 {
10212 }
10213 }
10214 }
10215 }
10216
10218 {
10219 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10220
10221 super.OnWasAttached(parent, slot_id);
10222
10225
10227 }
10228
10230 {
10231 super.OnWasDetached(parent, slot_id);
10232
10235 }
10236
10238 {
10239 int idx;
10242
10243 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10244 if (inventory_slots.Count() < 1)
10245 {
10246 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10247 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10248 }
10249 else
10250 {
10251 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10252 }
10253
10254 idx = inventory_slots.Find(slot);
10255 if (idx < 0)
10256 return "";
10257
10258 return attach_types.Get(idx);
10259 }
10260
10262 {
10263 int idx = -1;
10264 string slot;
10265
10268
10269 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10270 if (inventory_slots.Count() < 1)
10271 {
10272 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10273 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10274 }
10275 else
10276 {
10277 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10278 if (detach_types.Count() < 1)
10279 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10280 }
10281
10282 for (int i = 0; i < inventory_slots.Count(); i++)
10283 {
10284 slot = inventory_slots.Get(i);
10285 }
10286
10287 if (slot != "")
10288 {
10289 if (detach_types.Count() == 1)
10290 idx = 0;
10291 else
10292 idx = inventory_slots.Find(slot);
10293 }
10294 if (idx < 0)
10295 return "";
10296
10297 return detach_types.Get(idx);
10298 }
10299
10301 {
10302
10304
10305
10306 float min_time = 1;
10307 float max_time = 3;
10308 float delay = Math.RandomFloat(min_time, max_time);
10309
10310 explode_timer.Run(delay, this, "DoAmmoExplosion");
10311 }
10312
10314 {
10315 Magazine magazine = Magazine.Cast(this);
10316 int pop_sounds_count = 6;
10317 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10318
10319
10320 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10321 string sound_name = pop_sounds[ sound_idx ];
10323
10324
10325 magazine.ServerAddAmmoCount(-1);
10326
10327
10328 float min_temp_to_explode = 100;
10329
10330 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10331 {
10333 }
10334 }
10335
10336
10337 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10338 {
10339 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10340
10341 const int CHANCE_DAMAGE_CARGO = 4;
10342 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10343 const int CHANCE_DAMAGE_NOTHING = 2;
10344
10346 {
10347 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10348 int chances;
10349 int rnd;
10350
10351 if (GetInventory().GetCargo())
10352 {
10353 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10354 rnd = Math.RandomInt(0,chances);
10355
10356 if (rnd < CHANCE_DAMAGE_CARGO)
10357 {
10359 }
10360 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10361 {
10363 }
10364 }
10365 else
10366 {
10367 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10368 rnd = Math.RandomInt(0,chances);
10369
10370 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10371 {
10373 }
10374 }
10375 }
10376 }
10377
10379 {
10380 if (GetInventory().GetCargo())
10381 {
10382 int item_count = GetInventory().GetCargo().GetItemCount();
10383 if (item_count > 0)
10384 {
10385 int random_pick = Math.RandomInt(0, item_count);
10387 if (!item.IsExplosive())
10388 {
10389 item.AddHealth("","",damage);
10390 return true;
10391 }
10392 }
10393 }
10394 return false;
10395 }
10396
10398 {
10399 int attachment_count = GetInventory().AttachmentCount();
10400 if (attachment_count > 0)
10401 {
10402 int random_pick = Math.RandomInt(0, attachment_count);
10403 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10404 if (!attachment.IsExplosive())
10405 {
10406 attachment.AddHealth("","",damage);
10407 return true;
10408 }
10409 }
10410 return false;
10411 }
10412
10414 {
10416 }
10417
10419 {
10421 return GetInventory().CanRemoveEntity();
10422
10423 return false;
10424 }
10425
10427 {
10429 return;
10430
10432 {
10433 if (ScriptInputUserData.CanStoreInputUserData())
10434 {
10435 ScriptInputUserData ctx = new ScriptInputUserData;
10440 ctx.
Write(destination_entity);
10442 ctx.
Write(slot_id);
10444 }
10445 }
10446 else if (!
GetGame().IsMultiplayer())
10447 {
10449 }
10450 }
10451
10453 {
10455 return;
10456
10457 float split_quantity_new;
10461 InventoryLocation loc = new InventoryLocation;
10462
10463 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10464 {
10466 split_quantity_new = stack_max;
10467 else
10469
10470 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10471 if (new_item)
10472 {
10473 new_item.SetResultOfSplit(true);
10474 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10476 new_item.SetQuantity(split_quantity_new);
10477 }
10478 }
10479 else if (destination_entity && slot_id == -1)
10480 {
10481 if (quantity > stack_max)
10482 split_quantity_new = stack_max;
10483 else
10484 split_quantity_new = quantity;
10485
10487 {
10490 }
10491
10492 if (new_item)
10493 {
10494 new_item.SetResultOfSplit(true);
10495 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10497 new_item.SetQuantity(split_quantity_new);
10498 }
10499 }
10500 else
10501 {
10502 if (stack_max != 0)
10503 {
10505 {
10507 }
10508
10509 if (split_quantity_new == 0)
10510 {
10511 if (!
GetGame().IsMultiplayer())
10512 player.PhysicalPredictiveDropItem(this);
10513 else
10514 player.ServerDropEntity(this);
10515 return;
10516 }
10517
10519
10520 if (new_item)
10521 {
10522 new_item.SetResultOfSplit(true);
10523 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10525 new_item.SetQuantity(stack_max);
10526 new_item.PlaceOnSurface();
10527 }
10528 }
10529 }
10530 }
10531
10533 {
10535 return;
10536
10537 float split_quantity_new;
10541 InventoryLocation loc = new InventoryLocation;
10542
10543 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10544 {
10546 split_quantity_new = stack_max;
10547 else
10549
10550 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10551 if (new_item)
10552 {
10553 new_item.SetResultOfSplit(true);
10554 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10556 new_item.SetQuantity(split_quantity_new);
10557 }
10558 }
10559 else if (destination_entity && slot_id == -1)
10560 {
10561 if (quantity > stack_max)
10562 split_quantity_new = stack_max;
10563 else
10564 split_quantity_new = quantity;
10565
10567 {
10570 }
10571
10572 if (new_item)
10573 {
10574 new_item.SetResultOfSplit(true);
10575 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10577 new_item.SetQuantity(split_quantity_new);
10578 }
10579 }
10580 else
10581 {
10582 if (stack_max != 0)
10583 {
10585 {
10587 }
10588
10590
10591 if (new_item)
10592 {
10593 new_item.SetResultOfSplit(true);
10594 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10596 new_item.SetQuantity(stack_max);
10597 new_item.PlaceOnSurface();
10598 }
10599 }
10600 }
10601 }
10602
10604 {
10606 return;
10607
10609 {
10610 if (ScriptInputUserData.CanStoreInputUserData())
10611 {
10612 ScriptInputUserData ctx = new ScriptInputUserData;
10617 dst.WriteToContext(ctx);
10619 }
10620 }
10621 else if (!
GetGame().IsMultiplayer())
10622 {
10624 }
10625 }
10626
10628 {
10630 return;
10631
10633 {
10634 if (ScriptInputUserData.CanStoreInputUserData())
10635 {
10636 ScriptInputUserData ctx = new ScriptInputUserData;
10641 ctx.
Write(destination_entity);
10647 }
10648 }
10649 else if (!
GetGame().IsMultiplayer())
10650 {
10652 }
10653 }
10654
10656 {
10658 }
10659
10661 {
10663 return this;
10664
10666 float split_quantity_new;
10668 if (dst.IsValid())
10669 {
10670 int slot_id = dst.GetSlot();
10672
10673 if (quantity > stack_max)
10674 split_quantity_new = stack_max;
10675 else
10676 split_quantity_new = quantity;
10677
10679
10680 if (new_item)
10681 {
10682 new_item.SetResultOfSplit(true);
10683 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10686 }
10687
10688 return new_item;
10689 }
10690
10691 return null;
10692 }
10693
10695 {
10697 return;
10698
10700 float split_quantity_new;
10702 if (destination_entity)
10703 {
10705 if (quantity > stackable)
10706 split_quantity_new = stackable;
10707 else
10708 split_quantity_new = quantity;
10709
10710 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10711 if (new_item)
10712 {
10713 new_item.SetResultOfSplit(true);
10714 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10716 new_item.SetQuantity(split_quantity_new);
10717 }
10718 }
10719 }
10720
10722 {
10724 return;
10725
10727 {
10728 if (ScriptInputUserData.CanStoreInputUserData())
10729 {
10730 ScriptInputUserData ctx = new ScriptInputUserData;
10735 ItemBase destination_entity =
this;
10736 ctx.
Write(destination_entity);
10740 }
10741 }
10742 else if (!
GetGame().IsMultiplayer())
10743 {
10745 }
10746 }
10747
10749 {
10751 return;
10752
10754 float split_quantity_new;
10756 if (player)
10757 {
10759 if (quantity > stackable)
10760 split_quantity_new = stackable;
10761 else
10762 split_quantity_new = quantity;
10763
10764 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10765 new_item =
ItemBase.Cast(in_hands);
10766 if (new_item)
10767 {
10768 new_item.SetResultOfSplit(true);
10769 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10771 new_item.SetQuantity(split_quantity_new);
10772 }
10773 }
10774 }
10775
10777 {
10779 return;
10780
10782 float split_quantity_new = Math.Floor(quantity * 0.5);
10783
10785
10786 if (new_item)
10787 {
10788 if (new_item.GetQuantityMax() < split_quantity_new)
10789 {
10790 split_quantity_new = new_item.GetQuantityMax();
10791 }
10792
10793 new_item.SetResultOfSplit(true);
10794 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10795
10797 {
10800 }
10801 else
10802 {
10805 }
10806 }
10807 }
10808
10810 {
10812 return;
10813
10815 float split_quantity_new = Math.Floor(quantity / 2);
10816
10817 InventoryLocation invloc = new InventoryLocation;
10819
10821 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10822
10823 if (new_item)
10824 {
10825 if (new_item.GetQuantityMax() < split_quantity_new)
10826 {
10827 split_quantity_new = new_item.GetQuantityMax();
10828 }
10830 {
10833 }
10834 else
10835 {
10838 }
10839 }
10840 }
10841
10844 {
10845 SetWeightDirty();
10847
10848 if (parent)
10849 parent.OnAttachmentQuantityChangedEx(this, delta);
10850
10852 {
10854 {
10856 }
10858 {
10859 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10861 }
10862 }
10863
10864 }
10865
10868 {
10869
10870 }
10871
10874 {
10876 }
10877
10879 {
10880 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10881
10883 {
10884 if (newLevel == GameConstants.STATE_RUINED)
10885 {
10887 EntityAI parent = GetHierarchyParent();
10888 if (parent && parent.IsFireplace())
10889 {
10890 CargoBase cargo = GetInventory().GetCargo();
10891 if (cargo)
10892 {
10894 {
10896 }
10897 }
10898 }
10899 }
10900
10902 {
10903
10905 return;
10906 }
10907
10908 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10909 {
10911 }
10912 }
10913 }
10914
10915
10917 {
10918 super.OnRightClick();
10919
10921 {
10923 {
10924 if (ScriptInputUserData.CanStoreInputUserData())
10925 {
10926 vector m4[4];
10928
10929 EntityAI root = GetHierarchyRoot();
10930
10931 InventoryLocation dst = new InventoryLocation;
10933 {
10934 if (root)
10935 {
10936 root.GetTransform(m4);
10938 }
10939 else
10940 GetInventory().GetCurrentInventoryLocation(dst);
10941 }
10942 else
10943 {
10945
10946
10947 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10948 {
10949 if (root)
10950 {
10951 root.GetTransform(m4);
10953 }
10954 else
10955 GetInventory().GetCurrentInventoryLocation(dst);
10956 }
10957 else
10958 {
10959 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10960 }
10961 }
10962
10963 ScriptInputUserData ctx = new ScriptInputUserData;
10971 }
10972 }
10973 else if (!
GetGame().IsMultiplayer())
10974 {
10976 }
10977 }
10978 }
10979
10980 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10981 {
10982
10983 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10984 return false;
10985
10986 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10987 return false;
10988
10989
10991 return false;
10992
10993
10994 Magazine mag = Magazine.Cast(this);
10995 if (mag)
10996 {
10997 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10998 return false;
10999
11000 if (stack_max_limit)
11001 {
11002 Magazine other_mag = Magazine.Cast(other_item);
11003 if (other_item)
11004 {
11005 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11006 return false;
11007 }
11008
11009 }
11010 }
11011 else
11012 {
11013
11015 return false;
11016
11018 return false;
11019 }
11020
11021 PlayerBase player = null;
11022 if (CastTo(player, GetHierarchyRootPlayer()))
11023 {
11024 if (player.GetInventory().HasAttachment(this))
11025 return false;
11026
11027 if (player.IsItemsToDelete())
11028 return false;
11029 }
11030
11031 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11032 return false;
11033
11034 int slotID;
11036 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11037 return false;
11038
11039 return true;
11040 }
11041
11043 {
11045 }
11046
11048 {
11049 return m_IsResultOfSplit;
11050 }
11051
11053 {
11054 m_IsResultOfSplit = value;
11055 }
11056
11058 {
11060 }
11061
11063 {
11064 float other_item_quantity = other_item.GetQuantity();
11065 float this_free_space;
11066
11068
11070
11071 if (other_item_quantity > this_free_space)
11072 {
11073 return this_free_space;
11074 }
11075 else
11076 {
11077 return other_item_quantity;
11078 }
11079 }
11080
11082 {
11084 }
11085
11087 {
11089 return;
11090
11091 if (!IsMagazine() && other_item)
11092 {
11094 if (quantity_used != 0)
11095 {
11096 float hp1 = GetHealth01("","");
11097 float hp2 = other_item.GetHealth01("","");
11098 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11099 hpResult = hpResult / (
GetQuantity() + quantity_used);
11100
11101 hpResult *= GetMaxHealth();
11102 Math.Round(hpResult);
11103 SetHealth("", "Health", hpResult);
11104
11106 other_item.AddQuantity(-quantity_used);
11107 }
11108 }
11110 }
11111
11113 {
11114 #ifdef SERVER
11115 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11116 GetHierarchyParent().IncreaseLifetimeUp();
11117 #endif
11118 };
11119
11121 {
11122 PlayerBase p = PlayerBase.Cast(player);
11123
11124 array<int> recipesIds = p.m_Recipes;
11125 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11126 if (moduleRecipesManager)
11127 {
11128 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11129 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11130 }
11131
11132 for (int i = 0;i < recipesIds.Count(); i++)
11133 {
11134 int key = recipesIds.Get(i);
11135 string recipeName = moduleRecipesManager.GetRecipeName(key);
11137 }
11138 }
11139
11140
11141 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11142 {
11143 super.GetDebugActions(outputList);
11144
11145
11150
11151
11155
11159
11160
11163
11164
11166 {
11169 }
11170
11172
11175
11179 }
11180
11181
11182
11183
11185 {
11186 super.OnAction(action_id, player, ctx);
11187 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11188 {
11189 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11190 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11191 PlayerBase p = PlayerBase.Cast(player);
11192 if (
EActions.RECIPES_RANGE_START < 1000)
11193 {
11194 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11195 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11196 }
11197 }
11198 #ifndef SERVER
11199 else if (action_id ==
EActions.WATCH_PLAYER)
11200 {
11201 PluginDeveloper.SetDeveloperItemClientEx(player);
11202 }
11203 #endif
11205 {
11206 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11207 {
11208 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11209 OnDebugButtonPressServer(id + 1);
11210 }
11211
11212 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11213 {
11214 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11216 }
11217
11218 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11219 {
11220 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11222 }
11223
11224 else if (action_id ==
EActions.ADD_QUANTITY)
11225 {
11226 if (IsMagazine())
11227 {
11228 Magazine mag = Magazine.Cast(this);
11229 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11230 }
11231 else
11232 {
11234 }
11235
11236 if (m_EM)
11237 {
11238 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11239 }
11240
11241 }
11242
11243 else if (action_id ==
EActions.REMOVE_QUANTITY)
11244 {
11245 if (IsMagazine())
11246 {
11247 Magazine mag2 = Magazine.Cast(this);
11248 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11249 }
11250 else
11251 {
11253 }
11254 if (m_EM)
11255 {
11256 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11257 }
11258
11259 }
11260
11261 else if (action_id ==
EActions.SET_QUANTITY_0)
11262 {
11264
11265 if (m_EM)
11266 {
11267 m_EM.SetEnergy(0);
11268 }
11269 }
11270
11271 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11272 {
11274
11275 if (m_EM)
11276 {
11277 m_EM.SetEnergy(m_EM.GetEnergyMax());
11278 }
11279 }
11280
11281 else if (action_id ==
EActions.ADD_HEALTH)
11282 {
11283 AddHealth("","",GetMaxHealth("","Health")/5);
11284 }
11285 else if (action_id ==
EActions.REMOVE_HEALTH)
11286 {
11287 AddHealth("","",-GetMaxHealth("","Health")/5);
11288 }
11289 else if (action_id ==
EActions.DESTROY_HEALTH)
11290 {
11291 SetHealth01("","",0);
11292 }
11293 else if (action_id ==
EActions.WATCH_ITEM)
11294 {
11296 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11297 #ifdef DEVELOPER
11298 SetDebugDeveloper_item(this);
11299 #endif
11300 }
11301
11302 else if (action_id ==
EActions.ADD_TEMPERATURE)
11303 {
11304 AddTemperature(20);
11305
11306 }
11307
11308 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11309 {
11310 AddTemperature(-20);
11311
11312 }
11313
11314 else if (action_id ==
EActions.FLIP_FROZEN)
11315 {
11316 SetFrozen(!GetIsFrozen());
11317
11318 }
11319
11320 else if (action_id ==
EActions.ADD_WETNESS)
11321 {
11323
11324 }
11325
11326 else if (action_id ==
EActions.REMOVE_WETNESS)
11327 {
11329
11330 }
11331
11332 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11333 {
11336
11337
11338 }
11339
11340 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11341 {
11344 }
11345
11346 else if (action_id ==
EActions.MAKE_SPECIAL)
11347 {
11348 auto debugParams = DebugSpawnParams.WithPlayer(player);
11349 OnDebugSpawnEx(debugParams);
11350 }
11351
11352 else if (action_id ==
EActions.DELETE)
11353 {
11354 Delete();
11355 }
11356
11357 }
11358
11359
11360 return false;
11361 }
11362
11363
11364
11365
11369
11372
11373
11374
11376 {
11377 return false;
11378 }
11379
11380
11382 {
11383 return true;
11384 }
11385
11386
11388 {
11389 return true;
11390 }
11391
11392
11393
11395 {
11396 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11398 }
11399
11402 {
11403 return null;
11404 }
11405
11407 {
11408 return false;
11409 }
11410
11412 {
11413 return false;
11414 }
11415
11419
11420
11422 {
11423 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11424 return module_repairing.CanRepair(this, item_repair_kit);
11425 }
11426
11427
11428 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11429 {
11430 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11431 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11432 }
11433
11434
11436 {
11437
11438
11439
11440
11441
11442
11443
11444
11445 return 1;
11446 }
11447
11448
11449
11451 {
11453 }
11454
11455
11456
11458 {
11460 }
11461
11462
11471 {
11472 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11473
11474 if (player)
11475 {
11476 player.MessageStatus(text);
11477 }
11478 }
11479
11480
11489 {
11490 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11491
11492 if (player)
11493 {
11494 player.MessageAction(text);
11495 }
11496 }
11497
11498
11507 {
11508 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11509
11510 if (player)
11511 {
11512 player.MessageFriendly(text);
11513 }
11514 }
11515
11516
11525 {
11526 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11527
11528 if (player)
11529 {
11530 player.MessageImportant(text);
11531 }
11532 }
11533
11535 {
11536 return true;
11537 }
11538
11539
11540 override bool KindOf(
string tag)
11541 {
11542 bool found = false;
11543 string item_name = this.
GetType();
11546
11547 int array_size = item_tag_array.Count();
11548 for (int i = 0; i < array_size; i++)
11549 {
11550 if (item_tag_array.Get(i) == tag)
11551 {
11552 found = true;
11553 break;
11554 }
11555 }
11556 return found;
11557 }
11558
11559
11561 {
11562
11563 super.OnRPC(sender, rpc_type,ctx);
11564
11565
11566 switch (rpc_type)
11567 {
11568 #ifndef SERVER
11569 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11570 Param2<bool, string> p = new Param2<bool, string>(false, "");
11571
11573 return;
11574
11575 bool play = p.param1;
11576 string soundSet = p.param2;
11577
11578 if (play)
11579 {
11581 {
11583 {
11585 }
11586 }
11587 else
11588 {
11590 }
11591 }
11592 else
11593 {
11595 }
11596
11597 break;
11598 #endif
11599
11600 }
11601
11603 {
11605 }
11606 }
11607
11608
11609
11610
11612 {
11613 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11614 return plugin.GetID(
name);
11615 }
11616
11618 {
11619 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11620 return plugin.GetName(id);
11621 }
11622
11625 {
11626
11627
11628 int varFlags;
11629 if (!ctx.
Read(varFlags))
11630 return;
11631
11632 if (varFlags & ItemVariableFlags.FLOAT)
11633 {
11635 }
11636 }
11637
11639 {
11640
11641 super.SerializeNumericalVars(floats_out);
11642
11643
11644
11646 {
11648 }
11649
11651 {
11653 }
11654
11656 {
11658 }
11659
11661 {
11666 }
11667
11669 {
11671 }
11672 }
11673
11675 {
11676
11677 super.DeSerializeNumericalVars(floats);
11678
11679
11680 int index = 0;
11681 int mask = Math.Round(floats.Get(index));
11682
11683 index++;
11684
11686 {
11688 {
11690 }
11691 else
11692 {
11693 float quantity = floats.Get(index);
11694 SetQuantity(quantity,
true,
false,
false,
false);
11695 }
11696 index++;
11697 }
11698
11700 {
11701 float wet = floats.Get(index);
11703 index++;
11704 }
11705
11707 {
11708 int liquidtype = Math.Round(floats.Get(index));
11710 index++;
11711 }
11712
11714 {
11716 index++;
11718 index++;
11720 index++;
11722 index++;
11723 }
11724
11726 {
11727 int cleanness = Math.Round(floats.Get(index));
11729 index++;
11730 }
11731 }
11732
11734 {
11735 super.WriteVarsToCTX(ctx);
11736
11737
11739 {
11741 }
11742
11744 {
11746 }
11747
11749 {
11751 }
11752
11754 {
11755 int r,g,b,a;
11761 }
11762
11764 {
11766 }
11767 }
11768
11770 {
11771 if (!super.ReadVarsFromCTX(ctx,version))
11772 return false;
11773
11774 int intValue;
11775 float value;
11776
11777 if (version < 140)
11778 {
11779 if (!ctx.
Read(intValue))
11780 return false;
11781
11782 m_VariablesMask = intValue;
11783 }
11784
11786 {
11787 if (!ctx.
Read(value))
11788 return false;
11789
11791 {
11793 }
11794 else
11795 {
11797 }
11798 }
11799
11800 if (version < 140)
11801 {
11803 {
11804 if (!ctx.
Read(value))
11805 return false;
11806 SetTemperatureDirect(value);
11807 }
11808 }
11809
11811 {
11812 if (!ctx.
Read(value))
11813 return false;
11815 }
11816
11818 {
11819 if (!ctx.
Read(intValue))
11820 return false;
11822 }
11823
11825 {
11826 int r,g,b,a;
11828 return false;
11830 return false;
11832 return false;
11834 return false;
11835
11837 }
11838
11840 {
11841 if (!ctx.
Read(intValue))
11842 return false;
11844 }
11845
11846 if (version >= 138 && version < 140)
11847 {
11849 {
11850 if (!ctx.
Read(intValue))
11851 return false;
11852 SetFrozen(intValue);
11853 }
11854 }
11855
11856 return true;
11857 }
11858
11859
11861 {
11864 {
11866 }
11867
11868 if (!super.OnStoreLoad(ctx, version))
11869 {
11871 return false;
11872 }
11873
11874 if (version >= 114)
11875 {
11876 bool hasQuickBarIndexSaved;
11877
11878 if (!ctx.
Read(hasQuickBarIndexSaved))
11879 {
11881 return false;
11882 }
11883
11884 if (hasQuickBarIndexSaved)
11885 {
11886 int itmQBIndex;
11887
11888
11889 if (!ctx.
Read(itmQBIndex))
11890 {
11892 return false;
11893 }
11894
11895 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11896 if (itmQBIndex != -1 && parentPlayer)
11897 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11898 }
11899 }
11900 else
11901 {
11902
11903 PlayerBase player;
11904 int itemQBIndex;
11905 if (version ==
int.
MAX)
11906 {
11907 if (!ctx.
Read(itemQBIndex))
11908 {
11910 return false;
11911 }
11912 }
11913 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11914 {
11915
11916 if (!ctx.
Read(itemQBIndex))
11917 {
11919 return false;
11920 }
11921 if (itemQBIndex != -1 && player)
11922 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11923 }
11924 }
11925
11926 if (version < 140)
11927 {
11928
11929 if (!LoadVariables(ctx, version))
11930 {
11932 return false;
11933 }
11934 }
11935
11936
11938 {
11940 return false;
11941 }
11942 if (version >= 132)
11943 {
11945 if (raib)
11946 {
11948 {
11950 return false;
11951 }
11952 }
11953 }
11954
11956 return true;
11957 }
11958
11959
11960
11962 {
11963 super.OnStoreSave(ctx);
11964
11965 PlayerBase player;
11966 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11967 {
11969
11970 int itemQBIndex = -1;
11971 itemQBIndex = player.FindQuickBarEntityIndex(this);
11972 ctx.
Write(itemQBIndex);
11973 }
11974 else
11975 {
11977 }
11978
11980
11982 if (raib)
11983 {
11985 }
11986 }
11987
11988
11990 {
11991 super.AfterStoreLoad();
11992
11994 {
11996 }
11997
11999 {
12002 }
12003 }
12004
12006 {
12007 super.EEOnAfterLoad();
12008
12010 {
12012 }
12013
12016 }
12017
12019 {
12020 return false;
12021 }
12022
12023
12024
12026 {
12028 {
12029 #ifdef PLATFORM_CONSOLE
12030
12032 {
12034 if (menu)
12035 {
12037 }
12038 }
12039 #endif
12040 }
12041
12043 {
12046 }
12047
12049 {
12050 SetWeightDirty();
12052 }
12054 {
12057 }
12058
12060 {
12063 }
12065 {
12068 }
12069
12070 super.OnVariablesSynchronized();
12071 }
12072
12073
12074
12076 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12077 {
12078 if (!IsServerCheck(allow_client))
12079 return false;
12080
12082 return false;
12083
12086
12087 if (value <= (min + 0.001))
12088 value = min;
12089
12090 if (value == min)
12091 {
12092 if (destroy_config)
12093 {
12094 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12095 if (dstr)
12096 {
12098 this.Delete();
12099 return true;
12100 }
12101 }
12102 else if (destroy_forced)
12103 {
12105 this.Delete();
12106 return true;
12107 }
12108
12110 }
12111
12114
12116 {
12118
12119 if (delta)
12121 }
12122
12124
12125 return false;
12126 }
12127
12128
12130 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12131 {
12133 }
12134
12136 {
12139 }
12140
12142 {
12145 }
12146
12149 {
12150 float value_clamped = Math.Clamp(value, 0, 1);
12152 SetQuantity(result, destroy_config, destroy_forced);
12153 }
12154
12155
12158 {
12160 }
12161
12163 {
12165 }
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12177 {
12178 int slot = -1;
12179 if (GetInventory())
12180 {
12181 InventoryLocation il = new InventoryLocation;
12182 GetInventory().GetCurrentInventoryLocation(il);
12184 }
12185
12187 }
12188
12190 {
12191 float quantity_max = 0;
12192
12194 {
12195 if (attSlotID != -1)
12196 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12197
12198 if (quantity_max <= 0)
12200 }
12201
12202 if (quantity_max <= 0)
12204
12205 return quantity_max;
12206 }
12207
12209 {
12211 }
12212
12214 {
12216 }
12217
12218
12220 {
12222 }
12223
12225 {
12227 }
12228
12230 {
12232 }
12233
12234
12236 {
12237
12238 float weightEx = GetWeightEx();
12239 float special = GetInventoryAndCargoWeight();
12240 return weightEx - special;
12241 }
12242
12243
12245 {
12247 }
12248
12250 {
12252 {
12253 #ifdef DEVELOPER
12254 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12255 {
12256 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12258 }
12259 #endif
12260
12261 return GetQuantity() * GetConfigWeightModified();
12262 }
12263 else if (HasEnergyManager())
12264 {
12265 #ifdef DEVELOPER
12266 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12267 {
12268 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12269 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12270 }
12271 #endif
12272 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12273 }
12274 else
12275 {
12276 #ifdef DEVELOPER
12277 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12278 {
12279 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12280 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12281 }
12282 #endif
12283 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12284 }
12285 }
12286
12289 {
12290 int item_count = 0;
12292
12293 if (GetInventory().GetCargo() != NULL)
12294 {
12295 item_count = GetInventory().GetCargo().GetItemCount();
12296 }
12297
12298 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12299 {
12300 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12301 if (item)
12302 item_count += item.GetNumberOfItems();
12303 }
12304 return item_count;
12305 }
12306
12309 {
12310 float weight = 0;
12311 float wetness = 1;
12312 if (include_wetness)
12315 {
12316 weight = wetness * m_ConfigWeight;
12317 }
12319 {
12320 weight = 1;
12321 }
12322 return weight;
12323 }
12324
12325
12326
12328 {
12329 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12330 {
12331 GameInventory inv = GetInventory();
12332 array<EntityAI> items = new array<EntityAI>;
12334 for (int i = 0; i < items.Count(); i++)
12335 {
12337 if (item)
12338 {
12340 }
12341 }
12342 }
12343 }
12344
12345
12346
12347
12349 {
12350 float energy = 0;
12351 if (HasEnergyManager())
12352 {
12353 energy = GetCompEM().GetEnergy();
12354 }
12355 return energy;
12356 }
12357
12358
12360 {
12361 super.OnEnergyConsumed();
12362
12364 }
12365
12367 {
12368 super.OnEnergyAdded();
12369
12371 }
12372
12373
12375 {
12376 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12377 {
12379 {
12380 float energy_0to1 = GetCompEM().GetEnergy0To1();
12382 }
12383 }
12384 }
12385
12386
12388 {
12389 return ConfigGetFloat("heatIsolation");
12390 }
12391
12393 {
12395 }
12396
12398 {
12399 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12400 if (
GetGame().ConfigIsExisting(paramPath))
12402
12403 return 0.0;
12404 }
12405
12407 {
12408 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12409 if (
GetGame().ConfigIsExisting(paramPath))
12411
12412 return 0.0;
12413 }
12414
12415 override void SetWet(
float value,
bool allow_client =
false)
12416 {
12417 if (!IsServerCheck(allow_client))
12418 return;
12419
12422
12424
12425 m_VarWet = Math.Clamp(value, min, max);
12426
12428 {
12431 }
12432 }
12433
12434 override void AddWet(
float value)
12435 {
12437 }
12438
12440 {
12442 }
12443
12445 {
12447 }
12448
12450 {
12452 }
12453
12455 {
12457 }
12458
12460 {
12462 }
12463
12464 override void OnWetChanged(
float newVal,
float oldVal)
12465 {
12468 if (newLevel != oldLevel)
12469 {
12471 }
12472 }
12473
12475 {
12476 SetWeightDirty();
12477 }
12478
12480 {
12481 return GetWetLevelInternal(
m_VarWet);
12482 }
12483
12484
12485
12487 {
12489 }
12490
12492 {
12494 }
12495
12497 {
12499 }
12500
12502 {
12504 }
12505
12506
12507
12509 {
12510 if (ConfigIsExisting("itemModelLength"))
12511 {
12512 return ConfigGetFloat("itemModelLength");
12513 }
12514 return 0;
12515 }
12516
12518 {
12519 if (ConfigIsExisting("itemAttachOffset"))
12520 {
12521 return ConfigGetFloat("itemAttachOffset");
12522 }
12523 return 0;
12524 }
12525
12526 override void SetCleanness(
int value,
bool allow_client =
false)
12527 {
12528 if (!IsServerCheck(allow_client))
12529 return;
12530
12532
12534
12537 }
12538
12540 {
12542 }
12543
12545 {
12546 return true;
12547 }
12548
12549
12550
12551
12553 {
12555 }
12556
12558 {
12560 }
12561
12562
12563
12564
12565 override void SetColor(
int r,
int g,
int b,
int a)
12566 {
12572 }
12574 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12575 {
12580 }
12581
12583 {
12585 }
12586
12589 {
12590 int r,g,b,a;
12592 r = r/255;
12593 g = g/255;
12594 b = b/255;
12595 a = a/255;
12596 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12597 }
12598
12599
12600
12601 override void SetLiquidType(
int value,
bool allow_client =
false)
12602 {
12603 if (!IsServerCheck(allow_client))
12604 return;
12605
12610 }
12611
12613 {
12614 return ConfigGetInt("varLiquidTypeInit");
12615 }
12616
12618 {
12620 }
12621
12623 {
12625 SetFrozen(false);
12626 }
12627
12630 {
12631 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12632 }
12633
12634
12637 {
12638 PlayerBase nplayer;
12639 if (PlayerBase.CastTo(nplayer, player))
12640 {
12642
12643 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12644 }
12645 }
12646
12647
12650 {
12651 PlayerBase nplayer;
12652 if (PlayerBase.CastTo(nplayer,player))
12653 {
12654
12655 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12656
12657 }
12658
12659
12660 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12661
12662
12663 if (HasEnergyManager())
12664 {
12665 GetCompEM().UpdatePlugState();
12666 }
12667 }
12668
12669
12671 {
12672 super.OnPlacementStarted(player);
12673
12675 }
12676
12677 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12678 {
12680 {
12681 m_AdminLog.OnPlacementComplete(player,
this);
12682 }
12683
12684 super.OnPlacementComplete(player, position, orientation);
12685 }
12686
12687
12688
12689
12690
12692 {
12694 {
12695 return true;
12696 }
12697 else
12698 {
12699 return false;
12700 }
12701 }
12702
12703
12705 {
12707 {
12709 }
12710 }
12711
12712
12714 {
12716 }
12717
12719 {
12721 }
12722
12723 override void InsertAgent(
int agent,
float count = 1)
12724 {
12725 if (count < 1)
12726 return;
12727
12729 }
12730
12733 {
12735 }
12736
12737
12739 {
12741 }
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12785 {
12787 return false;
12788 return true;
12789 }
12790
12792 {
12793
12795 }
12796
12797
12800 {
12801 super.CheckForRoofLimited(timeTresholdMS);
12802
12804 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12805 {
12806 m_PreviousRoofTestTime = time;
12807 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12808 }
12809 }
12810
12811
12813 {
12815 {
12816 return 0;
12817 }
12818
12819 if (GetInventory().GetAttachmentSlotsCount() != 0)
12820 {
12821 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12822 if (filter)
12823 return filter.GetProtectionLevel(type, false, system);
12824 else
12825 return 0;
12826 }
12827
12828 string subclassPath, entryName;
12829
12830 switch (type)
12831 {
12833 entryName = "biological";
12834 break;
12836 entryName = "chemical";
12837 break;
12838 default:
12839 entryName = "biological";
12840 break;
12841 }
12842
12843 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12844
12846 }
12847
12848
12849
12852 {
12853 if (!IsMagazine())
12855
12857 }
12858
12859
12860
12861
12862
12867 {
12868 return true;
12869 }
12870
12872 {
12874 }
12875
12876
12877
12878
12879
12881 {
12882 if (parent)
12883 {
12884 if (parent.IsInherited(DayZInfected))
12885 return true;
12886
12887 if (!parent.IsRuined())
12888 return true;
12889 }
12890
12891 return true;
12892 }
12893
12895 {
12896 if (!super.CanPutAsAttachment(parent))
12897 {
12898 return false;
12899 }
12900
12901 if (!IsRuined() && !parent.IsRuined())
12902 {
12903 return true;
12904 }
12905
12906 return false;
12907 }
12908
12910 {
12911
12912
12913
12914
12915 return super.CanReceiveItemIntoCargo(item);
12916 }
12917
12919 {
12920
12921
12922
12923
12924 GameInventory attachmentInv = attachment.GetInventory();
12926 {
12927 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12928 return false;
12929 }
12930
12931 InventoryLocation loc = new InventoryLocation();
12932 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12933 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12934 return false;
12935
12936 return super.CanReceiveAttachment(attachment, slotId);
12937 }
12938
12940 {
12941 if (!super.CanReleaseAttachment(attachment))
12942 return false;
12943
12944 return GetInventory().AreChildrenAccessible();
12945 }
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12968 {
12969 int id = muzzle_owner.GetMuzzleID();
12970 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12971
12972 if (WPOF_array)
12973 {
12974 for (int i = 0; i < WPOF_array.Count(); i++)
12975 {
12976 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12977
12978 if (WPOF)
12979 {
12980 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12981 }
12982 }
12983 }
12984 }
12985
12986
12988 {
12989 int id = muzzle_owner.GetMuzzleID();
12991
12992 if (WPOBE_array)
12993 {
12994 for (int i = 0; i < WPOBE_array.Count(); i++)
12995 {
12996 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12997
12998 if (WPOBE)
12999 {
13000 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13001 }
13002 }
13003 }
13004 }
13005
13006
13008 {
13009 int id = muzzle_owner.GetMuzzleID();
13010 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13011
13012 if (WPOOH_array)
13013 {
13014 for (int i = 0; i < WPOOH_array.Count(); i++)
13015 {
13016 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13017
13018 if (WPOOH)
13019 {
13020 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13021 }
13022 }
13023 }
13024 }
13025
13026
13028 {
13029 int id = muzzle_owner.GetMuzzleID();
13030 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13031
13032 if (WPOOH_array)
13033 {
13034 for (int i = 0; i < WPOOH_array.Count(); i++)
13035 {
13036 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13037
13038 if (WPOOH)
13039 {
13040 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13041 }
13042 }
13043 }
13044 }
13045
13046
13048 {
13049 int id = muzzle_owner.GetMuzzleID();
13050 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13051
13052 if (WPOOH_array)
13053 {
13054 for (int i = 0; i < WPOOH_array.Count(); i++)
13055 {
13056 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13057
13058 if (WPOOH)
13059 {
13060 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13061 }
13062 }
13063 }
13064 }
13065
13066
13067
13069 {
13071 {
13072 return true;
13073 }
13074
13075 return false;
13076 }
13077
13079 {
13081 {
13082 return true;
13083 }
13084
13085 return false;
13086 }
13087
13089 {
13091 {
13092 return true;
13093 }
13094
13095 return false;
13096 }
13097
13099 {
13100 return false;
13101 }
13102
13105 {
13106 return UATimeSpent.DEFAULT_DEPLOY;
13107 }
13108
13109
13110
13111
13113 {
13115 SetSynchDirty();
13116 }
13117
13119 {
13121 }
13122
13123
13125 {
13126 return false;
13127 }
13128
13131 {
13132 string att_type = "None";
13133
13134 if (ConfigIsExisting("soundAttType"))
13135 {
13136 att_type = ConfigGetString("soundAttType");
13137 }
13138
13140 }
13141
13143 {
13145 }
13146
13147
13148
13149
13150
13154
13156 {
13159
13161 }
13162
13163
13165 {
13167 return;
13168
13170
13173
13176
13177 SoundParameters params = new SoundParameters();
13181 }
13182
13183
13185 {
13187 return;
13188
13190 SetSynchDirty();
13191
13194 }
13195
13196
13198 {
13200 return;
13201
13203 SetSynchDirty();
13204
13207 }
13208
13210 {
13212 }
13213
13215 {
13217 }
13218
13221 {
13222 if (!
GetGame().IsDedicatedServer())
13223 {
13224 if (ConfigIsExisting("attachSoundSet"))
13225 {
13226 string cfg_path = "";
13227 string soundset = "";
13228 string type_name =
GetType();
13229
13232 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13233 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13234
13235 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13236 {
13237 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13238 {
13239 if (cfg_slot_array[i] == slot_type)
13240 {
13241 soundset = cfg_soundset_array[i];
13242 break;
13243 }
13244 }
13245 }
13246
13247 if (soundset != "")
13248 {
13249 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13251 }
13252 }
13253 }
13254 }
13255
13257 {
13258
13259 }
13260
13261 void OnApply(PlayerBase player);
13262
13264 {
13265 return 1.0;
13266 };
13267
13269 {
13271 }
13272
13274 {
13276 }
13277
13279
13281 {
13282 SetDynamicPhysicsLifeTime(0.01);
13284 }
13285
13287 {
13288 array<string> zone_names = new array<string>;
13289 GetDamageZones(zone_names);
13290 for (int i = 0; i < zone_names.Count(); i++)
13291 {
13292 SetHealthMax(zone_names.Get(i),"Health");
13293 }
13294 SetHealthMax("","Health");
13295 }
13296
13299 {
13300 float global_health = GetHealth01("","Health");
13301 array<string> zones = new array<string>;
13302 GetDamageZones(zones);
13303
13304 for (int i = 0; i < zones.Count(); i++)
13305 {
13306 SetHealth01(zones.Get(i),"Health",global_health);
13307 }
13308 }
13309
13312 {
13313 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13314 }
13315
13317 {
13318 if (!hasRootAsPlayer)
13319 {
13320 if (refParentIB)
13321 {
13322
13323 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13324 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13325
13326 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13327 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13328
13331 }
13332 else
13333 {
13334
13337 }
13338 }
13339 }
13340
13342 {
13344 {
13345 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13346 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13347 {
13348 float heatPermCoef = 1.0;
13350 while (ent)
13351 {
13352 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13353 ent = ent.GetHierarchyParent();
13354 }
13355
13356 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13357 }
13358 }
13359 }
13360
13362 {
13363
13364 EntityAI parent = GetHierarchyParent();
13365 if (!parent)
13366 {
13367 hasParent = false;
13368 hasRootAsPlayer = false;
13369 }
13370 else
13371 {
13372 hasParent = true;
13373 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13374 refParentIB =
ItemBase.Cast(parent);
13375 }
13376 }
13377
13378 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13379 {
13380
13381 }
13382
13384 {
13385
13386 return false;
13387 }
13388
13390 {
13391
13392
13393 return false;
13394 }
13395
13397 {
13398
13399 return false;
13400 }
13401
13404 {
13405 return !GetIsFrozen() &&
IsOpen();
13406 }
13407
13409 {
13410 bool hasParent = false, hasRootAsPlayer = false;
13412
13413 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13414 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13415
13416 if (wwtu || foodDecay)
13417 {
13421
13422 if (processWetness || processTemperature || processDecay)
13423 {
13425
13426 if (processWetness)
13427 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13428
13429 if (processTemperature)
13431
13432 if (processDecay)
13433 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13434 }
13435 }
13436 }
13437
13440 {
13442 }
13443
13445 {
13448
13449 return super.GetTemperatureFreezeThreshold();
13450 }
13451
13453 {
13456
13457 return super.GetTemperatureThawThreshold();
13458 }
13459
13461 {
13464
13465 return super.GetItemOverheatThreshold();
13466 }
13467
13469 {
13471 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13472
13473 return super.GetTemperatureFreezeTime();
13474 }
13475
13477 {
13479 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13480
13481 return super.GetTemperatureThawTime();
13482 }
13483
13488
13490 {
13491 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13492 }
13493
13495 {
13496 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13497 }
13498
13501 {
13503 }
13504
13506 {
13508 }
13509
13511 {
13513 }
13514
13517 {
13518 return null;
13519 }
13520
13523 {
13524 return false;
13525 }
13526
13528 {
13530 {
13533 if (!trg)
13534 {
13536 explosive = this;
13537 }
13538
13539 explosive.PairRemote(trg);
13541
13542 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13543 trg.SetPersistentPairID(persistentID);
13544 explosive.SetPersistentPairID(persistentID);
13545
13546 return true;
13547 }
13548 return false;
13549 }
13550
13553 {
13554 float ret = 1.0;
13557 ret *= GetHealth01();
13558
13559 return ret;
13560 }
13561
13562 #ifdef DEVELOPER
13563 override void SetDebugItem()
13564 {
13565 super.SetDebugItem();
13566 _itemBase = this;
13567 }
13568
13570 {
13571 string text = super.GetDebugText();
13572
13574 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13575
13576 return text;
13577 }
13578 #endif
13579
13581 {
13582 return true;
13583 }
13584
13586
13588
13590 {
13593 }
13594
13595
13603
13619}
13620
13622{
13624 if (entity)
13625 {
13626 bool is_item = entity.IsInherited(
ItemBase);
13627 if (is_item && full_quantity)
13628 {
13631 }
13632 }
13633 else
13634 {
13636 return NULL;
13637 }
13638 return entity;
13639}
13640
13642{
13643 if (item)
13644 {
13645 if (health > 0)
13646 item.SetHealth("", "", health);
13647
13648 if (item.CanHaveTemperature())
13649 {
13651 if (item.CanFreeze())
13652 item.SetFrozen(false);
13653 }
13654
13655 if (item.HasEnergyManager())
13656 {
13657 if (quantity >= 0)
13658 {
13659 item.GetCompEM().SetEnergy0To1(quantity);
13660 }
13661 else
13662 {
13664 }
13665 }
13666 else if (item.IsMagazine())
13667 {
13668 Magazine mag = Magazine.Cast(item);
13669 if (quantity >= 0)
13670 {
13671 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13672 }
13673 else
13674 {
13676 }
13677
13678 }
13679 else
13680 {
13681 if (quantity >= 0)
13682 {
13683 item.SetQuantityNormalized(quantity, false);
13684 }
13685 else
13686 {
13688 }
13689
13690 }
13691 }
13692}
13693
13694#ifdef DEVELOPER
13696#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.