8520{
8522 {
8523 return true;
8524 }
8525};
8526
8527
8528
8530{
8534
8536
8539
8540
8541
8542
8543
8552
8558
8563
8568
8589 protected bool m_IsResultOfSplit
8590
8592
8597
8598
8599
8601
8605
8606
8607
8609
8612
8613
8614
8620
8621
8629
8632
8633
8635
8636
8638
8639
8644
8645
8650
8651
8653
8654
8656 {
8661
8662 if (!
GetGame().IsDedicatedServer())
8663 {
8665 {
8667
8669 {
8671 }
8672 }
8673
8676 }
8677
8678 m_OldLocation = null;
8679
8681 {
8683 }
8684
8685 if (ConfigIsExisting("headSelectionsToHide"))
8686 {
8689 }
8690
8692 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8693 {
8695 }
8696
8698
8699 m_IsResultOfSplit = false;
8700
8702 }
8703
8705 {
8706 super.InitItemVariables();
8707
8713 m_Count = ConfigGetInt(
"count");
8714
8717
8722
8725
8730
8742
8746
8747
8750 if (ConfigIsExisting("canBeSplit"))
8751 {
8754 }
8755
8757 if (ConfigIsExisting("itemBehaviour"))
8759
8760
8763 RegisterNetSyncVariableInt("m_VarLiquidType");
8764 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8765
8766 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8767 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8768 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8769
8770 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8771 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8772 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8773 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8774
8775 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8776 RegisterNetSyncVariableBool("m_IsTakeable");
8777 RegisterNetSyncVariableBool("m_IsHologram");
8778
8781 {
8784 }
8785
8787
8789 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8791
8792 }
8793
8795 {
8797 }
8798
8800 {
8803 {
8808 }
8809 }
8810
8811 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8812 {
8814 {
8817 }
8818
8820 }
8821
8823 {
8829 }
8830
8832
8834 {
8836
8837 if (!action)
8838 {
8839 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8840 return;
8841 }
8842
8844 if (!ai)
8845 {
8847 return;
8848 }
8849
8851 if (!action_array)
8852 {
8853 action_array = new array<ActionBase_Basic>;
8855 }
8856 if (LogManager.IsActionLogEnable())
8857 {
8858 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8859 }
8860
8861 if (action_array.Find(action) != -1)
8862 {
8863 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8864 }
8865 else
8866 {
8867 action_array.Insert(action);
8868 }
8869 }
8870
8872 {
8874 ActionBase action = player.GetActionManager().GetAction(actionName);
8877
8878 if (action_array)
8879 {
8880 action_array.RemoveItem(action);
8881 }
8882 }
8883
8884
8885
8887 {
8888 ActionOverrideData overrideData = new ActionOverrideData();
8892
8894 if (!actionMap)
8895 {
8898 }
8899
8900 actionMap.Insert(this.
Type(), overrideData);
8901
8902 }
8903
8905
8907
8908
8910 {
8913
8916
8917 string config_to_search = "CfgVehicles";
8918 string muzzle_owner_config;
8919
8921 {
8922 if (IsInherited(Weapon))
8923 config_to_search = "CfgWeapons";
8924
8925 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8926
8927 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8928
8930
8931 if (config_OnFire_subclass_count > 0)
8932 {
8933 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8934
8935 for (int i = 0; i < config_OnFire_subclass_count; i++)
8936 {
8937 string particle_class = "";
8939 string config_OnFire_entry = config_OnFire_class + particle_class;
8940 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8941 WPOF_array.Insert(WPOF);
8942 }
8943
8944
8946 }
8947 }
8948
8950 {
8951 config_to_search = "CfgWeapons";
8952 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8953
8954 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8955
8957
8958 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8959 {
8960 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8961
8962 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8963 {
8964 string particle_class2 = "";
8966 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8967 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8968 WPOBE_array.Insert(WPOBE);
8969 }
8970
8971
8973 }
8974 }
8975 }
8976
8977
8979 {
8982
8984 {
8985 string config_to_search = "CfgVehicles";
8986
8987 if (IsInherited(Weapon))
8988 config_to_search = "CfgWeapons";
8989
8990 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8991 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8992
8993 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8994 {
8995
8997
8999 {
9001 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9003 return;
9004 }
9005
9008
9009
9010
9012 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9013
9014 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9015 {
9016 string particle_class = "";
9018 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9020
9021 if (entry_type == CT_CLASS)
9022 {
9023 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9024 WPOOH_array.Insert(WPOF);
9025 }
9026 }
9027
9028
9030 }
9031 }
9032 }
9033
9035 {
9037 }
9038
9040 {
9042 {
9044
9047
9050
9051 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9052 }
9053 }
9054
9056 {
9058 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9059
9061 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9062
9064 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9065
9067 {
9069 }
9070 }
9071
9073 {
9075 }
9076
9078 {
9081 else
9083
9085 {
9088 }
9089 else
9090 {
9093
9096 }
9097
9099 }
9100
9102 {
9104 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9105 }
9106
9108 {
9110 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9112 }
9113
9115 {
9117 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9118 }
9119
9121 {
9124
9125 OverheatingParticle OP = new OverheatingParticle();
9130
9132 }
9133
9135 {
9138
9139 return -1;
9140 }
9141
9143 {
9145 {
9148
9149 for (int i = count; i > 0; --i)
9150 {
9151 int id = i - 1;
9154
9157
9158 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9159 {
9160 if (p)
9161 {
9164 }
9165 }
9166 }
9167 }
9168 }
9169
9171 {
9173 {
9175 {
9176 int id = i - 1;
9178
9179 if (OP)
9180 {
9182
9183 if (p)
9184 {
9186 }
9187
9188 delete OP;
9189 }
9190 }
9191
9194 }
9195 }
9196
9199 {
9200 return 0.0;
9201 }
9202
9203
9205 {
9206 return 250;
9207 }
9208
9210 {
9211 return 0;
9212 }
9213
9216 {
9218 return true;
9219
9220 return false;
9221 }
9222
9225 {
9228
9230 {
9232 }
9233 else
9234 {
9235
9237 }
9238
9240 }
9241
9248 {
9249 return -1;
9250 }
9251
9252
9253
9254
9256 {
9258 {
9260 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9261
9262 if (r_index >= 0)
9263 {
9264 InventoryLocation r_il = new InventoryLocation;
9265 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9266
9267 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9270 {
9271 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9272 }
9274 {
9275 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9276 }
9277
9278 }
9279
9280 player.GetHumanInventory().ClearUserReservedLocation(this);
9281 }
9282
9285 }
9286
9287
9288
9289
9291 {
9292 return ItemBase.m_DebugActionsMask;
9293 }
9294
9296 {
9297 return ItemBase.m_DebugActionsMask & mask;
9298 }
9299
9301 {
9302 ItemBase.m_DebugActionsMask = mask;
9303 }
9304
9306 {
9307 ItemBase.m_DebugActionsMask |= mask;
9308 }
9309
9311 {
9312 ItemBase.m_DebugActionsMask &= ~mask;
9313 }
9314
9316 {
9318 {
9320 }
9321 else
9322 {
9324 }
9325 }
9326
9327
9329 {
9330 if (GetEconomyProfile())
9331 {
9332 float q_max = GetEconomyProfile().GetQuantityMax();
9333 if (q_max > 0)
9334 {
9335 float q_min = GetEconomyProfile().GetQuantityMin();
9336 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9337
9339 {
9340 ComponentEnergyManager comp = GetCompEM();
9342 {
9344 }
9345 }
9347 {
9349
9350 }
9351
9352 }
9353 }
9354 }
9355
9358 {
9359 EntityAI parent = GetHierarchyParent();
9360
9361 if (parent)
9362 {
9363 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9364 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9365 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9366 }
9367 }
9368
9371 {
9372 EntityAI parent = GetHierarchyParent();
9373
9374 if (parent)
9375 {
9376 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9377 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9378 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9379 }
9380 }
9381
9383 {
9384
9385
9386
9387
9389
9391 {
9392 if (ScriptInputUserData.CanStoreInputUserData())
9393 {
9394 ScriptInputUserData ctx = new ScriptInputUserData;
9400 ctx.
Write(use_stack_max);
9403
9405 {
9406 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9407 }
9408 }
9409 }
9410 else if (!
GetGame().IsMultiplayer())
9411 {
9413 }
9414 }
9415
9417 {
9419 }
9420
9422 {
9424 }
9425
9427 {
9429 }
9430
9432 {
9433
9434 return false;
9435 }
9436
9438 {
9439 return false;
9440 }
9441
9445 {
9446 return false;
9447 }
9448
9450 {
9451 return "";
9452 }
9453
9455
9457 {
9458 return false;
9459 }
9460
9462 {
9463 return true;
9464 }
9465
9466
9467
9469 {
9470 return true;
9471 }
9472
9474 {
9475 return true;
9476 }
9477
9479 {
9480 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9482 }
9483
9485 {
9487 }
9488
9490 {
9492 if (!is_being_placed)
9494 SetSynchDirty();
9495 }
9496
9497
9499
9501 {
9503 }
9504
9506 {
9508 }
9509
9511 {
9512 return 1;
9513 }
9514
9516 {
9517 return false;
9518 }
9519
9521 {
9523 SetSynchDirty();
9524 }
9525
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
9561 {
9562 super.OnMovedInsideCargo(container);
9563
9564 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9565 }
9566
9567 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9568 {
9569 super.EEItemLocationChanged(oldLoc,newLoc);
9570
9571 PlayerBase new_player = null;
9572 PlayerBase old_player = null;
9573
9574 if (newLoc.GetParent())
9575 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9576
9577 if (oldLoc.GetParent())
9578 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9579
9581 {
9582 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9583
9584 if (r_index >= 0)
9585 {
9586 InventoryLocation r_il = new InventoryLocation;
9587 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9588
9589 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9592 {
9593 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9594 }
9596 {
9597 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9598 }
9599
9600 }
9601 }
9602
9604 {
9605 if (new_player)
9606 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9607
9608 if (new_player == old_player)
9609 {
9610
9611 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9612 {
9614 {
9615 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9616 {
9617 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9618 }
9619 }
9620 else
9621 {
9622 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9623 }
9624 }
9625
9626 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9627 {
9628 int type = oldLoc.GetType();
9630 {
9631 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9632 }
9634 {
9635 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9636 }
9637 }
9638 if (!m_OldLocation)
9639 {
9640 m_OldLocation = new InventoryLocation;
9641 }
9642 m_OldLocation.Copy(oldLoc);
9643 }
9644 else
9645 {
9646 if (m_OldLocation)
9647 {
9648 m_OldLocation.Reset();
9649 }
9650 }
9651
9653 }
9654 else
9655 {
9656 if (new_player)
9657 {
9658 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9659 if (res_index >= 0)
9660 {
9661 InventoryLocation il = new InventoryLocation;
9662 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9664 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9667 {
9668 il.
GetParent().GetOnReleaseLock().Invoke(it);
9669 }
9671 {
9673 }
9674
9675 }
9676 }
9678 {
9679
9681 }
9682
9683 if (m_OldLocation)
9684 {
9685 m_OldLocation.Reset();
9686 }
9687 }
9688 }
9689
9690 override void EOnContact(IEntity other, Contact extra)
9691 {
9693 {
9694 int liquidType = -1;
9696 if (impactSpeed > 0.0)
9697 {
9699 #ifndef SERVER
9701 #else
9703 SetSynchDirty();
9704 #endif
9706 }
9707 }
9708
9709 #ifdef SERVER
9710 if (GetCompEM() && GetCompEM().IsPlugged())
9711 {
9712 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9713 GetCompEM().UnplugThis();
9714 }
9715 #endif
9716 }
9717
9719
9721 {
9723 }
9724
9726 {
9727
9728 }
9729
9731 {
9732 super.OnItemLocationChanged(old_owner, new_owner);
9733
9734 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9735 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9736
9737 if (!relatedPlayer && playerNew)
9738 relatedPlayer = playerNew;
9739
9740 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9741 {
9743 if (actionMgr)
9744 {
9745 ActionBase currentAction = actionMgr.GetRunningAction();
9746 if (currentAction)
9748 }
9749 }
9750
9751 Man ownerPlayerOld = null;
9752 Man ownerPlayerNew = null;
9753
9754 if (old_owner)
9755 {
9756 if (old_owner.
IsMan())
9757 {
9758 ownerPlayerOld = Man.Cast(old_owner);
9759 }
9760 else
9761 {
9762 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9763 }
9764 }
9765 else
9766 {
9768 {
9770
9771 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9772 {
9773 GetCompEM().UnplugThis();
9774 }
9775 }
9776 }
9777
9778 if (new_owner)
9779 {
9780 if (new_owner.
IsMan())
9781 {
9782 ownerPlayerNew = Man.Cast(new_owner);
9783 }
9784 else
9785 {
9786 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9787 }
9788 }
9789
9790 if (ownerPlayerOld != ownerPlayerNew)
9791 {
9792 if (ownerPlayerOld)
9793 {
9794 array<EntityAI> subItemsExit = new array<EntityAI>;
9796 for (int i = 0; i < subItemsExit.Count(); i++)
9797 {
9800 }
9801 }
9802
9803 if (ownerPlayerNew)
9804 {
9805 array<EntityAI> subItemsEnter = new array<EntityAI>;
9807 for (int j = 0; j < subItemsEnter.Count(); j++)
9808 {
9811 }
9812 }
9813 }
9814 else if (ownerPlayerNew != null)
9815 {
9816 PlayerBase nplayer;
9817 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9818 {
9819 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9821 for (int k = 0; k < subItemsUpdate.Count(); k++)
9822 {
9824 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9825 }
9826 }
9827 }
9828
9829 if (old_owner)
9830 old_owner.OnChildItemRemoved(this);
9831 if (new_owner)
9832 new_owner.OnChildItemReceived(this);
9833 }
9834
9835
9837 {
9838 super.EEDelete(parent);
9839 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9840 if (player)
9841 {
9843
9844 if (player.IsAlive())
9845 {
9846 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9847 if (r_index >= 0)
9848 {
9849 InventoryLocation r_il = new InventoryLocation;
9850 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9851
9852 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9855 {
9856 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9857 }
9859 {
9860 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9861 }
9862
9863 }
9864
9865 player.RemoveQuickBarEntityShortcut(this);
9866 }
9867 }
9868 }
9869
9871 {
9872 super.EEKilled(killer);
9873
9876 {
9877 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9878 {
9879 if (IsMagazine())
9880 {
9881 if (Magazine.Cast(this).GetAmmoCount() > 0)
9882 {
9884 }
9885 }
9886 else
9887 {
9889 }
9890 }
9891 }
9892 }
9893
9895 {
9896 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9897
9898 super.OnWasAttached(parent, slot_id);
9899
9902
9904 }
9905
9907 {
9908 super.OnWasDetached(parent, slot_id);
9909
9912 }
9913
9915 {
9916 int idx;
9919
9920 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9921 if (inventory_slots.Count() < 1)
9922 {
9923 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9924 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9925 }
9926 else
9927 {
9928 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9929 }
9930
9931 idx = inventory_slots.Find(slot);
9932 if (idx < 0)
9933 return "";
9934
9935 return attach_types.Get(idx);
9936 }
9937
9939 {
9940 int idx = -1;
9941 string slot;
9942
9945
9946 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9947 if (inventory_slots.Count() < 1)
9948 {
9949 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9950 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9951 }
9952 else
9953 {
9954 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9955 if (detach_types.Count() < 1)
9956 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9957 }
9958
9959 for (int i = 0; i < inventory_slots.Count(); i++)
9960 {
9961 slot = inventory_slots.Get(i);
9962 }
9963
9964 if (slot != "")
9965 {
9966 if (detach_types.Count() == 1)
9967 idx = 0;
9968 else
9969 idx = inventory_slots.Find(slot);
9970 }
9971 if (idx < 0)
9972 return "";
9973
9974 return detach_types.Get(idx);
9975 }
9976
9978 {
9979
9981
9982
9983 float min_time = 1;
9984 float max_time = 3;
9985 float delay = Math.RandomFloat(min_time, max_time);
9986
9987 explode_timer.Run(delay, this, "DoAmmoExplosion");
9988 }
9989
9991 {
9992 Magazine magazine = Magazine.Cast(this);
9993 int pop_sounds_count = 6;
9994 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9995
9996
9997 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9998 string sound_name = pop_sounds[ sound_idx ];
10000
10001
10002 magazine.ServerAddAmmoCount(-1);
10003
10004
10005 float min_temp_to_explode = 100;
10006
10007 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10008 {
10010 }
10011 }
10012
10013
10014 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10015 {
10016 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10017
10018 const int CHANCE_DAMAGE_CARGO = 4;
10019 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10020 const int CHANCE_DAMAGE_NOTHING = 2;
10021
10023 {
10024 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10025 int chances;
10026 int rnd;
10027
10028 if (GetInventory().GetCargo())
10029 {
10030 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10031 rnd = Math.RandomInt(0,chances);
10032
10033 if (rnd < CHANCE_DAMAGE_CARGO)
10034 {
10036 }
10037 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10038 {
10040 }
10041 }
10042 else
10043 {
10044 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10045 rnd = Math.RandomInt(0,chances);
10046
10047 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10048 {
10050 }
10051 }
10052 }
10053 }
10054
10056 {
10057 if (GetInventory().GetCargo())
10058 {
10059 int item_count = GetInventory().GetCargo().GetItemCount();
10060 if (item_count > 0)
10061 {
10062 int random_pick = Math.RandomInt(0, item_count);
10064 if (!item.IsExplosive())
10065 {
10066 item.AddHealth("","",damage);
10067 return true;
10068 }
10069 }
10070 }
10071 return false;
10072 }
10073
10075 {
10076 int attachment_count = GetInventory().AttachmentCount();
10077 if (attachment_count > 0)
10078 {
10079 int random_pick = Math.RandomInt(0, attachment_count);
10080 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10081 if (!attachment.IsExplosive())
10082 {
10083 attachment.AddHealth("","",damage);
10084 return true;
10085 }
10086 }
10087 return false;
10088 }
10089
10091 {
10093 }
10094
10096 {
10098 return GetInventory().CanRemoveEntity();
10099
10100 return false;
10101 }
10102
10104 {
10105
10107 return false;
10108
10109
10111 return false;
10112
10113
10114
10116 if (delta == 0)
10117 return false;
10118
10119
10120 return true;
10121 }
10122
10124 {
10126 {
10127 if (ScriptInputUserData.CanStoreInputUserData())
10128 {
10129 ScriptInputUserData ctx = new ScriptInputUserData;
10134 ctx.
Write(destination_entity);
10136 ctx.
Write(slot_id);
10138 }
10139 }
10140 else if (!
GetGame().IsMultiplayer())
10141 {
10143 }
10144 }
10145
10147 {
10148 float split_quantity_new;
10152 InventoryLocation loc = new InventoryLocation;
10153
10154 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10155 {
10157 split_quantity_new = stack_max;
10158 else
10160
10162 {
10163 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10164 if (new_item)
10165 {
10166 new_item.SetResultOfSplit(true);
10167 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10169 new_item.
SetQuantity(split_quantity_new,
false,
true);
10170 }
10171 }
10172 }
10173 else if (destination_entity && slot_id == -1)
10174 {
10175 if (quantity > stack_max)
10176 split_quantity_new = stack_max;
10177 else
10178 split_quantity_new = quantity;
10179
10181 {
10183 {
10186 }
10187
10188 if (new_item)
10189 {
10190 new_item.SetResultOfSplit(true);
10191 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10193 new_item.
SetQuantity(split_quantity_new,
false,
true);
10194 }
10195 }
10196 }
10197 else
10198 {
10199 if (stack_max != 0)
10200 {
10202 {
10204 }
10205
10206 if (split_quantity_new == 0)
10207 {
10208 if (!
GetGame().IsMultiplayer())
10209 player.PhysicalPredictiveDropItem(this);
10210 else
10211 player.ServerDropEntity(this);
10212 return;
10213 }
10214
10216 {
10218
10219 if (new_item)
10220 {
10221 new_item.SetResultOfSplit(true);
10222 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10225 new_item.PlaceOnSurface();
10226 }
10227 }
10228 }
10229 }
10230 }
10231
10233 {
10234 float split_quantity_new;
10238 InventoryLocation loc = new InventoryLocation;
10239
10240 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10241 {
10243 split_quantity_new = stack_max;
10244 else
10246
10248 {
10249 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10250 if (new_item)
10251 {
10252 new_item.SetResultOfSplit(true);
10253 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10255 new_item.
SetQuantity(split_quantity_new,
false,
true);
10256 }
10257 }
10258 }
10259 else if (destination_entity && slot_id == -1)
10260 {
10261 if (quantity > stack_max)
10262 split_quantity_new = stack_max;
10263 else
10264 split_quantity_new = quantity;
10265
10267 {
10269 {
10272 }
10273
10274 if (new_item)
10275 {
10276 new_item.SetResultOfSplit(true);
10277 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10279 new_item.
SetQuantity(split_quantity_new,
false,
true);
10280 }
10281 }
10282 }
10283 else
10284 {
10285 if (stack_max != 0)
10286 {
10288 {
10290 }
10291
10293 {
10295
10296 if (new_item)
10297 {
10298 new_item.SetResultOfSplit(true);
10299 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10302 new_item.PlaceOnSurface();
10303 }
10304 }
10305 }
10306 }
10307 }
10308
10310 {
10312 {
10313 if (ScriptInputUserData.CanStoreInputUserData())
10314 {
10315 ScriptInputUserData ctx = new ScriptInputUserData;
10320 dst.WriteToContext(ctx);
10322 }
10323 }
10324 else if (!
GetGame().IsMultiplayer())
10325 {
10327 }
10328 }
10329
10331 {
10333 {
10334 if (ScriptInputUserData.CanStoreInputUserData())
10335 {
10336 ScriptInputUserData ctx = new ScriptInputUserData;
10341 ctx.
Write(destination_entity);
10347 }
10348 }
10349 else if (!
GetGame().IsMultiplayer())
10350 {
10352 }
10353 }
10354
10356 {
10358 }
10359
10361 {
10363 float split_quantity_new;
10365 if (dst.IsValid())
10366 {
10367 int slot_id = dst.GetSlot();
10369
10370 if (quantity > stack_max)
10371 split_quantity_new = stack_max;
10372 else
10373 split_quantity_new = quantity;
10374
10376 {
10378
10379 if (new_item)
10380 {
10381 new_item.SetResultOfSplit(true);
10382 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10384 new_item.
SetQuantity(split_quantity_new,
false,
true);
10385 }
10386
10387 return new_item;
10388 }
10389 }
10390
10391 return null;
10392 }
10393
10395 {
10397 float split_quantity_new;
10399 if (destination_entity)
10400 {
10402 if (quantity > stackable)
10403 split_quantity_new = stackable;
10404 else
10405 split_quantity_new = quantity;
10406
10408 {
10409 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10410 if (new_item)
10411 {
10412 new_item.SetResultOfSplit(true);
10413 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10415 new_item.
SetQuantity(split_quantity_new,
false,
true);
10416 }
10417 }
10418 }
10419 }
10420
10422 {
10424 {
10425 if (ScriptInputUserData.CanStoreInputUserData())
10426 {
10427 ScriptInputUserData ctx = new ScriptInputUserData;
10432 ItemBase destination_entity =
this;
10433 ctx.
Write(destination_entity);
10437 }
10438 }
10439 else if (!
GetGame().IsMultiplayer())
10440 {
10442 }
10443 }
10444
10446 {
10448 float split_quantity_new;
10450 if (player)
10451 {
10453 if (quantity > stackable)
10454 split_quantity_new = stackable;
10455 else
10456 split_quantity_new = quantity;
10457
10459 {
10460 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10461 new_item =
ItemBase.Cast(in_hands);
10462 if (new_item)
10463 {
10464 new_item.SetResultOfSplit(true);
10465 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10467 new_item.SetQuantity(split_quantity_new, false, true);
10468 }
10469 }
10470 }
10471 }
10472
10474 {
10476 float split_quantity_new = Math.Floor(quantity * 0.5);
10477
10479 return;
10480
10482
10483 if (new_item)
10484 {
10485 if (new_item.GetQuantityMax() < split_quantity_new)
10486 {
10487 split_quantity_new = new_item.GetQuantityMax();
10488 }
10489
10490 new_item.SetResultOfSplit(true);
10491 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10492
10494 {
10497 }
10498 else
10499 {
10501 new_item.
SetQuantity(split_quantity_new,
false,
true);
10502 }
10503 }
10504 }
10505
10507 {
10509 float split_quantity_new = Math.Floor(quantity / 2);
10510
10512 return;
10513
10514 InventoryLocation invloc = new InventoryLocation;
10516
10518 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10519
10520 if (new_item)
10521 {
10522 if (new_item.GetQuantityMax() < split_quantity_new)
10523 {
10524 split_quantity_new = new_item.GetQuantityMax();
10525 }
10527 {
10530 }
10531 else if (split_quantity_new > 1)
10532 {
10534 new_item.
SetQuantity(split_quantity_new,
false,
true);
10535 }
10536 }
10537 }
10538
10541 {
10542 SetWeightDirty();
10544
10545 if (parent)
10546 parent.OnAttachmentQuantityChangedEx(this, delta);
10547
10549 {
10551 {
10553 }
10555 {
10556 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10558 }
10559 }
10560
10561 }
10562
10565 {
10566
10567 }
10568
10571 {
10573 }
10574
10576 {
10577 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10578
10580 {
10581 if (newLevel == GameConstants.STATE_RUINED)
10582 {
10584 EntityAI parent = GetHierarchyParent();
10585 if (parent && parent.IsFireplace())
10586 {
10587 CargoBase cargo = GetInventory().GetCargo();
10588 if (cargo)
10589 {
10591 {
10593 }
10594 }
10595 }
10596 }
10597
10599 {
10600
10602 return;
10603 }
10604
10605 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10606 {
10608 }
10609 }
10610 }
10611
10612
10614 {
10615 super.OnRightClick();
10616
10618 {
10620 {
10621 if (ScriptInputUserData.CanStoreInputUserData())
10622 {
10623 EntityAI root = GetHierarchyRoot();
10624 Man playerOwner = GetHierarchyRootPlayer();
10625 InventoryLocation dst = new InventoryLocation;
10626
10627
10628 if (!playerOwner && root && root == this)
10629 {
10631 }
10632 else
10633 {
10634
10635 GetInventory().GetCurrentInventoryLocation(dst);
10637 {
10640 {
10642 }
10643 else
10644 {
10646
10647
10648 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10649 {
10651 }
10652 else
10653 {
10654 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10655 }
10656 }
10657 }
10658 }
10659
10660 ScriptInputUserData ctx = new ScriptInputUserData;
10668 }
10669 }
10670 else if (!
GetGame().IsMultiplayer())
10671 {
10673 }
10674 }
10675 }
10676
10678 {
10679 if (root)
10680 {
10681 vector m4[4];
10682 root.GetTransform(m4);
10683 dst.SetGround(this, m4);
10684 }
10685 else
10686 {
10687 GetInventory().GetCurrentInventoryLocation(dst);
10688 }
10689 }
10690
10691 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10692 {
10693
10694 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10695 return false;
10696
10697 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10698 return false;
10699
10700
10702 return false;
10703
10704
10705 Magazine mag = Magazine.Cast(this);
10706 if (mag)
10707 {
10708 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10709 return false;
10710
10711 if (stack_max_limit)
10712 {
10713 Magazine other_mag = Magazine.Cast(other_item);
10714 if (other_item)
10715 {
10716 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10717 return false;
10718 }
10719
10720 }
10721 }
10722 else
10723 {
10724
10726 return false;
10727
10729 return false;
10730 }
10731
10732 PlayerBase player = null;
10733 if (CastTo(player, GetHierarchyRootPlayer()))
10734 {
10735 if (player.GetInventory().HasAttachment(this))
10736 return false;
10737
10738 if (player.IsItemsToDelete())
10739 return false;
10740 }
10741
10742 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10743 return false;
10744
10745 int slotID;
10747 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10748 return false;
10749
10750 return true;
10751 }
10752
10754 {
10756 }
10757
10759 {
10760 return m_IsResultOfSplit;
10761 }
10762
10764 {
10765 m_IsResultOfSplit = value;
10766 }
10767
10769 {
10771 }
10772
10774 {
10775 float other_item_quantity = other_item.GetQuantity();
10776 float this_free_space;
10777
10779
10781
10782 if (other_item_quantity > this_free_space)
10783 {
10784 return this_free_space;
10785 }
10786 else
10787 {
10788 return other_item_quantity;
10789 }
10790 }
10791
10793 {
10795 }
10796
10798 {
10800 return;
10801
10802 if (!IsMagazine() && other_item)
10803 {
10805 if (quantity_used != 0)
10806 {
10807 float hp1 = GetHealth01("","");
10808 float hp2 = other_item.GetHealth01("","");
10809 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10810 hpResult = hpResult / (
GetQuantity() + quantity_used);
10811
10812 hpResult *= GetMaxHealth();
10813 Math.Round(hpResult);
10814 SetHealth("", "Health", hpResult);
10815
10817 other_item.AddQuantity(-quantity_used);
10818 }
10819 }
10821 }
10822
10824 {
10825 #ifdef SERVER
10826 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10827 GetHierarchyParent().IncreaseLifetimeUp();
10828 #endif
10829 };
10830
10832 {
10833 PlayerBase p = PlayerBase.Cast(player);
10834
10835 array<int> recipesIds = p.m_Recipes;
10836 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10837 if (moduleRecipesManager)
10838 {
10839 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10840 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10841 }
10842
10843 for (int i = 0;i < recipesIds.Count(); i++)
10844 {
10845 int key = recipesIds.Get(i);
10846 string recipeName = moduleRecipesManager.GetRecipeName(key);
10848 }
10849 }
10850
10851
10852 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10853 {
10854 super.GetDebugActions(outputList);
10855
10856
10862
10863
10868
10873
10874
10878
10879
10881 {
10885 }
10886
10889
10890
10894
10896
10897 InventoryLocation loc = new InventoryLocation();
10898 GetInventory().GetCurrentInventoryLocation(loc);
10900 {
10901 if (Gizmo_IsSupported())
10904 }
10905
10907 }
10908
10909
10910
10911
10913 {
10914 super.OnAction(action_id, player, ctx);
10915
10917 {
10918 switch (action_id)
10919 {
10922 return true;
10925 return true;
10926 }
10927 }
10928
10930 {
10931 switch (action_id)
10932 {
10934 Delete();
10935 return true;
10936 }
10937 }
10938
10939 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10940 {
10941 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10942 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10943 PlayerBase p = PlayerBase.Cast(player);
10944 if (
EActions.RECIPES_RANGE_START < 1000)
10945 {
10946 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10947 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10948 }
10949 }
10950 #ifndef SERVER
10951 else if (action_id ==
EActions.WATCH_PLAYER)
10952 {
10953 PluginDeveloper.SetDeveloperItemClientEx(player);
10954 }
10955 #endif
10957 {
10958 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10959 {
10960 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10961 OnDebugButtonPressServer(id + 1);
10962 }
10963
10964 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10965 {
10966 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10968 }
10969
10970 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10971 {
10972 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10974 }
10975
10976 else if (action_id ==
EActions.ADD_QUANTITY)
10977 {
10978 if (IsMagazine())
10979 {
10980 Magazine mag = Magazine.Cast(this);
10981 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10982 }
10983 else
10984 {
10986 }
10987
10988 if (m_EM)
10989 {
10990 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10991 }
10992
10993 }
10994
10995 else if (action_id ==
EActions.REMOVE_QUANTITY)
10996 {
10997 if (IsMagazine())
10998 {
10999 Magazine mag2 = Magazine.Cast(this);
11000 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11001 }
11002 else
11003 {
11005 }
11006 if (m_EM)
11007 {
11008 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11009 }
11010
11011 }
11012
11013 else if (action_id ==
EActions.SET_QUANTITY_0)
11014 {
11016
11017 if (m_EM)
11018 {
11019 m_EM.SetEnergy(0);
11020 }
11021 }
11022
11023 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11024 {
11026
11027 if (m_EM)
11028 {
11029 m_EM.SetEnergy(m_EM.GetEnergyMax());
11030 }
11031 }
11032
11033 else if (action_id ==
EActions.ADD_HEALTH)
11034 {
11035 AddHealth("","",GetMaxHealth("","Health")/5);
11036 }
11037 else if (action_id ==
EActions.REMOVE_HEALTH)
11038 {
11039 AddHealth("","",-GetMaxHealth("","Health")/5);
11040 }
11041 else if (action_id ==
EActions.DESTROY_HEALTH)
11042 {
11043 SetHealth01("","",0);
11044 }
11045 else if (action_id ==
EActions.WATCH_ITEM)
11046 {
11048 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11049 #ifdef DEVELOPER
11050 SetDebugDeveloper_item(this);
11051 #endif
11052 }
11053
11054 else if (action_id ==
EActions.ADD_TEMPERATURE)
11055 {
11056 AddTemperature(20);
11057
11058 }
11059
11060 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11061 {
11062 AddTemperature(-20);
11063
11064 }
11065
11066 else if (action_id ==
EActions.FLIP_FROZEN)
11067 {
11068 SetFrozen(!GetIsFrozen());
11069
11070 }
11071
11072 else if (action_id ==
EActions.ADD_WETNESS)
11073 {
11075
11076 }
11077
11078 else if (action_id ==
EActions.REMOVE_WETNESS)
11079 {
11081
11082 }
11083
11084 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11085 {
11088
11089
11090 }
11091
11092 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11093 {
11096 }
11097
11098 else if (action_id ==
EActions.MAKE_SPECIAL)
11099 {
11100 auto debugParams = DebugSpawnParams.WithPlayer(player);
11101 OnDebugSpawnEx(debugParams);
11102 }
11103
11104 }
11105
11106
11107 return false;
11108 }
11109
11110
11111
11112
11116
11119
11120
11121
11123 {
11124 return false;
11125 }
11126
11127
11129 {
11130 return true;
11131 }
11132
11133
11135 {
11136 return true;
11137 }
11138
11139
11140
11142 {
11143 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11145 }
11146
11149 {
11150 return null;
11151 }
11152
11154 {
11155 return false;
11156 }
11157
11159 {
11160 return false;
11161 }
11162
11166
11167
11169 {
11170 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11171 return module_repairing.CanRepair(this, item_repair_kit);
11172 }
11173
11174
11175 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11176 {
11177 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11178 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11179 }
11180
11181
11183 {
11184
11185
11186
11187
11188
11189
11190
11191
11192 return 1;
11193 }
11194
11195
11196
11198 {
11200 }
11201
11202
11203
11205 {
11207 }
11208
11209
11218 {
11219 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11220
11221 if (player)
11222 {
11223 player.MessageStatus(text);
11224 }
11225 }
11226
11227
11236 {
11237 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11238
11239 if (player)
11240 {
11241 player.MessageAction(text);
11242 }
11243 }
11244
11245
11254 {
11255 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11256
11257 if (player)
11258 {
11259 player.MessageFriendly(text);
11260 }
11261 }
11262
11263
11272 {
11273 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11274
11275 if (player)
11276 {
11277 player.MessageImportant(text);
11278 }
11279 }
11280
11282 {
11283 return true;
11284 }
11285
11286
11287 override bool KindOf(
string tag)
11288 {
11289 bool found = false;
11290 string item_name = this.
GetType();
11293
11294 int array_size = item_tag_array.Count();
11295 for (int i = 0; i < array_size; i++)
11296 {
11297 if (item_tag_array.Get(i) == tag)
11298 {
11299 found = true;
11300 break;
11301 }
11302 }
11303 return found;
11304 }
11305
11306
11308 {
11309
11310 super.OnRPC(sender, rpc_type,ctx);
11311
11312
11313 switch (rpc_type)
11314 {
11315 #ifndef SERVER
11316 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11317 Param2<bool, string> p = new Param2<bool, string>(false, "");
11318
11320 return;
11321
11322 bool play = p.param1;
11323 string soundSet = p.param2;
11324
11325 if (play)
11326 {
11328 {
11330 {
11332 }
11333 }
11334 else
11335 {
11337 }
11338 }
11339 else
11340 {
11342 }
11343
11344 break;
11345 #endif
11346
11347 }
11348
11350 {
11352 }
11353 }
11354
11355
11356
11357
11359 {
11360 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11361 return plugin.GetID(
name);
11362 }
11363
11365 {
11366 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11367 return plugin.GetName(id);
11368 }
11369
11372 {
11373
11374
11375 int varFlags;
11376 if (!ctx.
Read(varFlags))
11377 return;
11378
11379 if (varFlags & ItemVariableFlags.FLOAT)
11380 {
11382 }
11383 }
11384
11386 {
11387
11388 super.SerializeNumericalVars(floats_out);
11389
11390
11391
11393 {
11395 }
11396
11398 {
11400 }
11401
11403 {
11405 }
11406
11408 {
11413 }
11414
11416 {
11418 }
11419 }
11420
11422 {
11423
11424 super.DeSerializeNumericalVars(floats);
11425
11426
11427 int index = 0;
11428 int mask = Math.Round(floats.Get(index));
11429
11430 index++;
11431
11433 {
11435 {
11437 }
11438 else
11439 {
11440 float quantity = floats.Get(index);
11441 SetQuantity(quantity,
true,
false,
false,
false);
11442 }
11443 index++;
11444 }
11445
11447 {
11448 float wet = floats.Get(index);
11450 index++;
11451 }
11452
11454 {
11455 int liquidtype = Math.Round(floats.Get(index));
11457 index++;
11458 }
11459
11461 {
11463 index++;
11465 index++;
11467 index++;
11469 index++;
11470 }
11471
11473 {
11474 int cleanness = Math.Round(floats.Get(index));
11476 index++;
11477 }
11478 }
11479
11481 {
11482 super.WriteVarsToCTX(ctx);
11483
11484
11486 {
11488 }
11489
11491 {
11493 }
11494
11496 {
11498 }
11499
11501 {
11502 int r,g,b,a;
11508 }
11509
11511 {
11513 }
11514 }
11515
11517 {
11518 if (!super.ReadVarsFromCTX(ctx,version))
11519 return false;
11520
11521 int intValue;
11522 float value;
11523
11524 if (version < 140)
11525 {
11526 if (!ctx.
Read(intValue))
11527 return false;
11528
11529 m_VariablesMask = intValue;
11530 }
11531
11533 {
11534 if (!ctx.
Read(value))
11535 return false;
11536
11538 {
11540 }
11541 else
11542 {
11544 }
11545 }
11546
11547 if (version < 140)
11548 {
11550 {
11551 if (!ctx.
Read(value))
11552 return false;
11553 SetTemperatureDirect(value);
11554 }
11555 }
11556
11558 {
11559 if (!ctx.
Read(value))
11560 return false;
11562 }
11563
11565 {
11566 if (!ctx.
Read(intValue))
11567 return false;
11569 }
11570
11572 {
11573 int r,g,b,a;
11575 return false;
11577 return false;
11579 return false;
11581 return false;
11582
11584 }
11585
11587 {
11588 if (!ctx.
Read(intValue))
11589 return false;
11591 }
11592
11593 if (version >= 138 && version < 140)
11594 {
11596 {
11597 if (!ctx.
Read(intValue))
11598 return false;
11599 SetFrozen(intValue);
11600 }
11601 }
11602
11603 return true;
11604 }
11605
11606
11608 {
11611 {
11613 }
11614
11615 if (!super.OnStoreLoad(ctx, version))
11616 {
11618 return false;
11619 }
11620
11621 if (version >= 114)
11622 {
11623 bool hasQuickBarIndexSaved;
11624
11625 if (!ctx.
Read(hasQuickBarIndexSaved))
11626 {
11628 return false;
11629 }
11630
11631 if (hasQuickBarIndexSaved)
11632 {
11633 int itmQBIndex;
11634
11635
11636 if (!ctx.
Read(itmQBIndex))
11637 {
11639 return false;
11640 }
11641
11642 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11643 if (itmQBIndex != -1 && parentPlayer)
11644 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11645 }
11646 }
11647 else
11648 {
11649
11650 PlayerBase player;
11651 int itemQBIndex;
11652 if (version ==
int.
MAX)
11653 {
11654 if (!ctx.
Read(itemQBIndex))
11655 {
11657 return false;
11658 }
11659 }
11660 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11661 {
11662
11663 if (!ctx.
Read(itemQBIndex))
11664 {
11666 return false;
11667 }
11668 if (itemQBIndex != -1 && player)
11669 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11670 }
11671 }
11672
11673 if (version < 140)
11674 {
11675
11676 if (!LoadVariables(ctx, version))
11677 {
11679 return false;
11680 }
11681 }
11682
11683
11685 {
11687 return false;
11688 }
11689 if (version >= 132)
11690 {
11692 if (raib)
11693 {
11695 {
11697 return false;
11698 }
11699 }
11700 }
11701
11703 return true;
11704 }
11705
11706
11707
11709 {
11710 super.OnStoreSave(ctx);
11711
11712 PlayerBase player;
11713 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11714 {
11716
11717 int itemQBIndex = -1;
11718 itemQBIndex = player.FindQuickBarEntityIndex(this);
11719 ctx.
Write(itemQBIndex);
11720 }
11721 else
11722 {
11724 }
11725
11727
11729 if (raib)
11730 {
11732 }
11733 }
11734
11735
11737 {
11738 super.AfterStoreLoad();
11739
11741 {
11743 }
11744
11746 {
11749 }
11750 }
11751
11753 {
11754 super.EEOnAfterLoad();
11755
11757 {
11759 }
11760
11763 }
11764
11766 {
11767 return false;
11768 }
11769
11770
11771
11773 {
11775 {
11776 #ifdef PLATFORM_CONSOLE
11777
11779 {
11781 if (menu)
11782 {
11784 }
11785 }
11786 #endif
11787 }
11788
11790 {
11793 }
11794
11796 {
11797 SetWeightDirty();
11799 }
11801 {
11804 }
11805
11807 {
11810 }
11812 {
11815 }
11816
11817 super.OnVariablesSynchronized();
11818 }
11819
11820
11821
11823 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11824 {
11825 if (!IsServerCheck(allow_client))
11826 return false;
11827
11829 return false;
11830
11833
11834 if (value <= (min + 0.001))
11835 value = min;
11836
11837 if (value == min)
11838 {
11839 if (destroy_config)
11840 {
11841 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11842 if (dstr)
11843 {
11845 this.Delete();
11846 return true;
11847 }
11848 }
11849 else if (destroy_forced)
11850 {
11852 this.Delete();
11853 return true;
11854 }
11855
11857 }
11858
11861
11863 {
11865
11866 if (delta)
11868 }
11869
11871
11872 return false;
11873 }
11874
11875
11877 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11878 {
11880 }
11881
11883 {
11886 }
11887
11889 {
11892 }
11893
11895 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11896 {
11897 float value_clamped = Math.Clamp(value, 0, 1);
11899 SetQuantity(result, destroy_config, destroy_forced);
11900 }
11901
11902
11905 {
11907 }
11908
11910 {
11912 }
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11924 {
11925 int slot = -1;
11926 if (GetInventory())
11927 {
11928 InventoryLocation il = new InventoryLocation;
11929 GetInventory().GetCurrentInventoryLocation(il);
11931 }
11932
11934 }
11935
11937 {
11938 float quantity_max = 0;
11939
11941 {
11942 if (attSlotID != -1)
11943 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11944
11945 if (quantity_max <= 0)
11947 }
11948
11949 if (quantity_max <= 0)
11951
11952 return quantity_max;
11953 }
11954
11956 {
11958 }
11959
11961 {
11963 }
11964
11965
11967 {
11969 }
11970
11972 {
11974 }
11975
11977 {
11979 }
11980
11981
11983 {
11984
11985 float weightEx = GetWeightEx();
11986 float special = GetInventoryAndCargoWeight();
11987 return weightEx - special;
11988 }
11989
11990
11992 {
11994 }
11995
11997 {
11999 {
12000 #ifdef DEVELOPER
12001 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12002 {
12003 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12005 }
12006 #endif
12007
12008 return GetQuantity() * GetConfigWeightModified();
12009 }
12010 else if (HasEnergyManager())
12011 {
12012 #ifdef DEVELOPER
12013 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12014 {
12015 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12016 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12017 }
12018 #endif
12019 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12020 }
12021 else
12022 {
12023 #ifdef DEVELOPER
12024 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12025 {
12026 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12027 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12028 }
12029 #endif
12030 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12031 }
12032 }
12033
12036 {
12037 int item_count = 0;
12039
12040 if (GetInventory().GetCargo() != NULL)
12041 {
12042 item_count = GetInventory().GetCargo().GetItemCount();
12043 }
12044
12045 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12046 {
12047 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12048 if (item)
12049 item_count += item.GetNumberOfItems();
12050 }
12051 return item_count;
12052 }
12053
12056 {
12057 float weight = 0;
12058 float wetness = 1;
12059 if (include_wetness)
12062 {
12063 weight = wetness * m_ConfigWeight;
12064 }
12066 {
12067 weight = 1;
12068 }
12069 return weight;
12070 }
12071
12072
12073
12075 {
12076 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12077 {
12078 GameInventory inv = GetInventory();
12079 array<EntityAI> items = new array<EntityAI>;
12081 for (int i = 0; i < items.Count(); i++)
12082 {
12084 if (item)
12085 {
12087 }
12088 }
12089 }
12090 }
12091
12092
12093
12094
12096 {
12097 float energy = 0;
12098 if (HasEnergyManager())
12099 {
12100 energy = GetCompEM().GetEnergy();
12101 }
12102 return energy;
12103 }
12104
12105
12107 {
12108 super.OnEnergyConsumed();
12109
12111 }
12112
12114 {
12115 super.OnEnergyAdded();
12116
12118 }
12119
12120
12122 {
12123 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12124 {
12126 {
12127 float energy_0to1 = GetCompEM().GetEnergy0To1();
12129 }
12130 }
12131 }
12132
12133
12135 {
12136 return ConfigGetFloat("heatIsolation");
12137 }
12138
12140 {
12142 }
12143
12145 {
12146 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12147 if (
GetGame().ConfigIsExisting(paramPath))
12149
12150 return 0.0;
12151 }
12152
12154 {
12155 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12156 if (
GetGame().ConfigIsExisting(paramPath))
12158
12159 return 0.0;
12160 }
12161
12162 override void SetWet(
float value,
bool allow_client =
false)
12163 {
12164 if (!IsServerCheck(allow_client))
12165 return;
12166
12169
12171
12172 m_VarWet = Math.Clamp(value, min, max);
12173
12175 {
12178 }
12179 }
12180
12181 override void AddWet(
float value)
12182 {
12184 }
12185
12187 {
12189 }
12190
12192 {
12194 }
12195
12197 {
12199 }
12200
12202 {
12204 }
12205
12207 {
12209 }
12210
12211 override void OnWetChanged(
float newVal,
float oldVal)
12212 {
12215 if (newLevel != oldLevel)
12216 {
12218 }
12219 }
12220
12222 {
12223 SetWeightDirty();
12224 }
12225
12227 {
12228 return GetWetLevelInternal(
m_VarWet);
12229 }
12230
12231
12232
12234 {
12236 }
12237
12239 {
12241 }
12242
12244 {
12246 }
12247
12249 {
12251 }
12252
12253
12254
12256 {
12257 if (ConfigIsExisting("itemModelLength"))
12258 {
12259 return ConfigGetFloat("itemModelLength");
12260 }
12261 return 0;
12262 }
12263
12265 {
12266 if (ConfigIsExisting("itemAttachOffset"))
12267 {
12268 return ConfigGetFloat("itemAttachOffset");
12269 }
12270 return 0;
12271 }
12272
12273 override void SetCleanness(
int value,
bool allow_client =
false)
12274 {
12275 if (!IsServerCheck(allow_client))
12276 return;
12277
12279
12281
12284 }
12285
12287 {
12289 }
12290
12292 {
12293 return true;
12294 }
12295
12296
12297
12298
12300 {
12302 }
12303
12305 {
12307 }
12308
12309
12310
12311
12312 override void SetColor(
int r,
int g,
int b,
int a)
12313 {
12319 }
12321 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12322 {
12327 }
12328
12330 {
12332 }
12333
12336 {
12337 int r,g,b,a;
12339 r = r/255;
12340 g = g/255;
12341 b = b/255;
12342 a = a/255;
12343 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12344 }
12345
12346
12347
12348 override void SetLiquidType(
int value,
bool allow_client =
false)
12349 {
12350 if (!IsServerCheck(allow_client))
12351 return;
12352
12357 }
12358
12360 {
12361 return ConfigGetInt("varLiquidTypeInit");
12362 }
12363
12365 {
12367 }
12368
12370 {
12372 SetFrozen(false);
12373 }
12374
12377 {
12378 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12379 }
12380
12381
12384 {
12385 PlayerBase nplayer;
12386 if (PlayerBase.CastTo(nplayer, player))
12387 {
12389
12390 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12391 }
12392 }
12393
12394
12397 {
12398 PlayerBase nplayer;
12399 if (PlayerBase.CastTo(nplayer,player))
12400 {
12401
12402 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12403
12404 }
12405
12406
12407 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12408
12409
12410 if (HasEnergyManager())
12411 {
12412 GetCompEM().UpdatePlugState();
12413 }
12414 }
12415
12416
12418 {
12419 super.OnPlacementStarted(player);
12420
12422 }
12423
12424 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12425 {
12427 {
12428 m_AdminLog.OnPlacementComplete(player,
this);
12429 }
12430
12431 super.OnPlacementComplete(player, position, orientation);
12432 }
12433
12434
12435
12436
12437
12439 {
12441 {
12442 return true;
12443 }
12444 else
12445 {
12446 return false;
12447 }
12448 }
12449
12450
12452 {
12454 {
12456 }
12457 }
12458
12459
12461 {
12463 }
12464
12466 {
12468 }
12469
12470 override void InsertAgent(
int agent,
float count = 1)
12471 {
12472 if (count < 1)
12473 return;
12474
12476 }
12477
12480 {
12482 }
12483
12484
12486 {
12488 }
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12532 {
12534 return false;
12535 return true;
12536 }
12537
12539 {
12540
12542 }
12543
12544
12547 {
12548 super.CheckForRoofLimited(timeTresholdMS);
12549
12551 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12552 {
12553 m_PreviousRoofTestTime = time;
12554 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12555 }
12556 }
12557
12558
12560 {
12562 {
12563 return 0;
12564 }
12565
12566 if (GetInventory().GetAttachmentSlotsCount() != 0)
12567 {
12568 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12569 if (filter)
12570 return filter.GetProtectionLevel(type, false, system);
12571 else
12572 return 0;
12573 }
12574
12575 string subclassPath, entryName;
12576
12577 switch (type)
12578 {
12580 entryName = "biological";
12581 break;
12583 entryName = "chemical";
12584 break;
12585 default:
12586 entryName = "biological";
12587 break;
12588 }
12589
12590 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12591
12593 }
12594
12595
12596
12599 {
12600 if (!IsMagazine())
12602
12604 }
12605
12606
12607
12608
12609
12614 {
12615 return true;
12616 }
12617
12619 {
12621 }
12622
12623
12624
12625
12626
12628 {
12629 if (parent)
12630 {
12631 if (parent.IsInherited(DayZInfected))
12632 return true;
12633
12634 if (!parent.IsRuined())
12635 return true;
12636 }
12637
12638 return true;
12639 }
12640
12642 {
12643 if (!super.CanPutAsAttachment(parent))
12644 {
12645 return false;
12646 }
12647
12648 if (!IsRuined() && !parent.IsRuined())
12649 {
12650 return true;
12651 }
12652
12653 return false;
12654 }
12655
12657 {
12658
12659
12660
12661
12662 return super.CanReceiveItemIntoCargo(item);
12663 }
12664
12666 {
12667
12668
12669
12670
12671 GameInventory attachmentInv = attachment.GetInventory();
12673 {
12674 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12675 return false;
12676 }
12677
12678 InventoryLocation loc = new InventoryLocation();
12679 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12680 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12681 return false;
12682
12683 return super.CanReceiveAttachment(attachment, slotId);
12684 }
12685
12687 {
12688 if (!super.CanReleaseAttachment(attachment))
12689 return false;
12690
12691 return GetInventory().AreChildrenAccessible();
12692 }
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12715 {
12716 int id = muzzle_owner.GetMuzzleID();
12717 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12718
12719 if (WPOF_array)
12720 {
12721 for (int i = 0; i < WPOF_array.Count(); i++)
12722 {
12723 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12724
12725 if (WPOF)
12726 {
12727 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12728 }
12729 }
12730 }
12731 }
12732
12733
12735 {
12736 int id = muzzle_owner.GetMuzzleID();
12738
12739 if (WPOBE_array)
12740 {
12741 for (int i = 0; i < WPOBE_array.Count(); i++)
12742 {
12743 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12744
12745 if (WPOBE)
12746 {
12747 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12748 }
12749 }
12750 }
12751 }
12752
12753
12755 {
12756 int id = muzzle_owner.GetMuzzleID();
12757 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12758
12759 if (WPOOH_array)
12760 {
12761 for (int i = 0; i < WPOOH_array.Count(); i++)
12762 {
12763 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12764
12765 if (WPOOH)
12766 {
12767 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12768 }
12769 }
12770 }
12771 }
12772
12773
12775 {
12776 int id = muzzle_owner.GetMuzzleID();
12777 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12778
12779 if (WPOOH_array)
12780 {
12781 for (int i = 0; i < WPOOH_array.Count(); i++)
12782 {
12783 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12784
12785 if (WPOOH)
12786 {
12787 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12788 }
12789 }
12790 }
12791 }
12792
12793
12795 {
12796 int id = muzzle_owner.GetMuzzleID();
12797 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12798
12799 if (WPOOH_array)
12800 {
12801 for (int i = 0; i < WPOOH_array.Count(); i++)
12802 {
12803 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12804
12805 if (WPOOH)
12806 {
12807 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12808 }
12809 }
12810 }
12811 }
12812
12813
12814
12816 {
12818 {
12819 return true;
12820 }
12821
12822 return false;
12823 }
12824
12826 {
12828 {
12829 return true;
12830 }
12831
12832 return false;
12833 }
12834
12836 {
12838 {
12839 return true;
12840 }
12841
12842 return false;
12843 }
12844
12846 {
12847 return false;
12848 }
12849
12852 {
12853 return UATimeSpent.DEFAULT_DEPLOY;
12854 }
12855
12856
12857
12858
12860 {
12862 SetSynchDirty();
12863 }
12864
12866 {
12868 }
12869
12870
12872 {
12873 return false;
12874 }
12875
12878 {
12879 string att_type = "None";
12880
12881 if (ConfigIsExisting("soundAttType"))
12882 {
12883 att_type = ConfigGetString("soundAttType");
12884 }
12885
12887 }
12888
12890 {
12892 }
12893
12894
12895
12896
12897
12903
12905 {
12908
12910 }
12911
12912
12914 {
12916 return;
12917
12919
12922
12925
12926 SoundParameters params = new SoundParameters();
12930 }
12931
12932
12934 {
12936 return;
12937
12939 SetSynchDirty();
12940
12943 }
12944
12945
12947 {
12949 return;
12950
12952 SetSynchDirty();
12953
12956 }
12957
12959 {
12961 }
12962
12964 {
12966 }
12967
12970 {
12971 if (!
GetGame().IsDedicatedServer())
12972 {
12973 if (ConfigIsExisting("attachSoundSet"))
12974 {
12975 string cfg_path = "";
12976 string soundset = "";
12977 string type_name =
GetType();
12978
12981 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12982 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12983
12984 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12985 {
12986 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12987 {
12988 if (cfg_slot_array[i] == slot_type)
12989 {
12990 soundset = cfg_soundset_array[i];
12991 break;
12992 }
12993 }
12994 }
12995
12996 if (soundset != "")
12997 {
12998 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13000 }
13001 }
13002 }
13003 }
13004
13006 {
13007
13008 }
13009
13010 void OnApply(PlayerBase player);
13011
13013 {
13014 return 1.0;
13015 };
13016
13018 {
13020 }
13021
13023 {
13025 }
13026
13028
13030 {
13031 SetDynamicPhysicsLifeTime(0.01);
13033 }
13034
13036 {
13037 array<string> zone_names = new array<string>;
13038 GetDamageZones(zone_names);
13039 for (int i = 0; i < zone_names.Count(); i++)
13040 {
13041 SetHealthMax(zone_names.Get(i),"Health");
13042 }
13043 SetHealthMax("","Health");
13044 }
13045
13048 {
13049 float global_health = GetHealth01("","Health");
13050 array<string> zones = new array<string>;
13051 GetDamageZones(zones);
13052
13053 for (int i = 0; i < zones.Count(); i++)
13054 {
13055 SetHealth01(zones.Get(i),"Health",global_health);
13056 }
13057 }
13058
13061 {
13062 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13063 }
13064
13066 {
13067 if (!hasRootAsPlayer)
13068 {
13069 if (refParentIB)
13070 {
13071
13072 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13073 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13074
13075 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13076 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13077
13080 }
13081 else
13082 {
13083
13086 }
13087 }
13088 }
13089
13091 {
13093 {
13094 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13095 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13096 {
13097 float heatPermCoef = 1.0;
13099 while (ent)
13100 {
13101 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13102 ent = ent.GetHierarchyParent();
13103 }
13104
13105 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13106 }
13107 }
13108 }
13109
13111 {
13112
13113 EntityAI parent = GetHierarchyParent();
13114 if (!parent)
13115 {
13116 hasParent = false;
13117 hasRootAsPlayer = false;
13118 }
13119 else
13120 {
13121 hasParent = true;
13122 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13123 refParentIB =
ItemBase.Cast(parent);
13124 }
13125 }
13126
13127 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13128 {
13129
13130 }
13131
13133 {
13134
13135 return false;
13136 }
13137
13139 {
13140
13141
13142 return false;
13143 }
13144
13146 {
13147
13148 return false;
13149 }
13150
13153 {
13154 return !GetIsFrozen() &&
IsOpen();
13155 }
13156
13158 {
13159 bool hasParent = false, hasRootAsPlayer = false;
13161
13162 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13163 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13164
13165 if (wwtu || foodDecay)
13166 {
13170
13171 if (processWetness || processTemperature || processDecay)
13172 {
13174
13175 if (processWetness)
13176 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13177
13178 if (processTemperature)
13180
13181 if (processDecay)
13182 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13183 }
13184 }
13185 }
13186
13189 {
13191 }
13192
13194 {
13197
13198 return super.GetTemperatureFreezeThreshold();
13199 }
13200
13202 {
13205
13206 return super.GetTemperatureThawThreshold();
13207 }
13208
13210 {
13213
13214 return super.GetItemOverheatThreshold();
13215 }
13216
13218 {
13220 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13221
13222 return super.GetTemperatureFreezeTime();
13223 }
13224
13226 {
13228 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13229
13230 return super.GetTemperatureThawTime();
13231 }
13232
13237
13239 {
13240 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13241 }
13242
13244 {
13245 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13246 }
13247
13250 {
13252 }
13253
13255 {
13257 }
13258
13260 {
13262 }
13263
13266 {
13267 return null;
13268 }
13269
13272 {
13273 return false;
13274 }
13275
13277 {
13279 {
13282 if (!trg)
13283 {
13285 explosive = this;
13286 }
13287
13288 explosive.PairRemote(trg);
13290
13291 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13292 trg.SetPersistentPairID(persistentID);
13293 explosive.SetPersistentPairID(persistentID);
13294
13295 return true;
13296 }
13297 return false;
13298 }
13299
13302 {
13303 float ret = 1.0;
13306 ret *= GetHealth01();
13307
13308 return ret;
13309 }
13310
13311 #ifdef DEVELOPER
13312 override void SetDebugItem()
13313 {
13314 super.SetDebugItem();
13315 _itemBase = this;
13316 }
13317
13319 {
13320 string text = super.GetDebugText();
13321
13323 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13324
13325 return text;
13326 }
13327 #endif
13328
13330 {
13331 return true;
13332 }
13333
13335
13337
13339 {
13342 }
13343
13344
13352
13368}
13369
13371{
13373 if (entity)
13374 {
13375 bool is_item = entity.IsInherited(
ItemBase);
13376 if (is_item && full_quantity)
13377 {
13380 }
13381 }
13382 else
13383 {
13385 return NULL;
13386 }
13387 return entity;
13388}
13389
13391{
13392 if (item)
13393 {
13394 if (health > 0)
13395 item.SetHealth("", "", health);
13396
13397 if (item.CanHaveTemperature())
13398 {
13400 if (item.CanFreeze())
13401 item.SetFrozen(false);
13402 }
13403
13404 if (item.HasEnergyManager())
13405 {
13406 if (quantity >= 0)
13407 {
13408 item.GetCompEM().SetEnergy0To1(quantity);
13409 }
13410 else
13411 {
13413 }
13414 }
13415 else if (item.IsMagazine())
13416 {
13417 Magazine mag = Magazine.Cast(item);
13418 if (quantity >= 0)
13419 {
13420 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13421 }
13422 else
13423 {
13425 }
13426
13427 }
13428 else
13429 {
13430 if (quantity >= 0)
13431 {
13432 item.SetQuantityNormalized(quantity, false);
13433 }
13434 else
13435 {
13437 }
13438
13439 }
13440 }
13441}
13442
13443#ifdef DEVELOPER
13445#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.