8510{
8512 {
8513 return true;
8514 }
8515};
8516
8517
8518
8520{
8524
8526
8529
8530
8531
8532
8533
8542
8548
8553
8558
8579 protected bool m_IsResultOfSplit
8580
8582
8587
8588
8589
8591
8595
8596
8597
8599
8602
8603
8604
8610
8611
8619
8622
8623
8625
8626
8628
8629
8634
8635
8640
8641
8643
8644
8646 {
8651
8652 if (!
GetGame().IsDedicatedServer())
8653 {
8655 {
8657
8659 {
8661 }
8662 }
8663
8666 }
8667
8668 m_OldLocation = null;
8669
8671 {
8673 }
8674
8675 if (ConfigIsExisting("headSelectionsToHide"))
8676 {
8679 }
8680
8682 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8683 {
8685 }
8686
8688
8689 m_IsResultOfSplit = false;
8690
8692 }
8693
8695 {
8696 super.InitItemVariables();
8697
8703 m_Count = ConfigGetInt(
"count");
8704
8707
8712
8715
8720
8732
8736
8737
8740 if (ConfigIsExisting("canBeSplit"))
8741 {
8744 }
8745
8747 if (ConfigIsExisting("itemBehaviour"))
8749
8750
8753 RegisterNetSyncVariableInt("m_VarLiquidType");
8754 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8755
8756 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8757 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8758 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8759
8760 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8761 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8762 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8763 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8764
8765 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8766 RegisterNetSyncVariableBool("m_IsTakeable");
8767 RegisterNetSyncVariableBool("m_IsHologram");
8768
8771 {
8774 }
8775
8777
8779 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8781
8782 }
8783
8785 {
8787 }
8788
8790 {
8793 {
8798 }
8799 }
8800
8801 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8802 {
8804 {
8807 }
8808
8810 }
8811
8813 {
8819 }
8820
8822
8824 {
8826
8827 if (!action)
8828 {
8829 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8830 return;
8831 }
8832
8834 if (!ai)
8835 {
8837 return;
8838 }
8839
8841 if (!action_array)
8842 {
8843 action_array = new array<ActionBase_Basic>;
8845 }
8846 if (LogManager.IsActionLogEnable())
8847 {
8848 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8849 }
8850
8851 if (action_array.Find(action) != -1)
8852 {
8853 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8854 }
8855 else
8856 {
8857 action_array.Insert(action);
8858 }
8859 }
8860
8862 {
8864 ActionBase action = player.GetActionManager().GetAction(actionName);
8867
8868 if (action_array)
8869 {
8870 action_array.RemoveItem(action);
8871 }
8872 }
8873
8874
8875
8877 {
8878 ActionOverrideData overrideData = new ActionOverrideData();
8882
8884 if (!actionMap)
8885 {
8888 }
8889
8890 actionMap.Insert(this.
Type(), overrideData);
8891
8892 }
8893
8895
8897
8898
8900 {
8903
8906
8907 string config_to_search = "CfgVehicles";
8908 string muzzle_owner_config;
8909
8911 {
8912 if (IsInherited(Weapon))
8913 config_to_search = "CfgWeapons";
8914
8915 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8916
8917 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8918
8920
8921 if (config_OnFire_subclass_count > 0)
8922 {
8923 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8924
8925 for (int i = 0; i < config_OnFire_subclass_count; i++)
8926 {
8927 string particle_class = "";
8929 string config_OnFire_entry = config_OnFire_class + particle_class;
8930 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8931 WPOF_array.Insert(WPOF);
8932 }
8933
8934
8936 }
8937 }
8938
8940 {
8941 config_to_search = "CfgWeapons";
8942 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8943
8944 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8945
8947
8948 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8949 {
8950 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8951
8952 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8953 {
8954 string particle_class2 = "";
8956 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8957 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8958 WPOBE_array.Insert(WPOBE);
8959 }
8960
8961
8963 }
8964 }
8965 }
8966
8967
8969 {
8972
8974 {
8975 string config_to_search = "CfgVehicles";
8976
8977 if (IsInherited(Weapon))
8978 config_to_search = "CfgWeapons";
8979
8980 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8981 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8982
8983 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8984 {
8985
8987
8989 {
8991 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8993 return;
8994 }
8995
8998
8999
9000
9002 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9003
9004 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9005 {
9006 string particle_class = "";
9008 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9010
9011 if (entry_type == CT_CLASS)
9012 {
9013 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9014 WPOOH_array.Insert(WPOF);
9015 }
9016 }
9017
9018
9020 }
9021 }
9022 }
9023
9025 {
9027 }
9028
9030 {
9032 {
9034
9037
9040
9041 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9042 }
9043 }
9044
9046 {
9048 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9049
9051 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9052
9054 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9055
9057 {
9059 }
9060 }
9061
9063 {
9065 }
9066
9068 {
9071 else
9073
9075 {
9078 }
9079 else
9080 {
9083
9086 }
9087
9089 }
9090
9092 {
9094 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9095 }
9096
9098 {
9100 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9102 }
9103
9105 {
9107 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9108 }
9109
9111 {
9114
9115 OverheatingParticle OP = new OverheatingParticle();
9120
9122 }
9123
9125 {
9128
9129 return -1;
9130 }
9131
9133 {
9135 {
9138
9139 for (int i = count; i > 0; --i)
9140 {
9141 int id = i - 1;
9144
9147
9148 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9149 {
9150 if (p)
9151 {
9154 }
9155 }
9156 }
9157 }
9158 }
9159
9161 {
9163 {
9165 {
9166 int id = i - 1;
9168
9169 if (OP)
9170 {
9172
9173 if (p)
9174 {
9176 }
9177
9178 delete OP;
9179 }
9180 }
9181
9184 }
9185 }
9186
9189 {
9190 return 0.0;
9191 }
9192
9193
9195 {
9196 return 250;
9197 }
9198
9200 {
9201 return 0;
9202 }
9203
9206 {
9208 return true;
9209
9210 return false;
9211 }
9212
9215 {
9218
9220 {
9222 }
9223 else
9224 {
9225
9227 }
9228
9230 }
9231
9238 {
9239 return -1;
9240 }
9241
9242
9243
9244
9246 {
9248 {
9250 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9251
9252 if (r_index >= 0)
9253 {
9254 InventoryLocation r_il = new InventoryLocation;
9255 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9256
9257 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9260 {
9261 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9262 }
9264 {
9265 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9266 }
9267
9268 }
9269
9270 player.GetHumanInventory().ClearUserReservedLocation(this);
9271 }
9272
9275 }
9276
9277
9278
9279
9281 {
9282 return ItemBase.m_DebugActionsMask;
9283 }
9284
9286 {
9287 return ItemBase.m_DebugActionsMask & mask;
9288 }
9289
9291 {
9292 ItemBase.m_DebugActionsMask = mask;
9293 }
9294
9296 {
9297 ItemBase.m_DebugActionsMask |= mask;
9298 }
9299
9301 {
9302 ItemBase.m_DebugActionsMask &= ~mask;
9303 }
9304
9306 {
9308 {
9310 }
9311 else
9312 {
9314 }
9315 }
9316
9317
9319 {
9320 if (GetEconomyProfile())
9321 {
9322 float q_max = GetEconomyProfile().GetQuantityMax();
9323 if (q_max > 0)
9324 {
9325 float q_min = GetEconomyProfile().GetQuantityMin();
9326 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9327
9329 {
9330 ComponentEnergyManager comp = GetCompEM();
9332 {
9334 }
9335 }
9337 {
9339
9340 }
9341
9342 }
9343 }
9344 }
9345
9348 {
9349 EntityAI parent = GetHierarchyParent();
9350
9351 if (parent)
9352 {
9353 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9354 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9355 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9356 }
9357 }
9358
9361 {
9362 EntityAI parent = GetHierarchyParent();
9363
9364 if (parent)
9365 {
9366 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9367 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9368 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9369 }
9370 }
9371
9373 {
9374
9375
9376
9377
9379
9381 {
9382 if (ScriptInputUserData.CanStoreInputUserData())
9383 {
9384 ScriptInputUserData ctx = new ScriptInputUserData;
9390 ctx.
Write(use_stack_max);
9393
9395 {
9396 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9397 }
9398 }
9399 }
9400 else if (!
GetGame().IsMultiplayer())
9401 {
9403 }
9404 }
9405
9407 {
9409 }
9410
9412 {
9414 }
9415
9417 {
9419 }
9420
9422 {
9423
9424 return false;
9425 }
9426
9428 {
9429 return false;
9430 }
9431
9435 {
9436 return false;
9437 }
9438
9440 {
9441 return "";
9442 }
9443
9445
9447 {
9448 return false;
9449 }
9450
9452 {
9453 return true;
9454 }
9455
9456
9457
9459 {
9460 return true;
9461 }
9462
9464 {
9465 return true;
9466 }
9467
9469 {
9470 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9472 }
9473
9475 {
9477 }
9478
9480 {
9482 if (!is_being_placed)
9484 SetSynchDirty();
9485 }
9486
9487
9489
9491 {
9493 }
9494
9496 {
9498 }
9499
9501 {
9502 return 1;
9503 }
9504
9506 {
9507 return false;
9508 }
9509
9511 {
9513 SetSynchDirty();
9514 }
9515
9516
9517
9518
9519
9520
9521
9522
9523
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
9551 {
9552 super.OnMovedInsideCargo(container);
9553
9554 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9555 }
9556
9557 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9558 {
9559 super.EEItemLocationChanged(oldLoc,newLoc);
9560
9561 PlayerBase new_player = null;
9562 PlayerBase old_player = null;
9563
9564 if (newLoc.GetParent())
9565 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9566
9567 if (oldLoc.GetParent())
9568 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9569
9571 {
9572 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9573
9574 if (r_index >= 0)
9575 {
9576 InventoryLocation r_il = new InventoryLocation;
9577 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9578
9579 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9582 {
9583 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9584 }
9586 {
9587 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9588 }
9589
9590 }
9591 }
9592
9594 {
9595 if (new_player)
9596 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9597
9598 if (new_player == old_player)
9599 {
9600
9601 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9602 {
9604 {
9605 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9606 {
9607 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9608 }
9609 }
9610 else
9611 {
9612 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9613 }
9614 }
9615
9616 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9617 {
9618 int type = oldLoc.GetType();
9620 {
9621 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9622 }
9624 {
9625 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9626 }
9627 }
9628 if (!m_OldLocation)
9629 {
9630 m_OldLocation = new InventoryLocation;
9631 }
9632 m_OldLocation.Copy(oldLoc);
9633 }
9634 else
9635 {
9636 if (m_OldLocation)
9637 {
9638 m_OldLocation.Reset();
9639 }
9640 }
9641
9643 }
9644 else
9645 {
9646 if (new_player)
9647 {
9648 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9649 if (res_index >= 0)
9650 {
9651 InventoryLocation il = new InventoryLocation;
9652 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9654 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9657 {
9658 il.
GetParent().GetOnReleaseLock().Invoke(it);
9659 }
9661 {
9663 }
9664
9665 }
9666 }
9668 {
9669
9671 }
9672
9673 if (m_OldLocation)
9674 {
9675 m_OldLocation.Reset();
9676 }
9677 }
9678 }
9679
9680 override void EOnContact(IEntity other, Contact extra)
9681 {
9683 {
9684 int liquidType = -1;
9686 if (impactSpeed > 0.0)
9687 {
9689 #ifndef SERVER
9691 #else
9693 SetSynchDirty();
9694 #endif
9696 }
9697 }
9698
9699 #ifdef SERVER
9700 if (GetCompEM() && GetCompEM().IsPlugged())
9701 {
9702 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9703 GetCompEM().UnplugThis();
9704 }
9705 #endif
9706 }
9707
9709
9711 {
9713 }
9714
9716 {
9717
9718 }
9719
9721 {
9722 super.OnItemLocationChanged(old_owner, new_owner);
9723
9724 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9725 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9726
9727 if (!relatedPlayer && playerNew)
9728 relatedPlayer = playerNew;
9729
9730 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9731 {
9733 if (actionMgr)
9734 {
9735 ActionBase currentAction = actionMgr.GetRunningAction();
9736 if (currentAction)
9738 }
9739 }
9740
9741 Man ownerPlayerOld = null;
9742 Man ownerPlayerNew = null;
9743
9744 if (old_owner)
9745 {
9746 if (old_owner.
IsMan())
9747 {
9748 ownerPlayerOld = Man.Cast(old_owner);
9749 }
9750 else
9751 {
9752 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9753 }
9754 }
9755 else
9756 {
9758 {
9760
9761 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9762 {
9763 GetCompEM().UnplugThis();
9764 }
9765 }
9766 }
9767
9768 if (new_owner)
9769 {
9770 if (new_owner.
IsMan())
9771 {
9772 ownerPlayerNew = Man.Cast(new_owner);
9773 }
9774 else
9775 {
9776 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9777 }
9778 }
9779
9780 if (ownerPlayerOld != ownerPlayerNew)
9781 {
9782 if (ownerPlayerOld)
9783 {
9784 array<EntityAI> subItemsExit = new array<EntityAI>;
9786 for (int i = 0; i < subItemsExit.Count(); i++)
9787 {
9790 }
9791 }
9792
9793 if (ownerPlayerNew)
9794 {
9795 array<EntityAI> subItemsEnter = new array<EntityAI>;
9797 for (int j = 0; j < subItemsEnter.Count(); j++)
9798 {
9801 }
9802 }
9803 }
9804 else if (ownerPlayerNew != null)
9805 {
9806 PlayerBase nplayer;
9807 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9808 {
9809 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9811 for (int k = 0; k < subItemsUpdate.Count(); k++)
9812 {
9814 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9815 }
9816 }
9817 }
9818
9819 if (old_owner)
9820 old_owner.OnChildItemRemoved(this);
9821 if (new_owner)
9822 new_owner.OnChildItemReceived(this);
9823 }
9824
9825
9827 {
9828 super.EEDelete(parent);
9829 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9830 if (player)
9831 {
9833
9834 if (player.IsAlive())
9835 {
9836 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9837 if (r_index >= 0)
9838 {
9839 InventoryLocation r_il = new InventoryLocation;
9840 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9841
9842 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9845 {
9846 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9847 }
9849 {
9850 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9851 }
9852
9853 }
9854
9855 player.RemoveQuickBarEntityShortcut(this);
9856 }
9857 }
9858 }
9859
9861 {
9862 super.EEKilled(killer);
9863
9866 {
9867 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9868 {
9869 if (IsMagazine())
9870 {
9871 if (Magazine.Cast(this).GetAmmoCount() > 0)
9872 {
9874 }
9875 }
9876 else
9877 {
9879 }
9880 }
9881 }
9882 }
9883
9885 {
9886 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9887
9888 super.OnWasAttached(parent, slot_id);
9889
9892
9894 }
9895
9897 {
9898 super.OnWasDetached(parent, slot_id);
9899
9902 }
9903
9905 {
9906 int idx;
9909
9910 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9911 if (inventory_slots.Count() < 1)
9912 {
9913 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9914 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9915 }
9916 else
9917 {
9918 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9919 }
9920
9921 idx = inventory_slots.Find(slot);
9922 if (idx < 0)
9923 return "";
9924
9925 return attach_types.Get(idx);
9926 }
9927
9929 {
9930 int idx = -1;
9931 string slot;
9932
9935
9936 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9937 if (inventory_slots.Count() < 1)
9938 {
9939 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9940 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9941 }
9942 else
9943 {
9944 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9945 if (detach_types.Count() < 1)
9946 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9947 }
9948
9949 for (int i = 0; i < inventory_slots.Count(); i++)
9950 {
9951 slot = inventory_slots.Get(i);
9952 }
9953
9954 if (slot != "")
9955 {
9956 if (detach_types.Count() == 1)
9957 idx = 0;
9958 else
9959 idx = inventory_slots.Find(slot);
9960 }
9961 if (idx < 0)
9962 return "";
9963
9964 return detach_types.Get(idx);
9965 }
9966
9968 {
9969
9971
9972
9973 float min_time = 1;
9974 float max_time = 3;
9975 float delay = Math.RandomFloat(min_time, max_time);
9976
9977 explode_timer.Run(delay, this, "DoAmmoExplosion");
9978 }
9979
9981 {
9982 Magazine magazine = Magazine.Cast(this);
9983 int pop_sounds_count = 6;
9984 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9985
9986
9987 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9988 string sound_name = pop_sounds[ sound_idx ];
9990
9991
9992 magazine.ServerAddAmmoCount(-1);
9993
9994
9995 float min_temp_to_explode = 100;
9996
9997 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9998 {
10000 }
10001 }
10002
10003
10004 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10005 {
10006 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10007
10008 const int CHANCE_DAMAGE_CARGO = 4;
10009 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10010 const int CHANCE_DAMAGE_NOTHING = 2;
10011
10013 {
10014 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10015 int chances;
10016 int rnd;
10017
10018 if (GetInventory().GetCargo())
10019 {
10020 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10021 rnd = Math.RandomInt(0,chances);
10022
10023 if (rnd < CHANCE_DAMAGE_CARGO)
10024 {
10026 }
10027 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10028 {
10030 }
10031 }
10032 else
10033 {
10034 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10035 rnd = Math.RandomInt(0,chances);
10036
10037 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10038 {
10040 }
10041 }
10042 }
10043 }
10044
10046 {
10047 if (GetInventory().GetCargo())
10048 {
10049 int item_count = GetInventory().GetCargo().GetItemCount();
10050 if (item_count > 0)
10051 {
10052 int random_pick = Math.RandomInt(0, item_count);
10054 if (!item.IsExplosive())
10055 {
10056 item.AddHealth("","",damage);
10057 return true;
10058 }
10059 }
10060 }
10061 return false;
10062 }
10063
10065 {
10066 int attachment_count = GetInventory().AttachmentCount();
10067 if (attachment_count > 0)
10068 {
10069 int random_pick = Math.RandomInt(0, attachment_count);
10070 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10071 if (!attachment.IsExplosive())
10072 {
10073 attachment.AddHealth("","",damage);
10074 return true;
10075 }
10076 }
10077 return false;
10078 }
10079
10081 {
10083 }
10084
10086 {
10088 return GetInventory().CanRemoveEntity();
10089
10090 return false;
10091 }
10092
10094 {
10095
10097 return false;
10098
10099
10101 return false;
10102
10103
10104
10106 if (delta == 0)
10107 return false;
10108
10109
10110 return true;
10111 }
10112
10114 {
10116 {
10117 if (ScriptInputUserData.CanStoreInputUserData())
10118 {
10119 ScriptInputUserData ctx = new ScriptInputUserData;
10124 ctx.
Write(destination_entity);
10126 ctx.
Write(slot_id);
10128 }
10129 }
10130 else if (!
GetGame().IsMultiplayer())
10131 {
10133 }
10134 }
10135
10137 {
10138 float split_quantity_new;
10142 InventoryLocation loc = new InventoryLocation;
10143
10144 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10145 {
10147 split_quantity_new = stack_max;
10148 else
10150
10152 {
10153 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10154 if (new_item)
10155 {
10156 new_item.SetResultOfSplit(true);
10157 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10159 new_item.
SetQuantity(split_quantity_new,
false,
true);
10160 }
10161 }
10162 }
10163 else if (destination_entity && slot_id == -1)
10164 {
10165 if (quantity > stack_max)
10166 split_quantity_new = stack_max;
10167 else
10168 split_quantity_new = quantity;
10169
10171 {
10173 {
10176 }
10177
10178 if (new_item)
10179 {
10180 new_item.SetResultOfSplit(true);
10181 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10183 new_item.
SetQuantity(split_quantity_new,
false,
true);
10184 }
10185 }
10186 }
10187 else
10188 {
10189 if (stack_max != 0)
10190 {
10192 {
10194 }
10195
10196 if (split_quantity_new == 0)
10197 {
10198 if (!
GetGame().IsMultiplayer())
10199 player.PhysicalPredictiveDropItem(this);
10200 else
10201 player.ServerDropEntity(this);
10202 return;
10203 }
10204
10206 {
10208
10209 if (new_item)
10210 {
10211 new_item.SetResultOfSplit(true);
10212 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10215 new_item.PlaceOnSurface();
10216 }
10217 }
10218 }
10219 }
10220 }
10221
10223 {
10224 float split_quantity_new;
10228 InventoryLocation loc = new InventoryLocation;
10229
10230 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10231 {
10233 split_quantity_new = stack_max;
10234 else
10236
10238 {
10239 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10240 if (new_item)
10241 {
10242 new_item.SetResultOfSplit(true);
10243 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10245 new_item.
SetQuantity(split_quantity_new,
false,
true);
10246 }
10247 }
10248 }
10249 else if (destination_entity && slot_id == -1)
10250 {
10251 if (quantity > stack_max)
10252 split_quantity_new = stack_max;
10253 else
10254 split_quantity_new = quantity;
10255
10257 {
10259 {
10262 }
10263
10264 if (new_item)
10265 {
10266 new_item.SetResultOfSplit(true);
10267 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10269 new_item.
SetQuantity(split_quantity_new,
false,
true);
10270 }
10271 }
10272 }
10273 else
10274 {
10275 if (stack_max != 0)
10276 {
10278 {
10280 }
10281
10283 {
10285
10286 if (new_item)
10287 {
10288 new_item.SetResultOfSplit(true);
10289 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10292 new_item.PlaceOnSurface();
10293 }
10294 }
10295 }
10296 }
10297 }
10298
10300 {
10302 {
10303 if (ScriptInputUserData.CanStoreInputUserData())
10304 {
10305 ScriptInputUserData ctx = new ScriptInputUserData;
10310 dst.WriteToContext(ctx);
10312 }
10313 }
10314 else if (!
GetGame().IsMultiplayer())
10315 {
10317 }
10318 }
10319
10321 {
10323 {
10324 if (ScriptInputUserData.CanStoreInputUserData())
10325 {
10326 ScriptInputUserData ctx = new ScriptInputUserData;
10331 ctx.
Write(destination_entity);
10337 }
10338 }
10339 else if (!
GetGame().IsMultiplayer())
10340 {
10342 }
10343 }
10344
10346 {
10348 }
10349
10351 {
10353 float split_quantity_new;
10355 if (dst.IsValid())
10356 {
10357 int slot_id = dst.GetSlot();
10359
10360 if (quantity > stack_max)
10361 split_quantity_new = stack_max;
10362 else
10363 split_quantity_new = quantity;
10364
10366 {
10368
10369 if (new_item)
10370 {
10371 new_item.SetResultOfSplit(true);
10372 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10374 new_item.
SetQuantity(split_quantity_new,
false,
true);
10375 }
10376
10377 return new_item;
10378 }
10379 }
10380
10381 return null;
10382 }
10383
10385 {
10387 float split_quantity_new;
10389 if (destination_entity)
10390 {
10392 if (quantity > stackable)
10393 split_quantity_new = stackable;
10394 else
10395 split_quantity_new = quantity;
10396
10398 {
10399 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10400 if (new_item)
10401 {
10402 new_item.SetResultOfSplit(true);
10403 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10405 new_item.
SetQuantity(split_quantity_new,
false,
true);
10406 }
10407 }
10408 }
10409 }
10410
10412 {
10414 {
10415 if (ScriptInputUserData.CanStoreInputUserData())
10416 {
10417 ScriptInputUserData ctx = new ScriptInputUserData;
10422 ItemBase destination_entity =
this;
10423 ctx.
Write(destination_entity);
10427 }
10428 }
10429 else if (!
GetGame().IsMultiplayer())
10430 {
10432 }
10433 }
10434
10436 {
10438 float split_quantity_new;
10440 if (player)
10441 {
10443 if (quantity > stackable)
10444 split_quantity_new = stackable;
10445 else
10446 split_quantity_new = quantity;
10447
10449 {
10450 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10451 new_item =
ItemBase.Cast(in_hands);
10452 if (new_item)
10453 {
10454 new_item.SetResultOfSplit(true);
10455 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10457 new_item.SetQuantity(split_quantity_new, false, true);
10458 }
10459 }
10460 }
10461 }
10462
10464 {
10466 float split_quantity_new = Math.Floor(quantity * 0.5);
10467
10469 return;
10470
10472
10473 if (new_item)
10474 {
10475 if (new_item.GetQuantityMax() < split_quantity_new)
10476 {
10477 split_quantity_new = new_item.GetQuantityMax();
10478 }
10479
10480 new_item.SetResultOfSplit(true);
10481 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10482
10484 {
10487 }
10488 else
10489 {
10491 new_item.
SetQuantity(split_quantity_new,
false,
true);
10492 }
10493 }
10494 }
10495
10497 {
10499 float split_quantity_new = Math.Floor(quantity / 2);
10500
10502 return;
10503
10504 InventoryLocation invloc = new InventoryLocation;
10506
10508 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10509
10510 if (new_item)
10511 {
10512 if (new_item.GetQuantityMax() < split_quantity_new)
10513 {
10514 split_quantity_new = new_item.GetQuantityMax();
10515 }
10517 {
10520 }
10521 else if (split_quantity_new > 1)
10522 {
10524 new_item.
SetQuantity(split_quantity_new,
false,
true);
10525 }
10526 }
10527 }
10528
10531 {
10532 SetWeightDirty();
10534
10535 if (parent)
10536 parent.OnAttachmentQuantityChangedEx(this, delta);
10537
10539 {
10541 {
10543 }
10545 {
10546 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10548 }
10549 }
10550
10551 }
10552
10555 {
10556
10557 }
10558
10561 {
10563 }
10564
10566 {
10567 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10568
10570 {
10571 if (newLevel == GameConstants.STATE_RUINED)
10572 {
10574 EntityAI parent = GetHierarchyParent();
10575 if (parent && parent.IsFireplace())
10576 {
10577 CargoBase cargo = GetInventory().GetCargo();
10578 if (cargo)
10579 {
10581 {
10583 }
10584 }
10585 }
10586 }
10587
10589 {
10590
10592 return;
10593 }
10594
10595 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10596 {
10598 }
10599 }
10600 }
10601
10602
10604 {
10605 super.OnRightClick();
10606
10608 {
10610 {
10611 if (ScriptInputUserData.CanStoreInputUserData())
10612 {
10613 EntityAI root = GetHierarchyRoot();
10614 Man playerOwner = GetHierarchyRootPlayer();
10615 InventoryLocation dst = new InventoryLocation;
10616
10617
10618 if (!playerOwner && root && root == this)
10619 {
10621 }
10622 else
10623 {
10624
10625 GetInventory().GetCurrentInventoryLocation(dst);
10627 {
10630 {
10632 }
10633 else
10634 {
10636
10637
10638 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10639 {
10641 }
10642 else
10643 {
10644 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10645 }
10646 }
10647 }
10648 }
10649
10650 ScriptInputUserData ctx = new ScriptInputUserData;
10658 }
10659 }
10660 else if (!
GetGame().IsMultiplayer())
10661 {
10663 }
10664 }
10665 }
10666
10668 {
10669 if (root)
10670 {
10671 vector m4[4];
10672 root.GetTransform(m4);
10673 dst.SetGround(this, m4);
10674 }
10675 else
10676 {
10677 GetInventory().GetCurrentInventoryLocation(dst);
10678 }
10679 }
10680
10681 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10682 {
10683
10684 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10685 return false;
10686
10687 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10688 return false;
10689
10690
10692 return false;
10693
10694
10695 Magazine mag = Magazine.Cast(this);
10696 if (mag)
10697 {
10698 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10699 return false;
10700
10701 if (stack_max_limit)
10702 {
10703 Magazine other_mag = Magazine.Cast(other_item);
10704 if (other_item)
10705 {
10706 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10707 return false;
10708 }
10709
10710 }
10711 }
10712 else
10713 {
10714
10716 return false;
10717
10719 return false;
10720 }
10721
10722 PlayerBase player = null;
10723 if (CastTo(player, GetHierarchyRootPlayer()))
10724 {
10725 if (player.GetInventory().HasAttachment(this))
10726 return false;
10727
10728 if (player.IsItemsToDelete())
10729 return false;
10730 }
10731
10732 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10733 return false;
10734
10735 int slotID;
10737 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10738 return false;
10739
10740 return true;
10741 }
10742
10744 {
10746 }
10747
10749 {
10750 return m_IsResultOfSplit;
10751 }
10752
10754 {
10755 m_IsResultOfSplit = value;
10756 }
10757
10759 {
10761 }
10762
10764 {
10765 float other_item_quantity = other_item.GetQuantity();
10766 float this_free_space;
10767
10769
10771
10772 if (other_item_quantity > this_free_space)
10773 {
10774 return this_free_space;
10775 }
10776 else
10777 {
10778 return other_item_quantity;
10779 }
10780 }
10781
10783 {
10785 }
10786
10788 {
10790 return;
10791
10792 if (!IsMagazine() && other_item)
10793 {
10795 if (quantity_used != 0)
10796 {
10797 float hp1 = GetHealth01("","");
10798 float hp2 = other_item.GetHealth01("","");
10799 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10800 hpResult = hpResult / (
GetQuantity() + quantity_used);
10801
10802 hpResult *= GetMaxHealth();
10803 Math.Round(hpResult);
10804 SetHealth("", "Health", hpResult);
10805
10807 other_item.AddQuantity(-quantity_used);
10808 }
10809 }
10811 }
10812
10814 {
10815 #ifdef SERVER
10816 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10817 GetHierarchyParent().IncreaseLifetimeUp();
10818 #endif
10819 };
10820
10822 {
10823 PlayerBase p = PlayerBase.Cast(player);
10824
10825 array<int> recipesIds = p.m_Recipes;
10826 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10827 if (moduleRecipesManager)
10828 {
10829 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10830 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10831 }
10832
10833 for (int i = 0;i < recipesIds.Count(); i++)
10834 {
10835 int key = recipesIds.Get(i);
10836 string recipeName = moduleRecipesManager.GetRecipeName(key);
10838 }
10839 }
10840
10841
10842 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10843 {
10844 super.GetDebugActions(outputList);
10845
10846
10852
10853
10858
10863
10864
10868
10869
10871 {
10875 }
10876
10879
10880
10884
10886
10887 InventoryLocation loc = new InventoryLocation();
10888 GetInventory().GetCurrentInventoryLocation(loc);
10890 {
10891 if (Gizmo_IsSupported())
10894 }
10895
10897 }
10898
10899
10900
10901
10903 {
10904 super.OnAction(action_id, player, ctx);
10905
10907 {
10908 switch (action_id)
10909 {
10912 return true;
10915 return true;
10916 }
10917 }
10918
10920 {
10921 switch (action_id)
10922 {
10924 Delete();
10925 return true;
10926 }
10927 }
10928
10929 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10930 {
10931 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10932 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10933 PlayerBase p = PlayerBase.Cast(player);
10934 if (
EActions.RECIPES_RANGE_START < 1000)
10935 {
10936 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10937 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10938 }
10939 }
10940 #ifndef SERVER
10941 else if (action_id ==
EActions.WATCH_PLAYER)
10942 {
10943 PluginDeveloper.SetDeveloperItemClientEx(player);
10944 }
10945 #endif
10947 {
10948 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10949 {
10950 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10951 OnDebugButtonPressServer(id + 1);
10952 }
10953
10954 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10955 {
10956 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10958 }
10959
10960 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10961 {
10962 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10964 }
10965
10966 else if (action_id ==
EActions.ADD_QUANTITY)
10967 {
10968 if (IsMagazine())
10969 {
10970 Magazine mag = Magazine.Cast(this);
10971 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10972 }
10973 else
10974 {
10976 }
10977
10978 if (m_EM)
10979 {
10980 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10981 }
10982
10983 }
10984
10985 else if (action_id ==
EActions.REMOVE_QUANTITY)
10986 {
10987 if (IsMagazine())
10988 {
10989 Magazine mag2 = Magazine.Cast(this);
10990 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10991 }
10992 else
10993 {
10995 }
10996 if (m_EM)
10997 {
10998 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10999 }
11000
11001 }
11002
11003 else if (action_id ==
EActions.SET_QUANTITY_0)
11004 {
11006
11007 if (m_EM)
11008 {
11009 m_EM.SetEnergy(0);
11010 }
11011 }
11012
11013 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11014 {
11016
11017 if (m_EM)
11018 {
11019 m_EM.SetEnergy(m_EM.GetEnergyMax());
11020 }
11021 }
11022
11023 else if (action_id ==
EActions.ADD_HEALTH)
11024 {
11025 AddHealth("","",GetMaxHealth("","Health")/5);
11026 }
11027 else if (action_id ==
EActions.REMOVE_HEALTH)
11028 {
11029 AddHealth("","",-GetMaxHealth("","Health")/5);
11030 }
11031 else if (action_id ==
EActions.DESTROY_HEALTH)
11032 {
11033 SetHealth01("","",0);
11034 }
11035 else if (action_id ==
EActions.WATCH_ITEM)
11036 {
11038 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11039 #ifdef DEVELOPER
11040 SetDebugDeveloper_item(this);
11041 #endif
11042 }
11043
11044 else if (action_id ==
EActions.ADD_TEMPERATURE)
11045 {
11046 AddTemperature(20);
11047
11048 }
11049
11050 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11051 {
11052 AddTemperature(-20);
11053
11054 }
11055
11056 else if (action_id ==
EActions.FLIP_FROZEN)
11057 {
11058 SetFrozen(!GetIsFrozen());
11059
11060 }
11061
11062 else if (action_id ==
EActions.ADD_WETNESS)
11063 {
11065
11066 }
11067
11068 else if (action_id ==
EActions.REMOVE_WETNESS)
11069 {
11071
11072 }
11073
11074 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11075 {
11078
11079
11080 }
11081
11082 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11083 {
11086 }
11087
11088 else if (action_id ==
EActions.MAKE_SPECIAL)
11089 {
11090 auto debugParams = DebugSpawnParams.WithPlayer(player);
11091 OnDebugSpawnEx(debugParams);
11092 }
11093
11094 }
11095
11096
11097 return false;
11098 }
11099
11100
11101
11102
11106
11109
11110
11111
11113 {
11114 return false;
11115 }
11116
11117
11119 {
11120 return true;
11121 }
11122
11123
11125 {
11126 return true;
11127 }
11128
11129
11130
11132 {
11133 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11135 }
11136
11139 {
11140 return null;
11141 }
11142
11144 {
11145 return false;
11146 }
11147
11149 {
11150 return false;
11151 }
11152
11156
11157
11159 {
11160 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11161 return module_repairing.CanRepair(this, item_repair_kit);
11162 }
11163
11164
11165 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11166 {
11167 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11168 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11169 }
11170
11171
11173 {
11174
11175
11176
11177
11178
11179
11180
11181
11182 return 1;
11183 }
11184
11185
11186
11188 {
11190 }
11191
11192
11193
11195 {
11197 }
11198
11199
11208 {
11209 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11210
11211 if (player)
11212 {
11213 player.MessageStatus(text);
11214 }
11215 }
11216
11217
11226 {
11227 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11228
11229 if (player)
11230 {
11231 player.MessageAction(text);
11232 }
11233 }
11234
11235
11244 {
11245 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11246
11247 if (player)
11248 {
11249 player.MessageFriendly(text);
11250 }
11251 }
11252
11253
11262 {
11263 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11264
11265 if (player)
11266 {
11267 player.MessageImportant(text);
11268 }
11269 }
11270
11272 {
11273 return true;
11274 }
11275
11276
11277 override bool KindOf(
string tag)
11278 {
11279 bool found = false;
11280 string item_name = this.
GetType();
11283
11284 int array_size = item_tag_array.Count();
11285 for (int i = 0; i < array_size; i++)
11286 {
11287 if (item_tag_array.Get(i) == tag)
11288 {
11289 found = true;
11290 break;
11291 }
11292 }
11293 return found;
11294 }
11295
11296
11298 {
11299
11300 super.OnRPC(sender, rpc_type,ctx);
11301
11302
11303 switch (rpc_type)
11304 {
11305 #ifndef SERVER
11306 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11307 Param2<bool, string> p = new Param2<bool, string>(false, "");
11308
11310 return;
11311
11312 bool play = p.param1;
11313 string soundSet = p.param2;
11314
11315 if (play)
11316 {
11318 {
11320 {
11322 }
11323 }
11324 else
11325 {
11327 }
11328 }
11329 else
11330 {
11332 }
11333
11334 break;
11335 #endif
11336
11337 }
11338
11340 {
11342 }
11343 }
11344
11345
11346
11347
11349 {
11350 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11351 return plugin.GetID(
name);
11352 }
11353
11355 {
11356 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11357 return plugin.GetName(id);
11358 }
11359
11362 {
11363
11364
11365 int varFlags;
11366 if (!ctx.
Read(varFlags))
11367 return;
11368
11369 if (varFlags & ItemVariableFlags.FLOAT)
11370 {
11372 }
11373 }
11374
11376 {
11377
11378 super.SerializeNumericalVars(floats_out);
11379
11380
11381
11383 {
11385 }
11386
11388 {
11390 }
11391
11393 {
11395 }
11396
11398 {
11403 }
11404
11406 {
11408 }
11409 }
11410
11412 {
11413
11414 super.DeSerializeNumericalVars(floats);
11415
11416
11417 int index = 0;
11418 int mask = Math.Round(floats.Get(index));
11419
11420 index++;
11421
11423 {
11425 {
11427 }
11428 else
11429 {
11430 float quantity = floats.Get(index);
11431 SetQuantity(quantity,
true,
false,
false,
false);
11432 }
11433 index++;
11434 }
11435
11437 {
11438 float wet = floats.Get(index);
11440 index++;
11441 }
11442
11444 {
11445 int liquidtype = Math.Round(floats.Get(index));
11447 index++;
11448 }
11449
11451 {
11453 index++;
11455 index++;
11457 index++;
11459 index++;
11460 }
11461
11463 {
11464 int cleanness = Math.Round(floats.Get(index));
11466 index++;
11467 }
11468 }
11469
11471 {
11472 super.WriteVarsToCTX(ctx);
11473
11474
11476 {
11478 }
11479
11481 {
11483 }
11484
11486 {
11488 }
11489
11491 {
11492 int r,g,b,a;
11498 }
11499
11501 {
11503 }
11504 }
11505
11507 {
11508 if (!super.ReadVarsFromCTX(ctx,version))
11509 return false;
11510
11511 int intValue;
11512 float value;
11513
11514 if (version < 140)
11515 {
11516 if (!ctx.
Read(intValue))
11517 return false;
11518
11519 m_VariablesMask = intValue;
11520 }
11521
11523 {
11524 if (!ctx.
Read(value))
11525 return false;
11526
11528 {
11530 }
11531 else
11532 {
11534 }
11535 }
11536
11537 if (version < 140)
11538 {
11540 {
11541 if (!ctx.
Read(value))
11542 return false;
11543 SetTemperatureDirect(value);
11544 }
11545 }
11546
11548 {
11549 if (!ctx.
Read(value))
11550 return false;
11552 }
11553
11555 {
11556 if (!ctx.
Read(intValue))
11557 return false;
11559 }
11560
11562 {
11563 int r,g,b,a;
11565 return false;
11567 return false;
11569 return false;
11571 return false;
11572
11574 }
11575
11577 {
11578 if (!ctx.
Read(intValue))
11579 return false;
11581 }
11582
11583 if (version >= 138 && version < 140)
11584 {
11586 {
11587 if (!ctx.
Read(intValue))
11588 return false;
11589 SetFrozen(intValue);
11590 }
11591 }
11592
11593 return true;
11594 }
11595
11596
11598 {
11601 {
11603 }
11604
11605 if (!super.OnStoreLoad(ctx, version))
11606 {
11608 return false;
11609 }
11610
11611 if (version >= 114)
11612 {
11613 bool hasQuickBarIndexSaved;
11614
11615 if (!ctx.
Read(hasQuickBarIndexSaved))
11616 {
11618 return false;
11619 }
11620
11621 if (hasQuickBarIndexSaved)
11622 {
11623 int itmQBIndex;
11624
11625
11626 if (!ctx.
Read(itmQBIndex))
11627 {
11629 return false;
11630 }
11631
11632 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11633 if (itmQBIndex != -1 && parentPlayer)
11634 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11635 }
11636 }
11637 else
11638 {
11639
11640 PlayerBase player;
11641 int itemQBIndex;
11642 if (version ==
int.
MAX)
11643 {
11644 if (!ctx.
Read(itemQBIndex))
11645 {
11647 return false;
11648 }
11649 }
11650 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11651 {
11652
11653 if (!ctx.
Read(itemQBIndex))
11654 {
11656 return false;
11657 }
11658 if (itemQBIndex != -1 && player)
11659 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11660 }
11661 }
11662
11663 if (version < 140)
11664 {
11665
11666 if (!LoadVariables(ctx, version))
11667 {
11669 return false;
11670 }
11671 }
11672
11673
11675 {
11677 return false;
11678 }
11679 if (version >= 132)
11680 {
11682 if (raib)
11683 {
11685 {
11687 return false;
11688 }
11689 }
11690 }
11691
11693 return true;
11694 }
11695
11696
11697
11699 {
11700 super.OnStoreSave(ctx);
11701
11702 PlayerBase player;
11703 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11704 {
11706
11707 int itemQBIndex = -1;
11708 itemQBIndex = player.FindQuickBarEntityIndex(this);
11709 ctx.
Write(itemQBIndex);
11710 }
11711 else
11712 {
11714 }
11715
11717
11719 if (raib)
11720 {
11722 }
11723 }
11724
11725
11727 {
11728 super.AfterStoreLoad();
11729
11731 {
11733 }
11734
11736 {
11739 }
11740 }
11741
11743 {
11744 super.EEOnAfterLoad();
11745
11747 {
11749 }
11750
11753 }
11754
11756 {
11757 return false;
11758 }
11759
11760
11761
11763 {
11765 {
11766 #ifdef PLATFORM_CONSOLE
11767
11769 {
11771 if (menu)
11772 {
11774 }
11775 }
11776 #endif
11777 }
11778
11780 {
11783 }
11784
11786 {
11787 SetWeightDirty();
11789 }
11791 {
11794 }
11795
11797 {
11800 }
11802 {
11805 }
11806
11807 super.OnVariablesSynchronized();
11808 }
11809
11810
11811
11813 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11814 {
11815 if (!IsServerCheck(allow_client))
11816 return false;
11817
11819 return false;
11820
11823
11824 if (value <= (min + 0.001))
11825 value = min;
11826
11827 if (value == min)
11828 {
11829 if (destroy_config)
11830 {
11831 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11832 if (dstr)
11833 {
11835 this.Delete();
11836 return true;
11837 }
11838 }
11839 else if (destroy_forced)
11840 {
11842 this.Delete();
11843 return true;
11844 }
11845
11847 }
11848
11851
11853 {
11855
11856 if (delta)
11858 }
11859
11861
11862 return false;
11863 }
11864
11865
11867 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11868 {
11870 }
11871
11873 {
11876 }
11877
11879 {
11882 }
11883
11885 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11886 {
11887 float value_clamped = Math.Clamp(value, 0, 1);
11889 SetQuantity(result, destroy_config, destroy_forced);
11890 }
11891
11892
11895 {
11897 }
11898
11900 {
11902 }
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11914 {
11915 int slot = -1;
11916 if (GetInventory())
11917 {
11918 InventoryLocation il = new InventoryLocation;
11919 GetInventory().GetCurrentInventoryLocation(il);
11921 }
11922
11924 }
11925
11927 {
11928 float quantity_max = 0;
11929
11931 {
11932 if (attSlotID != -1)
11933 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11934
11935 if (quantity_max <= 0)
11937 }
11938
11939 if (quantity_max <= 0)
11941
11942 return quantity_max;
11943 }
11944
11946 {
11948 }
11949
11951 {
11953 }
11954
11955
11957 {
11959 }
11960
11962 {
11964 }
11965
11967 {
11969 }
11970
11971
11973 {
11974
11975 float weightEx = GetWeightEx();
11976 float special = GetInventoryAndCargoWeight();
11977 return weightEx - special;
11978 }
11979
11980
11982 {
11984 }
11985
11987 {
11989 {
11990 #ifdef DEVELOPER
11991 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11992 {
11993 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11995 }
11996 #endif
11997
11998 return GetQuantity() * GetConfigWeightModified();
11999 }
12000 else if (HasEnergyManager())
12001 {
12002 #ifdef DEVELOPER
12003 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12004 {
12005 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12006 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12007 }
12008 #endif
12009 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12010 }
12011 else
12012 {
12013 #ifdef DEVELOPER
12014 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12015 {
12016 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12017 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12018 }
12019 #endif
12020 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12021 }
12022 }
12023
12026 {
12027 int item_count = 0;
12029
12030 if (GetInventory().GetCargo() != NULL)
12031 {
12032 item_count = GetInventory().GetCargo().GetItemCount();
12033 }
12034
12035 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12036 {
12037 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12038 if (item)
12039 item_count += item.GetNumberOfItems();
12040 }
12041 return item_count;
12042 }
12043
12046 {
12047 float weight = 0;
12048 float wetness = 1;
12049 if (include_wetness)
12052 {
12053 weight = wetness * m_ConfigWeight;
12054 }
12056 {
12057 weight = 1;
12058 }
12059 return weight;
12060 }
12061
12062
12063
12065 {
12066 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12067 {
12068 GameInventory inv = GetInventory();
12069 array<EntityAI> items = new array<EntityAI>;
12071 for (int i = 0; i < items.Count(); i++)
12072 {
12074 if (item)
12075 {
12077 }
12078 }
12079 }
12080 }
12081
12082
12083
12084
12086 {
12087 float energy = 0;
12088 if (HasEnergyManager())
12089 {
12090 energy = GetCompEM().GetEnergy();
12091 }
12092 return energy;
12093 }
12094
12095
12097 {
12098 super.OnEnergyConsumed();
12099
12101 }
12102
12104 {
12105 super.OnEnergyAdded();
12106
12108 }
12109
12110
12112 {
12113 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12114 {
12116 {
12117 float energy_0to1 = GetCompEM().GetEnergy0To1();
12119 }
12120 }
12121 }
12122
12123
12125 {
12126 return ConfigGetFloat("heatIsolation");
12127 }
12128
12130 {
12132 }
12133
12135 {
12136 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12137 if (
GetGame().ConfigIsExisting(paramPath))
12139
12140 return 0.0;
12141 }
12142
12144 {
12145 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12146 if (
GetGame().ConfigIsExisting(paramPath))
12148
12149 return 0.0;
12150 }
12151
12152 override void SetWet(
float value,
bool allow_client =
false)
12153 {
12154 if (!IsServerCheck(allow_client))
12155 return;
12156
12159
12161
12162 m_VarWet = Math.Clamp(value, min, max);
12163
12165 {
12168 }
12169 }
12170
12171 override void AddWet(
float value)
12172 {
12174 }
12175
12177 {
12179 }
12180
12182 {
12184 }
12185
12187 {
12189 }
12190
12192 {
12194 }
12195
12197 {
12199 }
12200
12201 override void OnWetChanged(
float newVal,
float oldVal)
12202 {
12205 if (newLevel != oldLevel)
12206 {
12208 }
12209 }
12210
12212 {
12213 SetWeightDirty();
12214 }
12215
12217 {
12218 return GetWetLevelInternal(
m_VarWet);
12219 }
12220
12221
12222
12224 {
12226 }
12227
12229 {
12231 }
12232
12234 {
12236 }
12237
12239 {
12241 }
12242
12243
12244
12246 {
12247 if (ConfigIsExisting("itemModelLength"))
12248 {
12249 return ConfigGetFloat("itemModelLength");
12250 }
12251 return 0;
12252 }
12253
12255 {
12256 if (ConfigIsExisting("itemAttachOffset"))
12257 {
12258 return ConfigGetFloat("itemAttachOffset");
12259 }
12260 return 0;
12261 }
12262
12263 override void SetCleanness(
int value,
bool allow_client =
false)
12264 {
12265 if (!IsServerCheck(allow_client))
12266 return;
12267
12269
12271
12274 }
12275
12277 {
12279 }
12280
12282 {
12283 return true;
12284 }
12285
12286
12287
12288
12290 {
12292 }
12293
12295 {
12297 }
12298
12299
12300
12301
12302 override void SetColor(
int r,
int g,
int b,
int a)
12303 {
12309 }
12311 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12312 {
12317 }
12318
12320 {
12322 }
12323
12326 {
12327 int r,g,b,a;
12329 r = r/255;
12330 g = g/255;
12331 b = b/255;
12332 a = a/255;
12333 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12334 }
12335
12336
12337
12338 override void SetLiquidType(
int value,
bool allow_client =
false)
12339 {
12340 if (!IsServerCheck(allow_client))
12341 return;
12342
12347 }
12348
12350 {
12351 return ConfigGetInt("varLiquidTypeInit");
12352 }
12353
12355 {
12357 }
12358
12360 {
12362 SetFrozen(false);
12363 }
12364
12367 {
12368 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12369 }
12370
12371
12374 {
12375 PlayerBase nplayer;
12376 if (PlayerBase.CastTo(nplayer, player))
12377 {
12379
12380 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12381 }
12382 }
12383
12384
12387 {
12388 PlayerBase nplayer;
12389 if (PlayerBase.CastTo(nplayer,player))
12390 {
12391
12392 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12393
12394 }
12395
12396
12397 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12398
12399
12400 if (HasEnergyManager())
12401 {
12402 GetCompEM().UpdatePlugState();
12403 }
12404 }
12405
12406
12408 {
12409 super.OnPlacementStarted(player);
12410
12412 }
12413
12414 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12415 {
12417 {
12418 m_AdminLog.OnPlacementComplete(player,
this);
12419 }
12420
12421 super.OnPlacementComplete(player, position, orientation);
12422 }
12423
12424
12425
12426
12427
12429 {
12431 {
12432 return true;
12433 }
12434 else
12435 {
12436 return false;
12437 }
12438 }
12439
12440
12442 {
12444 {
12446 }
12447 }
12448
12449
12451 {
12453 }
12454
12456 {
12458 }
12459
12460 override void InsertAgent(
int agent,
float count = 1)
12461 {
12462 if (count < 1)
12463 return;
12464
12466 }
12467
12470 {
12472 }
12473
12474
12476 {
12478 }
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12522 {
12524 return false;
12525 return true;
12526 }
12527
12529 {
12530
12532 }
12533
12534
12537 {
12538 super.CheckForRoofLimited(timeTresholdMS);
12539
12541 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12542 {
12543 m_PreviousRoofTestTime = time;
12544 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12545 }
12546 }
12547
12548
12550 {
12552 {
12553 return 0;
12554 }
12555
12556 if (GetInventory().GetAttachmentSlotsCount() != 0)
12557 {
12558 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12559 if (filter)
12560 return filter.GetProtectionLevel(type, false, system);
12561 else
12562 return 0;
12563 }
12564
12565 string subclassPath, entryName;
12566
12567 switch (type)
12568 {
12570 entryName = "biological";
12571 break;
12573 entryName = "chemical";
12574 break;
12575 default:
12576 entryName = "biological";
12577 break;
12578 }
12579
12580 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12581
12583 }
12584
12585
12586
12589 {
12590 if (!IsMagazine())
12592
12594 }
12595
12596
12597
12598
12599
12604 {
12605 return true;
12606 }
12607
12609 {
12611 }
12612
12613
12614
12615
12616
12618 {
12619 if (parent)
12620 {
12621 if (parent.IsInherited(DayZInfected))
12622 return true;
12623
12624 if (!parent.IsRuined())
12625 return true;
12626 }
12627
12628 return true;
12629 }
12630
12632 {
12633 if (!super.CanPutAsAttachment(parent))
12634 {
12635 return false;
12636 }
12637
12638 if (!IsRuined() && !parent.IsRuined())
12639 {
12640 return true;
12641 }
12642
12643 return false;
12644 }
12645
12647 {
12648
12649
12650
12651
12652 return super.CanReceiveItemIntoCargo(item);
12653 }
12654
12656 {
12657
12658
12659
12660
12661 GameInventory attachmentInv = attachment.GetInventory();
12663 {
12664 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12665 return false;
12666 }
12667
12668 InventoryLocation loc = new InventoryLocation();
12669 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12670 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12671 return false;
12672
12673 return super.CanReceiveAttachment(attachment, slotId);
12674 }
12675
12677 {
12678 if (!super.CanReleaseAttachment(attachment))
12679 return false;
12680
12681 return GetInventory().AreChildrenAccessible();
12682 }
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12705 {
12706 int id = muzzle_owner.GetMuzzleID();
12707 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12708
12709 if (WPOF_array)
12710 {
12711 for (int i = 0; i < WPOF_array.Count(); i++)
12712 {
12713 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12714
12715 if (WPOF)
12716 {
12717 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12718 }
12719 }
12720 }
12721 }
12722
12723
12725 {
12726 int id = muzzle_owner.GetMuzzleID();
12728
12729 if (WPOBE_array)
12730 {
12731 for (int i = 0; i < WPOBE_array.Count(); i++)
12732 {
12733 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12734
12735 if (WPOBE)
12736 {
12737 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12738 }
12739 }
12740 }
12741 }
12742
12743
12745 {
12746 int id = muzzle_owner.GetMuzzleID();
12747 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12748
12749 if (WPOOH_array)
12750 {
12751 for (int i = 0; i < WPOOH_array.Count(); i++)
12752 {
12753 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12754
12755 if (WPOOH)
12756 {
12757 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12758 }
12759 }
12760 }
12761 }
12762
12763
12765 {
12766 int id = muzzle_owner.GetMuzzleID();
12767 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12768
12769 if (WPOOH_array)
12770 {
12771 for (int i = 0; i < WPOOH_array.Count(); i++)
12772 {
12773 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12774
12775 if (WPOOH)
12776 {
12777 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12778 }
12779 }
12780 }
12781 }
12782
12783
12785 {
12786 int id = muzzle_owner.GetMuzzleID();
12787 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12788
12789 if (WPOOH_array)
12790 {
12791 for (int i = 0; i < WPOOH_array.Count(); i++)
12792 {
12793 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12794
12795 if (WPOOH)
12796 {
12797 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12798 }
12799 }
12800 }
12801 }
12802
12803
12804
12806 {
12808 {
12809 return true;
12810 }
12811
12812 return false;
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 {
12837 return false;
12838 }
12839
12842 {
12843 return UATimeSpent.DEFAULT_DEPLOY;
12844 }
12845
12846
12847
12848
12850 {
12852 SetSynchDirty();
12853 }
12854
12856 {
12858 }
12859
12860
12862 {
12863 return false;
12864 }
12865
12868 {
12869 string att_type = "None";
12870
12871 if (ConfigIsExisting("soundAttType"))
12872 {
12873 att_type = ConfigGetString("soundAttType");
12874 }
12875
12877 }
12878
12880 {
12882 }
12883
12884
12885
12886
12887
12893
12895 {
12898
12900 }
12901
12902
12904 {
12906 return;
12907
12909
12912
12915
12916 SoundParameters params = new SoundParameters();
12920 }
12921
12922
12924 {
12926 return;
12927
12929 SetSynchDirty();
12930
12933 }
12934
12935
12937 {
12939 return;
12940
12942 SetSynchDirty();
12943
12946 }
12947
12949 {
12951 }
12952
12954 {
12956 }
12957
12960 {
12961 if (!
GetGame().IsDedicatedServer())
12962 {
12963 if (ConfigIsExisting("attachSoundSet"))
12964 {
12965 string cfg_path = "";
12966 string soundset = "";
12967 string type_name =
GetType();
12968
12971 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12972 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12973
12974 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12975 {
12976 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12977 {
12978 if (cfg_slot_array[i] == slot_type)
12979 {
12980 soundset = cfg_soundset_array[i];
12981 break;
12982 }
12983 }
12984 }
12985
12986 if (soundset != "")
12987 {
12988 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12990 }
12991 }
12992 }
12993 }
12994
12996 {
12997
12998 }
12999
13000 void OnApply(PlayerBase player);
13001
13003 {
13004 return 1.0;
13005 };
13006
13008 {
13010 }
13011
13013 {
13015 }
13016
13018
13020 {
13021 SetDynamicPhysicsLifeTime(0.01);
13023 }
13024
13026 {
13027 array<string> zone_names = new array<string>;
13028 GetDamageZones(zone_names);
13029 for (int i = 0; i < zone_names.Count(); i++)
13030 {
13031 SetHealthMax(zone_names.Get(i),"Health");
13032 }
13033 SetHealthMax("","Health");
13034 }
13035
13038 {
13039 float global_health = GetHealth01("","Health");
13040 array<string> zones = new array<string>;
13041 GetDamageZones(zones);
13042
13043 for (int i = 0; i < zones.Count(); i++)
13044 {
13045 SetHealth01(zones.Get(i),"Health",global_health);
13046 }
13047 }
13048
13051 {
13052 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13053 }
13054
13056 {
13057 if (!hasRootAsPlayer)
13058 {
13059 if (refParentIB)
13060 {
13061
13062 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13063 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13064
13065 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13066 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13067
13070 }
13071 else
13072 {
13073
13076 }
13077 }
13078 }
13079
13081 {
13083 {
13084 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13085 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13086 {
13087 float heatPermCoef = 1.0;
13089 while (ent)
13090 {
13091 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13092 ent = ent.GetHierarchyParent();
13093 }
13094
13095 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13096 }
13097 }
13098 }
13099
13101 {
13102
13103 EntityAI parent = GetHierarchyParent();
13104 if (!parent)
13105 {
13106 hasParent = false;
13107 hasRootAsPlayer = false;
13108 }
13109 else
13110 {
13111 hasParent = true;
13112 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13113 refParentIB =
ItemBase.Cast(parent);
13114 }
13115 }
13116
13117 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13118 {
13119
13120 }
13121
13123 {
13124
13125 return false;
13126 }
13127
13129 {
13130
13131
13132 return false;
13133 }
13134
13136 {
13137
13138 return false;
13139 }
13140
13143 {
13144 return !GetIsFrozen() &&
IsOpen();
13145 }
13146
13148 {
13149 bool hasParent = false, hasRootAsPlayer = false;
13151
13152 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13153 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13154
13155 if (wwtu || foodDecay)
13156 {
13160
13161 if (processWetness || processTemperature || processDecay)
13162 {
13164
13165 if (processWetness)
13166 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13167
13168 if (processTemperature)
13170
13171 if (processDecay)
13172 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13173 }
13174 }
13175 }
13176
13179 {
13181 }
13182
13184 {
13187
13188 return super.GetTemperatureFreezeThreshold();
13189 }
13190
13192 {
13195
13196 return super.GetTemperatureThawThreshold();
13197 }
13198
13200 {
13203
13204 return super.GetItemOverheatThreshold();
13205 }
13206
13208 {
13210 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13211
13212 return super.GetTemperatureFreezeTime();
13213 }
13214
13216 {
13218 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13219
13220 return super.GetTemperatureThawTime();
13221 }
13222
13227
13229 {
13230 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13231 }
13232
13234 {
13235 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13236 }
13237
13240 {
13242 }
13243
13245 {
13247 }
13248
13250 {
13252 }
13253
13256 {
13257 return null;
13258 }
13259
13262 {
13263 return false;
13264 }
13265
13267 {
13269 {
13272 if (!trg)
13273 {
13275 explosive = this;
13276 }
13277
13278 explosive.PairRemote(trg);
13280
13281 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13282 trg.SetPersistentPairID(persistentID);
13283 explosive.SetPersistentPairID(persistentID);
13284
13285 return true;
13286 }
13287 return false;
13288 }
13289
13292 {
13293 float ret = 1.0;
13296 ret *= GetHealth01();
13297
13298 return ret;
13299 }
13300
13301 #ifdef DEVELOPER
13302 override void SetDebugItem()
13303 {
13304 super.SetDebugItem();
13305 _itemBase = this;
13306 }
13307
13309 {
13310 string text = super.GetDebugText();
13311
13313 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13314
13315 return text;
13316 }
13317 #endif
13318
13320 {
13321 return true;
13322 }
13323
13325
13327
13329 {
13332 }
13333
13334
13342
13358}
13359
13361{
13363 if (entity)
13364 {
13365 bool is_item = entity.IsInherited(
ItemBase);
13366 if (is_item && full_quantity)
13367 {
13370 }
13371 }
13372 else
13373 {
13375 return NULL;
13376 }
13377 return entity;
13378}
13379
13381{
13382 if (item)
13383 {
13384 if (health > 0)
13385 item.SetHealth("", "", health);
13386
13387 if (item.CanHaveTemperature())
13388 {
13390 if (item.CanFreeze())
13391 item.SetFrozen(false);
13392 }
13393
13394 if (item.HasEnergyManager())
13395 {
13396 if (quantity >= 0)
13397 {
13398 item.GetCompEM().SetEnergy0To1(quantity);
13399 }
13400 else
13401 {
13403 }
13404 }
13405 else if (item.IsMagazine())
13406 {
13407 Magazine mag = Magazine.Cast(item);
13408 if (quantity >= 0)
13409 {
13410 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13411 }
13412 else
13413 {
13415 }
13416
13417 }
13418 else
13419 {
13420 if (quantity >= 0)
13421 {
13422 item.SetQuantityNormalized(quantity, false);
13423 }
13424 else
13425 {
13427 }
13428
13429 }
13430 }
13431}
13432
13433#ifdef DEVELOPER
13435#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.