8478{
8480 {
8481 return true;
8482 }
8483};
8484
8485
8486
8488{
8492
8494
8497
8498
8499
8500
8501
8510
8516
8521
8526
8547 protected bool m_IsResultOfSplit
8548
8550
8555
8556
8557
8559
8563
8564
8565
8567
8570
8571
8572
8578
8579
8587
8590
8591
8593
8594
8596
8597
8602
8603
8608
8609
8611
8612
8614 {
8619
8620 if (!
GetGame().IsDedicatedServer())
8621 {
8623 {
8625
8627 {
8629 }
8630 }
8631
8634 }
8635
8636 m_OldLocation = null;
8637
8639 {
8641 }
8642
8643 if (ConfigIsExisting("headSelectionsToHide"))
8644 {
8647 }
8648
8650 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8651 {
8653 }
8654
8656
8657 m_IsResultOfSplit = false;
8658
8660 }
8661
8663 {
8664 super.InitItemVariables();
8665
8671 m_Count = ConfigGetInt(
"count");
8672
8675
8680
8683
8688
8700
8704
8705
8708 if (ConfigIsExisting("canBeSplit"))
8709 {
8712 }
8713
8715 if (ConfigIsExisting("itemBehaviour"))
8717
8718
8721 RegisterNetSyncVariableInt("m_VarLiquidType");
8722 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8723
8724 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8725 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8726 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8727
8728 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8729 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8730 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8731 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8732
8733 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8734 RegisterNetSyncVariableBool("m_IsTakeable");
8735 RegisterNetSyncVariableBool("m_IsHologram");
8736
8739 {
8742 }
8743
8745
8747 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8749
8750 }
8751
8753 {
8755 }
8756
8758 {
8761 {
8766 }
8767 }
8768
8769 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8770 {
8772 {
8775 }
8776
8778 }
8779
8781 {
8787 }
8788
8790
8792 {
8794
8795 if (!action)
8796 {
8797 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8798 return;
8799 }
8800
8802 if (!ai)
8803 {
8805 return;
8806 }
8807
8809 if (!action_array)
8810 {
8811 action_array = new array<ActionBase_Basic>;
8813 }
8814 if (LogManager.IsActionLogEnable())
8815 {
8816 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8817 }
8818
8819 if (action_array.Find(action) != -1)
8820 {
8821 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8822 }
8823 else
8824 {
8825 action_array.Insert(action);
8826 }
8827 }
8828
8830 {
8832 ActionBase action = player.GetActionManager().GetAction(actionName);
8835
8836 if (action_array)
8837 {
8838 action_array.RemoveItem(action);
8839 }
8840 }
8841
8842
8843
8845 {
8846 ActionOverrideData overrideData = new ActionOverrideData();
8850
8852 if (!actionMap)
8853 {
8856 }
8857
8858 actionMap.Insert(this.
Type(), overrideData);
8859
8860 }
8861
8863
8865
8866
8868 {
8871
8874
8875 string config_to_search = "CfgVehicles";
8876 string muzzle_owner_config;
8877
8879 {
8880 if (IsInherited(Weapon))
8881 config_to_search = "CfgWeapons";
8882
8883 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8884
8885 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8886
8888
8889 if (config_OnFire_subclass_count > 0)
8890 {
8891 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8892
8893 for (int i = 0; i < config_OnFire_subclass_count; i++)
8894 {
8895 string particle_class = "";
8897 string config_OnFire_entry = config_OnFire_class + particle_class;
8898 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8899 WPOF_array.Insert(WPOF);
8900 }
8901
8902
8904 }
8905 }
8906
8908 {
8909 config_to_search = "CfgWeapons";
8910 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8911
8912 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8913
8915
8916 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8917 {
8918 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8919
8920 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8921 {
8922 string particle_class2 = "";
8924 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8925 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8926 WPOBE_array.Insert(WPOBE);
8927 }
8928
8929
8931 }
8932 }
8933 }
8934
8935
8937 {
8940
8942 {
8943 string config_to_search = "CfgVehicles";
8944
8945 if (IsInherited(Weapon))
8946 config_to_search = "CfgWeapons";
8947
8948 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8949 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8950
8951 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8952 {
8953
8955
8957 {
8959 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8961 return;
8962 }
8963
8966
8967
8968
8970 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8971
8972 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8973 {
8974 string particle_class = "";
8976 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8978
8979 if (entry_type == CT_CLASS)
8980 {
8981 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8982 WPOOH_array.Insert(WPOF);
8983 }
8984 }
8985
8986
8988 }
8989 }
8990 }
8991
8993 {
8995 }
8996
8998 {
9000 {
9002
9005
9008
9009 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9010 }
9011 }
9012
9014 {
9016 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9017
9019 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9020
9022 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9023
9025 {
9027 }
9028 }
9029
9031 {
9033 }
9034
9036 {
9039 else
9041
9043 {
9046 }
9047 else
9048 {
9051
9054 }
9055
9057 }
9058
9060 {
9062 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9063 }
9064
9066 {
9068 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9070 }
9071
9073 {
9075 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9076 }
9077
9079 {
9082
9083 OverheatingParticle OP = new OverheatingParticle();
9088
9090 }
9091
9093 {
9096
9097 return -1;
9098 }
9099
9101 {
9103 {
9106
9107 for (int i = count; i > 0; --i)
9108 {
9109 int id = i - 1;
9112
9115
9116 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9117 {
9118 if (p)
9119 {
9122 }
9123 }
9124 }
9125 }
9126 }
9127
9129 {
9131 {
9133 {
9134 int id = i - 1;
9136
9137 if (OP)
9138 {
9140
9141 if (p)
9142 {
9144 }
9145
9146 delete OP;
9147 }
9148 }
9149
9152 }
9153 }
9154
9157 {
9158 return 0.0;
9159 }
9160
9161
9163 {
9164 return 250;
9165 }
9166
9168 {
9169 return 0;
9170 }
9171
9174 {
9176 return true;
9177
9178 return false;
9179 }
9180
9183 {
9186
9188 {
9190 }
9191 else
9192 {
9193
9195 }
9196
9198 }
9199
9206 {
9207 return -1;
9208 }
9209
9210
9211
9212
9214 {
9216 {
9218 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9219
9220 if (r_index >= 0)
9221 {
9222 InventoryLocation r_il = new InventoryLocation;
9223 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9224
9225 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9228 {
9229 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9230 }
9232 {
9233 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9234 }
9235
9236 }
9237
9238 player.GetHumanInventory().ClearUserReservedLocation(this);
9239 }
9240
9243 }
9244
9245
9246
9247
9249 {
9250 return ItemBase.m_DebugActionsMask;
9251 }
9252
9254 {
9255 return ItemBase.m_DebugActionsMask & mask;
9256 }
9257
9259 {
9260 ItemBase.m_DebugActionsMask = mask;
9261 }
9262
9264 {
9265 ItemBase.m_DebugActionsMask |= mask;
9266 }
9267
9269 {
9270 ItemBase.m_DebugActionsMask &= ~mask;
9271 }
9272
9274 {
9276 {
9278 }
9279 else
9280 {
9282 }
9283 }
9284
9285
9287 {
9288 if (GetEconomyProfile())
9289 {
9290 float q_max = GetEconomyProfile().GetQuantityMax();
9291 if (q_max > 0)
9292 {
9293 float q_min = GetEconomyProfile().GetQuantityMin();
9294 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9295
9297 {
9298 ComponentEnergyManager comp = GetCompEM();
9300 {
9302 }
9303 }
9305 {
9307
9308 }
9309
9310 }
9311 }
9312 }
9313
9316 {
9317 EntityAI parent = GetHierarchyParent();
9318
9319 if (parent)
9320 {
9321 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9322 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9323 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9324 }
9325 }
9326
9329 {
9330 EntityAI parent = GetHierarchyParent();
9331
9332 if (parent)
9333 {
9334 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9335 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9336 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9337 }
9338 }
9339
9341 {
9342
9343
9344
9345
9347
9349 {
9350 if (ScriptInputUserData.CanStoreInputUserData())
9351 {
9352 ScriptInputUserData ctx = new ScriptInputUserData;
9358 ctx.
Write(use_stack_max);
9361
9363 {
9364 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9365 }
9366 }
9367 }
9368 else if (!
GetGame().IsMultiplayer())
9369 {
9371 }
9372 }
9373
9375 {
9377 }
9378
9380 {
9382 }
9383
9385 {
9387 }
9388
9390 {
9391
9392 return false;
9393 }
9394
9396 {
9397 return false;
9398 }
9399
9403 {
9404 return false;
9405 }
9406
9408 {
9409 return "";
9410 }
9411
9413
9415 {
9416 return false;
9417 }
9418
9420 {
9421 return true;
9422 }
9423
9424
9425
9427 {
9428 return true;
9429 }
9430
9432 {
9433 return true;
9434 }
9435
9437 {
9438 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9440 }
9441
9443 {
9445 }
9446
9448 {
9450 if (!is_being_placed)
9452 SetSynchDirty();
9453 }
9454
9455
9457
9459 {
9461 }
9462
9464 {
9466 }
9467
9469 {
9470 return 1;
9471 }
9472
9474 {
9475 return false;
9476 }
9477
9479 {
9481 SetSynchDirty();
9482 }
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9519 {
9520 super.OnMovedInsideCargo(container);
9521
9522 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9523 }
9524
9525 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9526 {
9527 super.EEItemLocationChanged(oldLoc,newLoc);
9528
9529 PlayerBase new_player = null;
9530 PlayerBase old_player = null;
9531
9532 if (newLoc.GetParent())
9533 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9534
9535 if (oldLoc.GetParent())
9536 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9537
9539 {
9540 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9541
9542 if (r_index >= 0)
9543 {
9544 InventoryLocation r_il = new InventoryLocation;
9545 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9546
9547 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9550 {
9551 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9552 }
9554 {
9555 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9556 }
9557
9558 }
9559 }
9560
9562 {
9563 if (new_player)
9564 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9565
9566 if (new_player == old_player)
9567 {
9568
9569 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9570 {
9572 {
9573 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9574 {
9575 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9576 }
9577 }
9578 else
9579 {
9580 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9581 }
9582 }
9583
9584 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9585 {
9586 int type = oldLoc.GetType();
9588 {
9589 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9590 }
9592 {
9593 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9594 }
9595 }
9596 if (!m_OldLocation)
9597 {
9598 m_OldLocation = new InventoryLocation;
9599 }
9600 m_OldLocation.Copy(oldLoc);
9601 }
9602 else
9603 {
9604 if (m_OldLocation)
9605 {
9606 m_OldLocation.Reset();
9607 }
9608 }
9609
9611 }
9612 else
9613 {
9614 if (new_player)
9615 {
9616 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9617 if (res_index >= 0)
9618 {
9619 InventoryLocation il = new InventoryLocation;
9620 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9622 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9625 {
9626 il.
GetParent().GetOnReleaseLock().Invoke(it);
9627 }
9629 {
9631 }
9632
9633 }
9634 }
9636 {
9637
9639 }
9640
9641 if (m_OldLocation)
9642 {
9643 m_OldLocation.Reset();
9644 }
9645 }
9646 }
9647
9648 override void EOnContact(IEntity other, Contact extra)
9649 {
9651 {
9652 int liquidType = -1;
9654 if (impactSpeed > 0.0)
9655 {
9657 #ifndef SERVER
9659 #else
9661 SetSynchDirty();
9662 #endif
9664 }
9665 }
9666
9667 #ifdef SERVER
9668 if (GetCompEM() && GetCompEM().IsPlugged())
9669 {
9670 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9671 GetCompEM().UnplugThis();
9672 }
9673 #endif
9674 }
9675
9677
9679 {
9681 }
9682
9684 {
9685
9686 }
9687
9689 {
9690 super.OnItemLocationChanged(old_owner, new_owner);
9691
9692 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9693 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9694
9695 if (!relatedPlayer && playerNew)
9696 relatedPlayer = playerNew;
9697
9698 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9699 {
9701 if (actionMgr)
9702 {
9703 ActionBase currentAction = actionMgr.GetRunningAction();
9704 if (currentAction)
9706 }
9707 }
9708
9709 Man ownerPlayerOld = null;
9710 Man ownerPlayerNew = null;
9711
9712 if (old_owner)
9713 {
9714 if (old_owner.
IsMan())
9715 {
9716 ownerPlayerOld = Man.Cast(old_owner);
9717 }
9718 else
9719 {
9720 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9721 }
9722 }
9723 else
9724 {
9726 {
9728
9729 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9730 {
9731 GetCompEM().UnplugThis();
9732 }
9733 }
9734 }
9735
9736 if (new_owner)
9737 {
9738 if (new_owner.
IsMan())
9739 {
9740 ownerPlayerNew = Man.Cast(new_owner);
9741 }
9742 else
9743 {
9744 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9745 }
9746 }
9747
9748 if (ownerPlayerOld != ownerPlayerNew)
9749 {
9750 if (ownerPlayerOld)
9751 {
9752 array<EntityAI> subItemsExit = new array<EntityAI>;
9754 for (int i = 0; i < subItemsExit.Count(); i++)
9755 {
9758 }
9759 }
9760
9761 if (ownerPlayerNew)
9762 {
9763 array<EntityAI> subItemsEnter = new array<EntityAI>;
9765 for (int j = 0; j < subItemsEnter.Count(); j++)
9766 {
9769 }
9770 }
9771 }
9772 else if (ownerPlayerNew != null)
9773 {
9774 PlayerBase nplayer;
9775 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9776 {
9777 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9779 for (int k = 0; k < subItemsUpdate.Count(); k++)
9780 {
9782 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9783 }
9784 }
9785 }
9786
9787 if (old_owner)
9788 old_owner.OnChildItemRemoved(this);
9789 if (new_owner)
9790 new_owner.OnChildItemReceived(this);
9791 }
9792
9793
9795 {
9796 super.EEDelete(parent);
9797 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9798 if (player)
9799 {
9801
9802 if (player.IsAlive())
9803 {
9804 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9805 if (r_index >= 0)
9806 {
9807 InventoryLocation r_il = new InventoryLocation;
9808 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9809
9810 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9813 {
9814 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9815 }
9817 {
9818 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9819 }
9820
9821 }
9822
9823 player.RemoveQuickBarEntityShortcut(this);
9824 }
9825 }
9826 }
9827
9829 {
9830 super.EEKilled(killer);
9831
9834 {
9835 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9836 {
9837 if (IsMagazine())
9838 {
9839 if (Magazine.Cast(this).GetAmmoCount() > 0)
9840 {
9842 }
9843 }
9844 else
9845 {
9847 }
9848 }
9849 }
9850 }
9851
9853 {
9854 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9855
9856 super.OnWasAttached(parent, slot_id);
9857
9860
9862 }
9863
9865 {
9866 super.OnWasDetached(parent, slot_id);
9867
9870 }
9871
9873 {
9874 int idx;
9877
9878 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9879 if (inventory_slots.Count() < 1)
9880 {
9881 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9882 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9883 }
9884 else
9885 {
9886 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9887 }
9888
9889 idx = inventory_slots.Find(slot);
9890 if (idx < 0)
9891 return "";
9892
9893 return attach_types.Get(idx);
9894 }
9895
9897 {
9898 int idx = -1;
9899 string slot;
9900
9903
9904 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9905 if (inventory_slots.Count() < 1)
9906 {
9907 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9908 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9909 }
9910 else
9911 {
9912 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9913 if (detach_types.Count() < 1)
9914 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9915 }
9916
9917 for (int i = 0; i < inventory_slots.Count(); i++)
9918 {
9919 slot = inventory_slots.Get(i);
9920 }
9921
9922 if (slot != "")
9923 {
9924 if (detach_types.Count() == 1)
9925 idx = 0;
9926 else
9927 idx = inventory_slots.Find(slot);
9928 }
9929 if (idx < 0)
9930 return "";
9931
9932 return detach_types.Get(idx);
9933 }
9934
9936 {
9937
9939
9940
9941 float min_time = 1;
9942 float max_time = 3;
9943 float delay = Math.RandomFloat(min_time, max_time);
9944
9945 explode_timer.Run(delay, this, "DoAmmoExplosion");
9946 }
9947
9949 {
9950 Magazine magazine = Magazine.Cast(this);
9951 int pop_sounds_count = 6;
9952 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9953
9954
9955 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9956 string sound_name = pop_sounds[ sound_idx ];
9958
9959
9960 magazine.ServerAddAmmoCount(-1);
9961
9962
9963 float min_temp_to_explode = 100;
9964
9965 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9966 {
9968 }
9969 }
9970
9971
9972 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9973 {
9974 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9975
9976 const int CHANCE_DAMAGE_CARGO = 4;
9977 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9978 const int CHANCE_DAMAGE_NOTHING = 2;
9979
9981 {
9982 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9983 int chances;
9984 int rnd;
9985
9986 if (GetInventory().GetCargo())
9987 {
9988 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9989 rnd = Math.RandomInt(0,chances);
9990
9991 if (rnd < CHANCE_DAMAGE_CARGO)
9992 {
9994 }
9995 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9996 {
9998 }
9999 }
10000 else
10001 {
10002 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10003 rnd = Math.RandomInt(0,chances);
10004
10005 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10006 {
10008 }
10009 }
10010 }
10011 }
10012
10014 {
10015 if (GetInventory().GetCargo())
10016 {
10017 int item_count = GetInventory().GetCargo().GetItemCount();
10018 if (item_count > 0)
10019 {
10020 int random_pick = Math.RandomInt(0, item_count);
10022 if (!item.IsExplosive())
10023 {
10024 item.AddHealth("","",damage);
10025 return true;
10026 }
10027 }
10028 }
10029 return false;
10030 }
10031
10033 {
10034 int attachment_count = GetInventory().AttachmentCount();
10035 if (attachment_count > 0)
10036 {
10037 int random_pick = Math.RandomInt(0, attachment_count);
10038 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10039 if (!attachment.IsExplosive())
10040 {
10041 attachment.AddHealth("","",damage);
10042 return true;
10043 }
10044 }
10045 return false;
10046 }
10047
10049 {
10051 }
10052
10054 {
10056 return GetInventory().CanRemoveEntity();
10057
10058 return false;
10059 }
10060
10062 {
10064 return;
10065
10067 {
10068 if (ScriptInputUserData.CanStoreInputUserData())
10069 {
10070 ScriptInputUserData ctx = new ScriptInputUserData;
10075 ctx.
Write(destination_entity);
10077 ctx.
Write(slot_id);
10079 }
10080 }
10081 else if (!
GetGame().IsMultiplayer())
10082 {
10084 }
10085 }
10086
10088 {
10090 return;
10091
10092 float split_quantity_new;
10096 InventoryLocation loc = new InventoryLocation;
10097
10098 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10099 {
10101 split_quantity_new = stack_max;
10102 else
10104
10105 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10106 if (new_item)
10107 {
10108 new_item.SetResultOfSplit(true);
10109 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10111 new_item.SetQuantity(split_quantity_new);
10112 }
10113 }
10114 else if (destination_entity && slot_id == -1)
10115 {
10116 if (quantity > stack_max)
10117 split_quantity_new = stack_max;
10118 else
10119 split_quantity_new = quantity;
10120
10122 {
10125 }
10126
10127 if (new_item)
10128 {
10129 new_item.SetResultOfSplit(true);
10130 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10132 new_item.SetQuantity(split_quantity_new);
10133 }
10134 }
10135 else
10136 {
10137 if (stack_max != 0)
10138 {
10140 {
10142 }
10143
10144 if (split_quantity_new == 0)
10145 {
10146 if (!
GetGame().IsMultiplayer())
10147 player.PhysicalPredictiveDropItem(this);
10148 else
10149 player.ServerDropEntity(this);
10150 return;
10151 }
10152
10154
10155 if (new_item)
10156 {
10157 new_item.SetResultOfSplit(true);
10158 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10160 new_item.SetQuantity(stack_max);
10161 new_item.PlaceOnSurface();
10162 }
10163 }
10164 }
10165 }
10166
10168 {
10170 return;
10171
10172 float split_quantity_new;
10176 InventoryLocation loc = new InventoryLocation;
10177
10178 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10179 {
10181 split_quantity_new = stack_max;
10182 else
10184
10185 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10186 if (new_item)
10187 {
10188 new_item.SetResultOfSplit(true);
10189 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10191 new_item.SetQuantity(split_quantity_new);
10192 }
10193 }
10194 else if (destination_entity && slot_id == -1)
10195 {
10196 if (quantity > stack_max)
10197 split_quantity_new = stack_max;
10198 else
10199 split_quantity_new = quantity;
10200
10202 {
10205 }
10206
10207 if (new_item)
10208 {
10209 new_item.SetResultOfSplit(true);
10210 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10212 new_item.SetQuantity(split_quantity_new);
10213 }
10214 }
10215 else
10216 {
10217 if (stack_max != 0)
10218 {
10220 {
10222 }
10223
10225
10226 if (new_item)
10227 {
10228 new_item.SetResultOfSplit(true);
10229 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10231 new_item.SetQuantity(stack_max);
10232 new_item.PlaceOnSurface();
10233 }
10234 }
10235 }
10236 }
10237
10239 {
10241 return;
10242
10244 {
10245 if (ScriptInputUserData.CanStoreInputUserData())
10246 {
10247 ScriptInputUserData ctx = new ScriptInputUserData;
10252 dst.WriteToContext(ctx);
10254 }
10255 }
10256 else if (!
GetGame().IsMultiplayer())
10257 {
10259 }
10260 }
10261
10263 {
10265 return;
10266
10268 {
10269 if (ScriptInputUserData.CanStoreInputUserData())
10270 {
10271 ScriptInputUserData ctx = new ScriptInputUserData;
10276 ctx.
Write(destination_entity);
10282 }
10283 }
10284 else if (!
GetGame().IsMultiplayer())
10285 {
10287 }
10288 }
10289
10291 {
10293 }
10294
10296 {
10298 return this;
10299
10301 float split_quantity_new;
10303 if (dst.IsValid())
10304 {
10305 int slot_id = dst.GetSlot();
10307
10308 if (quantity > stack_max)
10309 split_quantity_new = stack_max;
10310 else
10311 split_quantity_new = quantity;
10312
10314
10315 if (new_item)
10316 {
10317 new_item.SetResultOfSplit(true);
10318 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10321 }
10322
10323 return new_item;
10324 }
10325
10326 return null;
10327 }
10328
10330 {
10332 return;
10333
10335 float split_quantity_new;
10337 if (destination_entity)
10338 {
10340 if (quantity > stackable)
10341 split_quantity_new = stackable;
10342 else
10343 split_quantity_new = quantity;
10344
10345 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10346 if (new_item)
10347 {
10348 new_item.SetResultOfSplit(true);
10349 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10351 new_item.SetQuantity(split_quantity_new);
10352 }
10353 }
10354 }
10355
10357 {
10359 return;
10360
10362 {
10363 if (ScriptInputUserData.CanStoreInputUserData())
10364 {
10365 ScriptInputUserData ctx = new ScriptInputUserData;
10370 ItemBase destination_entity =
this;
10371 ctx.
Write(destination_entity);
10375 }
10376 }
10377 else if (!
GetGame().IsMultiplayer())
10378 {
10380 }
10381 }
10382
10384 {
10386 return;
10387
10389 float split_quantity_new;
10391 if (player)
10392 {
10394 if (quantity > stackable)
10395 split_quantity_new = stackable;
10396 else
10397 split_quantity_new = quantity;
10398
10399 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10400 new_item =
ItemBase.Cast(in_hands);
10401 if (new_item)
10402 {
10403 new_item.SetResultOfSplit(true);
10404 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10406 new_item.SetQuantity(split_quantity_new);
10407 }
10408 }
10409 }
10410
10412 {
10414 return;
10415
10417 float split_quantity_new = Math.Floor(quantity * 0.5);
10418
10420
10421 if (new_item)
10422 {
10423 if (new_item.GetQuantityMax() < split_quantity_new)
10424 {
10425 split_quantity_new = new_item.GetQuantityMax();
10426 }
10427
10428 new_item.SetResultOfSplit(true);
10429 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10430
10432 {
10435 }
10436 else
10437 {
10440 }
10441 }
10442 }
10443
10445 {
10447 return;
10448
10450 float split_quantity_new = Math.Floor(quantity / 2);
10451
10452 InventoryLocation invloc = new InventoryLocation;
10454
10456 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10457
10458 if (new_item)
10459 {
10460 if (new_item.GetQuantityMax() < split_quantity_new)
10461 {
10462 split_quantity_new = new_item.GetQuantityMax();
10463 }
10465 {
10468 }
10469 else
10470 {
10473 }
10474 }
10475 }
10476
10479 {
10480 SetWeightDirty();
10482
10483 if (parent)
10484 parent.OnAttachmentQuantityChangedEx(this, delta);
10485
10487 {
10489 {
10491 }
10493 {
10494 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10496 }
10497 }
10498
10499 }
10500
10503 {
10504
10505 }
10506
10509 {
10511 }
10512
10514 {
10515 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10516
10518 {
10519 if (newLevel == GameConstants.STATE_RUINED)
10520 {
10522 EntityAI parent = GetHierarchyParent();
10523 if (parent && parent.IsFireplace())
10524 {
10525 CargoBase cargo = GetInventory().GetCargo();
10526 if (cargo)
10527 {
10529 {
10531 }
10532 }
10533 }
10534 }
10535
10537 {
10538
10540 return;
10541 }
10542
10543 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10544 {
10546 }
10547 }
10548 }
10549
10550
10552 {
10553 super.OnRightClick();
10554
10556 {
10558 {
10559 if (ScriptInputUserData.CanStoreInputUserData())
10560 {
10561 vector m4[4];
10563
10564 EntityAI root = GetHierarchyRoot();
10565
10566 InventoryLocation dst = new InventoryLocation;
10568 {
10569 if (root)
10570 {
10571 root.GetTransform(m4);
10573 }
10574 else
10575 GetInventory().GetCurrentInventoryLocation(dst);
10576 }
10577 else
10578 {
10580
10581
10582 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10583 {
10584 if (root)
10585 {
10586 root.GetTransform(m4);
10588 }
10589 else
10590 GetInventory().GetCurrentInventoryLocation(dst);
10591 }
10592 else
10593 {
10594 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10595 }
10596 }
10597
10598 ScriptInputUserData ctx = new ScriptInputUserData;
10606 }
10607 }
10608 else if (!
GetGame().IsMultiplayer())
10609 {
10611 }
10612 }
10613 }
10614
10615 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10616 {
10617
10618 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10619 return false;
10620
10621 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10622 return false;
10623
10624
10626 return false;
10627
10628
10629 Magazine mag = Magazine.Cast(this);
10630 if (mag)
10631 {
10632 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10633 return false;
10634
10635 if (stack_max_limit)
10636 {
10637 Magazine other_mag = Magazine.Cast(other_item);
10638 if (other_item)
10639 {
10640 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10641 return false;
10642 }
10643
10644 }
10645 }
10646 else
10647 {
10648
10650 return false;
10651
10653 return false;
10654 }
10655
10656 PlayerBase player = null;
10657 if (CastTo(player, GetHierarchyRootPlayer()))
10658 {
10659 if (player.GetInventory().HasAttachment(this))
10660 return false;
10661
10662 if (player.IsItemsToDelete())
10663 return false;
10664 }
10665
10666 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10667 return false;
10668
10669 int slotID;
10671 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10672 return false;
10673
10674 return true;
10675 }
10676
10678 {
10680 }
10681
10683 {
10684 return m_IsResultOfSplit;
10685 }
10686
10688 {
10689 m_IsResultOfSplit = value;
10690 }
10691
10693 {
10695 }
10696
10698 {
10699 float other_item_quantity = other_item.GetQuantity();
10700 float this_free_space;
10701
10703
10705
10706 if (other_item_quantity > this_free_space)
10707 {
10708 return this_free_space;
10709 }
10710 else
10711 {
10712 return other_item_quantity;
10713 }
10714 }
10715
10717 {
10719 }
10720
10722 {
10724 return;
10725
10726 if (!IsMagazine() && other_item)
10727 {
10729 if (quantity_used != 0)
10730 {
10731 float hp1 = GetHealth01("","");
10732 float hp2 = other_item.GetHealth01("","");
10733 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10734 hpResult = hpResult / (
GetQuantity() + quantity_used);
10735
10736 hpResult *= GetMaxHealth();
10737 Math.Round(hpResult);
10738 SetHealth("", "Health", hpResult);
10739
10741 other_item.AddQuantity(-quantity_used);
10742 }
10743 }
10745 }
10746
10748 {
10749 #ifdef SERVER
10750 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10751 GetHierarchyParent().IncreaseLifetimeUp();
10752 #endif
10753 };
10754
10756 {
10757 PlayerBase p = PlayerBase.Cast(player);
10758
10759 array<int> recipesIds = p.m_Recipes;
10760 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10761 if (moduleRecipesManager)
10762 {
10763 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10764 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10765 }
10766
10767 for (int i = 0;i < recipesIds.Count(); i++)
10768 {
10769 int key = recipesIds.Get(i);
10770 string recipeName = moduleRecipesManager.GetRecipeName(key);
10772 }
10773 }
10774
10775
10776 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10777 {
10778 super.GetDebugActions(outputList);
10779
10780
10785
10786
10790
10794
10795
10798
10799
10801 {
10804 }
10805
10807
10810
10814 }
10815
10816
10817
10818
10820 {
10821 super.OnAction(action_id, player, ctx);
10822 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10823 {
10824 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10825 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10826 PlayerBase p = PlayerBase.Cast(player);
10827 if (
EActions.RECIPES_RANGE_START < 1000)
10828 {
10829 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10830 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10831 }
10832 }
10833 #ifndef SERVER
10834 else if (action_id ==
EActions.WATCH_PLAYER)
10835 {
10836 PluginDeveloper.SetDeveloperItemClientEx(player);
10837 }
10838 #endif
10840 {
10841 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10842 {
10843 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10844 OnDebugButtonPressServer(id + 1);
10845 }
10846
10847 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10848 {
10849 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10851 }
10852
10853 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10854 {
10855 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10857 }
10858
10859 else if (action_id ==
EActions.ADD_QUANTITY)
10860 {
10861 if (IsMagazine())
10862 {
10863 Magazine mag = Magazine.Cast(this);
10864 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10865 }
10866 else
10867 {
10869 }
10870
10871 if (m_EM)
10872 {
10873 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10874 }
10875
10876 }
10877
10878 else if (action_id ==
EActions.REMOVE_QUANTITY)
10879 {
10880 if (IsMagazine())
10881 {
10882 Magazine mag2 = Magazine.Cast(this);
10883 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10884 }
10885 else
10886 {
10888 }
10889 if (m_EM)
10890 {
10891 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10892 }
10893
10894 }
10895
10896 else if (action_id ==
EActions.SET_QUANTITY_0)
10897 {
10899
10900 if (m_EM)
10901 {
10902 m_EM.SetEnergy(0);
10903 }
10904 }
10905
10906 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10907 {
10909
10910 if (m_EM)
10911 {
10912 m_EM.SetEnergy(m_EM.GetEnergyMax());
10913 }
10914 }
10915
10916 else if (action_id ==
EActions.ADD_HEALTH)
10917 {
10918 AddHealth("","",GetMaxHealth("","Health")/5);
10919 }
10920 else if (action_id ==
EActions.REMOVE_HEALTH)
10921 {
10922 AddHealth("","",-GetMaxHealth("","Health")/5);
10923 }
10924 else if (action_id ==
EActions.DESTROY_HEALTH)
10925 {
10926 SetHealth01("","",0);
10927 }
10928 else if (action_id ==
EActions.WATCH_ITEM)
10929 {
10931 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10932 #ifdef DEVELOPER
10933 SetDebugDeveloper_item(this);
10934 #endif
10935 }
10936
10937 else if (action_id ==
EActions.ADD_TEMPERATURE)
10938 {
10939 AddTemperature(20);
10940
10941 }
10942
10943 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10944 {
10945 AddTemperature(-20);
10946
10947 }
10948
10949 else if (action_id ==
EActions.FLIP_FROZEN)
10950 {
10951 SetFrozen(!GetIsFrozen());
10952
10953 }
10954
10955 else if (action_id ==
EActions.ADD_WETNESS)
10956 {
10958
10959 }
10960
10961 else if (action_id ==
EActions.REMOVE_WETNESS)
10962 {
10964
10965 }
10966
10967 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10968 {
10971
10972
10973 }
10974
10975 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10976 {
10979 }
10980
10981 else if (action_id ==
EActions.MAKE_SPECIAL)
10982 {
10983 auto debugParams = DebugSpawnParams.WithPlayer(player);
10984 OnDebugSpawnEx(debugParams);
10985 }
10986
10987 else if (action_id ==
EActions.DELETE)
10988 {
10989 Delete();
10990 }
10991
10992 }
10993
10994
10995 return false;
10996 }
10997
10998
10999
11000
11004
11007
11008
11009
11011 {
11012 return false;
11013 }
11014
11015
11017 {
11018 return true;
11019 }
11020
11021
11023 {
11024 return true;
11025 }
11026
11027
11028
11030 {
11031 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11033 }
11034
11037 {
11038 return null;
11039 }
11040
11042 {
11043 return false;
11044 }
11045
11047 {
11048 return false;
11049 }
11050
11054
11055
11057 {
11058 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11059 return module_repairing.CanRepair(this, item_repair_kit);
11060 }
11061
11062
11063 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11064 {
11065 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11066 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11067 }
11068
11069
11071 {
11072
11073
11074
11075
11076
11077
11078
11079
11080 return 1;
11081 }
11082
11083
11084
11086 {
11088 }
11089
11090
11091
11093 {
11095 }
11096
11097
11106 {
11107 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11108
11109 if (player)
11110 {
11111 player.MessageStatus(text);
11112 }
11113 }
11114
11115
11124 {
11125 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11126
11127 if (player)
11128 {
11129 player.MessageAction(text);
11130 }
11131 }
11132
11133
11142 {
11143 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11144
11145 if (player)
11146 {
11147 player.MessageFriendly(text);
11148 }
11149 }
11150
11151
11160 {
11161 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11162
11163 if (player)
11164 {
11165 player.MessageImportant(text);
11166 }
11167 }
11168
11170 {
11171 return true;
11172 }
11173
11174
11175 override bool KindOf(
string tag)
11176 {
11177 bool found = false;
11178 string item_name = this.
GetType();
11181
11182 int array_size = item_tag_array.Count();
11183 for (int i = 0; i < array_size; i++)
11184 {
11185 if (item_tag_array.Get(i) == tag)
11186 {
11187 found = true;
11188 break;
11189 }
11190 }
11191 return found;
11192 }
11193
11194
11196 {
11197
11198 super.OnRPC(sender, rpc_type,ctx);
11199
11200
11201 switch (rpc_type)
11202 {
11203 #ifndef SERVER
11204 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11205 Param2<bool, string> p = new Param2<bool, string>(false, "");
11206
11208 return;
11209
11210 bool play = p.param1;
11211 string soundSet = p.param2;
11212
11213 if (play)
11214 {
11216 {
11218 {
11220 }
11221 }
11222 else
11223 {
11225 }
11226 }
11227 else
11228 {
11230 }
11231
11232 break;
11233 #endif
11234
11235 }
11236
11238 {
11240 }
11241 }
11242
11243
11244
11245
11247 {
11248 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11249 return plugin.GetID(
name);
11250 }
11251
11253 {
11254 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11255 return plugin.GetName(id);
11256 }
11257
11260 {
11261
11262
11263 int varFlags;
11264 if (!ctx.
Read(varFlags))
11265 return;
11266
11267 if (varFlags & ItemVariableFlags.FLOAT)
11268 {
11270 }
11271 }
11272
11274 {
11275
11276 super.SerializeNumericalVars(floats_out);
11277
11278
11279
11281 {
11283 }
11284
11286 {
11288 }
11289
11291 {
11293 }
11294
11296 {
11301 }
11302
11304 {
11306 }
11307 }
11308
11310 {
11311
11312 super.DeSerializeNumericalVars(floats);
11313
11314
11315 int index = 0;
11316 int mask = Math.Round(floats.Get(index));
11317
11318 index++;
11319
11321 {
11323 {
11325 }
11326 else
11327 {
11328 float quantity = floats.Get(index);
11329 SetQuantity(quantity,
true,
false,
false,
false);
11330 }
11331 index++;
11332 }
11333
11335 {
11336 float wet = floats.Get(index);
11338 index++;
11339 }
11340
11342 {
11343 int liquidtype = Math.Round(floats.Get(index));
11345 index++;
11346 }
11347
11349 {
11351 index++;
11353 index++;
11355 index++;
11357 index++;
11358 }
11359
11361 {
11362 int cleanness = Math.Round(floats.Get(index));
11364 index++;
11365 }
11366 }
11367
11369 {
11370 super.WriteVarsToCTX(ctx);
11371
11372
11374 {
11376 }
11377
11379 {
11381 }
11382
11384 {
11386 }
11387
11389 {
11390 int r,g,b,a;
11396 }
11397
11399 {
11401 }
11402 }
11403
11405 {
11406 if (!super.ReadVarsFromCTX(ctx,version))
11407 return false;
11408
11409 int intValue;
11410 float value;
11411
11412 if (version < 140)
11413 {
11414 if (!ctx.
Read(intValue))
11415 return false;
11416
11417 m_VariablesMask = intValue;
11418 }
11419
11421 {
11422 if (!ctx.
Read(value))
11423 return false;
11424
11426 {
11428 }
11429 else
11430 {
11432 }
11433 }
11434
11435 if (version < 140)
11436 {
11438 {
11439 if (!ctx.
Read(value))
11440 return false;
11441 SetTemperatureDirect(value);
11442 }
11443 }
11444
11446 {
11447 if (!ctx.
Read(value))
11448 return false;
11450 }
11451
11453 {
11454 if (!ctx.
Read(intValue))
11455 return false;
11457 }
11458
11460 {
11461 int r,g,b,a;
11463 return false;
11465 return false;
11467 return false;
11469 return false;
11470
11472 }
11473
11475 {
11476 if (!ctx.
Read(intValue))
11477 return false;
11479 }
11480
11481 if (version >= 138 && version < 140)
11482 {
11484 {
11485 if (!ctx.
Read(intValue))
11486 return false;
11487 SetFrozen(intValue);
11488 }
11489 }
11490
11491 return true;
11492 }
11493
11494
11496 {
11499 {
11501 }
11502
11503 if (!super.OnStoreLoad(ctx, version))
11504 {
11506 return false;
11507 }
11508
11509 if (version >= 114)
11510 {
11511 bool hasQuickBarIndexSaved;
11512
11513 if (!ctx.
Read(hasQuickBarIndexSaved))
11514 {
11516 return false;
11517 }
11518
11519 if (hasQuickBarIndexSaved)
11520 {
11521 int itmQBIndex;
11522
11523
11524 if (!ctx.
Read(itmQBIndex))
11525 {
11527 return false;
11528 }
11529
11530 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11531 if (itmQBIndex != -1 && parentPlayer)
11532 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11533 }
11534 }
11535 else
11536 {
11537
11538 PlayerBase player;
11539 int itemQBIndex;
11540 if (version ==
int.
MAX)
11541 {
11542 if (!ctx.
Read(itemQBIndex))
11543 {
11545 return false;
11546 }
11547 }
11548 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11549 {
11550
11551 if (!ctx.
Read(itemQBIndex))
11552 {
11554 return false;
11555 }
11556 if (itemQBIndex != -1 && player)
11557 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11558 }
11559 }
11560
11561 if (version < 140)
11562 {
11563
11564 if (!LoadVariables(ctx, version))
11565 {
11567 return false;
11568 }
11569 }
11570
11571
11573 {
11575 return false;
11576 }
11577 if (version >= 132)
11578 {
11580 if (raib)
11581 {
11583 {
11585 return false;
11586 }
11587 }
11588 }
11589
11591 return true;
11592 }
11593
11594
11595
11597 {
11598 super.OnStoreSave(ctx);
11599
11600 PlayerBase player;
11601 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11602 {
11604
11605 int itemQBIndex = -1;
11606 itemQBIndex = player.FindQuickBarEntityIndex(this);
11607 ctx.
Write(itemQBIndex);
11608 }
11609 else
11610 {
11612 }
11613
11615
11617 if (raib)
11618 {
11620 }
11621 }
11622
11623
11625 {
11626 super.AfterStoreLoad();
11627
11629 {
11631 }
11632
11634 {
11637 }
11638 }
11639
11641 {
11642 super.EEOnAfterLoad();
11643
11645 {
11647 }
11648
11651 }
11652
11654 {
11655 return false;
11656 }
11657
11658
11659
11661 {
11663 {
11664 #ifdef PLATFORM_CONSOLE
11665
11667 {
11669 if (menu)
11670 {
11672 }
11673 }
11674 #endif
11675 }
11676
11678 {
11681 }
11682
11684 {
11685 SetWeightDirty();
11687 }
11689 {
11692 }
11693
11695 {
11698 }
11700 {
11703 }
11704
11705 super.OnVariablesSynchronized();
11706 }
11707
11708
11709
11711 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11712 {
11713 if (!IsServerCheck(allow_client))
11714 return false;
11715
11717 return false;
11718
11721
11722 if (value <= (min + 0.001))
11723 value = min;
11724
11725 if (value == min)
11726 {
11727 if (destroy_config)
11728 {
11729 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11730 if (dstr)
11731 {
11733 this.Delete();
11734 return true;
11735 }
11736 }
11737 else if (destroy_forced)
11738 {
11740 this.Delete();
11741 return true;
11742 }
11743
11745 }
11746
11749
11751 {
11753
11754 if (delta)
11756 }
11757
11759
11760 return false;
11761 }
11762
11763
11765 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11766 {
11768 }
11769
11771 {
11774 }
11775
11777 {
11780 }
11781
11784 {
11785 float value_clamped = Math.Clamp(value, 0, 1);
11787 SetQuantity(result, destroy_config, destroy_forced);
11788 }
11789
11790
11793 {
11795 }
11796
11798 {
11800 }
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11812 {
11813 int slot = -1;
11814 if (GetInventory())
11815 {
11816 InventoryLocation il = new InventoryLocation;
11817 GetInventory().GetCurrentInventoryLocation(il);
11819 }
11820
11822 }
11823
11825 {
11826 float quantity_max = 0;
11827
11829 {
11830 if (attSlotID != -1)
11831 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11832
11833 if (quantity_max <= 0)
11835 }
11836
11837 if (quantity_max <= 0)
11839
11840 return quantity_max;
11841 }
11842
11844 {
11846 }
11847
11849 {
11851 }
11852
11853
11855 {
11857 }
11858
11860 {
11862 }
11863
11865 {
11867 }
11868
11869
11871 {
11872
11873 float weightEx = GetWeightEx();
11874 float special = GetInventoryAndCargoWeight();
11875 return weightEx - special;
11876 }
11877
11878
11880 {
11882 }
11883
11885 {
11887 {
11888 #ifdef DEVELOPER
11889 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11890 {
11891 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11893 }
11894 #endif
11895
11896 return GetQuantity() * GetConfigWeightModified();
11897 }
11898 else if (HasEnergyManager())
11899 {
11900 #ifdef DEVELOPER
11901 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11902 {
11903 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11904 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11905 }
11906 #endif
11907 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11908 }
11909 else
11910 {
11911 #ifdef DEVELOPER
11912 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11913 {
11914 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11915 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11916 }
11917 #endif
11918 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11919 }
11920 }
11921
11924 {
11925 int item_count = 0;
11927
11928 if (GetInventory().GetCargo() != NULL)
11929 {
11930 item_count = GetInventory().GetCargo().GetItemCount();
11931 }
11932
11933 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11934 {
11935 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11936 if (item)
11937 item_count += item.GetNumberOfItems();
11938 }
11939 return item_count;
11940 }
11941
11944 {
11945 float weight = 0;
11946 float wetness = 1;
11947 if (include_wetness)
11950 {
11951 weight = wetness * m_ConfigWeight;
11952 }
11954 {
11955 weight = 1;
11956 }
11957 return weight;
11958 }
11959
11960
11961
11963 {
11964 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11965 {
11966 GameInventory inv = GetInventory();
11967 array<EntityAI> items = new array<EntityAI>;
11969 for (int i = 0; i < items.Count(); i++)
11970 {
11972 if (item)
11973 {
11975 }
11976 }
11977 }
11978 }
11979
11980
11981
11982
11984 {
11985 float energy = 0;
11986 if (HasEnergyManager())
11987 {
11988 energy = GetCompEM().GetEnergy();
11989 }
11990 return energy;
11991 }
11992
11993
11995 {
11996 super.OnEnergyConsumed();
11997
11999 }
12000
12002 {
12003 super.OnEnergyAdded();
12004
12006 }
12007
12008
12010 {
12011 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12012 {
12014 {
12015 float energy_0to1 = GetCompEM().GetEnergy0To1();
12017 }
12018 }
12019 }
12020
12021
12023 {
12024 return ConfigGetFloat("heatIsolation");
12025 }
12026
12028 {
12030 }
12031
12033 {
12034 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12035 if (
GetGame().ConfigIsExisting(paramPath))
12037
12038 return 0.0;
12039 }
12040
12042 {
12043 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12044 if (
GetGame().ConfigIsExisting(paramPath))
12046
12047 return 0.0;
12048 }
12049
12050 override void SetWet(
float value,
bool allow_client =
false)
12051 {
12052 if (!IsServerCheck(allow_client))
12053 return;
12054
12057
12059
12060 m_VarWet = Math.Clamp(value, min, max);
12061
12063 {
12066 }
12067 }
12068
12069 override void AddWet(
float value)
12070 {
12072 }
12073
12075 {
12077 }
12078
12080 {
12082 }
12083
12085 {
12087 }
12088
12090 {
12092 }
12093
12095 {
12097 }
12098
12099 override void OnWetChanged(
float newVal,
float oldVal)
12100 {
12103 if (newLevel != oldLevel)
12104 {
12106 }
12107 }
12108
12110 {
12111 SetWeightDirty();
12112 }
12113
12115 {
12116 return GetWetLevelInternal(
m_VarWet);
12117 }
12118
12119
12120
12122 {
12124 }
12125
12127 {
12129 }
12130
12132 {
12134 }
12135
12137 {
12139 }
12140
12141
12142
12144 {
12145 if (ConfigIsExisting("itemModelLength"))
12146 {
12147 return ConfigGetFloat("itemModelLength");
12148 }
12149 return 0;
12150 }
12151
12153 {
12154 if (ConfigIsExisting("itemAttachOffset"))
12155 {
12156 return ConfigGetFloat("itemAttachOffset");
12157 }
12158 return 0;
12159 }
12160
12161 override void SetCleanness(
int value,
bool allow_client =
false)
12162 {
12163 if (!IsServerCheck(allow_client))
12164 return;
12165
12167
12169
12172 }
12173
12175 {
12177 }
12178
12180 {
12181 return true;
12182 }
12183
12184
12185
12186
12188 {
12190 }
12191
12193 {
12195 }
12196
12197
12198
12199
12200 override void SetColor(
int r,
int g,
int b,
int a)
12201 {
12207 }
12209 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12210 {
12215 }
12216
12218 {
12220 }
12221
12224 {
12225 int r,g,b,a;
12227 r = r/255;
12228 g = g/255;
12229 b = b/255;
12230 a = a/255;
12231 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12232 }
12233
12234
12235
12236 override void SetLiquidType(
int value,
bool allow_client =
false)
12237 {
12238 if (!IsServerCheck(allow_client))
12239 return;
12240
12245 }
12246
12248 {
12249 return ConfigGetInt("varLiquidTypeInit");
12250 }
12251
12253 {
12255 }
12256
12258 {
12260 SetFrozen(false);
12261 }
12262
12265 {
12266 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12267 }
12268
12269
12272 {
12273 PlayerBase nplayer;
12274 if (PlayerBase.CastTo(nplayer, player))
12275 {
12277
12278 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12279 }
12280 }
12281
12282
12285 {
12286 PlayerBase nplayer;
12287 if (PlayerBase.CastTo(nplayer,player))
12288 {
12289
12290 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12291
12292 }
12293
12294
12295 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12296
12297
12298 if (HasEnergyManager())
12299 {
12300 GetCompEM().UpdatePlugState();
12301 }
12302 }
12303
12304
12306 {
12307 super.OnPlacementStarted(player);
12308
12310 }
12311
12312 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12313 {
12315 {
12316 m_AdminLog.OnPlacementComplete(player,
this);
12317 }
12318
12319 super.OnPlacementComplete(player, position, orientation);
12320 }
12321
12322
12323
12324
12325
12327 {
12329 {
12330 return true;
12331 }
12332 else
12333 {
12334 return false;
12335 }
12336 }
12337
12338
12340 {
12342 {
12344 }
12345 }
12346
12347
12349 {
12351 }
12352
12354 {
12356 }
12357
12358 override void InsertAgent(
int agent,
float count = 1)
12359 {
12360 if (count < 1)
12361 return;
12362
12364 }
12365
12368 {
12370 }
12371
12372
12374 {
12376 }
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12420 {
12422 return false;
12423 return true;
12424 }
12425
12427 {
12428
12430 }
12431
12432
12435 {
12436 super.CheckForRoofLimited(timeTresholdMS);
12437
12439 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12440 {
12441 m_PreviousRoofTestTime = time;
12442 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12443 }
12444 }
12445
12446
12448 {
12450 {
12451 return 0;
12452 }
12453
12454 if (GetInventory().GetAttachmentSlotsCount() != 0)
12455 {
12456 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12457 if (filter)
12458 return filter.GetProtectionLevel(type, false, system);
12459 else
12460 return 0;
12461 }
12462
12463 string subclassPath, entryName;
12464
12465 switch (type)
12466 {
12468 entryName = "biological";
12469 break;
12471 entryName = "chemical";
12472 break;
12473 default:
12474 entryName = "biological";
12475 break;
12476 }
12477
12478 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12479
12481 }
12482
12483
12484
12487 {
12488 if (!IsMagazine())
12490
12492 }
12493
12494
12495
12496
12497
12502 {
12503 return true;
12504 }
12505
12507 {
12509 }
12510
12511
12512
12513
12514
12516 {
12517 if (parent)
12518 {
12519 if (parent.IsInherited(DayZInfected))
12520 return true;
12521
12522 if (!parent.IsRuined())
12523 return true;
12524 }
12525
12526 return true;
12527 }
12528
12530 {
12531 if (!super.CanPutAsAttachment(parent))
12532 {
12533 return false;
12534 }
12535
12536 if (!IsRuined() && !parent.IsRuined())
12537 {
12538 return true;
12539 }
12540
12541 return false;
12542 }
12543
12545 {
12546
12547
12548
12549
12550 return super.CanReceiveItemIntoCargo(item);
12551 }
12552
12554 {
12555
12556
12557
12558
12559 GameInventory attachmentInv = attachment.GetInventory();
12561 {
12562 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12563 return false;
12564 }
12565
12566 InventoryLocation loc = new InventoryLocation();
12567 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12568 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12569 return false;
12570
12571 return super.CanReceiveAttachment(attachment, slotId);
12572 }
12573
12575 {
12576 if (!super.CanReleaseAttachment(attachment))
12577 return false;
12578
12579 return GetInventory().AreChildrenAccessible();
12580 }
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12603 {
12604 int id = muzzle_owner.GetMuzzleID();
12605 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12606
12607 if (WPOF_array)
12608 {
12609 for (int i = 0; i < WPOF_array.Count(); i++)
12610 {
12611 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12612
12613 if (WPOF)
12614 {
12615 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12616 }
12617 }
12618 }
12619 }
12620
12621
12623 {
12624 int id = muzzle_owner.GetMuzzleID();
12626
12627 if (WPOBE_array)
12628 {
12629 for (int i = 0; i < WPOBE_array.Count(); i++)
12630 {
12631 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12632
12633 if (WPOBE)
12634 {
12635 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12636 }
12637 }
12638 }
12639 }
12640
12641
12643 {
12644 int id = muzzle_owner.GetMuzzleID();
12645 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12646
12647 if (WPOOH_array)
12648 {
12649 for (int i = 0; i < WPOOH_array.Count(); i++)
12650 {
12651 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12652
12653 if (WPOOH)
12654 {
12655 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12656 }
12657 }
12658 }
12659 }
12660
12661
12663 {
12664 int id = muzzle_owner.GetMuzzleID();
12665 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12666
12667 if (WPOOH_array)
12668 {
12669 for (int i = 0; i < WPOOH_array.Count(); i++)
12670 {
12671 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12672
12673 if (WPOOH)
12674 {
12675 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12676 }
12677 }
12678 }
12679 }
12680
12681
12683 {
12684 int id = muzzle_owner.GetMuzzleID();
12685 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12686
12687 if (WPOOH_array)
12688 {
12689 for (int i = 0; i < WPOOH_array.Count(); i++)
12690 {
12691 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12692
12693 if (WPOOH)
12694 {
12695 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12696 }
12697 }
12698 }
12699 }
12700
12701
12702
12704 {
12706 {
12707 return true;
12708 }
12709
12710 return false;
12711 }
12712
12714 {
12716 {
12717 return true;
12718 }
12719
12720 return false;
12721 }
12722
12724 {
12726 {
12727 return true;
12728 }
12729
12730 return false;
12731 }
12732
12734 {
12735 return false;
12736 }
12737
12740 {
12741 return UATimeSpent.DEFAULT_DEPLOY;
12742 }
12743
12744
12745
12746
12748 {
12750 SetSynchDirty();
12751 }
12752
12754 {
12756 }
12757
12758
12760 {
12761 return false;
12762 }
12763
12766 {
12767 string att_type = "None";
12768
12769 if (ConfigIsExisting("soundAttType"))
12770 {
12771 att_type = ConfigGetString("soundAttType");
12772 }
12773
12775 }
12776
12778 {
12780 }
12781
12782
12783
12784
12785
12789
12791 {
12794
12796 }
12797
12798
12800 {
12802 return;
12803
12805
12808
12811
12812 SoundParameters params = new SoundParameters();
12816 }
12817
12818
12820 {
12822 return;
12823
12825 SetSynchDirty();
12826
12829 }
12830
12831
12833 {
12835 return;
12836
12838 SetSynchDirty();
12839
12842 }
12843
12845 {
12847 }
12848
12850 {
12852 }
12853
12856 {
12857 if (!
GetGame().IsDedicatedServer())
12858 {
12859 if (ConfigIsExisting("attachSoundSet"))
12860 {
12861 string cfg_path = "";
12862 string soundset = "";
12863 string type_name =
GetType();
12864
12867 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12868 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12869
12870 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12871 {
12872 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12873 {
12874 if (cfg_slot_array[i] == slot_type)
12875 {
12876 soundset = cfg_soundset_array[i];
12877 break;
12878 }
12879 }
12880 }
12881
12882 if (soundset != "")
12883 {
12884 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12886 }
12887 }
12888 }
12889 }
12890
12892 {
12893
12894 }
12895
12896 void OnApply(PlayerBase player);
12897
12899 {
12900 return 1.0;
12901 };
12902
12904 {
12906 }
12907
12909 {
12911 }
12912
12914
12916 {
12917 SetDynamicPhysicsLifeTime(0.01);
12919 }
12920
12922 {
12923 array<string> zone_names = new array<string>;
12924 GetDamageZones(zone_names);
12925 for (int i = 0; i < zone_names.Count(); i++)
12926 {
12927 SetHealthMax(zone_names.Get(i),"Health");
12928 }
12929 SetHealthMax("","Health");
12930 }
12931
12934 {
12935 float global_health = GetHealth01("","Health");
12936 array<string> zones = new array<string>;
12937 GetDamageZones(zones);
12938
12939 for (int i = 0; i < zones.Count(); i++)
12940 {
12941 SetHealth01(zones.Get(i),"Health",global_health);
12942 }
12943 }
12944
12947 {
12948 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12949 }
12950
12952 {
12953 if (!hasRootAsPlayer)
12954 {
12955 if (refParentIB)
12956 {
12957
12958 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12959 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12960
12961 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12962 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12963
12966 }
12967 else
12968 {
12969
12972 }
12973 }
12974 }
12975
12977 {
12979 {
12980 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12981 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12982 {
12983 float heatPermCoef = 1.0;
12985 while (ent)
12986 {
12987 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12988 ent = ent.GetHierarchyParent();
12989 }
12990
12991 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12992 }
12993 }
12994 }
12995
12997 {
12998
12999 EntityAI parent = GetHierarchyParent();
13000 if (!parent)
13001 {
13002 hasParent = false;
13003 hasRootAsPlayer = false;
13004 }
13005 else
13006 {
13007 hasParent = true;
13008 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13009 refParentIB =
ItemBase.Cast(parent);
13010 }
13011 }
13012
13013 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13014 {
13015
13016 }
13017
13019 {
13020
13021 return false;
13022 }
13023
13025 {
13026
13027
13028 return false;
13029 }
13030
13032 {
13033
13034 return false;
13035 }
13036
13039 {
13040 return !GetIsFrozen() &&
IsOpen();
13041 }
13042
13044 {
13045 bool hasParent = false, hasRootAsPlayer = false;
13047
13048 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13049 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13050
13051 if (wwtu || foodDecay)
13052 {
13056
13057 if (processWetness || processTemperature || processDecay)
13058 {
13060
13061 if (processWetness)
13062 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13063
13064 if (processTemperature)
13066
13067 if (processDecay)
13068 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13069 }
13070 }
13071 }
13072
13075 {
13077 }
13078
13080 {
13083
13084 return super.GetTemperatureFreezeThreshold();
13085 }
13086
13088 {
13091
13092 return super.GetTemperatureThawThreshold();
13093 }
13094
13096 {
13099
13100 return super.GetItemOverheatThreshold();
13101 }
13102
13104 {
13106 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13107
13108 return super.GetTemperatureFreezeTime();
13109 }
13110
13112 {
13114 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13115
13116 return super.GetTemperatureThawTime();
13117 }
13118
13123
13125 {
13126 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13127 }
13128
13130 {
13131 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13132 }
13133
13136 {
13138 }
13139
13141 {
13143 }
13144
13146 {
13148 }
13149
13152 {
13153 return null;
13154 }
13155
13158 {
13159 return false;
13160 }
13161
13163 {
13165 {
13168 if (!trg)
13169 {
13171 explosive = this;
13172 }
13173
13174 explosive.PairRemote(trg);
13176
13177 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13178 trg.SetPersistentPairID(persistentID);
13179 explosive.SetPersistentPairID(persistentID);
13180
13181 return true;
13182 }
13183 return false;
13184 }
13185
13188 {
13189 float ret = 1.0;
13192 ret *= GetHealth01();
13193
13194 return ret;
13195 }
13196
13197 #ifdef DEVELOPER
13198 override void SetDebugItem()
13199 {
13200 super.SetDebugItem();
13201 _itemBase = this;
13202 }
13203
13205 {
13206 string text = super.GetDebugText();
13207
13209 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13210
13211 return text;
13212 }
13213 #endif
13214
13216 {
13217 return true;
13218 }
13219
13221
13223
13225 {
13228 }
13229
13230
13238
13254}
13255
13257{
13259 if (entity)
13260 {
13261 bool is_item = entity.IsInherited(
ItemBase);
13262 if (is_item && full_quantity)
13263 {
13266 }
13267 }
13268 else
13269 {
13271 return NULL;
13272 }
13273 return entity;
13274}
13275
13277{
13278 if (item)
13279 {
13280 if (health > 0)
13281 item.SetHealth("", "", health);
13282
13283 if (item.CanHaveTemperature())
13284 {
13286 if (item.CanFreeze())
13287 item.SetFrozen(false);
13288 }
13289
13290 if (item.HasEnergyManager())
13291 {
13292 if (quantity >= 0)
13293 {
13294 item.GetCompEM().SetEnergy0To1(quantity);
13295 }
13296 else
13297 {
13299 }
13300 }
13301 else if (item.IsMagazine())
13302 {
13303 Magazine mag = Magazine.Cast(item);
13304 if (quantity >= 0)
13305 {
13306 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13307 }
13308 else
13309 {
13311 }
13312
13313 }
13314 else
13315 {
13316 if (quantity >= 0)
13317 {
13318 item.SetQuantityNormalized(quantity, false);
13319 }
13320 else
13321 {
13323 }
13324
13325 }
13326 }
13327}
13328
13329#ifdef DEVELOPER
13331#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.