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 {
10076
10078 return false;
10079
10080
10082 return false;
10083
10084
10085
10087 if (delta == 0)
10088 return false;
10089
10090
10091 return true;
10092 }
10093
10095 {
10097 {
10098 if (ScriptInputUserData.CanStoreInputUserData())
10099 {
10100 ScriptInputUserData ctx = new ScriptInputUserData;
10105 ctx.
Write(destination_entity);
10107 ctx.
Write(slot_id);
10109 }
10110 }
10111 else if (!
GetGame().IsMultiplayer())
10112 {
10114 }
10115 }
10116
10118 {
10119 float split_quantity_new;
10123 InventoryLocation loc = new InventoryLocation;
10124
10125 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10126 {
10128 split_quantity_new = stack_max;
10129 else
10131
10133 {
10134 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10135 if (new_item)
10136 {
10137 new_item.SetResultOfSplit(true);
10138 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10140 new_item.
SetQuantity(split_quantity_new,
false,
true);
10141 }
10142 }
10143 }
10144 else if (destination_entity && slot_id == -1)
10145 {
10146 if (quantity > stack_max)
10147 split_quantity_new = stack_max;
10148 else
10149 split_quantity_new = quantity;
10150
10152 {
10154 {
10157 }
10158
10159 if (new_item)
10160 {
10161 new_item.SetResultOfSplit(true);
10162 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10164 new_item.
SetQuantity(split_quantity_new,
false,
true);
10165 }
10166 }
10167 }
10168 else
10169 {
10170 if (stack_max != 0)
10171 {
10173 {
10175 }
10176
10177 if (split_quantity_new == 0)
10178 {
10179 if (!
GetGame().IsMultiplayer())
10180 player.PhysicalPredictiveDropItem(this);
10181 else
10182 player.ServerDropEntity(this);
10183 return;
10184 }
10185
10187 {
10189
10190 if (new_item)
10191 {
10192 new_item.SetResultOfSplit(true);
10193 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10196 new_item.PlaceOnSurface();
10197 }
10198 }
10199 }
10200 }
10201 }
10202
10204 {
10205 float split_quantity_new;
10209 InventoryLocation loc = new InventoryLocation;
10210
10211 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10212 {
10214 split_quantity_new = stack_max;
10215 else
10217
10219 {
10220 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10221 if (new_item)
10222 {
10223 new_item.SetResultOfSplit(true);
10224 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10226 new_item.
SetQuantity(split_quantity_new,
false,
true);
10227 }
10228 }
10229 }
10230 else if (destination_entity && slot_id == -1)
10231 {
10232 if (quantity > stack_max)
10233 split_quantity_new = stack_max;
10234 else
10235 split_quantity_new = quantity;
10236
10238 {
10240 {
10243 }
10244
10245 if (new_item)
10246 {
10247 new_item.SetResultOfSplit(true);
10248 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10250 new_item.
SetQuantity(split_quantity_new,
false,
true);
10251 }
10252 }
10253 }
10254 else
10255 {
10256 if (stack_max != 0)
10257 {
10259 {
10261 }
10262
10264 {
10266
10267 if (new_item)
10268 {
10269 new_item.SetResultOfSplit(true);
10270 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10273 new_item.PlaceOnSurface();
10274 }
10275 }
10276 }
10277 }
10278 }
10279
10281 {
10283 {
10284 if (ScriptInputUserData.CanStoreInputUserData())
10285 {
10286 ScriptInputUserData ctx = new ScriptInputUserData;
10291 dst.WriteToContext(ctx);
10293 }
10294 }
10295 else if (!
GetGame().IsMultiplayer())
10296 {
10298 }
10299 }
10300
10302 {
10304 {
10305 if (ScriptInputUserData.CanStoreInputUserData())
10306 {
10307 ScriptInputUserData ctx = new ScriptInputUserData;
10312 ctx.
Write(destination_entity);
10318 }
10319 }
10320 else if (!
GetGame().IsMultiplayer())
10321 {
10323 }
10324 }
10325
10327 {
10329 }
10330
10332 {
10334 float split_quantity_new;
10336 if (dst.IsValid())
10337 {
10338 int slot_id = dst.GetSlot();
10340
10341 if (quantity > stack_max)
10342 split_quantity_new = stack_max;
10343 else
10344 split_quantity_new = quantity;
10345
10347 {
10349
10350 if (new_item)
10351 {
10352 new_item.SetResultOfSplit(true);
10353 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10355 new_item.
SetQuantity(split_quantity_new,
false,
true);
10356 }
10357
10358 return new_item;
10359 }
10360 }
10361
10362 return null;
10363 }
10364
10366 {
10368 float split_quantity_new;
10370 if (destination_entity)
10371 {
10373 if (quantity > stackable)
10374 split_quantity_new = stackable;
10375 else
10376 split_quantity_new = quantity;
10377
10379 {
10380 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10381 if (new_item)
10382 {
10383 new_item.SetResultOfSplit(true);
10384 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10386 new_item.
SetQuantity(split_quantity_new,
false,
true);
10387 }
10388 }
10389 }
10390 }
10391
10393 {
10395 {
10396 if (ScriptInputUserData.CanStoreInputUserData())
10397 {
10398 ScriptInputUserData ctx = new ScriptInputUserData;
10403 ItemBase destination_entity =
this;
10404 ctx.
Write(destination_entity);
10408 }
10409 }
10410 else if (!
GetGame().IsMultiplayer())
10411 {
10413 }
10414 }
10415
10417 {
10419 float split_quantity_new;
10421 if (player)
10422 {
10424 if (quantity > stackable)
10425 split_quantity_new = stackable;
10426 else
10427 split_quantity_new = quantity;
10428
10430 {
10431 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10432 new_item =
ItemBase.Cast(in_hands);
10433 if (new_item)
10434 {
10435 new_item.SetResultOfSplit(true);
10436 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10438 new_item.SetQuantity(split_quantity_new, false, true);
10439 }
10440 }
10441 }
10442 }
10443
10445 {
10447 float split_quantity_new = Math.Floor(quantity * 0.5);
10448
10450 return;
10451
10453
10454 if (new_item)
10455 {
10456 if (new_item.GetQuantityMax() < split_quantity_new)
10457 {
10458 split_quantity_new = new_item.GetQuantityMax();
10459 }
10460
10461 new_item.SetResultOfSplit(true);
10462 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10463
10465 {
10468 }
10469 else
10470 {
10472 new_item.
SetQuantity(split_quantity_new,
false,
true);
10473 }
10474 }
10475 }
10476
10478 {
10480 float split_quantity_new = Math.Floor(quantity / 2);
10481
10483 return;
10484
10485 InventoryLocation invloc = new InventoryLocation;
10487
10489 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10490
10491 if (new_item)
10492 {
10493 if (new_item.GetQuantityMax() < split_quantity_new)
10494 {
10495 split_quantity_new = new_item.GetQuantityMax();
10496 }
10498 {
10501 }
10502 else if (split_quantity_new > 1)
10503 {
10505 new_item.
SetQuantity(split_quantity_new,
false,
true);
10506 }
10507 }
10508 }
10509
10512 {
10513 SetWeightDirty();
10515
10516 if (parent)
10517 parent.OnAttachmentQuantityChangedEx(this, delta);
10518
10520 {
10522 {
10524 }
10526 {
10527 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10529 }
10530 }
10531
10532 }
10533
10536 {
10537
10538 }
10539
10542 {
10544 }
10545
10547 {
10548 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10549
10551 {
10552 if (newLevel == GameConstants.STATE_RUINED)
10553 {
10555 EntityAI parent = GetHierarchyParent();
10556 if (parent && parent.IsFireplace())
10557 {
10558 CargoBase cargo = GetInventory().GetCargo();
10559 if (cargo)
10560 {
10562 {
10564 }
10565 }
10566 }
10567 }
10568
10570 {
10571
10573 return;
10574 }
10575
10576 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10577 {
10579 }
10580 }
10581 }
10582
10583
10585 {
10586 super.OnRightClick();
10587
10589 {
10591 {
10592 if (ScriptInputUserData.CanStoreInputUserData())
10593 {
10594 EntityAI root = GetHierarchyRoot();
10595 Man playerOwner = GetHierarchyRootPlayer();
10596 InventoryLocation dst = new InventoryLocation;
10597
10598
10599 if (!playerOwner && root && root == this)
10600 {
10602 }
10603 else
10604 {
10605
10606 GetInventory().GetCurrentInventoryLocation(dst);
10608 {
10611 {
10613 }
10614 else
10615 {
10617
10618
10619 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10620 {
10622 }
10623 else
10624 {
10625 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10626 }
10627 }
10628 }
10629 }
10630
10631 ScriptInputUserData ctx = new ScriptInputUserData;
10639 }
10640 }
10641 else if (!
GetGame().IsMultiplayer())
10642 {
10644 }
10645 }
10646 }
10647
10649 {
10650 if (root)
10651 {
10652 vector m4[4];
10653 root.GetTransform(m4);
10654 dst.SetGround(this, m4);
10655 }
10656 else
10657 {
10658 GetInventory().GetCurrentInventoryLocation(dst);
10659 }
10660 }
10661
10662 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10663 {
10664
10665 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10666 return false;
10667
10668 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10669 return false;
10670
10671
10673 return false;
10674
10675
10676 Magazine mag = Magazine.Cast(this);
10677 if (mag)
10678 {
10679 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10680 return false;
10681
10682 if (stack_max_limit)
10683 {
10684 Magazine other_mag = Magazine.Cast(other_item);
10685 if (other_item)
10686 {
10687 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10688 return false;
10689 }
10690
10691 }
10692 }
10693 else
10694 {
10695
10697 return false;
10698
10700 return false;
10701 }
10702
10703 PlayerBase player = null;
10704 if (CastTo(player, GetHierarchyRootPlayer()))
10705 {
10706 if (player.GetInventory().HasAttachment(this))
10707 return false;
10708
10709 if (player.IsItemsToDelete())
10710 return false;
10711 }
10712
10713 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10714 return false;
10715
10716 int slotID;
10718 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10719 return false;
10720
10721 return true;
10722 }
10723
10725 {
10727 }
10728
10730 {
10731 return m_IsResultOfSplit;
10732 }
10733
10735 {
10736 m_IsResultOfSplit = value;
10737 }
10738
10740 {
10742 }
10743
10745 {
10746 float other_item_quantity = other_item.GetQuantity();
10747 float this_free_space;
10748
10750
10752
10753 if (other_item_quantity > this_free_space)
10754 {
10755 return this_free_space;
10756 }
10757 else
10758 {
10759 return other_item_quantity;
10760 }
10761 }
10762
10764 {
10766 }
10767
10769 {
10771 return;
10772
10773 if (!IsMagazine() && other_item)
10774 {
10776 if (quantity_used != 0)
10777 {
10778 float hp1 = GetHealth01("","");
10779 float hp2 = other_item.GetHealth01("","");
10780 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10781 hpResult = hpResult / (
GetQuantity() + quantity_used);
10782
10783 hpResult *= GetMaxHealth();
10784 Math.Round(hpResult);
10785 SetHealth("", "Health", hpResult);
10786
10788 other_item.AddQuantity(-quantity_used);
10789 }
10790 }
10792 }
10793
10795 {
10796 #ifdef SERVER
10797 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10798 GetHierarchyParent().IncreaseLifetimeUp();
10799 #endif
10800 };
10801
10803 {
10804 PlayerBase p = PlayerBase.Cast(player);
10805
10806 array<int> recipesIds = p.m_Recipes;
10807 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10808 if (moduleRecipesManager)
10809 {
10810 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10811 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10812 }
10813
10814 for (int i = 0;i < recipesIds.Count(); i++)
10815 {
10816 int key = recipesIds.Get(i);
10817 string recipeName = moduleRecipesManager.GetRecipeName(key);
10819 }
10820 }
10821
10822
10823 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10824 {
10825 super.GetDebugActions(outputList);
10826
10827
10833
10834
10839
10844
10845
10849
10850
10852 {
10856 }
10857
10860
10861
10865
10867
10868 InventoryLocation loc = new InventoryLocation();
10869 GetInventory().GetCurrentInventoryLocation(loc);
10871 {
10872 if (Gizmo_IsSupported())
10875 }
10876
10878 }
10879
10880
10881
10882
10884 {
10885 super.OnAction(action_id, player, ctx);
10886
10888 {
10889 switch (action_id)
10890 {
10893 return true;
10896 return true;
10897 }
10898 }
10899
10901 {
10902 switch (action_id)
10903 {
10905 Delete();
10906 return true;
10907 }
10908 }
10909
10910 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10911 {
10912 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10913 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10914 PlayerBase p = PlayerBase.Cast(player);
10915 if (
EActions.RECIPES_RANGE_START < 1000)
10916 {
10917 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10918 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10919 }
10920 }
10921 #ifndef SERVER
10922 else if (action_id ==
EActions.WATCH_PLAYER)
10923 {
10924 PluginDeveloper.SetDeveloperItemClientEx(player);
10925 }
10926 #endif
10928 {
10929 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10930 {
10931 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10932 OnDebugButtonPressServer(id + 1);
10933 }
10934
10935 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10936 {
10937 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10939 }
10940
10941 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10942 {
10943 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10945 }
10946
10947 else if (action_id ==
EActions.ADD_QUANTITY)
10948 {
10949 if (IsMagazine())
10950 {
10951 Magazine mag = Magazine.Cast(this);
10952 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10953 }
10954 else
10955 {
10957 }
10958
10959 if (m_EM)
10960 {
10961 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10962 }
10963
10964 }
10965
10966 else if (action_id ==
EActions.REMOVE_QUANTITY)
10967 {
10968 if (IsMagazine())
10969 {
10970 Magazine mag2 = Magazine.Cast(this);
10971 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10972 }
10973 else
10974 {
10976 }
10977 if (m_EM)
10978 {
10979 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10980 }
10981
10982 }
10983
10984 else if (action_id ==
EActions.SET_QUANTITY_0)
10985 {
10987
10988 if (m_EM)
10989 {
10990 m_EM.SetEnergy(0);
10991 }
10992 }
10993
10994 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10995 {
10997
10998 if (m_EM)
10999 {
11000 m_EM.SetEnergy(m_EM.GetEnergyMax());
11001 }
11002 }
11003
11004 else if (action_id ==
EActions.ADD_HEALTH)
11005 {
11006 AddHealth("","",GetMaxHealth("","Health")/5);
11007 }
11008 else if (action_id ==
EActions.REMOVE_HEALTH)
11009 {
11010 AddHealth("","",-GetMaxHealth("","Health")/5);
11011 }
11012 else if (action_id ==
EActions.DESTROY_HEALTH)
11013 {
11014 SetHealth01("","",0);
11015 }
11016 else if (action_id ==
EActions.WATCH_ITEM)
11017 {
11019 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11020 #ifdef DEVELOPER
11021 SetDebugDeveloper_item(this);
11022 #endif
11023 }
11024
11025 else if (action_id ==
EActions.ADD_TEMPERATURE)
11026 {
11027 AddTemperature(20);
11028
11029 }
11030
11031 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11032 {
11033 AddTemperature(-20);
11034
11035 }
11036
11037 else if (action_id ==
EActions.FLIP_FROZEN)
11038 {
11039 SetFrozen(!GetIsFrozen());
11040
11041 }
11042
11043 else if (action_id ==
EActions.ADD_WETNESS)
11044 {
11046
11047 }
11048
11049 else if (action_id ==
EActions.REMOVE_WETNESS)
11050 {
11052
11053 }
11054
11055 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11056 {
11059
11060
11061 }
11062
11063 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11064 {
11067 }
11068
11069 else if (action_id ==
EActions.MAKE_SPECIAL)
11070 {
11071 auto debugParams = DebugSpawnParams.WithPlayer(player);
11072 OnDebugSpawnEx(debugParams);
11073 }
11074
11075 }
11076
11077
11078 return false;
11079 }
11080
11081
11082
11083
11087
11090
11091
11092
11094 {
11095 return false;
11096 }
11097
11098
11100 {
11101 return true;
11102 }
11103
11104
11106 {
11107 return true;
11108 }
11109
11110
11111
11113 {
11114 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11116 }
11117
11120 {
11121 return null;
11122 }
11123
11125 {
11126 return false;
11127 }
11128
11130 {
11131 return false;
11132 }
11133
11137
11138
11140 {
11141 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11142 return module_repairing.CanRepair(this, item_repair_kit);
11143 }
11144
11145
11146 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11147 {
11148 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11149 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11150 }
11151
11152
11154 {
11155
11156
11157
11158
11159
11160
11161
11162
11163 return 1;
11164 }
11165
11166
11167
11169 {
11171 }
11172
11173
11174
11176 {
11178 }
11179
11180
11189 {
11190 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11191
11192 if (player)
11193 {
11194 player.MessageStatus(text);
11195 }
11196 }
11197
11198
11207 {
11208 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11209
11210 if (player)
11211 {
11212 player.MessageAction(text);
11213 }
11214 }
11215
11216
11225 {
11226 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11227
11228 if (player)
11229 {
11230 player.MessageFriendly(text);
11231 }
11232 }
11233
11234
11243 {
11244 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11245
11246 if (player)
11247 {
11248 player.MessageImportant(text);
11249 }
11250 }
11251
11253 {
11254 return true;
11255 }
11256
11257
11258 override bool KindOf(
string tag)
11259 {
11260 bool found = false;
11261 string item_name = this.
GetType();
11264
11265 int array_size = item_tag_array.Count();
11266 for (int i = 0; i < array_size; i++)
11267 {
11268 if (item_tag_array.Get(i) == tag)
11269 {
11270 found = true;
11271 break;
11272 }
11273 }
11274 return found;
11275 }
11276
11277
11279 {
11280
11281 super.OnRPC(sender, rpc_type,ctx);
11282
11283
11284 switch (rpc_type)
11285 {
11286 #ifndef SERVER
11287 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11288 Param2<bool, string> p = new Param2<bool, string>(false, "");
11289
11291 return;
11292
11293 bool play = p.param1;
11294 string soundSet = p.param2;
11295
11296 if (play)
11297 {
11299 {
11301 {
11303 }
11304 }
11305 else
11306 {
11308 }
11309 }
11310 else
11311 {
11313 }
11314
11315 break;
11316 #endif
11317
11318 }
11319
11321 {
11323 }
11324 }
11325
11326
11327
11328
11330 {
11331 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11332 return plugin.GetID(
name);
11333 }
11334
11336 {
11337 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11338 return plugin.GetName(id);
11339 }
11340
11343 {
11344
11345
11346 int varFlags;
11347 if (!ctx.
Read(varFlags))
11348 return;
11349
11350 if (varFlags & ItemVariableFlags.FLOAT)
11351 {
11353 }
11354 }
11355
11357 {
11358
11359 super.SerializeNumericalVars(floats_out);
11360
11361
11362
11364 {
11366 }
11367
11369 {
11371 }
11372
11374 {
11376 }
11377
11379 {
11384 }
11385
11387 {
11389 }
11390 }
11391
11393 {
11394
11395 super.DeSerializeNumericalVars(floats);
11396
11397
11398 int index = 0;
11399 int mask = Math.Round(floats.Get(index));
11400
11401 index++;
11402
11404 {
11406 {
11408 }
11409 else
11410 {
11411 float quantity = floats.Get(index);
11412 SetQuantity(quantity,
true,
false,
false,
false);
11413 }
11414 index++;
11415 }
11416
11418 {
11419 float wet = floats.Get(index);
11421 index++;
11422 }
11423
11425 {
11426 int liquidtype = Math.Round(floats.Get(index));
11428 index++;
11429 }
11430
11432 {
11434 index++;
11436 index++;
11438 index++;
11440 index++;
11441 }
11442
11444 {
11445 int cleanness = Math.Round(floats.Get(index));
11447 index++;
11448 }
11449 }
11450
11452 {
11453 super.WriteVarsToCTX(ctx);
11454
11455
11457 {
11459 }
11460
11462 {
11464 }
11465
11467 {
11469 }
11470
11472 {
11473 int r,g,b,a;
11479 }
11480
11482 {
11484 }
11485 }
11486
11488 {
11489 if (!super.ReadVarsFromCTX(ctx,version))
11490 return false;
11491
11492 int intValue;
11493 float value;
11494
11495 if (version < 140)
11496 {
11497 if (!ctx.
Read(intValue))
11498 return false;
11499
11500 m_VariablesMask = intValue;
11501 }
11502
11504 {
11505 if (!ctx.
Read(value))
11506 return false;
11507
11509 {
11511 }
11512 else
11513 {
11515 }
11516 }
11517
11518 if (version < 140)
11519 {
11521 {
11522 if (!ctx.
Read(value))
11523 return false;
11524 SetTemperatureDirect(value);
11525 }
11526 }
11527
11529 {
11530 if (!ctx.
Read(value))
11531 return false;
11533 }
11534
11536 {
11537 if (!ctx.
Read(intValue))
11538 return false;
11540 }
11541
11543 {
11544 int r,g,b,a;
11546 return false;
11548 return false;
11550 return false;
11552 return false;
11553
11555 }
11556
11558 {
11559 if (!ctx.
Read(intValue))
11560 return false;
11562 }
11563
11564 if (version >= 138 && version < 140)
11565 {
11567 {
11568 if (!ctx.
Read(intValue))
11569 return false;
11570 SetFrozen(intValue);
11571 }
11572 }
11573
11574 return true;
11575 }
11576
11577
11579 {
11582 {
11584 }
11585
11586 if (!super.OnStoreLoad(ctx, version))
11587 {
11589 return false;
11590 }
11591
11592 if (version >= 114)
11593 {
11594 bool hasQuickBarIndexSaved;
11595
11596 if (!ctx.
Read(hasQuickBarIndexSaved))
11597 {
11599 return false;
11600 }
11601
11602 if (hasQuickBarIndexSaved)
11603 {
11604 int itmQBIndex;
11605
11606
11607 if (!ctx.
Read(itmQBIndex))
11608 {
11610 return false;
11611 }
11612
11613 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11614 if (itmQBIndex != -1 && parentPlayer)
11615 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11616 }
11617 }
11618 else
11619 {
11620
11621 PlayerBase player;
11622 int itemQBIndex;
11623 if (version ==
int.
MAX)
11624 {
11625 if (!ctx.
Read(itemQBIndex))
11626 {
11628 return false;
11629 }
11630 }
11631 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11632 {
11633
11634 if (!ctx.
Read(itemQBIndex))
11635 {
11637 return false;
11638 }
11639 if (itemQBIndex != -1 && player)
11640 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11641 }
11642 }
11643
11644 if (version < 140)
11645 {
11646
11647 if (!LoadVariables(ctx, version))
11648 {
11650 return false;
11651 }
11652 }
11653
11654
11656 {
11658 return false;
11659 }
11660 if (version >= 132)
11661 {
11663 if (raib)
11664 {
11666 {
11668 return false;
11669 }
11670 }
11671 }
11672
11674 return true;
11675 }
11676
11677
11678
11680 {
11681 super.OnStoreSave(ctx);
11682
11683 PlayerBase player;
11684 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11685 {
11687
11688 int itemQBIndex = -1;
11689 itemQBIndex = player.FindQuickBarEntityIndex(this);
11690 ctx.
Write(itemQBIndex);
11691 }
11692 else
11693 {
11695 }
11696
11698
11700 if (raib)
11701 {
11703 }
11704 }
11705
11706
11708 {
11709 super.AfterStoreLoad();
11710
11712 {
11714 }
11715
11717 {
11720 }
11721 }
11722
11724 {
11725 super.EEOnAfterLoad();
11726
11728 {
11730 }
11731
11734 }
11735
11737 {
11738 return false;
11739 }
11740
11741
11742
11744 {
11746 {
11747 #ifdef PLATFORM_CONSOLE
11748
11750 {
11752 if (menu)
11753 {
11755 }
11756 }
11757 #endif
11758 }
11759
11761 {
11764 }
11765
11767 {
11768 SetWeightDirty();
11770 }
11772 {
11775 }
11776
11778 {
11781 }
11783 {
11786 }
11787
11788 super.OnVariablesSynchronized();
11789 }
11790
11791
11792
11794 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11795 {
11796 if (!IsServerCheck(allow_client))
11797 return false;
11798
11800 return false;
11801
11804
11805 if (value <= (min + 0.001))
11806 value = min;
11807
11808 if (value == min)
11809 {
11810 if (destroy_config)
11811 {
11812 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11813 if (dstr)
11814 {
11816 this.Delete();
11817 return true;
11818 }
11819 }
11820 else if (destroy_forced)
11821 {
11823 this.Delete();
11824 return true;
11825 }
11826
11828 }
11829
11832
11834 {
11836
11837 if (delta)
11839 }
11840
11842
11843 return false;
11844 }
11845
11846
11848 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11849 {
11851 }
11852
11854 {
11857 }
11858
11860 {
11863 }
11864
11866 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11867 {
11868 float value_clamped = Math.Clamp(value, 0, 1);
11870 SetQuantity(result, destroy_config, destroy_forced);
11871 }
11872
11873
11876 {
11878 }
11879
11881 {
11883 }
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11895 {
11896 int slot = -1;
11897 if (GetInventory())
11898 {
11899 InventoryLocation il = new InventoryLocation;
11900 GetInventory().GetCurrentInventoryLocation(il);
11902 }
11903
11905 }
11906
11908 {
11909 float quantity_max = 0;
11910
11912 {
11913 if (attSlotID != -1)
11914 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11915
11916 if (quantity_max <= 0)
11918 }
11919
11920 if (quantity_max <= 0)
11922
11923 return quantity_max;
11924 }
11925
11927 {
11929 }
11930
11932 {
11934 }
11935
11936
11938 {
11940 }
11941
11943 {
11945 }
11946
11948 {
11950 }
11951
11952
11954 {
11955
11956 float weightEx = GetWeightEx();
11957 float special = GetInventoryAndCargoWeight();
11958 return weightEx - special;
11959 }
11960
11961
11963 {
11965 }
11966
11968 {
11970 {
11971 #ifdef DEVELOPER
11972 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11973 {
11974 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11976 }
11977 #endif
11978
11979 return GetQuantity() * GetConfigWeightModified();
11980 }
11981 else if (HasEnergyManager())
11982 {
11983 #ifdef DEVELOPER
11984 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11985 {
11986 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11987 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11988 }
11989 #endif
11990 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11991 }
11992 else
11993 {
11994 #ifdef DEVELOPER
11995 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11996 {
11997 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11998 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11999 }
12000 #endif
12001 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12002 }
12003 }
12004
12007 {
12008 int item_count = 0;
12010
12011 if (GetInventory().GetCargo() != NULL)
12012 {
12013 item_count = GetInventory().GetCargo().GetItemCount();
12014 }
12015
12016 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12017 {
12018 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12019 if (item)
12020 item_count += item.GetNumberOfItems();
12021 }
12022 return item_count;
12023 }
12024
12027 {
12028 float weight = 0;
12029 float wetness = 1;
12030 if (include_wetness)
12033 {
12034 weight = wetness * m_ConfigWeight;
12035 }
12037 {
12038 weight = 1;
12039 }
12040 return weight;
12041 }
12042
12043
12044
12046 {
12047 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12048 {
12049 GameInventory inv = GetInventory();
12050 array<EntityAI> items = new array<EntityAI>;
12052 for (int i = 0; i < items.Count(); i++)
12053 {
12055 if (item)
12056 {
12058 }
12059 }
12060 }
12061 }
12062
12063
12064
12065
12067 {
12068 float energy = 0;
12069 if (HasEnergyManager())
12070 {
12071 energy = GetCompEM().GetEnergy();
12072 }
12073 return energy;
12074 }
12075
12076
12078 {
12079 super.OnEnergyConsumed();
12080
12082 }
12083
12085 {
12086 super.OnEnergyAdded();
12087
12089 }
12090
12091
12093 {
12094 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12095 {
12097 {
12098 float energy_0to1 = GetCompEM().GetEnergy0To1();
12100 }
12101 }
12102 }
12103
12104
12106 {
12107 return ConfigGetFloat("heatIsolation");
12108 }
12109
12111 {
12113 }
12114
12116 {
12117 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12118 if (
GetGame().ConfigIsExisting(paramPath))
12120
12121 return 0.0;
12122 }
12123
12125 {
12126 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12127 if (
GetGame().ConfigIsExisting(paramPath))
12129
12130 return 0.0;
12131 }
12132
12133 override void SetWet(
float value,
bool allow_client =
false)
12134 {
12135 if (!IsServerCheck(allow_client))
12136 return;
12137
12140
12142
12143 m_VarWet = Math.Clamp(value, min, max);
12144
12146 {
12149 }
12150 }
12151
12152 override void AddWet(
float value)
12153 {
12155 }
12156
12158 {
12160 }
12161
12163 {
12165 }
12166
12168 {
12170 }
12171
12173 {
12175 }
12176
12178 {
12180 }
12181
12182 override void OnWetChanged(
float newVal,
float oldVal)
12183 {
12186 if (newLevel != oldLevel)
12187 {
12189 }
12190 }
12191
12193 {
12194 SetWeightDirty();
12195 }
12196
12198 {
12199 return GetWetLevelInternal(
m_VarWet);
12200 }
12201
12202
12203
12205 {
12207 }
12208
12210 {
12212 }
12213
12215 {
12217 }
12218
12220 {
12222 }
12223
12224
12225
12227 {
12228 if (ConfigIsExisting("itemModelLength"))
12229 {
12230 return ConfigGetFloat("itemModelLength");
12231 }
12232 return 0;
12233 }
12234
12236 {
12237 if (ConfigIsExisting("itemAttachOffset"))
12238 {
12239 return ConfigGetFloat("itemAttachOffset");
12240 }
12241 return 0;
12242 }
12243
12244 override void SetCleanness(
int value,
bool allow_client =
false)
12245 {
12246 if (!IsServerCheck(allow_client))
12247 return;
12248
12250
12252
12255 }
12256
12258 {
12260 }
12261
12263 {
12264 return true;
12265 }
12266
12267
12268
12269
12271 {
12273 }
12274
12276 {
12278 }
12279
12280
12281
12282
12283 override void SetColor(
int r,
int g,
int b,
int a)
12284 {
12290 }
12292 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12293 {
12298 }
12299
12301 {
12303 }
12304
12307 {
12308 int r,g,b,a;
12310 r = r/255;
12311 g = g/255;
12312 b = b/255;
12313 a = a/255;
12314 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12315 }
12316
12317
12318
12319 override void SetLiquidType(
int value,
bool allow_client =
false)
12320 {
12321 if (!IsServerCheck(allow_client))
12322 return;
12323
12328 }
12329
12331 {
12332 return ConfigGetInt("varLiquidTypeInit");
12333 }
12334
12336 {
12338 }
12339
12341 {
12343 SetFrozen(false);
12344 }
12345
12348 {
12349 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12350 }
12351
12352
12355 {
12356 PlayerBase nplayer;
12357 if (PlayerBase.CastTo(nplayer, player))
12358 {
12360
12361 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12362 }
12363 }
12364
12365
12368 {
12369 PlayerBase nplayer;
12370 if (PlayerBase.CastTo(nplayer,player))
12371 {
12372
12373 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12374
12375 }
12376
12377
12378 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12379
12380
12381 if (HasEnergyManager())
12382 {
12383 GetCompEM().UpdatePlugState();
12384 }
12385 }
12386
12387
12389 {
12390 super.OnPlacementStarted(player);
12391
12393 }
12394
12395 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12396 {
12398 {
12399 m_AdminLog.OnPlacementComplete(player,
this);
12400 }
12401
12402 super.OnPlacementComplete(player, position, orientation);
12403 }
12404
12405
12406
12407
12408
12410 {
12412 {
12413 return true;
12414 }
12415 else
12416 {
12417 return false;
12418 }
12419 }
12420
12421
12423 {
12425 {
12427 }
12428 }
12429
12430
12432 {
12434 }
12435
12437 {
12439 }
12440
12441 override void InsertAgent(
int agent,
float count = 1)
12442 {
12443 if (count < 1)
12444 return;
12445
12447 }
12448
12451 {
12453 }
12454
12455
12457 {
12459 }
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12503 {
12505 return false;
12506 return true;
12507 }
12508
12510 {
12511
12513 }
12514
12515
12518 {
12519 super.CheckForRoofLimited(timeTresholdMS);
12520
12522 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12523 {
12524 m_PreviousRoofTestTime = time;
12525 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12526 }
12527 }
12528
12529
12531 {
12533 {
12534 return 0;
12535 }
12536
12537 if (GetInventory().GetAttachmentSlotsCount() != 0)
12538 {
12539 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12540 if (filter)
12541 return filter.GetProtectionLevel(type, false, system);
12542 else
12543 return 0;
12544 }
12545
12546 string subclassPath, entryName;
12547
12548 switch (type)
12549 {
12551 entryName = "biological";
12552 break;
12554 entryName = "chemical";
12555 break;
12556 default:
12557 entryName = "biological";
12558 break;
12559 }
12560
12561 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12562
12564 }
12565
12566
12567
12570 {
12571 if (!IsMagazine())
12573
12575 }
12576
12577
12578
12579
12580
12585 {
12586 return true;
12587 }
12588
12590 {
12592 }
12593
12594
12595
12596
12597
12599 {
12600 if (parent)
12601 {
12602 if (parent.IsInherited(DayZInfected))
12603 return true;
12604
12605 if (!parent.IsRuined())
12606 return true;
12607 }
12608
12609 return true;
12610 }
12611
12613 {
12614 if (!super.CanPutAsAttachment(parent))
12615 {
12616 return false;
12617 }
12618
12619 if (!IsRuined() && !parent.IsRuined())
12620 {
12621 return true;
12622 }
12623
12624 return false;
12625 }
12626
12628 {
12629
12630
12631
12632
12633 return super.CanReceiveItemIntoCargo(item);
12634 }
12635
12637 {
12638
12639
12640
12641
12642 GameInventory attachmentInv = attachment.GetInventory();
12644 {
12645 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12646 return false;
12647 }
12648
12649 InventoryLocation loc = new InventoryLocation();
12650 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12651 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12652 return false;
12653
12654 return super.CanReceiveAttachment(attachment, slotId);
12655 }
12656
12658 {
12659 if (!super.CanReleaseAttachment(attachment))
12660 return false;
12661
12662 return GetInventory().AreChildrenAccessible();
12663 }
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12686 {
12687 int id = muzzle_owner.GetMuzzleID();
12688 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12689
12690 if (WPOF_array)
12691 {
12692 for (int i = 0; i < WPOF_array.Count(); i++)
12693 {
12694 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12695
12696 if (WPOF)
12697 {
12698 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12699 }
12700 }
12701 }
12702 }
12703
12704
12706 {
12707 int id = muzzle_owner.GetMuzzleID();
12709
12710 if (WPOBE_array)
12711 {
12712 for (int i = 0; i < WPOBE_array.Count(); i++)
12713 {
12714 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12715
12716 if (WPOBE)
12717 {
12718 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12719 }
12720 }
12721 }
12722 }
12723
12724
12726 {
12727 int id = muzzle_owner.GetMuzzleID();
12728 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12729
12730 if (WPOOH_array)
12731 {
12732 for (int i = 0; i < WPOOH_array.Count(); i++)
12733 {
12734 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12735
12736 if (WPOOH)
12737 {
12738 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12739 }
12740 }
12741 }
12742 }
12743
12744
12746 {
12747 int id = muzzle_owner.GetMuzzleID();
12748 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12749
12750 if (WPOOH_array)
12751 {
12752 for (int i = 0; i < WPOOH_array.Count(); i++)
12753 {
12754 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12755
12756 if (WPOOH)
12757 {
12758 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12759 }
12760 }
12761 }
12762 }
12763
12764
12766 {
12767 int id = muzzle_owner.GetMuzzleID();
12768 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12769
12770 if (WPOOH_array)
12771 {
12772 for (int i = 0; i < WPOOH_array.Count(); i++)
12773 {
12774 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12775
12776 if (WPOOH)
12777 {
12778 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12779 }
12780 }
12781 }
12782 }
12783
12784
12785
12787 {
12789 {
12790 return true;
12791 }
12792
12793 return false;
12794 }
12795
12797 {
12799 {
12800 return true;
12801 }
12802
12803 return false;
12804 }
12805
12807 {
12809 {
12810 return true;
12811 }
12812
12813 return false;
12814 }
12815
12817 {
12818 return false;
12819 }
12820
12823 {
12824 return UATimeSpent.DEFAULT_DEPLOY;
12825 }
12826
12827
12828
12829
12831 {
12833 SetSynchDirty();
12834 }
12835
12837 {
12839 }
12840
12841
12843 {
12844 return false;
12845 }
12846
12849 {
12850 string att_type = "None";
12851
12852 if (ConfigIsExisting("soundAttType"))
12853 {
12854 att_type = ConfigGetString("soundAttType");
12855 }
12856
12858 }
12859
12861 {
12863 }
12864
12865
12866
12867
12868
12874
12876 {
12879
12881 }
12882
12883
12885 {
12887 return;
12888
12890
12893
12896
12897 SoundParameters params = new SoundParameters();
12901 }
12902
12903
12905 {
12907 return;
12908
12910 SetSynchDirty();
12911
12914 }
12915
12916
12918 {
12920 return;
12921
12923 SetSynchDirty();
12924
12927 }
12928
12930 {
12932 }
12933
12935 {
12937 }
12938
12941 {
12942 if (!
GetGame().IsDedicatedServer())
12943 {
12944 if (ConfigIsExisting("attachSoundSet"))
12945 {
12946 string cfg_path = "";
12947 string soundset = "";
12948 string type_name =
GetType();
12949
12952 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12953 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12954
12955 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12956 {
12957 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12958 {
12959 if (cfg_slot_array[i] == slot_type)
12960 {
12961 soundset = cfg_soundset_array[i];
12962 break;
12963 }
12964 }
12965 }
12966
12967 if (soundset != "")
12968 {
12969 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12971 }
12972 }
12973 }
12974 }
12975
12977 {
12978
12979 }
12980
12981 void OnApply(PlayerBase player);
12982
12984 {
12985 return 1.0;
12986 };
12987
12989 {
12991 }
12992
12994 {
12996 }
12997
12999
13001 {
13002 SetDynamicPhysicsLifeTime(0.01);
13004 }
13005
13007 {
13008 array<string> zone_names = new array<string>;
13009 GetDamageZones(zone_names);
13010 for (int i = 0; i < zone_names.Count(); i++)
13011 {
13012 SetHealthMax(zone_names.Get(i),"Health");
13013 }
13014 SetHealthMax("","Health");
13015 }
13016
13019 {
13020 float global_health = GetHealth01("","Health");
13021 array<string> zones = new array<string>;
13022 GetDamageZones(zones);
13023
13024 for (int i = 0; i < zones.Count(); i++)
13025 {
13026 SetHealth01(zones.Get(i),"Health",global_health);
13027 }
13028 }
13029
13032 {
13033 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13034 }
13035
13037 {
13038 if (!hasRootAsPlayer)
13039 {
13040 if (refParentIB)
13041 {
13042
13043 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13044 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13045
13046 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13047 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13048
13051 }
13052 else
13053 {
13054
13057 }
13058 }
13059 }
13060
13062 {
13064 {
13065 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13066 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13067 {
13068 float heatPermCoef = 1.0;
13070 while (ent)
13071 {
13072 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13073 ent = ent.GetHierarchyParent();
13074 }
13075
13076 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13077 }
13078 }
13079 }
13080
13082 {
13083
13084 EntityAI parent = GetHierarchyParent();
13085 if (!parent)
13086 {
13087 hasParent = false;
13088 hasRootAsPlayer = false;
13089 }
13090 else
13091 {
13092 hasParent = true;
13093 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13094 refParentIB =
ItemBase.Cast(parent);
13095 }
13096 }
13097
13098 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13099 {
13100
13101 }
13102
13104 {
13105
13106 return false;
13107 }
13108
13110 {
13111
13112
13113 return false;
13114 }
13115
13117 {
13118
13119 return false;
13120 }
13121
13124 {
13125 return !GetIsFrozen() &&
IsOpen();
13126 }
13127
13129 {
13130 bool hasParent = false, hasRootAsPlayer = false;
13132
13133 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13134 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13135
13136 if (wwtu || foodDecay)
13137 {
13141
13142 if (processWetness || processTemperature || processDecay)
13143 {
13145
13146 if (processWetness)
13147 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13148
13149 if (processTemperature)
13151
13152 if (processDecay)
13153 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13154 }
13155 }
13156 }
13157
13160 {
13162 }
13163
13165 {
13168
13169 return super.GetTemperatureFreezeThreshold();
13170 }
13171
13173 {
13176
13177 return super.GetTemperatureThawThreshold();
13178 }
13179
13181 {
13184
13185 return super.GetItemOverheatThreshold();
13186 }
13187
13189 {
13191 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13192
13193 return super.GetTemperatureFreezeTime();
13194 }
13195
13197 {
13199 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13200
13201 return super.GetTemperatureThawTime();
13202 }
13203
13208
13210 {
13211 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13212 }
13213
13215 {
13216 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13217 }
13218
13221 {
13223 }
13224
13226 {
13228 }
13229
13231 {
13233 }
13234
13237 {
13238 return null;
13239 }
13240
13243 {
13244 return false;
13245 }
13246
13248 {
13250 {
13253 if (!trg)
13254 {
13256 explosive = this;
13257 }
13258
13259 explosive.PairRemote(trg);
13261
13262 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13263 trg.SetPersistentPairID(persistentID);
13264 explosive.SetPersistentPairID(persistentID);
13265
13266 return true;
13267 }
13268 return false;
13269 }
13270
13273 {
13274 float ret = 1.0;
13277 ret *= GetHealth01();
13278
13279 return ret;
13280 }
13281
13282 #ifdef DEVELOPER
13283 override void SetDebugItem()
13284 {
13285 super.SetDebugItem();
13286 _itemBase = this;
13287 }
13288
13290 {
13291 string text = super.GetDebugText();
13292
13294 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13295
13296 return text;
13297 }
13298 #endif
13299
13301 {
13302 return true;
13303 }
13304
13306
13308
13310 {
13313 }
13314
13315
13323
13339}
13340
13342{
13344 if (entity)
13345 {
13346 bool is_item = entity.IsInherited(
ItemBase);
13347 if (is_item && full_quantity)
13348 {
13351 }
13352 }
13353 else
13354 {
13356 return NULL;
13357 }
13358 return entity;
13359}
13360
13362{
13363 if (item)
13364 {
13365 if (health > 0)
13366 item.SetHealth("", "", health);
13367
13368 if (item.CanHaveTemperature())
13369 {
13371 if (item.CanFreeze())
13372 item.SetFrozen(false);
13373 }
13374
13375 if (item.HasEnergyManager())
13376 {
13377 if (quantity >= 0)
13378 {
13379 item.GetCompEM().SetEnergy0To1(quantity);
13380 }
13381 else
13382 {
13384 }
13385 }
13386 else if (item.IsMagazine())
13387 {
13388 Magazine mag = Magazine.Cast(item);
13389 if (quantity >= 0)
13390 {
13391 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13392 }
13393 else
13394 {
13396 }
13397
13398 }
13399 else
13400 {
13401 if (quantity >= 0)
13402 {
13403 item.SetQuantityNormalized(quantity, false);
13404 }
13405 else
13406 {
13408 }
13409
13410 }
13411 }
13412}
13413
13414#ifdef DEVELOPER
13416#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
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.