To be called on moving item within character's inventory; 'player' should never be null.
8563{
8565 {
8566 return true;
8567 }
8568};
8569
8570
8571
8573{
8577
8579
8582
8583
8584
8585
8586
8595
8601
8606
8611
8632 protected bool m_IsResultOfSplit
8633
8635
8640
8641
8642
8644
8648
8649
8650
8652
8655
8656
8657
8663
8664
8672
8675
8676
8678
8679
8681
8682
8687
8688
8693
8694
8696
8697
8699 {
8704
8705 if (!
GetGame().IsDedicatedServer())
8706 {
8708 {
8710
8712 {
8714 }
8715 }
8716
8719 }
8720
8721 m_OldLocation = null;
8722
8724 {
8726 }
8727
8728 if (ConfigIsExisting("headSelectionsToHide"))
8729 {
8732 }
8733
8735 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8736 {
8738 }
8739
8741
8742 m_IsResultOfSplit = false;
8743
8745 }
8746
8748 {
8749 super.InitItemVariables();
8750
8756 m_Count = ConfigGetInt(
"count");
8757
8760
8765
8768
8773
8785
8789
8790
8793 if (ConfigIsExisting("canBeSplit"))
8794 {
8797 }
8798
8800 if (ConfigIsExisting("itemBehaviour"))
8802
8803
8806 RegisterNetSyncVariableInt("m_VarLiquidType");
8807 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8808
8809 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8810 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8811 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8812
8813 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8814 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8815 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8816 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8817
8818 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8819 RegisterNetSyncVariableBool("m_IsTakeable");
8820 RegisterNetSyncVariableBool("m_IsHologram");
8821
8824 {
8827 }
8828
8830
8832 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8834
8835 }
8836
8838 {
8840 }
8841
8843 {
8846 {
8851 }
8852 }
8853
8854 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8855 {
8857 {
8860 }
8861
8863 }
8864
8866 {
8872 }
8873
8875
8877 {
8879
8880 if (!action)
8881 {
8882 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8883 return;
8884 }
8885
8887 if (!ai)
8888 {
8890 return;
8891 }
8892
8894 if (!action_array)
8895 {
8896 action_array = new array<ActionBase_Basic>;
8898 }
8899 if (LogManager.IsActionLogEnable())
8900 {
8901 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8902 }
8903
8904 if (action_array.Find(action) != -1)
8905 {
8906 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8907 }
8908 else
8909 {
8910 action_array.Insert(action);
8911 }
8912 }
8913
8915 {
8917 ActionBase action = player.GetActionManager().GetAction(actionName);
8920
8921 if (action_array)
8922 {
8923 action_array.RemoveItem(action);
8924 }
8925 }
8926
8927
8928
8930 {
8931 ActionOverrideData overrideData = new ActionOverrideData();
8935
8937 if (!actionMap)
8938 {
8941 }
8942
8943 actionMap.Insert(this.
Type(), overrideData);
8944
8945 }
8946
8948
8950
8951
8953 {
8956
8959
8960 string config_to_search = "CfgVehicles";
8961 string muzzle_owner_config;
8962
8964 {
8965 if (IsInherited(Weapon))
8966 config_to_search = "CfgWeapons";
8967
8968 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8969
8970 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8971
8973
8974 if (config_OnFire_subclass_count > 0)
8975 {
8976 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8977
8978 for (int i = 0; i < config_OnFire_subclass_count; i++)
8979 {
8980 string particle_class = "";
8982 string config_OnFire_entry = config_OnFire_class + particle_class;
8983 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8984 WPOF_array.Insert(WPOF);
8985 }
8986
8987
8989 }
8990 }
8991
8993 {
8994 config_to_search = "CfgWeapons";
8995 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8996
8997 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8998
9000
9001 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9002 {
9003 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9004
9005 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9006 {
9007 string particle_class2 = "";
9009 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9010 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9011 WPOBE_array.Insert(WPOBE);
9012 }
9013
9014
9016 }
9017 }
9018 }
9019
9020
9022 {
9025
9027 {
9028 string config_to_search = "CfgVehicles";
9029
9030 if (IsInherited(Weapon))
9031 config_to_search = "CfgWeapons";
9032
9033 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9034 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9035
9036 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9037 {
9038
9040
9042 {
9044 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9046 return;
9047 }
9048
9051
9052
9053
9055 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9056
9057 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9058 {
9059 string particle_class = "";
9061 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9063
9064 if (entry_type == CT_CLASS)
9065 {
9066 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9067 WPOOH_array.Insert(WPOF);
9068 }
9069 }
9070
9071
9073 }
9074 }
9075 }
9076
9078 {
9080 }
9081
9083 {
9085 {
9087
9090
9093
9094 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9095 }
9096 }
9097
9099 {
9101 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9102
9104 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9105
9107 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9108
9110 {
9112 }
9113 }
9114
9116 {
9118 }
9119
9121 {
9124 else
9126
9128 {
9131 }
9132 else
9133 {
9136
9139 }
9140
9142 }
9143
9145 {
9147 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9148 }
9149
9151 {
9153 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9155 }
9156
9158 {
9160 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9161 }
9162
9164 {
9167
9168 OverheatingParticle OP = new OverheatingParticle();
9173
9175 }
9176
9178 {
9181
9182 return -1;
9183 }
9184
9186 {
9188 {
9191
9192 for (int i = count; i > 0; --i)
9193 {
9194 int id = i - 1;
9197
9200
9201 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9202 {
9203 if (p)
9204 {
9207 }
9208 }
9209 }
9210 }
9211 }
9212
9214 {
9216 {
9218 {
9219 int id = i - 1;
9221
9222 if (OP)
9223 {
9225
9226 if (p)
9227 {
9229 }
9230
9231 delete OP;
9232 }
9233 }
9234
9237 }
9238 }
9239
9242 {
9243 return 0.0;
9244 }
9245
9246
9248 {
9249 return 250;
9250 }
9251
9253 {
9254 return 0;
9255 }
9256
9259 {
9261 return true;
9262
9263 return false;
9264 }
9265
9268 {
9271
9273 {
9275 }
9276 else
9277 {
9278
9280 }
9281
9283 }
9284
9291 {
9292 return -1;
9293 }
9294
9295
9296
9297
9299 {
9301 {
9303 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9304
9305 if (r_index >= 0)
9306 {
9307 InventoryLocation r_il = new InventoryLocation;
9308 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9309
9310 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9313 {
9314 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9315 }
9317 {
9318 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9319 }
9320
9321 }
9322
9323 player.GetHumanInventory().ClearUserReservedLocation(this);
9324 }
9325
9328 }
9329
9330
9331
9332
9334 {
9335 return ItemBase.m_DebugActionsMask;
9336 }
9337
9339 {
9340 return ItemBase.m_DebugActionsMask & mask;
9341 }
9342
9344 {
9345 ItemBase.m_DebugActionsMask = mask;
9346 }
9347
9349 {
9350 ItemBase.m_DebugActionsMask |= mask;
9351 }
9352
9354 {
9355 ItemBase.m_DebugActionsMask &= ~mask;
9356 }
9357
9359 {
9361 {
9363 }
9364 else
9365 {
9367 }
9368 }
9369
9370
9372 {
9373 if (GetEconomyProfile())
9374 {
9375 float q_max = GetEconomyProfile().GetQuantityMax();
9376 if (q_max > 0)
9377 {
9378 float q_min = GetEconomyProfile().GetQuantityMin();
9379 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9380
9382 {
9383 ComponentEnergyManager comp = GetCompEM();
9385 {
9387 }
9388 }
9390 {
9392
9393 }
9394
9395 }
9396 }
9397 }
9398
9401 {
9402 EntityAI parent = GetHierarchyParent();
9403
9404 if (parent)
9405 {
9406 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9407 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9408 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9409 }
9410 }
9411
9414 {
9415 EntityAI parent = GetHierarchyParent();
9416
9417 if (parent)
9418 {
9419 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9420 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9421 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9422 }
9423 }
9424
9426 {
9427
9428
9429
9430
9432
9434 {
9435 if (ScriptInputUserData.CanStoreInputUserData())
9436 {
9437 ScriptInputUserData ctx = new ScriptInputUserData;
9443 ctx.
Write(use_stack_max);
9446
9448 {
9449 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9450 }
9451 }
9452 }
9453 else if (!
GetGame().IsMultiplayer())
9454 {
9456 }
9457 }
9458
9460 {
9462 }
9463
9465 {
9467 }
9468
9470 {
9472 }
9473
9475 {
9476
9477 return false;
9478 }
9479
9481 {
9482 return false;
9483 }
9484
9488 {
9489 return false;
9490 }
9491
9493 {
9494 return "";
9495 }
9496
9498
9500 {
9501 return false;
9502 }
9503
9505 {
9506 return true;
9507 }
9508
9509
9510
9512 {
9513 return true;
9514 }
9515
9517 {
9518 return true;
9519 }
9520
9522 {
9523 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9525 }
9526
9528 {
9530 }
9531
9533 {
9535 if (!is_being_placed)
9537 SetSynchDirty();
9538 }
9539
9540
9542
9544 {
9546 }
9547
9549 {
9551 }
9552
9554 {
9555 return 1;
9556 }
9557
9559 {
9560 return false;
9561 }
9562
9564 {
9566 SetSynchDirty();
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
9596
9597
9598
9599
9600
9601
9602
9604 {
9605 super.OnMovedInsideCargo(container);
9606
9607 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9608 }
9609
9610 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9611 {
9612 super.EEItemLocationChanged(oldLoc,newLoc);
9613
9614 PlayerBase new_player = null;
9615 PlayerBase old_player = null;
9616
9617 if (newLoc.GetParent())
9618 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9619
9620 if (oldLoc.GetParent())
9621 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9622
9624 {
9625 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9626
9627 if (r_index >= 0)
9628 {
9629 InventoryLocation r_il = new InventoryLocation;
9630 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9631
9632 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9635 {
9636 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9637 }
9639 {
9640 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9641 }
9642
9643 }
9644 }
9645
9647 {
9648 if (new_player)
9649 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9650
9651 if (new_player == old_player)
9652 {
9653
9654 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9655 {
9657 {
9658 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9659 {
9660 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9661 }
9662 }
9663 else
9664 {
9665 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9666 }
9667 }
9668
9669 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9670 {
9671 int type = oldLoc.GetType();
9673 {
9674 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9675 }
9677 {
9678 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9679 }
9680 }
9681 if (!m_OldLocation)
9682 {
9683 m_OldLocation = new InventoryLocation;
9684 }
9685 m_OldLocation.Copy(oldLoc);
9686 }
9687 else
9688 {
9689 if (m_OldLocation)
9690 {
9691 m_OldLocation.Reset();
9692 }
9693 }
9694
9696 }
9697 else
9698 {
9699 if (new_player)
9700 {
9701 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9702 if (res_index >= 0)
9703 {
9704 InventoryLocation il = new InventoryLocation;
9705 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9707 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9710 {
9711 il.
GetParent().GetOnReleaseLock().Invoke(it);
9712 }
9714 {
9716 }
9717
9718 }
9719 }
9721 {
9722
9724 }
9725
9726 if (m_OldLocation)
9727 {
9728 m_OldLocation.Reset();
9729 }
9730 }
9731 }
9732
9733 override void EOnContact(IEntity other, Contact extra)
9734 {
9736 {
9737 int liquidType = -1;
9739 if (impactSpeed > 0.0)
9740 {
9742 #ifndef SERVER
9744 #else
9746 SetSynchDirty();
9747 #endif
9749 }
9750 }
9751
9752 #ifdef SERVER
9753 if (GetCompEM() && GetCompEM().IsPlugged())
9754 {
9755 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9756 GetCompEM().UnplugThis();
9757 }
9758 #endif
9759 }
9760
9762
9764 {
9766 }
9767
9769 {
9770
9771 }
9772
9774 {
9775 super.OnItemLocationChanged(old_owner, new_owner);
9776
9777 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9778 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9779
9780 if (!relatedPlayer && playerNew)
9781 relatedPlayer = playerNew;
9782
9783 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9784 {
9786 if (actionMgr)
9787 {
9788 ActionBase currentAction = actionMgr.GetRunningAction();
9789 if (currentAction)
9791 }
9792 }
9793
9794 Man ownerPlayerOld = null;
9795 Man ownerPlayerNew = null;
9796
9797 if (old_owner)
9798 {
9799 if (old_owner.
IsMan())
9800 {
9801 ownerPlayerOld = Man.Cast(old_owner);
9802 }
9803 else
9804 {
9805 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9806 }
9807 }
9808 else
9809 {
9811 {
9813
9814 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9815 {
9816 GetCompEM().UnplugThis();
9817 }
9818 }
9819 }
9820
9821 if (new_owner)
9822 {
9823 if (new_owner.
IsMan())
9824 {
9825 ownerPlayerNew = Man.Cast(new_owner);
9826 }
9827 else
9828 {
9829 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9830 }
9831 }
9832
9833 if (ownerPlayerOld != ownerPlayerNew)
9834 {
9835 if (ownerPlayerOld)
9836 {
9837 array<EntityAI> subItemsExit = new array<EntityAI>;
9839 for (int i = 0; i < subItemsExit.Count(); i++)
9840 {
9843 }
9844 }
9845
9846 if (ownerPlayerNew)
9847 {
9848 array<EntityAI> subItemsEnter = new array<EntityAI>;
9850 for (int j = 0; j < subItemsEnter.Count(); j++)
9851 {
9854 }
9855 }
9856 }
9857 else if (ownerPlayerNew != null)
9858 {
9859 PlayerBase nplayer;
9860 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9861 {
9862 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9864 for (int k = 0; k < subItemsUpdate.Count(); k++)
9865 {
9867 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9868 }
9869 }
9870 }
9871
9872 if (old_owner)
9873 old_owner.OnChildItemRemoved(this);
9874 if (new_owner)
9875 new_owner.OnChildItemReceived(this);
9876 }
9877
9878
9880 {
9881 super.EEDelete(parent);
9882 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9883 if (player)
9884 {
9886
9887 if (player.IsAlive())
9888 {
9889 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9890 if (r_index >= 0)
9891 {
9892 InventoryLocation r_il = new InventoryLocation;
9893 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9894
9895 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9898 {
9899 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9900 }
9902 {
9903 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9904 }
9905
9906 }
9907
9908 player.RemoveQuickBarEntityShortcut(this);
9909 }
9910 }
9911 }
9912
9914 {
9915 super.EEKilled(killer);
9916
9919 {
9920 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9921 {
9922 if (IsMagazine())
9923 {
9924 if (Magazine.Cast(this).GetAmmoCount() > 0)
9925 {
9927 }
9928 }
9929 else
9930 {
9932 }
9933 }
9934 }
9935 }
9936
9938 {
9939 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9940
9941 super.OnWasAttached(parent, slot_id);
9942
9945
9947 }
9948
9950 {
9951 super.OnWasDetached(parent, slot_id);
9952
9955 }
9956
9958 {
9959 int idx;
9962
9963 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9964 if (inventory_slots.Count() < 1)
9965 {
9966 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9967 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9968 }
9969 else
9970 {
9971 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9972 }
9973
9974 idx = inventory_slots.Find(slot);
9975 if (idx < 0)
9976 return "";
9977
9978 return attach_types.Get(idx);
9979 }
9980
9982 {
9983 int idx = -1;
9984 string slot;
9985
9988
9989 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9990 if (inventory_slots.Count() < 1)
9991 {
9992 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9993 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9994 }
9995 else
9996 {
9997 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9998 if (detach_types.Count() < 1)
9999 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10000 }
10001
10002 for (int i = 0; i < inventory_slots.Count(); i++)
10003 {
10004 slot = inventory_slots.Get(i);
10005 }
10006
10007 if (slot != "")
10008 {
10009 if (detach_types.Count() == 1)
10010 idx = 0;
10011 else
10012 idx = inventory_slots.Find(slot);
10013 }
10014 if (idx < 0)
10015 return "";
10016
10017 return detach_types.Get(idx);
10018 }
10019
10021 {
10022
10024
10025
10026 float min_time = 1;
10027 float max_time = 3;
10028 float delay = Math.RandomFloat(min_time, max_time);
10029
10030 explode_timer.Run(delay, this, "DoAmmoExplosion");
10031 }
10032
10034 {
10035 Magazine magazine = Magazine.Cast(this);
10036 int pop_sounds_count = 6;
10037 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10038
10039
10040 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10041 string sound_name = pop_sounds[ sound_idx ];
10043
10044
10045 magazine.ServerAddAmmoCount(-1);
10046
10047
10048 float min_temp_to_explode = 100;
10049
10050 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10051 {
10053 }
10054 }
10055
10056
10057 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10058 {
10059 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10060
10061 const int CHANCE_DAMAGE_CARGO = 4;
10062 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10063 const int CHANCE_DAMAGE_NOTHING = 2;
10064
10066 {
10067 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10068 int chances;
10069 int rnd;
10070
10071 if (GetInventory().GetCargo())
10072 {
10073 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10074 rnd = Math.RandomInt(0,chances);
10075
10076 if (rnd < CHANCE_DAMAGE_CARGO)
10077 {
10079 }
10080 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10081 {
10083 }
10084 }
10085 else
10086 {
10087 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10088 rnd = Math.RandomInt(0,chances);
10089
10090 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10091 {
10093 }
10094 }
10095 }
10096 }
10097
10099 {
10100 if (GetInventory().GetCargo())
10101 {
10102 int item_count = GetInventory().GetCargo().GetItemCount();
10103 if (item_count > 0)
10104 {
10105 int random_pick = Math.RandomInt(0, item_count);
10107 if (!item.IsExplosive())
10108 {
10109 item.AddHealth("","",damage);
10110 return true;
10111 }
10112 }
10113 }
10114 return false;
10115 }
10116
10118 {
10119 int attachment_count = GetInventory().AttachmentCount();
10120 if (attachment_count > 0)
10121 {
10122 int random_pick = Math.RandomInt(0, attachment_count);
10123 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10124 if (!attachment.IsExplosive())
10125 {
10126 attachment.AddHealth("","",damage);
10127 return true;
10128 }
10129 }
10130 return false;
10131 }
10132
10134 {
10136 }
10137
10139 {
10141 return GetInventory().CanRemoveEntity();
10142
10143 return false;
10144 }
10145
10147 {
10149 return;
10150
10152 {
10153 if (ScriptInputUserData.CanStoreInputUserData())
10154 {
10155 ScriptInputUserData ctx = new ScriptInputUserData;
10160 ctx.
Write(destination_entity);
10162 ctx.
Write(slot_id);
10164 }
10165 }
10166 else if (!
GetGame().IsMultiplayer())
10167 {
10169 }
10170 }
10171
10173 {
10175 return;
10176
10177 float split_quantity_new;
10181 InventoryLocation loc = new InventoryLocation;
10182
10183 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10184 {
10186 split_quantity_new = stack_max;
10187 else
10189
10190 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10191 if (new_item)
10192 {
10193 new_item.SetResultOfSplit(true);
10194 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10196 new_item.SetQuantity(split_quantity_new);
10197 }
10198 }
10199 else if (destination_entity && slot_id == -1)
10200 {
10201 if (quantity > stack_max)
10202 split_quantity_new = stack_max;
10203 else
10204 split_quantity_new = quantity;
10205
10207 {
10210 }
10211
10212 if (new_item)
10213 {
10214 new_item.SetResultOfSplit(true);
10215 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10217 new_item.SetQuantity(split_quantity_new);
10218 }
10219 }
10220 else
10221 {
10222 if (stack_max != 0)
10223 {
10225 {
10227 }
10228
10229 if (split_quantity_new == 0)
10230 {
10231 if (!
GetGame().IsMultiplayer())
10232 player.PhysicalPredictiveDropItem(this);
10233 else
10234 player.ServerDropEntity(this);
10235 return;
10236 }
10237
10239
10240 if (new_item)
10241 {
10242 new_item.SetResultOfSplit(true);
10243 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10245 new_item.SetQuantity(stack_max);
10246 new_item.PlaceOnSurface();
10247 }
10248 }
10249 }
10250 }
10251
10253 {
10255 return;
10256
10257 float split_quantity_new;
10261 InventoryLocation loc = new InventoryLocation;
10262
10263 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10264 {
10266 split_quantity_new = stack_max;
10267 else
10269
10270 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10271 if (new_item)
10272 {
10273 new_item.SetResultOfSplit(true);
10274 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10276 new_item.SetQuantity(split_quantity_new);
10277 }
10278 }
10279 else if (destination_entity && slot_id == -1)
10280 {
10281 if (quantity > stack_max)
10282 split_quantity_new = stack_max;
10283 else
10284 split_quantity_new = quantity;
10285
10287 {
10290 }
10291
10292 if (new_item)
10293 {
10294 new_item.SetResultOfSplit(true);
10295 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10297 new_item.SetQuantity(split_quantity_new);
10298 }
10299 }
10300 else
10301 {
10302 if (stack_max != 0)
10303 {
10305 {
10307 }
10308
10310
10311 if (new_item)
10312 {
10313 new_item.SetResultOfSplit(true);
10314 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10316 new_item.SetQuantity(stack_max);
10317 new_item.PlaceOnSurface();
10318 }
10319 }
10320 }
10321 }
10322
10324 {
10326 return;
10327
10329 {
10330 if (ScriptInputUserData.CanStoreInputUserData())
10331 {
10332 ScriptInputUserData ctx = new ScriptInputUserData;
10337 dst.WriteToContext(ctx);
10339 }
10340 }
10341 else if (!
GetGame().IsMultiplayer())
10342 {
10344 }
10345 }
10346
10348 {
10350 return;
10351
10353 {
10354 if (ScriptInputUserData.CanStoreInputUserData())
10355 {
10356 ScriptInputUserData ctx = new ScriptInputUserData;
10361 ctx.
Write(destination_entity);
10367 }
10368 }
10369 else if (!
GetGame().IsMultiplayer())
10370 {
10372 }
10373 }
10374
10376 {
10378 }
10379
10381 {
10383 return this;
10384
10386 float split_quantity_new;
10388 if (dst.IsValid())
10389 {
10390 int slot_id = dst.GetSlot();
10392
10393 if (quantity > stack_max)
10394 split_quantity_new = stack_max;
10395 else
10396 split_quantity_new = quantity;
10397
10399
10400 if (new_item)
10401 {
10402 new_item.SetResultOfSplit(true);
10403 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10406 }
10407
10408 return new_item;
10409 }
10410
10411 return null;
10412 }
10413
10415 {
10417 return;
10418
10420 float split_quantity_new;
10422 if (destination_entity)
10423 {
10425 if (quantity > stackable)
10426 split_quantity_new = stackable;
10427 else
10428 split_quantity_new = quantity;
10429
10430 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10431 if (new_item)
10432 {
10433 new_item.SetResultOfSplit(true);
10434 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10436 new_item.SetQuantity(split_quantity_new);
10437 }
10438 }
10439 }
10440
10442 {
10444 return;
10445
10447 {
10448 if (ScriptInputUserData.CanStoreInputUserData())
10449 {
10450 ScriptInputUserData ctx = new ScriptInputUserData;
10455 ItemBase destination_entity =
this;
10456 ctx.
Write(destination_entity);
10460 }
10461 }
10462 else if (!
GetGame().IsMultiplayer())
10463 {
10465 }
10466 }
10467
10469 {
10471 return;
10472
10474 float split_quantity_new;
10476 if (player)
10477 {
10479 if (quantity > stackable)
10480 split_quantity_new = stackable;
10481 else
10482 split_quantity_new = quantity;
10483
10484 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10485 new_item =
ItemBase.Cast(in_hands);
10486 if (new_item)
10487 {
10488 new_item.SetResultOfSplit(true);
10489 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10491 new_item.SetQuantity(split_quantity_new);
10492 }
10493 }
10494 }
10495
10497 {
10499 return;
10500
10502 float split_quantity_new = Math.Floor(quantity * 0.5);
10503
10505
10506 if (new_item)
10507 {
10508 if (new_item.GetQuantityMax() < split_quantity_new)
10509 {
10510 split_quantity_new = new_item.GetQuantityMax();
10511 }
10512
10513 new_item.SetResultOfSplit(true);
10514 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10515
10517 {
10520 }
10521 else
10522 {
10525 }
10526 }
10527 }
10528
10530 {
10532 return;
10533
10535 float split_quantity_new = Math.Floor(quantity / 2);
10536
10537 InventoryLocation invloc = new InventoryLocation;
10539
10541 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10542
10543 if (new_item)
10544 {
10545 if (new_item.GetQuantityMax() < split_quantity_new)
10546 {
10547 split_quantity_new = new_item.GetQuantityMax();
10548 }
10550 {
10553 }
10554 else
10555 {
10558 }
10559 }
10560 }
10561
10564 {
10565 SetWeightDirty();
10567
10568 if (parent)
10569 parent.OnAttachmentQuantityChangedEx(this, delta);
10570
10572 {
10574 {
10576 }
10578 {
10579 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10581 }
10582 }
10583
10584 }
10585
10588 {
10589
10590 }
10591
10594 {
10596 }
10597
10599 {
10600 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10601
10603 {
10604 if (newLevel == GameConstants.STATE_RUINED)
10605 {
10607 EntityAI parent = GetHierarchyParent();
10608 if (parent && parent.IsFireplace())
10609 {
10610 CargoBase cargo = GetInventory().GetCargo();
10611 if (cargo)
10612 {
10614 {
10616 }
10617 }
10618 }
10619 }
10620
10622 {
10623
10625 return;
10626 }
10627
10628 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10629 {
10631 }
10632 }
10633 }
10634
10635
10637 {
10638 super.OnRightClick();
10639
10641 {
10643 {
10644 if (ScriptInputUserData.CanStoreInputUserData())
10645 {
10646 vector m4[4];
10648
10649 EntityAI root = GetHierarchyRoot();
10650
10651 InventoryLocation dst = new InventoryLocation;
10653 {
10654 if (root)
10655 {
10656 root.GetTransform(m4);
10658 }
10659 else
10660 GetInventory().GetCurrentInventoryLocation(dst);
10661 }
10662 else
10663 {
10665
10666
10667 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10668 {
10669 if (root)
10670 {
10671 root.GetTransform(m4);
10673 }
10674 else
10675 GetInventory().GetCurrentInventoryLocation(dst);
10676 }
10677 else
10678 {
10679 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10680 }
10681 }
10682
10683 ScriptInputUserData ctx = new ScriptInputUserData;
10691 }
10692 }
10693 else if (!
GetGame().IsMultiplayer())
10694 {
10696 }
10697 }
10698 }
10699
10700 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10701 {
10702
10703 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10704 return false;
10705
10706 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10707 return false;
10708
10709
10711 return false;
10712
10713
10714 Magazine mag = Magazine.Cast(this);
10715 if (mag)
10716 {
10717 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10718 return false;
10719
10720 if (stack_max_limit)
10721 {
10722 Magazine other_mag = Magazine.Cast(other_item);
10723 if (other_item)
10724 {
10725 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10726 return false;
10727 }
10728
10729 }
10730 }
10731 else
10732 {
10733
10735 return false;
10736
10738 return false;
10739 }
10740
10741 PlayerBase player = null;
10742 if (CastTo(player, GetHierarchyRootPlayer()))
10743 {
10744 if (player.GetInventory().HasAttachment(this))
10745 return false;
10746
10747 if (player.IsItemsToDelete())
10748 return false;
10749 }
10750
10751 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10752 return false;
10753
10754 int slotID;
10756 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10757 return false;
10758
10759 return true;
10760 }
10761
10763 {
10765 }
10766
10768 {
10769 return m_IsResultOfSplit;
10770 }
10771
10773 {
10774 m_IsResultOfSplit = value;
10775 }
10776
10778 {
10780 }
10781
10783 {
10784 float other_item_quantity = other_item.GetQuantity();
10785 float this_free_space;
10786
10788
10790
10791 if (other_item_quantity > this_free_space)
10792 {
10793 return this_free_space;
10794 }
10795 else
10796 {
10797 return other_item_quantity;
10798 }
10799 }
10800
10802 {
10804 }
10805
10807 {
10809 return;
10810
10811 if (!IsMagazine() && other_item)
10812 {
10814 if (quantity_used != 0)
10815 {
10816 float hp1 = GetHealth01("","");
10817 float hp2 = other_item.GetHealth01("","");
10818 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10819 hpResult = hpResult / (
GetQuantity() + quantity_used);
10820
10821 hpResult *= GetMaxHealth();
10822 Math.Round(hpResult);
10823 SetHealth("", "Health", hpResult);
10824
10826 other_item.AddQuantity(-quantity_used);
10827 }
10828 }
10830 }
10831
10833 {
10834 #ifdef SERVER
10835 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10836 GetHierarchyParent().IncreaseLifetimeUp();
10837 #endif
10838 };
10839
10841 {
10842 PlayerBase p = PlayerBase.Cast(player);
10843
10844 array<int> recipesIds = p.m_Recipes;
10845 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10846 if (moduleRecipesManager)
10847 {
10848 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10849 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10850 }
10851
10852 for (int i = 0;i < recipesIds.Count(); i++)
10853 {
10854 int key = recipesIds.Get(i);
10855 string recipeName = moduleRecipesManager.GetRecipeName(key);
10857 }
10858 }
10859
10860
10861 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10862 {
10863 super.GetDebugActions(outputList);
10864
10865
10870
10871
10875
10879
10880
10883
10884
10886 {
10889 }
10890
10892
10895
10899 }
10900
10901
10902
10903
10905 {
10906 super.OnAction(action_id, player, ctx);
10907 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10908 {
10909 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10910 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10911 PlayerBase p = PlayerBase.Cast(player);
10912 if (
EActions.RECIPES_RANGE_START < 1000)
10913 {
10914 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10915 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10916 }
10917 }
10918 #ifndef SERVER
10919 else if (action_id ==
EActions.WATCH_PLAYER)
10920 {
10921 PluginDeveloper.SetDeveloperItemClientEx(player);
10922 }
10923 #endif
10925 {
10926 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10927 {
10928 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10929 OnDebugButtonPressServer(id + 1);
10930 }
10931
10932 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10933 {
10934 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10936 }
10937
10938 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10939 {
10940 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10942 }
10943
10944 else if (action_id ==
EActions.ADD_QUANTITY)
10945 {
10946 if (IsMagazine())
10947 {
10948 Magazine mag = Magazine.Cast(this);
10949 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10950 }
10951 else
10952 {
10954 }
10955
10956 if (m_EM)
10957 {
10958 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10959 }
10960
10961 }
10962
10963 else if (action_id ==
EActions.REMOVE_QUANTITY)
10964 {
10965 if (IsMagazine())
10966 {
10967 Magazine mag2 = Magazine.Cast(this);
10968 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10969 }
10970 else
10971 {
10973 }
10974 if (m_EM)
10975 {
10976 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10977 }
10978
10979 }
10980
10981 else if (action_id ==
EActions.SET_QUANTITY_0)
10982 {
10984
10985 if (m_EM)
10986 {
10987 m_EM.SetEnergy(0);
10988 }
10989 }
10990
10991 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10992 {
10994
10995 if (m_EM)
10996 {
10997 m_EM.SetEnergy(m_EM.GetEnergyMax());
10998 }
10999 }
11000
11001 else if (action_id ==
EActions.ADD_HEALTH)
11002 {
11003 AddHealth("","",GetMaxHealth("","Health")/5);
11004 }
11005 else if (action_id ==
EActions.REMOVE_HEALTH)
11006 {
11007 AddHealth("","",-GetMaxHealth("","Health")/5);
11008 }
11009 else if (action_id ==
EActions.DESTROY_HEALTH)
11010 {
11011 SetHealth01("","",0);
11012 }
11013 else if (action_id ==
EActions.WATCH_ITEM)
11014 {
11016 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11017 #ifdef DEVELOPER
11018 SetDebugDeveloper_item(this);
11019 #endif
11020 }
11021
11022 else if (action_id ==
EActions.ADD_TEMPERATURE)
11023 {
11024 AddTemperature(20);
11025
11026 }
11027
11028 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11029 {
11030 AddTemperature(-20);
11031
11032 }
11033
11034 else if (action_id ==
EActions.FLIP_FROZEN)
11035 {
11036 SetFrozen(!GetIsFrozen());
11037
11038 }
11039
11040 else if (action_id ==
EActions.ADD_WETNESS)
11041 {
11043
11044 }
11045
11046 else if (action_id ==
EActions.REMOVE_WETNESS)
11047 {
11049
11050 }
11051
11052 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11053 {
11056
11057
11058 }
11059
11060 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11061 {
11064 }
11065
11066 else if (action_id ==
EActions.MAKE_SPECIAL)
11067 {
11068 auto debugParams = DebugSpawnParams.WithPlayer(player);
11069 OnDebugSpawnEx(debugParams);
11070 }
11071
11072 else if (action_id ==
EActions.DELETE)
11073 {
11074 Delete();
11075 }
11076
11077 }
11078
11079
11080 return false;
11081 }
11082
11083
11084
11085
11089
11092
11093
11094
11096 {
11097 return false;
11098 }
11099
11100
11102 {
11103 return true;
11104 }
11105
11106
11108 {
11109 return true;
11110 }
11111
11112
11113
11115 {
11116 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11118 }
11119
11122 {
11123 return null;
11124 }
11125
11127 {
11128 return false;
11129 }
11130
11132 {
11133 return false;
11134 }
11135
11139
11140
11142 {
11143 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11144 return module_repairing.CanRepair(this, item_repair_kit);
11145 }
11146
11147
11148 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11149 {
11150 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11151 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11152 }
11153
11154
11156 {
11157
11158
11159
11160
11161
11162
11163
11164
11165 return 1;
11166 }
11167
11168
11169
11171 {
11173 }
11174
11175
11176
11178 {
11180 }
11181
11182
11191 {
11192 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11193
11194 if (player)
11195 {
11196 player.MessageStatus(text);
11197 }
11198 }
11199
11200
11209 {
11210 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11211
11212 if (player)
11213 {
11214 player.MessageAction(text);
11215 }
11216 }
11217
11218
11227 {
11228 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11229
11230 if (player)
11231 {
11232 player.MessageFriendly(text);
11233 }
11234 }
11235
11236
11245 {
11246 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11247
11248 if (player)
11249 {
11250 player.MessageImportant(text);
11251 }
11252 }
11253
11255 {
11256 return true;
11257 }
11258
11259
11260 override bool KindOf(
string tag)
11261 {
11262 bool found = false;
11263 string item_name = this.
GetType();
11266
11267 int array_size = item_tag_array.Count();
11268 for (int i = 0; i < array_size; i++)
11269 {
11270 if (item_tag_array.Get(i) == tag)
11271 {
11272 found = true;
11273 break;
11274 }
11275 }
11276 return found;
11277 }
11278
11279
11281 {
11282
11283 super.OnRPC(sender, rpc_type,ctx);
11284
11285
11286 switch (rpc_type)
11287 {
11288 #ifndef SERVER
11289 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11290 Param2<bool, string> p = new Param2<bool, string>(false, "");
11291
11293 return;
11294
11295 bool play = p.param1;
11296 string soundSet = p.param2;
11297
11298 if (play)
11299 {
11301 {
11303 {
11305 }
11306 }
11307 else
11308 {
11310 }
11311 }
11312 else
11313 {
11315 }
11316
11317 break;
11318 #endif
11319
11320 }
11321
11323 {
11325 }
11326 }
11327
11328
11329
11330
11332 {
11333 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11334 return plugin.GetID(
name);
11335 }
11336
11338 {
11339 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11340 return plugin.GetName(id);
11341 }
11342
11345 {
11346
11347
11348 int varFlags;
11349 if (!ctx.
Read(varFlags))
11350 return;
11351
11352 if (varFlags & ItemVariableFlags.FLOAT)
11353 {
11355 }
11356 }
11357
11359 {
11360
11361 super.SerializeNumericalVars(floats_out);
11362
11363
11364
11366 {
11368 }
11369
11371 {
11373 }
11374
11376 {
11378 }
11379
11381 {
11386 }
11387
11389 {
11391 }
11392 }
11393
11395 {
11396
11397 super.DeSerializeNumericalVars(floats);
11398
11399
11400 int index = 0;
11401 int mask = Math.Round(floats.Get(index));
11402
11403 index++;
11404
11406 {
11408 {
11410 }
11411 else
11412 {
11413 float quantity = floats.Get(index);
11414 SetQuantity(quantity,
true,
false,
false,
false);
11415 }
11416 index++;
11417 }
11418
11420 {
11421 float wet = floats.Get(index);
11423 index++;
11424 }
11425
11427 {
11428 int liquidtype = Math.Round(floats.Get(index));
11430 index++;
11431 }
11432
11434 {
11436 index++;
11438 index++;
11440 index++;
11442 index++;
11443 }
11444
11446 {
11447 int cleanness = Math.Round(floats.Get(index));
11449 index++;
11450 }
11451 }
11452
11454 {
11455 super.WriteVarsToCTX(ctx);
11456
11457
11459 {
11461 }
11462
11464 {
11466 }
11467
11469 {
11471 }
11472
11474 {
11475 int r,g,b,a;
11481 }
11482
11484 {
11486 }
11487 }
11488
11490 {
11491 if (!super.ReadVarsFromCTX(ctx,version))
11492 return false;
11493
11494 int intValue;
11495 float value;
11496
11497 if (version < 140)
11498 {
11499 if (!ctx.
Read(intValue))
11500 return false;
11501
11502 m_VariablesMask = intValue;
11503 }
11504
11506 {
11507 if (!ctx.
Read(value))
11508 return false;
11509
11511 {
11513 }
11514 else
11515 {
11517 }
11518 }
11519
11520 if (version < 140)
11521 {
11523 {
11524 if (!ctx.
Read(value))
11525 return false;
11526 SetTemperatureDirect(value);
11527 }
11528 }
11529
11531 {
11532 if (!ctx.
Read(value))
11533 return false;
11535 }
11536
11538 {
11539 if (!ctx.
Read(intValue))
11540 return false;
11542 }
11543
11545 {
11546 int r,g,b,a;
11548 return false;
11550 return false;
11552 return false;
11554 return false;
11555
11557 }
11558
11560 {
11561 if (!ctx.
Read(intValue))
11562 return false;
11564 }
11565
11566 if (version >= 138 && version < 140)
11567 {
11569 {
11570 if (!ctx.
Read(intValue))
11571 return false;
11572 SetFrozen(intValue);
11573 }
11574 }
11575
11576 return true;
11577 }
11578
11579
11581 {
11584 {
11586 }
11587
11588 if (!super.OnStoreLoad(ctx, version))
11589 {
11591 return false;
11592 }
11593
11594 if (version >= 114)
11595 {
11596 bool hasQuickBarIndexSaved;
11597
11598 if (!ctx.
Read(hasQuickBarIndexSaved))
11599 {
11601 return false;
11602 }
11603
11604 if (hasQuickBarIndexSaved)
11605 {
11606 int itmQBIndex;
11607
11608
11609 if (!ctx.
Read(itmQBIndex))
11610 {
11612 return false;
11613 }
11614
11615 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11616 if (itmQBIndex != -1 && parentPlayer)
11617 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11618 }
11619 }
11620 else
11621 {
11622
11623 PlayerBase player;
11624 int itemQBIndex;
11625 if (version ==
int.
MAX)
11626 {
11627 if (!ctx.
Read(itemQBIndex))
11628 {
11630 return false;
11631 }
11632 }
11633 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11634 {
11635
11636 if (!ctx.
Read(itemQBIndex))
11637 {
11639 return false;
11640 }
11641 if (itemQBIndex != -1 && player)
11642 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11643 }
11644 }
11645
11646 if (version < 140)
11647 {
11648
11649 if (!LoadVariables(ctx, version))
11650 {
11652 return false;
11653 }
11654 }
11655
11656
11658 {
11660 return false;
11661 }
11662 if (version >= 132)
11663 {
11665 if (raib)
11666 {
11668 {
11670 return false;
11671 }
11672 }
11673 }
11674
11676 return true;
11677 }
11678
11679
11680
11682 {
11683 super.OnStoreSave(ctx);
11684
11685 PlayerBase player;
11686 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11687 {
11689
11690 int itemQBIndex = -1;
11691 itemQBIndex = player.FindQuickBarEntityIndex(this);
11692 ctx.
Write(itemQBIndex);
11693 }
11694 else
11695 {
11697 }
11698
11700
11702 if (raib)
11703 {
11705 }
11706 }
11707
11708
11710 {
11711 super.AfterStoreLoad();
11712
11714 {
11716 }
11717
11719 {
11722 }
11723 }
11724
11726 {
11727 super.EEOnAfterLoad();
11728
11730 {
11732 }
11733
11736 }
11737
11739 {
11740 return false;
11741 }
11742
11743
11744
11746 {
11748 {
11749 #ifdef PLATFORM_CONSOLE
11750
11752 {
11754 if (menu)
11755 {
11757 }
11758 }
11759 #endif
11760 }
11761
11763 {
11766 }
11767
11769 {
11770 SetWeightDirty();
11772 }
11774 {
11777 }
11778
11780 {
11783 }
11785 {
11788 }
11789
11790 super.OnVariablesSynchronized();
11791 }
11792
11793
11794
11796 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11797 {
11798 if (!IsServerCheck(allow_client))
11799 return false;
11800
11802 return false;
11803
11806
11807 if (value <= (min + 0.001))
11808 value = min;
11809
11810 if (value == min)
11811 {
11812 if (destroy_config)
11813 {
11814 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11815 if (dstr)
11816 {
11818 this.Delete();
11819 return true;
11820 }
11821 }
11822 else if (destroy_forced)
11823 {
11825 this.Delete();
11826 return true;
11827 }
11828
11830 }
11831
11834
11836 {
11838
11839 if (delta)
11841 }
11842
11844
11845 return false;
11846 }
11847
11848
11850 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11851 {
11853 }
11854
11856 {
11859 }
11860
11862 {
11865 }
11866
11869 {
11870 float value_clamped = Math.Clamp(value, 0, 1);
11872 SetQuantity(result, destroy_config, destroy_forced);
11873 }
11874
11875
11878 {
11880 }
11881
11883 {
11885 }
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11897 {
11898 int slot = -1;
11899 if (GetInventory())
11900 {
11901 InventoryLocation il = new InventoryLocation;
11902 GetInventory().GetCurrentInventoryLocation(il);
11904 }
11905
11907 }
11908
11910 {
11911 float quantity_max = 0;
11912
11914 {
11915 if (attSlotID != -1)
11916 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11917
11918 if (quantity_max <= 0)
11920 }
11921
11922 if (quantity_max <= 0)
11924
11925 return quantity_max;
11926 }
11927
11929 {
11931 }
11932
11934 {
11936 }
11937
11938
11940 {
11942 }
11943
11945 {
11947 }
11948
11950 {
11952 }
11953
11954
11956 {
11957
11958 float weightEx = GetWeightEx();
11959 float special = GetInventoryAndCargoWeight();
11960 return weightEx - special;
11961 }
11962
11963
11965 {
11967 }
11968
11970 {
11972 {
11973 #ifdef DEVELOPER
11974 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11975 {
11976 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11978 }
11979 #endif
11980
11981 return GetQuantity() * GetConfigWeightModified();
11982 }
11983 else if (HasEnergyManager())
11984 {
11985 #ifdef DEVELOPER
11986 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11987 {
11988 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11989 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11990 }
11991 #endif
11992 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11993 }
11994 else
11995 {
11996 #ifdef DEVELOPER
11997 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11998 {
11999 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12000 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12001 }
12002 #endif
12003 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12004 }
12005 }
12006
12009 {
12010 int item_count = 0;
12012
12013 if (GetInventory().GetCargo() != NULL)
12014 {
12015 item_count = GetInventory().GetCargo().GetItemCount();
12016 }
12017
12018 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12019 {
12020 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12021 if (item)
12022 item_count += item.GetNumberOfItems();
12023 }
12024 return item_count;
12025 }
12026
12029 {
12030 float weight = 0;
12031 float wetness = 1;
12032 if (include_wetness)
12035 {
12036 weight = wetness * m_ConfigWeight;
12037 }
12039 {
12040 weight = 1;
12041 }
12042 return weight;
12043 }
12044
12045
12046
12048 {
12049 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12050 {
12051 GameInventory inv = GetInventory();
12052 array<EntityAI> items = new array<EntityAI>;
12054 for (int i = 0; i < items.Count(); i++)
12055 {
12057 if (item)
12058 {
12060 }
12061 }
12062 }
12063 }
12064
12065
12066
12067
12069 {
12070 float energy = 0;
12071 if (HasEnergyManager())
12072 {
12073 energy = GetCompEM().GetEnergy();
12074 }
12075 return energy;
12076 }
12077
12078
12080 {
12081 super.OnEnergyConsumed();
12082
12084 }
12085
12087 {
12088 super.OnEnergyAdded();
12089
12091 }
12092
12093
12095 {
12096 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12097 {
12099 {
12100 float energy_0to1 = GetCompEM().GetEnergy0To1();
12102 }
12103 }
12104 }
12105
12106
12108 {
12109 return ConfigGetFloat("heatIsolation");
12110 }
12111
12113 {
12115 }
12116
12118 {
12119 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12120 if (
GetGame().ConfigIsExisting(paramPath))
12122
12123 return 0.0;
12124 }
12125
12127 {
12128 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12129 if (
GetGame().ConfigIsExisting(paramPath))
12131
12132 return 0.0;
12133 }
12134
12135 override void SetWet(
float value,
bool allow_client =
false)
12136 {
12137 if (!IsServerCheck(allow_client))
12138 return;
12139
12142
12144
12145 m_VarWet = Math.Clamp(value, min, max);
12146
12148 {
12151 }
12152 }
12153
12154 override void AddWet(
float value)
12155 {
12157 }
12158
12160 {
12162 }
12163
12165 {
12167 }
12168
12170 {
12172 }
12173
12175 {
12177 }
12178
12180 {
12182 }
12183
12184 override void OnWetChanged(
float newVal,
float oldVal)
12185 {
12188 if (newLevel != oldLevel)
12189 {
12191 }
12192 }
12193
12195 {
12196 SetWeightDirty();
12197 }
12198
12200 {
12201 return GetWetLevelInternal(
m_VarWet);
12202 }
12203
12204
12205
12207 {
12209 }
12210
12212 {
12214 }
12215
12217 {
12219 }
12220
12222 {
12224 }
12225
12226
12227
12229 {
12230 if (ConfigIsExisting("itemModelLength"))
12231 {
12232 return ConfigGetFloat("itemModelLength");
12233 }
12234 return 0;
12235 }
12236
12238 {
12239 if (ConfigIsExisting("itemAttachOffset"))
12240 {
12241 return ConfigGetFloat("itemAttachOffset");
12242 }
12243 return 0;
12244 }
12245
12246 override void SetCleanness(
int value,
bool allow_client =
false)
12247 {
12248 if (!IsServerCheck(allow_client))
12249 return;
12250
12252
12254
12257 }
12258
12260 {
12262 }
12263
12265 {
12266 return true;
12267 }
12268
12269
12270
12271
12273 {
12275 }
12276
12278 {
12280 }
12281
12282
12283
12284
12285 override void SetColor(
int r,
int g,
int b,
int a)
12286 {
12292 }
12294 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12295 {
12300 }
12301
12303 {
12305 }
12306
12309 {
12310 int r,g,b,a;
12312 r = r/255;
12313 g = g/255;
12314 b = b/255;
12315 a = a/255;
12316 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12317 }
12318
12319
12320
12321 override void SetLiquidType(
int value,
bool allow_client =
false)
12322 {
12323 if (!IsServerCheck(allow_client))
12324 return;
12325
12330 }
12331
12333 {
12334 return ConfigGetInt("varLiquidTypeInit");
12335 }
12336
12338 {
12340 }
12341
12343 {
12345 SetFrozen(false);
12346 }
12347
12350 {
12351 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12352 }
12353
12354
12357 {
12358 PlayerBase nplayer;
12359 if (PlayerBase.CastTo(nplayer, player))
12360 {
12362
12363 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12364 }
12365 }
12366
12367
12370 {
12371 PlayerBase nplayer;
12372 if (PlayerBase.CastTo(nplayer,player))
12373 {
12374
12375 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12376
12377 }
12378
12379
12380 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12381
12382
12383 if (HasEnergyManager())
12384 {
12385 GetCompEM().UpdatePlugState();
12386 }
12387 }
12388
12389
12391 {
12392 super.OnPlacementStarted(player);
12393
12395 }
12396
12397 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12398 {
12400 {
12401 m_AdminLog.OnPlacementComplete(player,
this);
12402 }
12403
12404 super.OnPlacementComplete(player, position, orientation);
12405 }
12406
12407
12408
12409
12410
12412 {
12414 {
12415 return true;
12416 }
12417 else
12418 {
12419 return false;
12420 }
12421 }
12422
12423
12425 {
12427 {
12429 }
12430 }
12431
12432
12434 {
12436 }
12437
12439 {
12441 }
12442
12443 override void InsertAgent(
int agent,
float count = 1)
12444 {
12445 if (count < 1)
12446 return;
12447
12449 }
12450
12453 {
12455 }
12456
12457
12459 {
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
12497
12498
12499
12500
12501
12502
12503
12505 {
12507 return false;
12508 return true;
12509 }
12510
12512 {
12513
12515 }
12516
12517
12520 {
12521 super.CheckForRoofLimited(timeTresholdMS);
12522
12524 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12525 {
12526 m_PreviousRoofTestTime = time;
12527 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12528 }
12529 }
12530
12531
12533 {
12535 {
12536 return 0;
12537 }
12538
12539 if (GetInventory().GetAttachmentSlotsCount() != 0)
12540 {
12541 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12542 if (filter)
12543 return filter.GetProtectionLevel(type, false, system);
12544 else
12545 return 0;
12546 }
12547
12548 string subclassPath, entryName;
12549
12550 switch (type)
12551 {
12553 entryName = "biological";
12554 break;
12556 entryName = "chemical";
12557 break;
12558 default:
12559 entryName = "biological";
12560 break;
12561 }
12562
12563 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12564
12566 }
12567
12568
12569
12572 {
12573 if (!IsMagazine())
12575
12577 }
12578
12579
12580
12581
12582
12587 {
12588 return true;
12589 }
12590
12592 {
12594 }
12595
12596
12597
12598
12599
12601 {
12602 if (parent)
12603 {
12604 if (parent.IsInherited(DayZInfected))
12605 return true;
12606
12607 if (!parent.IsRuined())
12608 return true;
12609 }
12610
12611 return true;
12612 }
12613
12615 {
12616 if (!super.CanPutAsAttachment(parent))
12617 {
12618 return false;
12619 }
12620
12621 if (!IsRuined() && !parent.IsRuined())
12622 {
12623 return true;
12624 }
12625
12626 return false;
12627 }
12628
12630 {
12631
12632
12633
12634
12635 return super.CanReceiveItemIntoCargo(item);
12636 }
12637
12639 {
12640
12641
12642
12643
12644 GameInventory attachmentInv = attachment.GetInventory();
12646 {
12647 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12648 return false;
12649 }
12650
12651 InventoryLocation loc = new InventoryLocation();
12652 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12653 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12654 return false;
12655
12656 return super.CanReceiveAttachment(attachment, slotId);
12657 }
12658
12660 {
12661 if (!super.CanReleaseAttachment(attachment))
12662 return false;
12663
12664 return GetInventory().AreChildrenAccessible();
12665 }
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12688 {
12689 int id = muzzle_owner.GetMuzzleID();
12690 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12691
12692 if (WPOF_array)
12693 {
12694 for (int i = 0; i < WPOF_array.Count(); i++)
12695 {
12696 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12697
12698 if (WPOF)
12699 {
12700 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12701 }
12702 }
12703 }
12704 }
12705
12706
12708 {
12709 int id = muzzle_owner.GetMuzzleID();
12711
12712 if (WPOBE_array)
12713 {
12714 for (int i = 0; i < WPOBE_array.Count(); i++)
12715 {
12716 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12717
12718 if (WPOBE)
12719 {
12720 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12721 }
12722 }
12723 }
12724 }
12725
12726
12728 {
12729 int id = muzzle_owner.GetMuzzleID();
12730 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12731
12732 if (WPOOH_array)
12733 {
12734 for (int i = 0; i < WPOOH_array.Count(); i++)
12735 {
12736 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12737
12738 if (WPOOH)
12739 {
12740 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12741 }
12742 }
12743 }
12744 }
12745
12746
12748 {
12749 int id = muzzle_owner.GetMuzzleID();
12750 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12751
12752 if (WPOOH_array)
12753 {
12754 for (int i = 0; i < WPOOH_array.Count(); i++)
12755 {
12756 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12757
12758 if (WPOOH)
12759 {
12760 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12761 }
12762 }
12763 }
12764 }
12765
12766
12768 {
12769 int id = muzzle_owner.GetMuzzleID();
12770 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12771
12772 if (WPOOH_array)
12773 {
12774 for (int i = 0; i < WPOOH_array.Count(); i++)
12775 {
12776 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12777
12778 if (WPOOH)
12779 {
12780 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12781 }
12782 }
12783 }
12784 }
12785
12786
12787
12789 {
12791 {
12792 return true;
12793 }
12794
12795 return false;
12796 }
12797
12799 {
12801 {
12802 return true;
12803 }
12804
12805 return false;
12806 }
12807
12809 {
12811 {
12812 return true;
12813 }
12814
12815 return false;
12816 }
12817
12819 {
12820 return false;
12821 }
12822
12825 {
12826 return UATimeSpent.DEFAULT_DEPLOY;
12827 }
12828
12829
12830
12831
12833 {
12835 SetSynchDirty();
12836 }
12837
12839 {
12841 }
12842
12843
12845 {
12846 return false;
12847 }
12848
12851 {
12852 string att_type = "None";
12853
12854 if (ConfigIsExisting("soundAttType"))
12855 {
12856 att_type = ConfigGetString("soundAttType");
12857 }
12858
12860 }
12861
12863 {
12865 }
12866
12867
12868
12869
12870
12874
12876 {
12879
12881 }
12882
12883
12885 {
12887 return;
12888
12890
12893
12896
12897 SoundParameters params = new SoundParameters();
12901 }
12902
12903
12905 {
12907 return;
12908
12910 SetSynchDirty();
12911
12914 }
12915
12916
12918 {
12920 return;
12921
12923 SetSynchDirty();
12924
12927 }
12928
12930 {
12932 }
12933
12935 {
12937 }
12938
12941 {
12942 if (!
GetGame().IsDedicatedServer())
12943 {
12944 if (ConfigIsExisting("attachSoundSet"))
12945 {
12946 string cfg_path = "";
12947 string soundset = "";
12948 string type_name =
GetType();
12949
12952 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12953 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12954
12955 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12956 {
12957 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12958 {
12959 if (cfg_slot_array[i] == slot_type)
12960 {
12961 soundset = cfg_soundset_array[i];
12962 break;
12963 }
12964 }
12965 }
12966
12967 if (soundset != "")
12968 {
12969 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12971 }
12972 }
12973 }
12974 }
12975
12977 {
12978
12979 }
12980
12981 void OnApply(PlayerBase player);
12982
12984 {
12985 return 1.0;
12986 };
12987
12989 {
12991 }
12992
12994 {
12996 }
12997
12999
13001 {
13002 SetDynamicPhysicsLifeTime(0.01);
13004 }
13005
13007 {
13008 array<string> zone_names = new array<string>;
13009 GetDamageZones(zone_names);
13010 for (int i = 0; i < zone_names.Count(); i++)
13011 {
13012 SetHealthMax(zone_names.Get(i),"Health");
13013 }
13014 SetHealthMax("","Health");
13015 }
13016
13019 {
13020 float global_health = GetHealth01("","Health");
13021 array<string> zones = new array<string>;
13022 GetDamageZones(zones);
13023
13024 for (int i = 0; i < zones.Count(); i++)
13025 {
13026 SetHealth01(zones.Get(i),"Health",global_health);
13027 }
13028 }
13029
13032 {
13033 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13034 }
13035
13037 {
13038 if (!hasRootAsPlayer)
13039 {
13040 if (refParentIB)
13041 {
13042
13043 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13044 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13045
13046 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13047 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13048
13051 }
13052 else
13053 {
13054
13057 }
13058 }
13059 }
13060
13062 {
13064 {
13065 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13066 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13067 {
13068 float heatPermCoef = 1.0;
13070 while (ent)
13071 {
13072 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13073 ent = ent.GetHierarchyParent();
13074 }
13075
13076 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13077 }
13078 }
13079 }
13080
13082 {
13083
13084 EntityAI parent = GetHierarchyParent();
13085 if (!parent)
13086 {
13087 hasParent = false;
13088 hasRootAsPlayer = false;
13089 }
13090 else
13091 {
13092 hasParent = true;
13093 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13094 refParentIB =
ItemBase.Cast(parent);
13095 }
13096 }
13097
13098 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13099 {
13100
13101 }
13102
13104 {
13105
13106 return false;
13107 }
13108
13110 {
13111
13112
13113 return false;
13114 }
13115
13117 {
13118
13119 return false;
13120 }
13121
13124 {
13125 return !GetIsFrozen() &&
IsOpen();
13126 }
13127
13129 {
13130 bool hasParent = false, hasRootAsPlayer = false;
13132
13133 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13134 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13135
13136 if (wwtu || foodDecay)
13137 {
13141
13142 if (processWetness || processTemperature || processDecay)
13143 {
13145
13146 if (processWetness)
13147 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13148
13149 if (processTemperature)
13151
13152 if (processDecay)
13153 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13154 }
13155 }
13156 }
13157
13160 {
13162 }
13163
13165 {
13168
13169 return super.GetTemperatureFreezeThreshold();
13170 }
13171
13173 {
13176
13177 return super.GetTemperatureThawThreshold();
13178 }
13179
13181 {
13184
13185 return super.GetItemOverheatThreshold();
13186 }
13187
13189 {
13191 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13192
13193 return super.GetTemperatureFreezeTime();
13194 }
13195
13197 {
13199 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13200
13201 return super.GetTemperatureThawTime();
13202 }
13203
13208
13210 {
13211 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13212 }
13213
13215 {
13216 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13217 }
13218
13221 {
13223 }
13224
13226 {
13228 }
13229
13231 {
13233 }
13234
13237 {
13238 return null;
13239 }
13240
13243 {
13244 return false;
13245 }
13246
13248 {
13250 {
13253 if (!trg)
13254 {
13256 explosive = this;
13257 }
13258
13259 explosive.PairRemote(trg);
13261
13262 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13263 trg.SetPersistentPairID(persistentID);
13264 explosive.SetPersistentPairID(persistentID);
13265
13266 return true;
13267 }
13268 return false;
13269 }
13270
13273 {
13274 float ret = 1.0;
13277 ret *= GetHealth01();
13278
13279 return ret;
13280 }
13281
13282 #ifdef DEVELOPER
13283 override void SetDebugItem()
13284 {
13285 super.SetDebugItem();
13286 _itemBase = this;
13287 }
13288
13290 {
13291 string text = super.GetDebugText();
13292
13294 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13295
13296 return text;
13297 }
13298 #endif
13299
13301 {
13302 return true;
13303 }
13304
13306
13308
13310 {
13313 }
13314
13315
13323
13339}
13340
13342{
13344 if (entity)
13345 {
13346 bool is_item = entity.IsInherited(
ItemBase);
13347 if (is_item && full_quantity)
13348 {
13351 }
13352 }
13353 else
13354 {
13356 return NULL;
13357 }
13358 return entity;
13359}
13360
13362{
13363 if (item)
13364 {
13365 if (health > 0)
13366 item.SetHealth("", "", health);
13367
13368 if (item.CanHaveTemperature())
13369 {
13371 if (item.CanFreeze())
13372 item.SetFrozen(false);
13373 }
13374
13375 if (item.HasEnergyManager())
13376 {
13377 if (quantity >= 0)
13378 {
13379 item.GetCompEM().SetEnergy0To1(quantity);
13380 }
13381 else
13382 {
13384 }
13385 }
13386 else if (item.IsMagazine())
13387 {
13388 Magazine mag = Magazine.Cast(item);
13389 if (quantity >= 0)
13390 {
13391 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13392 }
13393 else
13394 {
13396 }
13397
13398 }
13399 else
13400 {
13401 if (quantity >= 0)
13402 {
13403 item.SetQuantityNormalized(quantity, false);
13404 }
13405 else
13406 {
13408 }
13409
13410 }
13411 }
13412}
13413
13414#ifdef DEVELOPER
13416#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.