8463{
8465 {
8466 return true;
8467 }
8468};
8469
8470
8471
8473{
8477
8479
8482
8483
8484
8485
8486
8495
8501
8506
8511
8532 protected bool m_IsResultOfSplit
8533
8535
8540
8541
8542
8544
8548
8549
8550
8552
8555
8556
8557
8563
8564
8572
8575
8576
8578
8579
8581
8582
8587
8588
8593
8594
8596
8597
8599 {
8604
8605 if (!
GetGame().IsDedicatedServer())
8606 {
8608 {
8610
8612 {
8614 }
8615 }
8616
8619 }
8620
8621 m_OldLocation = null;
8622
8624 {
8626 }
8627
8628 if (ConfigIsExisting("headSelectionsToHide"))
8629 {
8632 }
8633
8635 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8636 {
8638 }
8639
8641
8642 m_IsResultOfSplit = false;
8643
8645 }
8646
8648 {
8649 super.InitItemVariables();
8650
8656 m_Count = ConfigGetInt(
"count");
8657
8660
8665
8668
8673
8685
8689
8690
8693 if (ConfigIsExisting("canBeSplit"))
8694 {
8697 }
8698
8700 if (ConfigIsExisting("itemBehaviour"))
8702
8703
8706 RegisterNetSyncVariableInt("m_VarLiquidType");
8707 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8708
8709 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8710 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8711 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8712
8713 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8714 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8715 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8716 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8717
8718 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8719 RegisterNetSyncVariableBool("m_IsTakeable");
8720 RegisterNetSyncVariableBool("m_IsHologram");
8721
8724 {
8727 }
8728
8730
8732 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8734
8735 }
8736
8738 {
8740 }
8741
8743 {
8746 {
8751 }
8752 }
8753
8754 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8755 {
8757 {
8760 }
8761
8763 }
8764
8766 {
8772 }
8773
8775
8777 {
8779
8780 if (!action)
8781 {
8782 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8783 return;
8784 }
8785
8787 if (!ai)
8788 {
8790 return;
8791 }
8792
8794 if (!action_array)
8795 {
8796 action_array = new array<ActionBase_Basic>;
8798 }
8799 if (LogManager.IsActionLogEnable())
8800 {
8801 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8802 }
8803
8804 if (action_array.Find(action) != -1)
8805 {
8806 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8807 }
8808 else
8809 {
8810 action_array.Insert(action);
8811 }
8812 }
8813
8815 {
8817 ActionBase action = player.GetActionManager().GetAction(actionName);
8820
8821 if (action_array)
8822 {
8823 action_array.RemoveItem(action);
8824 }
8825 }
8826
8827
8828
8830 {
8831 ActionOverrideData overrideData = new ActionOverrideData();
8835
8837 if (!actionMap)
8838 {
8841 }
8842
8843 actionMap.Insert(this.
Type(), overrideData);
8844
8845 }
8846
8848
8850
8851
8853 {
8856
8859
8860 string config_to_search = "CfgVehicles";
8861 string muzzle_owner_config;
8862
8864 {
8865 if (IsInherited(Weapon))
8866 config_to_search = "CfgWeapons";
8867
8868 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8869
8870 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8871
8873
8874 if (config_OnFire_subclass_count > 0)
8875 {
8876 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8877
8878 for (int i = 0; i < config_OnFire_subclass_count; i++)
8879 {
8880 string particle_class = "";
8882 string config_OnFire_entry = config_OnFire_class + particle_class;
8883 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8884 WPOF_array.Insert(WPOF);
8885 }
8886
8887
8889 }
8890 }
8891
8893 {
8894 config_to_search = "CfgWeapons";
8895 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8896
8897 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8898
8900
8901 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8902 {
8903 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8904
8905 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8906 {
8907 string particle_class2 = "";
8909 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8910 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8911 WPOBE_array.Insert(WPOBE);
8912 }
8913
8914
8916 }
8917 }
8918 }
8919
8920
8922 {
8925
8927 {
8928 string config_to_search = "CfgVehicles";
8929
8930 if (IsInherited(Weapon))
8931 config_to_search = "CfgWeapons";
8932
8933 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8934 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8935
8936 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8937 {
8938
8940
8942 {
8944 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8946 return;
8947 }
8948
8951
8952
8953
8955 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8956
8957 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8958 {
8959 string particle_class = "";
8961 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8963
8964 if (entry_type == CT_CLASS)
8965 {
8966 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8967 WPOOH_array.Insert(WPOF);
8968 }
8969 }
8970
8971
8973 }
8974 }
8975 }
8976
8978 {
8980 }
8981
8983 {
8985 {
8987
8990
8993
8994 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8995 }
8996 }
8997
8999 {
9001 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9002
9004 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9005
9007 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9008
9010 {
9012 }
9013 }
9014
9016 {
9018 }
9019
9021 {
9024 else
9026
9028 {
9031 }
9032 else
9033 {
9036
9039 }
9040
9042 }
9043
9045 {
9047 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9048 }
9049
9051 {
9053 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9055 }
9056
9058 {
9060 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9061 }
9062
9064 {
9067
9068 OverheatingParticle OP = new OverheatingParticle();
9073
9075 }
9076
9078 {
9081
9082 return -1;
9083 }
9084
9086 {
9088 {
9091
9092 for (int i = count; i > 0; --i)
9093 {
9094 int id = i - 1;
9097
9100
9101 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9102 {
9103 if (p)
9104 {
9107 }
9108 }
9109 }
9110 }
9111 }
9112
9114 {
9116 {
9118 {
9119 int id = i - 1;
9121
9122 if (OP)
9123 {
9125
9126 if (p)
9127 {
9129 }
9130
9131 delete OP;
9132 }
9133 }
9134
9137 }
9138 }
9139
9142 {
9143 return 0.0;
9144 }
9145
9146
9148 {
9149 return 250;
9150 }
9151
9153 {
9154 return 0;
9155 }
9156
9159 {
9161 return true;
9162
9163 return false;
9164 }
9165
9168 {
9171
9173 {
9175 }
9176 else
9177 {
9178
9180 }
9181
9183 }
9184
9191 {
9192 return -1;
9193 }
9194
9195
9196
9197
9199 {
9201 {
9203 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9204
9205 if (r_index >= 0)
9206 {
9207 InventoryLocation r_il = new InventoryLocation;
9208 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9209
9210 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9213 {
9214 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9215 }
9217 {
9218 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9219 }
9220
9221 }
9222
9223 player.GetHumanInventory().ClearUserReservedLocation(this);
9224 }
9225
9228 }
9229
9230
9231
9232
9234 {
9235 return ItemBase.m_DebugActionsMask;
9236 }
9237
9239 {
9240 return ItemBase.m_DebugActionsMask & mask;
9241 }
9242
9244 {
9245 ItemBase.m_DebugActionsMask = mask;
9246 }
9247
9249 {
9250 ItemBase.m_DebugActionsMask |= mask;
9251 }
9252
9254 {
9255 ItemBase.m_DebugActionsMask &= ~mask;
9256 }
9257
9259 {
9261 {
9263 }
9264 else
9265 {
9267 }
9268 }
9269
9270
9272 {
9273 if (GetEconomyProfile())
9274 {
9275 float q_max = GetEconomyProfile().GetQuantityMax();
9276 if (q_max > 0)
9277 {
9278 float q_min = GetEconomyProfile().GetQuantityMin();
9279 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9280
9282 {
9283 ComponentEnergyManager comp = GetCompEM();
9285 {
9287 }
9288 }
9290 {
9292
9293 }
9294
9295 }
9296 }
9297 }
9298
9301 {
9302 EntityAI parent = GetHierarchyParent();
9303
9304 if (parent)
9305 {
9306 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9307 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9308 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9309 }
9310 }
9311
9314 {
9315 EntityAI parent = GetHierarchyParent();
9316
9317 if (parent)
9318 {
9319 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9320 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9321 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9322 }
9323 }
9324
9326 {
9327
9328
9329
9330
9332
9334 {
9335 if (ScriptInputUserData.CanStoreInputUserData())
9336 {
9337 ScriptInputUserData ctx = new ScriptInputUserData;
9343 ctx.
Write(use_stack_max);
9346
9348 {
9349 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9350 }
9351 }
9352 }
9353 else if (!
GetGame().IsMultiplayer())
9354 {
9356 }
9357 }
9358
9360 {
9362 }
9363
9365 {
9367 }
9368
9370 {
9372 }
9373
9375 {
9376
9377 return false;
9378 }
9379
9381 {
9382 return false;
9383 }
9384
9388 {
9389 return false;
9390 }
9391
9393 {
9394 return "";
9395 }
9396
9398
9400 {
9401 return false;
9402 }
9403
9405 {
9406 return true;
9407 }
9408
9409
9410
9412 {
9413 return true;
9414 }
9415
9417 {
9418 return true;
9419 }
9420
9422 {
9423 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9425 }
9426
9428 {
9430 }
9431
9433 {
9435 if (!is_being_placed)
9437 SetSynchDirty();
9438 }
9439
9440
9442
9444 {
9446 }
9447
9449 {
9451 }
9452
9454 {
9455 return 1;
9456 }
9457
9459 {
9460 return false;
9461 }
9462
9464 {
9466 SetSynchDirty();
9467 }
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9504 {
9505 super.OnMovedInsideCargo(container);
9506
9507 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9508 }
9509
9510 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9511 {
9512 super.EEItemLocationChanged(oldLoc,newLoc);
9513
9514 PlayerBase new_player = null;
9515 PlayerBase old_player = null;
9516
9517 if (newLoc.GetParent())
9518 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9519
9520 if (oldLoc.GetParent())
9521 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9522
9524 {
9525 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9526
9527 if (r_index >= 0)
9528 {
9529 InventoryLocation r_il = new InventoryLocation;
9530 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9531
9532 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9535 {
9536 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9537 }
9539 {
9540 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9541 }
9542
9543 }
9544 }
9545
9547 {
9548 if (new_player)
9549 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9550
9551 if (new_player == old_player)
9552 {
9553
9554 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9555 {
9557 {
9558 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9559 {
9560 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9561 }
9562 }
9563 else
9564 {
9565 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9566 }
9567 }
9568
9569 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9570 {
9571 int type = oldLoc.GetType();
9573 {
9574 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9575 }
9577 {
9578 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9579 }
9580 }
9581 if (!m_OldLocation)
9582 {
9583 m_OldLocation = new InventoryLocation;
9584 }
9585 m_OldLocation.Copy(oldLoc);
9586 }
9587 else
9588 {
9589 if (m_OldLocation)
9590 {
9591 m_OldLocation.Reset();
9592 }
9593 }
9594
9596 }
9597 else
9598 {
9599 if (new_player)
9600 {
9601 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9602 if (res_index >= 0)
9603 {
9604 InventoryLocation il = new InventoryLocation;
9605 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9607 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9610 {
9611 il.
GetParent().GetOnReleaseLock().Invoke(it);
9612 }
9614 {
9616 }
9617
9618 }
9619 }
9621 {
9622
9624 }
9625
9626 if (m_OldLocation)
9627 {
9628 m_OldLocation.Reset();
9629 }
9630 }
9631 }
9632
9633 override void EOnContact(IEntity other, Contact extra)
9634 {
9636 {
9637 int liquidType = -1;
9639 if (impactSpeed > 0.0)
9640 {
9642 #ifndef SERVER
9644 #else
9646 SetSynchDirty();
9647 #endif
9649 }
9650 }
9651
9652 #ifdef SERVER
9653 if (GetCompEM() && GetCompEM().IsPlugged())
9654 {
9655 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9656 GetCompEM().UnplugThis();
9657 }
9658 #endif
9659 }
9660
9662
9664 {
9666 }
9667
9669 {
9670
9671 }
9672
9674 {
9675 super.OnItemLocationChanged(old_owner, new_owner);
9676
9677 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9678 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9679
9680 if (!relatedPlayer && playerNew)
9681 relatedPlayer = playerNew;
9682
9683 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9684 {
9686 if (actionMgr)
9687 {
9688 ActionBase currentAction = actionMgr.GetRunningAction();
9689 if (currentAction)
9691 }
9692 }
9693
9694 Man ownerPlayerOld = null;
9695 Man ownerPlayerNew = null;
9696
9697 if (old_owner)
9698 {
9699 if (old_owner.
IsMan())
9700 {
9701 ownerPlayerOld = Man.Cast(old_owner);
9702 }
9703 else
9704 {
9705 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9706 }
9707 }
9708 else
9709 {
9711 {
9713
9714 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9715 {
9716 GetCompEM().UnplugThis();
9717 }
9718 }
9719 }
9720
9721 if (new_owner)
9722 {
9723 if (new_owner.
IsMan())
9724 {
9725 ownerPlayerNew = Man.Cast(new_owner);
9726 }
9727 else
9728 {
9729 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9730 }
9731 }
9732
9733 if (ownerPlayerOld != ownerPlayerNew)
9734 {
9735 if (ownerPlayerOld)
9736 {
9737 array<EntityAI> subItemsExit = new array<EntityAI>;
9739 for (int i = 0; i < subItemsExit.Count(); i++)
9740 {
9743 }
9744 }
9745
9746 if (ownerPlayerNew)
9747 {
9748 array<EntityAI> subItemsEnter = new array<EntityAI>;
9750 for (int j = 0; j < subItemsEnter.Count(); j++)
9751 {
9754 }
9755 }
9756 }
9757 else if (ownerPlayerNew != null)
9758 {
9759 PlayerBase nplayer;
9760 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9761 {
9762 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9764 for (int k = 0; k < subItemsUpdate.Count(); k++)
9765 {
9767 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9768 }
9769 }
9770 }
9771
9772 if (old_owner)
9773 old_owner.OnChildItemRemoved(this);
9774 if (new_owner)
9775 new_owner.OnChildItemReceived(this);
9776 }
9777
9778
9780 {
9781 super.EEDelete(parent);
9782 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9783 if (player)
9784 {
9786
9787 if (player.IsAlive())
9788 {
9789 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9790 if (r_index >= 0)
9791 {
9792 InventoryLocation r_il = new InventoryLocation;
9793 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9794
9795 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9798 {
9799 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9800 }
9802 {
9803 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9804 }
9805
9806 }
9807
9808 player.RemoveQuickBarEntityShortcut(this);
9809 }
9810 }
9811 }
9812
9814 {
9815 super.EEKilled(killer);
9816
9819 {
9820 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9821 {
9822 if (IsMagazine())
9823 {
9824 if (Magazine.Cast(this).GetAmmoCount() > 0)
9825 {
9827 }
9828 }
9829 else
9830 {
9832 }
9833 }
9834 }
9835 }
9836
9838 {
9839 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9840
9841 super.OnWasAttached(parent, slot_id);
9842
9845
9847 }
9848
9850 {
9851 super.OnWasDetached(parent, slot_id);
9852
9855 }
9856
9858 {
9859 int idx;
9862
9863 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9864 if (inventory_slots.Count() < 1)
9865 {
9866 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9867 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9868 }
9869 else
9870 {
9871 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9872 }
9873
9874 idx = inventory_slots.Find(slot);
9875 if (idx < 0)
9876 return "";
9877
9878 return attach_types.Get(idx);
9879 }
9880
9882 {
9883 int idx = -1;
9884 string slot;
9885
9888
9889 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9890 if (inventory_slots.Count() < 1)
9891 {
9892 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9893 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9894 }
9895 else
9896 {
9897 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9898 if (detach_types.Count() < 1)
9899 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9900 }
9901
9902 for (int i = 0; i < inventory_slots.Count(); i++)
9903 {
9904 slot = inventory_slots.Get(i);
9905 }
9906
9907 if (slot != "")
9908 {
9909 if (detach_types.Count() == 1)
9910 idx = 0;
9911 else
9912 idx = inventory_slots.Find(slot);
9913 }
9914 if (idx < 0)
9915 return "";
9916
9917 return detach_types.Get(idx);
9918 }
9919
9921 {
9922
9924
9925
9926 float min_time = 1;
9927 float max_time = 3;
9928 float delay = Math.RandomFloat(min_time, max_time);
9929
9930 explode_timer.Run(delay, this, "DoAmmoExplosion");
9931 }
9932
9934 {
9935 Magazine magazine = Magazine.Cast(this);
9936 int pop_sounds_count = 6;
9937 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9938
9939
9940 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9941 string sound_name = pop_sounds[ sound_idx ];
9943
9944
9945 magazine.ServerAddAmmoCount(-1);
9946
9947
9948 float min_temp_to_explode = 100;
9949
9950 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9951 {
9953 }
9954 }
9955
9956
9957 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9958 {
9959 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9960
9961 const int CHANCE_DAMAGE_CARGO = 4;
9962 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9963 const int CHANCE_DAMAGE_NOTHING = 2;
9964
9966 {
9967 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9968 int chances;
9969 int rnd;
9970
9971 if (GetInventory().GetCargo())
9972 {
9973 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9974 rnd = Math.RandomInt(0,chances);
9975
9976 if (rnd < CHANCE_DAMAGE_CARGO)
9977 {
9979 }
9980 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9981 {
9983 }
9984 }
9985 else
9986 {
9987 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9988 rnd = Math.RandomInt(0,chances);
9989
9990 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9991 {
9993 }
9994 }
9995 }
9996 }
9997
9999 {
10000 if (GetInventory().GetCargo())
10001 {
10002 int item_count = GetInventory().GetCargo().GetItemCount();
10003 if (item_count > 0)
10004 {
10005 int random_pick = Math.RandomInt(0, item_count);
10007 if (!item.IsExplosive())
10008 {
10009 item.AddHealth("","",damage);
10010 return true;
10011 }
10012 }
10013 }
10014 return false;
10015 }
10016
10018 {
10019 int attachment_count = GetInventory().AttachmentCount();
10020 if (attachment_count > 0)
10021 {
10022 int random_pick = Math.RandomInt(0, attachment_count);
10023 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10024 if (!attachment.IsExplosive())
10025 {
10026 attachment.AddHealth("","",damage);
10027 return true;
10028 }
10029 }
10030 return false;
10031 }
10032
10034 {
10036 }
10037
10039 {
10041 return GetInventory().CanRemoveEntity();
10042
10043 return false;
10044 }
10045
10047 {
10048
10050 return false;
10051
10052
10054 return false;
10055
10056
10057
10059 if (delta == 0)
10060 return false;
10061
10062
10063 return true;
10064 }
10065
10067 {
10069 {
10070 if (ScriptInputUserData.CanStoreInputUserData())
10071 {
10072 ScriptInputUserData ctx = new ScriptInputUserData;
10077 ctx.
Write(destination_entity);
10079 ctx.
Write(slot_id);
10081 }
10082 }
10083 else if (!
GetGame().IsMultiplayer())
10084 {
10086 }
10087 }
10088
10090 {
10091 float split_quantity_new;
10095 InventoryLocation loc = new InventoryLocation;
10096
10097 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10098 {
10100 split_quantity_new = stack_max;
10101 else
10103
10105 {
10106 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10107 if (new_item)
10108 {
10109 new_item.SetResultOfSplit(true);
10110 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10112 new_item.
SetQuantity(split_quantity_new,
false,
true);
10113 }
10114 }
10115 }
10116 else if (destination_entity && slot_id == -1)
10117 {
10118 if (quantity > stack_max)
10119 split_quantity_new = stack_max;
10120 else
10121 split_quantity_new = quantity;
10122
10124 {
10126 {
10129 }
10130
10131 if (new_item)
10132 {
10133 new_item.SetResultOfSplit(true);
10134 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10136 new_item.
SetQuantity(split_quantity_new,
false,
true);
10137 }
10138 }
10139 }
10140 else
10141 {
10142 if (stack_max != 0)
10143 {
10145 {
10147 }
10148
10149 if (split_quantity_new == 0)
10150 {
10151 if (!
GetGame().IsMultiplayer())
10152 player.PhysicalPredictiveDropItem(this);
10153 else
10154 player.ServerDropEntity(this);
10155 return;
10156 }
10157
10159 {
10161
10162 if (new_item)
10163 {
10164 new_item.SetResultOfSplit(true);
10165 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10168 new_item.PlaceOnSurface();
10169 }
10170 }
10171 }
10172 }
10173 }
10174
10176 {
10177 float split_quantity_new;
10181 InventoryLocation loc = new InventoryLocation;
10182
10183 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10184 {
10186 split_quantity_new = stack_max;
10187 else
10189
10191 {
10192 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10193 if (new_item)
10194 {
10195 new_item.SetResultOfSplit(true);
10196 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10198 new_item.
SetQuantity(split_quantity_new,
false,
true);
10199 }
10200 }
10201 }
10202 else if (destination_entity && slot_id == -1)
10203 {
10204 if (quantity > stack_max)
10205 split_quantity_new = stack_max;
10206 else
10207 split_quantity_new = quantity;
10208
10210 {
10212 {
10215 }
10216
10217 if (new_item)
10218 {
10219 new_item.SetResultOfSplit(true);
10220 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10222 new_item.
SetQuantity(split_quantity_new,
false,
true);
10223 }
10224 }
10225 }
10226 else
10227 {
10228 if (stack_max != 0)
10229 {
10231 {
10233 }
10234
10236 {
10238
10239 if (new_item)
10240 {
10241 new_item.SetResultOfSplit(true);
10242 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10245 new_item.PlaceOnSurface();
10246 }
10247 }
10248 }
10249 }
10250 }
10251
10253 {
10255 {
10256 if (ScriptInputUserData.CanStoreInputUserData())
10257 {
10258 ScriptInputUserData ctx = new ScriptInputUserData;
10263 dst.WriteToContext(ctx);
10265 }
10266 }
10267 else if (!
GetGame().IsMultiplayer())
10268 {
10270 }
10271 }
10272
10274 {
10276 {
10277 if (ScriptInputUserData.CanStoreInputUserData())
10278 {
10279 ScriptInputUserData ctx = new ScriptInputUserData;
10284 ctx.
Write(destination_entity);
10290 }
10291 }
10292 else if (!
GetGame().IsMultiplayer())
10293 {
10295 }
10296 }
10297
10299 {
10301 }
10302
10304 {
10306 float split_quantity_new;
10308 if (dst.IsValid())
10309 {
10310 int slot_id = dst.GetSlot();
10312
10313 if (quantity > stack_max)
10314 split_quantity_new = stack_max;
10315 else
10316 split_quantity_new = quantity;
10317
10319 {
10321
10322 if (new_item)
10323 {
10324 new_item.SetResultOfSplit(true);
10325 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10327 new_item.
SetQuantity(split_quantity_new,
false,
true);
10328 }
10329
10330 return new_item;
10331 }
10332 }
10333
10334 return null;
10335 }
10336
10338 {
10340 float split_quantity_new;
10342 if (destination_entity)
10343 {
10345 if (quantity > stackable)
10346 split_quantity_new = stackable;
10347 else
10348 split_quantity_new = quantity;
10349
10351 {
10352 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10353 if (new_item)
10354 {
10355 new_item.SetResultOfSplit(true);
10356 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10358 new_item.
SetQuantity(split_quantity_new,
false,
true);
10359 }
10360 }
10361 }
10362 }
10363
10365 {
10367 {
10368 if (ScriptInputUserData.CanStoreInputUserData())
10369 {
10370 ScriptInputUserData ctx = new ScriptInputUserData;
10375 ItemBase destination_entity =
this;
10376 ctx.
Write(destination_entity);
10380 }
10381 }
10382 else if (!
GetGame().IsMultiplayer())
10383 {
10385 }
10386 }
10387
10389 {
10391 float split_quantity_new;
10393 if (player)
10394 {
10396 if (quantity > stackable)
10397 split_quantity_new = stackable;
10398 else
10399 split_quantity_new = quantity;
10400
10402 {
10403 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10404 new_item =
ItemBase.Cast(in_hands);
10405 if (new_item)
10406 {
10407 new_item.SetResultOfSplit(true);
10408 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10410 new_item.SetQuantity(split_quantity_new, false, true);
10411 }
10412 }
10413 }
10414 }
10415
10417 {
10419 float split_quantity_new = Math.Floor(quantity * 0.5);
10420
10422 return;
10423
10425
10426 if (new_item)
10427 {
10428 if (new_item.GetQuantityMax() < split_quantity_new)
10429 {
10430 split_quantity_new = new_item.GetQuantityMax();
10431 }
10432
10433 new_item.SetResultOfSplit(true);
10434 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10435
10437 {
10440 }
10441 else
10442 {
10444 new_item.
SetQuantity(split_quantity_new,
false,
true);
10445 }
10446 }
10447 }
10448
10450 {
10452 float split_quantity_new = Math.Floor(quantity / 2);
10453
10455 return;
10456
10457 InventoryLocation invloc = new InventoryLocation;
10459
10461 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10462
10463 if (new_item)
10464 {
10465 if (new_item.GetQuantityMax() < split_quantity_new)
10466 {
10467 split_quantity_new = new_item.GetQuantityMax();
10468 }
10470 {
10473 }
10474 else if (split_quantity_new > 1)
10475 {
10477 new_item.
SetQuantity(split_quantity_new,
false,
true);
10478 }
10479 }
10480 }
10481
10484 {
10485 SetWeightDirty();
10487
10488 if (parent)
10489 parent.OnAttachmentQuantityChangedEx(this, delta);
10490
10492 {
10494 {
10496 }
10498 {
10499 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10501 }
10502 }
10503
10504 }
10505
10508 {
10509
10510 }
10511
10514 {
10516 }
10517
10519 {
10520 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10521
10523 {
10524 if (newLevel == GameConstants.STATE_RUINED)
10525 {
10527 EntityAI parent = GetHierarchyParent();
10528 if (parent && parent.IsFireplace())
10529 {
10530 CargoBase cargo = GetInventory().GetCargo();
10531 if (cargo)
10532 {
10534 {
10536 }
10537 }
10538 }
10539 }
10540
10542 {
10543
10545 return;
10546 }
10547
10548 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10549 {
10551 }
10552 }
10553 }
10554
10555
10557 {
10558 super.OnRightClick();
10559
10561 {
10563 {
10564 if (ScriptInputUserData.CanStoreInputUserData())
10565 {
10566 EntityAI root = GetHierarchyRoot();
10567 Man playerOwner = GetHierarchyRootPlayer();
10568 InventoryLocation dst = new InventoryLocation;
10569
10570
10571 if (!playerOwner && root && root == this)
10572 {
10574 }
10575 else
10576 {
10577
10578 GetInventory().GetCurrentInventoryLocation(dst);
10580 {
10583 {
10585 }
10586 else
10587 {
10589
10590
10591 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10592 {
10594 }
10595 else
10596 {
10597 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10598 }
10599 }
10600 }
10601 }
10602
10603 ScriptInputUserData ctx = new ScriptInputUserData;
10611 }
10612 }
10613 else if (!
GetGame().IsMultiplayer())
10614 {
10616 }
10617 }
10618 }
10619
10621 {
10622 if (root)
10623 {
10624 vector m4[4];
10625 root.GetTransform(m4);
10626 dst.SetGround(this, m4);
10627 }
10628 else
10629 {
10630 GetInventory().GetCurrentInventoryLocation(dst);
10631 }
10632 }
10633
10634 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10635 {
10636
10637 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10638 return false;
10639
10640 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10641 return false;
10642
10643
10645 return false;
10646
10647
10648 Magazine mag = Magazine.Cast(this);
10649 if (mag)
10650 {
10651 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10652 return false;
10653
10654 if (stack_max_limit)
10655 {
10656 Magazine other_mag = Magazine.Cast(other_item);
10657 if (other_item)
10658 {
10659 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10660 return false;
10661 }
10662
10663 }
10664 }
10665 else
10666 {
10667
10669 return false;
10670
10672 return false;
10673 }
10674
10675 PlayerBase player = null;
10676 if (CastTo(player, GetHierarchyRootPlayer()))
10677 {
10678 if (player.GetInventory().HasAttachment(this))
10679 return false;
10680
10681 if (player.IsItemsToDelete())
10682 return false;
10683 }
10684
10685 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10686 return false;
10687
10688 int slotID;
10690 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10691 return false;
10692
10693 return true;
10694 }
10695
10697 {
10699 }
10700
10702 {
10703 return m_IsResultOfSplit;
10704 }
10705
10707 {
10708 m_IsResultOfSplit = value;
10709 }
10710
10712 {
10714 }
10715
10717 {
10718 float other_item_quantity = other_item.GetQuantity();
10719 float this_free_space;
10720
10722
10724
10725 if (other_item_quantity > this_free_space)
10726 {
10727 return this_free_space;
10728 }
10729 else
10730 {
10731 return other_item_quantity;
10732 }
10733 }
10734
10736 {
10738 }
10739
10741 {
10743 return;
10744
10745 if (!IsMagazine() && other_item)
10746 {
10748 if (quantity_used != 0)
10749 {
10750 float hp1 = GetHealth01("","");
10751 float hp2 = other_item.GetHealth01("","");
10752 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10753 hpResult = hpResult / (
GetQuantity() + quantity_used);
10754
10755 hpResult *= GetMaxHealth();
10756 Math.Round(hpResult);
10757 SetHealth("", "Health", hpResult);
10758
10760 other_item.AddQuantity(-quantity_used);
10761 }
10762 }
10764 }
10765
10767 {
10768 #ifdef SERVER
10769 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10770 GetHierarchyParent().IncreaseLifetimeUp();
10771 #endif
10772 };
10773
10775 {
10776 PlayerBase p = PlayerBase.Cast(player);
10777
10778 array<int> recipesIds = p.m_Recipes;
10779 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10780 if (moduleRecipesManager)
10781 {
10782 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10783 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10784 }
10785
10786 for (int i = 0;i < recipesIds.Count(); i++)
10787 {
10788 int key = recipesIds.Get(i);
10789 string recipeName = moduleRecipesManager.GetRecipeName(key);
10791 }
10792 }
10793
10794
10795 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10796 {
10797 super.GetDebugActions(outputList);
10798
10799
10805
10806
10811
10816
10817
10821
10822
10824 {
10828 }
10829
10832
10833
10837
10839
10840 InventoryLocation loc = new InventoryLocation();
10841 GetInventory().GetCurrentInventoryLocation(loc);
10843 {
10844 if (Gizmo_IsSupported())
10847 }
10848
10850 }
10851
10852
10853
10854
10856 {
10857 super.OnAction(action_id, player, ctx);
10858
10860 {
10861 switch (action_id)
10862 {
10865 return true;
10868 return true;
10869 }
10870 }
10871
10873 {
10874 switch (action_id)
10875 {
10877 Delete();
10878 return true;
10879 }
10880 }
10881
10882 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10883 {
10884 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10885 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10886 PlayerBase p = PlayerBase.Cast(player);
10887 if (
EActions.RECIPES_RANGE_START < 1000)
10888 {
10889 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10890 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10891 }
10892 }
10893 #ifndef SERVER
10894 else if (action_id ==
EActions.WATCH_PLAYER)
10895 {
10896 PluginDeveloper.SetDeveloperItemClientEx(player);
10897 }
10898 #endif
10900 {
10901 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10902 {
10903 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10904 OnDebugButtonPressServer(id + 1);
10905 }
10906
10907 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10908 {
10909 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10911 }
10912
10913 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10914 {
10915 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10917 }
10918
10919 else if (action_id ==
EActions.ADD_QUANTITY)
10920 {
10921 if (IsMagazine())
10922 {
10923 Magazine mag = Magazine.Cast(this);
10924 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10925 }
10926 else
10927 {
10929 }
10930
10931 if (m_EM)
10932 {
10933 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10934 }
10935
10936 }
10937
10938 else if (action_id ==
EActions.REMOVE_QUANTITY)
10939 {
10940 if (IsMagazine())
10941 {
10942 Magazine mag2 = Magazine.Cast(this);
10943 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10944 }
10945 else
10946 {
10948 }
10949 if (m_EM)
10950 {
10951 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10952 }
10953
10954 }
10955
10956 else if (action_id ==
EActions.SET_QUANTITY_0)
10957 {
10959
10960 if (m_EM)
10961 {
10962 m_EM.SetEnergy(0);
10963 }
10964 }
10965
10966 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10967 {
10969
10970 if (m_EM)
10971 {
10972 m_EM.SetEnergy(m_EM.GetEnergyMax());
10973 }
10974 }
10975
10976 else if (action_id ==
EActions.ADD_HEALTH)
10977 {
10978 AddHealth("","",GetMaxHealth("","Health")/5);
10979 }
10980 else if (action_id ==
EActions.REMOVE_HEALTH)
10981 {
10982 AddHealth("","",-GetMaxHealth("","Health")/5);
10983 }
10984 else if (action_id ==
EActions.DESTROY_HEALTH)
10985 {
10986 SetHealth01("","",0);
10987 }
10988 else if (action_id ==
EActions.WATCH_ITEM)
10989 {
10991 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10992 #ifdef DEVELOPER
10993 SetDebugDeveloper_item(this);
10994 #endif
10995 }
10996
10997 else if (action_id ==
EActions.ADD_TEMPERATURE)
10998 {
10999 AddTemperature(20);
11000
11001 }
11002
11003 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11004 {
11005 AddTemperature(-20);
11006
11007 }
11008
11009 else if (action_id ==
EActions.FLIP_FROZEN)
11010 {
11011 SetFrozen(!GetIsFrozen());
11012
11013 }
11014
11015 else if (action_id ==
EActions.ADD_WETNESS)
11016 {
11018
11019 }
11020
11021 else if (action_id ==
EActions.REMOVE_WETNESS)
11022 {
11024
11025 }
11026
11027 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11028 {
11031
11032
11033 }
11034
11035 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11036 {
11039 }
11040
11041 else if (action_id ==
EActions.MAKE_SPECIAL)
11042 {
11043 auto debugParams = DebugSpawnParams.WithPlayer(player);
11044 OnDebugSpawnEx(debugParams);
11045 }
11046
11047 }
11048
11049
11050 return false;
11051 }
11052
11053
11054
11055
11059
11062
11063
11064
11066 {
11067 return false;
11068 }
11069
11070
11072 {
11073 return true;
11074 }
11075
11076
11078 {
11079 return true;
11080 }
11081
11082
11083
11085 {
11086 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11088 }
11089
11092 {
11093 return null;
11094 }
11095
11097 {
11098 return false;
11099 }
11100
11102 {
11103 return false;
11104 }
11105
11109
11110
11112 {
11113 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11114 return module_repairing.CanRepair(this, item_repair_kit);
11115 }
11116
11117
11118 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11119 {
11120 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11121 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11122 }
11123
11124
11126 {
11127
11128
11129
11130
11131
11132
11133
11134
11135 return 1;
11136 }
11137
11138
11139
11141 {
11143 }
11144
11145
11146
11148 {
11150 }
11151
11152
11161 {
11162 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11163
11164 if (player)
11165 {
11166 player.MessageStatus(text);
11167 }
11168 }
11169
11170
11179 {
11180 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11181
11182 if (player)
11183 {
11184 player.MessageAction(text);
11185 }
11186 }
11187
11188
11197 {
11198 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11199
11200 if (player)
11201 {
11202 player.MessageFriendly(text);
11203 }
11204 }
11205
11206
11215 {
11216 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11217
11218 if (player)
11219 {
11220 player.MessageImportant(text);
11221 }
11222 }
11223
11225 {
11226 return true;
11227 }
11228
11229
11230 override bool KindOf(
string tag)
11231 {
11232 bool found = false;
11233 string item_name = this.
GetType();
11236
11237 int array_size = item_tag_array.Count();
11238 for (int i = 0; i < array_size; i++)
11239 {
11240 if (item_tag_array.Get(i) == tag)
11241 {
11242 found = true;
11243 break;
11244 }
11245 }
11246 return found;
11247 }
11248
11249
11251 {
11252
11253 super.OnRPC(sender, rpc_type,ctx);
11254
11255
11256 switch (rpc_type)
11257 {
11258 #ifndef SERVER
11259 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11260 Param2<bool, string> p = new Param2<bool, string>(false, "");
11261
11263 return;
11264
11265 bool play = p.param1;
11266 string soundSet = p.param2;
11267
11268 if (play)
11269 {
11271 {
11273 {
11275 }
11276 }
11277 else
11278 {
11280 }
11281 }
11282 else
11283 {
11285 }
11286
11287 break;
11288 #endif
11289
11290 }
11291
11293 {
11295 }
11296 }
11297
11298
11299
11300
11302 {
11303 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11304 return plugin.GetID(
name);
11305 }
11306
11308 {
11309 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11310 return plugin.GetName(id);
11311 }
11312
11315 {
11316
11317
11318 int varFlags;
11319 if (!ctx.
Read(varFlags))
11320 return;
11321
11322 if (varFlags & ItemVariableFlags.FLOAT)
11323 {
11325 }
11326 }
11327
11329 {
11330
11331 super.SerializeNumericalVars(floats_out);
11332
11333
11334
11336 {
11338 }
11339
11341 {
11343 }
11344
11346 {
11348 }
11349
11351 {
11356 }
11357
11359 {
11361 }
11362 }
11363
11365 {
11366
11367 super.DeSerializeNumericalVars(floats);
11368
11369
11370 int index = 0;
11371 int mask = Math.Round(floats.Get(index));
11372
11373 index++;
11374
11376 {
11378 {
11380 }
11381 else
11382 {
11383 float quantity = floats.Get(index);
11384 SetQuantity(quantity,
true,
false,
false,
false);
11385 }
11386 index++;
11387 }
11388
11390 {
11391 float wet = floats.Get(index);
11393 index++;
11394 }
11395
11397 {
11398 int liquidtype = Math.Round(floats.Get(index));
11400 index++;
11401 }
11402
11404 {
11406 index++;
11408 index++;
11410 index++;
11412 index++;
11413 }
11414
11416 {
11417 int cleanness = Math.Round(floats.Get(index));
11419 index++;
11420 }
11421 }
11422
11424 {
11425 super.WriteVarsToCTX(ctx);
11426
11427
11429 {
11431 }
11432
11434 {
11436 }
11437
11439 {
11441 }
11442
11444 {
11445 int r,g,b,a;
11451 }
11452
11454 {
11456 }
11457 }
11458
11460 {
11461 if (!super.ReadVarsFromCTX(ctx,version))
11462 return false;
11463
11464 int intValue;
11465 float value;
11466
11467 if (version < 140)
11468 {
11469 if (!ctx.
Read(intValue))
11470 return false;
11471
11472 m_VariablesMask = intValue;
11473 }
11474
11476 {
11477 if (!ctx.
Read(value))
11478 return false;
11479
11481 {
11483 }
11484 else
11485 {
11487 }
11488 }
11489
11490 if (version < 140)
11491 {
11493 {
11494 if (!ctx.
Read(value))
11495 return false;
11496 SetTemperatureDirect(value);
11497 }
11498 }
11499
11501 {
11502 if (!ctx.
Read(value))
11503 return false;
11505 }
11506
11508 {
11509 if (!ctx.
Read(intValue))
11510 return false;
11512 }
11513
11515 {
11516 int r,g,b,a;
11518 return false;
11520 return false;
11522 return false;
11524 return false;
11525
11527 }
11528
11530 {
11531 if (!ctx.
Read(intValue))
11532 return false;
11534 }
11535
11536 if (version >= 138 && version < 140)
11537 {
11539 {
11540 if (!ctx.
Read(intValue))
11541 return false;
11542 SetFrozen(intValue);
11543 }
11544 }
11545
11546 return true;
11547 }
11548
11549
11551 {
11554 {
11556 }
11557
11558 if (!super.OnStoreLoad(ctx, version))
11559 {
11561 return false;
11562 }
11563
11564 if (version >= 114)
11565 {
11566 bool hasQuickBarIndexSaved;
11567
11568 if (!ctx.
Read(hasQuickBarIndexSaved))
11569 {
11571 return false;
11572 }
11573
11574 if (hasQuickBarIndexSaved)
11575 {
11576 int itmQBIndex;
11577
11578
11579 if (!ctx.
Read(itmQBIndex))
11580 {
11582 return false;
11583 }
11584
11585 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11586 if (itmQBIndex != -1 && parentPlayer)
11587 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11588 }
11589 }
11590 else
11591 {
11592
11593 PlayerBase player;
11594 int itemQBIndex;
11595 if (version ==
int.
MAX)
11596 {
11597 if (!ctx.
Read(itemQBIndex))
11598 {
11600 return false;
11601 }
11602 }
11603 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11604 {
11605
11606 if (!ctx.
Read(itemQBIndex))
11607 {
11609 return false;
11610 }
11611 if (itemQBIndex != -1 && player)
11612 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11613 }
11614 }
11615
11616 if (version < 140)
11617 {
11618
11619 if (!LoadVariables(ctx, version))
11620 {
11622 return false;
11623 }
11624 }
11625
11626
11628 {
11630 return false;
11631 }
11632 if (version >= 132)
11633 {
11635 if (raib)
11636 {
11638 {
11640 return false;
11641 }
11642 }
11643 }
11644
11646 return true;
11647 }
11648
11649
11650
11652 {
11653 super.OnStoreSave(ctx);
11654
11655 PlayerBase player;
11656 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11657 {
11659
11660 int itemQBIndex = -1;
11661 itemQBIndex = player.FindQuickBarEntityIndex(this);
11662 ctx.
Write(itemQBIndex);
11663 }
11664 else
11665 {
11667 }
11668
11670
11672 if (raib)
11673 {
11675 }
11676 }
11677
11678
11680 {
11681 super.AfterStoreLoad();
11682
11684 {
11686 }
11687
11689 {
11692 }
11693 }
11694
11696 {
11697 super.EEOnAfterLoad();
11698
11700 {
11702 }
11703
11706 }
11707
11709 {
11710 return false;
11711 }
11712
11713
11714
11716 {
11718 {
11719 #ifdef PLATFORM_CONSOLE
11720
11722 {
11724 if (menu)
11725 {
11727 }
11728 }
11729 #endif
11730 }
11731
11733 {
11736 }
11737
11739 {
11740 SetWeightDirty();
11742 }
11744 {
11747 }
11748
11750 {
11753 }
11755 {
11758 }
11759
11760 super.OnVariablesSynchronized();
11761 }
11762
11763
11764
11766 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11767 {
11768 if (!IsServerCheck(allow_client))
11769 return false;
11770
11772 return false;
11773
11776
11777 if (value <= (min + 0.001))
11778 value = min;
11779
11780 if (value == min)
11781 {
11782 if (destroy_config)
11783 {
11784 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11785 if (dstr)
11786 {
11788 this.Delete();
11789 return true;
11790 }
11791 }
11792 else if (destroy_forced)
11793 {
11795 this.Delete();
11796 return true;
11797 }
11798
11800 }
11801
11804
11806 {
11808
11809 if (delta)
11811 }
11812
11814
11815 return false;
11816 }
11817
11818
11820 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11821 {
11823 }
11824
11826 {
11829 }
11830
11832 {
11835 }
11836
11838 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11839 {
11840 float value_clamped = Math.Clamp(value, 0, 1);
11842 SetQuantity(result, destroy_config, destroy_forced);
11843 }
11844
11845
11848 {
11850 }
11851
11853 {
11855 }
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11867 {
11868 int slot = -1;
11869 if (GetInventory())
11870 {
11871 InventoryLocation il = new InventoryLocation;
11872 GetInventory().GetCurrentInventoryLocation(il);
11874 }
11875
11877 }
11878
11880 {
11881 float quantity_max = 0;
11882
11884 {
11885 if (attSlotID != -1)
11886 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11887
11888 if (quantity_max <= 0)
11890 }
11891
11892 if (quantity_max <= 0)
11894
11895 return quantity_max;
11896 }
11897
11899 {
11901 }
11902
11904 {
11906 }
11907
11908
11910 {
11912 }
11913
11915 {
11917 }
11918
11920 {
11922 }
11923
11924
11926 {
11927
11928 float weightEx = GetWeightEx();
11929 float special = GetInventoryAndCargoWeight();
11930 return weightEx - special;
11931 }
11932
11933
11935 {
11937 }
11938
11940 {
11942 {
11943 #ifdef DEVELOPER
11944 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11945 {
11946 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11948 }
11949 #endif
11950
11951 return GetQuantity() * GetConfigWeightModified();
11952 }
11953 else if (HasEnergyManager())
11954 {
11955 #ifdef DEVELOPER
11956 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11957 {
11958 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11959 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11960 }
11961 #endif
11962 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11963 }
11964 else
11965 {
11966 #ifdef DEVELOPER
11967 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11968 {
11969 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11970 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11971 }
11972 #endif
11973 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11974 }
11975 }
11976
11979 {
11980 int item_count = 0;
11982
11983 if (GetInventory().GetCargo() != NULL)
11984 {
11985 item_count = GetInventory().GetCargo().GetItemCount();
11986 }
11987
11988 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11989 {
11990 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11991 if (item)
11992 item_count += item.GetNumberOfItems();
11993 }
11994 return item_count;
11995 }
11996
11999 {
12000 float weight = 0;
12001 float wetness = 1;
12002 if (include_wetness)
12005 {
12006 weight = wetness * m_ConfigWeight;
12007 }
12009 {
12010 weight = 1;
12011 }
12012 return weight;
12013 }
12014
12015
12016
12018 {
12019 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12020 {
12021 GameInventory inv = GetInventory();
12022 array<EntityAI> items = new array<EntityAI>;
12024 for (int i = 0; i < items.Count(); i++)
12025 {
12027 if (item)
12028 {
12030 }
12031 }
12032 }
12033 }
12034
12035
12036
12037
12039 {
12040 float energy = 0;
12041 if (HasEnergyManager())
12042 {
12043 energy = GetCompEM().GetEnergy();
12044 }
12045 return energy;
12046 }
12047
12048
12050 {
12051 super.OnEnergyConsumed();
12052
12054 }
12055
12057 {
12058 super.OnEnergyAdded();
12059
12061 }
12062
12063
12065 {
12066 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12067 {
12069 {
12070 float energy_0to1 = GetCompEM().GetEnergy0To1();
12072 }
12073 }
12074 }
12075
12076
12078 {
12079 return ConfigGetFloat("heatIsolation");
12080 }
12081
12083 {
12085 }
12086
12088 {
12089 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12090 if (
GetGame().ConfigIsExisting(paramPath))
12092
12093 return 0.0;
12094 }
12095
12097 {
12098 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12099 if (
GetGame().ConfigIsExisting(paramPath))
12101
12102 return 0.0;
12103 }
12104
12105 override void SetWet(
float value,
bool allow_client =
false)
12106 {
12107 if (!IsServerCheck(allow_client))
12108 return;
12109
12112
12114
12115 m_VarWet = Math.Clamp(value, min, max);
12116
12118 {
12121 }
12122 }
12123
12124 override void AddWet(
float value)
12125 {
12127 }
12128
12130 {
12132 }
12133
12135 {
12137 }
12138
12140 {
12142 }
12143
12145 {
12147 }
12148
12150 {
12152 }
12153
12154 override void OnWetChanged(
float newVal,
float oldVal)
12155 {
12158 if (newLevel != oldLevel)
12159 {
12161 }
12162 }
12163
12165 {
12166 SetWeightDirty();
12167 }
12168
12170 {
12171 return GetWetLevelInternal(
m_VarWet);
12172 }
12173
12174
12175
12177 {
12179 }
12180
12182 {
12184 }
12185
12187 {
12189 }
12190
12192 {
12194 }
12195
12196
12197
12199 {
12200 if (ConfigIsExisting("itemModelLength"))
12201 {
12202 return ConfigGetFloat("itemModelLength");
12203 }
12204 return 0;
12205 }
12206
12208 {
12209 if (ConfigIsExisting("itemAttachOffset"))
12210 {
12211 return ConfigGetFloat("itemAttachOffset");
12212 }
12213 return 0;
12214 }
12215
12216 override void SetCleanness(
int value,
bool allow_client =
false)
12217 {
12218 if (!IsServerCheck(allow_client))
12219 return;
12220
12222
12224
12227 }
12228
12230 {
12232 }
12233
12235 {
12236 return true;
12237 }
12238
12239
12240
12241
12243 {
12245 }
12246
12248 {
12250 }
12251
12252
12253
12254
12255 override void SetColor(
int r,
int g,
int b,
int a)
12256 {
12262 }
12264 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12265 {
12270 }
12271
12273 {
12275 }
12276
12279 {
12280 int r,g,b,a;
12282 r = r/255;
12283 g = g/255;
12284 b = b/255;
12285 a = a/255;
12286 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12287 }
12288
12289
12290
12291 override void SetLiquidType(
int value,
bool allow_client =
false)
12292 {
12293 if (!IsServerCheck(allow_client))
12294 return;
12295
12300 }
12301
12303 {
12304 return ConfigGetInt("varLiquidTypeInit");
12305 }
12306
12308 {
12310 }
12311
12313 {
12315 SetFrozen(false);
12316 }
12317
12320 {
12321 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12322 }
12323
12324
12327 {
12328 PlayerBase nplayer;
12329 if (PlayerBase.CastTo(nplayer, player))
12330 {
12332
12333 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12334 }
12335 }
12336
12337
12340 {
12341 PlayerBase nplayer;
12342 if (PlayerBase.CastTo(nplayer,player))
12343 {
12344
12345 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12346
12347 }
12348
12349
12350 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12351
12352
12353 if (HasEnergyManager())
12354 {
12355 GetCompEM().UpdatePlugState();
12356 }
12357 }
12358
12359
12361 {
12362 super.OnPlacementStarted(player);
12363
12365 }
12366
12367 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12368 {
12370 {
12371 m_AdminLog.OnPlacementComplete(player,
this);
12372 }
12373
12374 super.OnPlacementComplete(player, position, orientation);
12375 }
12376
12377
12378
12379
12380
12382 {
12384 {
12385 return true;
12386 }
12387 else
12388 {
12389 return false;
12390 }
12391 }
12392
12393
12395 {
12397 {
12399 }
12400 }
12401
12402
12404 {
12406 }
12407
12409 {
12411 }
12412
12413 override void InsertAgent(
int agent,
float count = 1)
12414 {
12415 if (count < 1)
12416 return;
12417
12419 }
12420
12423 {
12425 }
12426
12427
12429 {
12431 }
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12475 {
12477 return false;
12478 return true;
12479 }
12480
12482 {
12483
12485 }
12486
12487
12490 {
12491 super.CheckForRoofLimited(timeTresholdMS);
12492
12494 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12495 {
12496 m_PreviousRoofTestTime = time;
12497 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12498 }
12499 }
12500
12501
12503 {
12505 {
12506 return 0;
12507 }
12508
12509 if (GetInventory().GetAttachmentSlotsCount() != 0)
12510 {
12511 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12512 if (filter)
12513 return filter.GetProtectionLevel(type, false, system);
12514 else
12515 return 0;
12516 }
12517
12518 string subclassPath, entryName;
12519
12520 switch (type)
12521 {
12523 entryName = "biological";
12524 break;
12526 entryName = "chemical";
12527 break;
12528 default:
12529 entryName = "biological";
12530 break;
12531 }
12532
12533 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12534
12536 }
12537
12538
12539
12542 {
12543 if (!IsMagazine())
12545
12547 }
12548
12549
12550
12551
12552
12557 {
12558 return true;
12559 }
12560
12562 {
12564 }
12565
12566
12567
12568
12569
12571 {
12572 if (parent)
12573 {
12574 if (parent.IsInherited(DayZInfected))
12575 return true;
12576
12577 if (!parent.IsRuined())
12578 return true;
12579 }
12580
12581 return true;
12582 }
12583
12585 {
12586 if (!super.CanPutAsAttachment(parent))
12587 {
12588 return false;
12589 }
12590
12591 if (!IsRuined() && !parent.IsRuined())
12592 {
12593 return true;
12594 }
12595
12596 return false;
12597 }
12598
12600 {
12601
12602
12603
12604
12605 return super.CanReceiveItemIntoCargo(item);
12606 }
12607
12609 {
12610
12611
12612
12613
12614 GameInventory attachmentInv = attachment.GetInventory();
12616 {
12617 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12618 return false;
12619 }
12620
12621 InventoryLocation loc = new InventoryLocation();
12622 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12623 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12624 return false;
12625
12626 return super.CanReceiveAttachment(attachment, slotId);
12627 }
12628
12630 {
12631 if (!super.CanReleaseAttachment(attachment))
12632 return false;
12633
12634 return GetInventory().AreChildrenAccessible();
12635 }
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12658 {
12659 int id = muzzle_owner.GetMuzzleID();
12660 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12661
12662 if (WPOF_array)
12663 {
12664 for (int i = 0; i < WPOF_array.Count(); i++)
12665 {
12666 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12667
12668 if (WPOF)
12669 {
12670 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12671 }
12672 }
12673 }
12674 }
12675
12676
12678 {
12679 int id = muzzle_owner.GetMuzzleID();
12681
12682 if (WPOBE_array)
12683 {
12684 for (int i = 0; i < WPOBE_array.Count(); i++)
12685 {
12686 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12687
12688 if (WPOBE)
12689 {
12690 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12691 }
12692 }
12693 }
12694 }
12695
12696
12698 {
12699 int id = muzzle_owner.GetMuzzleID();
12700 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12701
12702 if (WPOOH_array)
12703 {
12704 for (int i = 0; i < WPOOH_array.Count(); i++)
12705 {
12706 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12707
12708 if (WPOOH)
12709 {
12710 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12711 }
12712 }
12713 }
12714 }
12715
12716
12718 {
12719 int id = muzzle_owner.GetMuzzleID();
12720 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12721
12722 if (WPOOH_array)
12723 {
12724 for (int i = 0; i < WPOOH_array.Count(); i++)
12725 {
12726 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12727
12728 if (WPOOH)
12729 {
12730 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12731 }
12732 }
12733 }
12734 }
12735
12736
12738 {
12739 int id = muzzle_owner.GetMuzzleID();
12740 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12741
12742 if (WPOOH_array)
12743 {
12744 for (int i = 0; i < WPOOH_array.Count(); i++)
12745 {
12746 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12747
12748 if (WPOOH)
12749 {
12750 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12751 }
12752 }
12753 }
12754 }
12755
12756
12757
12759 {
12761 {
12762 return true;
12763 }
12764
12765 return false;
12766 }
12767
12769 {
12771 {
12772 return true;
12773 }
12774
12775 return false;
12776 }
12777
12779 {
12781 {
12782 return true;
12783 }
12784
12785 return false;
12786 }
12787
12789 {
12790 return false;
12791 }
12792
12795 {
12796 return UATimeSpent.DEFAULT_DEPLOY;
12797 }
12798
12799
12800
12801
12803 {
12805 SetSynchDirty();
12806 }
12807
12809 {
12811 }
12812
12813
12815 {
12816 return false;
12817 }
12818
12821 {
12822 string att_type = "None";
12823
12824 if (ConfigIsExisting("soundAttType"))
12825 {
12826 att_type = ConfigGetString("soundAttType");
12827 }
12828
12830 }
12831
12833 {
12835 }
12836
12837
12838
12839
12840
12846
12848 {
12851
12853 }
12854
12855
12857 {
12859 return;
12860
12862
12865
12868
12869 SoundParameters params = new SoundParameters();
12873 }
12874
12875
12877 {
12879 return;
12880
12882 SetSynchDirty();
12883
12886 }
12887
12888
12890 {
12892 return;
12893
12895 SetSynchDirty();
12896
12899 }
12900
12902 {
12904 }
12905
12907 {
12909 }
12910
12913 {
12914 if (!
GetGame().IsDedicatedServer())
12915 {
12916 if (ConfigIsExisting("attachSoundSet"))
12917 {
12918 string cfg_path = "";
12919 string soundset = "";
12920 string type_name =
GetType();
12921
12924 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12925 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12926
12927 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12928 {
12929 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12930 {
12931 if (cfg_slot_array[i] == slot_type)
12932 {
12933 soundset = cfg_soundset_array[i];
12934 break;
12935 }
12936 }
12937 }
12938
12939 if (soundset != "")
12940 {
12941 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12943 }
12944 }
12945 }
12946 }
12947
12949 {
12950
12951 }
12952
12953 void OnApply(PlayerBase player);
12954
12956 {
12957 return 1.0;
12958 };
12959
12961 {
12963 }
12964
12966 {
12968 }
12969
12971
12973 {
12974 SetDynamicPhysicsLifeTime(0.01);
12976 }
12977
12979 {
12980 array<string> zone_names = new array<string>;
12981 GetDamageZones(zone_names);
12982 for (int i = 0; i < zone_names.Count(); i++)
12983 {
12984 SetHealthMax(zone_names.Get(i),"Health");
12985 }
12986 SetHealthMax("","Health");
12987 }
12988
12991 {
12992 float global_health = GetHealth01("","Health");
12993 array<string> zones = new array<string>;
12994 GetDamageZones(zones);
12995
12996 for (int i = 0; i < zones.Count(); i++)
12997 {
12998 SetHealth01(zones.Get(i),"Health",global_health);
12999 }
13000 }
13001
13004 {
13005 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13006 }
13007
13009 {
13010 if (!hasRootAsPlayer)
13011 {
13012 if (refParentIB)
13013 {
13014
13015 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13016 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13017
13018 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13019 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13020
13023 }
13024 else
13025 {
13026
13029 }
13030 }
13031 }
13032
13034 {
13036 {
13037 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13038 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13039 {
13040 float heatPermCoef = 1.0;
13042 while (ent)
13043 {
13044 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13045 ent = ent.GetHierarchyParent();
13046 }
13047
13048 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13049 }
13050 }
13051 }
13052
13054 {
13055
13056 EntityAI parent = GetHierarchyParent();
13057 if (!parent)
13058 {
13059 hasParent = false;
13060 hasRootAsPlayer = false;
13061 }
13062 else
13063 {
13064 hasParent = true;
13065 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13066 refParentIB =
ItemBase.Cast(parent);
13067 }
13068 }
13069
13070 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13071 {
13072
13073 }
13074
13076 {
13077
13078 return false;
13079 }
13080
13082 {
13083
13084
13085 return false;
13086 }
13087
13089 {
13090
13091 return false;
13092 }
13093
13096 {
13097 return !GetIsFrozen() &&
IsOpen();
13098 }
13099
13101 {
13102 bool hasParent = false, hasRootAsPlayer = false;
13104
13105 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13106 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13107
13108 if (wwtu || foodDecay)
13109 {
13113
13114 if (processWetness || processTemperature || processDecay)
13115 {
13117
13118 if (processWetness)
13119 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13120
13121 if (processTemperature)
13123
13124 if (processDecay)
13125 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13126 }
13127 }
13128 }
13129
13132 {
13134 }
13135
13137 {
13140
13141 return super.GetTemperatureFreezeThreshold();
13142 }
13143
13145 {
13148
13149 return super.GetTemperatureThawThreshold();
13150 }
13151
13153 {
13156
13157 return super.GetItemOverheatThreshold();
13158 }
13159
13161 {
13163 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13164
13165 return super.GetTemperatureFreezeTime();
13166 }
13167
13169 {
13171 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13172
13173 return super.GetTemperatureThawTime();
13174 }
13175
13180
13182 {
13183 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13184 }
13185
13187 {
13188 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13189 }
13190
13193 {
13195 }
13196
13198 {
13200 }
13201
13203 {
13205 }
13206
13209 {
13210 return null;
13211 }
13212
13215 {
13216 return false;
13217 }
13218
13220 {
13222 {
13225 if (!trg)
13226 {
13228 explosive = this;
13229 }
13230
13231 explosive.PairRemote(trg);
13233
13234 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13235 trg.SetPersistentPairID(persistentID);
13236 explosive.SetPersistentPairID(persistentID);
13237
13238 return true;
13239 }
13240 return false;
13241 }
13242
13245 {
13246 float ret = 1.0;
13249 ret *= GetHealth01();
13250
13251 return ret;
13252 }
13253
13254 #ifdef DEVELOPER
13255 override void SetDebugItem()
13256 {
13257 super.SetDebugItem();
13258 _itemBase = this;
13259 }
13260
13262 {
13263 string text = super.GetDebugText();
13264
13266 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13267
13268 return text;
13269 }
13270 #endif
13271
13273 {
13274 return true;
13275 }
13276
13278
13280
13282 {
13285 }
13286
13287
13295
13311}
13312
13314{
13316 if (entity)
13317 {
13318 bool is_item = entity.IsInherited(
ItemBase);
13319 if (is_item && full_quantity)
13320 {
13323 }
13324 }
13325 else
13326 {
13328 return NULL;
13329 }
13330 return entity;
13331}
13332
13334{
13335 if (item)
13336 {
13337 if (health > 0)
13338 item.SetHealth("", "", health);
13339
13340 if (item.CanHaveTemperature())
13341 {
13343 if (item.CanFreeze())
13344 item.SetFrozen(false);
13345 }
13346
13347 if (item.HasEnergyManager())
13348 {
13349 if (quantity >= 0)
13350 {
13351 item.GetCompEM().SetEnergy0To1(quantity);
13352 }
13353 else
13354 {
13356 }
13357 }
13358 else if (item.IsMagazine())
13359 {
13360 Magazine mag = Magazine.Cast(item);
13361 if (quantity >= 0)
13362 {
13363 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13364 }
13365 else
13366 {
13368 }
13369
13370 }
13371 else
13372 {
13373 if (quantity >= 0)
13374 {
13375 item.SetQuantityNormalized(quantity, false);
13376 }
13377 else
13378 {
13380 }
13381
13382 }
13383 }
13384}
13385
13386#ifdef DEVELOPER
13388#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.