8641{
8643 {
8644 return true;
8645 }
8646};
8647
8648
8649
8651{
8655
8657
8660
8661
8662
8663
8664
8673
8679
8684
8689
8710 protected bool m_IsResultOfSplit
8711
8713
8718
8719
8720
8722
8726
8727
8728
8730
8733
8734
8735
8741
8742
8750
8753
8754
8756
8757
8759
8760
8765
8766
8771
8772
8774
8775
8777 {
8782
8783 if (!
GetGame().IsDedicatedServer())
8784 {
8786 {
8788
8790 {
8792 }
8793 }
8794
8797 }
8798
8799 m_OldLocation = null;
8800
8802 {
8804 }
8805
8806 if (ConfigIsExisting("headSelectionsToHide"))
8807 {
8810 }
8811
8813 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8814 {
8816 }
8817
8819
8820 m_IsResultOfSplit = false;
8821
8823 }
8824
8826 {
8827 super.InitItemVariables();
8828
8834 m_Count = ConfigGetInt(
"count");
8835
8838
8843
8846
8851
8863
8867
8868
8871 if (ConfigIsExisting("canBeSplit"))
8872 {
8875 }
8876
8878 if (ConfigIsExisting("itemBehaviour"))
8880
8881
8884 RegisterNetSyncVariableInt("m_VarLiquidType");
8885 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8886
8887 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8888 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8889 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8890
8891 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8892 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8893 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8894 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8895
8896 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8897 RegisterNetSyncVariableBool("m_IsTakeable");
8898 RegisterNetSyncVariableBool("m_IsHologram");
8899
8902 {
8905 }
8906
8908
8910 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8912
8913 }
8914
8916 {
8918 }
8919
8921 {
8924 {
8929 }
8930 }
8931
8932 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8933 {
8935 {
8938 }
8939
8941 }
8942
8944 {
8950 }
8951
8953
8955 {
8957
8958 if (!action)
8959 {
8960 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8961 return;
8962 }
8963
8965 if (!ai)
8966 {
8968 return;
8969 }
8970
8972 if (!action_array)
8973 {
8974 action_array = new array<ActionBase_Basic>;
8976 }
8977 if (LogManager.IsActionLogEnable())
8978 {
8979 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8980 }
8981
8982 if (action_array.Find(action) != -1)
8983 {
8984 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8985 }
8986 else
8987 {
8988 action_array.Insert(action);
8989 }
8990 }
8991
8993 {
8995 ActionBase action = player.GetActionManager().GetAction(actionName);
8998
8999 if (action_array)
9000 {
9001 action_array.RemoveItem(action);
9002 }
9003 }
9004
9005
9006
9008 {
9009 ActionOverrideData overrideData = new ActionOverrideData();
9013
9015 if (!actionMap)
9016 {
9019 }
9020
9021 actionMap.Insert(this.
Type(), overrideData);
9022
9023 }
9024
9026
9028
9029
9031 {
9034
9037
9038 string config_to_search = "CfgVehicles";
9039 string muzzle_owner_config;
9040
9042 {
9043 if (IsInherited(Weapon))
9044 config_to_search = "CfgWeapons";
9045
9046 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9047
9048 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9049
9051
9052 if (config_OnFire_subclass_count > 0)
9053 {
9054 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9055
9056 for (int i = 0; i < config_OnFire_subclass_count; i++)
9057 {
9058 string particle_class = "";
9060 string config_OnFire_entry = config_OnFire_class + particle_class;
9061 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9062 WPOF_array.Insert(WPOF);
9063 }
9064
9065
9067 }
9068 }
9069
9071 {
9072 config_to_search = "CfgWeapons";
9073 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9074
9075 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9076
9078
9079 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9080 {
9081 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9082
9083 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9084 {
9085 string particle_class2 = "";
9087 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9088 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9089 WPOBE_array.Insert(WPOBE);
9090 }
9091
9092
9094 }
9095 }
9096 }
9097
9098
9100 {
9103
9105 {
9106 string config_to_search = "CfgVehicles";
9107
9108 if (IsInherited(Weapon))
9109 config_to_search = "CfgWeapons";
9110
9111 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9112 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9113
9114 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9115 {
9116
9118
9120 {
9122 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9124 return;
9125 }
9126
9129
9130
9131
9133 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9134
9135 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9136 {
9137 string particle_class = "";
9139 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9141
9142 if (entry_type == CT_CLASS)
9143 {
9144 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9145 WPOOH_array.Insert(WPOF);
9146 }
9147 }
9148
9149
9151 }
9152 }
9153 }
9154
9156 {
9158 }
9159
9161 {
9163 {
9165
9168
9171
9172 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9173 }
9174 }
9175
9177 {
9179 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9180
9182 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9183
9185 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9186
9188 {
9190 }
9191 }
9192
9194 {
9196 }
9197
9199 {
9202 else
9204
9206 {
9209 }
9210 else
9211 {
9214
9217 }
9218
9220 }
9221
9223 {
9225 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9226 }
9227
9229 {
9231 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9233 }
9234
9236 {
9238 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9239 }
9240
9242 {
9245
9246 OverheatingParticle OP = new OverheatingParticle();
9251
9253 }
9254
9256 {
9259
9260 return -1;
9261 }
9262
9264 {
9266 {
9269
9270 for (int i = count; i > 0; --i)
9271 {
9272 int id = i - 1;
9275
9278
9279 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9280 {
9281 if (p)
9282 {
9285 }
9286 }
9287 }
9288 }
9289 }
9290
9292 {
9294 {
9296 {
9297 int id = i - 1;
9299
9300 if (OP)
9301 {
9303
9304 if (p)
9305 {
9307 }
9308
9309 delete OP;
9310 }
9311 }
9312
9315 }
9316 }
9317
9320 {
9321 return 0.0;
9322 }
9323
9324
9326 {
9327 return 250;
9328 }
9329
9331 {
9332 return 0;
9333 }
9334
9337 {
9339 return true;
9340
9341 return false;
9342 }
9343
9346 {
9349
9351 {
9353 }
9354 else
9355 {
9356
9358 }
9359
9361 }
9362
9369 {
9370 return -1;
9371 }
9372
9373
9374
9375
9377 {
9379 {
9381 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9382
9383 if (r_index >= 0)
9384 {
9385 InventoryLocation r_il = new InventoryLocation;
9386 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9387
9388 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9391 {
9392 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9393 }
9395 {
9396 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9397 }
9398
9399 }
9400
9401 player.GetHumanInventory().ClearUserReservedLocation(this);
9402 }
9403
9406 }
9407
9408
9409
9410
9412 {
9413 return ItemBase.m_DebugActionsMask;
9414 }
9415
9417 {
9418 return ItemBase.m_DebugActionsMask & mask;
9419 }
9420
9422 {
9423 ItemBase.m_DebugActionsMask = mask;
9424 }
9425
9427 {
9428 ItemBase.m_DebugActionsMask |= mask;
9429 }
9430
9432 {
9433 ItemBase.m_DebugActionsMask &= ~mask;
9434 }
9435
9437 {
9439 {
9441 }
9442 else
9443 {
9445 }
9446 }
9447
9448
9450 {
9451 if (GetEconomyProfile())
9452 {
9453 float q_max = GetEconomyProfile().GetQuantityMax();
9454 if (q_max > 0)
9455 {
9456 float q_min = GetEconomyProfile().GetQuantityMin();
9457 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9458
9460 {
9461 ComponentEnergyManager comp = GetCompEM();
9463 {
9465 }
9466 }
9468 {
9470
9471 }
9472
9473 }
9474 }
9475 }
9476
9479 {
9480 EntityAI parent = GetHierarchyParent();
9481
9482 if (parent)
9483 {
9484 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9485 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9486 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9487 }
9488 }
9489
9492 {
9493 EntityAI parent = GetHierarchyParent();
9494
9495 if (parent)
9496 {
9497 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9498 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9499 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9500 }
9501 }
9502
9504 {
9505
9506
9507
9508
9510
9512 {
9513 if (ScriptInputUserData.CanStoreInputUserData())
9514 {
9515 ScriptInputUserData ctx = new ScriptInputUserData;
9521 ctx.
Write(use_stack_max);
9524
9526 {
9527 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9528 }
9529 }
9530 }
9531 else if (!
GetGame().IsMultiplayer())
9532 {
9534 }
9535 }
9536
9538 {
9540 }
9541
9543 {
9545 }
9546
9548 {
9550 }
9551
9553 {
9554
9555 return false;
9556 }
9557
9559 {
9560 return false;
9561 }
9562
9566 {
9567 return false;
9568 }
9569
9571 {
9572 return "";
9573 }
9574
9576
9578 {
9579 return false;
9580 }
9581
9583 {
9584 return true;
9585 }
9586
9587
9588
9590 {
9591 return true;
9592 }
9593
9595 {
9596 return true;
9597 }
9598
9600 {
9601 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9603 }
9604
9606 {
9608 }
9609
9611 {
9613 if (!is_being_placed)
9615 SetSynchDirty();
9616 }
9617
9618
9620
9622 {
9624 }
9625
9627 {
9629 }
9630
9632 {
9633 return 1;
9634 }
9635
9637 {
9638 return false;
9639 }
9640
9642 {
9644 SetSynchDirty();
9645 }
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9682 {
9683 super.OnMovedInsideCargo(container);
9684
9685 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9686 }
9687
9688 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9689 {
9690 super.EEItemLocationChanged(oldLoc,newLoc);
9691
9692 PlayerBase new_player = null;
9693 PlayerBase old_player = null;
9694
9695 if (newLoc.GetParent())
9696 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9697
9698 if (oldLoc.GetParent())
9699 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9700
9702 {
9703 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9704
9705 if (r_index >= 0)
9706 {
9707 InventoryLocation r_il = new InventoryLocation;
9708 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9709
9710 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9713 {
9714 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9715 }
9717 {
9718 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9719 }
9720
9721 }
9722 }
9723
9725 {
9726 if (new_player)
9727 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9728
9729 if (new_player == old_player)
9730 {
9731
9732 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9733 {
9735 {
9736 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9737 {
9738 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9739 }
9740 }
9741 else
9742 {
9743 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9744 }
9745 }
9746
9747 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9748 {
9749 int type = oldLoc.GetType();
9751 {
9752 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9753 }
9755 {
9756 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9757 }
9758 }
9759 if (!m_OldLocation)
9760 {
9761 m_OldLocation = new InventoryLocation;
9762 }
9763 m_OldLocation.Copy(oldLoc);
9764 }
9765 else
9766 {
9767 if (m_OldLocation)
9768 {
9769 m_OldLocation.Reset();
9770 }
9771 }
9772
9774 }
9775 else
9776 {
9777 if (new_player)
9778 {
9779 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9780 if (res_index >= 0)
9781 {
9782 InventoryLocation il = new InventoryLocation;
9783 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9785 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9788 {
9789 il.
GetParent().GetOnReleaseLock().Invoke(it);
9790 }
9792 {
9794 }
9795
9796 }
9797 }
9799 {
9800
9802 }
9803
9804 if (m_OldLocation)
9805 {
9806 m_OldLocation.Reset();
9807 }
9808 }
9809 }
9810
9811 override void EOnContact(IEntity other, Contact extra)
9812 {
9814 {
9815 int liquidType = -1;
9817 if (impactSpeed > 0.0)
9818 {
9820 #ifndef SERVER
9822 #else
9824 SetSynchDirty();
9825 #endif
9827 }
9828 }
9829
9830 #ifdef SERVER
9831 if (GetCompEM() && GetCompEM().IsPlugged())
9832 {
9833 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9834 GetCompEM().UnplugThis();
9835 }
9836 #endif
9837 }
9838
9840
9842 {
9844 }
9845
9847 {
9848
9849 }
9850
9852 {
9853 super.OnItemLocationChanged(old_owner, new_owner);
9854
9855 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9856 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9857
9858 if (!relatedPlayer && playerNew)
9859 relatedPlayer = playerNew;
9860
9861 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9862 {
9864 if (actionMgr)
9865 {
9866 ActionBase currentAction = actionMgr.GetRunningAction();
9867 if (currentAction)
9869 }
9870 }
9871
9872 Man ownerPlayerOld = null;
9873 Man ownerPlayerNew = null;
9874
9875 if (old_owner)
9876 {
9877 if (old_owner.
IsMan())
9878 {
9879 ownerPlayerOld = Man.Cast(old_owner);
9880 }
9881 else
9882 {
9883 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9884 }
9885 }
9886 else
9887 {
9889 {
9891
9892 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9893 {
9894 GetCompEM().UnplugThis();
9895 }
9896 }
9897 }
9898
9899 if (new_owner)
9900 {
9901 if (new_owner.
IsMan())
9902 {
9903 ownerPlayerNew = Man.Cast(new_owner);
9904 }
9905 else
9906 {
9907 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9908 }
9909 }
9910
9911 if (ownerPlayerOld != ownerPlayerNew)
9912 {
9913 if (ownerPlayerOld)
9914 {
9915 array<EntityAI> subItemsExit = new array<EntityAI>;
9917 for (int i = 0; i < subItemsExit.Count(); i++)
9918 {
9921 }
9922 }
9923
9924 if (ownerPlayerNew)
9925 {
9926 array<EntityAI> subItemsEnter = new array<EntityAI>;
9928 for (int j = 0; j < subItemsEnter.Count(); j++)
9929 {
9932 }
9933 }
9934 }
9935 else if (ownerPlayerNew != null)
9936 {
9937 PlayerBase nplayer;
9938 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9939 {
9940 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9942 for (int k = 0; k < subItemsUpdate.Count(); k++)
9943 {
9945 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9946 }
9947 }
9948 }
9949
9950 if (old_owner)
9951 old_owner.OnChildItemRemoved(this);
9952 if (new_owner)
9953 new_owner.OnChildItemReceived(this);
9954 }
9955
9956
9958 {
9959 super.EEDelete(parent);
9960 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9961 if (player)
9962 {
9964
9965 if (player.IsAlive())
9966 {
9967 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9968 if (r_index >= 0)
9969 {
9970 InventoryLocation r_il = new InventoryLocation;
9971 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9972
9973 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9976 {
9977 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9978 }
9980 {
9981 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9982 }
9983
9984 }
9985
9986 player.RemoveQuickBarEntityShortcut(this);
9987 }
9988 }
9989 }
9990
9992 {
9993 super.EEKilled(killer);
9994
9997 {
9998 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9999 {
10000 if (IsMagazine())
10001 {
10002 if (Magazine.Cast(this).GetAmmoCount() > 0)
10003 {
10005 }
10006 }
10007 else
10008 {
10010 }
10011 }
10012 }
10013 }
10014
10016 {
10017 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10018
10019 super.OnWasAttached(parent, slot_id);
10020
10023
10025 }
10026
10028 {
10029 super.OnWasDetached(parent, slot_id);
10030
10033 }
10034
10036 {
10037 int idx;
10040
10041 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10042 if (inventory_slots.Count() < 1)
10043 {
10044 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10045 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10046 }
10047 else
10048 {
10049 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10050 }
10051
10052 idx = inventory_slots.Find(slot);
10053 if (idx < 0)
10054 return "";
10055
10056 return attach_types.Get(idx);
10057 }
10058
10060 {
10061 int idx = -1;
10062 string slot;
10063
10066
10067 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10068 if (inventory_slots.Count() < 1)
10069 {
10070 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10071 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10072 }
10073 else
10074 {
10075 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10076 if (detach_types.Count() < 1)
10077 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10078 }
10079
10080 for (int i = 0; i < inventory_slots.Count(); i++)
10081 {
10082 slot = inventory_slots.Get(i);
10083 }
10084
10085 if (slot != "")
10086 {
10087 if (detach_types.Count() == 1)
10088 idx = 0;
10089 else
10090 idx = inventory_slots.Find(slot);
10091 }
10092 if (idx < 0)
10093 return "";
10094
10095 return detach_types.Get(idx);
10096 }
10097
10099 {
10100
10102
10103
10104 float min_time = 1;
10105 float max_time = 3;
10106 float delay = Math.RandomFloat(min_time, max_time);
10107
10108 explode_timer.Run(delay, this, "DoAmmoExplosion");
10109 }
10110
10112 {
10113 Magazine magazine = Magazine.Cast(this);
10114 int pop_sounds_count = 6;
10115 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10116
10117
10118 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10119 string sound_name = pop_sounds[ sound_idx ];
10121
10122
10123 magazine.ServerAddAmmoCount(-1);
10124
10125
10126 float min_temp_to_explode = 100;
10127
10128 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10129 {
10131 }
10132 }
10133
10134
10135 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10136 {
10137 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10138
10139 const int CHANCE_DAMAGE_CARGO = 4;
10140 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10141 const int CHANCE_DAMAGE_NOTHING = 2;
10142
10144 {
10145 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10146 int chances;
10147 int rnd;
10148
10149 if (GetInventory().GetCargo())
10150 {
10151 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10152 rnd = Math.RandomInt(0,chances);
10153
10154 if (rnd < CHANCE_DAMAGE_CARGO)
10155 {
10157 }
10158 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10159 {
10161 }
10162 }
10163 else
10164 {
10165 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10166 rnd = Math.RandomInt(0,chances);
10167
10168 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10169 {
10171 }
10172 }
10173 }
10174 }
10175
10177 {
10178 if (GetInventory().GetCargo())
10179 {
10180 int item_count = GetInventory().GetCargo().GetItemCount();
10181 if (item_count > 0)
10182 {
10183 int random_pick = Math.RandomInt(0, item_count);
10185 if (!item.IsExplosive())
10186 {
10187 item.AddHealth("","",damage);
10188 return true;
10189 }
10190 }
10191 }
10192 return false;
10193 }
10194
10196 {
10197 int attachment_count = GetInventory().AttachmentCount();
10198 if (attachment_count > 0)
10199 {
10200 int random_pick = Math.RandomInt(0, attachment_count);
10201 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10202 if (!attachment.IsExplosive())
10203 {
10204 attachment.AddHealth("","",damage);
10205 return true;
10206 }
10207 }
10208 return false;
10209 }
10210
10212 {
10214 }
10215
10217 {
10219 return GetInventory().CanRemoveEntity();
10220
10221 return false;
10222 }
10223
10225 {
10226
10228 return false;
10229
10230
10232 return false;
10233
10234
10235
10237 if (delta == 0)
10238 return false;
10239
10240
10241 return true;
10242 }
10243
10245 {
10247 {
10248 if (ScriptInputUserData.CanStoreInputUserData())
10249 {
10250 ScriptInputUserData ctx = new ScriptInputUserData;
10255 ctx.
Write(destination_entity);
10257 ctx.
Write(slot_id);
10259 }
10260 }
10261 else if (!
GetGame().IsMultiplayer())
10262 {
10264 }
10265 }
10266
10268 {
10269 float split_quantity_new;
10273 InventoryLocation loc = new InventoryLocation;
10274
10275 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10276 {
10278 split_quantity_new = stack_max;
10279 else
10281
10283 {
10284 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10285 if (new_item)
10286 {
10287 new_item.SetResultOfSplit(true);
10288 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10290 new_item.
SetQuantity(split_quantity_new,
false,
true);
10291 }
10292 }
10293 }
10294 else if (destination_entity && slot_id == -1)
10295 {
10296 if (quantity > stack_max)
10297 split_quantity_new = stack_max;
10298 else
10299 split_quantity_new = quantity;
10300
10302 {
10304 {
10307 }
10308
10309 if (new_item)
10310 {
10311 new_item.SetResultOfSplit(true);
10312 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10314 new_item.
SetQuantity(split_quantity_new,
false,
true);
10315 }
10316 }
10317 }
10318 else
10319 {
10320 if (stack_max != 0)
10321 {
10323 {
10325 }
10326
10327 if (split_quantity_new == 0)
10328 {
10329 if (!
GetGame().IsMultiplayer())
10330 player.PhysicalPredictiveDropItem(this);
10331 else
10332 player.ServerDropEntity(this);
10333 return;
10334 }
10335
10337 {
10339
10340 if (new_item)
10341 {
10342 new_item.SetResultOfSplit(true);
10343 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10346 new_item.PlaceOnSurface();
10347 }
10348 }
10349 }
10350 }
10351 }
10352
10354 {
10355 float split_quantity_new;
10359 InventoryLocation loc = new InventoryLocation;
10360
10361 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10362 {
10364 split_quantity_new = stack_max;
10365 else
10367
10369 {
10370 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10371 if (new_item)
10372 {
10373 new_item.SetResultOfSplit(true);
10374 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10376 new_item.
SetQuantity(split_quantity_new,
false,
true);
10377 }
10378 }
10379 }
10380 else if (destination_entity && slot_id == -1)
10381 {
10382 if (quantity > stack_max)
10383 split_quantity_new = stack_max;
10384 else
10385 split_quantity_new = quantity;
10386
10388 {
10390 {
10393 }
10394
10395 if (new_item)
10396 {
10397 new_item.SetResultOfSplit(true);
10398 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10400 new_item.
SetQuantity(split_quantity_new,
false,
true);
10401 }
10402 }
10403 }
10404 else
10405 {
10406 if (stack_max != 0)
10407 {
10409 {
10411 }
10412
10414 {
10416
10417 if (new_item)
10418 {
10419 new_item.SetResultOfSplit(true);
10420 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10423 new_item.PlaceOnSurface();
10424 }
10425 }
10426 }
10427 }
10428 }
10429
10431 {
10433 {
10434 if (ScriptInputUserData.CanStoreInputUserData())
10435 {
10436 ScriptInputUserData ctx = new ScriptInputUserData;
10441 dst.WriteToContext(ctx);
10443 }
10444 }
10445 else if (!
GetGame().IsMultiplayer())
10446 {
10448 }
10449 }
10450
10452 {
10454 {
10455 if (ScriptInputUserData.CanStoreInputUserData())
10456 {
10457 ScriptInputUserData ctx = new ScriptInputUserData;
10462 ctx.
Write(destination_entity);
10468 }
10469 }
10470 else if (!
GetGame().IsMultiplayer())
10471 {
10473 }
10474 }
10475
10477 {
10479 }
10480
10482 {
10484 float split_quantity_new;
10486 if (dst.IsValid())
10487 {
10488 int slot_id = dst.GetSlot();
10490
10491 if (quantity > stack_max)
10492 split_quantity_new = stack_max;
10493 else
10494 split_quantity_new = quantity;
10495
10497 {
10499
10500 if (new_item)
10501 {
10502 new_item.SetResultOfSplit(true);
10503 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10505 new_item.
SetQuantity(split_quantity_new,
false,
true);
10506 }
10507
10508 return new_item;
10509 }
10510 }
10511
10512 return null;
10513 }
10514
10516 {
10518 float split_quantity_new;
10520 if (destination_entity)
10521 {
10523 if (quantity > stackable)
10524 split_quantity_new = stackable;
10525 else
10526 split_quantity_new = quantity;
10527
10529 {
10530 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10531 if (new_item)
10532 {
10533 new_item.SetResultOfSplit(true);
10534 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10536 new_item.
SetQuantity(split_quantity_new,
false,
true);
10537 }
10538 }
10539 }
10540 }
10541
10543 {
10545 {
10546 if (ScriptInputUserData.CanStoreInputUserData())
10547 {
10548 ScriptInputUserData ctx = new ScriptInputUserData;
10553 ItemBase destination_entity =
this;
10554 ctx.
Write(destination_entity);
10558 }
10559 }
10560 else if (!
GetGame().IsMultiplayer())
10561 {
10563 }
10564 }
10565
10567 {
10569 float split_quantity_new;
10571 if (player)
10572 {
10574 if (quantity > stackable)
10575 split_quantity_new = stackable;
10576 else
10577 split_quantity_new = quantity;
10578
10580 {
10581 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10582 new_item =
ItemBase.Cast(in_hands);
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 float split_quantity_new = Math.Floor(quantity * 0.5);
10598
10600 return;
10601
10603
10604 if (new_item)
10605 {
10606 if (new_item.GetQuantityMax() < split_quantity_new)
10607 {
10608 split_quantity_new = new_item.GetQuantityMax();
10609 }
10610
10611 new_item.SetResultOfSplit(true);
10612 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10613
10615 {
10618 }
10619 else
10620 {
10622 new_item.
SetQuantity(split_quantity_new,
false,
true);
10623 }
10624 }
10625 }
10626
10628 {
10630 float split_quantity_new = Math.Floor(quantity / 2);
10631
10633 return;
10634
10635 InventoryLocation invloc = new InventoryLocation;
10637
10639 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10640
10641 if (new_item)
10642 {
10643 if (new_item.GetQuantityMax() < split_quantity_new)
10644 {
10645 split_quantity_new = new_item.GetQuantityMax();
10646 }
10648 {
10651 }
10652 else if (split_quantity_new > 1)
10653 {
10655 new_item.
SetQuantity(split_quantity_new,
false,
true);
10656 }
10657 }
10658 }
10659
10662 {
10663 SetWeightDirty();
10665
10666 if (parent)
10667 parent.OnAttachmentQuantityChangedEx(this, delta);
10668
10670 {
10672 {
10674 }
10676 {
10677 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10679 }
10680 }
10681
10682 }
10683
10686 {
10687
10688 }
10689
10692 {
10694 }
10695
10697 {
10698 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10699
10701 {
10702 if (newLevel == GameConstants.STATE_RUINED)
10703 {
10705 EntityAI parent = GetHierarchyParent();
10706 if (parent && parent.IsFireplace())
10707 {
10708 CargoBase cargo = GetInventory().GetCargo();
10709 if (cargo)
10710 {
10712 {
10714 }
10715 }
10716 }
10717 }
10718
10720 {
10721
10723 return;
10724 }
10725
10726 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10727 {
10729 }
10730 }
10731 }
10732
10733
10735 {
10736 super.OnRightClick();
10737
10739 {
10741 {
10742 if (ScriptInputUserData.CanStoreInputUserData())
10743 {
10744 EntityAI root = GetHierarchyRoot();
10745 Man playerOwner = GetHierarchyRootPlayer();
10746 InventoryLocation dst = new InventoryLocation;
10747
10748
10749 if (!playerOwner && root && root == this)
10750 {
10752 }
10753 else
10754 {
10755
10756 GetInventory().GetCurrentInventoryLocation(dst);
10758 {
10761 {
10763 }
10764 else
10765 {
10767
10768
10769 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10770 {
10772 }
10773 else
10774 {
10775 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10776 }
10777 }
10778 }
10779 }
10780
10781 ScriptInputUserData ctx = new ScriptInputUserData;
10789 }
10790 }
10791 else if (!
GetGame().IsMultiplayer())
10792 {
10794 }
10795 }
10796 }
10797
10799 {
10800 if (root)
10801 {
10802 vector m4[4];
10803 root.GetTransform(m4);
10804 dst.SetGround(this, m4);
10805 }
10806 else
10807 {
10808 GetInventory().GetCurrentInventoryLocation(dst);
10809 }
10810 }
10811
10812 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10813 {
10814
10815 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10816 return false;
10817
10818 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10819 return false;
10820
10821
10823 return false;
10824
10825
10826 Magazine mag = Magazine.Cast(this);
10827 if (mag)
10828 {
10829 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10830 return false;
10831
10832 if (stack_max_limit)
10833 {
10834 Magazine other_mag = Magazine.Cast(other_item);
10835 if (other_item)
10836 {
10837 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10838 return false;
10839 }
10840
10841 }
10842 }
10843 else
10844 {
10845
10847 return false;
10848
10850 return false;
10851 }
10852
10853 PlayerBase player = null;
10854 if (CastTo(player, GetHierarchyRootPlayer()))
10855 {
10856 if (player.GetInventory().HasAttachment(this))
10857 return false;
10858
10859 if (player.IsItemsToDelete())
10860 return false;
10861 }
10862
10863 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10864 return false;
10865
10866 int slotID;
10868 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10869 return false;
10870
10871 return true;
10872 }
10873
10875 {
10877 }
10878
10880 {
10881 return m_IsResultOfSplit;
10882 }
10883
10885 {
10886 m_IsResultOfSplit = value;
10887 }
10888
10890 {
10892 }
10893
10895 {
10896 float other_item_quantity = other_item.GetQuantity();
10897 float this_free_space;
10898
10900
10902
10903 if (other_item_quantity > this_free_space)
10904 {
10905 return this_free_space;
10906 }
10907 else
10908 {
10909 return other_item_quantity;
10910 }
10911 }
10912
10914 {
10916 }
10917
10919 {
10921 return;
10922
10923 if (!IsMagazine() && other_item)
10924 {
10926 if (quantity_used != 0)
10927 {
10928 float hp1 = GetHealth01("","");
10929 float hp2 = other_item.GetHealth01("","");
10930 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10931 hpResult = hpResult / (
GetQuantity() + quantity_used);
10932
10933 hpResult *= GetMaxHealth();
10934 Math.Round(hpResult);
10935 SetHealth("", "Health", hpResult);
10936
10938 other_item.AddQuantity(-quantity_used);
10939 }
10940 }
10942 }
10943
10945 {
10946 #ifdef SERVER
10947 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10948 GetHierarchyParent().IncreaseLifetimeUp();
10949 #endif
10950 };
10951
10953 {
10954 PlayerBase p = PlayerBase.Cast(player);
10955
10956 array<int> recipesIds = p.m_Recipes;
10957 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10958 if (moduleRecipesManager)
10959 {
10960 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10961 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10962 }
10963
10964 for (int i = 0;i < recipesIds.Count(); i++)
10965 {
10966 int key = recipesIds.Get(i);
10967 string recipeName = moduleRecipesManager.GetRecipeName(key);
10969 }
10970 }
10971
10972
10973 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10974 {
10975 super.GetDebugActions(outputList);
10976
10977
10983
10984
10989
10994
10995
10999
11000
11002 {
11006 }
11007
11010
11011
11015
11017
11018 InventoryLocation loc = new InventoryLocation();
11019 GetInventory().GetCurrentInventoryLocation(loc);
11021 {
11022 if (Gizmo_IsSupported())
11025 }
11026
11028 }
11029
11030
11031
11032
11034 {
11035 super.OnAction(action_id, player, ctx);
11036
11038 {
11039 switch (action_id)
11040 {
11043 return true;
11046 return true;
11047 }
11048 }
11049
11051 {
11052 switch (action_id)
11053 {
11055 Delete();
11056 return true;
11057 }
11058 }
11059
11060 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11061 {
11062 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11063 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11064 PlayerBase p = PlayerBase.Cast(player);
11065 if (
EActions.RECIPES_RANGE_START < 1000)
11066 {
11067 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11068 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11069 }
11070 }
11071 #ifndef SERVER
11072 else if (action_id ==
EActions.WATCH_PLAYER)
11073 {
11074 PluginDeveloper.SetDeveloperItemClientEx(player);
11075 }
11076 #endif
11078 {
11079 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11080 {
11081 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11082 OnDebugButtonPressServer(id + 1);
11083 }
11084
11085 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11086 {
11087 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11089 }
11090
11091 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11092 {
11093 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11095 }
11096
11097 else if (action_id ==
EActions.ADD_QUANTITY)
11098 {
11099 if (IsMagazine())
11100 {
11101 Magazine mag = Magazine.Cast(this);
11102 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11103 }
11104 else
11105 {
11107 }
11108
11109 if (m_EM)
11110 {
11111 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11112 }
11113
11114 }
11115
11116 else if (action_id ==
EActions.REMOVE_QUANTITY)
11117 {
11118 if (IsMagazine())
11119 {
11120 Magazine mag2 = Magazine.Cast(this);
11121 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11122 }
11123 else
11124 {
11126 }
11127 if (m_EM)
11128 {
11129 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11130 }
11131
11132 }
11133
11134 else if (action_id ==
EActions.SET_QUANTITY_0)
11135 {
11137
11138 if (m_EM)
11139 {
11140 m_EM.SetEnergy(0);
11141 }
11142 }
11143
11144 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11145 {
11147
11148 if (m_EM)
11149 {
11150 m_EM.SetEnergy(m_EM.GetEnergyMax());
11151 }
11152 }
11153
11154 else if (action_id ==
EActions.ADD_HEALTH)
11155 {
11156 AddHealth("","",GetMaxHealth("","Health")/5);
11157 }
11158 else if (action_id ==
EActions.REMOVE_HEALTH)
11159 {
11160 AddHealth("","",-GetMaxHealth("","Health")/5);
11161 }
11162 else if (action_id ==
EActions.DESTROY_HEALTH)
11163 {
11164 SetHealth01("","",0);
11165 }
11166 else if (action_id ==
EActions.WATCH_ITEM)
11167 {
11169 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11170 #ifdef DEVELOPER
11171 SetDebugDeveloper_item(this);
11172 #endif
11173 }
11174
11175 else if (action_id ==
EActions.ADD_TEMPERATURE)
11176 {
11177 AddTemperature(20);
11178
11179 }
11180
11181 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11182 {
11183 AddTemperature(-20);
11184
11185 }
11186
11187 else if (action_id ==
EActions.FLIP_FROZEN)
11188 {
11189 SetFrozen(!GetIsFrozen());
11190
11191 }
11192
11193 else if (action_id ==
EActions.ADD_WETNESS)
11194 {
11196
11197 }
11198
11199 else if (action_id ==
EActions.REMOVE_WETNESS)
11200 {
11202
11203 }
11204
11205 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11206 {
11209
11210
11211 }
11212
11213 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11214 {
11217 }
11218
11219 else if (action_id ==
EActions.MAKE_SPECIAL)
11220 {
11221 auto debugParams = DebugSpawnParams.WithPlayer(player);
11222 OnDebugSpawnEx(debugParams);
11223 }
11224
11225 }
11226
11227
11228 return false;
11229 }
11230
11231
11232
11233
11237
11240
11241
11242
11244 {
11245 return false;
11246 }
11247
11248
11250 {
11251 return true;
11252 }
11253
11254
11256 {
11257 return true;
11258 }
11259
11260
11261
11263 {
11264 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11266 }
11267
11270 {
11271 return null;
11272 }
11273
11275 {
11276 return false;
11277 }
11278
11280 {
11281 return false;
11282 }
11283
11287
11288
11290 {
11291 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11292 return module_repairing.CanRepair(this, item_repair_kit);
11293 }
11294
11295
11296 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11297 {
11298 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11299 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11300 }
11301
11302
11304 {
11305
11306
11307
11308
11309
11310
11311
11312
11313 return 1;
11314 }
11315
11316
11317
11319 {
11321 }
11322
11323
11324
11326 {
11328 }
11329
11330
11339 {
11340 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11341
11342 if (player)
11343 {
11344 player.MessageStatus(text);
11345 }
11346 }
11347
11348
11357 {
11358 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11359
11360 if (player)
11361 {
11362 player.MessageAction(text);
11363 }
11364 }
11365
11366
11375 {
11376 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11377
11378 if (player)
11379 {
11380 player.MessageFriendly(text);
11381 }
11382 }
11383
11384
11393 {
11394 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11395
11396 if (player)
11397 {
11398 player.MessageImportant(text);
11399 }
11400 }
11401
11403 {
11404 return true;
11405 }
11406
11407
11408 override bool KindOf(
string tag)
11409 {
11410 bool found = false;
11411 string item_name = this.
GetType();
11414
11415 int array_size = item_tag_array.Count();
11416 for (int i = 0; i < array_size; i++)
11417 {
11418 if (item_tag_array.Get(i) == tag)
11419 {
11420 found = true;
11421 break;
11422 }
11423 }
11424 return found;
11425 }
11426
11427
11429 {
11430
11431 super.OnRPC(sender, rpc_type,ctx);
11432
11433
11434 switch (rpc_type)
11435 {
11436 #ifndef SERVER
11437 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11438 Param2<bool, string> p = new Param2<bool, string>(false, "");
11439
11441 return;
11442
11443 bool play = p.param1;
11444 string soundSet = p.param2;
11445
11446 if (play)
11447 {
11449 {
11451 {
11453 }
11454 }
11455 else
11456 {
11458 }
11459 }
11460 else
11461 {
11463 }
11464
11465 break;
11466 #endif
11467
11468 }
11469
11471 {
11473 }
11474 }
11475
11476
11477
11478
11480 {
11481 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11482 return plugin.GetID(
name);
11483 }
11484
11486 {
11487 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11488 return plugin.GetName(id);
11489 }
11490
11493 {
11494
11495
11496 int varFlags;
11497 if (!ctx.
Read(varFlags))
11498 return;
11499
11500 if (varFlags & ItemVariableFlags.FLOAT)
11501 {
11503 }
11504 }
11505
11507 {
11508
11509 super.SerializeNumericalVars(floats_out);
11510
11511
11512
11514 {
11516 }
11517
11519 {
11521 }
11522
11524 {
11526 }
11527
11529 {
11534 }
11535
11537 {
11539 }
11540 }
11541
11543 {
11544
11545 super.DeSerializeNumericalVars(floats);
11546
11547
11548 int index = 0;
11549 int mask = Math.Round(floats.Get(index));
11550
11551 index++;
11552
11554 {
11556 {
11558 }
11559 else
11560 {
11561 float quantity = floats.Get(index);
11562 SetQuantity(quantity,
true,
false,
false,
false);
11563 }
11564 index++;
11565 }
11566
11568 {
11569 float wet = floats.Get(index);
11571 index++;
11572 }
11573
11575 {
11576 int liquidtype = Math.Round(floats.Get(index));
11578 index++;
11579 }
11580
11582 {
11584 index++;
11586 index++;
11588 index++;
11590 index++;
11591 }
11592
11594 {
11595 int cleanness = Math.Round(floats.Get(index));
11597 index++;
11598 }
11599 }
11600
11602 {
11603 super.WriteVarsToCTX(ctx);
11604
11605
11607 {
11609 }
11610
11612 {
11614 }
11615
11617 {
11619 }
11620
11622 {
11623 int r,g,b,a;
11629 }
11630
11632 {
11634 }
11635 }
11636
11638 {
11639 if (!super.ReadVarsFromCTX(ctx,version))
11640 return false;
11641
11642 int intValue;
11643 float value;
11644
11645 if (version < 140)
11646 {
11647 if (!ctx.
Read(intValue))
11648 return false;
11649
11650 m_VariablesMask = intValue;
11651 }
11652
11654 {
11655 if (!ctx.
Read(value))
11656 return false;
11657
11659 {
11661 }
11662 else
11663 {
11665 }
11666 }
11667
11668 if (version < 140)
11669 {
11671 {
11672 if (!ctx.
Read(value))
11673 return false;
11674 SetTemperatureDirect(value);
11675 }
11676 }
11677
11679 {
11680 if (!ctx.
Read(value))
11681 return false;
11683 }
11684
11686 {
11687 if (!ctx.
Read(intValue))
11688 return false;
11690 }
11691
11693 {
11694 int r,g,b,a;
11696 return false;
11698 return false;
11700 return false;
11702 return false;
11703
11705 }
11706
11708 {
11709 if (!ctx.
Read(intValue))
11710 return false;
11712 }
11713
11714 if (version >= 138 && version < 140)
11715 {
11717 {
11718 if (!ctx.
Read(intValue))
11719 return false;
11720 SetFrozen(intValue);
11721 }
11722 }
11723
11724 return true;
11725 }
11726
11727
11729 {
11732 {
11734 }
11735
11736 if (!super.OnStoreLoad(ctx, version))
11737 {
11739 return false;
11740 }
11741
11742 if (version >= 114)
11743 {
11744 bool hasQuickBarIndexSaved;
11745
11746 if (!ctx.
Read(hasQuickBarIndexSaved))
11747 {
11749 return false;
11750 }
11751
11752 if (hasQuickBarIndexSaved)
11753 {
11754 int itmQBIndex;
11755
11756
11757 if (!ctx.
Read(itmQBIndex))
11758 {
11760 return false;
11761 }
11762
11763 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11764 if (itmQBIndex != -1 && parentPlayer)
11765 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11766 }
11767 }
11768 else
11769 {
11770
11771 PlayerBase player;
11772 int itemQBIndex;
11773 if (version ==
int.
MAX)
11774 {
11775 if (!ctx.
Read(itemQBIndex))
11776 {
11778 return false;
11779 }
11780 }
11781 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11782 {
11783
11784 if (!ctx.
Read(itemQBIndex))
11785 {
11787 return false;
11788 }
11789 if (itemQBIndex != -1 && player)
11790 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11791 }
11792 }
11793
11794 if (version < 140)
11795 {
11796
11797 if (!LoadVariables(ctx, version))
11798 {
11800 return false;
11801 }
11802 }
11803
11804
11806 {
11808 return false;
11809 }
11810 if (version >= 132)
11811 {
11813 if (raib)
11814 {
11816 {
11818 return false;
11819 }
11820 }
11821 }
11822
11824 return true;
11825 }
11826
11827
11828
11830 {
11831 super.OnStoreSave(ctx);
11832
11833 PlayerBase player;
11834 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11835 {
11837
11838 int itemQBIndex = -1;
11839 itemQBIndex = player.FindQuickBarEntityIndex(this);
11840 ctx.
Write(itemQBIndex);
11841 }
11842 else
11843 {
11845 }
11846
11848
11850 if (raib)
11851 {
11853 }
11854 }
11855
11856
11858 {
11859 super.AfterStoreLoad();
11860
11862 {
11864 }
11865
11867 {
11870 }
11871 }
11872
11874 {
11875 super.EEOnAfterLoad();
11876
11878 {
11880 }
11881
11884 }
11885
11887 {
11888 return false;
11889 }
11890
11891
11892
11894 {
11896 {
11897 #ifdef PLATFORM_CONSOLE
11898
11900 {
11902 if (menu)
11903 {
11905 }
11906 }
11907 #endif
11908 }
11909
11911 {
11914 }
11915
11917 {
11918 SetWeightDirty();
11920 }
11922 {
11925 }
11926
11928 {
11931 }
11933 {
11936 }
11937
11938 super.OnVariablesSynchronized();
11939 }
11940
11941
11942
11944 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11945 {
11946 if (!IsServerCheck(allow_client))
11947 return false;
11948
11950 return false;
11951
11954
11955 if (value <= (min + 0.001))
11956 value = min;
11957
11958 if (value == min)
11959 {
11960 if (destroy_config)
11961 {
11962 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11963 if (dstr)
11964 {
11966 this.Delete();
11967 return true;
11968 }
11969 }
11970 else if (destroy_forced)
11971 {
11973 this.Delete();
11974 return true;
11975 }
11976
11978 }
11979
11982
11984 {
11986
11987 if (delta)
11989 }
11990
11992
11993 return false;
11994 }
11995
11996
11998 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11999 {
12001 }
12002
12004 {
12007 }
12008
12010 {
12013 }
12014
12016 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12017 {
12018 float value_clamped = Math.Clamp(value, 0, 1);
12020 SetQuantity(result, destroy_config, destroy_forced);
12021 }
12022
12023
12026 {
12028 }
12029
12031 {
12033 }
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12045 {
12046 int slot = -1;
12047 if (GetInventory())
12048 {
12049 InventoryLocation il = new InventoryLocation;
12050 GetInventory().GetCurrentInventoryLocation(il);
12052 }
12053
12055 }
12056
12058 {
12059 float quantity_max = 0;
12060
12062 {
12063 if (attSlotID != -1)
12064 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12065
12066 if (quantity_max <= 0)
12068 }
12069
12070 if (quantity_max <= 0)
12072
12073 return quantity_max;
12074 }
12075
12077 {
12079 }
12080
12082 {
12084 }
12085
12086
12088 {
12090 }
12091
12093 {
12095 }
12096
12098 {
12100 }
12101
12102
12104 {
12105
12106 float weightEx = GetWeightEx();
12107 float special = GetInventoryAndCargoWeight();
12108 return weightEx - special;
12109 }
12110
12111
12113 {
12115 }
12116
12118 {
12120 {
12121 #ifdef DEVELOPER
12122 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12123 {
12124 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12126 }
12127 #endif
12128
12129 return GetQuantity() * GetConfigWeightModified();
12130 }
12131 else if (HasEnergyManager())
12132 {
12133 #ifdef DEVELOPER
12134 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12135 {
12136 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12137 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12138 }
12139 #endif
12140 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12141 }
12142 else
12143 {
12144 #ifdef DEVELOPER
12145 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12146 {
12147 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12148 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12149 }
12150 #endif
12151 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12152 }
12153 }
12154
12157 {
12158 int item_count = 0;
12160
12161 if (GetInventory().GetCargo() != NULL)
12162 {
12163 item_count = GetInventory().GetCargo().GetItemCount();
12164 }
12165
12166 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12167 {
12168 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12169 if (item)
12170 item_count += item.GetNumberOfItems();
12171 }
12172 return item_count;
12173 }
12174
12177 {
12178 float weight = 0;
12179 float wetness = 1;
12180 if (include_wetness)
12183 {
12184 weight = wetness * m_ConfigWeight;
12185 }
12187 {
12188 weight = 1;
12189 }
12190 return weight;
12191 }
12192
12193
12194
12196 {
12197 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12198 {
12199 GameInventory inv = GetInventory();
12200 array<EntityAI> items = new array<EntityAI>;
12202 for (int i = 0; i < items.Count(); i++)
12203 {
12205 if (item)
12206 {
12208 }
12209 }
12210 }
12211 }
12212
12213
12214
12215
12217 {
12218 float energy = 0;
12219 if (HasEnergyManager())
12220 {
12221 energy = GetCompEM().GetEnergy();
12222 }
12223 return energy;
12224 }
12225
12226
12228 {
12229 super.OnEnergyConsumed();
12230
12232 }
12233
12235 {
12236 super.OnEnergyAdded();
12237
12239 }
12240
12241
12243 {
12244 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12245 {
12247 {
12248 float energy_0to1 = GetCompEM().GetEnergy0To1();
12250 }
12251 }
12252 }
12253
12254
12256 {
12257 return ConfigGetFloat("heatIsolation");
12258 }
12259
12261 {
12263 }
12264
12266 {
12267 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12268 if (
GetGame().ConfigIsExisting(paramPath))
12270
12271 return 0.0;
12272 }
12273
12275 {
12276 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12277 if (
GetGame().ConfigIsExisting(paramPath))
12279
12280 return 0.0;
12281 }
12282
12283 override void SetWet(
float value,
bool allow_client =
false)
12284 {
12285 if (!IsServerCheck(allow_client))
12286 return;
12287
12290
12292
12293 m_VarWet = Math.Clamp(value, min, max);
12294
12296 {
12299 }
12300 }
12301
12302 override void AddWet(
float value)
12303 {
12305 }
12306
12308 {
12310 }
12311
12313 {
12315 }
12316
12318 {
12320 }
12321
12323 {
12325 }
12326
12328 {
12330 }
12331
12332 override void OnWetChanged(
float newVal,
float oldVal)
12333 {
12336 if (newLevel != oldLevel)
12337 {
12339 }
12340 }
12341
12343 {
12344 SetWeightDirty();
12345 }
12346
12348 {
12349 return GetWetLevelInternal(
m_VarWet);
12350 }
12351
12352
12353
12355 {
12357 }
12358
12360 {
12362 }
12363
12365 {
12367 }
12368
12370 {
12372 }
12373
12374
12375
12377 {
12378 if (ConfigIsExisting("itemModelLength"))
12379 {
12380 return ConfigGetFloat("itemModelLength");
12381 }
12382 return 0;
12383 }
12384
12386 {
12387 if (ConfigIsExisting("itemAttachOffset"))
12388 {
12389 return ConfigGetFloat("itemAttachOffset");
12390 }
12391 return 0;
12392 }
12393
12394 override void SetCleanness(
int value,
bool allow_client =
false)
12395 {
12396 if (!IsServerCheck(allow_client))
12397 return;
12398
12400
12402
12405 }
12406
12408 {
12410 }
12411
12413 {
12414 return true;
12415 }
12416
12417
12418
12419
12421 {
12423 }
12424
12426 {
12428 }
12429
12430
12431
12432
12433 override void SetColor(
int r,
int g,
int b,
int a)
12434 {
12440 }
12442 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12443 {
12448 }
12449
12451 {
12453 }
12454
12457 {
12458 int r,g,b,a;
12460 r = r/255;
12461 g = g/255;
12462 b = b/255;
12463 a = a/255;
12464 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12465 }
12466
12467
12468
12469 override void SetLiquidType(
int value,
bool allow_client =
false)
12470 {
12471 if (!IsServerCheck(allow_client))
12472 return;
12473
12478 }
12479
12481 {
12482 return ConfigGetInt("varLiquidTypeInit");
12483 }
12484
12486 {
12488 }
12489
12491 {
12493 SetFrozen(false);
12494 }
12495
12498 {
12499 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12500 }
12501
12502
12505 {
12506 PlayerBase nplayer;
12507 if (PlayerBase.CastTo(nplayer, player))
12508 {
12510
12511 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12512 }
12513 }
12514
12515
12518 {
12519 PlayerBase nplayer;
12520 if (PlayerBase.CastTo(nplayer,player))
12521 {
12522
12523 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12524
12525 }
12526
12527
12528 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12529
12530
12531 if (HasEnergyManager())
12532 {
12533 GetCompEM().UpdatePlugState();
12534 }
12535 }
12536
12537
12539 {
12540 super.OnPlacementStarted(player);
12541
12543 }
12544
12545 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12546 {
12548 {
12549 m_AdminLog.OnPlacementComplete(player,
this);
12550 }
12551
12552 super.OnPlacementComplete(player, position, orientation);
12553 }
12554
12555
12556
12557
12558
12560 {
12562 {
12563 return true;
12564 }
12565 else
12566 {
12567 return false;
12568 }
12569 }
12570
12571
12573 {
12575 {
12577 }
12578 }
12579
12580
12582 {
12584 }
12585
12587 {
12589 }
12590
12591 override void InsertAgent(
int agent,
float count = 1)
12592 {
12593 if (count < 1)
12594 return;
12595
12597 }
12598
12601 {
12603 }
12604
12605
12607 {
12609 }
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12653 {
12655 return false;
12656 return true;
12657 }
12658
12660 {
12661
12663 }
12664
12665
12668 {
12669 super.CheckForRoofLimited(timeTresholdMS);
12670
12672 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12673 {
12674 m_PreviousRoofTestTime = time;
12675 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12676 }
12677 }
12678
12679
12681 {
12683 {
12684 return 0;
12685 }
12686
12687 if (GetInventory().GetAttachmentSlotsCount() != 0)
12688 {
12689 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12690 if (filter)
12691 return filter.GetProtectionLevel(type, false, system);
12692 else
12693 return 0;
12694 }
12695
12696 string subclassPath, entryName;
12697
12698 switch (type)
12699 {
12701 entryName = "biological";
12702 break;
12704 entryName = "chemical";
12705 break;
12706 default:
12707 entryName = "biological";
12708 break;
12709 }
12710
12711 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12712
12714 }
12715
12716
12717
12720 {
12721 if (!IsMagazine())
12723
12725 }
12726
12727
12728
12729
12730
12735 {
12736 return true;
12737 }
12738
12740 {
12742 }
12743
12744
12745
12746
12747
12749 {
12750 if (parent)
12751 {
12752 if (parent.IsInherited(DayZInfected))
12753 return true;
12754
12755 if (!parent.IsRuined())
12756 return true;
12757 }
12758
12759 return true;
12760 }
12761
12763 {
12764 if (!super.CanPutAsAttachment(parent))
12765 {
12766 return false;
12767 }
12768
12769 if (!IsRuined() && !parent.IsRuined())
12770 {
12771 return true;
12772 }
12773
12774 return false;
12775 }
12776
12778 {
12779
12780
12781
12782
12783 return super.CanReceiveItemIntoCargo(item);
12784 }
12785
12787 {
12788
12789
12790
12791
12792 GameInventory attachmentInv = attachment.GetInventory();
12794 {
12795 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12796 return false;
12797 }
12798
12799 InventoryLocation loc = new InventoryLocation();
12800 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12801 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12802 return false;
12803
12804 return super.CanReceiveAttachment(attachment, slotId);
12805 }
12806
12808 {
12809 if (!super.CanReleaseAttachment(attachment))
12810 return false;
12811
12812 return GetInventory().AreChildrenAccessible();
12813 }
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12836 {
12837 int id = muzzle_owner.GetMuzzleID();
12838 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12839
12840 if (WPOF_array)
12841 {
12842 for (int i = 0; i < WPOF_array.Count(); i++)
12843 {
12844 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12845
12846 if (WPOF)
12847 {
12848 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12849 }
12850 }
12851 }
12852 }
12853
12854
12856 {
12857 int id = muzzle_owner.GetMuzzleID();
12859
12860 if (WPOBE_array)
12861 {
12862 for (int i = 0; i < WPOBE_array.Count(); i++)
12863 {
12864 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12865
12866 if (WPOBE)
12867 {
12868 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12869 }
12870 }
12871 }
12872 }
12873
12874
12876 {
12877 int id = muzzle_owner.GetMuzzleID();
12878 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12879
12880 if (WPOOH_array)
12881 {
12882 for (int i = 0; i < WPOOH_array.Count(); i++)
12883 {
12884 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12885
12886 if (WPOOH)
12887 {
12888 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12889 }
12890 }
12891 }
12892 }
12893
12894
12896 {
12897 int id = muzzle_owner.GetMuzzleID();
12898 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12899
12900 if (WPOOH_array)
12901 {
12902 for (int i = 0; i < WPOOH_array.Count(); i++)
12903 {
12904 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12905
12906 if (WPOOH)
12907 {
12908 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12909 }
12910 }
12911 }
12912 }
12913
12914
12916 {
12917 int id = muzzle_owner.GetMuzzleID();
12918 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12919
12920 if (WPOOH_array)
12921 {
12922 for (int i = 0; i < WPOOH_array.Count(); i++)
12923 {
12924 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12925
12926 if (WPOOH)
12927 {
12928 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12929 }
12930 }
12931 }
12932 }
12933
12934
12935
12937 {
12939 {
12940 return true;
12941 }
12942
12943 return false;
12944 }
12945
12947 {
12949 {
12950 return true;
12951 }
12952
12953 return false;
12954 }
12955
12957 {
12959 {
12960 return true;
12961 }
12962
12963 return false;
12964 }
12965
12967 {
12968 return false;
12969 }
12970
12973 {
12974 return UATimeSpent.DEFAULT_DEPLOY;
12975 }
12976
12977
12978
12979
12981 {
12983 SetSynchDirty();
12984 }
12985
12987 {
12989 }
12990
12991
12993 {
12994 return false;
12995 }
12996
12999 {
13000 string att_type = "None";
13001
13002 if (ConfigIsExisting("soundAttType"))
13003 {
13004 att_type = ConfigGetString("soundAttType");
13005 }
13006
13008 }
13009
13011 {
13013 }
13014
13015
13016
13017
13018
13024
13026 {
13029
13031 }
13032
13033
13035 {
13037 return;
13038
13040
13043
13046
13047 SoundParameters params = new SoundParameters();
13051 }
13052
13053
13055 {
13057 return;
13058
13060 SetSynchDirty();
13061
13064 }
13065
13066
13068 {
13070 return;
13071
13073 SetSynchDirty();
13074
13077 }
13078
13080 {
13082 }
13083
13085 {
13087 }
13088
13091 {
13092 if (!
GetGame().IsDedicatedServer())
13093 {
13094 if (ConfigIsExisting("attachSoundSet"))
13095 {
13096 string cfg_path = "";
13097 string soundset = "";
13098 string type_name =
GetType();
13099
13102 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13103 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13104
13105 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13106 {
13107 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13108 {
13109 if (cfg_slot_array[i] == slot_type)
13110 {
13111 soundset = cfg_soundset_array[i];
13112 break;
13113 }
13114 }
13115 }
13116
13117 if (soundset != "")
13118 {
13119 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13121 }
13122 }
13123 }
13124 }
13125
13127 {
13128
13129 }
13130
13131 void OnApply(PlayerBase player);
13132
13134 {
13135 return 1.0;
13136 };
13137
13139 {
13141 }
13142
13144 {
13146 }
13147
13149
13151 {
13152 SetDynamicPhysicsLifeTime(0.01);
13154 }
13155
13157 {
13158 array<string> zone_names = new array<string>;
13159 GetDamageZones(zone_names);
13160 for (int i = 0; i < zone_names.Count(); i++)
13161 {
13162 SetHealthMax(zone_names.Get(i),"Health");
13163 }
13164 SetHealthMax("","Health");
13165 }
13166
13169 {
13170 float global_health = GetHealth01("","Health");
13171 array<string> zones = new array<string>;
13172 GetDamageZones(zones);
13173
13174 for (int i = 0; i < zones.Count(); i++)
13175 {
13176 SetHealth01(zones.Get(i),"Health",global_health);
13177 }
13178 }
13179
13182 {
13183 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13184 }
13185
13187 {
13188 if (!hasRootAsPlayer)
13189 {
13190 if (refParentIB)
13191 {
13192
13193 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13194 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13195
13196 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13197 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13198
13201 }
13202 else
13203 {
13204
13207 }
13208 }
13209 }
13210
13212 {
13214 {
13215 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13216 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13217 {
13218 float heatPermCoef = 1.0;
13220 while (ent)
13221 {
13222 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13223 ent = ent.GetHierarchyParent();
13224 }
13225
13226 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13227 }
13228 }
13229 }
13230
13232 {
13233
13234 EntityAI parent = GetHierarchyParent();
13235 if (!parent)
13236 {
13237 hasParent = false;
13238 hasRootAsPlayer = false;
13239 }
13240 else
13241 {
13242 hasParent = true;
13243 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13244 refParentIB =
ItemBase.Cast(parent);
13245 }
13246 }
13247
13248 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13249 {
13250
13251 }
13252
13254 {
13255
13256 return false;
13257 }
13258
13260 {
13261
13262
13263 return false;
13264 }
13265
13267 {
13268
13269 return false;
13270 }
13271
13274 {
13275 return !GetIsFrozen() &&
IsOpen();
13276 }
13277
13279 {
13280 bool hasParent = false, hasRootAsPlayer = false;
13282
13283 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13284 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13285
13286 if (wwtu || foodDecay)
13287 {
13291
13292 if (processWetness || processTemperature || processDecay)
13293 {
13295
13296 if (processWetness)
13297 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13298
13299 if (processTemperature)
13301
13302 if (processDecay)
13303 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13304 }
13305 }
13306 }
13307
13310 {
13312 }
13313
13315 {
13318
13319 return super.GetTemperatureFreezeThreshold();
13320 }
13321
13323 {
13326
13327 return super.GetTemperatureThawThreshold();
13328 }
13329
13331 {
13334
13335 return super.GetItemOverheatThreshold();
13336 }
13337
13339 {
13341 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13342
13343 return super.GetTemperatureFreezeTime();
13344 }
13345
13347 {
13349 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13350
13351 return super.GetTemperatureThawTime();
13352 }
13353
13358
13360 {
13361 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13362 }
13363
13365 {
13366 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13367 }
13368
13371 {
13373 }
13374
13376 {
13378 }
13379
13381 {
13383 }
13384
13387 {
13388 return null;
13389 }
13390
13393 {
13394 return false;
13395 }
13396
13398 {
13400 {
13403 if (!trg)
13404 {
13406 explosive = this;
13407 }
13408
13409 explosive.PairRemote(trg);
13411
13412 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13413 trg.SetPersistentPairID(persistentID);
13414 explosive.SetPersistentPairID(persistentID);
13415
13416 return true;
13417 }
13418 return false;
13419 }
13420
13423 {
13424 float ret = 1.0;
13427 ret *= GetHealth01();
13428
13429 return ret;
13430 }
13431
13432 #ifdef DEVELOPER
13433 override void SetDebugItem()
13434 {
13435 super.SetDebugItem();
13436 _itemBase = this;
13437 }
13438
13440 {
13441 string text = super.GetDebugText();
13442
13444 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13445
13446 return text;
13447 }
13448 #endif
13449
13451 {
13452 return true;
13453 }
13454
13456
13458
13460 {
13463 }
13464
13465
13473
13489}
13490
13492{
13494 if (entity)
13495 {
13496 bool is_item = entity.IsInherited(
ItemBase);
13497 if (is_item && full_quantity)
13498 {
13501 }
13502 }
13503 else
13504 {
13506 return NULL;
13507 }
13508 return entity;
13509}
13510
13512{
13513 if (item)
13514 {
13515 if (health > 0)
13516 item.SetHealth("", "", health);
13517
13518 if (item.CanHaveTemperature())
13519 {
13521 if (item.CanFreeze())
13522 item.SetFrozen(false);
13523 }
13524
13525 if (item.HasEnergyManager())
13526 {
13527 if (quantity >= 0)
13528 {
13529 item.GetCompEM().SetEnergy0To1(quantity);
13530 }
13531 else
13532 {
13534 }
13535 }
13536 else if (item.IsMagazine())
13537 {
13538 Magazine mag = Magazine.Cast(item);
13539 if (quantity >= 0)
13540 {
13541 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13542 }
13543 else
13544 {
13546 }
13547
13548 }
13549 else
13550 {
13551 if (quantity >= 0)
13552 {
13553 item.SetQuantityNormalized(quantity, false);
13554 }
13555 else
13556 {
13558 }
13559
13560 }
13561 }
13562}
13563
13564#ifdef DEVELOPER
13566#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.