8693{
8695 {
8696 return true;
8697 }
8698};
8699
8700
8701
8703{
8707
8709
8712
8713
8714
8715
8716
8725
8731
8736
8741
8762 protected bool m_IsResultOfSplit
8763
8765
8770
8771
8772
8774
8778
8779
8780
8782
8785
8786
8787
8793
8794
8802
8805
8806
8808
8809
8811
8812
8817
8818
8823
8824
8826
8827
8829 {
8834
8835 if (!
GetGame().IsDedicatedServer())
8836 {
8838 {
8840
8842 {
8844 }
8845 }
8846
8849 }
8850
8851 m_OldLocation = null;
8852
8854 {
8856 }
8857
8858 if (ConfigIsExisting("headSelectionsToHide"))
8859 {
8862 }
8863
8865 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8866 {
8868 }
8869
8871
8872 m_IsResultOfSplit = false;
8873
8875 }
8876
8878 {
8879 super.InitItemVariables();
8880
8886 m_Count = ConfigGetInt(
"count");
8887
8890
8895
8898
8903
8915
8919
8920
8923 if (ConfigIsExisting("canBeSplit"))
8924 {
8927 }
8928
8930 if (ConfigIsExisting("itemBehaviour"))
8932
8933
8936 RegisterNetSyncVariableInt("m_VarLiquidType");
8937 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8938
8939 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8940 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8941 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8942
8943 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8944 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8945 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8946 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8947
8948 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8949 RegisterNetSyncVariableBool("m_IsTakeable");
8950 RegisterNetSyncVariableBool("m_IsHologram");
8951
8954 {
8957 }
8958
8960
8962 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8964
8965 }
8966
8968 {
8970 }
8971
8973 {
8976 {
8981 }
8982 }
8983
8984 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8985 {
8987 {
8990 }
8991
8993 }
8994
8996 {
9002 }
9003
9005
9007 {
9009
9010 if (!action)
9011 {
9012 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9013 return;
9014 }
9015
9017 if (!ai)
9018 {
9020 return;
9021 }
9022
9024 if (!action_array)
9025 {
9026 action_array = new array<ActionBase_Basic>;
9028 }
9029 if (LogManager.IsActionLogEnable())
9030 {
9031 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9032 }
9033
9034 if (action_array.Find(action) != -1)
9035 {
9036 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9037 }
9038 else
9039 {
9040 action_array.Insert(action);
9041 }
9042 }
9043
9045 {
9047 ActionBase action = player.GetActionManager().GetAction(actionName);
9050
9051 if (action_array)
9052 {
9053 action_array.RemoveItem(action);
9054 }
9055 }
9056
9057
9058
9060 {
9061 ActionOverrideData overrideData = new ActionOverrideData();
9065
9067 if (!actionMap)
9068 {
9071 }
9072
9073 actionMap.Insert(this.
Type(), overrideData);
9074
9075 }
9076
9078
9080
9081
9083 {
9086
9089
9090 string config_to_search = "CfgVehicles";
9091 string muzzle_owner_config;
9092
9094 {
9095 if (IsInherited(Weapon))
9096 config_to_search = "CfgWeapons";
9097
9098 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9099
9100 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9101
9103
9104 if (config_OnFire_subclass_count > 0)
9105 {
9106 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9107
9108 for (int i = 0; i < config_OnFire_subclass_count; i++)
9109 {
9110 string particle_class = "";
9112 string config_OnFire_entry = config_OnFire_class + particle_class;
9113 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9114 WPOF_array.Insert(WPOF);
9115 }
9116
9117
9119 }
9120 }
9121
9123 {
9124 config_to_search = "CfgWeapons";
9125 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9126
9127 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9128
9130
9131 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9132 {
9133 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9134
9135 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9136 {
9137 string particle_class2 = "";
9139 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9140 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9141 WPOBE_array.Insert(WPOBE);
9142 }
9143
9144
9146 }
9147 }
9148 }
9149
9150
9152 {
9155
9157 {
9158 string config_to_search = "CfgVehicles";
9159
9160 if (IsInherited(Weapon))
9161 config_to_search = "CfgWeapons";
9162
9163 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9164 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9165
9166 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9167 {
9168
9170
9172 {
9174 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9176 return;
9177 }
9178
9181
9182
9183
9185 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9186
9187 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9188 {
9189 string particle_class = "";
9191 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9193
9194 if (entry_type == CT_CLASS)
9195 {
9196 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9197 WPOOH_array.Insert(WPOF);
9198 }
9199 }
9200
9201
9203 }
9204 }
9205 }
9206
9208 {
9210 }
9211
9213 {
9215 {
9217
9220
9223
9224 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9225 }
9226 }
9227
9229 {
9231 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9232
9234 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9235
9237 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9238
9240 {
9242 }
9243 }
9244
9246 {
9248 }
9249
9251 {
9254 else
9256
9258 {
9261 }
9262 else
9263 {
9266
9269 }
9270
9272 }
9273
9275 {
9277 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9278 }
9279
9281 {
9283 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9285 }
9286
9288 {
9290 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9291 }
9292
9294 {
9297
9298 OverheatingParticle OP = new OverheatingParticle();
9303
9305 }
9306
9308 {
9311
9312 return -1;
9313 }
9314
9316 {
9318 {
9321
9322 for (int i = count; i > 0; --i)
9323 {
9324 int id = i - 1;
9327
9330
9331 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9332 {
9333 if (p)
9334 {
9337 }
9338 }
9339 }
9340 }
9341 }
9342
9344 {
9346 {
9348 {
9349 int id = i - 1;
9351
9352 if (OP)
9353 {
9355
9356 if (p)
9357 {
9359 }
9360
9361 delete OP;
9362 }
9363 }
9364
9367 }
9368 }
9369
9372 {
9373 return 0.0;
9374 }
9375
9376
9378 {
9379 return 250;
9380 }
9381
9383 {
9384 return 0;
9385 }
9386
9389 {
9391 return true;
9392
9393 return false;
9394 }
9395
9398 {
9401
9403 {
9405 }
9406 else
9407 {
9408
9410 }
9411
9413 }
9414
9421 {
9422 return -1;
9423 }
9424
9425
9426
9427
9429 {
9431 {
9433 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9434
9435 if (r_index >= 0)
9436 {
9437 InventoryLocation r_il = new InventoryLocation;
9438 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9439
9440 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9443 {
9444 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9445 }
9447 {
9448 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9449 }
9450
9451 }
9452
9453 player.GetHumanInventory().ClearUserReservedLocation(this);
9454 }
9455
9458 }
9459
9460
9461
9462
9464 {
9465 return ItemBase.m_DebugActionsMask;
9466 }
9467
9469 {
9470 return ItemBase.m_DebugActionsMask & mask;
9471 }
9472
9474 {
9475 ItemBase.m_DebugActionsMask = mask;
9476 }
9477
9479 {
9480 ItemBase.m_DebugActionsMask |= mask;
9481 }
9482
9484 {
9485 ItemBase.m_DebugActionsMask &= ~mask;
9486 }
9487
9489 {
9491 {
9493 }
9494 else
9495 {
9497 }
9498 }
9499
9500
9502 {
9503 if (GetEconomyProfile())
9504 {
9505 float q_max = GetEconomyProfile().GetQuantityMax();
9506 if (q_max > 0)
9507 {
9508 float q_min = GetEconomyProfile().GetQuantityMin();
9509 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9510
9512 {
9513 ComponentEnergyManager comp = GetCompEM();
9515 {
9517 }
9518 }
9520 {
9522
9523 }
9524
9525 }
9526 }
9527 }
9528
9531 {
9532 EntityAI parent = GetHierarchyParent();
9533
9534 if (parent)
9535 {
9536 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9537 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9538 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9539 }
9540 }
9541
9544 {
9545 EntityAI parent = GetHierarchyParent();
9546
9547 if (parent)
9548 {
9549 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9550 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9551 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9552 }
9553 }
9554
9556 {
9557
9558
9559
9560
9562
9564 {
9565 if (ScriptInputUserData.CanStoreInputUserData())
9566 {
9567 ScriptInputUserData ctx = new ScriptInputUserData;
9573 ctx.
Write(use_stack_max);
9576
9578 {
9579 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9580 }
9581 }
9582 }
9583 else if (!
GetGame().IsMultiplayer())
9584 {
9586 }
9587 }
9588
9590 {
9592 }
9593
9595 {
9597 }
9598
9600 {
9602 }
9603
9605 {
9606
9607 return false;
9608 }
9609
9611 {
9612 return false;
9613 }
9614
9618 {
9619 return false;
9620 }
9621
9623 {
9624 return "";
9625 }
9626
9628
9630 {
9631 return false;
9632 }
9633
9635 {
9636 return true;
9637 }
9638
9639
9640
9642 {
9643 return true;
9644 }
9645
9647 {
9648 return true;
9649 }
9650
9652 {
9653 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9655 }
9656
9658 {
9660 }
9661
9663 {
9665 if (!is_being_placed)
9667 SetSynchDirty();
9668 }
9669
9670
9672
9674 {
9676 }
9677
9679 {
9681 }
9682
9684 {
9685 return 1;
9686 }
9687
9689 {
9690 return false;
9691 }
9692
9694 {
9696 SetSynchDirty();
9697 }
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9734 {
9735 super.OnMovedInsideCargo(container);
9736
9737 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9738 }
9739
9740 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9741 {
9742 super.EEItemLocationChanged(oldLoc,newLoc);
9743
9744 PlayerBase new_player = null;
9745 PlayerBase old_player = null;
9746
9747 if (newLoc.GetParent())
9748 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9749
9750 if (oldLoc.GetParent())
9751 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9752
9754 {
9755 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9756
9757 if (r_index >= 0)
9758 {
9759 InventoryLocation r_il = new InventoryLocation;
9760 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9761
9762 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9765 {
9766 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9767 }
9769 {
9770 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9771 }
9772
9773 }
9774 }
9775
9777 {
9778 if (new_player)
9779 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9780
9781 if (new_player == old_player)
9782 {
9783
9784 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9785 {
9787 {
9788 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9789 {
9790 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9791 }
9792 }
9793 else
9794 {
9795 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9796 }
9797 }
9798
9799 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9800 {
9801 int type = oldLoc.GetType();
9803 {
9804 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9805 }
9807 {
9808 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9809 }
9810 }
9811 if (!m_OldLocation)
9812 {
9813 m_OldLocation = new InventoryLocation;
9814 }
9815 m_OldLocation.Copy(oldLoc);
9816 }
9817 else
9818 {
9819 if (m_OldLocation)
9820 {
9821 m_OldLocation.Reset();
9822 }
9823 }
9824
9826 }
9827 else
9828 {
9829 if (new_player)
9830 {
9831 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9832 if (res_index >= 0)
9833 {
9834 InventoryLocation il = new InventoryLocation;
9835 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9837 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9840 {
9841 il.
GetParent().GetOnReleaseLock().Invoke(it);
9842 }
9844 {
9846 }
9847
9848 }
9849 }
9851 {
9852
9854 }
9855
9856 if (m_OldLocation)
9857 {
9858 m_OldLocation.Reset();
9859 }
9860 }
9861 }
9862
9863 override void EOnContact(IEntity other, Contact extra)
9864 {
9866 {
9867 int liquidType = -1;
9869 if (impactSpeed > 0.0)
9870 {
9872 #ifndef SERVER
9874 #else
9876 SetSynchDirty();
9877 #endif
9879 }
9880 }
9881
9882 #ifdef SERVER
9883 if (GetCompEM() && GetCompEM().IsPlugged())
9884 {
9885 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9886 GetCompEM().UnplugThis();
9887 }
9888 #endif
9889 }
9890
9892
9894 {
9896 }
9897
9899 {
9900
9901 }
9902
9904 {
9905 super.OnItemLocationChanged(old_owner, new_owner);
9906
9907 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9908 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9909
9910 if (!relatedPlayer && playerNew)
9911 relatedPlayer = playerNew;
9912
9913 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9914 {
9916 if (actionMgr)
9917 {
9918 ActionBase currentAction = actionMgr.GetRunningAction();
9919 if (currentAction)
9921 }
9922 }
9923
9924 Man ownerPlayerOld = null;
9925 Man ownerPlayerNew = null;
9926
9927 if (old_owner)
9928 {
9929 if (old_owner.
IsMan())
9930 {
9931 ownerPlayerOld = Man.Cast(old_owner);
9932 }
9933 else
9934 {
9935 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9936 }
9937 }
9938 else
9939 {
9941 {
9943
9944 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9945 {
9946 GetCompEM().UnplugThis();
9947 }
9948 }
9949 }
9950
9951 if (new_owner)
9952 {
9953 if (new_owner.
IsMan())
9954 {
9955 ownerPlayerNew = Man.Cast(new_owner);
9956 }
9957 else
9958 {
9959 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9960 }
9961 }
9962
9963 if (ownerPlayerOld != ownerPlayerNew)
9964 {
9965 if (ownerPlayerOld)
9966 {
9967 array<EntityAI> subItemsExit = new array<EntityAI>;
9969 for (int i = 0; i < subItemsExit.Count(); i++)
9970 {
9973 }
9974 }
9975
9976 if (ownerPlayerNew)
9977 {
9978 array<EntityAI> subItemsEnter = new array<EntityAI>;
9980 for (int j = 0; j < subItemsEnter.Count(); j++)
9981 {
9984 }
9985 }
9986 }
9987 else if (ownerPlayerNew != null)
9988 {
9989 PlayerBase nplayer;
9990 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9991 {
9992 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9994 for (int k = 0; k < subItemsUpdate.Count(); k++)
9995 {
9997 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9998 }
9999 }
10000 }
10001
10002 if (old_owner)
10003 old_owner.OnChildItemRemoved(this);
10004 if (new_owner)
10005 new_owner.OnChildItemReceived(this);
10006 }
10007
10008
10010 {
10011 super.EEDelete(parent);
10012 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10013 if (player)
10014 {
10016
10017 if (player.IsAlive())
10018 {
10019 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10020 if (r_index >= 0)
10021 {
10022 InventoryLocation r_il = new InventoryLocation;
10023 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10024
10025 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10028 {
10029 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10030 }
10032 {
10033 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10034 }
10035
10036 }
10037
10038 player.RemoveQuickBarEntityShortcut(this);
10039 }
10040 }
10041 }
10042
10044 {
10045 super.EEKilled(killer);
10046
10049 {
10050 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10051 {
10052 if (IsMagazine())
10053 {
10054 if (Magazine.Cast(this).GetAmmoCount() > 0)
10055 {
10057 }
10058 }
10059 else
10060 {
10062 }
10063 }
10064 }
10065 }
10066
10068 {
10069 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10070
10071 super.OnWasAttached(parent, slot_id);
10072
10075
10077 }
10078
10080 {
10081 super.OnWasDetached(parent, slot_id);
10082
10085 }
10086
10088 {
10089 int idx;
10092
10093 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10094 if (inventory_slots.Count() < 1)
10095 {
10096 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10097 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10098 }
10099 else
10100 {
10101 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10102 }
10103
10104 idx = inventory_slots.Find(slot);
10105 if (idx < 0)
10106 return "";
10107
10108 return attach_types.Get(idx);
10109 }
10110
10112 {
10113 int idx = -1;
10114 string slot;
10115
10118
10119 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10120 if (inventory_slots.Count() < 1)
10121 {
10122 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10123 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10124 }
10125 else
10126 {
10127 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10128 if (detach_types.Count() < 1)
10129 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10130 }
10131
10132 for (int i = 0; i < inventory_slots.Count(); i++)
10133 {
10134 slot = inventory_slots.Get(i);
10135 }
10136
10137 if (slot != "")
10138 {
10139 if (detach_types.Count() == 1)
10140 idx = 0;
10141 else
10142 idx = inventory_slots.Find(slot);
10143 }
10144 if (idx < 0)
10145 return "";
10146
10147 return detach_types.Get(idx);
10148 }
10149
10151 {
10152
10154
10155
10156 float min_time = 1;
10157 float max_time = 3;
10158 float delay = Math.RandomFloat(min_time, max_time);
10159
10160 explode_timer.Run(delay, this, "DoAmmoExplosion");
10161 }
10162
10164 {
10165 Magazine magazine = Magazine.Cast(this);
10166 int pop_sounds_count = 6;
10167 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10168
10169
10170 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10171 string sound_name = pop_sounds[ sound_idx ];
10173
10174
10175 magazine.ServerAddAmmoCount(-1);
10176
10177
10178 float min_temp_to_explode = 100;
10179
10180 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10181 {
10183 }
10184 }
10185
10186
10187 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10188 {
10189 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10190
10191 const int CHANCE_DAMAGE_CARGO = 4;
10192 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10193 const int CHANCE_DAMAGE_NOTHING = 2;
10194
10196 {
10197 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10198 int chances;
10199 int rnd;
10200
10201 if (GetInventory().GetCargo())
10202 {
10203 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10204 rnd = Math.RandomInt(0,chances);
10205
10206 if (rnd < CHANCE_DAMAGE_CARGO)
10207 {
10209 }
10210 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10211 {
10213 }
10214 }
10215 else
10216 {
10217 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10218 rnd = Math.RandomInt(0,chances);
10219
10220 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10221 {
10223 }
10224 }
10225 }
10226 }
10227
10229 {
10230 if (GetInventory().GetCargo())
10231 {
10232 int item_count = GetInventory().GetCargo().GetItemCount();
10233 if (item_count > 0)
10234 {
10235 int random_pick = Math.RandomInt(0, item_count);
10237 if (!item.IsExplosive())
10238 {
10239 item.AddHealth("","",damage);
10240 return true;
10241 }
10242 }
10243 }
10244 return false;
10245 }
10246
10248 {
10249 int attachment_count = GetInventory().AttachmentCount();
10250 if (attachment_count > 0)
10251 {
10252 int random_pick = Math.RandomInt(0, attachment_count);
10253 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10254 if (!attachment.IsExplosive())
10255 {
10256 attachment.AddHealth("","",damage);
10257 return true;
10258 }
10259 }
10260 return false;
10261 }
10262
10264 {
10266 }
10267
10269 {
10271 return GetInventory().CanRemoveEntity();
10272
10273 return false;
10274 }
10275
10277 {
10278
10280 return false;
10281
10282
10284 return false;
10285
10286
10287
10289 if (delta == 0)
10290 return false;
10291
10292
10293 return true;
10294 }
10295
10297 {
10299 {
10300 if (ScriptInputUserData.CanStoreInputUserData())
10301 {
10302 ScriptInputUserData ctx = new ScriptInputUserData;
10307 ctx.
Write(destination_entity);
10309 ctx.
Write(slot_id);
10311 }
10312 }
10313 else if (!
GetGame().IsMultiplayer())
10314 {
10316 }
10317 }
10318
10320 {
10321 float split_quantity_new;
10325 InventoryLocation loc = new InventoryLocation;
10326
10327 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10328 {
10330 split_quantity_new = stack_max;
10331 else
10333
10335 {
10336 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10337 if (new_item)
10338 {
10339 new_item.SetResultOfSplit(true);
10340 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10342 new_item.
SetQuantity(split_quantity_new,
false,
true);
10343 }
10344 }
10345 }
10346 else if (destination_entity && slot_id == -1)
10347 {
10348 if (quantity > stack_max)
10349 split_quantity_new = stack_max;
10350 else
10351 split_quantity_new = quantity;
10352
10354 {
10356 {
10359 }
10360
10361 if (new_item)
10362 {
10363 new_item.SetResultOfSplit(true);
10364 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10366 new_item.
SetQuantity(split_quantity_new,
false,
true);
10367 }
10368 }
10369 }
10370 else
10371 {
10372 if (stack_max != 0)
10373 {
10375 {
10377 }
10378
10379 if (split_quantity_new == 0)
10380 {
10381 if (!
GetGame().IsMultiplayer())
10382 player.PhysicalPredictiveDropItem(this);
10383 else
10384 player.ServerDropEntity(this);
10385 return;
10386 }
10387
10389 {
10391
10392 if (new_item)
10393 {
10394 new_item.SetResultOfSplit(true);
10395 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10398 new_item.PlaceOnSurface();
10399 }
10400 }
10401 }
10402 }
10403 }
10404
10406 {
10407 float split_quantity_new;
10411 InventoryLocation loc = new InventoryLocation;
10412
10413 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10414 {
10416 split_quantity_new = stack_max;
10417 else
10419
10421 {
10422 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10423 if (new_item)
10424 {
10425 new_item.SetResultOfSplit(true);
10426 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10428 new_item.
SetQuantity(split_quantity_new,
false,
true);
10429 }
10430 }
10431 }
10432 else if (destination_entity && slot_id == -1)
10433 {
10434 if (quantity > stack_max)
10435 split_quantity_new = stack_max;
10436 else
10437 split_quantity_new = quantity;
10438
10440 {
10442 {
10445 }
10446
10447 if (new_item)
10448 {
10449 new_item.SetResultOfSplit(true);
10450 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10452 new_item.
SetQuantity(split_quantity_new,
false,
true);
10453 }
10454 }
10455 }
10456 else
10457 {
10458 if (stack_max != 0)
10459 {
10461 {
10463 }
10464
10466 {
10468
10469 if (new_item)
10470 {
10471 new_item.SetResultOfSplit(true);
10472 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10475 new_item.PlaceOnSurface();
10476 }
10477 }
10478 }
10479 }
10480 }
10481
10483 {
10485 {
10486 if (ScriptInputUserData.CanStoreInputUserData())
10487 {
10488 ScriptInputUserData ctx = new ScriptInputUserData;
10493 dst.WriteToContext(ctx);
10495 }
10496 }
10497 else if (!
GetGame().IsMultiplayer())
10498 {
10500 }
10501 }
10502
10504 {
10506 {
10507 if (ScriptInputUserData.CanStoreInputUserData())
10508 {
10509 ScriptInputUserData ctx = new ScriptInputUserData;
10514 ctx.
Write(destination_entity);
10520 }
10521 }
10522 else if (!
GetGame().IsMultiplayer())
10523 {
10525 }
10526 }
10527
10529 {
10531 }
10532
10534 {
10536 float split_quantity_new;
10538 if (dst.IsValid())
10539 {
10540 int slot_id = dst.GetSlot();
10542
10543 if (quantity > stack_max)
10544 split_quantity_new = stack_max;
10545 else
10546 split_quantity_new = quantity;
10547
10549 {
10551
10552 if (new_item)
10553 {
10554 new_item.SetResultOfSplit(true);
10555 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10557 new_item.
SetQuantity(split_quantity_new,
false,
true);
10558 }
10559
10560 return new_item;
10561 }
10562 }
10563
10564 return null;
10565 }
10566
10568 {
10570 float split_quantity_new;
10572 if (destination_entity)
10573 {
10575 if (quantity > stackable)
10576 split_quantity_new = stackable;
10577 else
10578 split_quantity_new = quantity;
10579
10581 {
10582 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10583 if (new_item)
10584 {
10585 new_item.SetResultOfSplit(true);
10586 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10588 new_item.
SetQuantity(split_quantity_new,
false,
true);
10589 }
10590 }
10591 }
10592 }
10593
10595 {
10597 {
10598 if (ScriptInputUserData.CanStoreInputUserData())
10599 {
10600 ScriptInputUserData ctx = new ScriptInputUserData;
10605 ItemBase destination_entity =
this;
10606 ctx.
Write(destination_entity);
10610 }
10611 }
10612 else if (!
GetGame().IsMultiplayer())
10613 {
10615 }
10616 }
10617
10619 {
10621 float split_quantity_new;
10623 if (player)
10624 {
10626 if (quantity > stackable)
10627 split_quantity_new = stackable;
10628 else
10629 split_quantity_new = quantity;
10630
10632 {
10633 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10634 new_item =
ItemBase.Cast(in_hands);
10635 if (new_item)
10636 {
10637 new_item.SetResultOfSplit(true);
10638 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10640 new_item.SetQuantity(split_quantity_new, false, true);
10641 }
10642 }
10643 }
10644 }
10645
10647 {
10649 float split_quantity_new = Math.Floor(quantity * 0.5);
10650
10652 return;
10653
10655
10656 if (new_item)
10657 {
10658 if (new_item.GetQuantityMax() < split_quantity_new)
10659 {
10660 split_quantity_new = new_item.GetQuantityMax();
10661 }
10662
10663 new_item.SetResultOfSplit(true);
10664 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10665
10667 {
10670 }
10671 else
10672 {
10674 new_item.
SetQuantity(split_quantity_new,
false,
true);
10675 }
10676 }
10677 }
10678
10680 {
10682 float split_quantity_new = Math.Floor(quantity / 2);
10683
10685 return;
10686
10687 InventoryLocation invloc = new InventoryLocation;
10689
10691 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10692
10693 if (new_item)
10694 {
10695 if (new_item.GetQuantityMax() < split_quantity_new)
10696 {
10697 split_quantity_new = new_item.GetQuantityMax();
10698 }
10700 {
10703 }
10704 else if (split_quantity_new > 1)
10705 {
10707 new_item.
SetQuantity(split_quantity_new,
false,
true);
10708 }
10709 }
10710 }
10711
10714 {
10715 SetWeightDirty();
10717
10718 if (parent)
10719 parent.OnAttachmentQuantityChangedEx(this, delta);
10720
10722 {
10724 {
10726 }
10728 {
10729 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10731 }
10732 }
10733
10734 }
10735
10738 {
10739
10740 }
10741
10744 {
10746 }
10747
10749 {
10750 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10751
10753 {
10754 if (newLevel == GameConstants.STATE_RUINED)
10755 {
10757 EntityAI parent = GetHierarchyParent();
10758 if (parent && parent.IsFireplace())
10759 {
10760 CargoBase cargo = GetInventory().GetCargo();
10761 if (cargo)
10762 {
10764 {
10766 }
10767 }
10768 }
10769 }
10770
10772 {
10773
10775 return;
10776 }
10777
10778 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10779 {
10781 }
10782 }
10783 }
10784
10785
10787 {
10788 super.OnRightClick();
10789
10791 {
10793 {
10794 if (ScriptInputUserData.CanStoreInputUserData())
10795 {
10796 EntityAI root = GetHierarchyRoot();
10797 Man playerOwner = GetHierarchyRootPlayer();
10798 InventoryLocation dst = new InventoryLocation;
10799
10800
10801 if (!playerOwner && root && root == this)
10802 {
10804 }
10805 else
10806 {
10807
10808 GetInventory().GetCurrentInventoryLocation(dst);
10810 {
10813 {
10815 }
10816 else
10817 {
10819
10820
10821 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10822 {
10824 }
10825 else
10826 {
10827 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10828 }
10829 }
10830 }
10831 }
10832
10833 ScriptInputUserData ctx = new ScriptInputUserData;
10841 }
10842 }
10843 else if (!
GetGame().IsMultiplayer())
10844 {
10846 }
10847 }
10848 }
10849
10851 {
10852 if (root)
10853 {
10854 vector m4[4];
10855 root.GetTransform(m4);
10856 dst.SetGround(this, m4);
10857 }
10858 else
10859 {
10860 GetInventory().GetCurrentInventoryLocation(dst);
10861 }
10862 }
10863
10864 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10865 {
10866
10867 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10868 return false;
10869
10870 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10871 return false;
10872
10873
10875 return false;
10876
10877
10878 Magazine mag = Magazine.Cast(this);
10879 if (mag)
10880 {
10881 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10882 return false;
10883
10884 if (stack_max_limit)
10885 {
10886 Magazine other_mag = Magazine.Cast(other_item);
10887 if (other_item)
10888 {
10889 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10890 return false;
10891 }
10892
10893 }
10894 }
10895 else
10896 {
10897
10899 return false;
10900
10902 return false;
10903 }
10904
10905 PlayerBase player = null;
10906 if (CastTo(player, GetHierarchyRootPlayer()))
10907 {
10908 if (player.GetInventory().HasAttachment(this))
10909 return false;
10910
10911 if (player.IsItemsToDelete())
10912 return false;
10913 }
10914
10915 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10916 return false;
10917
10918 int slotID;
10920 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10921 return false;
10922
10923 return true;
10924 }
10925
10927 {
10929 }
10930
10932 {
10933 return m_IsResultOfSplit;
10934 }
10935
10937 {
10938 m_IsResultOfSplit = value;
10939 }
10940
10942 {
10944 }
10945
10947 {
10948 float other_item_quantity = other_item.GetQuantity();
10949 float this_free_space;
10950
10952
10954
10955 if (other_item_quantity > this_free_space)
10956 {
10957 return this_free_space;
10958 }
10959 else
10960 {
10961 return other_item_quantity;
10962 }
10963 }
10964
10966 {
10968 }
10969
10971 {
10973 return;
10974
10975 if (!IsMagazine() && other_item)
10976 {
10978 if (quantity_used != 0)
10979 {
10980 float hp1 = GetHealth01("","");
10981 float hp2 = other_item.GetHealth01("","");
10982 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10983 hpResult = hpResult / (
GetQuantity() + quantity_used);
10984
10985 hpResult *= GetMaxHealth();
10986 Math.Round(hpResult);
10987 SetHealth("", "Health", hpResult);
10988
10990 other_item.AddQuantity(-quantity_used);
10991 }
10992 }
10994 }
10995
10997 {
10998 #ifdef SERVER
10999 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11000 GetHierarchyParent().IncreaseLifetimeUp();
11001 #endif
11002 };
11003
11005 {
11006 PlayerBase p = PlayerBase.Cast(player);
11007
11008 array<int> recipesIds = p.m_Recipes;
11009 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11010 if (moduleRecipesManager)
11011 {
11012 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11013 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11014 }
11015
11016 for (int i = 0;i < recipesIds.Count(); i++)
11017 {
11018 int key = recipesIds.Get(i);
11019 string recipeName = moduleRecipesManager.GetRecipeName(key);
11021 }
11022 }
11023
11024
11025 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11026 {
11027 super.GetDebugActions(outputList);
11028
11029
11035
11036
11041
11046
11047
11051
11052
11054 {
11058 }
11059
11062
11063
11067
11069
11070 InventoryLocation loc = new InventoryLocation();
11071 GetInventory().GetCurrentInventoryLocation(loc);
11073 {
11074 if (Gizmo_IsSupported())
11077 }
11078
11080 }
11081
11082
11083
11084
11086 {
11087 super.OnAction(action_id, player, ctx);
11088
11090 {
11091 switch (action_id)
11092 {
11095 return true;
11098 return true;
11099 }
11100 }
11101
11103 {
11104 switch (action_id)
11105 {
11107 Delete();
11108 return true;
11109 }
11110 }
11111
11112 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11113 {
11114 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11115 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11116 PlayerBase p = PlayerBase.Cast(player);
11117 if (
EActions.RECIPES_RANGE_START < 1000)
11118 {
11119 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11120 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11121 }
11122 }
11123 #ifndef SERVER
11124 else if (action_id ==
EActions.WATCH_PLAYER)
11125 {
11126 PluginDeveloper.SetDeveloperItemClientEx(player);
11127 }
11128 #endif
11130 {
11131 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11132 {
11133 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11134 OnDebugButtonPressServer(id + 1);
11135 }
11136
11137 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11138 {
11139 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11141 }
11142
11143 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11144 {
11145 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11147 }
11148
11149 else if (action_id ==
EActions.ADD_QUANTITY)
11150 {
11151 if (IsMagazine())
11152 {
11153 Magazine mag = Magazine.Cast(this);
11154 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11155 }
11156 else
11157 {
11159 }
11160
11161 if (m_EM)
11162 {
11163 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11164 }
11165
11166 }
11167
11168 else if (action_id ==
EActions.REMOVE_QUANTITY)
11169 {
11170 if (IsMagazine())
11171 {
11172 Magazine mag2 = Magazine.Cast(this);
11173 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11174 }
11175 else
11176 {
11178 }
11179 if (m_EM)
11180 {
11181 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11182 }
11183
11184 }
11185
11186 else if (action_id ==
EActions.SET_QUANTITY_0)
11187 {
11189
11190 if (m_EM)
11191 {
11192 m_EM.SetEnergy(0);
11193 }
11194 }
11195
11196 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11197 {
11199
11200 if (m_EM)
11201 {
11202 m_EM.SetEnergy(m_EM.GetEnergyMax());
11203 }
11204 }
11205
11206 else if (action_id ==
EActions.ADD_HEALTH)
11207 {
11208 AddHealth("","",GetMaxHealth("","Health")/5);
11209 }
11210 else if (action_id ==
EActions.REMOVE_HEALTH)
11211 {
11212 AddHealth("","",-GetMaxHealth("","Health")/5);
11213 }
11214 else if (action_id ==
EActions.DESTROY_HEALTH)
11215 {
11216 SetHealth01("","",0);
11217 }
11218 else if (action_id ==
EActions.WATCH_ITEM)
11219 {
11221 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11222 #ifdef DEVELOPER
11223 SetDebugDeveloper_item(this);
11224 #endif
11225 }
11226
11227 else if (action_id ==
EActions.ADD_TEMPERATURE)
11228 {
11229 AddTemperature(20);
11230
11231 }
11232
11233 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11234 {
11235 AddTemperature(-20);
11236
11237 }
11238
11239 else if (action_id ==
EActions.FLIP_FROZEN)
11240 {
11241 SetFrozen(!GetIsFrozen());
11242
11243 }
11244
11245 else if (action_id ==
EActions.ADD_WETNESS)
11246 {
11248
11249 }
11250
11251 else if (action_id ==
EActions.REMOVE_WETNESS)
11252 {
11254
11255 }
11256
11257 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11258 {
11261
11262
11263 }
11264
11265 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11266 {
11269 }
11270
11271 else if (action_id ==
EActions.MAKE_SPECIAL)
11272 {
11273 auto debugParams = DebugSpawnParams.WithPlayer(player);
11274 OnDebugSpawnEx(debugParams);
11275 }
11276
11277 }
11278
11279
11280 return false;
11281 }
11282
11283
11284
11285
11289
11292
11293
11294
11296 {
11297 return false;
11298 }
11299
11300
11302 {
11303 return true;
11304 }
11305
11306
11308 {
11309 return true;
11310 }
11311
11312
11313
11315 {
11316 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11318 }
11319
11322 {
11323 return null;
11324 }
11325
11327 {
11328 return false;
11329 }
11330
11332 {
11333 return false;
11334 }
11335
11339
11340
11342 {
11343 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11344 return module_repairing.CanRepair(this, item_repair_kit);
11345 }
11346
11347
11348 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11349 {
11350 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11351 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11352 }
11353
11354
11356 {
11357
11358
11359
11360
11361
11362
11363
11364
11365 return 1;
11366 }
11367
11368
11369
11371 {
11373 }
11374
11375
11376
11378 {
11380 }
11381
11382
11391 {
11392 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11393
11394 if (player)
11395 {
11396 player.MessageStatus(text);
11397 }
11398 }
11399
11400
11409 {
11410 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11411
11412 if (player)
11413 {
11414 player.MessageAction(text);
11415 }
11416 }
11417
11418
11427 {
11428 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11429
11430 if (player)
11431 {
11432 player.MessageFriendly(text);
11433 }
11434 }
11435
11436
11445 {
11446 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11447
11448 if (player)
11449 {
11450 player.MessageImportant(text);
11451 }
11452 }
11453
11455 {
11456 return true;
11457 }
11458
11459
11460 override bool KindOf(
string tag)
11461 {
11462 bool found = false;
11463 string item_name = this.
GetType();
11466
11467 int array_size = item_tag_array.Count();
11468 for (int i = 0; i < array_size; i++)
11469 {
11470 if (item_tag_array.Get(i) == tag)
11471 {
11472 found = true;
11473 break;
11474 }
11475 }
11476 return found;
11477 }
11478
11479
11481 {
11482
11483 super.OnRPC(sender, rpc_type,ctx);
11484
11485
11486 switch (rpc_type)
11487 {
11488 #ifndef SERVER
11489 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11490 Param2<bool, string> p = new Param2<bool, string>(false, "");
11491
11493 return;
11494
11495 bool play = p.param1;
11496 string soundSet = p.param2;
11497
11498 if (play)
11499 {
11501 {
11503 {
11505 }
11506 }
11507 else
11508 {
11510 }
11511 }
11512 else
11513 {
11515 }
11516
11517 break;
11518 #endif
11519
11520 }
11521
11523 {
11525 }
11526 }
11527
11528
11529
11530
11532 {
11533 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11534 return plugin.GetID(
name);
11535 }
11536
11538 {
11539 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11540 return plugin.GetName(id);
11541 }
11542
11545 {
11546
11547
11548 int varFlags;
11549 if (!ctx.
Read(varFlags))
11550 return;
11551
11552 if (varFlags & ItemVariableFlags.FLOAT)
11553 {
11555 }
11556 }
11557
11559 {
11560
11561 super.SerializeNumericalVars(floats_out);
11562
11563
11564
11566 {
11568 }
11569
11571 {
11573 }
11574
11576 {
11578 }
11579
11581 {
11586 }
11587
11589 {
11591 }
11592 }
11593
11595 {
11596
11597 super.DeSerializeNumericalVars(floats);
11598
11599
11600 int index = 0;
11601 int mask = Math.Round(floats.Get(index));
11602
11603 index++;
11604
11606 {
11608 {
11610 }
11611 else
11612 {
11613 float quantity = floats.Get(index);
11614 SetQuantity(quantity,
true,
false,
false,
false);
11615 }
11616 index++;
11617 }
11618
11620 {
11621 float wet = floats.Get(index);
11623 index++;
11624 }
11625
11627 {
11628 int liquidtype = Math.Round(floats.Get(index));
11630 index++;
11631 }
11632
11634 {
11636 index++;
11638 index++;
11640 index++;
11642 index++;
11643 }
11644
11646 {
11647 int cleanness = Math.Round(floats.Get(index));
11649 index++;
11650 }
11651 }
11652
11654 {
11655 super.WriteVarsToCTX(ctx);
11656
11657
11659 {
11661 }
11662
11664 {
11666 }
11667
11669 {
11671 }
11672
11674 {
11675 int r,g,b,a;
11681 }
11682
11684 {
11686 }
11687 }
11688
11690 {
11691 if (!super.ReadVarsFromCTX(ctx,version))
11692 return false;
11693
11694 int intValue;
11695 float value;
11696
11697 if (version < 140)
11698 {
11699 if (!ctx.
Read(intValue))
11700 return false;
11701
11702 m_VariablesMask = intValue;
11703 }
11704
11706 {
11707 if (!ctx.
Read(value))
11708 return false;
11709
11711 {
11713 }
11714 else
11715 {
11717 }
11718 }
11719
11720 if (version < 140)
11721 {
11723 {
11724 if (!ctx.
Read(value))
11725 return false;
11726 SetTemperatureDirect(value);
11727 }
11728 }
11729
11731 {
11732 if (!ctx.
Read(value))
11733 return false;
11735 }
11736
11738 {
11739 if (!ctx.
Read(intValue))
11740 return false;
11742 }
11743
11745 {
11746 int r,g,b,a;
11748 return false;
11750 return false;
11752 return false;
11754 return false;
11755
11757 }
11758
11760 {
11761 if (!ctx.
Read(intValue))
11762 return false;
11764 }
11765
11766 if (version >= 138 && version < 140)
11767 {
11769 {
11770 if (!ctx.
Read(intValue))
11771 return false;
11772 SetFrozen(intValue);
11773 }
11774 }
11775
11776 return true;
11777 }
11778
11779
11781 {
11784 {
11786 }
11787
11788 if (!super.OnStoreLoad(ctx, version))
11789 {
11791 return false;
11792 }
11793
11794 if (version >= 114)
11795 {
11796 bool hasQuickBarIndexSaved;
11797
11798 if (!ctx.
Read(hasQuickBarIndexSaved))
11799 {
11801 return false;
11802 }
11803
11804 if (hasQuickBarIndexSaved)
11805 {
11806 int itmQBIndex;
11807
11808
11809 if (!ctx.
Read(itmQBIndex))
11810 {
11812 return false;
11813 }
11814
11815 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11816 if (itmQBIndex != -1 && parentPlayer)
11817 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11818 }
11819 }
11820 else
11821 {
11822
11823 PlayerBase player;
11824 int itemQBIndex;
11825 if (version ==
int.
MAX)
11826 {
11827 if (!ctx.
Read(itemQBIndex))
11828 {
11830 return false;
11831 }
11832 }
11833 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11834 {
11835
11836 if (!ctx.
Read(itemQBIndex))
11837 {
11839 return false;
11840 }
11841 if (itemQBIndex != -1 && player)
11842 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11843 }
11844 }
11845
11846 if (version < 140)
11847 {
11848
11849 if (!LoadVariables(ctx, version))
11850 {
11852 return false;
11853 }
11854 }
11855
11856
11858 {
11860 return false;
11861 }
11862 if (version >= 132)
11863 {
11865 if (raib)
11866 {
11868 {
11870 return false;
11871 }
11872 }
11873 }
11874
11876 return true;
11877 }
11878
11879
11880
11882 {
11883 super.OnStoreSave(ctx);
11884
11885 PlayerBase player;
11886 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11887 {
11889
11890 int itemQBIndex = -1;
11891 itemQBIndex = player.FindQuickBarEntityIndex(this);
11892 ctx.
Write(itemQBIndex);
11893 }
11894 else
11895 {
11897 }
11898
11900
11902 if (raib)
11903 {
11905 }
11906 }
11907
11908
11910 {
11911 super.AfterStoreLoad();
11912
11914 {
11916 }
11917
11919 {
11922 }
11923 }
11924
11926 {
11927 super.EEOnAfterLoad();
11928
11930 {
11932 }
11933
11936 }
11937
11939 {
11940 return false;
11941 }
11942
11943
11944
11946 {
11948 {
11949 #ifdef PLATFORM_CONSOLE
11950
11952 {
11954 if (menu)
11955 {
11957 }
11958 }
11959 #endif
11960 }
11961
11963 {
11966 }
11967
11969 {
11970 SetWeightDirty();
11972 }
11974 {
11977 }
11978
11980 {
11983 }
11985 {
11988 }
11989
11990 super.OnVariablesSynchronized();
11991 }
11992
11993
11994
11996 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11997 {
11998 if (!IsServerCheck(allow_client))
11999 return false;
12000
12002 return false;
12003
12006
12007 if (value <= (min + 0.001))
12008 value = min;
12009
12010 if (value == min)
12011 {
12012 if (destroy_config)
12013 {
12014 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12015 if (dstr)
12016 {
12018 this.Delete();
12019 return true;
12020 }
12021 }
12022 else if (destroy_forced)
12023 {
12025 this.Delete();
12026 return true;
12027 }
12028
12030 }
12031
12034
12036 {
12038
12039 if (delta)
12041 }
12042
12044
12045 return false;
12046 }
12047
12048
12050 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12051 {
12053 }
12054
12056 {
12059 }
12060
12062 {
12065 }
12066
12068 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12069 {
12070 float value_clamped = Math.Clamp(value, 0, 1);
12072 SetQuantity(result, destroy_config, destroy_forced);
12073 }
12074
12075
12078 {
12080 }
12081
12083 {
12085 }
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12097 {
12098 int slot = -1;
12099 if (GetInventory())
12100 {
12101 InventoryLocation il = new InventoryLocation;
12102 GetInventory().GetCurrentInventoryLocation(il);
12104 }
12105
12107 }
12108
12110 {
12111 float quantity_max = 0;
12112
12114 {
12115 if (attSlotID != -1)
12116 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12117
12118 if (quantity_max <= 0)
12120 }
12121
12122 if (quantity_max <= 0)
12124
12125 return quantity_max;
12126 }
12127
12129 {
12131 }
12132
12134 {
12136 }
12137
12138
12140 {
12142 }
12143
12145 {
12147 }
12148
12150 {
12152 }
12153
12154
12156 {
12157
12158 float weightEx = GetWeightEx();
12159 float special = GetInventoryAndCargoWeight();
12160 return weightEx - special;
12161 }
12162
12163
12165 {
12167 }
12168
12170 {
12172 {
12173 #ifdef DEVELOPER
12174 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12175 {
12176 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12178 }
12179 #endif
12180
12181 return GetQuantity() * GetConfigWeightModified();
12182 }
12183 else if (HasEnergyManager())
12184 {
12185 #ifdef DEVELOPER
12186 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12187 {
12188 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12189 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12190 }
12191 #endif
12192 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12193 }
12194 else
12195 {
12196 #ifdef DEVELOPER
12197 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12198 {
12199 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12200 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12201 }
12202 #endif
12203 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12204 }
12205 }
12206
12209 {
12210 int item_count = 0;
12212
12213 if (GetInventory().GetCargo() != NULL)
12214 {
12215 item_count = GetInventory().GetCargo().GetItemCount();
12216 }
12217
12218 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12219 {
12220 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12221 if (item)
12222 item_count += item.GetNumberOfItems();
12223 }
12224 return item_count;
12225 }
12226
12229 {
12230 float weight = 0;
12231 float wetness = 1;
12232 if (include_wetness)
12235 {
12236 weight = wetness * m_ConfigWeight;
12237 }
12239 {
12240 weight = 1;
12241 }
12242 return weight;
12243 }
12244
12245
12246
12248 {
12249 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12250 {
12251 GameInventory inv = GetInventory();
12252 array<EntityAI> items = new array<EntityAI>;
12254 for (int i = 0; i < items.Count(); i++)
12255 {
12257 if (item)
12258 {
12260 }
12261 }
12262 }
12263 }
12264
12265
12266
12267
12269 {
12270 float energy = 0;
12271 if (HasEnergyManager())
12272 {
12273 energy = GetCompEM().GetEnergy();
12274 }
12275 return energy;
12276 }
12277
12278
12280 {
12281 super.OnEnergyConsumed();
12282
12284 }
12285
12287 {
12288 super.OnEnergyAdded();
12289
12291 }
12292
12293
12295 {
12296 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12297 {
12299 {
12300 float energy_0to1 = GetCompEM().GetEnergy0To1();
12302 }
12303 }
12304 }
12305
12306
12308 {
12309 return ConfigGetFloat("heatIsolation");
12310 }
12311
12313 {
12315 }
12316
12318 {
12319 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12320 if (
GetGame().ConfigIsExisting(paramPath))
12322
12323 return 0.0;
12324 }
12325
12327 {
12328 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12329 if (
GetGame().ConfigIsExisting(paramPath))
12331
12332 return 0.0;
12333 }
12334
12335 override void SetWet(
float value,
bool allow_client =
false)
12336 {
12337 if (!IsServerCheck(allow_client))
12338 return;
12339
12342
12344
12345 m_VarWet = Math.Clamp(value, min, max);
12346
12348 {
12351 }
12352 }
12353
12354 override void AddWet(
float value)
12355 {
12357 }
12358
12360 {
12362 }
12363
12365 {
12367 }
12368
12370 {
12372 }
12373
12375 {
12377 }
12378
12380 {
12382 }
12383
12384 override void OnWetChanged(
float newVal,
float oldVal)
12385 {
12388 if (newLevel != oldLevel)
12389 {
12391 }
12392 }
12393
12395 {
12396 SetWeightDirty();
12397 }
12398
12400 {
12401 return GetWetLevelInternal(
m_VarWet);
12402 }
12403
12404
12405
12407 {
12409 }
12410
12412 {
12414 }
12415
12417 {
12419 }
12420
12422 {
12424 }
12425
12426
12427
12429 {
12430 if (ConfigIsExisting("itemModelLength"))
12431 {
12432 return ConfigGetFloat("itemModelLength");
12433 }
12434 return 0;
12435 }
12436
12438 {
12439 if (ConfigIsExisting("itemAttachOffset"))
12440 {
12441 return ConfigGetFloat("itemAttachOffset");
12442 }
12443 return 0;
12444 }
12445
12446 override void SetCleanness(
int value,
bool allow_client =
false)
12447 {
12448 if (!IsServerCheck(allow_client))
12449 return;
12450
12452
12454
12457 }
12458
12460 {
12462 }
12463
12465 {
12466 return true;
12467 }
12468
12469
12470
12471
12473 {
12475 }
12476
12478 {
12480 }
12481
12482
12483
12484
12485 override void SetColor(
int r,
int g,
int b,
int a)
12486 {
12492 }
12494 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12495 {
12500 }
12501
12503 {
12505 }
12506
12509 {
12510 int r,g,b,a;
12512 r = r/255;
12513 g = g/255;
12514 b = b/255;
12515 a = a/255;
12516 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12517 }
12518
12519
12520
12521 override void SetLiquidType(
int value,
bool allow_client =
false)
12522 {
12523 if (!IsServerCheck(allow_client))
12524 return;
12525
12530 }
12531
12533 {
12534 return ConfigGetInt("varLiquidTypeInit");
12535 }
12536
12538 {
12540 }
12541
12543 {
12545 SetFrozen(false);
12546 }
12547
12550 {
12551 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12552 }
12553
12554
12557 {
12558 PlayerBase nplayer;
12559 if (PlayerBase.CastTo(nplayer, player))
12560 {
12562
12563 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12564 }
12565 }
12566
12567
12570 {
12571 PlayerBase nplayer;
12572 if (PlayerBase.CastTo(nplayer,player))
12573 {
12574
12575 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12576
12577 }
12578
12579
12580 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12581
12582
12583 if (HasEnergyManager())
12584 {
12585 GetCompEM().UpdatePlugState();
12586 }
12587 }
12588
12589
12591 {
12592 super.OnPlacementStarted(player);
12593
12595 }
12596
12597 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12598 {
12600 {
12601 m_AdminLog.OnPlacementComplete(player,
this);
12602 }
12603
12604 super.OnPlacementComplete(player, position, orientation);
12605 }
12606
12607
12608
12609
12610
12612 {
12614 {
12615 return true;
12616 }
12617 else
12618 {
12619 return false;
12620 }
12621 }
12622
12623
12625 {
12627 {
12629 }
12630 }
12631
12632
12634 {
12636 }
12637
12639 {
12641 }
12642
12643 override void InsertAgent(
int agent,
float count = 1)
12644 {
12645 if (count < 1)
12646 return;
12647
12649 }
12650
12653 {
12655 }
12656
12657
12659 {
12661 }
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12705 {
12707 return false;
12708 return true;
12709 }
12710
12712 {
12713
12715 }
12716
12717
12720 {
12721 super.CheckForRoofLimited(timeTresholdMS);
12722
12724 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12725 {
12726 m_PreviousRoofTestTime = time;
12727 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12728 }
12729 }
12730
12731
12733 {
12735 {
12736 return 0;
12737 }
12738
12739 if (GetInventory().GetAttachmentSlotsCount() != 0)
12740 {
12741 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12742 if (filter)
12743 return filter.GetProtectionLevel(type, false, system);
12744 else
12745 return 0;
12746 }
12747
12748 string subclassPath, entryName;
12749
12750 switch (type)
12751 {
12753 entryName = "biological";
12754 break;
12756 entryName = "chemical";
12757 break;
12758 default:
12759 entryName = "biological";
12760 break;
12761 }
12762
12763 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12764
12766 }
12767
12768
12769
12772 {
12773 if (!IsMagazine())
12775
12777 }
12778
12779
12780
12781
12782
12787 {
12788 return true;
12789 }
12790
12792 {
12794 }
12795
12796
12797
12798
12799
12801 {
12802 if (parent)
12803 {
12804 if (parent.IsInherited(DayZInfected))
12805 return true;
12806
12807 if (!parent.IsRuined())
12808 return true;
12809 }
12810
12811 return true;
12812 }
12813
12815 {
12816 if (!super.CanPutAsAttachment(parent))
12817 {
12818 return false;
12819 }
12820
12821 if (!IsRuined() && !parent.IsRuined())
12822 {
12823 return true;
12824 }
12825
12826 return false;
12827 }
12828
12830 {
12831
12832
12833
12834
12835 return super.CanReceiveItemIntoCargo(item);
12836 }
12837
12839 {
12840
12841
12842
12843
12844 GameInventory attachmentInv = attachment.GetInventory();
12846 {
12847 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12848 return false;
12849 }
12850
12851 InventoryLocation loc = new InventoryLocation();
12852 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12853 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12854 return false;
12855
12856 return super.CanReceiveAttachment(attachment, slotId);
12857 }
12858
12860 {
12861 if (!super.CanReleaseAttachment(attachment))
12862 return false;
12863
12864 return GetInventory().AreChildrenAccessible();
12865 }
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12888 {
12889 int id = muzzle_owner.GetMuzzleID();
12890 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12891
12892 if (WPOF_array)
12893 {
12894 for (int i = 0; i < WPOF_array.Count(); i++)
12895 {
12896 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12897
12898 if (WPOF)
12899 {
12900 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12901 }
12902 }
12903 }
12904 }
12905
12906
12908 {
12909 int id = muzzle_owner.GetMuzzleID();
12911
12912 if (WPOBE_array)
12913 {
12914 for (int i = 0; i < WPOBE_array.Count(); i++)
12915 {
12916 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12917
12918 if (WPOBE)
12919 {
12920 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12921 }
12922 }
12923 }
12924 }
12925
12926
12928 {
12929 int id = muzzle_owner.GetMuzzleID();
12930 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12931
12932 if (WPOOH_array)
12933 {
12934 for (int i = 0; i < WPOOH_array.Count(); i++)
12935 {
12936 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12937
12938 if (WPOOH)
12939 {
12940 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12941 }
12942 }
12943 }
12944 }
12945
12946
12948 {
12949 int id = muzzle_owner.GetMuzzleID();
12950 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12951
12952 if (WPOOH_array)
12953 {
12954 for (int i = 0; i < WPOOH_array.Count(); i++)
12955 {
12956 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12957
12958 if (WPOOH)
12959 {
12960 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12961 }
12962 }
12963 }
12964 }
12965
12966
12968 {
12969 int id = muzzle_owner.GetMuzzleID();
12970 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12971
12972 if (WPOOH_array)
12973 {
12974 for (int i = 0; i < WPOOH_array.Count(); i++)
12975 {
12976 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12977
12978 if (WPOOH)
12979 {
12980 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12981 }
12982 }
12983 }
12984 }
12985
12986
12987
12989 {
12991 {
12992 return true;
12993 }
12994
12995 return false;
12996 }
12997
12999 {
13001 {
13002 return true;
13003 }
13004
13005 return false;
13006 }
13007
13009 {
13011 {
13012 return true;
13013 }
13014
13015 return false;
13016 }
13017
13019 {
13020 return false;
13021 }
13022
13025 {
13026 return UATimeSpent.DEFAULT_DEPLOY;
13027 }
13028
13029
13030
13031
13033 {
13035 SetSynchDirty();
13036 }
13037
13039 {
13041 }
13042
13043
13045 {
13046 return false;
13047 }
13048
13051 {
13052 string att_type = "None";
13053
13054 if (ConfigIsExisting("soundAttType"))
13055 {
13056 att_type = ConfigGetString("soundAttType");
13057 }
13058
13060 }
13061
13063 {
13065 }
13066
13067
13068
13069
13070
13076
13078 {
13081
13083 }
13084
13085
13087 {
13089 return;
13090
13092
13095
13098
13099 SoundParameters params = new SoundParameters();
13103 }
13104
13105
13107 {
13109 return;
13110
13112 SetSynchDirty();
13113
13116 }
13117
13118
13120 {
13122 return;
13123
13125 SetSynchDirty();
13126
13129 }
13130
13132 {
13134 }
13135
13137 {
13139 }
13140
13143 {
13144 if (!
GetGame().IsDedicatedServer())
13145 {
13146 if (ConfigIsExisting("attachSoundSet"))
13147 {
13148 string cfg_path = "";
13149 string soundset = "";
13150 string type_name =
GetType();
13151
13154 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13155 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13156
13157 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13158 {
13159 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13160 {
13161 if (cfg_slot_array[i] == slot_type)
13162 {
13163 soundset = cfg_soundset_array[i];
13164 break;
13165 }
13166 }
13167 }
13168
13169 if (soundset != "")
13170 {
13171 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13173 }
13174 }
13175 }
13176 }
13177
13179 {
13180
13181 }
13182
13183 void OnApply(PlayerBase player);
13184
13186 {
13187 return 1.0;
13188 };
13189
13191 {
13193 }
13194
13196 {
13198 }
13199
13201
13203 {
13204 SetDynamicPhysicsLifeTime(0.01);
13206 }
13207
13209 {
13210 array<string> zone_names = new array<string>;
13211 GetDamageZones(zone_names);
13212 for (int i = 0; i < zone_names.Count(); i++)
13213 {
13214 SetHealthMax(zone_names.Get(i),"Health");
13215 }
13216 SetHealthMax("","Health");
13217 }
13218
13221 {
13222 float global_health = GetHealth01("","Health");
13223 array<string> zones = new array<string>;
13224 GetDamageZones(zones);
13225
13226 for (int i = 0; i < zones.Count(); i++)
13227 {
13228 SetHealth01(zones.Get(i),"Health",global_health);
13229 }
13230 }
13231
13234 {
13235 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13236 }
13237
13239 {
13240 if (!hasRootAsPlayer)
13241 {
13242 if (refParentIB)
13243 {
13244
13245 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13246 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13247
13248 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13249 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13250
13253 }
13254 else
13255 {
13256
13259 }
13260 }
13261 }
13262
13264 {
13266 {
13267 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13268 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13269 {
13270 float heatPermCoef = 1.0;
13272 while (ent)
13273 {
13274 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13275 ent = ent.GetHierarchyParent();
13276 }
13277
13278 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13279 }
13280 }
13281 }
13282
13284 {
13285
13286 EntityAI parent = GetHierarchyParent();
13287 if (!parent)
13288 {
13289 hasParent = false;
13290 hasRootAsPlayer = false;
13291 }
13292 else
13293 {
13294 hasParent = true;
13295 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13296 refParentIB =
ItemBase.Cast(parent);
13297 }
13298 }
13299
13300 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13301 {
13302
13303 }
13304
13306 {
13307
13308 return false;
13309 }
13310
13312 {
13313
13314
13315 return false;
13316 }
13317
13319 {
13320
13321 return false;
13322 }
13323
13326 {
13327 return !GetIsFrozen() &&
IsOpen();
13328 }
13329
13331 {
13332 bool hasParent = false, hasRootAsPlayer = false;
13334
13335 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13336 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13337
13338 if (wwtu || foodDecay)
13339 {
13343
13344 if (processWetness || processTemperature || processDecay)
13345 {
13347
13348 if (processWetness)
13349 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13350
13351 if (processTemperature)
13353
13354 if (processDecay)
13355 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13356 }
13357 }
13358 }
13359
13362 {
13364 }
13365
13367 {
13370
13371 return super.GetTemperatureFreezeThreshold();
13372 }
13373
13375 {
13378
13379 return super.GetTemperatureThawThreshold();
13380 }
13381
13383 {
13386
13387 return super.GetItemOverheatThreshold();
13388 }
13389
13391 {
13393 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13394
13395 return super.GetTemperatureFreezeTime();
13396 }
13397
13399 {
13401 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13402
13403 return super.GetTemperatureThawTime();
13404 }
13405
13410
13412 {
13413 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13414 }
13415
13417 {
13418 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13419 }
13420
13423 {
13425 }
13426
13428 {
13430 }
13431
13433 {
13435 }
13436
13439 {
13440 return null;
13441 }
13442
13445 {
13446 return false;
13447 }
13448
13450 {
13452 {
13455 if (!trg)
13456 {
13458 explosive = this;
13459 }
13460
13461 explosive.PairRemote(trg);
13463
13464 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13465 trg.SetPersistentPairID(persistentID);
13466 explosive.SetPersistentPairID(persistentID);
13467
13468 return true;
13469 }
13470 return false;
13471 }
13472
13475 {
13476 float ret = 1.0;
13479 ret *= GetHealth01();
13480
13481 return ret;
13482 }
13483
13484 #ifdef DEVELOPER
13485 override void SetDebugItem()
13486 {
13487 super.SetDebugItem();
13488 _itemBase = this;
13489 }
13490
13492 {
13493 string text = super.GetDebugText();
13494
13496 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13497
13498 return text;
13499 }
13500 #endif
13501
13503 {
13504 return true;
13505 }
13506
13508
13510
13512 {
13515 }
13516
13517
13525
13541}
13542
13544{
13546 if (entity)
13547 {
13548 bool is_item = entity.IsInherited(
ItemBase);
13549 if (is_item && full_quantity)
13550 {
13553 }
13554 }
13555 else
13556 {
13558 return NULL;
13559 }
13560 return entity;
13561}
13562
13564{
13565 if (item)
13566 {
13567 if (health > 0)
13568 item.SetHealth("", "", health);
13569
13570 if (item.CanHaveTemperature())
13571 {
13573 if (item.CanFreeze())
13574 item.SetFrozen(false);
13575 }
13576
13577 if (item.HasEnergyManager())
13578 {
13579 if (quantity >= 0)
13580 {
13581 item.GetCompEM().SetEnergy0To1(quantity);
13582 }
13583 else
13584 {
13586 }
13587 }
13588 else if (item.IsMagazine())
13589 {
13590 Magazine mag = Magazine.Cast(item);
13591 if (quantity >= 0)
13592 {
13593 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13594 }
13595 else
13596 {
13598 }
13599
13600 }
13601 else
13602 {
13603 if (quantity >= 0)
13604 {
13605 item.SetQuantityNormalized(quantity, false);
13606 }
13607 else
13608 {
13610 }
13611
13612 }
13613 }
13614}
13615
13616#ifdef DEVELOPER
13618#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.