8725{
8727 {
8728 return true;
8729 }
8730};
8731
8732
8733
8735{
8739
8741
8744
8745
8746
8747
8748
8757
8763
8768
8773
8794 protected bool m_IsResultOfSplit
8795
8797
8802
8803
8804
8806
8810
8811
8812
8814
8817
8818
8819
8825
8826
8834
8837
8838
8840
8841
8843
8844
8849
8850
8855
8856
8858
8859
8861 {
8866
8867 if (!
GetGame().IsDedicatedServer())
8868 {
8870 {
8872
8874 {
8876 }
8877 }
8878
8881 }
8882
8883 m_OldLocation = null;
8884
8886 {
8888 }
8889
8890 if (ConfigIsExisting("headSelectionsToHide"))
8891 {
8894 }
8895
8897 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8898 {
8900 }
8901
8903
8904 m_IsResultOfSplit = false;
8905
8907 }
8908
8910 {
8911 super.InitItemVariables();
8912
8918 m_Count = ConfigGetInt(
"count");
8919
8922
8927
8930
8935
8947
8951
8952
8955 if (ConfigIsExisting("canBeSplit"))
8956 {
8959 }
8960
8962 if (ConfigIsExisting("itemBehaviour"))
8964
8965
8968 RegisterNetSyncVariableInt("m_VarLiquidType");
8969 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8970
8971 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8972 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8973 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8974
8975 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8976 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8977 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8978 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8979
8980 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8981 RegisterNetSyncVariableBool("m_IsTakeable");
8982 RegisterNetSyncVariableBool("m_IsHologram");
8983
8986 {
8989 }
8990
8992
8994 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8996
8997 }
8998
9000 {
9002 }
9003
9005 {
9008 {
9013 }
9014 }
9015
9016 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9017 {
9019 {
9022 }
9023
9025 }
9026
9028 {
9034 }
9035
9037
9039 {
9041
9042 if (!action)
9043 {
9044 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9045 return;
9046 }
9047
9049 if (!ai)
9050 {
9052 return;
9053 }
9054
9056 if (!action_array)
9057 {
9058 action_array = new array<ActionBase_Basic>;
9060 }
9061 if (LogManager.IsActionLogEnable())
9062 {
9063 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9064 }
9065
9066 if (action_array.Find(action) != -1)
9067 {
9068 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9069 }
9070 else
9071 {
9072 action_array.Insert(action);
9073 }
9074 }
9075
9077 {
9079 ActionBase action = player.GetActionManager().GetAction(actionName);
9082
9083 if (action_array)
9084 {
9085 action_array.RemoveItem(action);
9086 }
9087 }
9088
9089
9090
9092 {
9093 ActionOverrideData overrideData = new ActionOverrideData();
9097
9099 if (!actionMap)
9100 {
9103 }
9104
9105 actionMap.Insert(this.
Type(), overrideData);
9106
9107 }
9108
9110
9112
9113
9115 {
9118
9121
9122 string config_to_search = "CfgVehicles";
9123 string muzzle_owner_config;
9124
9126 {
9127 if (IsInherited(Weapon))
9128 config_to_search = "CfgWeapons";
9129
9130 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9131
9132 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9133
9135
9136 if (config_OnFire_subclass_count > 0)
9137 {
9138 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9139
9140 for (int i = 0; i < config_OnFire_subclass_count; i++)
9141 {
9142 string particle_class = "";
9144 string config_OnFire_entry = config_OnFire_class + particle_class;
9145 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9146 WPOF_array.Insert(WPOF);
9147 }
9148
9149
9151 }
9152 }
9153
9155 {
9156 config_to_search = "CfgWeapons";
9157 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9158
9159 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9160
9162
9163 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9164 {
9165 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9166
9167 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9168 {
9169 string particle_class2 = "";
9171 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9172 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9173 WPOBE_array.Insert(WPOBE);
9174 }
9175
9176
9178 }
9179 }
9180 }
9181
9182
9184 {
9187
9189 {
9190 string config_to_search = "CfgVehicles";
9191
9192 if (IsInherited(Weapon))
9193 config_to_search = "CfgWeapons";
9194
9195 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9196 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9197
9198 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9199 {
9200
9202
9204 {
9206 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9208 return;
9209 }
9210
9213
9214
9215
9217 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9218
9219 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9220 {
9221 string particle_class = "";
9223 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9225
9226 if (entry_type == CT_CLASS)
9227 {
9228 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9229 WPOOH_array.Insert(WPOF);
9230 }
9231 }
9232
9233
9235 }
9236 }
9237 }
9238
9240 {
9242 }
9243
9245 {
9247 {
9249
9252
9255
9256 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9257 }
9258 }
9259
9261 {
9263 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9264
9266 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9267
9269 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9270
9272 {
9274 }
9275 }
9276
9278 {
9280 }
9281
9283 {
9286 else
9288
9290 {
9293 }
9294 else
9295 {
9298
9301 }
9302
9304 }
9305
9307 {
9309 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9310 }
9311
9313 {
9315 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9317 }
9318
9320 {
9322 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9323 }
9324
9326 {
9329
9330 OverheatingParticle OP = new OverheatingParticle();
9335
9337 }
9338
9340 {
9343
9344 return -1;
9345 }
9346
9348 {
9350 {
9353
9354 for (int i = count; i > 0; --i)
9355 {
9356 int id = i - 1;
9359
9362
9363 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9364 {
9365 if (p)
9366 {
9369 }
9370 }
9371 }
9372 }
9373 }
9374
9376 {
9378 {
9380 {
9381 int id = i - 1;
9383
9384 if (OP)
9385 {
9387
9388 if (p)
9389 {
9391 }
9392
9393 delete OP;
9394 }
9395 }
9396
9399 }
9400 }
9401
9404 {
9405 return 0.0;
9406 }
9407
9408
9410 {
9411 return 250;
9412 }
9413
9415 {
9416 return 0;
9417 }
9418
9421 {
9423 return true;
9424
9425 return false;
9426 }
9427
9430 {
9433
9435 {
9437 }
9438 else
9439 {
9440
9442 }
9443
9445 }
9446
9453 {
9454 return -1;
9455 }
9456
9457
9458
9459
9461 {
9463 {
9465 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9466
9467 if (r_index >= 0)
9468 {
9469 InventoryLocation r_il = new InventoryLocation;
9470 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9471
9472 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9475 {
9476 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9477 }
9479 {
9480 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9481 }
9482
9483 }
9484
9485 player.GetHumanInventory().ClearUserReservedLocation(this);
9486 }
9487
9490 }
9491
9492
9493
9494
9496 {
9497 return ItemBase.m_DebugActionsMask;
9498 }
9499
9501 {
9502 return ItemBase.m_DebugActionsMask & mask;
9503 }
9504
9506 {
9507 ItemBase.m_DebugActionsMask = mask;
9508 }
9509
9511 {
9512 ItemBase.m_DebugActionsMask |= mask;
9513 }
9514
9516 {
9517 ItemBase.m_DebugActionsMask &= ~mask;
9518 }
9519
9521 {
9523 {
9525 }
9526 else
9527 {
9529 }
9530 }
9531
9532
9534 {
9535 if (GetEconomyProfile())
9536 {
9537 float q_max = GetEconomyProfile().GetQuantityMax();
9538 if (q_max > 0)
9539 {
9540 float q_min = GetEconomyProfile().GetQuantityMin();
9541 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9542
9544 {
9545 ComponentEnergyManager comp = GetCompEM();
9547 {
9549 }
9550 }
9552 {
9554
9555 }
9556
9557 }
9558 }
9559 }
9560
9563 {
9564 EntityAI parent = GetHierarchyParent();
9565
9566 if (parent)
9567 {
9568 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9569 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9570 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9571 }
9572 }
9573
9576 {
9577 EntityAI parent = GetHierarchyParent();
9578
9579 if (parent)
9580 {
9581 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9582 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9583 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9584 }
9585 }
9586
9588 {
9589
9590
9591
9592
9594
9596 {
9597 if (ScriptInputUserData.CanStoreInputUserData())
9598 {
9599 ScriptInputUserData ctx = new ScriptInputUserData;
9605 ctx.
Write(use_stack_max);
9608
9610 {
9611 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9612 }
9613 }
9614 }
9615 else if (!
GetGame().IsMultiplayer())
9616 {
9618 }
9619 }
9620
9622 {
9624 }
9625
9627 {
9629 }
9630
9632 {
9634 }
9635
9637 {
9638
9639 return false;
9640 }
9641
9643 {
9644 return false;
9645 }
9646
9650 {
9651 return false;
9652 }
9653
9655 {
9656 return "";
9657 }
9658
9660
9662 {
9663 return false;
9664 }
9665
9667 {
9668 return true;
9669 }
9670
9671
9672
9674 {
9675 return true;
9676 }
9677
9679 {
9680 return true;
9681 }
9682
9684 {
9685 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9687 }
9688
9690 {
9692 }
9693
9695 {
9697 if (!is_being_placed)
9699 SetSynchDirty();
9700 }
9701
9702
9704
9706 {
9708 }
9709
9711 {
9713 }
9714
9716 {
9717 return 1;
9718 }
9719
9721 {
9722 return false;
9723 }
9724
9726 {
9728 SetSynchDirty();
9729 }
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9766 {
9767 super.OnMovedInsideCargo(container);
9768
9769 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9770 }
9771
9772 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9773 {
9774 super.EEItemLocationChanged(oldLoc,newLoc);
9775
9776 PlayerBase new_player = null;
9777 PlayerBase old_player = null;
9778
9779 if (newLoc.GetParent())
9780 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9781
9782 if (oldLoc.GetParent())
9783 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9784
9786 {
9787 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9788
9789 if (r_index >= 0)
9790 {
9791 InventoryLocation r_il = new InventoryLocation;
9792 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9793
9794 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9797 {
9798 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9799 }
9801 {
9802 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9803 }
9804
9805 }
9806 }
9807
9809 {
9810 if (new_player)
9811 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9812
9813 if (new_player == old_player)
9814 {
9815
9816 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9817 {
9819 {
9820 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9821 {
9822 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9823 }
9824 }
9825 else
9826 {
9827 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9828 }
9829 }
9830
9831 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9832 {
9833 int type = oldLoc.GetType();
9835 {
9836 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9837 }
9839 {
9840 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9841 }
9842 }
9843 if (!m_OldLocation)
9844 {
9845 m_OldLocation = new InventoryLocation;
9846 }
9847 m_OldLocation.Copy(oldLoc);
9848 }
9849 else
9850 {
9851 if (m_OldLocation)
9852 {
9853 m_OldLocation.Reset();
9854 }
9855 }
9856
9858 }
9859 else
9860 {
9861 if (new_player)
9862 {
9863 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9864 if (res_index >= 0)
9865 {
9866 InventoryLocation il = new InventoryLocation;
9867 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9869 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9872 {
9873 il.
GetParent().GetOnReleaseLock().Invoke(it);
9874 }
9876 {
9878 }
9879
9880 }
9881 }
9883 {
9884
9886 }
9887
9888 if (m_OldLocation)
9889 {
9890 m_OldLocation.Reset();
9891 }
9892 }
9893 }
9894
9895 override void EOnContact(IEntity other, Contact extra)
9896 {
9898 {
9899 int liquidType = -1;
9901 if (impactSpeed > 0.0)
9902 {
9904 #ifndef SERVER
9906 #else
9908 SetSynchDirty();
9909 #endif
9911 }
9912 }
9913
9914 #ifdef SERVER
9915 if (GetCompEM() && GetCompEM().IsPlugged())
9916 {
9917 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9918 GetCompEM().UnplugThis();
9919 }
9920 #endif
9921 }
9922
9924
9926 {
9928 }
9929
9931 {
9932
9933 }
9934
9936 {
9937 super.OnItemLocationChanged(old_owner, new_owner);
9938
9939 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9940 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9941
9942 if (!relatedPlayer && playerNew)
9943 relatedPlayer = playerNew;
9944
9945 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9946 {
9948 if (actionMgr)
9949 {
9950 ActionBase currentAction = actionMgr.GetRunningAction();
9951 if (currentAction)
9953 }
9954 }
9955
9956 Man ownerPlayerOld = null;
9957 Man ownerPlayerNew = null;
9958
9959 if (old_owner)
9960 {
9961 if (old_owner.
IsMan())
9962 {
9963 ownerPlayerOld = Man.Cast(old_owner);
9964 }
9965 else
9966 {
9967 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9968 }
9969 }
9970 else
9971 {
9973 {
9975
9976 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9977 {
9978 GetCompEM().UnplugThis();
9979 }
9980 }
9981 }
9982
9983 if (new_owner)
9984 {
9985 if (new_owner.
IsMan())
9986 {
9987 ownerPlayerNew = Man.Cast(new_owner);
9988 }
9989 else
9990 {
9991 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9992 }
9993 }
9994
9995 if (ownerPlayerOld != ownerPlayerNew)
9996 {
9997 if (ownerPlayerOld)
9998 {
9999 array<EntityAI> subItemsExit = new array<EntityAI>;
10001 for (int i = 0; i < subItemsExit.Count(); i++)
10002 {
10005 }
10006 }
10007
10008 if (ownerPlayerNew)
10009 {
10010 array<EntityAI> subItemsEnter = new array<EntityAI>;
10012 for (int j = 0; j < subItemsEnter.Count(); j++)
10013 {
10016 }
10017 }
10018 }
10019 else if (ownerPlayerNew != null)
10020 {
10021 PlayerBase nplayer;
10022 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10023 {
10024 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10026 for (int k = 0; k < subItemsUpdate.Count(); k++)
10027 {
10029 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10030 }
10031 }
10032 }
10033
10034 if (old_owner)
10035 old_owner.OnChildItemRemoved(this);
10036 if (new_owner)
10037 new_owner.OnChildItemReceived(this);
10038 }
10039
10040
10042 {
10043 super.EEDelete(parent);
10044 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10045 if (player)
10046 {
10048
10049 if (player.IsAlive())
10050 {
10051 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10052 if (r_index >= 0)
10053 {
10054 InventoryLocation r_il = new InventoryLocation;
10055 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10056
10057 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10060 {
10061 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10062 }
10064 {
10065 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10066 }
10067
10068 }
10069
10070 player.RemoveQuickBarEntityShortcut(this);
10071 }
10072 }
10073 }
10074
10076 {
10077 super.EEKilled(killer);
10078
10081 {
10082 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10083 {
10084 if (IsMagazine())
10085 {
10086 if (Magazine.Cast(this).GetAmmoCount() > 0)
10087 {
10089 }
10090 }
10091 else
10092 {
10094 }
10095 }
10096 }
10097 }
10098
10100 {
10101 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10102
10103 super.OnWasAttached(parent, slot_id);
10104
10107
10109 }
10110
10112 {
10113 super.OnWasDetached(parent, slot_id);
10114
10117 }
10118
10120 {
10121 int idx;
10124
10125 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10126 if (inventory_slots.Count() < 1)
10127 {
10128 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10129 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10130 }
10131 else
10132 {
10133 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10134 }
10135
10136 idx = inventory_slots.Find(slot);
10137 if (idx < 0)
10138 return "";
10139
10140 return attach_types.Get(idx);
10141 }
10142
10144 {
10145 int idx = -1;
10146 string slot;
10147
10150
10151 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10152 if (inventory_slots.Count() < 1)
10153 {
10154 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10155 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10156 }
10157 else
10158 {
10159 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10160 if (detach_types.Count() < 1)
10161 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10162 }
10163
10164 for (int i = 0; i < inventory_slots.Count(); i++)
10165 {
10166 slot = inventory_slots.Get(i);
10167 }
10168
10169 if (slot != "")
10170 {
10171 if (detach_types.Count() == 1)
10172 idx = 0;
10173 else
10174 idx = inventory_slots.Find(slot);
10175 }
10176 if (idx < 0)
10177 return "";
10178
10179 return detach_types.Get(idx);
10180 }
10181
10183 {
10184
10186
10187
10188 float min_time = 1;
10189 float max_time = 3;
10190 float delay = Math.RandomFloat(min_time, max_time);
10191
10192 explode_timer.Run(delay, this, "DoAmmoExplosion");
10193 }
10194
10196 {
10197 Magazine magazine = Magazine.Cast(this);
10198 int pop_sounds_count = 6;
10199 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10200
10201
10202 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10203 string sound_name = pop_sounds[ sound_idx ];
10205
10206
10207 magazine.ServerAddAmmoCount(-1);
10208
10209
10210 float min_temp_to_explode = 100;
10211
10212 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10213 {
10215 }
10216 }
10217
10218
10219 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10220 {
10221 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10222
10223 const int CHANCE_DAMAGE_CARGO = 4;
10224 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10225 const int CHANCE_DAMAGE_NOTHING = 2;
10226
10228 {
10229 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10230 int chances;
10231 int rnd;
10232
10233 if (GetInventory().GetCargo())
10234 {
10235 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10236 rnd = Math.RandomInt(0,chances);
10237
10238 if (rnd < CHANCE_DAMAGE_CARGO)
10239 {
10241 }
10242 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10243 {
10245 }
10246 }
10247 else
10248 {
10249 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10250 rnd = Math.RandomInt(0,chances);
10251
10252 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10253 {
10255 }
10256 }
10257 }
10258 }
10259
10261 {
10262 if (GetInventory().GetCargo())
10263 {
10264 int item_count = GetInventory().GetCargo().GetItemCount();
10265 if (item_count > 0)
10266 {
10267 int random_pick = Math.RandomInt(0, item_count);
10269 if (!item.IsExplosive())
10270 {
10271 item.AddHealth("","",damage);
10272 return true;
10273 }
10274 }
10275 }
10276 return false;
10277 }
10278
10280 {
10281 int attachment_count = GetInventory().AttachmentCount();
10282 if (attachment_count > 0)
10283 {
10284 int random_pick = Math.RandomInt(0, attachment_count);
10285 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10286 if (!attachment.IsExplosive())
10287 {
10288 attachment.AddHealth("","",damage);
10289 return true;
10290 }
10291 }
10292 return false;
10293 }
10294
10296 {
10298 }
10299
10301 {
10303 return GetInventory().CanRemoveEntity();
10304
10305 return false;
10306 }
10307
10309 {
10311 return;
10312
10314 {
10315 if (ScriptInputUserData.CanStoreInputUserData())
10316 {
10317 ScriptInputUserData ctx = new ScriptInputUserData;
10322 ctx.
Write(destination_entity);
10324 ctx.
Write(slot_id);
10326 }
10327 }
10328 else if (!
GetGame().IsMultiplayer())
10329 {
10331 }
10332 }
10333
10335 {
10337 return;
10338
10339 float split_quantity_new;
10343 InventoryLocation loc = new InventoryLocation;
10344
10345 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10346 {
10348 split_quantity_new = stack_max;
10349 else
10351
10352 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10353 if (new_item)
10354 {
10355 new_item.SetResultOfSplit(true);
10356 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10358 new_item.SetQuantity(split_quantity_new);
10359 }
10360 }
10361 else if (destination_entity && slot_id == -1)
10362 {
10363 if (quantity > stack_max)
10364 split_quantity_new = stack_max;
10365 else
10366 split_quantity_new = quantity;
10367
10369 {
10372 }
10373
10374 if (new_item)
10375 {
10376 new_item.SetResultOfSplit(true);
10377 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10379 new_item.SetQuantity(split_quantity_new);
10380 }
10381 }
10382 else
10383 {
10384 if (stack_max != 0)
10385 {
10387 {
10389 }
10390
10391 if (split_quantity_new == 0)
10392 {
10393 if (!
GetGame().IsMultiplayer())
10394 player.PhysicalPredictiveDropItem(this);
10395 else
10396 player.ServerDropEntity(this);
10397 return;
10398 }
10399
10401
10402 if (new_item)
10403 {
10404 new_item.SetResultOfSplit(true);
10405 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10407 new_item.SetQuantity(stack_max);
10408 new_item.PlaceOnSurface();
10409 }
10410 }
10411 }
10412 }
10413
10415 {
10417 return;
10418
10419 float split_quantity_new;
10423 InventoryLocation loc = new InventoryLocation;
10424
10425 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10426 {
10428 split_quantity_new = stack_max;
10429 else
10431
10432 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10433 if (new_item)
10434 {
10435 new_item.SetResultOfSplit(true);
10436 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10438 new_item.SetQuantity(split_quantity_new);
10439 }
10440 }
10441 else if (destination_entity && slot_id == -1)
10442 {
10443 if (quantity > stack_max)
10444 split_quantity_new = stack_max;
10445 else
10446 split_quantity_new = quantity;
10447
10449 {
10452 }
10453
10454 if (new_item)
10455 {
10456 new_item.SetResultOfSplit(true);
10457 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10459 new_item.SetQuantity(split_quantity_new);
10460 }
10461 }
10462 else
10463 {
10464 if (stack_max != 0)
10465 {
10467 {
10469 }
10470
10472
10473 if (new_item)
10474 {
10475 new_item.SetResultOfSplit(true);
10476 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10478 new_item.SetQuantity(stack_max);
10479 new_item.PlaceOnSurface();
10480 }
10481 }
10482 }
10483 }
10484
10486 {
10488 return;
10489
10491 {
10492 if (ScriptInputUserData.CanStoreInputUserData())
10493 {
10494 ScriptInputUserData ctx = new ScriptInputUserData;
10499 dst.WriteToContext(ctx);
10501 }
10502 }
10503 else if (!
GetGame().IsMultiplayer())
10504 {
10506 }
10507 }
10508
10510 {
10512 return;
10513
10515 {
10516 if (ScriptInputUserData.CanStoreInputUserData())
10517 {
10518 ScriptInputUserData ctx = new ScriptInputUserData;
10523 ctx.
Write(destination_entity);
10529 }
10530 }
10531 else if (!
GetGame().IsMultiplayer())
10532 {
10534 }
10535 }
10536
10538 {
10540 }
10541
10543 {
10545 return this;
10546
10548 float split_quantity_new;
10550 if (dst.IsValid())
10551 {
10552 int slot_id = dst.GetSlot();
10554
10555 if (quantity > stack_max)
10556 split_quantity_new = stack_max;
10557 else
10558 split_quantity_new = quantity;
10559
10561
10562 if (new_item)
10563 {
10564 new_item.SetResultOfSplit(true);
10565 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10568 }
10569
10570 return new_item;
10571 }
10572
10573 return null;
10574 }
10575
10577 {
10579 return;
10580
10582 float split_quantity_new;
10584 if (destination_entity)
10585 {
10587 if (quantity > stackable)
10588 split_quantity_new = stackable;
10589 else
10590 split_quantity_new = quantity;
10591
10592 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10593 if (new_item)
10594 {
10595 new_item.SetResultOfSplit(true);
10596 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10598 new_item.SetQuantity(split_quantity_new);
10599 }
10600 }
10601 }
10602
10604 {
10606 return;
10607
10609 {
10610 if (ScriptInputUserData.CanStoreInputUserData())
10611 {
10612 ScriptInputUserData ctx = new ScriptInputUserData;
10617 ItemBase destination_entity =
this;
10618 ctx.
Write(destination_entity);
10622 }
10623 }
10624 else if (!
GetGame().IsMultiplayer())
10625 {
10627 }
10628 }
10629
10631 {
10633 return;
10634
10636 float split_quantity_new;
10638 if (player)
10639 {
10641 if (quantity > stackable)
10642 split_quantity_new = stackable;
10643 else
10644 split_quantity_new = quantity;
10645
10646 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10647 new_item =
ItemBase.Cast(in_hands);
10648 if (new_item)
10649 {
10650 new_item.SetResultOfSplit(true);
10651 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10653 new_item.SetQuantity(split_quantity_new);
10654 }
10655 }
10656 }
10657
10659 {
10661 return;
10662
10664 float split_quantity_new = Math.Floor(quantity * 0.5);
10665
10667
10668 if (new_item)
10669 {
10670 if (new_item.GetQuantityMax() < split_quantity_new)
10671 {
10672 split_quantity_new = new_item.GetQuantityMax();
10673 }
10674
10675 new_item.SetResultOfSplit(true);
10676 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10677
10679 {
10682 }
10683 else
10684 {
10687 }
10688 }
10689 }
10690
10692 {
10694 return;
10695
10697 float split_quantity_new = Math.Floor(quantity / 2);
10698
10699 InventoryLocation invloc = new InventoryLocation;
10701
10703 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10704
10705 if (new_item)
10706 {
10707 if (new_item.GetQuantityMax() < split_quantity_new)
10708 {
10709 split_quantity_new = new_item.GetQuantityMax();
10710 }
10712 {
10715 }
10716 else
10717 {
10720 }
10721 }
10722 }
10723
10726 {
10727 SetWeightDirty();
10729
10730 if (parent)
10731 parent.OnAttachmentQuantityChangedEx(this, delta);
10732
10734 {
10736 {
10738 }
10740 {
10741 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10743 }
10744 }
10745
10746 }
10747
10750 {
10751
10752 }
10753
10756 {
10758 }
10759
10761 {
10762 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10763
10765 {
10766 if (newLevel == GameConstants.STATE_RUINED)
10767 {
10769 EntityAI parent = GetHierarchyParent();
10770 if (parent && parent.IsFireplace())
10771 {
10772 CargoBase cargo = GetInventory().GetCargo();
10773 if (cargo)
10774 {
10776 {
10778 }
10779 }
10780 }
10781 }
10782
10784 {
10785
10787 return;
10788 }
10789
10790 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10791 {
10793 }
10794 }
10795 }
10796
10797
10799 {
10800 super.OnRightClick();
10801
10803 {
10805 {
10806 if (ScriptInputUserData.CanStoreInputUserData())
10807 {
10808 vector m4[4];
10810
10811 EntityAI root = GetHierarchyRoot();
10812
10813 InventoryLocation dst = new InventoryLocation;
10815 {
10816 if (root)
10817 {
10818 root.GetTransform(m4);
10820 }
10821 else
10822 GetInventory().GetCurrentInventoryLocation(dst);
10823 }
10824 else
10825 {
10827
10828
10829 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10830 {
10831 if (root)
10832 {
10833 root.GetTransform(m4);
10835 }
10836 else
10837 GetInventory().GetCurrentInventoryLocation(dst);
10838 }
10839 else
10840 {
10841 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10842 }
10843 }
10844
10845 ScriptInputUserData ctx = new ScriptInputUserData;
10853 }
10854 }
10855 else if (!
GetGame().IsMultiplayer())
10856 {
10858 }
10859 }
10860 }
10861
10862 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10863 {
10864
10865 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10866 return false;
10867
10868 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10869 return false;
10870
10871
10873 return false;
10874
10875
10876 Magazine mag = Magazine.Cast(this);
10877 if (mag)
10878 {
10879 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10880 return false;
10881
10882 if (stack_max_limit)
10883 {
10884 Magazine other_mag = Magazine.Cast(other_item);
10885 if (other_item)
10886 {
10887 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10888 return false;
10889 }
10890
10891 }
10892 }
10893 else
10894 {
10895
10897 return false;
10898
10900 return false;
10901 }
10902
10903 PlayerBase player = null;
10904 if (CastTo(player, GetHierarchyRootPlayer()))
10905 {
10906 if (player.GetInventory().HasAttachment(this))
10907 return false;
10908
10909 if (player.IsItemsToDelete())
10910 return false;
10911 }
10912
10913 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10914 return false;
10915
10916 int slotID;
10918 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10919 return false;
10920
10921 return true;
10922 }
10923
10925 {
10927 }
10928
10930 {
10931 return m_IsResultOfSplit;
10932 }
10933
10935 {
10936 m_IsResultOfSplit = value;
10937 }
10938
10940 {
10942 }
10943
10945 {
10946 float other_item_quantity = other_item.GetQuantity();
10947 float this_free_space;
10948
10950
10952
10953 if (other_item_quantity > this_free_space)
10954 {
10955 return this_free_space;
10956 }
10957 else
10958 {
10959 return other_item_quantity;
10960 }
10961 }
10962
10964 {
10966 }
10967
10969 {
10971 return;
10972
10973 if (!IsMagazine() && other_item)
10974 {
10976 if (quantity_used != 0)
10977 {
10978 float hp1 = GetHealth01("","");
10979 float hp2 = other_item.GetHealth01("","");
10980 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10981 hpResult = hpResult / (
GetQuantity() + quantity_used);
10982
10983 hpResult *= GetMaxHealth();
10984 Math.Round(hpResult);
10985 SetHealth("", "Health", hpResult);
10986
10988 other_item.AddQuantity(-quantity_used);
10989 }
10990 }
10992 }
10993
10995 {
10996 #ifdef SERVER
10997 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10998 GetHierarchyParent().IncreaseLifetimeUp();
10999 #endif
11000 };
11001
11003 {
11004 PlayerBase p = PlayerBase.Cast(player);
11005
11006 array<int> recipesIds = p.m_Recipes;
11007 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11008 if (moduleRecipesManager)
11009 {
11010 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11011 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11012 }
11013
11014 for (int i = 0;i < recipesIds.Count(); i++)
11015 {
11016 int key = recipesIds.Get(i);
11017 string recipeName = moduleRecipesManager.GetRecipeName(key);
11019 }
11020 }
11021
11022
11023 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11024 {
11025 super.GetDebugActions(outputList);
11026
11027
11032
11033
11037
11041
11042
11045
11046
11048 {
11051 }
11052
11054
11057
11061 }
11062
11063
11064
11065
11067 {
11068 super.OnAction(action_id, player, ctx);
11069 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11070 {
11071 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11072 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11073 PlayerBase p = PlayerBase.Cast(player);
11074 if (
EActions.RECIPES_RANGE_START < 1000)
11075 {
11076 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11077 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11078 }
11079 }
11080 #ifndef SERVER
11081 else if (action_id ==
EActions.WATCH_PLAYER)
11082 {
11083 PluginDeveloper.SetDeveloperItemClientEx(player);
11084 }
11085 #endif
11087 {
11088 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11089 {
11090 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11091 OnDebugButtonPressServer(id + 1);
11092 }
11093
11094 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11095 {
11096 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11098 }
11099
11100 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11101 {
11102 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11104 }
11105
11106 else if (action_id ==
EActions.ADD_QUANTITY)
11107 {
11108 if (IsMagazine())
11109 {
11110 Magazine mag = Magazine.Cast(this);
11111 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11112 }
11113 else
11114 {
11116 }
11117
11118 if (m_EM)
11119 {
11120 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11121 }
11122
11123 }
11124
11125 else if (action_id ==
EActions.REMOVE_QUANTITY)
11126 {
11127 if (IsMagazine())
11128 {
11129 Magazine mag2 = Magazine.Cast(this);
11130 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11131 }
11132 else
11133 {
11135 }
11136 if (m_EM)
11137 {
11138 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11139 }
11140
11141 }
11142
11143 else if (action_id ==
EActions.SET_QUANTITY_0)
11144 {
11146
11147 if (m_EM)
11148 {
11149 m_EM.SetEnergy(0);
11150 }
11151 }
11152
11153 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11154 {
11156
11157 if (m_EM)
11158 {
11159 m_EM.SetEnergy(m_EM.GetEnergyMax());
11160 }
11161 }
11162
11163 else if (action_id ==
EActions.ADD_HEALTH)
11164 {
11165 AddHealth("","",GetMaxHealth("","Health")/5);
11166 }
11167 else if (action_id ==
EActions.REMOVE_HEALTH)
11168 {
11169 AddHealth("","",-GetMaxHealth("","Health")/5);
11170 }
11171 else if (action_id ==
EActions.DESTROY_HEALTH)
11172 {
11173 SetHealth01("","",0);
11174 }
11175 else if (action_id ==
EActions.WATCH_ITEM)
11176 {
11178 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11179 #ifdef DEVELOPER
11180 SetDebugDeveloper_item(this);
11181 #endif
11182 }
11183
11184 else if (action_id ==
EActions.ADD_TEMPERATURE)
11185 {
11186 AddTemperature(20);
11187
11188 }
11189
11190 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11191 {
11192 AddTemperature(-20);
11193
11194 }
11195
11196 else if (action_id ==
EActions.FLIP_FROZEN)
11197 {
11198 SetFrozen(!GetIsFrozen());
11199
11200 }
11201
11202 else if (action_id ==
EActions.ADD_WETNESS)
11203 {
11205
11206 }
11207
11208 else if (action_id ==
EActions.REMOVE_WETNESS)
11209 {
11211
11212 }
11213
11214 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11215 {
11218
11219
11220 }
11221
11222 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11223 {
11226 }
11227
11228 else if (action_id ==
EActions.MAKE_SPECIAL)
11229 {
11230 auto debugParams = DebugSpawnParams.WithPlayer(player);
11231 OnDebugSpawnEx(debugParams);
11232 }
11233
11234 else if (action_id ==
EActions.DELETE)
11235 {
11236 Delete();
11237 }
11238
11239 }
11240
11241
11242 return false;
11243 }
11244
11245
11246
11247
11251
11254
11255
11256
11258 {
11259 return false;
11260 }
11261
11262
11264 {
11265 return true;
11266 }
11267
11268
11270 {
11271 return true;
11272 }
11273
11274
11275
11277 {
11278 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11280 }
11281
11284 {
11285 return null;
11286 }
11287
11289 {
11290 return false;
11291 }
11292
11294 {
11295 return false;
11296 }
11297
11301
11302
11304 {
11305 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11306 return module_repairing.CanRepair(this, item_repair_kit);
11307 }
11308
11309
11310 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11311 {
11312 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11313 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11314 }
11315
11316
11318 {
11319
11320
11321
11322
11323
11324
11325
11326
11327 return 1;
11328 }
11329
11330
11331
11333 {
11335 }
11336
11337
11338
11340 {
11342 }
11343
11344
11353 {
11354 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11355
11356 if (player)
11357 {
11358 player.MessageStatus(text);
11359 }
11360 }
11361
11362
11371 {
11372 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11373
11374 if (player)
11375 {
11376 player.MessageAction(text);
11377 }
11378 }
11379
11380
11389 {
11390 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11391
11392 if (player)
11393 {
11394 player.MessageFriendly(text);
11395 }
11396 }
11397
11398
11407 {
11408 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11409
11410 if (player)
11411 {
11412 player.MessageImportant(text);
11413 }
11414 }
11415
11417 {
11418 return true;
11419 }
11420
11421
11422 override bool KindOf(
string tag)
11423 {
11424 bool found = false;
11425 string item_name = this.
GetType();
11428
11429 int array_size = item_tag_array.Count();
11430 for (int i = 0; i < array_size; i++)
11431 {
11432 if (item_tag_array.Get(i) == tag)
11433 {
11434 found = true;
11435 break;
11436 }
11437 }
11438 return found;
11439 }
11440
11441
11443 {
11444
11445 super.OnRPC(sender, rpc_type,ctx);
11446
11447
11448 switch (rpc_type)
11449 {
11450 #ifndef SERVER
11451 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11452 Param2<bool, string> p = new Param2<bool, string>(false, "");
11453
11455 return;
11456
11457 bool play = p.param1;
11458 string soundSet = p.param2;
11459
11460 if (play)
11461 {
11463 {
11465 {
11467 }
11468 }
11469 else
11470 {
11472 }
11473 }
11474 else
11475 {
11477 }
11478
11479 break;
11480 #endif
11481
11482 }
11483
11485 {
11487 }
11488 }
11489
11490
11491
11492
11494 {
11495 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11496 return plugin.GetID(
name);
11497 }
11498
11500 {
11501 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11502 return plugin.GetName(id);
11503 }
11504
11507 {
11508
11509
11510 int varFlags;
11511 if (!ctx.
Read(varFlags))
11512 return;
11513
11514 if (varFlags & ItemVariableFlags.FLOAT)
11515 {
11517 }
11518 }
11519
11521 {
11522
11523 super.SerializeNumericalVars(floats_out);
11524
11525
11526
11528 {
11530 }
11531
11533 {
11535 }
11536
11538 {
11540 }
11541
11543 {
11548 }
11549
11551 {
11553 }
11554 }
11555
11557 {
11558
11559 super.DeSerializeNumericalVars(floats);
11560
11561
11562 int index = 0;
11563 int mask = Math.Round(floats.Get(index));
11564
11565 index++;
11566
11568 {
11570 {
11572 }
11573 else
11574 {
11575 float quantity = floats.Get(index);
11576 SetQuantity(quantity,
true,
false,
false,
false);
11577 }
11578 index++;
11579 }
11580
11582 {
11583 float wet = floats.Get(index);
11585 index++;
11586 }
11587
11589 {
11590 int liquidtype = Math.Round(floats.Get(index));
11592 index++;
11593 }
11594
11596 {
11598 index++;
11600 index++;
11602 index++;
11604 index++;
11605 }
11606
11608 {
11609 int cleanness = Math.Round(floats.Get(index));
11611 index++;
11612 }
11613 }
11614
11616 {
11617 super.WriteVarsToCTX(ctx);
11618
11619
11621 {
11623 }
11624
11626 {
11628 }
11629
11631 {
11633 }
11634
11636 {
11637 int r,g,b,a;
11643 }
11644
11646 {
11648 }
11649 }
11650
11652 {
11653 if (!super.ReadVarsFromCTX(ctx,version))
11654 return false;
11655
11656 int intValue;
11657 float value;
11658
11659 if (version < 140)
11660 {
11661 if (!ctx.
Read(intValue))
11662 return false;
11663
11664 m_VariablesMask = intValue;
11665 }
11666
11668 {
11669 if (!ctx.
Read(value))
11670 return false;
11671
11673 {
11675 }
11676 else
11677 {
11679 }
11680 }
11681
11682 if (version < 140)
11683 {
11685 {
11686 if (!ctx.
Read(value))
11687 return false;
11688 SetTemperatureDirect(value);
11689 }
11690 }
11691
11693 {
11694 if (!ctx.
Read(value))
11695 return false;
11697 }
11698
11700 {
11701 if (!ctx.
Read(intValue))
11702 return false;
11704 }
11705
11707 {
11708 int r,g,b,a;
11710 return false;
11712 return false;
11714 return false;
11716 return false;
11717
11719 }
11720
11722 {
11723 if (!ctx.
Read(intValue))
11724 return false;
11726 }
11727
11728 if (version >= 138 && version < 140)
11729 {
11731 {
11732 if (!ctx.
Read(intValue))
11733 return false;
11734 SetFrozen(intValue);
11735 }
11736 }
11737
11738 return true;
11739 }
11740
11741
11743 {
11746 {
11748 }
11749
11750 if (!super.OnStoreLoad(ctx, version))
11751 {
11753 return false;
11754 }
11755
11756 if (version >= 114)
11757 {
11758 bool hasQuickBarIndexSaved;
11759
11760 if (!ctx.
Read(hasQuickBarIndexSaved))
11761 {
11763 return false;
11764 }
11765
11766 if (hasQuickBarIndexSaved)
11767 {
11768 int itmQBIndex;
11769
11770
11771 if (!ctx.
Read(itmQBIndex))
11772 {
11774 return false;
11775 }
11776
11777 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11778 if (itmQBIndex != -1 && parentPlayer)
11779 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11780 }
11781 }
11782 else
11783 {
11784
11785 PlayerBase player;
11786 int itemQBIndex;
11787 if (version ==
int.
MAX)
11788 {
11789 if (!ctx.
Read(itemQBIndex))
11790 {
11792 return false;
11793 }
11794 }
11795 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11796 {
11797
11798 if (!ctx.
Read(itemQBIndex))
11799 {
11801 return false;
11802 }
11803 if (itemQBIndex != -1 && player)
11804 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11805 }
11806 }
11807
11808 if (version < 140)
11809 {
11810
11811 if (!LoadVariables(ctx, version))
11812 {
11814 return false;
11815 }
11816 }
11817
11818
11820 {
11822 return false;
11823 }
11824 if (version >= 132)
11825 {
11827 if (raib)
11828 {
11830 {
11832 return false;
11833 }
11834 }
11835 }
11836
11838 return true;
11839 }
11840
11841
11842
11844 {
11845 super.OnStoreSave(ctx);
11846
11847 PlayerBase player;
11848 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11849 {
11851
11852 int itemQBIndex = -1;
11853 itemQBIndex = player.FindQuickBarEntityIndex(this);
11854 ctx.
Write(itemQBIndex);
11855 }
11856 else
11857 {
11859 }
11860
11862
11864 if (raib)
11865 {
11867 }
11868 }
11869
11870
11872 {
11873 super.AfterStoreLoad();
11874
11876 {
11878 }
11879
11881 {
11884 }
11885 }
11886
11888 {
11889 super.EEOnAfterLoad();
11890
11892 {
11894 }
11895
11898 }
11899
11901 {
11902 return false;
11903 }
11904
11905
11906
11908 {
11910 {
11911 #ifdef PLATFORM_CONSOLE
11912
11914 {
11916 if (menu)
11917 {
11919 }
11920 }
11921 #endif
11922 }
11923
11925 {
11928 }
11929
11931 {
11932 SetWeightDirty();
11934 }
11936 {
11939 }
11940
11942 {
11945 }
11947 {
11950 }
11951
11952 super.OnVariablesSynchronized();
11953 }
11954
11955
11956
11958 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11959 {
11960 if (!IsServerCheck(allow_client))
11961 return false;
11962
11964 return false;
11965
11968
11969 if (value <= (min + 0.001))
11970 value = min;
11971
11972 if (value == min)
11973 {
11974 if (destroy_config)
11975 {
11976 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11977 if (dstr)
11978 {
11980 this.Delete();
11981 return true;
11982 }
11983 }
11984 else if (destroy_forced)
11985 {
11987 this.Delete();
11988 return true;
11989 }
11990
11992 }
11993
11996
11998 {
12000
12001 if (delta)
12003 }
12004
12006
12007 return false;
12008 }
12009
12010
12012 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12013 {
12015 }
12016
12018 {
12021 }
12022
12024 {
12027 }
12028
12031 {
12032 float value_clamped = Math.Clamp(value, 0, 1);
12034 SetQuantity(result, destroy_config, destroy_forced);
12035 }
12036
12037
12040 {
12042 }
12043
12045 {
12047 }
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12059 {
12060 int slot = -1;
12061 if (GetInventory())
12062 {
12063 InventoryLocation il = new InventoryLocation;
12064 GetInventory().GetCurrentInventoryLocation(il);
12066 }
12067
12069 }
12070
12072 {
12073 float quantity_max = 0;
12074
12076 {
12077 if (attSlotID != -1)
12078 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12079
12080 if (quantity_max <= 0)
12082 }
12083
12084 if (quantity_max <= 0)
12086
12087 return quantity_max;
12088 }
12089
12091 {
12093 }
12094
12096 {
12098 }
12099
12100
12102 {
12104 }
12105
12107 {
12109 }
12110
12112 {
12114 }
12115
12116
12118 {
12119
12120 float weightEx = GetWeightEx();
12121 float special = GetInventoryAndCargoWeight();
12122 return weightEx - special;
12123 }
12124
12125
12127 {
12129 }
12130
12132 {
12134 {
12135 #ifdef DEVELOPER
12136 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12137 {
12138 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12140 }
12141 #endif
12142
12143 return GetQuantity() * GetConfigWeightModified();
12144 }
12145 else if (HasEnergyManager())
12146 {
12147 #ifdef DEVELOPER
12148 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12149 {
12150 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12151 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12152 }
12153 #endif
12154 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12155 }
12156 else
12157 {
12158 #ifdef DEVELOPER
12159 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12160 {
12161 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12162 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12163 }
12164 #endif
12165 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12166 }
12167 }
12168
12171 {
12172 int item_count = 0;
12174
12175 if (GetInventory().GetCargo() != NULL)
12176 {
12177 item_count = GetInventory().GetCargo().GetItemCount();
12178 }
12179
12180 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12181 {
12182 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12183 if (item)
12184 item_count += item.GetNumberOfItems();
12185 }
12186 return item_count;
12187 }
12188
12191 {
12192 float weight = 0;
12193 float wetness = 1;
12194 if (include_wetness)
12197 {
12198 weight = wetness * m_ConfigWeight;
12199 }
12201 {
12202 weight = 1;
12203 }
12204 return weight;
12205 }
12206
12207
12208
12210 {
12211 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12212 {
12213 GameInventory inv = GetInventory();
12214 array<EntityAI> items = new array<EntityAI>;
12216 for (int i = 0; i < items.Count(); i++)
12217 {
12219 if (item)
12220 {
12222 }
12223 }
12224 }
12225 }
12226
12227
12228
12229
12231 {
12232 float energy = 0;
12233 if (HasEnergyManager())
12234 {
12235 energy = GetCompEM().GetEnergy();
12236 }
12237 return energy;
12238 }
12239
12240
12242 {
12243 super.OnEnergyConsumed();
12244
12246 }
12247
12249 {
12250 super.OnEnergyAdded();
12251
12253 }
12254
12255
12257 {
12258 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12259 {
12261 {
12262 float energy_0to1 = GetCompEM().GetEnergy0To1();
12264 }
12265 }
12266 }
12267
12268
12270 {
12271 return ConfigGetFloat("heatIsolation");
12272 }
12273
12275 {
12277 }
12278
12280 {
12281 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12282 if (
GetGame().ConfigIsExisting(paramPath))
12284
12285 return 0.0;
12286 }
12287
12289 {
12290 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12291 if (
GetGame().ConfigIsExisting(paramPath))
12293
12294 return 0.0;
12295 }
12296
12297 override void SetWet(
float value,
bool allow_client =
false)
12298 {
12299 if (!IsServerCheck(allow_client))
12300 return;
12301
12304
12306
12307 m_VarWet = Math.Clamp(value, min, max);
12308
12310 {
12313 }
12314 }
12315
12316 override void AddWet(
float value)
12317 {
12319 }
12320
12322 {
12324 }
12325
12327 {
12329 }
12330
12332 {
12334 }
12335
12337 {
12339 }
12340
12342 {
12344 }
12345
12346 override void OnWetChanged(
float newVal,
float oldVal)
12347 {
12350 if (newLevel != oldLevel)
12351 {
12353 }
12354 }
12355
12357 {
12358 SetWeightDirty();
12359 }
12360
12362 {
12363 return GetWetLevelInternal(
m_VarWet);
12364 }
12365
12366
12367
12369 {
12371 }
12372
12374 {
12376 }
12377
12379 {
12381 }
12382
12384 {
12386 }
12387
12388
12389
12391 {
12392 if (ConfigIsExisting("itemModelLength"))
12393 {
12394 return ConfigGetFloat("itemModelLength");
12395 }
12396 return 0;
12397 }
12398
12400 {
12401 if (ConfigIsExisting("itemAttachOffset"))
12402 {
12403 return ConfigGetFloat("itemAttachOffset");
12404 }
12405 return 0;
12406 }
12407
12408 override void SetCleanness(
int value,
bool allow_client =
false)
12409 {
12410 if (!IsServerCheck(allow_client))
12411 return;
12412
12414
12416
12419 }
12420
12422 {
12424 }
12425
12427 {
12428 return true;
12429 }
12430
12431
12432
12433
12435 {
12437 }
12438
12440 {
12442 }
12443
12444
12445
12446
12447 override void SetColor(
int r,
int g,
int b,
int a)
12448 {
12454 }
12456 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12457 {
12462 }
12463
12465 {
12467 }
12468
12471 {
12472 int r,g,b,a;
12474 r = r/255;
12475 g = g/255;
12476 b = b/255;
12477 a = a/255;
12478 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12479 }
12480
12481
12482
12483 override void SetLiquidType(
int value,
bool allow_client =
false)
12484 {
12485 if (!IsServerCheck(allow_client))
12486 return;
12487
12492 }
12493
12495 {
12496 return ConfigGetInt("varLiquidTypeInit");
12497 }
12498
12500 {
12502 }
12503
12505 {
12507 SetFrozen(false);
12508 }
12509
12512 {
12513 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12514 }
12515
12516
12519 {
12520 PlayerBase nplayer;
12521 if (PlayerBase.CastTo(nplayer, player))
12522 {
12524
12525 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12526 }
12527 }
12528
12529
12532 {
12533 PlayerBase nplayer;
12534 if (PlayerBase.CastTo(nplayer,player))
12535 {
12536
12537 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12538
12539 }
12540
12541
12542 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12543
12544
12545 if (HasEnergyManager())
12546 {
12547 GetCompEM().UpdatePlugState();
12548 }
12549 }
12550
12551
12553 {
12554 super.OnPlacementStarted(player);
12555
12557 }
12558
12559 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12560 {
12562 {
12563 m_AdminLog.OnPlacementComplete(player,
this);
12564 }
12565
12566 super.OnPlacementComplete(player, position, orientation);
12567 }
12568
12569
12570
12571
12572
12574 {
12576 {
12577 return true;
12578 }
12579 else
12580 {
12581 return false;
12582 }
12583 }
12584
12585
12587 {
12589 {
12591 }
12592 }
12593
12594
12596 {
12598 }
12599
12601 {
12603 }
12604
12605 override void InsertAgent(
int agent,
float count = 1)
12606 {
12607 if (count < 1)
12608 return;
12609
12611 }
12612
12615 {
12617 }
12618
12619
12621 {
12623 }
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12667 {
12669 return false;
12670 return true;
12671 }
12672
12674 {
12675
12677 }
12678
12679
12682 {
12683 super.CheckForRoofLimited(timeTresholdMS);
12684
12686 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12687 {
12688 m_PreviousRoofTestTime = time;
12689 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12690 }
12691 }
12692
12693
12695 {
12697 {
12698 return 0;
12699 }
12700
12701 if (GetInventory().GetAttachmentSlotsCount() != 0)
12702 {
12703 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12704 if (filter)
12705 return filter.GetProtectionLevel(type, false, system);
12706 else
12707 return 0;
12708 }
12709
12710 string subclassPath, entryName;
12711
12712 switch (type)
12713 {
12715 entryName = "biological";
12716 break;
12718 entryName = "chemical";
12719 break;
12720 default:
12721 entryName = "biological";
12722 break;
12723 }
12724
12725 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12726
12728 }
12729
12730
12731
12734 {
12735 if (!IsMagazine())
12737
12739 }
12740
12741
12742
12743
12744
12749 {
12750 return true;
12751 }
12752
12754 {
12756 }
12757
12758
12759
12760
12761
12763 {
12764 if (parent)
12765 {
12766 if (parent.IsInherited(DayZInfected))
12767 return true;
12768
12769 if (!parent.IsRuined())
12770 return true;
12771 }
12772
12773 return true;
12774 }
12775
12777 {
12778 if (!super.CanPutAsAttachment(parent))
12779 {
12780 return false;
12781 }
12782
12783 if (!IsRuined() && !parent.IsRuined())
12784 {
12785 return true;
12786 }
12787
12788 return false;
12789 }
12790
12792 {
12793
12794
12795
12796
12797 return super.CanReceiveItemIntoCargo(item);
12798 }
12799
12801 {
12802
12803
12804
12805
12806 GameInventory attachmentInv = attachment.GetInventory();
12808 {
12809 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12810 return false;
12811 }
12812
12813 InventoryLocation loc = new InventoryLocation();
12814 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12815 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12816 return false;
12817
12818 return super.CanReceiveAttachment(attachment, slotId);
12819 }
12820
12822 {
12823 if (!super.CanReleaseAttachment(attachment))
12824 return false;
12825
12826 return GetInventory().AreChildrenAccessible();
12827 }
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12850 {
12851 int id = muzzle_owner.GetMuzzleID();
12852 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12853
12854 if (WPOF_array)
12855 {
12856 for (int i = 0; i < WPOF_array.Count(); i++)
12857 {
12858 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12859
12860 if (WPOF)
12861 {
12862 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12863 }
12864 }
12865 }
12866 }
12867
12868
12870 {
12871 int id = muzzle_owner.GetMuzzleID();
12873
12874 if (WPOBE_array)
12875 {
12876 for (int i = 0; i < WPOBE_array.Count(); i++)
12877 {
12878 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12879
12880 if (WPOBE)
12881 {
12882 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12883 }
12884 }
12885 }
12886 }
12887
12888
12890 {
12891 int id = muzzle_owner.GetMuzzleID();
12892 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12893
12894 if (WPOOH_array)
12895 {
12896 for (int i = 0; i < WPOOH_array.Count(); i++)
12897 {
12898 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12899
12900 if (WPOOH)
12901 {
12902 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12903 }
12904 }
12905 }
12906 }
12907
12908
12910 {
12911 int id = muzzle_owner.GetMuzzleID();
12912 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12913
12914 if (WPOOH_array)
12915 {
12916 for (int i = 0; i < WPOOH_array.Count(); i++)
12917 {
12918 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12919
12920 if (WPOOH)
12921 {
12922 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12923 }
12924 }
12925 }
12926 }
12927
12928
12930 {
12931 int id = muzzle_owner.GetMuzzleID();
12932 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12933
12934 if (WPOOH_array)
12935 {
12936 for (int i = 0; i < WPOOH_array.Count(); i++)
12937 {
12938 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12939
12940 if (WPOOH)
12941 {
12942 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12943 }
12944 }
12945 }
12946 }
12947
12948
12949
12951 {
12953 {
12954 return true;
12955 }
12956
12957 return false;
12958 }
12959
12961 {
12963 {
12964 return true;
12965 }
12966
12967 return false;
12968 }
12969
12971 {
12973 {
12974 return true;
12975 }
12976
12977 return false;
12978 }
12979
12981 {
12982 return false;
12983 }
12984
12987 {
12988 return UATimeSpent.DEFAULT_DEPLOY;
12989 }
12990
12991
12992
12993
12995 {
12997 SetSynchDirty();
12998 }
12999
13001 {
13003 }
13004
13005
13007 {
13008 return false;
13009 }
13010
13013 {
13014 string att_type = "None";
13015
13016 if (ConfigIsExisting("soundAttType"))
13017 {
13018 att_type = ConfigGetString("soundAttType");
13019 }
13020
13022 }
13023
13025 {
13027 }
13028
13029
13030
13031
13032
13036
13038 {
13041
13043 }
13044
13045
13047 {
13049 return;
13050
13052
13055
13058
13059 SoundParameters params = new SoundParameters();
13063 }
13064
13065
13067 {
13069 return;
13070
13072 SetSynchDirty();
13073
13076 }
13077
13078
13080 {
13082 return;
13083
13085 SetSynchDirty();
13086
13089 }
13090
13092 {
13094 }
13095
13097 {
13099 }
13100
13103 {
13104 if (!
GetGame().IsDedicatedServer())
13105 {
13106 if (ConfigIsExisting("attachSoundSet"))
13107 {
13108 string cfg_path = "";
13109 string soundset = "";
13110 string type_name =
GetType();
13111
13114 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13115 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13116
13117 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13118 {
13119 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13120 {
13121 if (cfg_slot_array[i] == slot_type)
13122 {
13123 soundset = cfg_soundset_array[i];
13124 break;
13125 }
13126 }
13127 }
13128
13129 if (soundset != "")
13130 {
13131 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13133 }
13134 }
13135 }
13136 }
13137
13139 {
13140
13141 }
13142
13143 void OnApply(PlayerBase player);
13144
13146 {
13147 return 1.0;
13148 };
13149
13151 {
13153 }
13154
13156 {
13158 }
13159
13161
13163 {
13164 SetDynamicPhysicsLifeTime(0.01);
13166 }
13167
13169 {
13170 array<string> zone_names = new array<string>;
13171 GetDamageZones(zone_names);
13172 for (int i = 0; i < zone_names.Count(); i++)
13173 {
13174 SetHealthMax(zone_names.Get(i),"Health");
13175 }
13176 SetHealthMax("","Health");
13177 }
13178
13181 {
13182 float global_health = GetHealth01("","Health");
13183 array<string> zones = new array<string>;
13184 GetDamageZones(zones);
13185
13186 for (int i = 0; i < zones.Count(); i++)
13187 {
13188 SetHealth01(zones.Get(i),"Health",global_health);
13189 }
13190 }
13191
13194 {
13195 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13196 }
13197
13199 {
13200 if (!hasRootAsPlayer)
13201 {
13202 if (refParentIB)
13203 {
13204
13205 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13206 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13207
13208 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13209 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13210
13213 }
13214 else
13215 {
13216
13219 }
13220 }
13221 }
13222
13224 {
13226 {
13227 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13228 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13229 {
13230 float heatPermCoef = 1.0;
13232 while (ent)
13233 {
13234 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13235 ent = ent.GetHierarchyParent();
13236 }
13237
13238 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13239 }
13240 }
13241 }
13242
13244 {
13245
13246 EntityAI parent = GetHierarchyParent();
13247 if (!parent)
13248 {
13249 hasParent = false;
13250 hasRootAsPlayer = false;
13251 }
13252 else
13253 {
13254 hasParent = true;
13255 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13256 refParentIB =
ItemBase.Cast(parent);
13257 }
13258 }
13259
13260 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13261 {
13262
13263 }
13264
13266 {
13267
13268 return false;
13269 }
13270
13272 {
13273
13274
13275 return false;
13276 }
13277
13279 {
13280
13281 return false;
13282 }
13283
13286 {
13287 return !GetIsFrozen() &&
IsOpen();
13288 }
13289
13291 {
13292 bool hasParent = false, hasRootAsPlayer = false;
13294
13295 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13296 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13297
13298 if (wwtu || foodDecay)
13299 {
13303
13304 if (processWetness || processTemperature || processDecay)
13305 {
13307
13308 if (processWetness)
13309 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13310
13311 if (processTemperature)
13313
13314 if (processDecay)
13315 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13316 }
13317 }
13318 }
13319
13322 {
13324 }
13325
13327 {
13330
13331 return super.GetTemperatureFreezeThreshold();
13332 }
13333
13335 {
13338
13339 return super.GetTemperatureThawThreshold();
13340 }
13341
13343 {
13346
13347 return super.GetItemOverheatThreshold();
13348 }
13349
13351 {
13353 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13354
13355 return super.GetTemperatureFreezeTime();
13356 }
13357
13359 {
13361 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13362
13363 return super.GetTemperatureThawTime();
13364 }
13365
13370
13372 {
13373 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13374 }
13375
13377 {
13378 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13379 }
13380
13383 {
13385 }
13386
13388 {
13390 }
13391
13393 {
13395 }
13396
13399 {
13400 return null;
13401 }
13402
13405 {
13406 return false;
13407 }
13408
13410 {
13412 {
13415 if (!trg)
13416 {
13418 explosive = this;
13419 }
13420
13421 explosive.PairRemote(trg);
13423
13424 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13425 trg.SetPersistentPairID(persistentID);
13426 explosive.SetPersistentPairID(persistentID);
13427
13428 return true;
13429 }
13430 return false;
13431 }
13432
13435 {
13436 float ret = 1.0;
13439 ret *= GetHealth01();
13440
13441 return ret;
13442 }
13443
13444 #ifdef DEVELOPER
13445 override void SetDebugItem()
13446 {
13447 super.SetDebugItem();
13448 _itemBase = this;
13449 }
13450
13452 {
13453 string text = super.GetDebugText();
13454
13456 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13457
13458 return text;
13459 }
13460 #endif
13461
13463 {
13464 return true;
13465 }
13466
13468
13470
13472 {
13475 }
13476
13477
13485
13501}
13502
13504{
13506 if (entity)
13507 {
13508 bool is_item = entity.IsInherited(
ItemBase);
13509 if (is_item && full_quantity)
13510 {
13513 }
13514 }
13515 else
13516 {
13518 return NULL;
13519 }
13520 return entity;
13521}
13522
13524{
13525 if (item)
13526 {
13527 if (health > 0)
13528 item.SetHealth("", "", health);
13529
13530 if (item.CanHaveTemperature())
13531 {
13533 if (item.CanFreeze())
13534 item.SetFrozen(false);
13535 }
13536
13537 if (item.HasEnergyManager())
13538 {
13539 if (quantity >= 0)
13540 {
13541 item.GetCompEM().SetEnergy0To1(quantity);
13542 }
13543 else
13544 {
13546 }
13547 }
13548 else if (item.IsMagazine())
13549 {
13550 Magazine mag = Magazine.Cast(item);
13551 if (quantity >= 0)
13552 {
13553 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13554 }
13555 else
13556 {
13558 }
13559
13560 }
13561 else
13562 {
13563 if (quantity >= 0)
13564 {
13565 item.SetQuantityNormalized(quantity, false);
13566 }
13567 else
13568 {
13570 }
13571
13572 }
13573 }
13574}
13575
13576#ifdef DEVELOPER
13578#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.