Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,0.15,0.15,1.0,CO)".
8522{
8524 {
8525 return true;
8526 }
8527};
8528
8529
8530
8532{
8536
8538
8541
8542
8543
8544
8545
8554
8560
8565
8570
8591 protected bool m_IsResultOfSplit
8592
8594
8599
8600
8601
8603
8607
8608
8609
8611
8614
8615
8616
8622
8623
8631
8634
8635
8637
8638
8640
8641
8646
8647
8652
8653
8655
8656
8658 {
8663
8664 if (!
GetGame().IsDedicatedServer())
8665 {
8667 {
8669
8671 {
8673 }
8674 }
8675
8678 }
8679
8680 m_OldLocation = null;
8681
8683 {
8685 }
8686
8687 if (ConfigIsExisting("headSelectionsToHide"))
8688 {
8691 }
8692
8694 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8695 {
8697 }
8698
8700
8701 m_IsResultOfSplit = false;
8702
8704 }
8705
8707 {
8708 super.InitItemVariables();
8709
8715 m_Count = ConfigGetInt(
"count");
8716
8719
8724
8727
8732
8744
8748
8749
8752 if (ConfigIsExisting("canBeSplit"))
8753 {
8756 }
8757
8759 if (ConfigIsExisting("itemBehaviour"))
8761
8762
8765 RegisterNetSyncVariableInt("m_VarLiquidType");
8766 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8767
8768 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8769 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8770 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8771
8772 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8773 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8774 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8775 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8776
8777 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8778 RegisterNetSyncVariableBool("m_IsTakeable");
8779 RegisterNetSyncVariableBool("m_IsHologram");
8780
8783 {
8786 }
8787
8789
8791 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8793
8794 }
8795
8797 {
8799 }
8800
8802 {
8805 {
8810 }
8811 }
8812
8813 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8814 {
8816 {
8819 }
8820
8822 }
8823
8825 {
8831 }
8832
8834
8836 {
8838
8839 if (!action)
8840 {
8841 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8842 return;
8843 }
8844
8846 if (!ai)
8847 {
8849 return;
8850 }
8851
8853 if (!action_array)
8854 {
8855 action_array = new array<ActionBase_Basic>;
8857 }
8858 if (LogManager.IsActionLogEnable())
8859 {
8860 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8861 }
8862
8863 if (action_array.Find(action) != -1)
8864 {
8865 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8866 }
8867 else
8868 {
8869 action_array.Insert(action);
8870 }
8871 }
8872
8874 {
8876 ActionBase action = player.GetActionManager().GetAction(actionName);
8879
8880 if (action_array)
8881 {
8882 action_array.RemoveItem(action);
8883 }
8884 }
8885
8886
8887
8889 {
8890 ActionOverrideData overrideData = new ActionOverrideData();
8894
8896 if (!actionMap)
8897 {
8900 }
8901
8902 actionMap.Insert(this.
Type(), overrideData);
8903
8904 }
8905
8907
8909
8910
8912 {
8915
8918
8919 string config_to_search = "CfgVehicles";
8920 string muzzle_owner_config;
8921
8923 {
8924 if (IsInherited(Weapon))
8925 config_to_search = "CfgWeapons";
8926
8927 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8928
8929 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8930
8932
8933 if (config_OnFire_subclass_count > 0)
8934 {
8935 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8936
8937 for (int i = 0; i < config_OnFire_subclass_count; i++)
8938 {
8939 string particle_class = "";
8941 string config_OnFire_entry = config_OnFire_class + particle_class;
8942 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8943 WPOF_array.Insert(WPOF);
8944 }
8945
8946
8948 }
8949 }
8950
8952 {
8953 config_to_search = "CfgWeapons";
8954 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8955
8956 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8957
8959
8960 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8961 {
8962 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8963
8964 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8965 {
8966 string particle_class2 = "";
8968 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8969 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8970 WPOBE_array.Insert(WPOBE);
8971 }
8972
8973
8975 }
8976 }
8977 }
8978
8979
8981 {
8984
8986 {
8987 string config_to_search = "CfgVehicles";
8988
8989 if (IsInherited(Weapon))
8990 config_to_search = "CfgWeapons";
8991
8992 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8993 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8994
8995 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8996 {
8997
8999
9001 {
9003 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9005 return;
9006 }
9007
9010
9011
9012
9014 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9015
9016 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9017 {
9018 string particle_class = "";
9020 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9022
9023 if (entry_type == CT_CLASS)
9024 {
9025 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9026 WPOOH_array.Insert(WPOF);
9027 }
9028 }
9029
9030
9032 }
9033 }
9034 }
9035
9037 {
9039 }
9040
9042 {
9044 {
9046
9049
9052
9053 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9054 }
9055 }
9056
9058 {
9060 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9061
9063 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9064
9066 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9067
9069 {
9071 }
9072 }
9073
9075 {
9077 }
9078
9080 {
9083 else
9085
9087 {
9090 }
9091 else
9092 {
9095
9098 }
9099
9101 }
9102
9104 {
9106 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9107 }
9108
9110 {
9112 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9114 }
9115
9117 {
9119 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9120 }
9121
9123 {
9126
9127 OverheatingParticle OP = new OverheatingParticle();
9132
9134 }
9135
9137 {
9140
9141 return -1;
9142 }
9143
9145 {
9147 {
9150
9151 for (int i = count; i > 0; --i)
9152 {
9153 int id = i - 1;
9156
9159
9160 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9161 {
9162 if (p)
9163 {
9166 }
9167 }
9168 }
9169 }
9170 }
9171
9173 {
9175 {
9177 {
9178 int id = i - 1;
9180
9181 if (OP)
9182 {
9184
9185 if (p)
9186 {
9188 }
9189
9190 delete OP;
9191 }
9192 }
9193
9196 }
9197 }
9198
9201 {
9202 return 0.0;
9203 }
9204
9205
9207 {
9208 return 250;
9209 }
9210
9212 {
9213 return 0;
9214 }
9215
9218 {
9220 return true;
9221
9222 return false;
9223 }
9224
9227 {
9230
9232 {
9234 }
9235 else
9236 {
9237
9239 }
9240
9242 }
9243
9250 {
9251 return -1;
9252 }
9253
9254
9255
9256
9258 {
9260 {
9262 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9263
9264 if (r_index >= 0)
9265 {
9266 InventoryLocation r_il = new InventoryLocation;
9267 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9268
9269 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9272 {
9273 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9274 }
9276 {
9277 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9278 }
9279
9280 }
9281
9282 player.GetHumanInventory().ClearUserReservedLocation(this);
9283 }
9284
9287 }
9288
9289
9290
9291
9293 {
9294 return ItemBase.m_DebugActionsMask;
9295 }
9296
9298 {
9299 return ItemBase.m_DebugActionsMask & mask;
9300 }
9301
9303 {
9304 ItemBase.m_DebugActionsMask = mask;
9305 }
9306
9308 {
9309 ItemBase.m_DebugActionsMask |= mask;
9310 }
9311
9313 {
9314 ItemBase.m_DebugActionsMask &= ~mask;
9315 }
9316
9318 {
9320 {
9322 }
9323 else
9324 {
9326 }
9327 }
9328
9329
9331 {
9332 if (GetEconomyProfile())
9333 {
9334 float q_max = GetEconomyProfile().GetQuantityMax();
9335 if (q_max > 0)
9336 {
9337 float q_min = GetEconomyProfile().GetQuantityMin();
9338 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9339
9341 {
9342 ComponentEnergyManager comp = GetCompEM();
9344 {
9346 }
9347 }
9349 {
9351
9352 }
9353
9354 }
9355 }
9356 }
9357
9360 {
9361 EntityAI parent = GetHierarchyParent();
9362
9363 if (parent)
9364 {
9365 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9366 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9367 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9368 }
9369 }
9370
9373 {
9374 EntityAI parent = GetHierarchyParent();
9375
9376 if (parent)
9377 {
9378 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9379 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9380 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9381 }
9382 }
9383
9385 {
9386
9387
9388
9389
9391
9393 {
9394 if (ScriptInputUserData.CanStoreInputUserData())
9395 {
9396 ScriptInputUserData ctx = new ScriptInputUserData;
9402 ctx.
Write(use_stack_max);
9405
9407 {
9408 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9409 }
9410 }
9411 }
9412 else if (!
GetGame().IsMultiplayer())
9413 {
9415 }
9416 }
9417
9419 {
9421 }
9422
9424 {
9426 }
9427
9429 {
9431 }
9432
9434 {
9435
9436 return false;
9437 }
9438
9440 {
9441 return false;
9442 }
9443
9447 {
9448 return false;
9449 }
9450
9452 {
9453 return "";
9454 }
9455
9457
9459 {
9460 return false;
9461 }
9462
9464 {
9465 return true;
9466 }
9467
9468
9469
9471 {
9472 return true;
9473 }
9474
9476 {
9477 return true;
9478 }
9479
9481 {
9482 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9484 }
9485
9487 {
9489 }
9490
9492 {
9494 if (!is_being_placed)
9496 SetSynchDirty();
9497 }
9498
9499
9501
9503 {
9505 }
9506
9508 {
9510 }
9511
9513 {
9514 return 1;
9515 }
9516
9518 {
9519 return false;
9520 }
9521
9523 {
9525 SetSynchDirty();
9526 }
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9563 {
9564 super.OnMovedInsideCargo(container);
9565
9566 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9567 }
9568
9569 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9570 {
9571 super.EEItemLocationChanged(oldLoc,newLoc);
9572
9573 PlayerBase new_player = null;
9574 PlayerBase old_player = null;
9575
9576 if (newLoc.GetParent())
9577 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9578
9579 if (oldLoc.GetParent())
9580 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9581
9583 {
9584 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9585
9586 if (r_index >= 0)
9587 {
9588 InventoryLocation r_il = new InventoryLocation;
9589 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9590
9591 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9594 {
9595 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9596 }
9598 {
9599 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9600 }
9601
9602 }
9603 }
9604
9606 {
9607 if (new_player)
9608 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9609
9610 if (new_player == old_player)
9611 {
9612
9613 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9614 {
9616 {
9617 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9618 {
9619 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9620 }
9621 }
9622 else
9623 {
9624 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9625 }
9626 }
9627
9628 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9629 {
9630 int type = oldLoc.GetType();
9632 {
9633 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9634 }
9636 {
9637 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9638 }
9639 }
9640 if (!m_OldLocation)
9641 {
9642 m_OldLocation = new InventoryLocation;
9643 }
9644 m_OldLocation.Copy(oldLoc);
9645 }
9646 else
9647 {
9648 if (m_OldLocation)
9649 {
9650 m_OldLocation.Reset();
9651 }
9652 }
9653
9655 }
9656 else
9657 {
9658 if (new_player)
9659 {
9660 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9661 if (res_index >= 0)
9662 {
9663 InventoryLocation il = new InventoryLocation;
9664 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9666 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9669 {
9670 il.
GetParent().GetOnReleaseLock().Invoke(it);
9671 }
9673 {
9675 }
9676
9677 }
9678 }
9680 {
9681
9683 }
9684
9685 if (m_OldLocation)
9686 {
9687 m_OldLocation.Reset();
9688 }
9689 }
9690 }
9691
9692 override void EOnContact(IEntity other, Contact extra)
9693 {
9695 {
9696 int liquidType = -1;
9698 if (impactSpeed > 0.0)
9699 {
9701 #ifndef SERVER
9703 #else
9705 SetSynchDirty();
9706 #endif
9708 }
9709 }
9710
9711 #ifdef SERVER
9712 if (GetCompEM() && GetCompEM().IsPlugged())
9713 {
9714 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9715 GetCompEM().UnplugThis();
9716 }
9717 #endif
9718 }
9719
9721
9723 {
9725 }
9726
9728 {
9729
9730 }
9731
9733 {
9734 super.OnItemLocationChanged(old_owner, new_owner);
9735
9736 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9737 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9738
9739 if (!relatedPlayer && playerNew)
9740 relatedPlayer = playerNew;
9741
9742 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9743 {
9745 if (actionMgr)
9746 {
9747 ActionBase currentAction = actionMgr.GetRunningAction();
9748 if (currentAction)
9750 }
9751 }
9752
9753 Man ownerPlayerOld = null;
9754 Man ownerPlayerNew = null;
9755
9756 if (old_owner)
9757 {
9758 if (old_owner.
IsMan())
9759 {
9760 ownerPlayerOld = Man.Cast(old_owner);
9761 }
9762 else
9763 {
9764 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9765 }
9766 }
9767 else
9768 {
9770 {
9772
9773 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9774 {
9775 GetCompEM().UnplugThis();
9776 }
9777 }
9778 }
9779
9780 if (new_owner)
9781 {
9782 if (new_owner.
IsMan())
9783 {
9784 ownerPlayerNew = Man.Cast(new_owner);
9785 }
9786 else
9787 {
9788 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9789 }
9790 }
9791
9792 if (ownerPlayerOld != ownerPlayerNew)
9793 {
9794 if (ownerPlayerOld)
9795 {
9796 array<EntityAI> subItemsExit = new array<EntityAI>;
9798 for (int i = 0; i < subItemsExit.Count(); i++)
9799 {
9802 }
9803 }
9804
9805 if (ownerPlayerNew)
9806 {
9807 array<EntityAI> subItemsEnter = new array<EntityAI>;
9809 for (int j = 0; j < subItemsEnter.Count(); j++)
9810 {
9813 }
9814 }
9815 }
9816 else if (ownerPlayerNew != null)
9817 {
9818 PlayerBase nplayer;
9819 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9820 {
9821 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9823 for (int k = 0; k < subItemsUpdate.Count(); k++)
9824 {
9826 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9827 }
9828 }
9829 }
9830
9831 if (old_owner)
9832 old_owner.OnChildItemRemoved(this);
9833 if (new_owner)
9834 new_owner.OnChildItemReceived(this);
9835 }
9836
9837
9839 {
9840 super.EEDelete(parent);
9841 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9842 if (player)
9843 {
9845
9846 if (player.IsAlive())
9847 {
9848 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9849 if (r_index >= 0)
9850 {
9851 InventoryLocation r_il = new InventoryLocation;
9852 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9853
9854 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9857 {
9858 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9859 }
9861 {
9862 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9863 }
9864
9865 }
9866
9867 player.RemoveQuickBarEntityShortcut(this);
9868 }
9869 }
9870 }
9871
9873 {
9874 super.EEKilled(killer);
9875
9878 {
9879 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9880 {
9881 if (IsMagazine())
9882 {
9883 if (Magazine.Cast(this).GetAmmoCount() > 0)
9884 {
9886 }
9887 }
9888 else
9889 {
9891 }
9892 }
9893 }
9894 }
9895
9897 {
9898 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9899
9900 super.OnWasAttached(parent, slot_id);
9901
9904
9906 }
9907
9909 {
9910 super.OnWasDetached(parent, slot_id);
9911
9914 }
9915
9917 {
9918 int idx;
9921
9922 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9923 if (inventory_slots.Count() < 1)
9924 {
9925 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9926 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9927 }
9928 else
9929 {
9930 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9931 }
9932
9933 idx = inventory_slots.Find(slot);
9934 if (idx < 0)
9935 return "";
9936
9937 return attach_types.Get(idx);
9938 }
9939
9941 {
9942 int idx = -1;
9943 string slot;
9944
9947
9948 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9949 if (inventory_slots.Count() < 1)
9950 {
9951 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9952 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9953 }
9954 else
9955 {
9956 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9957 if (detach_types.Count() < 1)
9958 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9959 }
9960
9961 for (int i = 0; i < inventory_slots.Count(); i++)
9962 {
9963 slot = inventory_slots.Get(i);
9964 }
9965
9966 if (slot != "")
9967 {
9968 if (detach_types.Count() == 1)
9969 idx = 0;
9970 else
9971 idx = inventory_slots.Find(slot);
9972 }
9973 if (idx < 0)
9974 return "";
9975
9976 return detach_types.Get(idx);
9977 }
9978
9980 {
9981
9983
9984
9985 float min_time = 1;
9986 float max_time = 3;
9987 float delay = Math.RandomFloat(min_time, max_time);
9988
9989 explode_timer.Run(delay, this, "DoAmmoExplosion");
9990 }
9991
9993 {
9994 Magazine magazine = Magazine.Cast(this);
9995 int pop_sounds_count = 6;
9996 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9997
9998
9999 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10000 string sound_name = pop_sounds[ sound_idx ];
10002
10003
10004 magazine.ServerAddAmmoCount(-1);
10005
10006
10007 float min_temp_to_explode = 100;
10008
10009 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10010 {
10012 }
10013 }
10014
10015
10016 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10017 {
10018 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10019
10020 const int CHANCE_DAMAGE_CARGO = 4;
10021 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10022 const int CHANCE_DAMAGE_NOTHING = 2;
10023
10025 {
10026 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10027 int chances;
10028 int rnd;
10029
10030 if (GetInventory().GetCargo())
10031 {
10032 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10033 rnd = Math.RandomInt(0,chances);
10034
10035 if (rnd < CHANCE_DAMAGE_CARGO)
10036 {
10038 }
10039 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10040 {
10042 }
10043 }
10044 else
10045 {
10046 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10047 rnd = Math.RandomInt(0,chances);
10048
10049 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10050 {
10052 }
10053 }
10054 }
10055 }
10056
10058 {
10059 if (GetInventory().GetCargo())
10060 {
10061 int item_count = GetInventory().GetCargo().GetItemCount();
10062 if (item_count > 0)
10063 {
10064 int random_pick = Math.RandomInt(0, item_count);
10066 if (!item.IsExplosive())
10067 {
10068 item.AddHealth("","",damage);
10069 return true;
10070 }
10071 }
10072 }
10073 return false;
10074 }
10075
10077 {
10078 int attachment_count = GetInventory().AttachmentCount();
10079 if (attachment_count > 0)
10080 {
10081 int random_pick = Math.RandomInt(0, attachment_count);
10082 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10083 if (!attachment.IsExplosive())
10084 {
10085 attachment.AddHealth("","",damage);
10086 return true;
10087 }
10088 }
10089 return false;
10090 }
10091
10093 {
10095 }
10096
10098 {
10100 return GetInventory().CanRemoveEntity();
10101
10102 return false;
10103 }
10104
10106 {
10108 return;
10109
10111 {
10112 if (ScriptInputUserData.CanStoreInputUserData())
10113 {
10114 ScriptInputUserData ctx = new ScriptInputUserData;
10119 ctx.
Write(destination_entity);
10121 ctx.
Write(slot_id);
10123 }
10124 }
10125 else if (!
GetGame().IsMultiplayer())
10126 {
10128 }
10129 }
10130
10132 {
10134 return;
10135
10136 float split_quantity_new;
10140 InventoryLocation loc = new InventoryLocation;
10141
10142 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10143 {
10145 split_quantity_new = stack_max;
10146 else
10148
10149 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10150 if (new_item)
10151 {
10152 new_item.SetResultOfSplit(true);
10153 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10155 new_item.SetQuantity(split_quantity_new);
10156 }
10157 }
10158 else if (destination_entity && slot_id == -1)
10159 {
10160 if (quantity > stack_max)
10161 split_quantity_new = stack_max;
10162 else
10163 split_quantity_new = quantity;
10164
10166 {
10169 }
10170
10171 if (new_item)
10172 {
10173 new_item.SetResultOfSplit(true);
10174 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10176 new_item.SetQuantity(split_quantity_new);
10177 }
10178 }
10179 else
10180 {
10181 if (stack_max != 0)
10182 {
10184 {
10186 }
10187
10188 if (split_quantity_new == 0)
10189 {
10190 if (!
GetGame().IsMultiplayer())
10191 player.PhysicalPredictiveDropItem(this);
10192 else
10193 player.ServerDropEntity(this);
10194 return;
10195 }
10196
10198
10199 if (new_item)
10200 {
10201 new_item.SetResultOfSplit(true);
10202 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10204 new_item.SetQuantity(stack_max);
10205 new_item.PlaceOnSurface();
10206 }
10207 }
10208 }
10209 }
10210
10212 {
10214 return;
10215
10216 float split_quantity_new;
10220 InventoryLocation loc = new InventoryLocation;
10221
10222 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10223 {
10225 split_quantity_new = stack_max;
10226 else
10228
10229 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10230 if (new_item)
10231 {
10232 new_item.SetResultOfSplit(true);
10233 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10235 new_item.SetQuantity(split_quantity_new);
10236 }
10237 }
10238 else if (destination_entity && slot_id == -1)
10239 {
10240 if (quantity > stack_max)
10241 split_quantity_new = stack_max;
10242 else
10243 split_quantity_new = quantity;
10244
10246 {
10249 }
10250
10251 if (new_item)
10252 {
10253 new_item.SetResultOfSplit(true);
10254 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10256 new_item.SetQuantity(split_quantity_new);
10257 }
10258 }
10259 else
10260 {
10261 if (stack_max != 0)
10262 {
10264 {
10266 }
10267
10269
10270 if (new_item)
10271 {
10272 new_item.SetResultOfSplit(true);
10273 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10275 new_item.SetQuantity(stack_max);
10276 new_item.PlaceOnSurface();
10277 }
10278 }
10279 }
10280 }
10281
10283 {
10285 return;
10286
10288 {
10289 if (ScriptInputUserData.CanStoreInputUserData())
10290 {
10291 ScriptInputUserData ctx = new ScriptInputUserData;
10296 dst.WriteToContext(ctx);
10298 }
10299 }
10300 else if (!
GetGame().IsMultiplayer())
10301 {
10303 }
10304 }
10305
10307 {
10309 return;
10310
10312 {
10313 if (ScriptInputUserData.CanStoreInputUserData())
10314 {
10315 ScriptInputUserData ctx = new ScriptInputUserData;
10320 ctx.
Write(destination_entity);
10326 }
10327 }
10328 else if (!
GetGame().IsMultiplayer())
10329 {
10331 }
10332 }
10333
10335 {
10337 }
10338
10340 {
10342 return this;
10343
10345 float split_quantity_new;
10347 if (dst.IsValid())
10348 {
10349 int slot_id = dst.GetSlot();
10351
10352 if (quantity > stack_max)
10353 split_quantity_new = stack_max;
10354 else
10355 split_quantity_new = quantity;
10356
10358
10359 if (new_item)
10360 {
10361 new_item.SetResultOfSplit(true);
10362 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10365 }
10366
10367 return new_item;
10368 }
10369
10370 return null;
10371 }
10372
10374 {
10376 return;
10377
10379 float split_quantity_new;
10381 if (destination_entity)
10382 {
10384 if (quantity > stackable)
10385 split_quantity_new = stackable;
10386 else
10387 split_quantity_new = quantity;
10388
10389 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10390 if (new_item)
10391 {
10392 new_item.SetResultOfSplit(true);
10393 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10395 new_item.SetQuantity(split_quantity_new);
10396 }
10397 }
10398 }
10399
10401 {
10403 return;
10404
10406 {
10407 if (ScriptInputUserData.CanStoreInputUserData())
10408 {
10409 ScriptInputUserData ctx = new ScriptInputUserData;
10414 ItemBase destination_entity =
this;
10415 ctx.
Write(destination_entity);
10419 }
10420 }
10421 else if (!
GetGame().IsMultiplayer())
10422 {
10424 }
10425 }
10426
10428 {
10430 return;
10431
10433 float split_quantity_new;
10435 if (player)
10436 {
10438 if (quantity > stackable)
10439 split_quantity_new = stackable;
10440 else
10441 split_quantity_new = quantity;
10442
10443 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10444 new_item =
ItemBase.Cast(in_hands);
10445 if (new_item)
10446 {
10447 new_item.SetResultOfSplit(true);
10448 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10450 new_item.SetQuantity(split_quantity_new);
10451 }
10452 }
10453 }
10454
10456 {
10458 return;
10459
10461 float split_quantity_new = Math.Floor(quantity * 0.5);
10462
10464
10465 if (new_item)
10466 {
10467 if (new_item.GetQuantityMax() < split_quantity_new)
10468 {
10469 split_quantity_new = new_item.GetQuantityMax();
10470 }
10471
10472 new_item.SetResultOfSplit(true);
10473 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10474
10476 {
10479 }
10480 else
10481 {
10484 }
10485 }
10486 }
10487
10489 {
10491 return;
10492
10494 float split_quantity_new = Math.Floor(quantity / 2);
10495
10496 InventoryLocation invloc = new InventoryLocation;
10498
10500 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10501
10502 if (new_item)
10503 {
10504 if (new_item.GetQuantityMax() < split_quantity_new)
10505 {
10506 split_quantity_new = new_item.GetQuantityMax();
10507 }
10509 {
10512 }
10513 else
10514 {
10517 }
10518 }
10519 }
10520
10523 {
10524 SetWeightDirty();
10526
10527 if (parent)
10528 parent.OnAttachmentQuantityChangedEx(this, delta);
10529
10531 {
10533 {
10535 }
10537 {
10538 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10540 }
10541 }
10542
10543 }
10544
10547 {
10548
10549 }
10550
10553 {
10555 }
10556
10558 {
10559 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10560
10562 {
10563 if (newLevel == GameConstants.STATE_RUINED)
10564 {
10566 EntityAI parent = GetHierarchyParent();
10567 if (parent && parent.IsFireplace())
10568 {
10569 CargoBase cargo = GetInventory().GetCargo();
10570 if (cargo)
10571 {
10573 {
10575 }
10576 }
10577 }
10578 }
10579
10581 {
10582
10584 return;
10585 }
10586
10587 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10588 {
10590 }
10591 }
10592 }
10593
10594
10596 {
10597 super.OnRightClick();
10598
10600 {
10602 {
10603 if (ScriptInputUserData.CanStoreInputUserData())
10604 {
10605 vector m4[4];
10607
10608 EntityAI root = GetHierarchyRoot();
10609
10610 InventoryLocation dst = new InventoryLocation;
10612 {
10613 if (root)
10614 {
10615 root.GetTransform(m4);
10617 }
10618 else
10619 GetInventory().GetCurrentInventoryLocation(dst);
10620 }
10621 else
10622 {
10624
10625
10626 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10627 {
10628 if (root)
10629 {
10630 root.GetTransform(m4);
10632 }
10633 else
10634 GetInventory().GetCurrentInventoryLocation(dst);
10635 }
10636 else
10637 {
10638 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10639 }
10640 }
10641
10642 ScriptInputUserData ctx = new ScriptInputUserData;
10650 }
10651 }
10652 else if (!
GetGame().IsMultiplayer())
10653 {
10655 }
10656 }
10657 }
10658
10659 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10660 {
10661
10662 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10663 return false;
10664
10665 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10666 return false;
10667
10668
10670 return false;
10671
10672
10673 Magazine mag = Magazine.Cast(this);
10674 if (mag)
10675 {
10676 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10677 return false;
10678
10679 if (stack_max_limit)
10680 {
10681 Magazine other_mag = Magazine.Cast(other_item);
10682 if (other_item)
10683 {
10684 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10685 return false;
10686 }
10687
10688 }
10689 }
10690 else
10691 {
10692
10694 return false;
10695
10697 return false;
10698 }
10699
10700 PlayerBase player = null;
10701 if (CastTo(player, GetHierarchyRootPlayer()))
10702 {
10703 if (player.GetInventory().HasAttachment(this))
10704 return false;
10705
10706 if (player.IsItemsToDelete())
10707 return false;
10708 }
10709
10710 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10711 return false;
10712
10713 int slotID;
10715 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10716 return false;
10717
10718 return true;
10719 }
10720
10722 {
10724 }
10725
10727 {
10728 return m_IsResultOfSplit;
10729 }
10730
10732 {
10733 m_IsResultOfSplit = value;
10734 }
10735
10737 {
10739 }
10740
10742 {
10743 float other_item_quantity = other_item.GetQuantity();
10744 float this_free_space;
10745
10747
10749
10750 if (other_item_quantity > this_free_space)
10751 {
10752 return this_free_space;
10753 }
10754 else
10755 {
10756 return other_item_quantity;
10757 }
10758 }
10759
10761 {
10763 }
10764
10766 {
10768 return;
10769
10770 if (!IsMagazine() && other_item)
10771 {
10773 if (quantity_used != 0)
10774 {
10775 float hp1 = GetHealth01("","");
10776 float hp2 = other_item.GetHealth01("","");
10777 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10778 hpResult = hpResult / (
GetQuantity() + quantity_used);
10779
10780 hpResult *= GetMaxHealth();
10781 Math.Round(hpResult);
10782 SetHealth("", "Health", hpResult);
10783
10785 other_item.AddQuantity(-quantity_used);
10786 }
10787 }
10789 }
10790
10792 {
10793 #ifdef SERVER
10794 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10795 GetHierarchyParent().IncreaseLifetimeUp();
10796 #endif
10797 };
10798
10800 {
10801 PlayerBase p = PlayerBase.Cast(player);
10802
10803 array<int> recipesIds = p.m_Recipes;
10804 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10805 if (moduleRecipesManager)
10806 {
10807 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10808 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10809 }
10810
10811 for (int i = 0;i < recipesIds.Count(); i++)
10812 {
10813 int key = recipesIds.Get(i);
10814 string recipeName = moduleRecipesManager.GetRecipeName(key);
10816 }
10817 }
10818
10819
10820 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10821 {
10822 super.GetDebugActions(outputList);
10823
10824
10829
10830
10834
10838
10839
10842
10843
10845 {
10848 }
10849
10851
10854
10858 }
10859
10860
10861
10862
10864 {
10865 super.OnAction(action_id, player, ctx);
10866 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10867 {
10868 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10869 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10870 PlayerBase p = PlayerBase.Cast(player);
10871 if (
EActions.RECIPES_RANGE_START < 1000)
10872 {
10873 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10874 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10875 }
10876 }
10877 #ifndef SERVER
10878 else if (action_id ==
EActions.WATCH_PLAYER)
10879 {
10880 PluginDeveloper.SetDeveloperItemClientEx(player);
10881 }
10882 #endif
10884 {
10885 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10886 {
10887 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10888 OnDebugButtonPressServer(id + 1);
10889 }
10890
10891 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10892 {
10893 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10895 }
10896
10897 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10898 {
10899 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10901 }
10902
10903 else if (action_id ==
EActions.ADD_QUANTITY)
10904 {
10905 if (IsMagazine())
10906 {
10907 Magazine mag = Magazine.Cast(this);
10908 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10909 }
10910 else
10911 {
10913 }
10914
10915 if (m_EM)
10916 {
10917 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10918 }
10919
10920 }
10921
10922 else if (action_id ==
EActions.REMOVE_QUANTITY)
10923 {
10924 if (IsMagazine())
10925 {
10926 Magazine mag2 = Magazine.Cast(this);
10927 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10928 }
10929 else
10930 {
10932 }
10933 if (m_EM)
10934 {
10935 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10936 }
10937
10938 }
10939
10940 else if (action_id ==
EActions.SET_QUANTITY_0)
10941 {
10943
10944 if (m_EM)
10945 {
10946 m_EM.SetEnergy(0);
10947 }
10948 }
10949
10950 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10951 {
10953
10954 if (m_EM)
10955 {
10956 m_EM.SetEnergy(m_EM.GetEnergyMax());
10957 }
10958 }
10959
10960 else if (action_id ==
EActions.ADD_HEALTH)
10961 {
10962 AddHealth("","",GetMaxHealth("","Health")/5);
10963 }
10964 else if (action_id ==
EActions.REMOVE_HEALTH)
10965 {
10966 AddHealth("","",-GetMaxHealth("","Health")/5);
10967 }
10968 else if (action_id ==
EActions.DESTROY_HEALTH)
10969 {
10970 SetHealth01("","",0);
10971 }
10972 else if (action_id ==
EActions.WATCH_ITEM)
10973 {
10975 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10976 #ifdef DEVELOPER
10977 SetDebugDeveloper_item(this);
10978 #endif
10979 }
10980
10981 else if (action_id ==
EActions.ADD_TEMPERATURE)
10982 {
10983 AddTemperature(20);
10984
10985 }
10986
10987 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10988 {
10989 AddTemperature(-20);
10990
10991 }
10992
10993 else if (action_id ==
EActions.FLIP_FROZEN)
10994 {
10995 SetFrozen(!GetIsFrozen());
10996
10997 }
10998
10999 else if (action_id ==
EActions.ADD_WETNESS)
11000 {
11002
11003 }
11004
11005 else if (action_id ==
EActions.REMOVE_WETNESS)
11006 {
11008
11009 }
11010
11011 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11012 {
11015
11016
11017 }
11018
11019 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11020 {
11023 }
11024
11025 else if (action_id ==
EActions.MAKE_SPECIAL)
11026 {
11027 auto debugParams = DebugSpawnParams.WithPlayer(player);
11028 OnDebugSpawnEx(debugParams);
11029 }
11030
11031 else if (action_id ==
EActions.DELETE)
11032 {
11033 Delete();
11034 }
11035
11036 }
11037
11038
11039 return false;
11040 }
11041
11042
11043
11044
11048
11051
11052
11053
11055 {
11056 return false;
11057 }
11058
11059
11061 {
11062 return true;
11063 }
11064
11065
11067 {
11068 return true;
11069 }
11070
11071
11072
11074 {
11075 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11077 }
11078
11081 {
11082 return null;
11083 }
11084
11086 {
11087 return false;
11088 }
11089
11091 {
11092 return false;
11093 }
11094
11098
11099
11101 {
11102 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11103 return module_repairing.CanRepair(this, item_repair_kit);
11104 }
11105
11106
11107 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11108 {
11109 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11110 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11111 }
11112
11113
11115 {
11116
11117
11118
11119
11120
11121
11122
11123
11124 return 1;
11125 }
11126
11127
11128
11130 {
11132 }
11133
11134
11135
11137 {
11139 }
11140
11141
11150 {
11151 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11152
11153 if (player)
11154 {
11155 player.MessageStatus(text);
11156 }
11157 }
11158
11159
11168 {
11169 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11170
11171 if (player)
11172 {
11173 player.MessageAction(text);
11174 }
11175 }
11176
11177
11186 {
11187 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11188
11189 if (player)
11190 {
11191 player.MessageFriendly(text);
11192 }
11193 }
11194
11195
11204 {
11205 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11206
11207 if (player)
11208 {
11209 player.MessageImportant(text);
11210 }
11211 }
11212
11214 {
11215 return true;
11216 }
11217
11218
11219 override bool KindOf(
string tag)
11220 {
11221 bool found = false;
11222 string item_name = this.
GetType();
11225
11226 int array_size = item_tag_array.Count();
11227 for (int i = 0; i < array_size; i++)
11228 {
11229 if (item_tag_array.Get(i) == tag)
11230 {
11231 found = true;
11232 break;
11233 }
11234 }
11235 return found;
11236 }
11237
11238
11240 {
11241
11242 super.OnRPC(sender, rpc_type,ctx);
11243
11244
11245 switch (rpc_type)
11246 {
11247 #ifndef SERVER
11248 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11249 Param2<bool, string> p = new Param2<bool, string>(false, "");
11250
11252 return;
11253
11254 bool play = p.param1;
11255 string soundSet = p.param2;
11256
11257 if (play)
11258 {
11260 {
11262 {
11264 }
11265 }
11266 else
11267 {
11269 }
11270 }
11271 else
11272 {
11274 }
11275
11276 break;
11277 #endif
11278
11279 }
11280
11282 {
11284 }
11285 }
11286
11287
11288
11289
11291 {
11292 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11293 return plugin.GetID(
name);
11294 }
11295
11297 {
11298 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11299 return plugin.GetName(id);
11300 }
11301
11304 {
11305
11306
11307 int varFlags;
11308 if (!ctx.
Read(varFlags))
11309 return;
11310
11311 if (varFlags & ItemVariableFlags.FLOAT)
11312 {
11314 }
11315 }
11316
11318 {
11319
11320 super.SerializeNumericalVars(floats_out);
11321
11322
11323
11325 {
11327 }
11328
11330 {
11332 }
11333
11335 {
11337 }
11338
11340 {
11345 }
11346
11348 {
11350 }
11351 }
11352
11354 {
11355
11356 super.DeSerializeNumericalVars(floats);
11357
11358
11359 int index = 0;
11360 int mask = Math.Round(floats.Get(index));
11361
11362 index++;
11363
11365 {
11367 {
11369 }
11370 else
11371 {
11372 float quantity = floats.Get(index);
11373 SetQuantity(quantity,
true,
false,
false,
false);
11374 }
11375 index++;
11376 }
11377
11379 {
11380 float wet = floats.Get(index);
11382 index++;
11383 }
11384
11386 {
11387 int liquidtype = Math.Round(floats.Get(index));
11389 index++;
11390 }
11391
11393 {
11395 index++;
11397 index++;
11399 index++;
11401 index++;
11402 }
11403
11405 {
11406 int cleanness = Math.Round(floats.Get(index));
11408 index++;
11409 }
11410 }
11411
11413 {
11414 super.WriteVarsToCTX(ctx);
11415
11416
11418 {
11420 }
11421
11423 {
11425 }
11426
11428 {
11430 }
11431
11433 {
11434 int r,g,b,a;
11440 }
11441
11443 {
11445 }
11446 }
11447
11449 {
11450 if (!super.ReadVarsFromCTX(ctx,version))
11451 return false;
11452
11453 int intValue;
11454 float value;
11455
11456 if (version < 140)
11457 {
11458 if (!ctx.
Read(intValue))
11459 return false;
11460
11461 m_VariablesMask = intValue;
11462 }
11463
11465 {
11466 if (!ctx.
Read(value))
11467 return false;
11468
11470 {
11472 }
11473 else
11474 {
11476 }
11477 }
11478
11479 if (version < 140)
11480 {
11482 {
11483 if (!ctx.
Read(value))
11484 return false;
11485 SetTemperatureDirect(value);
11486 }
11487 }
11488
11490 {
11491 if (!ctx.
Read(value))
11492 return false;
11494 }
11495
11497 {
11498 if (!ctx.
Read(intValue))
11499 return false;
11501 }
11502
11504 {
11505 int r,g,b,a;
11507 return false;
11509 return false;
11511 return false;
11513 return false;
11514
11516 }
11517
11519 {
11520 if (!ctx.
Read(intValue))
11521 return false;
11523 }
11524
11525 if (version >= 138 && version < 140)
11526 {
11528 {
11529 if (!ctx.
Read(intValue))
11530 return false;
11531 SetFrozen(intValue);
11532 }
11533 }
11534
11535 return true;
11536 }
11537
11538
11540 {
11543 {
11545 }
11546
11547 if (!super.OnStoreLoad(ctx, version))
11548 {
11550 return false;
11551 }
11552
11553 if (version >= 114)
11554 {
11555 bool hasQuickBarIndexSaved;
11556
11557 if (!ctx.
Read(hasQuickBarIndexSaved))
11558 {
11560 return false;
11561 }
11562
11563 if (hasQuickBarIndexSaved)
11564 {
11565 int itmQBIndex;
11566
11567
11568 if (!ctx.
Read(itmQBIndex))
11569 {
11571 return false;
11572 }
11573
11574 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11575 if (itmQBIndex != -1 && parentPlayer)
11576 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11577 }
11578 }
11579 else
11580 {
11581
11582 PlayerBase player;
11583 int itemQBIndex;
11584 if (version ==
int.
MAX)
11585 {
11586 if (!ctx.
Read(itemQBIndex))
11587 {
11589 return false;
11590 }
11591 }
11592 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11593 {
11594
11595 if (!ctx.
Read(itemQBIndex))
11596 {
11598 return false;
11599 }
11600 if (itemQBIndex != -1 && player)
11601 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11602 }
11603 }
11604
11605 if (version < 140)
11606 {
11607
11608 if (!LoadVariables(ctx, version))
11609 {
11611 return false;
11612 }
11613 }
11614
11615
11617 {
11619 return false;
11620 }
11621 if (version >= 132)
11622 {
11624 if (raib)
11625 {
11627 {
11629 return false;
11630 }
11631 }
11632 }
11633
11635 return true;
11636 }
11637
11638
11639
11641 {
11642 super.OnStoreSave(ctx);
11643
11644 PlayerBase player;
11645 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11646 {
11648
11649 int itemQBIndex = -1;
11650 itemQBIndex = player.FindQuickBarEntityIndex(this);
11651 ctx.
Write(itemQBIndex);
11652 }
11653 else
11654 {
11656 }
11657
11659
11661 if (raib)
11662 {
11664 }
11665 }
11666
11667
11669 {
11670 super.AfterStoreLoad();
11671
11673 {
11675 }
11676
11678 {
11681 }
11682 }
11683
11685 {
11686 super.EEOnAfterLoad();
11687
11689 {
11691 }
11692
11695 }
11696
11698 {
11699 return false;
11700 }
11701
11702
11703
11705 {
11707 {
11708 #ifdef PLATFORM_CONSOLE
11709
11711 {
11713 if (menu)
11714 {
11716 }
11717 }
11718 #endif
11719 }
11720
11722 {
11725 }
11726
11728 {
11729 SetWeightDirty();
11731 }
11733 {
11736 }
11737
11739 {
11742 }
11744 {
11747 }
11748
11749 super.OnVariablesSynchronized();
11750 }
11751
11752
11753
11755 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11756 {
11757 if (!IsServerCheck(allow_client))
11758 return false;
11759
11761 return false;
11762
11765
11766 if (value <= (min + 0.001))
11767 value = min;
11768
11769 if (value == min)
11770 {
11771 if (destroy_config)
11772 {
11773 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11774 if (dstr)
11775 {
11777 this.Delete();
11778 return true;
11779 }
11780 }
11781 else if (destroy_forced)
11782 {
11784 this.Delete();
11785 return true;
11786 }
11787
11789 }
11790
11793
11795 {
11797
11798 if (delta)
11800 }
11801
11803
11804 return false;
11805 }
11806
11807
11809 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11810 {
11812 }
11813
11815 {
11818 }
11819
11821 {
11824 }
11825
11828 {
11829 float value_clamped = Math.Clamp(value, 0, 1);
11831 SetQuantity(result, destroy_config, destroy_forced);
11832 }
11833
11834
11837 {
11839 }
11840
11842 {
11844 }
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11856 {
11857 int slot = -1;
11858 if (GetInventory())
11859 {
11860 InventoryLocation il = new InventoryLocation;
11861 GetInventory().GetCurrentInventoryLocation(il);
11863 }
11864
11866 }
11867
11869 {
11870 float quantity_max = 0;
11871
11873 {
11874 if (attSlotID != -1)
11875 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11876
11877 if (quantity_max <= 0)
11879 }
11880
11881 if (quantity_max <= 0)
11883
11884 return quantity_max;
11885 }
11886
11888 {
11890 }
11891
11893 {
11895 }
11896
11897
11899 {
11901 }
11902
11904 {
11906 }
11907
11909 {
11911 }
11912
11913
11915 {
11916
11917 float weightEx = GetWeightEx();
11918 float special = GetInventoryAndCargoWeight();
11919 return weightEx - special;
11920 }
11921
11922
11924 {
11926 }
11927
11929 {
11931 {
11932 #ifdef DEVELOPER
11933 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11934 {
11935 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11937 }
11938 #endif
11939
11940 return GetQuantity() * GetConfigWeightModified();
11941 }
11942 else if (HasEnergyManager())
11943 {
11944 #ifdef DEVELOPER
11945 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11946 {
11947 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11948 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11949 }
11950 #endif
11951 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11952 }
11953 else
11954 {
11955 #ifdef DEVELOPER
11956 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11957 {
11958 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11959 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11960 }
11961 #endif
11962 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11963 }
11964 }
11965
11968 {
11969 int item_count = 0;
11971
11972 if (GetInventory().GetCargo() != NULL)
11973 {
11974 item_count = GetInventory().GetCargo().GetItemCount();
11975 }
11976
11977 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11978 {
11979 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11980 if (item)
11981 item_count += item.GetNumberOfItems();
11982 }
11983 return item_count;
11984 }
11985
11988 {
11989 float weight = 0;
11990 float wetness = 1;
11991 if (include_wetness)
11994 {
11995 weight = wetness * m_ConfigWeight;
11996 }
11998 {
11999 weight = 1;
12000 }
12001 return weight;
12002 }
12003
12004
12005
12007 {
12008 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12009 {
12010 GameInventory inv = GetInventory();
12011 array<EntityAI> items = new array<EntityAI>;
12013 for (int i = 0; i < items.Count(); i++)
12014 {
12016 if (item)
12017 {
12019 }
12020 }
12021 }
12022 }
12023
12024
12025
12026
12028 {
12029 float energy = 0;
12030 if (HasEnergyManager())
12031 {
12032 energy = GetCompEM().GetEnergy();
12033 }
12034 return energy;
12035 }
12036
12037
12039 {
12040 super.OnEnergyConsumed();
12041
12043 }
12044
12046 {
12047 super.OnEnergyAdded();
12048
12050 }
12051
12052
12054 {
12055 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12056 {
12058 {
12059 float energy_0to1 = GetCompEM().GetEnergy0To1();
12061 }
12062 }
12063 }
12064
12065
12067 {
12068 return ConfigGetFloat("heatIsolation");
12069 }
12070
12072 {
12074 }
12075
12077 {
12078 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12079 if (
GetGame().ConfigIsExisting(paramPath))
12081
12082 return 0.0;
12083 }
12084
12086 {
12087 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12088 if (
GetGame().ConfigIsExisting(paramPath))
12090
12091 return 0.0;
12092 }
12093
12094 override void SetWet(
float value,
bool allow_client =
false)
12095 {
12096 if (!IsServerCheck(allow_client))
12097 return;
12098
12101
12103
12104 m_VarWet = Math.Clamp(value, min, max);
12105
12107 {
12110 }
12111 }
12112
12113 override void AddWet(
float value)
12114 {
12116 }
12117
12119 {
12121 }
12122
12124 {
12126 }
12127
12129 {
12131 }
12132
12134 {
12136 }
12137
12139 {
12141 }
12142
12143 override void OnWetChanged(
float newVal,
float oldVal)
12144 {
12147 if (newLevel != oldLevel)
12148 {
12150 }
12151 }
12152
12154 {
12155 SetWeightDirty();
12156 }
12157
12159 {
12160 return GetWetLevelInternal(
m_VarWet);
12161 }
12162
12163
12164
12166 {
12168 }
12169
12171 {
12173 }
12174
12176 {
12178 }
12179
12181 {
12183 }
12184
12185
12186
12188 {
12189 if (ConfigIsExisting("itemModelLength"))
12190 {
12191 return ConfigGetFloat("itemModelLength");
12192 }
12193 return 0;
12194 }
12195
12197 {
12198 if (ConfigIsExisting("itemAttachOffset"))
12199 {
12200 return ConfigGetFloat("itemAttachOffset");
12201 }
12202 return 0;
12203 }
12204
12205 override void SetCleanness(
int value,
bool allow_client =
false)
12206 {
12207 if (!IsServerCheck(allow_client))
12208 return;
12209
12211
12213
12216 }
12217
12219 {
12221 }
12222
12224 {
12225 return true;
12226 }
12227
12228
12229
12230
12232 {
12234 }
12235
12237 {
12239 }
12240
12241
12242
12243
12244 override void SetColor(
int r,
int g,
int b,
int a)
12245 {
12251 }
12253 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12254 {
12259 }
12260
12262 {
12264 }
12265
12268 {
12269 int r,g,b,a;
12271 r = r/255;
12272 g = g/255;
12273 b = b/255;
12274 a = a/255;
12275 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12276 }
12277
12278
12279
12280 override void SetLiquidType(
int value,
bool allow_client =
false)
12281 {
12282 if (!IsServerCheck(allow_client))
12283 return;
12284
12289 }
12290
12292 {
12293 return ConfigGetInt("varLiquidTypeInit");
12294 }
12295
12297 {
12299 }
12300
12302 {
12304 SetFrozen(false);
12305 }
12306
12309 {
12310 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12311 }
12312
12313
12316 {
12317 PlayerBase nplayer;
12318 if (PlayerBase.CastTo(nplayer, player))
12319 {
12321
12322 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12323 }
12324 }
12325
12326
12329 {
12330 PlayerBase nplayer;
12331 if (PlayerBase.CastTo(nplayer,player))
12332 {
12333
12334 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12335
12336 }
12337
12338
12339 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12340
12341
12342 if (HasEnergyManager())
12343 {
12344 GetCompEM().UpdatePlugState();
12345 }
12346 }
12347
12348
12350 {
12351 super.OnPlacementStarted(player);
12352
12354 }
12355
12356 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12357 {
12359 {
12360 m_AdminLog.OnPlacementComplete(player,
this);
12361 }
12362
12363 super.OnPlacementComplete(player, position, orientation);
12364 }
12365
12366
12367
12368
12369
12371 {
12373 {
12374 return true;
12375 }
12376 else
12377 {
12378 return false;
12379 }
12380 }
12381
12382
12384 {
12386 {
12388 }
12389 }
12390
12391
12393 {
12395 }
12396
12398 {
12400 }
12401
12402 override void InsertAgent(
int agent,
float count = 1)
12403 {
12404 if (count < 1)
12405 return;
12406
12408 }
12409
12412 {
12414 }
12415
12416
12418 {
12420 }
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12464 {
12466 return false;
12467 return true;
12468 }
12469
12471 {
12472
12474 }
12475
12476
12479 {
12480 super.CheckForRoofLimited(timeTresholdMS);
12481
12483 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12484 {
12485 m_PreviousRoofTestTime = time;
12486 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12487 }
12488 }
12489
12490
12492 {
12494 {
12495 return 0;
12496 }
12497
12498 if (GetInventory().GetAttachmentSlotsCount() != 0)
12499 {
12500 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12501 if (filter)
12502 return filter.GetProtectionLevel(type, false, system);
12503 else
12504 return 0;
12505 }
12506
12507 string subclassPath, entryName;
12508
12509 switch (type)
12510 {
12512 entryName = "biological";
12513 break;
12515 entryName = "chemical";
12516 break;
12517 default:
12518 entryName = "biological";
12519 break;
12520 }
12521
12522 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12523
12525 }
12526
12527
12528
12531 {
12532 if (!IsMagazine())
12534
12536 }
12537
12538
12539
12540
12541
12546 {
12547 return true;
12548 }
12549
12551 {
12553 }
12554
12555
12556
12557
12558
12560 {
12561 if (parent)
12562 {
12563 if (parent.IsInherited(DayZInfected))
12564 return true;
12565
12566 if (!parent.IsRuined())
12567 return true;
12568 }
12569
12570 return true;
12571 }
12572
12574 {
12575 if (!super.CanPutAsAttachment(parent))
12576 {
12577 return false;
12578 }
12579
12580 if (!IsRuined() && !parent.IsRuined())
12581 {
12582 return true;
12583 }
12584
12585 return false;
12586 }
12587
12589 {
12590
12591
12592
12593
12594 return super.CanReceiveItemIntoCargo(item);
12595 }
12596
12598 {
12599
12600
12601
12602
12603 GameInventory attachmentInv = attachment.GetInventory();
12605 {
12606 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12607 return false;
12608 }
12609
12610 InventoryLocation loc = new InventoryLocation();
12611 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12612 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12613 return false;
12614
12615 return super.CanReceiveAttachment(attachment, slotId);
12616 }
12617
12619 {
12620 if (!super.CanReleaseAttachment(attachment))
12621 return false;
12622
12623 return GetInventory().AreChildrenAccessible();
12624 }
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12647 {
12648 int id = muzzle_owner.GetMuzzleID();
12649 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12650
12651 if (WPOF_array)
12652 {
12653 for (int i = 0; i < WPOF_array.Count(); i++)
12654 {
12655 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12656
12657 if (WPOF)
12658 {
12659 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12660 }
12661 }
12662 }
12663 }
12664
12665
12667 {
12668 int id = muzzle_owner.GetMuzzleID();
12670
12671 if (WPOBE_array)
12672 {
12673 for (int i = 0; i < WPOBE_array.Count(); i++)
12674 {
12675 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12676
12677 if (WPOBE)
12678 {
12679 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12680 }
12681 }
12682 }
12683 }
12684
12685
12687 {
12688 int id = muzzle_owner.GetMuzzleID();
12689 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12690
12691 if (WPOOH_array)
12692 {
12693 for (int i = 0; i < WPOOH_array.Count(); i++)
12694 {
12695 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12696
12697 if (WPOOH)
12698 {
12699 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12700 }
12701 }
12702 }
12703 }
12704
12705
12707 {
12708 int id = muzzle_owner.GetMuzzleID();
12709 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12710
12711 if (WPOOH_array)
12712 {
12713 for (int i = 0; i < WPOOH_array.Count(); i++)
12714 {
12715 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12716
12717 if (WPOOH)
12718 {
12719 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12720 }
12721 }
12722 }
12723 }
12724
12725
12727 {
12728 int id = muzzle_owner.GetMuzzleID();
12729 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12730
12731 if (WPOOH_array)
12732 {
12733 for (int i = 0; i < WPOOH_array.Count(); i++)
12734 {
12735 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12736
12737 if (WPOOH)
12738 {
12739 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12740 }
12741 }
12742 }
12743 }
12744
12745
12746
12748 {
12750 {
12751 return true;
12752 }
12753
12754 return false;
12755 }
12756
12758 {
12760 {
12761 return true;
12762 }
12763
12764 return false;
12765 }
12766
12768 {
12770 {
12771 return true;
12772 }
12773
12774 return false;
12775 }
12776
12778 {
12779 return false;
12780 }
12781
12784 {
12785 return UATimeSpent.DEFAULT_DEPLOY;
12786 }
12787
12788
12789
12790
12792 {
12794 SetSynchDirty();
12795 }
12796
12798 {
12800 }
12801
12802
12804 {
12805 return false;
12806 }
12807
12810 {
12811 string att_type = "None";
12812
12813 if (ConfigIsExisting("soundAttType"))
12814 {
12815 att_type = ConfigGetString("soundAttType");
12816 }
12817
12819 }
12820
12822 {
12824 }
12825
12826
12827
12828
12829
12833
12835 {
12838
12840 }
12841
12842
12844 {
12846 return;
12847
12849
12852
12855
12856 SoundParameters params = new SoundParameters();
12860 }
12861
12862
12864 {
12866 return;
12867
12869 SetSynchDirty();
12870
12873 }
12874
12875
12877 {
12879 return;
12880
12882 SetSynchDirty();
12883
12886 }
12887
12889 {
12891 }
12892
12894 {
12896 }
12897
12900 {
12901 if (!
GetGame().IsDedicatedServer())
12902 {
12903 if (ConfigIsExisting("attachSoundSet"))
12904 {
12905 string cfg_path = "";
12906 string soundset = "";
12907 string type_name =
GetType();
12908
12911 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12912 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12913
12914 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12915 {
12916 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12917 {
12918 if (cfg_slot_array[i] == slot_type)
12919 {
12920 soundset = cfg_soundset_array[i];
12921 break;
12922 }
12923 }
12924 }
12925
12926 if (soundset != "")
12927 {
12928 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12930 }
12931 }
12932 }
12933 }
12934
12936 {
12937
12938 }
12939
12940 void OnApply(PlayerBase player);
12941
12943 {
12944 return 1.0;
12945 };
12946
12948 {
12950 }
12951
12953 {
12955 }
12956
12958
12960 {
12961 SetDynamicPhysicsLifeTime(0.01);
12963 }
12964
12966 {
12967 array<string> zone_names = new array<string>;
12968 GetDamageZones(zone_names);
12969 for (int i = 0; i < zone_names.Count(); i++)
12970 {
12971 SetHealthMax(zone_names.Get(i),"Health");
12972 }
12973 SetHealthMax("","Health");
12974 }
12975
12978 {
12979 float global_health = GetHealth01("","Health");
12980 array<string> zones = new array<string>;
12981 GetDamageZones(zones);
12982
12983 for (int i = 0; i < zones.Count(); i++)
12984 {
12985 SetHealth01(zones.Get(i),"Health",global_health);
12986 }
12987 }
12988
12991 {
12992 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12993 }
12994
12996 {
12997 if (!hasRootAsPlayer)
12998 {
12999 if (refParentIB)
13000 {
13001
13002 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13003 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13004
13005 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13006 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13007
13010 }
13011 else
13012 {
13013
13016 }
13017 }
13018 }
13019
13021 {
13023 {
13024 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13025 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13026 {
13027 float heatPermCoef = 1.0;
13029 while (ent)
13030 {
13031 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13032 ent = ent.GetHierarchyParent();
13033 }
13034
13035 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13036 }
13037 }
13038 }
13039
13041 {
13042
13043 EntityAI parent = GetHierarchyParent();
13044 if (!parent)
13045 {
13046 hasParent = false;
13047 hasRootAsPlayer = false;
13048 }
13049 else
13050 {
13051 hasParent = true;
13052 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13053 refParentIB =
ItemBase.Cast(parent);
13054 }
13055 }
13056
13057 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13058 {
13059
13060 }
13061
13063 {
13064
13065 return false;
13066 }
13067
13069 {
13070
13071
13072 return false;
13073 }
13074
13076 {
13077
13078 return false;
13079 }
13080
13083 {
13084 return !GetIsFrozen() &&
IsOpen();
13085 }
13086
13088 {
13089 bool hasParent = false, hasRootAsPlayer = false;
13091
13092 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13093 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13094
13095 if (wwtu || foodDecay)
13096 {
13100
13101 if (processWetness || processTemperature || processDecay)
13102 {
13104
13105 if (processWetness)
13106 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13107
13108 if (processTemperature)
13110
13111 if (processDecay)
13112 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13113 }
13114 }
13115 }
13116
13119 {
13121 }
13122
13124 {
13127
13128 return super.GetTemperatureFreezeThreshold();
13129 }
13130
13132 {
13135
13136 return super.GetTemperatureThawThreshold();
13137 }
13138
13140 {
13143
13144 return super.GetItemOverheatThreshold();
13145 }
13146
13148 {
13150 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13151
13152 return super.GetTemperatureFreezeTime();
13153 }
13154
13156 {
13158 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13159
13160 return super.GetTemperatureThawTime();
13161 }
13162
13167
13169 {
13170 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13171 }
13172
13174 {
13175 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13176 }
13177
13180 {
13182 }
13183
13185 {
13187 }
13188
13190 {
13192 }
13193
13196 {
13197 return null;
13198 }
13199
13202 {
13203 return false;
13204 }
13205
13207 {
13209 {
13212 if (!trg)
13213 {
13215 explosive = this;
13216 }
13217
13218 explosive.PairRemote(trg);
13220
13221 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13222 trg.SetPersistentPairID(persistentID);
13223 explosive.SetPersistentPairID(persistentID);
13224
13225 return true;
13226 }
13227 return false;
13228 }
13229
13232 {
13233 float ret = 1.0;
13236 ret *= GetHealth01();
13237
13238 return ret;
13239 }
13240
13241 #ifdef DEVELOPER
13242 override void SetDebugItem()
13243 {
13244 super.SetDebugItem();
13245 _itemBase = this;
13246 }
13247
13249 {
13250 string text = super.GetDebugText();
13251
13253 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13254
13255 return text;
13256 }
13257 #endif
13258
13260 {
13261 return true;
13262 }
13263
13265
13267
13269 {
13272 }
13273
13274
13282
13298}
13299
13301{
13303 if (entity)
13304 {
13305 bool is_item = entity.IsInherited(
ItemBase);
13306 if (is_item && full_quantity)
13307 {
13310 }
13311 }
13312 else
13313 {
13315 return NULL;
13316 }
13317 return entity;
13318}
13319
13321{
13322 if (item)
13323 {
13324 if (health > 0)
13325 item.SetHealth("", "", health);
13326
13327 if (item.CanHaveTemperature())
13328 {
13330 if (item.CanFreeze())
13331 item.SetFrozen(false);
13332 }
13333
13334 if (item.HasEnergyManager())
13335 {
13336 if (quantity >= 0)
13337 {
13338 item.GetCompEM().SetEnergy0To1(quantity);
13339 }
13340 else
13341 {
13343 }
13344 }
13345 else if (item.IsMagazine())
13346 {
13347 Magazine mag = Magazine.Cast(item);
13348 if (quantity >= 0)
13349 {
13350 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13351 }
13352 else
13353 {
13355 }
13356
13357 }
13358 else
13359 {
13360 if (quantity >= 0)
13361 {
13362 item.SetQuantityNormalized(quantity, false);
13363 }
13364 else
13365 {
13367 }
13368
13369 }
13370 }
13371}
13372
13373#ifdef DEVELOPER
13375#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.