8556{
8558 {
8559 return true;
8560 }
8561};
8562
8563
8564
8566{
8570
8572
8575
8576
8577
8578
8579
8588
8594
8599
8604
8625 protected bool m_IsResultOfSplit
8626
8628
8633
8634
8635
8637
8641
8642
8643
8645
8648
8649
8650
8656
8657
8665
8668
8669
8671
8672
8674
8675
8680
8681
8686
8687
8689
8690
8692 {
8697
8698 if (!
GetGame().IsDedicatedServer())
8699 {
8701 {
8703
8705 {
8707 }
8708 }
8709
8712 }
8713
8714 m_OldLocation = null;
8715
8717 {
8719 }
8720
8721 if (ConfigIsExisting("headSelectionsToHide"))
8722 {
8725 }
8726
8728 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8729 {
8731 }
8732
8734
8735 m_IsResultOfSplit = false;
8736
8738 }
8739
8741 {
8742 super.InitItemVariables();
8743
8749 m_Count = ConfigGetInt(
"count");
8750
8753
8758
8761
8766
8778
8782
8783
8786 if (ConfigIsExisting("canBeSplit"))
8787 {
8790 }
8791
8793 if (ConfigIsExisting("itemBehaviour"))
8795
8796
8799 RegisterNetSyncVariableInt("m_VarLiquidType");
8800 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8801
8802 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8803 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8804 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8805
8806 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8807 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8808 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8809 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8810
8811 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8812 RegisterNetSyncVariableBool("m_IsTakeable");
8813 RegisterNetSyncVariableBool("m_IsHologram");
8814
8817 {
8820 }
8821
8823
8825 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8827
8828 }
8829
8831 {
8833 }
8834
8836 {
8839 {
8844 }
8845 }
8846
8847 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8848 {
8850 {
8853 }
8854
8856 }
8857
8859 {
8865 }
8866
8868
8870 {
8872
8873 if (!action)
8874 {
8875 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8876 return;
8877 }
8878
8880 if (!ai)
8881 {
8883 return;
8884 }
8885
8887 if (!action_array)
8888 {
8889 action_array = new array<ActionBase_Basic>;
8891 }
8892 if (LogManager.IsActionLogEnable())
8893 {
8894 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8895 }
8896
8897 if (action_array.Find(action) != -1)
8898 {
8899 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8900 }
8901 else
8902 {
8903 action_array.Insert(action);
8904 }
8905 }
8906
8908 {
8910 ActionBase action = player.GetActionManager().GetAction(actionName);
8913
8914 if (action_array)
8915 {
8916 action_array.RemoveItem(action);
8917 }
8918 }
8919
8920
8921
8923 {
8924 ActionOverrideData overrideData = new ActionOverrideData();
8928
8930 if (!actionMap)
8931 {
8934 }
8935
8936 actionMap.Insert(this.
Type(), overrideData);
8937
8938 }
8939
8941
8943
8944
8946 {
8949
8952
8953 string config_to_search = "CfgVehicles";
8954 string muzzle_owner_config;
8955
8957 {
8958 if (IsInherited(Weapon))
8959 config_to_search = "CfgWeapons";
8960
8961 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8962
8963 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8964
8966
8967 if (config_OnFire_subclass_count > 0)
8968 {
8969 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8970
8971 for (int i = 0; i < config_OnFire_subclass_count; i++)
8972 {
8973 string particle_class = "";
8975 string config_OnFire_entry = config_OnFire_class + particle_class;
8976 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8977 WPOF_array.Insert(WPOF);
8978 }
8979
8980
8982 }
8983 }
8984
8986 {
8987 config_to_search = "CfgWeapons";
8988 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8989
8990 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8991
8993
8994 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8995 {
8996 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8997
8998 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8999 {
9000 string particle_class2 = "";
9002 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9003 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9004 WPOBE_array.Insert(WPOBE);
9005 }
9006
9007
9009 }
9010 }
9011 }
9012
9013
9015 {
9018
9020 {
9021 string config_to_search = "CfgVehicles";
9022
9023 if (IsInherited(Weapon))
9024 config_to_search = "CfgWeapons";
9025
9026 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9027 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9028
9029 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9030 {
9031
9033
9035 {
9037 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9039 return;
9040 }
9041
9044
9045
9046
9048 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9049
9050 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9051 {
9052 string particle_class = "";
9054 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9056
9057 if (entry_type == CT_CLASS)
9058 {
9059 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9060 WPOOH_array.Insert(WPOF);
9061 }
9062 }
9063
9064
9066 }
9067 }
9068 }
9069
9071 {
9073 }
9074
9076 {
9078 {
9080
9083
9086
9087 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9088 }
9089 }
9090
9092 {
9094 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9095
9097 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9098
9100 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9101
9103 {
9105 }
9106 }
9107
9109 {
9111 }
9112
9114 {
9117 else
9119
9121 {
9124 }
9125 else
9126 {
9129
9132 }
9133
9135 }
9136
9138 {
9140 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9141 }
9142
9144 {
9146 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9148 }
9149
9151 {
9153 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9154 }
9155
9157 {
9160
9161 OverheatingParticle OP = new OverheatingParticle();
9166
9168 }
9169
9171 {
9174
9175 return -1;
9176 }
9177
9179 {
9181 {
9184
9185 for (int i = count; i > 0; --i)
9186 {
9187 int id = i - 1;
9190
9193
9194 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9195 {
9196 if (p)
9197 {
9200 }
9201 }
9202 }
9203 }
9204 }
9205
9207 {
9209 {
9211 {
9212 int id = i - 1;
9214
9215 if (OP)
9216 {
9218
9219 if (p)
9220 {
9222 }
9223
9224 delete OP;
9225 }
9226 }
9227
9230 }
9231 }
9232
9235 {
9236 return 0.0;
9237 }
9238
9239
9241 {
9242 return 250;
9243 }
9244
9246 {
9247 return 0;
9248 }
9249
9252 {
9254 return true;
9255
9256 return false;
9257 }
9258
9261 {
9264
9266 {
9268 }
9269 else
9270 {
9271
9273 }
9274
9276 }
9277
9284 {
9285 return -1;
9286 }
9287
9288
9289
9290
9292 {
9294 {
9296 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9297
9298 if (r_index >= 0)
9299 {
9300 InventoryLocation r_il = new InventoryLocation;
9301 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9302
9303 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9306 {
9307 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9308 }
9310 {
9311 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9312 }
9313
9314 }
9315
9316 player.GetHumanInventory().ClearUserReservedLocation(this);
9317 }
9318
9321 }
9322
9323
9324
9325
9327 {
9328 return ItemBase.m_DebugActionsMask;
9329 }
9330
9332 {
9333 return ItemBase.m_DebugActionsMask & mask;
9334 }
9335
9337 {
9338 ItemBase.m_DebugActionsMask = mask;
9339 }
9340
9342 {
9343 ItemBase.m_DebugActionsMask |= mask;
9344 }
9345
9347 {
9348 ItemBase.m_DebugActionsMask &= ~mask;
9349 }
9350
9352 {
9354 {
9356 }
9357 else
9358 {
9360 }
9361 }
9362
9363
9365 {
9366 if (GetEconomyProfile())
9367 {
9368 float q_max = GetEconomyProfile().GetQuantityMax();
9369 if (q_max > 0)
9370 {
9371 float q_min = GetEconomyProfile().GetQuantityMin();
9372 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9373
9375 {
9376 ComponentEnergyManager comp = GetCompEM();
9378 {
9380 }
9381 }
9383 {
9385
9386 }
9387
9388 }
9389 }
9390 }
9391
9394 {
9395 EntityAI parent = GetHierarchyParent();
9396
9397 if (parent)
9398 {
9399 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9400 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9401 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9402 }
9403 }
9404
9407 {
9408 EntityAI parent = GetHierarchyParent();
9409
9410 if (parent)
9411 {
9412 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9413 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9414 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9415 }
9416 }
9417
9419 {
9420
9421
9422
9423
9425
9427 {
9428 if (ScriptInputUserData.CanStoreInputUserData())
9429 {
9430 ScriptInputUserData ctx = new ScriptInputUserData;
9436 ctx.
Write(use_stack_max);
9439
9441 {
9442 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9443 }
9444 }
9445 }
9446 else if (!
GetGame().IsMultiplayer())
9447 {
9449 }
9450 }
9451
9453 {
9455 }
9456
9458 {
9460 }
9461
9463 {
9465 }
9466
9468 {
9469
9470 return false;
9471 }
9472
9474 {
9475 return false;
9476 }
9477
9481 {
9482 return false;
9483 }
9484
9486 {
9487 return "";
9488 }
9489
9491
9493 {
9494 return false;
9495 }
9496
9498 {
9499 return true;
9500 }
9501
9502
9503
9505 {
9506 return true;
9507 }
9508
9510 {
9511 return true;
9512 }
9513
9515 {
9516 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9518 }
9519
9521 {
9523 }
9524
9526 {
9528 if (!is_being_placed)
9530 SetSynchDirty();
9531 }
9532
9533
9535
9537 {
9539 }
9540
9542 {
9544 }
9545
9547 {
9548 return 1;
9549 }
9550
9552 {
9553 return false;
9554 }
9555
9557 {
9559 SetSynchDirty();
9560 }
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9597 {
9598 super.OnMovedInsideCargo(container);
9599
9600 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9601 }
9602
9603 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9604 {
9605 super.EEItemLocationChanged(oldLoc,newLoc);
9606
9607 PlayerBase new_player = null;
9608 PlayerBase old_player = null;
9609
9610 if (newLoc.GetParent())
9611 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9612
9613 if (oldLoc.GetParent())
9614 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9615
9617 {
9618 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9619
9620 if (r_index >= 0)
9621 {
9622 InventoryLocation r_il = new InventoryLocation;
9623 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9624
9625 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9628 {
9629 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9630 }
9632 {
9633 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9634 }
9635
9636 }
9637 }
9638
9640 {
9641 if (new_player)
9642 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9643
9644 if (new_player == old_player)
9645 {
9646
9647 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9648 {
9650 {
9651 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9652 {
9653 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9654 }
9655 }
9656 else
9657 {
9658 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9659 }
9660 }
9661
9662 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9663 {
9664 int type = oldLoc.GetType();
9666 {
9667 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9668 }
9670 {
9671 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9672 }
9673 }
9674 if (!m_OldLocation)
9675 {
9676 m_OldLocation = new InventoryLocation;
9677 }
9678 m_OldLocation.Copy(oldLoc);
9679 }
9680 else
9681 {
9682 if (m_OldLocation)
9683 {
9684 m_OldLocation.Reset();
9685 }
9686 }
9687
9689 }
9690 else
9691 {
9692 if (new_player)
9693 {
9694 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9695 if (res_index >= 0)
9696 {
9697 InventoryLocation il = new InventoryLocation;
9698 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9700 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9703 {
9704 il.
GetParent().GetOnReleaseLock().Invoke(it);
9705 }
9707 {
9709 }
9710
9711 }
9712 }
9714 {
9715
9717 }
9718
9719 if (m_OldLocation)
9720 {
9721 m_OldLocation.Reset();
9722 }
9723 }
9724 }
9725
9726 override void EOnContact(IEntity other, Contact extra)
9727 {
9729 {
9730 int liquidType = -1;
9732 if (impactSpeed > 0.0)
9733 {
9735 #ifndef SERVER
9737 #else
9739 SetSynchDirty();
9740 #endif
9742 }
9743 }
9744
9745 #ifdef SERVER
9746 if (GetCompEM() && GetCompEM().IsPlugged())
9747 {
9748 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9749 GetCompEM().UnplugThis();
9750 }
9751 #endif
9752 }
9753
9755
9757 {
9759 }
9760
9762 {
9763
9764 }
9765
9767 {
9768 super.OnItemLocationChanged(old_owner, new_owner);
9769
9770 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9771 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9772
9773 if (!relatedPlayer && playerNew)
9774 relatedPlayer = playerNew;
9775
9776 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9777 {
9779 if (actionMgr)
9780 {
9781 ActionBase currentAction = actionMgr.GetRunningAction();
9782 if (currentAction)
9784 }
9785 }
9786
9787 Man ownerPlayerOld = null;
9788 Man ownerPlayerNew = null;
9789
9790 if (old_owner)
9791 {
9792 if (old_owner.
IsMan())
9793 {
9794 ownerPlayerOld = Man.Cast(old_owner);
9795 }
9796 else
9797 {
9798 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9799 }
9800 }
9801 else
9802 {
9804 {
9806
9807 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9808 {
9809 GetCompEM().UnplugThis();
9810 }
9811 }
9812 }
9813
9814 if (new_owner)
9815 {
9816 if (new_owner.
IsMan())
9817 {
9818 ownerPlayerNew = Man.Cast(new_owner);
9819 }
9820 else
9821 {
9822 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9823 }
9824 }
9825
9826 if (ownerPlayerOld != ownerPlayerNew)
9827 {
9828 if (ownerPlayerOld)
9829 {
9830 array<EntityAI> subItemsExit = new array<EntityAI>;
9832 for (int i = 0; i < subItemsExit.Count(); i++)
9833 {
9836 }
9837 }
9838
9839 if (ownerPlayerNew)
9840 {
9841 array<EntityAI> subItemsEnter = new array<EntityAI>;
9843 for (int j = 0; j < subItemsEnter.Count(); j++)
9844 {
9847 }
9848 }
9849 }
9850 else if (ownerPlayerNew != null)
9851 {
9852 PlayerBase nplayer;
9853 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9854 {
9855 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9857 for (int k = 0; k < subItemsUpdate.Count(); k++)
9858 {
9860 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9861 }
9862 }
9863 }
9864
9865 if (old_owner)
9866 old_owner.OnChildItemRemoved(this);
9867 if (new_owner)
9868 new_owner.OnChildItemReceived(this);
9869 }
9870
9871
9873 {
9874 super.EEDelete(parent);
9875 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9876 if (player)
9877 {
9879
9880 if (player.IsAlive())
9881 {
9882 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9883 if (r_index >= 0)
9884 {
9885 InventoryLocation r_il = new InventoryLocation;
9886 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9887
9888 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9891 {
9892 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9893 }
9895 {
9896 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9897 }
9898
9899 }
9900
9901 player.RemoveQuickBarEntityShortcut(this);
9902 }
9903 }
9904 }
9905
9907 {
9908 super.EEKilled(killer);
9909
9912 {
9913 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9914 {
9915 if (IsMagazine())
9916 {
9917 if (Magazine.Cast(this).GetAmmoCount() > 0)
9918 {
9920 }
9921 }
9922 else
9923 {
9925 }
9926 }
9927 }
9928 }
9929
9931 {
9932 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9933
9934 super.OnWasAttached(parent, slot_id);
9935
9938
9940 }
9941
9943 {
9944 super.OnWasDetached(parent, slot_id);
9945
9948 }
9949
9951 {
9952 int idx;
9955
9956 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9957 if (inventory_slots.Count() < 1)
9958 {
9959 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9960 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9961 }
9962 else
9963 {
9964 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9965 }
9966
9967 idx = inventory_slots.Find(slot);
9968 if (idx < 0)
9969 return "";
9970
9971 return attach_types.Get(idx);
9972 }
9973
9975 {
9976 int idx = -1;
9977 string slot;
9978
9981
9982 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9983 if (inventory_slots.Count() < 1)
9984 {
9985 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9986 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9987 }
9988 else
9989 {
9990 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9991 if (detach_types.Count() < 1)
9992 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9993 }
9994
9995 for (int i = 0; i < inventory_slots.Count(); i++)
9996 {
9997 slot = inventory_slots.Get(i);
9998 }
9999
10000 if (slot != "")
10001 {
10002 if (detach_types.Count() == 1)
10003 idx = 0;
10004 else
10005 idx = inventory_slots.Find(slot);
10006 }
10007 if (idx < 0)
10008 return "";
10009
10010 return detach_types.Get(idx);
10011 }
10012
10014 {
10015
10017
10018
10019 float min_time = 1;
10020 float max_time = 3;
10021 float delay = Math.RandomFloat(min_time, max_time);
10022
10023 explode_timer.Run(delay, this, "DoAmmoExplosion");
10024 }
10025
10027 {
10028 Magazine magazine = Magazine.Cast(this);
10029 int pop_sounds_count = 6;
10030 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10031
10032
10033 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10034 string sound_name = pop_sounds[ sound_idx ];
10036
10037
10038 magazine.ServerAddAmmoCount(-1);
10039
10040
10041 float min_temp_to_explode = 100;
10042
10043 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10044 {
10046 }
10047 }
10048
10049
10050 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10051 {
10052 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10053
10054 const int CHANCE_DAMAGE_CARGO = 4;
10055 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10056 const int CHANCE_DAMAGE_NOTHING = 2;
10057
10059 {
10060 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10061 int chances;
10062 int rnd;
10063
10064 if (GetInventory().GetCargo())
10065 {
10066 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10067 rnd = Math.RandomInt(0,chances);
10068
10069 if (rnd < CHANCE_DAMAGE_CARGO)
10070 {
10072 }
10073 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10074 {
10076 }
10077 }
10078 else
10079 {
10080 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10081 rnd = Math.RandomInt(0,chances);
10082
10083 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10084 {
10086 }
10087 }
10088 }
10089 }
10090
10092 {
10093 if (GetInventory().GetCargo())
10094 {
10095 int item_count = GetInventory().GetCargo().GetItemCount();
10096 if (item_count > 0)
10097 {
10098 int random_pick = Math.RandomInt(0, item_count);
10100 if (!item.IsExplosive())
10101 {
10102 item.AddHealth("","",damage);
10103 return true;
10104 }
10105 }
10106 }
10107 return false;
10108 }
10109
10111 {
10112 int attachment_count = GetInventory().AttachmentCount();
10113 if (attachment_count > 0)
10114 {
10115 int random_pick = Math.RandomInt(0, attachment_count);
10116 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10117 if (!attachment.IsExplosive())
10118 {
10119 attachment.AddHealth("","",damage);
10120 return true;
10121 }
10122 }
10123 return false;
10124 }
10125
10127 {
10129 }
10130
10132 {
10134 return GetInventory().CanRemoveEntity();
10135
10136 return false;
10137 }
10138
10140 {
10142 return;
10143
10145 {
10146 if (ScriptInputUserData.CanStoreInputUserData())
10147 {
10148 ScriptInputUserData ctx = new ScriptInputUserData;
10153 ctx.
Write(destination_entity);
10155 ctx.
Write(slot_id);
10157 }
10158 }
10159 else if (!
GetGame().IsMultiplayer())
10160 {
10162 }
10163 }
10164
10166 {
10168 return;
10169
10170 float split_quantity_new;
10174 InventoryLocation loc = new InventoryLocation;
10175
10176 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10177 {
10179 split_quantity_new = stack_max;
10180 else
10182
10183 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10184 if (new_item)
10185 {
10186 new_item.SetResultOfSplit(true);
10187 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10189 new_item.SetQuantity(split_quantity_new);
10190 }
10191 }
10192 else if (destination_entity && slot_id == -1)
10193 {
10194 if (quantity > stack_max)
10195 split_quantity_new = stack_max;
10196 else
10197 split_quantity_new = quantity;
10198
10200 {
10203 }
10204
10205 if (new_item)
10206 {
10207 new_item.SetResultOfSplit(true);
10208 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10210 new_item.SetQuantity(split_quantity_new);
10211 }
10212 }
10213 else
10214 {
10215 if (stack_max != 0)
10216 {
10218 {
10220 }
10221
10222 if (split_quantity_new == 0)
10223 {
10224 if (!
GetGame().IsMultiplayer())
10225 player.PhysicalPredictiveDropItem(this);
10226 else
10227 player.ServerDropEntity(this);
10228 return;
10229 }
10230
10232
10233 if (new_item)
10234 {
10235 new_item.SetResultOfSplit(true);
10236 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10238 new_item.SetQuantity(stack_max);
10239 new_item.PlaceOnSurface();
10240 }
10241 }
10242 }
10243 }
10244
10246 {
10248 return;
10249
10250 float split_quantity_new;
10254 InventoryLocation loc = new InventoryLocation;
10255
10256 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10257 {
10259 split_quantity_new = stack_max;
10260 else
10262
10263 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10264 if (new_item)
10265 {
10266 new_item.SetResultOfSplit(true);
10267 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10269 new_item.SetQuantity(split_quantity_new);
10270 }
10271 }
10272 else if (destination_entity && slot_id == -1)
10273 {
10274 if (quantity > stack_max)
10275 split_quantity_new = stack_max;
10276 else
10277 split_quantity_new = quantity;
10278
10280 {
10283 }
10284
10285 if (new_item)
10286 {
10287 new_item.SetResultOfSplit(true);
10288 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10290 new_item.SetQuantity(split_quantity_new);
10291 }
10292 }
10293 else
10294 {
10295 if (stack_max != 0)
10296 {
10298 {
10300 }
10301
10303
10304 if (new_item)
10305 {
10306 new_item.SetResultOfSplit(true);
10307 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10309 new_item.SetQuantity(stack_max);
10310 new_item.PlaceOnSurface();
10311 }
10312 }
10313 }
10314 }
10315
10317 {
10319 return;
10320
10322 {
10323 if (ScriptInputUserData.CanStoreInputUserData())
10324 {
10325 ScriptInputUserData ctx = new ScriptInputUserData;
10330 dst.WriteToContext(ctx);
10332 }
10333 }
10334 else if (!
GetGame().IsMultiplayer())
10335 {
10337 }
10338 }
10339
10341 {
10343 return;
10344
10346 {
10347 if (ScriptInputUserData.CanStoreInputUserData())
10348 {
10349 ScriptInputUserData ctx = new ScriptInputUserData;
10354 ctx.
Write(destination_entity);
10360 }
10361 }
10362 else if (!
GetGame().IsMultiplayer())
10363 {
10365 }
10366 }
10367
10369 {
10371 }
10372
10374 {
10376 return this;
10377
10379 float split_quantity_new;
10381 if (dst.IsValid())
10382 {
10383 int slot_id = dst.GetSlot();
10385
10386 if (quantity > stack_max)
10387 split_quantity_new = stack_max;
10388 else
10389 split_quantity_new = quantity;
10390
10392
10393 if (new_item)
10394 {
10395 new_item.SetResultOfSplit(true);
10396 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10399 }
10400
10401 return new_item;
10402 }
10403
10404 return null;
10405 }
10406
10408 {
10410 return;
10411
10413 float split_quantity_new;
10415 if (destination_entity)
10416 {
10418 if (quantity > stackable)
10419 split_quantity_new = stackable;
10420 else
10421 split_quantity_new = quantity;
10422
10423 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10424 if (new_item)
10425 {
10426 new_item.SetResultOfSplit(true);
10427 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10429 new_item.SetQuantity(split_quantity_new);
10430 }
10431 }
10432 }
10433
10435 {
10437 return;
10438
10440 {
10441 if (ScriptInputUserData.CanStoreInputUserData())
10442 {
10443 ScriptInputUserData ctx = new ScriptInputUserData;
10448 ItemBase destination_entity =
this;
10449 ctx.
Write(destination_entity);
10453 }
10454 }
10455 else if (!
GetGame().IsMultiplayer())
10456 {
10458 }
10459 }
10460
10462 {
10464 return;
10465
10467 float split_quantity_new;
10469 if (player)
10470 {
10472 if (quantity > stackable)
10473 split_quantity_new = stackable;
10474 else
10475 split_quantity_new = quantity;
10476
10477 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10478 new_item =
ItemBase.Cast(in_hands);
10479 if (new_item)
10480 {
10481 new_item.SetResultOfSplit(true);
10482 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10484 new_item.SetQuantity(split_quantity_new);
10485 }
10486 }
10487 }
10488
10490 {
10492 return;
10493
10495 float split_quantity_new = Math.Floor(quantity * 0.5);
10496
10498
10499 if (new_item)
10500 {
10501 if (new_item.GetQuantityMax() < split_quantity_new)
10502 {
10503 split_quantity_new = new_item.GetQuantityMax();
10504 }
10505
10506 new_item.SetResultOfSplit(true);
10507 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10508
10510 {
10513 }
10514 else
10515 {
10518 }
10519 }
10520 }
10521
10523 {
10525 return;
10526
10528 float split_quantity_new = Math.Floor(quantity / 2);
10529
10530 InventoryLocation invloc = new InventoryLocation;
10532
10534 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10535
10536 if (new_item)
10537 {
10538 if (new_item.GetQuantityMax() < split_quantity_new)
10539 {
10540 split_quantity_new = new_item.GetQuantityMax();
10541 }
10543 {
10546 }
10547 else
10548 {
10551 }
10552 }
10553 }
10554
10557 {
10558 SetWeightDirty();
10560
10561 if (parent)
10562 parent.OnAttachmentQuantityChangedEx(this, delta);
10563
10565 {
10567 {
10569 }
10571 {
10572 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10574 }
10575 }
10576
10577 }
10578
10581 {
10582
10583 }
10584
10587 {
10589 }
10590
10592 {
10593 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10594
10596 {
10597 if (newLevel == GameConstants.STATE_RUINED)
10598 {
10600 EntityAI parent = GetHierarchyParent();
10601 if (parent && parent.IsFireplace())
10602 {
10603 CargoBase cargo = GetInventory().GetCargo();
10604 if (cargo)
10605 {
10607 {
10609 }
10610 }
10611 }
10612 }
10613
10615 {
10616
10618 return;
10619 }
10620
10621 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10622 {
10624 }
10625 }
10626 }
10627
10628
10630 {
10631 super.OnRightClick();
10632
10634 {
10636 {
10637 if (ScriptInputUserData.CanStoreInputUserData())
10638 {
10639 vector m4[4];
10641
10642 EntityAI root = GetHierarchyRoot();
10643
10644 InventoryLocation dst = new InventoryLocation;
10646 {
10647 if (root)
10648 {
10649 root.GetTransform(m4);
10651 }
10652 else
10653 GetInventory().GetCurrentInventoryLocation(dst);
10654 }
10655 else
10656 {
10658
10659
10660 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10661 {
10662 if (root)
10663 {
10664 root.GetTransform(m4);
10666 }
10667 else
10668 GetInventory().GetCurrentInventoryLocation(dst);
10669 }
10670 else
10671 {
10672 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10673 }
10674 }
10675
10676 ScriptInputUserData ctx = new ScriptInputUserData;
10684 }
10685 }
10686 else if (!
GetGame().IsMultiplayer())
10687 {
10689 }
10690 }
10691 }
10692
10693 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10694 {
10695
10696 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10697 return false;
10698
10699 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10700 return false;
10701
10702
10704 return false;
10705
10706
10707 Magazine mag = Magazine.Cast(this);
10708 if (mag)
10709 {
10710 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10711 return false;
10712
10713 if (stack_max_limit)
10714 {
10715 Magazine other_mag = Magazine.Cast(other_item);
10716 if (other_item)
10717 {
10718 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10719 return false;
10720 }
10721
10722 }
10723 }
10724 else
10725 {
10726
10728 return false;
10729
10731 return false;
10732 }
10733
10734 PlayerBase player = null;
10735 if (CastTo(player, GetHierarchyRootPlayer()))
10736 {
10737 if (player.GetInventory().HasAttachment(this))
10738 return false;
10739
10740 if (player.IsItemsToDelete())
10741 return false;
10742 }
10743
10744 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10745 return false;
10746
10747 int slotID;
10749 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10750 return false;
10751
10752 return true;
10753 }
10754
10756 {
10758 }
10759
10761 {
10762 return m_IsResultOfSplit;
10763 }
10764
10766 {
10767 m_IsResultOfSplit = value;
10768 }
10769
10771 {
10773 }
10774
10776 {
10777 float other_item_quantity = other_item.GetQuantity();
10778 float this_free_space;
10779
10781
10783
10784 if (other_item_quantity > this_free_space)
10785 {
10786 return this_free_space;
10787 }
10788 else
10789 {
10790 return other_item_quantity;
10791 }
10792 }
10793
10795 {
10797 }
10798
10800 {
10802 return;
10803
10804 if (!IsMagazine() && other_item)
10805 {
10807 if (quantity_used != 0)
10808 {
10809 float hp1 = GetHealth01("","");
10810 float hp2 = other_item.GetHealth01("","");
10811 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10812 hpResult = hpResult / (
GetQuantity() + quantity_used);
10813
10814 hpResult *= GetMaxHealth();
10815 Math.Round(hpResult);
10816 SetHealth("", "Health", hpResult);
10817
10819 other_item.AddQuantity(-quantity_used);
10820 }
10821 }
10823 }
10824
10826 {
10827 #ifdef SERVER
10828 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10829 GetHierarchyParent().IncreaseLifetimeUp();
10830 #endif
10831 };
10832
10834 {
10835 PlayerBase p = PlayerBase.Cast(player);
10836
10837 array<int> recipesIds = p.m_Recipes;
10838 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10839 if (moduleRecipesManager)
10840 {
10841 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10842 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10843 }
10844
10845 for (int i = 0;i < recipesIds.Count(); i++)
10846 {
10847 int key = recipesIds.Get(i);
10848 string recipeName = moduleRecipesManager.GetRecipeName(key);
10850 }
10851 }
10852
10853
10854 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10855 {
10856 super.GetDebugActions(outputList);
10857
10858
10863
10864
10868
10872
10873
10876
10877
10879 {
10882 }
10883
10885
10888
10892 }
10893
10894
10895
10896
10898 {
10899 super.OnAction(action_id, player, ctx);
10900 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10901 {
10902 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10903 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10904 PlayerBase p = PlayerBase.Cast(player);
10905 if (
EActions.RECIPES_RANGE_START < 1000)
10906 {
10907 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10908 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10909 }
10910 }
10911 #ifndef SERVER
10912 else if (action_id ==
EActions.WATCH_PLAYER)
10913 {
10914 PluginDeveloper.SetDeveloperItemClientEx(player);
10915 }
10916 #endif
10918 {
10919 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10920 {
10921 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10922 OnDebugButtonPressServer(id + 1);
10923 }
10924
10925 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10926 {
10927 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10929 }
10930
10931 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10932 {
10933 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10935 }
10936
10937 else if (action_id ==
EActions.ADD_QUANTITY)
10938 {
10939 if (IsMagazine())
10940 {
10941 Magazine mag = Magazine.Cast(this);
10942 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10943 }
10944 else
10945 {
10947 }
10948
10949 if (m_EM)
10950 {
10951 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10952 }
10953
10954 }
10955
10956 else if (action_id ==
EActions.REMOVE_QUANTITY)
10957 {
10958 if (IsMagazine())
10959 {
10960 Magazine mag2 = Magazine.Cast(this);
10961 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10962 }
10963 else
10964 {
10966 }
10967 if (m_EM)
10968 {
10969 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10970 }
10971
10972 }
10973
10974 else if (action_id ==
EActions.SET_QUANTITY_0)
10975 {
10977
10978 if (m_EM)
10979 {
10980 m_EM.SetEnergy(0);
10981 }
10982 }
10983
10984 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10985 {
10987
10988 if (m_EM)
10989 {
10990 m_EM.SetEnergy(m_EM.GetEnergyMax());
10991 }
10992 }
10993
10994 else if (action_id ==
EActions.ADD_HEALTH)
10995 {
10996 AddHealth("","",GetMaxHealth("","Health")/5);
10997 }
10998 else if (action_id ==
EActions.REMOVE_HEALTH)
10999 {
11000 AddHealth("","",-GetMaxHealth("","Health")/5);
11001 }
11002 else if (action_id ==
EActions.DESTROY_HEALTH)
11003 {
11004 SetHealth01("","",0);
11005 }
11006 else if (action_id ==
EActions.WATCH_ITEM)
11007 {
11009 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11010 #ifdef DEVELOPER
11011 SetDebugDeveloper_item(this);
11012 #endif
11013 }
11014
11015 else if (action_id ==
EActions.ADD_TEMPERATURE)
11016 {
11017 AddTemperature(20);
11018
11019 }
11020
11021 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11022 {
11023 AddTemperature(-20);
11024
11025 }
11026
11027 else if (action_id ==
EActions.FLIP_FROZEN)
11028 {
11029 SetFrozen(!GetIsFrozen());
11030
11031 }
11032
11033 else if (action_id ==
EActions.ADD_WETNESS)
11034 {
11036
11037 }
11038
11039 else if (action_id ==
EActions.REMOVE_WETNESS)
11040 {
11042
11043 }
11044
11045 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11046 {
11049
11050
11051 }
11052
11053 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11054 {
11057 }
11058
11059 else if (action_id ==
EActions.MAKE_SPECIAL)
11060 {
11061 auto debugParams = DebugSpawnParams.WithPlayer(player);
11062 OnDebugSpawnEx(debugParams);
11063 }
11064
11065 else if (action_id ==
EActions.DELETE)
11066 {
11067 Delete();
11068 }
11069
11070 }
11071
11072
11073 return false;
11074 }
11075
11076
11077
11078
11082
11085
11086
11087
11089 {
11090 return false;
11091 }
11092
11093
11095 {
11096 return true;
11097 }
11098
11099
11101 {
11102 return true;
11103 }
11104
11105
11106
11108 {
11109 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11111 }
11112
11115 {
11116 return null;
11117 }
11118
11120 {
11121 return false;
11122 }
11123
11125 {
11126 return false;
11127 }
11128
11132
11133
11135 {
11136 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11137 return module_repairing.CanRepair(this, item_repair_kit);
11138 }
11139
11140
11141 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11142 {
11143 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11144 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11145 }
11146
11147
11149 {
11150
11151
11152
11153
11154
11155
11156
11157
11158 return 1;
11159 }
11160
11161
11162
11164 {
11166 }
11167
11168
11169
11171 {
11173 }
11174
11175
11184 {
11185 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11186
11187 if (player)
11188 {
11189 player.MessageStatus(text);
11190 }
11191 }
11192
11193
11202 {
11203 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11204
11205 if (player)
11206 {
11207 player.MessageAction(text);
11208 }
11209 }
11210
11211
11220 {
11221 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11222
11223 if (player)
11224 {
11225 player.MessageFriendly(text);
11226 }
11227 }
11228
11229
11238 {
11239 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11240
11241 if (player)
11242 {
11243 player.MessageImportant(text);
11244 }
11245 }
11246
11248 {
11249 return true;
11250 }
11251
11252
11253 override bool KindOf(
string tag)
11254 {
11255 bool found = false;
11256 string item_name = this.
GetType();
11259
11260 int array_size = item_tag_array.Count();
11261 for (int i = 0; i < array_size; i++)
11262 {
11263 if (item_tag_array.Get(i) == tag)
11264 {
11265 found = true;
11266 break;
11267 }
11268 }
11269 return found;
11270 }
11271
11272
11274 {
11275
11276 super.OnRPC(sender, rpc_type,ctx);
11277
11278
11279 switch (rpc_type)
11280 {
11281 #ifndef SERVER
11282 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11283 Param2<bool, string> p = new Param2<bool, string>(false, "");
11284
11286 return;
11287
11288 bool play = p.param1;
11289 string soundSet = p.param2;
11290
11291 if (play)
11292 {
11294 {
11296 {
11298 }
11299 }
11300 else
11301 {
11303 }
11304 }
11305 else
11306 {
11308 }
11309
11310 break;
11311 #endif
11312
11313 }
11314
11316 {
11318 }
11319 }
11320
11321
11322
11323
11325 {
11326 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11327 return plugin.GetID(
name);
11328 }
11329
11331 {
11332 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11333 return plugin.GetName(id);
11334 }
11335
11338 {
11339
11340
11341 int varFlags;
11342 if (!ctx.
Read(varFlags))
11343 return;
11344
11345 if (varFlags & ItemVariableFlags.FLOAT)
11346 {
11348 }
11349 }
11350
11352 {
11353
11354 super.SerializeNumericalVars(floats_out);
11355
11356
11357
11359 {
11361 }
11362
11364 {
11366 }
11367
11369 {
11371 }
11372
11374 {
11379 }
11380
11382 {
11384 }
11385 }
11386
11388 {
11389
11390 super.DeSerializeNumericalVars(floats);
11391
11392
11393 int index = 0;
11394 int mask = Math.Round(floats.Get(index));
11395
11396 index++;
11397
11399 {
11401 {
11403 }
11404 else
11405 {
11406 float quantity = floats.Get(index);
11407 SetQuantity(quantity,
true,
false,
false,
false);
11408 }
11409 index++;
11410 }
11411
11413 {
11414 float wet = floats.Get(index);
11416 index++;
11417 }
11418
11420 {
11421 int liquidtype = Math.Round(floats.Get(index));
11423 index++;
11424 }
11425
11427 {
11429 index++;
11431 index++;
11433 index++;
11435 index++;
11436 }
11437
11439 {
11440 int cleanness = Math.Round(floats.Get(index));
11442 index++;
11443 }
11444 }
11445
11447 {
11448 super.WriteVarsToCTX(ctx);
11449
11450
11452 {
11454 }
11455
11457 {
11459 }
11460
11462 {
11464 }
11465
11467 {
11468 int r,g,b,a;
11474 }
11475
11477 {
11479 }
11480 }
11481
11483 {
11484 if (!super.ReadVarsFromCTX(ctx,version))
11485 return false;
11486
11487 int intValue;
11488 float value;
11489
11490 if (version < 140)
11491 {
11492 if (!ctx.
Read(intValue))
11493 return false;
11494
11495 m_VariablesMask = intValue;
11496 }
11497
11499 {
11500 if (!ctx.
Read(value))
11501 return false;
11502
11504 {
11506 }
11507 else
11508 {
11510 }
11511 }
11512
11513 if (version < 140)
11514 {
11516 {
11517 if (!ctx.
Read(value))
11518 return false;
11519 SetTemperatureDirect(value);
11520 }
11521 }
11522
11524 {
11525 if (!ctx.
Read(value))
11526 return false;
11528 }
11529
11531 {
11532 if (!ctx.
Read(intValue))
11533 return false;
11535 }
11536
11538 {
11539 int r,g,b,a;
11541 return false;
11543 return false;
11545 return false;
11547 return false;
11548
11550 }
11551
11553 {
11554 if (!ctx.
Read(intValue))
11555 return false;
11557 }
11558
11559 if (version >= 138 && version < 140)
11560 {
11562 {
11563 if (!ctx.
Read(intValue))
11564 return false;
11565 SetFrozen(intValue);
11566 }
11567 }
11568
11569 return true;
11570 }
11571
11572
11574 {
11577 {
11579 }
11580
11581 if (!super.OnStoreLoad(ctx, version))
11582 {
11584 return false;
11585 }
11586
11587 if (version >= 114)
11588 {
11589 bool hasQuickBarIndexSaved;
11590
11591 if (!ctx.
Read(hasQuickBarIndexSaved))
11592 {
11594 return false;
11595 }
11596
11597 if (hasQuickBarIndexSaved)
11598 {
11599 int itmQBIndex;
11600
11601
11602 if (!ctx.
Read(itmQBIndex))
11603 {
11605 return false;
11606 }
11607
11608 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11609 if (itmQBIndex != -1 && parentPlayer)
11610 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11611 }
11612 }
11613 else
11614 {
11615
11616 PlayerBase player;
11617 int itemQBIndex;
11618 if (version ==
int.
MAX)
11619 {
11620 if (!ctx.
Read(itemQBIndex))
11621 {
11623 return false;
11624 }
11625 }
11626 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11627 {
11628
11629 if (!ctx.
Read(itemQBIndex))
11630 {
11632 return false;
11633 }
11634 if (itemQBIndex != -1 && player)
11635 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11636 }
11637 }
11638
11639 if (version < 140)
11640 {
11641
11642 if (!LoadVariables(ctx, version))
11643 {
11645 return false;
11646 }
11647 }
11648
11649
11651 {
11653 return false;
11654 }
11655 if (version >= 132)
11656 {
11658 if (raib)
11659 {
11661 {
11663 return false;
11664 }
11665 }
11666 }
11667
11669 return true;
11670 }
11671
11672
11673
11675 {
11676 super.OnStoreSave(ctx);
11677
11678 PlayerBase player;
11679 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11680 {
11682
11683 int itemQBIndex = -1;
11684 itemQBIndex = player.FindQuickBarEntityIndex(this);
11685 ctx.
Write(itemQBIndex);
11686 }
11687 else
11688 {
11690 }
11691
11693
11695 if (raib)
11696 {
11698 }
11699 }
11700
11701
11703 {
11704 super.AfterStoreLoad();
11705
11707 {
11709 }
11710
11712 {
11715 }
11716 }
11717
11719 {
11720 super.EEOnAfterLoad();
11721
11723 {
11725 }
11726
11729 }
11730
11732 {
11733 return false;
11734 }
11735
11736
11737
11739 {
11741 {
11742 #ifdef PLATFORM_CONSOLE
11743
11745 {
11747 if (menu)
11748 {
11750 }
11751 }
11752 #endif
11753 }
11754
11756 {
11759 }
11760
11762 {
11763 SetWeightDirty();
11765 }
11767 {
11770 }
11771
11773 {
11776 }
11778 {
11781 }
11782
11783 super.OnVariablesSynchronized();
11784 }
11785
11786
11787
11789 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11790 {
11791 if (!IsServerCheck(allow_client))
11792 return false;
11793
11795 return false;
11796
11799
11800 if (value <= (min + 0.001))
11801 value = min;
11802
11803 if (value == min)
11804 {
11805 if (destroy_config)
11806 {
11807 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11808 if (dstr)
11809 {
11811 this.Delete();
11812 return true;
11813 }
11814 }
11815 else if (destroy_forced)
11816 {
11818 this.Delete();
11819 return true;
11820 }
11821
11823 }
11824
11827
11829 {
11831
11832 if (delta)
11834 }
11835
11837
11838 return false;
11839 }
11840
11841
11843 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11844 {
11846 }
11847
11849 {
11852 }
11853
11855 {
11858 }
11859
11862 {
11863 float value_clamped = Math.Clamp(value, 0, 1);
11865 SetQuantity(result, destroy_config, destroy_forced);
11866 }
11867
11868
11871 {
11873 }
11874
11876 {
11878 }
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11890 {
11891 int slot = -1;
11892 if (GetInventory())
11893 {
11894 InventoryLocation il = new InventoryLocation;
11895 GetInventory().GetCurrentInventoryLocation(il);
11897 }
11898
11900 }
11901
11903 {
11904 float quantity_max = 0;
11905
11907 {
11908 if (attSlotID != -1)
11909 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11910
11911 if (quantity_max <= 0)
11913 }
11914
11915 if (quantity_max <= 0)
11917
11918 return quantity_max;
11919 }
11920
11922 {
11924 }
11925
11927 {
11929 }
11930
11931
11933 {
11935 }
11936
11938 {
11940 }
11941
11943 {
11945 }
11946
11947
11949 {
11950
11951 float weightEx = GetWeightEx();
11952 float special = GetInventoryAndCargoWeight();
11953 return weightEx - special;
11954 }
11955
11956
11958 {
11960 }
11961
11963 {
11965 {
11966 #ifdef DEVELOPER
11967 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11968 {
11969 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11971 }
11972 #endif
11973
11974 return GetQuantity() * GetConfigWeightModified();
11975 }
11976 else if (HasEnergyManager())
11977 {
11978 #ifdef DEVELOPER
11979 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11980 {
11981 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11982 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11983 }
11984 #endif
11985 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11986 }
11987 else
11988 {
11989 #ifdef DEVELOPER
11990 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11991 {
11992 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11993 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11994 }
11995 #endif
11996 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11997 }
11998 }
11999
12002 {
12003 int item_count = 0;
12005
12006 if (GetInventory().GetCargo() != NULL)
12007 {
12008 item_count = GetInventory().GetCargo().GetItemCount();
12009 }
12010
12011 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12012 {
12013 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12014 if (item)
12015 item_count += item.GetNumberOfItems();
12016 }
12017 return item_count;
12018 }
12019
12022 {
12023 float weight = 0;
12024 float wetness = 1;
12025 if (include_wetness)
12028 {
12029 weight = wetness * m_ConfigWeight;
12030 }
12032 {
12033 weight = 1;
12034 }
12035 return weight;
12036 }
12037
12038
12039
12041 {
12042 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12043 {
12044 GameInventory inv = GetInventory();
12045 array<EntityAI> items = new array<EntityAI>;
12047 for (int i = 0; i < items.Count(); i++)
12048 {
12050 if (item)
12051 {
12053 }
12054 }
12055 }
12056 }
12057
12058
12059
12060
12062 {
12063 float energy = 0;
12064 if (HasEnergyManager())
12065 {
12066 energy = GetCompEM().GetEnergy();
12067 }
12068 return energy;
12069 }
12070
12071
12073 {
12074 super.OnEnergyConsumed();
12075
12077 }
12078
12080 {
12081 super.OnEnergyAdded();
12082
12084 }
12085
12086
12088 {
12089 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12090 {
12092 {
12093 float energy_0to1 = GetCompEM().GetEnergy0To1();
12095 }
12096 }
12097 }
12098
12099
12101 {
12102 return ConfigGetFloat("heatIsolation");
12103 }
12104
12106 {
12108 }
12109
12111 {
12112 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12113 if (
GetGame().ConfigIsExisting(paramPath))
12115
12116 return 0.0;
12117 }
12118
12120 {
12121 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12122 if (
GetGame().ConfigIsExisting(paramPath))
12124
12125 return 0.0;
12126 }
12127
12128 override void SetWet(
float value,
bool allow_client =
false)
12129 {
12130 if (!IsServerCheck(allow_client))
12131 return;
12132
12135
12137
12138 m_VarWet = Math.Clamp(value, min, max);
12139
12141 {
12144 }
12145 }
12146
12147 override void AddWet(
float value)
12148 {
12150 }
12151
12153 {
12155 }
12156
12158 {
12160 }
12161
12163 {
12165 }
12166
12168 {
12170 }
12171
12173 {
12175 }
12176
12177 override void OnWetChanged(
float newVal,
float oldVal)
12178 {
12181 if (newLevel != oldLevel)
12182 {
12184 }
12185 }
12186
12188 {
12189 SetWeightDirty();
12190 }
12191
12193 {
12194 return GetWetLevelInternal(
m_VarWet);
12195 }
12196
12197
12198
12200 {
12202 }
12203
12205 {
12207 }
12208
12210 {
12212 }
12213
12215 {
12217 }
12218
12219
12220
12222 {
12223 if (ConfigIsExisting("itemModelLength"))
12224 {
12225 return ConfigGetFloat("itemModelLength");
12226 }
12227 return 0;
12228 }
12229
12231 {
12232 if (ConfigIsExisting("itemAttachOffset"))
12233 {
12234 return ConfigGetFloat("itemAttachOffset");
12235 }
12236 return 0;
12237 }
12238
12239 override void SetCleanness(
int value,
bool allow_client =
false)
12240 {
12241 if (!IsServerCheck(allow_client))
12242 return;
12243
12245
12247
12250 }
12251
12253 {
12255 }
12256
12258 {
12259 return true;
12260 }
12261
12262
12263
12264
12266 {
12268 }
12269
12271 {
12273 }
12274
12275
12276
12277
12278 override void SetColor(
int r,
int g,
int b,
int a)
12279 {
12285 }
12287 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12288 {
12293 }
12294
12296 {
12298 }
12299
12302 {
12303 int r,g,b,a;
12305 r = r/255;
12306 g = g/255;
12307 b = b/255;
12308 a = a/255;
12309 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12310 }
12311
12312
12313
12314 override void SetLiquidType(
int value,
bool allow_client =
false)
12315 {
12316 if (!IsServerCheck(allow_client))
12317 return;
12318
12323 }
12324
12326 {
12327 return ConfigGetInt("varLiquidTypeInit");
12328 }
12329
12331 {
12333 }
12334
12336 {
12338 SetFrozen(false);
12339 }
12340
12343 {
12344 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12345 }
12346
12347
12350 {
12351 PlayerBase nplayer;
12352 if (PlayerBase.CastTo(nplayer, player))
12353 {
12355
12356 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12357 }
12358 }
12359
12360
12363 {
12364 PlayerBase nplayer;
12365 if (PlayerBase.CastTo(nplayer,player))
12366 {
12367
12368 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12369
12370 }
12371
12372
12373 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12374
12375
12376 if (HasEnergyManager())
12377 {
12378 GetCompEM().UpdatePlugState();
12379 }
12380 }
12381
12382
12384 {
12385 super.OnPlacementStarted(player);
12386
12388 }
12389
12390 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12391 {
12393 {
12394 m_AdminLog.OnPlacementComplete(player,
this);
12395 }
12396
12397 super.OnPlacementComplete(player, position, orientation);
12398 }
12399
12400
12401
12402
12403
12405 {
12407 {
12408 return true;
12409 }
12410 else
12411 {
12412 return false;
12413 }
12414 }
12415
12416
12418 {
12420 {
12422 }
12423 }
12424
12425
12427 {
12429 }
12430
12432 {
12434 }
12435
12436 override void InsertAgent(
int agent,
float count = 1)
12437 {
12438 if (count < 1)
12439 return;
12440
12442 }
12443
12446 {
12448 }
12449
12450
12452 {
12454 }
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12498 {
12500 return false;
12501 return true;
12502 }
12503
12505 {
12506
12508 }
12509
12510
12513 {
12514 super.CheckForRoofLimited(timeTresholdMS);
12515
12517 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12518 {
12519 m_PreviousRoofTestTime = time;
12520 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12521 }
12522 }
12523
12524
12526 {
12528 {
12529 return 0;
12530 }
12531
12532 if (GetInventory().GetAttachmentSlotsCount() != 0)
12533 {
12534 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12535 if (filter)
12536 return filter.GetProtectionLevel(type, false, system);
12537 else
12538 return 0;
12539 }
12540
12541 string subclassPath, entryName;
12542
12543 switch (type)
12544 {
12546 entryName = "biological";
12547 break;
12549 entryName = "chemical";
12550 break;
12551 default:
12552 entryName = "biological";
12553 break;
12554 }
12555
12556 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12557
12559 }
12560
12561
12562
12565 {
12566 if (!IsMagazine())
12568
12570 }
12571
12572
12573
12574
12575
12580 {
12581 return true;
12582 }
12583
12585 {
12587 }
12588
12589
12590
12591
12592
12594 {
12595 if (parent)
12596 {
12597 if (parent.IsInherited(DayZInfected))
12598 return true;
12599
12600 if (!parent.IsRuined())
12601 return true;
12602 }
12603
12604 return true;
12605 }
12606
12608 {
12609 if (!super.CanPutAsAttachment(parent))
12610 {
12611 return false;
12612 }
12613
12614 if (!IsRuined() && !parent.IsRuined())
12615 {
12616 return true;
12617 }
12618
12619 return false;
12620 }
12621
12623 {
12624
12625
12626
12627
12628 return super.CanReceiveItemIntoCargo(item);
12629 }
12630
12632 {
12633
12634
12635
12636
12637 GameInventory attachmentInv = attachment.GetInventory();
12639 {
12640 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12641 return false;
12642 }
12643
12644 InventoryLocation loc = new InventoryLocation();
12645 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12646 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12647 return false;
12648
12649 return super.CanReceiveAttachment(attachment, slotId);
12650 }
12651
12653 {
12654 if (!super.CanReleaseAttachment(attachment))
12655 return false;
12656
12657 return GetInventory().AreChildrenAccessible();
12658 }
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12681 {
12682 int id = muzzle_owner.GetMuzzleID();
12683 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12684
12685 if (WPOF_array)
12686 {
12687 for (int i = 0; i < WPOF_array.Count(); i++)
12688 {
12689 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12690
12691 if (WPOF)
12692 {
12693 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12694 }
12695 }
12696 }
12697 }
12698
12699
12701 {
12702 int id = muzzle_owner.GetMuzzleID();
12704
12705 if (WPOBE_array)
12706 {
12707 for (int i = 0; i < WPOBE_array.Count(); i++)
12708 {
12709 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12710
12711 if (WPOBE)
12712 {
12713 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12714 }
12715 }
12716 }
12717 }
12718
12719
12721 {
12722 int id = muzzle_owner.GetMuzzleID();
12723 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12724
12725 if (WPOOH_array)
12726 {
12727 for (int i = 0; i < WPOOH_array.Count(); i++)
12728 {
12729 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12730
12731 if (WPOOH)
12732 {
12733 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12734 }
12735 }
12736 }
12737 }
12738
12739
12741 {
12742 int id = muzzle_owner.GetMuzzleID();
12743 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12744
12745 if (WPOOH_array)
12746 {
12747 for (int i = 0; i < WPOOH_array.Count(); i++)
12748 {
12749 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12750
12751 if (WPOOH)
12752 {
12753 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12754 }
12755 }
12756 }
12757 }
12758
12759
12761 {
12762 int id = muzzle_owner.GetMuzzleID();
12763 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12764
12765 if (WPOOH_array)
12766 {
12767 for (int i = 0; i < WPOOH_array.Count(); i++)
12768 {
12769 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12770
12771 if (WPOOH)
12772 {
12773 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12774 }
12775 }
12776 }
12777 }
12778
12779
12780
12782 {
12784 {
12785 return true;
12786 }
12787
12788 return false;
12789 }
12790
12792 {
12794 {
12795 return true;
12796 }
12797
12798 return false;
12799 }
12800
12802 {
12804 {
12805 return true;
12806 }
12807
12808 return false;
12809 }
12810
12812 {
12813 return false;
12814 }
12815
12818 {
12819 return UATimeSpent.DEFAULT_DEPLOY;
12820 }
12821
12822
12823
12824
12826 {
12828 SetSynchDirty();
12829 }
12830
12832 {
12834 }
12835
12836
12838 {
12839 return false;
12840 }
12841
12844 {
12845 string att_type = "None";
12846
12847 if (ConfigIsExisting("soundAttType"))
12848 {
12849 att_type = ConfigGetString("soundAttType");
12850 }
12851
12853 }
12854
12856 {
12858 }
12859
12860
12861
12862
12863
12867
12869 {
12872
12874 }
12875
12876
12878 {
12880 return;
12881
12883
12886
12889
12890 SoundParameters params = new SoundParameters();
12894 }
12895
12896
12898 {
12900 return;
12901
12903 SetSynchDirty();
12904
12907 }
12908
12909
12911 {
12913 return;
12914
12916 SetSynchDirty();
12917
12920 }
12921
12923 {
12925 }
12926
12928 {
12930 }
12931
12934 {
12935 if (!
GetGame().IsDedicatedServer())
12936 {
12937 if (ConfigIsExisting("attachSoundSet"))
12938 {
12939 string cfg_path = "";
12940 string soundset = "";
12941 string type_name =
GetType();
12942
12945 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12946 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12947
12948 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12949 {
12950 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12951 {
12952 if (cfg_slot_array[i] == slot_type)
12953 {
12954 soundset = cfg_soundset_array[i];
12955 break;
12956 }
12957 }
12958 }
12959
12960 if (soundset != "")
12961 {
12962 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12964 }
12965 }
12966 }
12967 }
12968
12970 {
12971
12972 }
12973
12974 void OnApply(PlayerBase player);
12975
12977 {
12978 return 1.0;
12979 };
12980
12982 {
12984 }
12985
12987 {
12989 }
12990
12992
12994 {
12995 SetDynamicPhysicsLifeTime(0.01);
12997 }
12998
13000 {
13001 array<string> zone_names = new array<string>;
13002 GetDamageZones(zone_names);
13003 for (int i = 0; i < zone_names.Count(); i++)
13004 {
13005 SetHealthMax(zone_names.Get(i),"Health");
13006 }
13007 SetHealthMax("","Health");
13008 }
13009
13012 {
13013 float global_health = GetHealth01("","Health");
13014 array<string> zones = new array<string>;
13015 GetDamageZones(zones);
13016
13017 for (int i = 0; i < zones.Count(); i++)
13018 {
13019 SetHealth01(zones.Get(i),"Health",global_health);
13020 }
13021 }
13022
13025 {
13026 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13027 }
13028
13030 {
13031 if (!hasRootAsPlayer)
13032 {
13033 if (refParentIB)
13034 {
13035
13036 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13037 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13038
13039 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13040 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13041
13044 }
13045 else
13046 {
13047
13050 }
13051 }
13052 }
13053
13055 {
13057 {
13058 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13059 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13060 {
13061 float heatPermCoef = 1.0;
13063 while (ent)
13064 {
13065 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13066 ent = ent.GetHierarchyParent();
13067 }
13068
13069 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13070 }
13071 }
13072 }
13073
13075 {
13076
13077 EntityAI parent = GetHierarchyParent();
13078 if (!parent)
13079 {
13080 hasParent = false;
13081 hasRootAsPlayer = false;
13082 }
13083 else
13084 {
13085 hasParent = true;
13086 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13087 refParentIB =
ItemBase.Cast(parent);
13088 }
13089 }
13090
13091 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13092 {
13093
13094 }
13095
13097 {
13098
13099 return false;
13100 }
13101
13103 {
13104
13105
13106 return false;
13107 }
13108
13110 {
13111
13112 return false;
13113 }
13114
13117 {
13118 return !GetIsFrozen() &&
IsOpen();
13119 }
13120
13122 {
13123 bool hasParent = false, hasRootAsPlayer = false;
13125
13126 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13127 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13128
13129 if (wwtu || foodDecay)
13130 {
13134
13135 if (processWetness || processTemperature || processDecay)
13136 {
13138
13139 if (processWetness)
13140 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13141
13142 if (processTemperature)
13144
13145 if (processDecay)
13146 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13147 }
13148 }
13149 }
13150
13153 {
13155 }
13156
13158 {
13161
13162 return super.GetTemperatureFreezeThreshold();
13163 }
13164
13166 {
13169
13170 return super.GetTemperatureThawThreshold();
13171 }
13172
13174 {
13177
13178 return super.GetItemOverheatThreshold();
13179 }
13180
13182 {
13184 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13185
13186 return super.GetTemperatureFreezeTime();
13187 }
13188
13190 {
13192 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13193
13194 return super.GetTemperatureThawTime();
13195 }
13196
13201
13203 {
13204 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13205 }
13206
13208 {
13209 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13210 }
13211
13214 {
13216 }
13217
13219 {
13221 }
13222
13224 {
13226 }
13227
13230 {
13231 return null;
13232 }
13233
13236 {
13237 return false;
13238 }
13239
13241 {
13243 {
13246 if (!trg)
13247 {
13249 explosive = this;
13250 }
13251
13252 explosive.PairRemote(trg);
13254
13255 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13256 trg.SetPersistentPairID(persistentID);
13257 explosive.SetPersistentPairID(persistentID);
13258
13259 return true;
13260 }
13261 return false;
13262 }
13263
13266 {
13267 float ret = 1.0;
13270 ret *= GetHealth01();
13271
13272 return ret;
13273 }
13274
13275 #ifdef DEVELOPER
13276 override void SetDebugItem()
13277 {
13278 super.SetDebugItem();
13279 _itemBase = this;
13280 }
13281
13283 {
13284 string text = super.GetDebugText();
13285
13287 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13288
13289 return text;
13290 }
13291 #endif
13292
13294 {
13295 return true;
13296 }
13297
13299
13301
13303 {
13306 }
13307
13308
13316
13332}
13333
13335{
13337 if (entity)
13338 {
13339 bool is_item = entity.IsInherited(
ItemBase);
13340 if (is_item && full_quantity)
13341 {
13344 }
13345 }
13346 else
13347 {
13349 return NULL;
13350 }
13351 return entity;
13352}
13353
13355{
13356 if (item)
13357 {
13358 if (health > 0)
13359 item.SetHealth("", "", health);
13360
13361 if (item.CanHaveTemperature())
13362 {
13364 if (item.CanFreeze())
13365 item.SetFrozen(false);
13366 }
13367
13368 if (item.HasEnergyManager())
13369 {
13370 if (quantity >= 0)
13371 {
13372 item.GetCompEM().SetEnergy0To1(quantity);
13373 }
13374 else
13375 {
13377 }
13378 }
13379 else if (item.IsMagazine())
13380 {
13381 Magazine mag = Magazine.Cast(item);
13382 if (quantity >= 0)
13383 {
13384 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13385 }
13386 else
13387 {
13389 }
13390
13391 }
13392 else
13393 {
13394 if (quantity >= 0)
13395 {
13396 item.SetQuantityNormalized(quantity, false);
13397 }
13398 else
13399 {
13401 }
13402
13403 }
13404 }
13405}
13406
13407#ifdef DEVELOPER
13409#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.