8491{
8493 {
8494 return true;
8495 }
8496};
8497
8498
8499
8501{
8505
8507
8510
8511
8512
8513
8514
8523
8529
8534
8539
8560 protected bool m_IsResultOfSplit
8561
8563
8568
8569
8570
8572
8576
8577
8578
8580
8583
8584
8585
8591
8592
8600
8603
8604
8606
8607
8609
8610
8615
8616
8621
8622
8624
8625
8627 {
8632
8633 if (!
GetGame().IsDedicatedServer())
8634 {
8636 {
8638
8640 {
8642 }
8643 }
8644
8647 }
8648
8649 m_OldLocation = null;
8650
8652 {
8654 }
8655
8656 if (ConfigIsExisting("headSelectionsToHide"))
8657 {
8660 }
8661
8663 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8664 {
8666 }
8667
8669
8670 m_IsResultOfSplit = false;
8671
8673 }
8674
8676 {
8677 super.InitItemVariables();
8678
8684 m_Count = ConfigGetInt(
"count");
8685
8688
8693
8696
8701
8713
8717
8718
8721 if (ConfigIsExisting("canBeSplit"))
8722 {
8725 }
8726
8728 if (ConfigIsExisting("itemBehaviour"))
8730
8731
8734 RegisterNetSyncVariableInt("m_VarLiquidType");
8735 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8736
8737 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8738 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8739 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8740
8741 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8742 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8743 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8744 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8745
8746 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8747 RegisterNetSyncVariableBool("m_IsTakeable");
8748 RegisterNetSyncVariableBool("m_IsHologram");
8749
8752 {
8755 }
8756
8758
8760 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8762
8763 }
8764
8766 {
8768 }
8769
8771 {
8774 {
8779 }
8780 }
8781
8782 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8783 {
8785 {
8788 }
8789
8791 }
8792
8794 {
8800 }
8801
8803
8805 {
8807
8808 if (!action)
8809 {
8810 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8811 return;
8812 }
8813
8815 if (!ai)
8816 {
8818 return;
8819 }
8820
8822 if (!action_array)
8823 {
8824 action_array = new array<ActionBase_Basic>;
8826 }
8827 if (LogManager.IsActionLogEnable())
8828 {
8829 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8830 }
8831
8832 if (action_array.Find(action) != -1)
8833 {
8834 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8835 }
8836 else
8837 {
8838 action_array.Insert(action);
8839 }
8840 }
8841
8843 {
8845 ActionBase action = player.GetActionManager().GetAction(actionName);
8848
8849 if (action_array)
8850 {
8851 action_array.RemoveItem(action);
8852 }
8853 }
8854
8855
8856
8858 {
8859 ActionOverrideData overrideData = new ActionOverrideData();
8863
8865 if (!actionMap)
8866 {
8869 }
8870
8871 actionMap.Insert(this.
Type(), overrideData);
8872
8873 }
8874
8876
8878
8879
8881 {
8884
8887
8888 string config_to_search = "CfgVehicles";
8889 string muzzle_owner_config;
8890
8892 {
8893 if (IsInherited(Weapon))
8894 config_to_search = "CfgWeapons";
8895
8896 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8897
8898 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8899
8901
8902 if (config_OnFire_subclass_count > 0)
8903 {
8904 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8905
8906 for (int i = 0; i < config_OnFire_subclass_count; i++)
8907 {
8908 string particle_class = "";
8910 string config_OnFire_entry = config_OnFire_class + particle_class;
8911 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8912 WPOF_array.Insert(WPOF);
8913 }
8914
8915
8917 }
8918 }
8919
8921 {
8922 config_to_search = "CfgWeapons";
8923 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8924
8925 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8926
8928
8929 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8930 {
8931 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8932
8933 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8934 {
8935 string particle_class2 = "";
8937 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8938 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8939 WPOBE_array.Insert(WPOBE);
8940 }
8941
8942
8944 }
8945 }
8946 }
8947
8948
8950 {
8953
8955 {
8956 string config_to_search = "CfgVehicles";
8957
8958 if (IsInherited(Weapon))
8959 config_to_search = "CfgWeapons";
8960
8961 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8962 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8963
8964 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8965 {
8966
8968
8970 {
8972 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8974 return;
8975 }
8976
8979
8980
8981
8983 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8984
8985 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8986 {
8987 string particle_class = "";
8989 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8991
8992 if (entry_type == CT_CLASS)
8993 {
8994 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8995 WPOOH_array.Insert(WPOF);
8996 }
8997 }
8998
8999
9001 }
9002 }
9003 }
9004
9006 {
9008 }
9009
9011 {
9013 {
9015
9018
9021
9022 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9023 }
9024 }
9025
9027 {
9029 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9030
9032 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9033
9035 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9036
9038 {
9040 }
9041 }
9042
9044 {
9046 }
9047
9049 {
9052 else
9054
9056 {
9059 }
9060 else
9061 {
9064
9067 }
9068
9070 }
9071
9073 {
9075 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9076 }
9077
9079 {
9081 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9083 }
9084
9086 {
9088 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9089 }
9090
9092 {
9095
9096 OverheatingParticle OP = new OverheatingParticle();
9101
9103 }
9104
9106 {
9109
9110 return -1;
9111 }
9112
9114 {
9116 {
9119
9120 for (int i = count; i > 0; --i)
9121 {
9122 int id = i - 1;
9125
9128
9129 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9130 {
9131 if (p)
9132 {
9135 }
9136 }
9137 }
9138 }
9139 }
9140
9142 {
9144 {
9146 {
9147 int id = i - 1;
9149
9150 if (OP)
9151 {
9153
9154 if (p)
9155 {
9157 }
9158
9159 delete OP;
9160 }
9161 }
9162
9165 }
9166 }
9167
9170 {
9171 return 0.0;
9172 }
9173
9174
9176 {
9177 return 250;
9178 }
9179
9181 {
9182 return 0;
9183 }
9184
9187 {
9189 return true;
9190
9191 return false;
9192 }
9193
9196 {
9199
9201 {
9203 }
9204 else
9205 {
9206
9208 }
9209
9211 }
9212
9219 {
9220 return -1;
9221 }
9222
9223
9224
9225
9227 {
9229 {
9231 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9232
9233 if (r_index >= 0)
9234 {
9235 InventoryLocation r_il = new InventoryLocation;
9236 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9237
9238 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9241 {
9242 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9243 }
9245 {
9246 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9247 }
9248
9249 }
9250
9251 player.GetHumanInventory().ClearUserReservedLocation(this);
9252 }
9253
9256 }
9257
9258
9259
9260
9262 {
9263 return ItemBase.m_DebugActionsMask;
9264 }
9265
9267 {
9268 return ItemBase.m_DebugActionsMask & mask;
9269 }
9270
9272 {
9273 ItemBase.m_DebugActionsMask = mask;
9274 }
9275
9277 {
9278 ItemBase.m_DebugActionsMask |= mask;
9279 }
9280
9282 {
9283 ItemBase.m_DebugActionsMask &= ~mask;
9284 }
9285
9287 {
9289 {
9291 }
9292 else
9293 {
9295 }
9296 }
9297
9298
9300 {
9301 if (GetEconomyProfile())
9302 {
9303 float q_max = GetEconomyProfile().GetQuantityMax();
9304 if (q_max > 0)
9305 {
9306 float q_min = GetEconomyProfile().GetQuantityMin();
9307 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9308
9310 {
9311 ComponentEnergyManager comp = GetCompEM();
9313 {
9315 }
9316 }
9318 {
9320
9321 }
9322
9323 }
9324 }
9325 }
9326
9329 {
9330 EntityAI parent = GetHierarchyParent();
9331
9332 if (parent)
9333 {
9334 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9335 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9336 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9337 }
9338 }
9339
9342 {
9343 EntityAI parent = GetHierarchyParent();
9344
9345 if (parent)
9346 {
9347 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9348 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9349 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9350 }
9351 }
9352
9354 {
9355
9356
9357
9358
9360
9362 {
9363 if (ScriptInputUserData.CanStoreInputUserData())
9364 {
9365 ScriptInputUserData ctx = new ScriptInputUserData;
9371 ctx.
Write(use_stack_max);
9374
9376 {
9377 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9378 }
9379 }
9380 }
9381 else if (!
GetGame().IsMultiplayer())
9382 {
9384 }
9385 }
9386
9388 {
9390 }
9391
9393 {
9395 }
9396
9398 {
9400 }
9401
9403 {
9404
9405 return false;
9406 }
9407
9409 {
9410 return false;
9411 }
9412
9416 {
9417 return false;
9418 }
9419
9421 {
9422 return "";
9423 }
9424
9426
9428 {
9429 return false;
9430 }
9431
9433 {
9434 return true;
9435 }
9436
9437
9438
9440 {
9441 return true;
9442 }
9443
9445 {
9446 return true;
9447 }
9448
9450 {
9451 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9453 }
9454
9456 {
9458 }
9459
9461 {
9463 if (!is_being_placed)
9465 SetSynchDirty();
9466 }
9467
9468
9470
9472 {
9474 }
9475
9477 {
9479 }
9480
9482 {
9483 return 1;
9484 }
9485
9487 {
9488 return false;
9489 }
9490
9492 {
9494 SetSynchDirty();
9495 }
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9532 {
9533 super.OnMovedInsideCargo(container);
9534
9535 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9536 }
9537
9538 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9539 {
9540 super.EEItemLocationChanged(oldLoc,newLoc);
9541
9542 PlayerBase new_player = null;
9543 PlayerBase old_player = null;
9544
9545 if (newLoc.GetParent())
9546 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9547
9548 if (oldLoc.GetParent())
9549 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9550
9552 {
9553 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9554
9555 if (r_index >= 0)
9556 {
9557 InventoryLocation r_il = new InventoryLocation;
9558 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9559
9560 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9563 {
9564 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9565 }
9567 {
9568 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9569 }
9570
9571 }
9572 }
9573
9575 {
9576 if (new_player)
9577 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9578
9579 if (new_player == old_player)
9580 {
9581
9582 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9583 {
9585 {
9586 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9587 {
9588 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9589 }
9590 }
9591 else
9592 {
9593 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9594 }
9595 }
9596
9597 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9598 {
9599 int type = oldLoc.GetType();
9601 {
9602 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9603 }
9605 {
9606 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9607 }
9608 }
9609 if (!m_OldLocation)
9610 {
9611 m_OldLocation = new InventoryLocation;
9612 }
9613 m_OldLocation.Copy(oldLoc);
9614 }
9615 else
9616 {
9617 if (m_OldLocation)
9618 {
9619 m_OldLocation.Reset();
9620 }
9621 }
9622
9624 }
9625 else
9626 {
9627 if (new_player)
9628 {
9629 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9630 if (res_index >= 0)
9631 {
9632 InventoryLocation il = new InventoryLocation;
9633 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9635 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9638 {
9639 il.
GetParent().GetOnReleaseLock().Invoke(it);
9640 }
9642 {
9644 }
9645
9646 }
9647 }
9649 {
9650
9652 }
9653
9654 if (m_OldLocation)
9655 {
9656 m_OldLocation.Reset();
9657 }
9658 }
9659 }
9660
9661 override void EOnContact(IEntity other, Contact extra)
9662 {
9664 {
9665 int liquidType = -1;
9667 if (impactSpeed > 0.0)
9668 {
9670 #ifndef SERVER
9672 #else
9674 SetSynchDirty();
9675 #endif
9677 }
9678 }
9679
9680 #ifdef SERVER
9681 if (GetCompEM() && GetCompEM().IsPlugged())
9682 {
9683 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9684 GetCompEM().UnplugThis();
9685 }
9686 #endif
9687 }
9688
9690
9692 {
9694 }
9695
9697 {
9698
9699 }
9700
9702 {
9703 super.OnItemLocationChanged(old_owner, new_owner);
9704
9705 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9706 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9707
9708 if (!relatedPlayer && playerNew)
9709 relatedPlayer = playerNew;
9710
9711 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9712 {
9714 if (actionMgr)
9715 {
9716 ActionBase currentAction = actionMgr.GetRunningAction();
9717 if (currentAction)
9719 }
9720 }
9721
9722 Man ownerPlayerOld = null;
9723 Man ownerPlayerNew = null;
9724
9725 if (old_owner)
9726 {
9727 if (old_owner.
IsMan())
9728 {
9729 ownerPlayerOld = Man.Cast(old_owner);
9730 }
9731 else
9732 {
9733 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9734 }
9735 }
9736 else
9737 {
9739 {
9741
9742 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9743 {
9744 GetCompEM().UnplugThis();
9745 }
9746 }
9747 }
9748
9749 if (new_owner)
9750 {
9751 if (new_owner.
IsMan())
9752 {
9753 ownerPlayerNew = Man.Cast(new_owner);
9754 }
9755 else
9756 {
9757 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9758 }
9759 }
9760
9761 if (ownerPlayerOld != ownerPlayerNew)
9762 {
9763 if (ownerPlayerOld)
9764 {
9765 array<EntityAI> subItemsExit = new array<EntityAI>;
9767 for (int i = 0; i < subItemsExit.Count(); i++)
9768 {
9771 }
9772 }
9773
9774 if (ownerPlayerNew)
9775 {
9776 array<EntityAI> subItemsEnter = new array<EntityAI>;
9778 for (int j = 0; j < subItemsEnter.Count(); j++)
9779 {
9782 }
9783 }
9784 }
9785 else if (ownerPlayerNew != null)
9786 {
9787 PlayerBase nplayer;
9788 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9789 {
9790 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9792 for (int k = 0; k < subItemsUpdate.Count(); k++)
9793 {
9795 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9796 }
9797 }
9798 }
9799
9800 if (old_owner)
9801 old_owner.OnChildItemRemoved(this);
9802 if (new_owner)
9803 new_owner.OnChildItemReceived(this);
9804 }
9805
9806
9808 {
9809 super.EEDelete(parent);
9810 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9811 if (player)
9812 {
9814
9815 if (player.IsAlive())
9816 {
9817 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9818 if (r_index >= 0)
9819 {
9820 InventoryLocation r_il = new InventoryLocation;
9821 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9822
9823 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9826 {
9827 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9828 }
9830 {
9831 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9832 }
9833
9834 }
9835
9836 player.RemoveQuickBarEntityShortcut(this);
9837 }
9838 }
9839 }
9840
9842 {
9843 super.EEKilled(killer);
9844
9847 {
9848 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9849 {
9850 if (IsMagazine())
9851 {
9852 if (Magazine.Cast(this).GetAmmoCount() > 0)
9853 {
9855 }
9856 }
9857 else
9858 {
9860 }
9861 }
9862 }
9863 }
9864
9866 {
9867 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9868
9869 super.OnWasAttached(parent, slot_id);
9870
9873
9875 }
9876
9878 {
9879 super.OnWasDetached(parent, slot_id);
9880
9883 }
9884
9886 {
9887 int idx;
9890
9891 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9892 if (inventory_slots.Count() < 1)
9893 {
9894 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9895 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9896 }
9897 else
9898 {
9899 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9900 }
9901
9902 idx = inventory_slots.Find(slot);
9903 if (idx < 0)
9904 return "";
9905
9906 return attach_types.Get(idx);
9907 }
9908
9910 {
9911 int idx = -1;
9912 string slot;
9913
9916
9917 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9918 if (inventory_slots.Count() < 1)
9919 {
9920 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9921 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9922 }
9923 else
9924 {
9925 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9926 if (detach_types.Count() < 1)
9927 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9928 }
9929
9930 for (int i = 0; i < inventory_slots.Count(); i++)
9931 {
9932 slot = inventory_slots.Get(i);
9933 }
9934
9935 if (slot != "")
9936 {
9937 if (detach_types.Count() == 1)
9938 idx = 0;
9939 else
9940 idx = inventory_slots.Find(slot);
9941 }
9942 if (idx < 0)
9943 return "";
9944
9945 return detach_types.Get(idx);
9946 }
9947
9949 {
9950
9952
9953
9954 float min_time = 1;
9955 float max_time = 3;
9956 float delay = Math.RandomFloat(min_time, max_time);
9957
9958 explode_timer.Run(delay, this, "DoAmmoExplosion");
9959 }
9960
9962 {
9963 Magazine magazine = Magazine.Cast(this);
9964 int pop_sounds_count = 6;
9965 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9966
9967
9968 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9969 string sound_name = pop_sounds[ sound_idx ];
9971
9972
9973 magazine.ServerAddAmmoCount(-1);
9974
9975
9976 float min_temp_to_explode = 100;
9977
9978 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9979 {
9981 }
9982 }
9983
9984
9985 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9986 {
9987 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9988
9989 const int CHANCE_DAMAGE_CARGO = 4;
9990 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9991 const int CHANCE_DAMAGE_NOTHING = 2;
9992
9994 {
9995 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9996 int chances;
9997 int rnd;
9998
9999 if (GetInventory().GetCargo())
10000 {
10001 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10002 rnd = Math.RandomInt(0,chances);
10003
10004 if (rnd < CHANCE_DAMAGE_CARGO)
10005 {
10007 }
10008 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10009 {
10011 }
10012 }
10013 else
10014 {
10015 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10016 rnd = Math.RandomInt(0,chances);
10017
10018 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10019 {
10021 }
10022 }
10023 }
10024 }
10025
10027 {
10028 if (GetInventory().GetCargo())
10029 {
10030 int item_count = GetInventory().GetCargo().GetItemCount();
10031 if (item_count > 0)
10032 {
10033 int random_pick = Math.RandomInt(0, item_count);
10035 if (!item.IsExplosive())
10036 {
10037 item.AddHealth("","",damage);
10038 return true;
10039 }
10040 }
10041 }
10042 return false;
10043 }
10044
10046 {
10047 int attachment_count = GetInventory().AttachmentCount();
10048 if (attachment_count > 0)
10049 {
10050 int random_pick = Math.RandomInt(0, attachment_count);
10051 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10052 if (!attachment.IsExplosive())
10053 {
10054 attachment.AddHealth("","",damage);
10055 return true;
10056 }
10057 }
10058 return false;
10059 }
10060
10062 {
10064 }
10065
10067 {
10069 return GetInventory().CanRemoveEntity();
10070
10071 return false;
10072 }
10073
10075 {
10077 return;
10078
10080 {
10081 if (ScriptInputUserData.CanStoreInputUserData())
10082 {
10083 ScriptInputUserData ctx = new ScriptInputUserData;
10088 ctx.
Write(destination_entity);
10090 ctx.
Write(slot_id);
10092 }
10093 }
10094 else if (!
GetGame().IsMultiplayer())
10095 {
10097 }
10098 }
10099
10101 {
10103 return;
10104
10105 float split_quantity_new;
10109 InventoryLocation loc = new InventoryLocation;
10110
10111 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10112 {
10114 split_quantity_new = stack_max;
10115 else
10117
10118 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10119 if (new_item)
10120 {
10121 new_item.SetResultOfSplit(true);
10122 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10124 new_item.SetQuantity(split_quantity_new);
10125 }
10126 }
10127 else if (destination_entity && slot_id == -1)
10128 {
10129 if (quantity > stack_max)
10130 split_quantity_new = stack_max;
10131 else
10132 split_quantity_new = quantity;
10133
10135 {
10138 }
10139
10140 if (new_item)
10141 {
10142 new_item.SetResultOfSplit(true);
10143 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10145 new_item.SetQuantity(split_quantity_new);
10146 }
10147 }
10148 else
10149 {
10150 if (stack_max != 0)
10151 {
10153 {
10155 }
10156
10157 if (split_quantity_new == 0)
10158 {
10159 if (!
GetGame().IsMultiplayer())
10160 player.PhysicalPredictiveDropItem(this);
10161 else
10162 player.ServerDropEntity(this);
10163 return;
10164 }
10165
10167
10168 if (new_item)
10169 {
10170 new_item.SetResultOfSplit(true);
10171 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10173 new_item.SetQuantity(stack_max);
10174 new_item.PlaceOnSurface();
10175 }
10176 }
10177 }
10178 }
10179
10181 {
10183 return;
10184
10185 float split_quantity_new;
10189 InventoryLocation loc = new InventoryLocation;
10190
10191 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10192 {
10194 split_quantity_new = stack_max;
10195 else
10197
10198 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10199 if (new_item)
10200 {
10201 new_item.SetResultOfSplit(true);
10202 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10204 new_item.SetQuantity(split_quantity_new);
10205 }
10206 }
10207 else if (destination_entity && slot_id == -1)
10208 {
10209 if (quantity > stack_max)
10210 split_quantity_new = stack_max;
10211 else
10212 split_quantity_new = quantity;
10213
10215 {
10218 }
10219
10220 if (new_item)
10221 {
10222 new_item.SetResultOfSplit(true);
10223 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10225 new_item.SetQuantity(split_quantity_new);
10226 }
10227 }
10228 else
10229 {
10230 if (stack_max != 0)
10231 {
10233 {
10235 }
10236
10238
10239 if (new_item)
10240 {
10241 new_item.SetResultOfSplit(true);
10242 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10244 new_item.SetQuantity(stack_max);
10245 new_item.PlaceOnSurface();
10246 }
10247 }
10248 }
10249 }
10250
10252 {
10254 return;
10255
10257 {
10258 if (ScriptInputUserData.CanStoreInputUserData())
10259 {
10260 ScriptInputUserData ctx = new ScriptInputUserData;
10265 dst.WriteToContext(ctx);
10267 }
10268 }
10269 else if (!
GetGame().IsMultiplayer())
10270 {
10272 }
10273 }
10274
10276 {
10278 return;
10279
10281 {
10282 if (ScriptInputUserData.CanStoreInputUserData())
10283 {
10284 ScriptInputUserData ctx = new ScriptInputUserData;
10289 ctx.
Write(destination_entity);
10295 }
10296 }
10297 else if (!
GetGame().IsMultiplayer())
10298 {
10300 }
10301 }
10302
10304 {
10306 }
10307
10309 {
10311 return this;
10312
10314 float split_quantity_new;
10316 if (dst.IsValid())
10317 {
10318 int slot_id = dst.GetSlot();
10320
10321 if (quantity > stack_max)
10322 split_quantity_new = stack_max;
10323 else
10324 split_quantity_new = quantity;
10325
10327
10328 if (new_item)
10329 {
10330 new_item.SetResultOfSplit(true);
10331 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10334 }
10335
10336 return new_item;
10337 }
10338
10339 return null;
10340 }
10341
10343 {
10345 return;
10346
10348 float split_quantity_new;
10350 if (destination_entity)
10351 {
10353 if (quantity > stackable)
10354 split_quantity_new = stackable;
10355 else
10356 split_quantity_new = quantity;
10357
10358 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10359 if (new_item)
10360 {
10361 new_item.SetResultOfSplit(true);
10362 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10364 new_item.SetQuantity(split_quantity_new);
10365 }
10366 }
10367 }
10368
10370 {
10372 return;
10373
10375 {
10376 if (ScriptInputUserData.CanStoreInputUserData())
10377 {
10378 ScriptInputUserData ctx = new ScriptInputUserData;
10383 ItemBase destination_entity =
this;
10384 ctx.
Write(destination_entity);
10388 }
10389 }
10390 else if (!
GetGame().IsMultiplayer())
10391 {
10393 }
10394 }
10395
10397 {
10399 return;
10400
10402 float split_quantity_new;
10404 if (player)
10405 {
10407 if (quantity > stackable)
10408 split_quantity_new = stackable;
10409 else
10410 split_quantity_new = quantity;
10411
10412 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10413 new_item =
ItemBase.Cast(in_hands);
10414 if (new_item)
10415 {
10416 new_item.SetResultOfSplit(true);
10417 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10419 new_item.SetQuantity(split_quantity_new);
10420 }
10421 }
10422 }
10423
10425 {
10427 return;
10428
10430 float split_quantity_new = Math.Floor(quantity * 0.5);
10431
10433
10434 if (new_item)
10435 {
10436 if (new_item.GetQuantityMax() < split_quantity_new)
10437 {
10438 split_quantity_new = new_item.GetQuantityMax();
10439 }
10440
10441 new_item.SetResultOfSplit(true);
10442 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10443
10445 {
10448 }
10449 else
10450 {
10453 }
10454 }
10455 }
10456
10458 {
10460 return;
10461
10463 float split_quantity_new = Math.Floor(quantity / 2);
10464
10465 InventoryLocation invloc = new InventoryLocation;
10467
10469 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10470
10471 if (new_item)
10472 {
10473 if (new_item.GetQuantityMax() < split_quantity_new)
10474 {
10475 split_quantity_new = new_item.GetQuantityMax();
10476 }
10478 {
10481 }
10482 else
10483 {
10486 }
10487 }
10488 }
10489
10492 {
10493 SetWeightDirty();
10495
10496 if (parent)
10497 parent.OnAttachmentQuantityChangedEx(this, delta);
10498
10500 {
10502 {
10504 }
10506 {
10507 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10509 }
10510 }
10511
10512 }
10513
10516 {
10517
10518 }
10519
10522 {
10524 }
10525
10527 {
10528 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10529
10531 {
10532 if (newLevel == GameConstants.STATE_RUINED)
10533 {
10535 EntityAI parent = GetHierarchyParent();
10536 if (parent && parent.IsFireplace())
10537 {
10538 CargoBase cargo = GetInventory().GetCargo();
10539 if (cargo)
10540 {
10542 {
10544 }
10545 }
10546 }
10547 }
10548
10550 {
10551
10553 return;
10554 }
10555
10556 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10557 {
10559 }
10560 }
10561 }
10562
10563
10565 {
10566 super.OnRightClick();
10567
10569 {
10571 {
10572 if (ScriptInputUserData.CanStoreInputUserData())
10573 {
10574 vector m4[4];
10576
10577 EntityAI root = GetHierarchyRoot();
10578
10579 InventoryLocation dst = new InventoryLocation;
10581 {
10582 if (root)
10583 {
10584 root.GetTransform(m4);
10586 }
10587 else
10588 GetInventory().GetCurrentInventoryLocation(dst);
10589 }
10590 else
10591 {
10593
10594
10595 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10596 {
10597 if (root)
10598 {
10599 root.GetTransform(m4);
10601 }
10602 else
10603 GetInventory().GetCurrentInventoryLocation(dst);
10604 }
10605 else
10606 {
10607 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10608 }
10609 }
10610
10611 ScriptInputUserData ctx = new ScriptInputUserData;
10619 }
10620 }
10621 else if (!
GetGame().IsMultiplayer())
10622 {
10624 }
10625 }
10626 }
10627
10628 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10629 {
10630
10631 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10632 return false;
10633
10634 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10635 return false;
10636
10637
10639 return false;
10640
10641
10642 Magazine mag = Magazine.Cast(this);
10643 if (mag)
10644 {
10645 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10646 return false;
10647
10648 if (stack_max_limit)
10649 {
10650 Magazine other_mag = Magazine.Cast(other_item);
10651 if (other_item)
10652 {
10653 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10654 return false;
10655 }
10656
10657 }
10658 }
10659 else
10660 {
10661
10663 return false;
10664
10666 return false;
10667 }
10668
10669 PlayerBase player = null;
10670 if (CastTo(player, GetHierarchyRootPlayer()))
10671 {
10672 if (player.GetInventory().HasAttachment(this))
10673 return false;
10674
10675 if (player.IsItemsToDelete())
10676 return false;
10677 }
10678
10679 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10680 return false;
10681
10682 int slotID;
10684 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10685 return false;
10686
10687 return true;
10688 }
10689
10691 {
10693 }
10694
10696 {
10697 return m_IsResultOfSplit;
10698 }
10699
10701 {
10702 m_IsResultOfSplit = value;
10703 }
10704
10706 {
10708 }
10709
10711 {
10712 float other_item_quantity = other_item.GetQuantity();
10713 float this_free_space;
10714
10716
10718
10719 if (other_item_quantity > this_free_space)
10720 {
10721 return this_free_space;
10722 }
10723 else
10724 {
10725 return other_item_quantity;
10726 }
10727 }
10728
10730 {
10732 }
10733
10735 {
10737 return;
10738
10739 if (!IsMagazine() && other_item)
10740 {
10742 if (quantity_used != 0)
10743 {
10744 float hp1 = GetHealth01("","");
10745 float hp2 = other_item.GetHealth01("","");
10746 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10747 hpResult = hpResult / (
GetQuantity() + quantity_used);
10748
10749 hpResult *= GetMaxHealth();
10750 Math.Round(hpResult);
10751 SetHealth("", "Health", hpResult);
10752
10754 other_item.AddQuantity(-quantity_used);
10755 }
10756 }
10758 }
10759
10761 {
10762 #ifdef SERVER
10763 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10764 GetHierarchyParent().IncreaseLifetimeUp();
10765 #endif
10766 };
10767
10769 {
10770 PlayerBase p = PlayerBase.Cast(player);
10771
10772 array<int> recipesIds = p.m_Recipes;
10773 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10774 if (moduleRecipesManager)
10775 {
10776 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10777 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10778 }
10779
10780 for (int i = 0;i < recipesIds.Count(); i++)
10781 {
10782 int key = recipesIds.Get(i);
10783 string recipeName = moduleRecipesManager.GetRecipeName(key);
10785 }
10786 }
10787
10788
10789 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10790 {
10791 super.GetDebugActions(outputList);
10792
10793
10798
10799
10803
10807
10808
10811
10812
10814 {
10817 }
10818
10820
10823
10827 }
10828
10829
10830
10831
10833 {
10834 super.OnAction(action_id, player, ctx);
10835 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10836 {
10837 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10838 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10839 PlayerBase p = PlayerBase.Cast(player);
10840 if (
EActions.RECIPES_RANGE_START < 1000)
10841 {
10842 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10843 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10844 }
10845 }
10846 #ifndef SERVER
10847 else if (action_id ==
EActions.WATCH_PLAYER)
10848 {
10849 PluginDeveloper.SetDeveloperItemClientEx(player);
10850 }
10851 #endif
10853 {
10854 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10855 {
10856 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10857 OnDebugButtonPressServer(id + 1);
10858 }
10859
10860 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10861 {
10862 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10864 }
10865
10866 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10867 {
10868 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10870 }
10871
10872 else if (action_id ==
EActions.ADD_QUANTITY)
10873 {
10874 if (IsMagazine())
10875 {
10876 Magazine mag = Magazine.Cast(this);
10877 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10878 }
10879 else
10880 {
10882 }
10883
10884 if (m_EM)
10885 {
10886 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10887 }
10888
10889 }
10890
10891 else if (action_id ==
EActions.REMOVE_QUANTITY)
10892 {
10893 if (IsMagazine())
10894 {
10895 Magazine mag2 = Magazine.Cast(this);
10896 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10897 }
10898 else
10899 {
10901 }
10902 if (m_EM)
10903 {
10904 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10905 }
10906
10907 }
10908
10909 else if (action_id ==
EActions.SET_QUANTITY_0)
10910 {
10912
10913 if (m_EM)
10914 {
10915 m_EM.SetEnergy(0);
10916 }
10917 }
10918
10919 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10920 {
10922
10923 if (m_EM)
10924 {
10925 m_EM.SetEnergy(m_EM.GetEnergyMax());
10926 }
10927 }
10928
10929 else if (action_id ==
EActions.ADD_HEALTH)
10930 {
10931 AddHealth("","",GetMaxHealth("","Health")/5);
10932 }
10933 else if (action_id ==
EActions.REMOVE_HEALTH)
10934 {
10935 AddHealth("","",-GetMaxHealth("","Health")/5);
10936 }
10937 else if (action_id ==
EActions.DESTROY_HEALTH)
10938 {
10939 SetHealth01("","",0);
10940 }
10941 else if (action_id ==
EActions.WATCH_ITEM)
10942 {
10944 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10945 #ifdef DEVELOPER
10946 SetDebugDeveloper_item(this);
10947 #endif
10948 }
10949
10950 else if (action_id ==
EActions.ADD_TEMPERATURE)
10951 {
10952 AddTemperature(20);
10953
10954 }
10955
10956 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10957 {
10958 AddTemperature(-20);
10959
10960 }
10961
10962 else if (action_id ==
EActions.FLIP_FROZEN)
10963 {
10964 SetFrozen(!GetIsFrozen());
10965
10966 }
10967
10968 else if (action_id ==
EActions.ADD_WETNESS)
10969 {
10971
10972 }
10973
10974 else if (action_id ==
EActions.REMOVE_WETNESS)
10975 {
10977
10978 }
10979
10980 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10981 {
10984
10985
10986 }
10987
10988 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10989 {
10992 }
10993
10994 else if (action_id ==
EActions.MAKE_SPECIAL)
10995 {
10996 auto debugParams = DebugSpawnParams.WithPlayer(player);
10997 OnDebugSpawnEx(debugParams);
10998 }
10999
11000 else if (action_id ==
EActions.DELETE)
11001 {
11002 Delete();
11003 }
11004
11005 }
11006
11007
11008 return false;
11009 }
11010
11011
11012
11013
11017
11020
11021
11022
11024 {
11025 return false;
11026 }
11027
11028
11030 {
11031 return true;
11032 }
11033
11034
11036 {
11037 return true;
11038 }
11039
11040
11041
11043 {
11044 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11046 }
11047
11050 {
11051 return null;
11052 }
11053
11055 {
11056 return false;
11057 }
11058
11060 {
11061 return false;
11062 }
11063
11067
11068
11070 {
11071 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11072 return module_repairing.CanRepair(this, item_repair_kit);
11073 }
11074
11075
11076 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11077 {
11078 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11079 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11080 }
11081
11082
11084 {
11085
11086
11087
11088
11089
11090
11091
11092
11093 return 1;
11094 }
11095
11096
11097
11099 {
11101 }
11102
11103
11104
11106 {
11108 }
11109
11110
11119 {
11120 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11121
11122 if (player)
11123 {
11124 player.MessageStatus(text);
11125 }
11126 }
11127
11128
11137 {
11138 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11139
11140 if (player)
11141 {
11142 player.MessageAction(text);
11143 }
11144 }
11145
11146
11155 {
11156 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11157
11158 if (player)
11159 {
11160 player.MessageFriendly(text);
11161 }
11162 }
11163
11164
11173 {
11174 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11175
11176 if (player)
11177 {
11178 player.MessageImportant(text);
11179 }
11180 }
11181
11183 {
11184 return true;
11185 }
11186
11187
11188 override bool KindOf(
string tag)
11189 {
11190 bool found = false;
11191 string item_name = this.
GetType();
11194
11195 int array_size = item_tag_array.Count();
11196 for (int i = 0; i < array_size; i++)
11197 {
11198 if (item_tag_array.Get(i) == tag)
11199 {
11200 found = true;
11201 break;
11202 }
11203 }
11204 return found;
11205 }
11206
11207
11209 {
11210
11211 super.OnRPC(sender, rpc_type,ctx);
11212
11213
11214 switch (rpc_type)
11215 {
11216 #ifndef SERVER
11217 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11218 Param2<bool, string> p = new Param2<bool, string>(false, "");
11219
11221 return;
11222
11223 bool play = p.param1;
11224 string soundSet = p.param2;
11225
11226 if (play)
11227 {
11229 {
11231 {
11233 }
11234 }
11235 else
11236 {
11238 }
11239 }
11240 else
11241 {
11243 }
11244
11245 break;
11246 #endif
11247
11248 }
11249
11251 {
11253 }
11254 }
11255
11256
11257
11258
11260 {
11261 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11262 return plugin.GetID(
name);
11263 }
11264
11266 {
11267 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11268 return plugin.GetName(id);
11269 }
11270
11273 {
11274
11275
11276 int varFlags;
11277 if (!ctx.
Read(varFlags))
11278 return;
11279
11280 if (varFlags & ItemVariableFlags.FLOAT)
11281 {
11283 }
11284 }
11285
11287 {
11288
11289 super.SerializeNumericalVars(floats_out);
11290
11291
11292
11294 {
11296 }
11297
11299 {
11301 }
11302
11304 {
11306 }
11307
11309 {
11314 }
11315
11317 {
11319 }
11320 }
11321
11323 {
11324
11325 super.DeSerializeNumericalVars(floats);
11326
11327
11328 int index = 0;
11329 int mask = Math.Round(floats.Get(index));
11330
11331 index++;
11332
11334 {
11336 {
11338 }
11339 else
11340 {
11341 float quantity = floats.Get(index);
11342 SetQuantity(quantity,
true,
false,
false,
false);
11343 }
11344 index++;
11345 }
11346
11348 {
11349 float wet = floats.Get(index);
11351 index++;
11352 }
11353
11355 {
11356 int liquidtype = Math.Round(floats.Get(index));
11358 index++;
11359 }
11360
11362 {
11364 index++;
11366 index++;
11368 index++;
11370 index++;
11371 }
11372
11374 {
11375 int cleanness = Math.Round(floats.Get(index));
11377 index++;
11378 }
11379 }
11380
11382 {
11383 super.WriteVarsToCTX(ctx);
11384
11385
11387 {
11389 }
11390
11392 {
11394 }
11395
11397 {
11399 }
11400
11402 {
11403 int r,g,b,a;
11409 }
11410
11412 {
11414 }
11415 }
11416
11418 {
11419 if (!super.ReadVarsFromCTX(ctx,version))
11420 return false;
11421
11422 int intValue;
11423 float value;
11424
11425 if (version < 140)
11426 {
11427 if (!ctx.
Read(intValue))
11428 return false;
11429
11430 m_VariablesMask = intValue;
11431 }
11432
11434 {
11435 if (!ctx.
Read(value))
11436 return false;
11437
11439 {
11441 }
11442 else
11443 {
11445 }
11446 }
11447
11448 if (version < 140)
11449 {
11451 {
11452 if (!ctx.
Read(value))
11453 return false;
11454 SetTemperatureDirect(value);
11455 }
11456 }
11457
11459 {
11460 if (!ctx.
Read(value))
11461 return false;
11463 }
11464
11466 {
11467 if (!ctx.
Read(intValue))
11468 return false;
11470 }
11471
11473 {
11474 int r,g,b,a;
11476 return false;
11478 return false;
11480 return false;
11482 return false;
11483
11485 }
11486
11488 {
11489 if (!ctx.
Read(intValue))
11490 return false;
11492 }
11493
11494 if (version >= 138 && version < 140)
11495 {
11497 {
11498 if (!ctx.
Read(intValue))
11499 return false;
11500 SetFrozen(intValue);
11501 }
11502 }
11503
11504 return true;
11505 }
11506
11507
11509 {
11512 {
11514 }
11515
11516 if (!super.OnStoreLoad(ctx, version))
11517 {
11519 return false;
11520 }
11521
11522 if (version >= 114)
11523 {
11524 bool hasQuickBarIndexSaved;
11525
11526 if (!ctx.
Read(hasQuickBarIndexSaved))
11527 {
11529 return false;
11530 }
11531
11532 if (hasQuickBarIndexSaved)
11533 {
11534 int itmQBIndex;
11535
11536
11537 if (!ctx.
Read(itmQBIndex))
11538 {
11540 return false;
11541 }
11542
11543 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11544 if (itmQBIndex != -1 && parentPlayer)
11545 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11546 }
11547 }
11548 else
11549 {
11550
11551 PlayerBase player;
11552 int itemQBIndex;
11553 if (version ==
int.
MAX)
11554 {
11555 if (!ctx.
Read(itemQBIndex))
11556 {
11558 return false;
11559 }
11560 }
11561 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11562 {
11563
11564 if (!ctx.
Read(itemQBIndex))
11565 {
11567 return false;
11568 }
11569 if (itemQBIndex != -1 && player)
11570 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11571 }
11572 }
11573
11574 if (version < 140)
11575 {
11576
11577 if (!LoadVariables(ctx, version))
11578 {
11580 return false;
11581 }
11582 }
11583
11584
11586 {
11588 return false;
11589 }
11590 if (version >= 132)
11591 {
11593 if (raib)
11594 {
11596 {
11598 return false;
11599 }
11600 }
11601 }
11602
11604 return true;
11605 }
11606
11607
11608
11610 {
11611 super.OnStoreSave(ctx);
11612
11613 PlayerBase player;
11614 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11615 {
11617
11618 int itemQBIndex = -1;
11619 itemQBIndex = player.FindQuickBarEntityIndex(this);
11620 ctx.
Write(itemQBIndex);
11621 }
11622 else
11623 {
11625 }
11626
11628
11630 if (raib)
11631 {
11633 }
11634 }
11635
11636
11638 {
11639 super.AfterStoreLoad();
11640
11642 {
11644 }
11645
11647 {
11650 }
11651 }
11652
11654 {
11655 super.EEOnAfterLoad();
11656
11658 {
11660 }
11661
11664 }
11665
11667 {
11668 return false;
11669 }
11670
11671
11672
11674 {
11676 {
11677 #ifdef PLATFORM_CONSOLE
11678
11680 {
11682 if (menu)
11683 {
11685 }
11686 }
11687 #endif
11688 }
11689
11691 {
11694 }
11695
11697 {
11698 SetWeightDirty();
11700 }
11702 {
11705 }
11706
11708 {
11711 }
11713 {
11716 }
11717
11718 super.OnVariablesSynchronized();
11719 }
11720
11721
11722
11724 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11725 {
11726 if (!IsServerCheck(allow_client))
11727 return false;
11728
11730 return false;
11731
11734
11735 if (value <= (min + 0.001))
11736 value = min;
11737
11738 if (value == min)
11739 {
11740 if (destroy_config)
11741 {
11742 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11743 if (dstr)
11744 {
11746 this.Delete();
11747 return true;
11748 }
11749 }
11750 else if (destroy_forced)
11751 {
11753 this.Delete();
11754 return true;
11755 }
11756
11758 }
11759
11762
11764 {
11766
11767 if (delta)
11769 }
11770
11772
11773 return false;
11774 }
11775
11776
11778 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11779 {
11781 }
11782
11784 {
11787 }
11788
11790 {
11793 }
11794
11797 {
11798 float value_clamped = Math.Clamp(value, 0, 1);
11800 SetQuantity(result, destroy_config, destroy_forced);
11801 }
11802
11803
11806 {
11808 }
11809
11811 {
11813 }
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11825 {
11826 int slot = -1;
11827 if (GetInventory())
11828 {
11829 InventoryLocation il = new InventoryLocation;
11830 GetInventory().GetCurrentInventoryLocation(il);
11832 }
11833
11835 }
11836
11838 {
11839 float quantity_max = 0;
11840
11842 {
11843 if (attSlotID != -1)
11844 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11845
11846 if (quantity_max <= 0)
11848 }
11849
11850 if (quantity_max <= 0)
11852
11853 return quantity_max;
11854 }
11855
11857 {
11859 }
11860
11862 {
11864 }
11865
11866
11868 {
11870 }
11871
11873 {
11875 }
11876
11878 {
11880 }
11881
11882
11884 {
11885
11886 float weightEx = GetWeightEx();
11887 float special = GetInventoryAndCargoWeight();
11888 return weightEx - special;
11889 }
11890
11891
11893 {
11895 }
11896
11898 {
11900 {
11901 #ifdef DEVELOPER
11902 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11903 {
11904 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11906 }
11907 #endif
11908
11909 return GetQuantity() * GetConfigWeightModified();
11910 }
11911 else if (HasEnergyManager())
11912 {
11913 #ifdef DEVELOPER
11914 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11915 {
11916 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11917 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11918 }
11919 #endif
11920 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11921 }
11922 else
11923 {
11924 #ifdef DEVELOPER
11925 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11926 {
11927 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11928 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11929 }
11930 #endif
11931 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11932 }
11933 }
11934
11937 {
11938 int item_count = 0;
11940
11941 if (GetInventory().GetCargo() != NULL)
11942 {
11943 item_count = GetInventory().GetCargo().GetItemCount();
11944 }
11945
11946 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11947 {
11948 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11949 if (item)
11950 item_count += item.GetNumberOfItems();
11951 }
11952 return item_count;
11953 }
11954
11957 {
11958 float weight = 0;
11959 float wetness = 1;
11960 if (include_wetness)
11963 {
11964 weight = wetness * m_ConfigWeight;
11965 }
11967 {
11968 weight = 1;
11969 }
11970 return weight;
11971 }
11972
11973
11974
11976 {
11977 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11978 {
11979 GameInventory inv = GetInventory();
11980 array<EntityAI> items = new array<EntityAI>;
11982 for (int i = 0; i < items.Count(); i++)
11983 {
11985 if (item)
11986 {
11988 }
11989 }
11990 }
11991 }
11992
11993
11994
11995
11997 {
11998 float energy = 0;
11999 if (HasEnergyManager())
12000 {
12001 energy = GetCompEM().GetEnergy();
12002 }
12003 return energy;
12004 }
12005
12006
12008 {
12009 super.OnEnergyConsumed();
12010
12012 }
12013
12015 {
12016 super.OnEnergyAdded();
12017
12019 }
12020
12021
12023 {
12024 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12025 {
12027 {
12028 float energy_0to1 = GetCompEM().GetEnergy0To1();
12030 }
12031 }
12032 }
12033
12034
12036 {
12037 return ConfigGetFloat("heatIsolation");
12038 }
12039
12041 {
12043 }
12044
12046 {
12047 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12048 if (
GetGame().ConfigIsExisting(paramPath))
12050
12051 return 0.0;
12052 }
12053
12055 {
12056 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12057 if (
GetGame().ConfigIsExisting(paramPath))
12059
12060 return 0.0;
12061 }
12062
12063 override void SetWet(
float value,
bool allow_client =
false)
12064 {
12065 if (!IsServerCheck(allow_client))
12066 return;
12067
12070
12072
12073 m_VarWet = Math.Clamp(value, min, max);
12074
12076 {
12079 }
12080 }
12081
12082 override void AddWet(
float value)
12083 {
12085 }
12086
12088 {
12090 }
12091
12093 {
12095 }
12096
12098 {
12100 }
12101
12103 {
12105 }
12106
12108 {
12110 }
12111
12112 override void OnWetChanged(
float newVal,
float oldVal)
12113 {
12116 if (newLevel != oldLevel)
12117 {
12119 }
12120 }
12121
12123 {
12124 SetWeightDirty();
12125 }
12126
12128 {
12129 return GetWetLevelInternal(
m_VarWet);
12130 }
12131
12132
12133
12135 {
12137 }
12138
12140 {
12142 }
12143
12145 {
12147 }
12148
12150 {
12152 }
12153
12154
12155
12157 {
12158 if (ConfigIsExisting("itemModelLength"))
12159 {
12160 return ConfigGetFloat("itemModelLength");
12161 }
12162 return 0;
12163 }
12164
12166 {
12167 if (ConfigIsExisting("itemAttachOffset"))
12168 {
12169 return ConfigGetFloat("itemAttachOffset");
12170 }
12171 return 0;
12172 }
12173
12174 override void SetCleanness(
int value,
bool allow_client =
false)
12175 {
12176 if (!IsServerCheck(allow_client))
12177 return;
12178
12180
12182
12185 }
12186
12188 {
12190 }
12191
12193 {
12194 return true;
12195 }
12196
12197
12198
12199
12201 {
12203 }
12204
12206 {
12208 }
12209
12210
12211
12212
12213 override void SetColor(
int r,
int g,
int b,
int a)
12214 {
12220 }
12222 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12223 {
12228 }
12229
12231 {
12233 }
12234
12237 {
12238 int r,g,b,a;
12240 r = r/255;
12241 g = g/255;
12242 b = b/255;
12243 a = a/255;
12244 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12245 }
12246
12247
12248
12249 override void SetLiquidType(
int value,
bool allow_client =
false)
12250 {
12251 if (!IsServerCheck(allow_client))
12252 return;
12253
12258 }
12259
12261 {
12262 return ConfigGetInt("varLiquidTypeInit");
12263 }
12264
12266 {
12268 }
12269
12271 {
12273 SetFrozen(false);
12274 }
12275
12278 {
12279 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12280 }
12281
12282
12285 {
12286 PlayerBase nplayer;
12287 if (PlayerBase.CastTo(nplayer, player))
12288 {
12290
12291 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12292 }
12293 }
12294
12295
12298 {
12299 PlayerBase nplayer;
12300 if (PlayerBase.CastTo(nplayer,player))
12301 {
12302
12303 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12304
12305 }
12306
12307
12308 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12309
12310
12311 if (HasEnergyManager())
12312 {
12313 GetCompEM().UpdatePlugState();
12314 }
12315 }
12316
12317
12319 {
12320 super.OnPlacementStarted(player);
12321
12323 }
12324
12325 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12326 {
12328 {
12329 m_AdminLog.OnPlacementComplete(player,
this);
12330 }
12331
12332 super.OnPlacementComplete(player, position, orientation);
12333 }
12334
12335
12336
12337
12338
12340 {
12342 {
12343 return true;
12344 }
12345 else
12346 {
12347 return false;
12348 }
12349 }
12350
12351
12353 {
12355 {
12357 }
12358 }
12359
12360
12362 {
12364 }
12365
12367 {
12369 }
12370
12371 override void InsertAgent(
int agent,
float count = 1)
12372 {
12373 if (count < 1)
12374 return;
12375
12377 }
12378
12381 {
12383 }
12384
12385
12387 {
12389 }
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12433 {
12435 return false;
12436 return true;
12437 }
12438
12440 {
12441
12443 }
12444
12445
12448 {
12449 super.CheckForRoofLimited(timeTresholdMS);
12450
12452 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12453 {
12454 m_PreviousRoofTestTime = time;
12455 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12456 }
12457 }
12458
12459
12461 {
12463 {
12464 return 0;
12465 }
12466
12467 if (GetInventory().GetAttachmentSlotsCount() != 0)
12468 {
12469 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12470 if (filter)
12471 return filter.GetProtectionLevel(type, false, system);
12472 else
12473 return 0;
12474 }
12475
12476 string subclassPath, entryName;
12477
12478 switch (type)
12479 {
12481 entryName = "biological";
12482 break;
12484 entryName = "chemical";
12485 break;
12486 default:
12487 entryName = "biological";
12488 break;
12489 }
12490
12491 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12492
12494 }
12495
12496
12497
12500 {
12501 if (!IsMagazine())
12503
12505 }
12506
12507
12508
12509
12510
12515 {
12516 return true;
12517 }
12518
12520 {
12522 }
12523
12524
12525
12526
12527
12529 {
12530 if (parent)
12531 {
12532 if (parent.IsInherited(DayZInfected))
12533 return true;
12534
12535 if (!parent.IsRuined())
12536 return true;
12537 }
12538
12539 return true;
12540 }
12541
12543 {
12544 if (!super.CanPutAsAttachment(parent))
12545 {
12546 return false;
12547 }
12548
12549 if (!IsRuined() && !parent.IsRuined())
12550 {
12551 return true;
12552 }
12553
12554 return false;
12555 }
12556
12558 {
12559
12560
12561
12562
12563 return super.CanReceiveItemIntoCargo(item);
12564 }
12565
12567 {
12568
12569
12570
12571
12572 GameInventory attachmentInv = attachment.GetInventory();
12574 {
12575 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12576 return false;
12577 }
12578
12579 InventoryLocation loc = new InventoryLocation();
12580 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12581 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12582 return false;
12583
12584 return super.CanReceiveAttachment(attachment, slotId);
12585 }
12586
12588 {
12589 if (!super.CanReleaseAttachment(attachment))
12590 return false;
12591
12592 return GetInventory().AreChildrenAccessible();
12593 }
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12616 {
12617 int id = muzzle_owner.GetMuzzleID();
12618 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12619
12620 if (WPOF_array)
12621 {
12622 for (int i = 0; i < WPOF_array.Count(); i++)
12623 {
12624 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12625
12626 if (WPOF)
12627 {
12628 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12629 }
12630 }
12631 }
12632 }
12633
12634
12636 {
12637 int id = muzzle_owner.GetMuzzleID();
12639
12640 if (WPOBE_array)
12641 {
12642 for (int i = 0; i < WPOBE_array.Count(); i++)
12643 {
12644 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12645
12646 if (WPOBE)
12647 {
12648 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12649 }
12650 }
12651 }
12652 }
12653
12654
12656 {
12657 int id = muzzle_owner.GetMuzzleID();
12658 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12659
12660 if (WPOOH_array)
12661 {
12662 for (int i = 0; i < WPOOH_array.Count(); i++)
12663 {
12664 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12665
12666 if (WPOOH)
12667 {
12668 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12669 }
12670 }
12671 }
12672 }
12673
12674
12676 {
12677 int id = muzzle_owner.GetMuzzleID();
12678 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12679
12680 if (WPOOH_array)
12681 {
12682 for (int i = 0; i < WPOOH_array.Count(); i++)
12683 {
12684 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12685
12686 if (WPOOH)
12687 {
12688 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12689 }
12690 }
12691 }
12692 }
12693
12694
12696 {
12697 int id = muzzle_owner.GetMuzzleID();
12698 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12699
12700 if (WPOOH_array)
12701 {
12702 for (int i = 0; i < WPOOH_array.Count(); i++)
12703 {
12704 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12705
12706 if (WPOOH)
12707 {
12708 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12709 }
12710 }
12711 }
12712 }
12713
12714
12715
12717 {
12719 {
12720 return true;
12721 }
12722
12723 return false;
12724 }
12725
12727 {
12729 {
12730 return true;
12731 }
12732
12733 return false;
12734 }
12735
12737 {
12739 {
12740 return true;
12741 }
12742
12743 return false;
12744 }
12745
12747 {
12748 return false;
12749 }
12750
12753 {
12754 return UATimeSpent.DEFAULT_DEPLOY;
12755 }
12756
12757
12758
12759
12761 {
12763 SetSynchDirty();
12764 }
12765
12767 {
12769 }
12770
12771
12773 {
12774 return false;
12775 }
12776
12779 {
12780 string att_type = "None";
12781
12782 if (ConfigIsExisting("soundAttType"))
12783 {
12784 att_type = ConfigGetString("soundAttType");
12785 }
12786
12788 }
12789
12791 {
12793 }
12794
12795
12796
12797
12798
12802
12804 {
12807
12809 }
12810
12811
12813 {
12815 return;
12816
12818
12821
12824
12825 SoundParameters params = new SoundParameters();
12829 }
12830
12831
12833 {
12835 return;
12836
12838 SetSynchDirty();
12839
12842 }
12843
12844
12846 {
12848 return;
12849
12851 SetSynchDirty();
12852
12855 }
12856
12858 {
12860 }
12861
12863 {
12865 }
12866
12869 {
12870 if (!
GetGame().IsDedicatedServer())
12871 {
12872 if (ConfigIsExisting("attachSoundSet"))
12873 {
12874 string cfg_path = "";
12875 string soundset = "";
12876 string type_name =
GetType();
12877
12880 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12881 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12882
12883 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12884 {
12885 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12886 {
12887 if (cfg_slot_array[i] == slot_type)
12888 {
12889 soundset = cfg_soundset_array[i];
12890 break;
12891 }
12892 }
12893 }
12894
12895 if (soundset != "")
12896 {
12897 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12899 }
12900 }
12901 }
12902 }
12903
12905 {
12906
12907 }
12908
12909 void OnApply(PlayerBase player);
12910
12912 {
12913 return 1.0;
12914 };
12915
12917 {
12919 }
12920
12922 {
12924 }
12925
12927
12929 {
12930 SetDynamicPhysicsLifeTime(0.01);
12932 }
12933
12935 {
12936 array<string> zone_names = new array<string>;
12937 GetDamageZones(zone_names);
12938 for (int i = 0; i < zone_names.Count(); i++)
12939 {
12940 SetHealthMax(zone_names.Get(i),"Health");
12941 }
12942 SetHealthMax("","Health");
12943 }
12944
12947 {
12948 float global_health = GetHealth01("","Health");
12949 array<string> zones = new array<string>;
12950 GetDamageZones(zones);
12951
12952 for (int i = 0; i < zones.Count(); i++)
12953 {
12954 SetHealth01(zones.Get(i),"Health",global_health);
12955 }
12956 }
12957
12960 {
12961 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12962 }
12963
12965 {
12966 if (!hasRootAsPlayer)
12967 {
12968 if (refParentIB)
12969 {
12970
12971 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12972 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12973
12974 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12975 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12976
12979 }
12980 else
12981 {
12982
12985 }
12986 }
12987 }
12988
12990 {
12992 {
12993 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12994 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12995 {
12996 float heatPermCoef = 1.0;
12998 while (ent)
12999 {
13000 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13001 ent = ent.GetHierarchyParent();
13002 }
13003
13004 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13005 }
13006 }
13007 }
13008
13010 {
13011
13012 EntityAI parent = GetHierarchyParent();
13013 if (!parent)
13014 {
13015 hasParent = false;
13016 hasRootAsPlayer = false;
13017 }
13018 else
13019 {
13020 hasParent = true;
13021 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13022 refParentIB =
ItemBase.Cast(parent);
13023 }
13024 }
13025
13026 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13027 {
13028
13029 }
13030
13032 {
13033
13034 return false;
13035 }
13036
13038 {
13039
13040
13041 return false;
13042 }
13043
13045 {
13046
13047 return false;
13048 }
13049
13052 {
13053 return !GetIsFrozen() &&
IsOpen();
13054 }
13055
13057 {
13058 bool hasParent = false, hasRootAsPlayer = false;
13060
13061 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13062 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13063
13064 if (wwtu || foodDecay)
13065 {
13069
13070 if (processWetness || processTemperature || processDecay)
13071 {
13073
13074 if (processWetness)
13075 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13076
13077 if (processTemperature)
13079
13080 if (processDecay)
13081 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13082 }
13083 }
13084 }
13085
13088 {
13090 }
13091
13093 {
13096
13097 return super.GetTemperatureFreezeThreshold();
13098 }
13099
13101 {
13104
13105 return super.GetTemperatureThawThreshold();
13106 }
13107
13109 {
13112
13113 return super.GetItemOverheatThreshold();
13114 }
13115
13117 {
13119 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13120
13121 return super.GetTemperatureFreezeTime();
13122 }
13123
13125 {
13127 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13128
13129 return super.GetTemperatureThawTime();
13130 }
13131
13136
13138 {
13139 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13140 }
13141
13143 {
13144 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13145 }
13146
13149 {
13151 }
13152
13154 {
13156 }
13157
13159 {
13161 }
13162
13165 {
13166 return null;
13167 }
13168
13171 {
13172 return false;
13173 }
13174
13176 {
13178 {
13181 if (!trg)
13182 {
13184 explosive = this;
13185 }
13186
13187 explosive.PairRemote(trg);
13189
13190 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13191 trg.SetPersistentPairID(persistentID);
13192 explosive.SetPersistentPairID(persistentID);
13193
13194 return true;
13195 }
13196 return false;
13197 }
13198
13201 {
13202 float ret = 1.0;
13205 ret *= GetHealth01();
13206
13207 return ret;
13208 }
13209
13210 #ifdef DEVELOPER
13211 override void SetDebugItem()
13212 {
13213 super.SetDebugItem();
13214 _itemBase = this;
13215 }
13216
13218 {
13219 string text = super.GetDebugText();
13220
13222 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13223
13224 return text;
13225 }
13226 #endif
13227
13229 {
13230 return true;
13231 }
13232
13234
13236
13238 {
13241 }
13242
13243
13251
13267}
13268
13270{
13272 if (entity)
13273 {
13274 bool is_item = entity.IsInherited(
ItemBase);
13275 if (is_item && full_quantity)
13276 {
13279 }
13280 }
13281 else
13282 {
13284 return NULL;
13285 }
13286 return entity;
13287}
13288
13290{
13291 if (item)
13292 {
13293 if (health > 0)
13294 item.SetHealth("", "", health);
13295
13296 if (item.CanHaveTemperature())
13297 {
13299 if (item.CanFreeze())
13300 item.SetFrozen(false);
13301 }
13302
13303 if (item.HasEnergyManager())
13304 {
13305 if (quantity >= 0)
13306 {
13307 item.GetCompEM().SetEnergy0To1(quantity);
13308 }
13309 else
13310 {
13312 }
13313 }
13314 else if (item.IsMagazine())
13315 {
13316 Magazine mag = Magazine.Cast(item);
13317 if (quantity >= 0)
13318 {
13319 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13320 }
13321 else
13322 {
13324 }
13325
13326 }
13327 else
13328 {
13329 if (quantity >= 0)
13330 {
13331 item.SetQuantityNormalized(quantity, false);
13332 }
13333 else
13334 {
13336 }
13337
13338 }
13339 }
13340}
13341
13342#ifdef DEVELOPER
13344#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.