8460{
8462 {
8463 return true;
8464 }
8465};
8466
8467
8468
8470{
8474
8476
8479
8480
8481
8482
8483
8492
8498
8503
8508
8529 protected bool m_IsResultOfSplit
8530
8532
8537
8538
8539
8541
8545
8546
8547
8549
8552
8553
8554
8560
8561
8569
8572
8573
8575
8576
8578
8579
8584
8585
8590
8591
8593
8594
8596 {
8601
8602 if (!
GetGame().IsDedicatedServer())
8603 {
8605 {
8607
8609 {
8611 }
8612 }
8613
8616 }
8617
8618 m_OldLocation = null;
8619
8621 {
8623 }
8624
8625 if (ConfigIsExisting("headSelectionsToHide"))
8626 {
8629 }
8630
8632 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8633 {
8635 }
8636
8638
8639 m_IsResultOfSplit = false;
8640
8642 }
8643
8645 {
8646 super.InitItemVariables();
8647
8653 m_Count = ConfigGetInt(
"count");
8654
8657
8662
8665
8670
8682
8686
8687
8690 if (ConfigIsExisting("canBeSplit"))
8691 {
8694 }
8695
8697 if (ConfigIsExisting("itemBehaviour"))
8699
8700
8703 RegisterNetSyncVariableInt("m_VarLiquidType");
8704 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8705
8706 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8707 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8708 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8709
8710 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8711 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8712 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8713 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8714
8715 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8716 RegisterNetSyncVariableBool("m_IsTakeable");
8717 RegisterNetSyncVariableBool("m_IsHologram");
8718
8721 {
8724 }
8725
8727
8729 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8731
8732 }
8733
8735 {
8737 }
8738
8740 {
8743 {
8748 }
8749 }
8750
8751 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8752 {
8754 {
8757 }
8758
8760 }
8761
8763 {
8769 }
8770
8772
8774 {
8776
8777 if (!action)
8778 {
8779 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8780 return;
8781 }
8782
8784 if (!ai)
8785 {
8787 return;
8788 }
8789
8791 if (!action_array)
8792 {
8793 action_array = new array<ActionBase_Basic>;
8795 }
8796 if (LogManager.IsActionLogEnable())
8797 {
8798 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8799 }
8800
8801 if (action_array.Find(action) != -1)
8802 {
8803 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8804 }
8805 else
8806 {
8807 action_array.Insert(action);
8808 }
8809 }
8810
8812 {
8814 ActionBase action = player.GetActionManager().GetAction(actionName);
8817
8818 if (action_array)
8819 {
8820 action_array.RemoveItem(action);
8821 }
8822 }
8823
8824
8825
8827 {
8828 ActionOverrideData overrideData = new ActionOverrideData();
8832
8834 if (!actionMap)
8835 {
8838 }
8839
8840 actionMap.Insert(this.
Type(), overrideData);
8841
8842 }
8843
8845
8847
8848
8850 {
8853
8856
8857 string config_to_search = "CfgVehicles";
8858 string muzzle_owner_config;
8859
8861 {
8862 if (IsInherited(Weapon))
8863 config_to_search = "CfgWeapons";
8864
8865 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8866
8867 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8868
8870
8871 if (config_OnFire_subclass_count > 0)
8872 {
8873 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8874
8875 for (int i = 0; i < config_OnFire_subclass_count; i++)
8876 {
8877 string particle_class = "";
8879 string config_OnFire_entry = config_OnFire_class + particle_class;
8880 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8881 WPOF_array.Insert(WPOF);
8882 }
8883
8884
8886 }
8887 }
8888
8890 {
8891 config_to_search = "CfgWeapons";
8892 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8893
8894 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8895
8897
8898 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8899 {
8900 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8901
8902 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8903 {
8904 string particle_class2 = "";
8906 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8907 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8908 WPOBE_array.Insert(WPOBE);
8909 }
8910
8911
8913 }
8914 }
8915 }
8916
8917
8919 {
8922
8924 {
8925 string config_to_search = "CfgVehicles";
8926
8927 if (IsInherited(Weapon))
8928 config_to_search = "CfgWeapons";
8929
8930 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8931 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8932
8933 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8934 {
8935
8937
8939 {
8941 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8943 return;
8944 }
8945
8948
8949
8950
8952 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8953
8954 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8955 {
8956 string particle_class = "";
8958 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8960
8961 if (entry_type == CT_CLASS)
8962 {
8963 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8964 WPOOH_array.Insert(WPOF);
8965 }
8966 }
8967
8968
8970 }
8971 }
8972 }
8973
8975 {
8977 }
8978
8980 {
8982 {
8984
8987
8990
8991 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8992 }
8993 }
8994
8996 {
8998 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8999
9001 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9002
9004 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9005
9007 {
9009 }
9010 }
9011
9013 {
9015 }
9016
9018 {
9021 else
9023
9025 {
9028 }
9029 else
9030 {
9033
9036 }
9037
9039 }
9040
9042 {
9044 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9045 }
9046
9048 {
9050 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9052 }
9053
9055 {
9057 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9058 }
9059
9061 {
9064
9065 OverheatingParticle OP = new OverheatingParticle();
9070
9072 }
9073
9075 {
9078
9079 return -1;
9080 }
9081
9083 {
9085 {
9088
9089 for (int i = count; i > 0; --i)
9090 {
9091 int id = i - 1;
9094
9097
9098 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9099 {
9100 if (p)
9101 {
9104 }
9105 }
9106 }
9107 }
9108 }
9109
9111 {
9113 {
9115 {
9116 int id = i - 1;
9118
9119 if (OP)
9120 {
9122
9123 if (p)
9124 {
9126 }
9127
9128 delete OP;
9129 }
9130 }
9131
9134 }
9135 }
9136
9139 {
9140 return 0.0;
9141 }
9142
9143
9145 {
9146 return 250;
9147 }
9148
9150 {
9151 return 0;
9152 }
9153
9156 {
9158 return true;
9159
9160 return false;
9161 }
9162
9165 {
9168
9170 {
9172 }
9173 else
9174 {
9175
9177 }
9178
9180 }
9181
9188 {
9189 return -1;
9190 }
9191
9192
9193
9194
9196 {
9198 {
9200 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9201
9202 if (r_index >= 0)
9203 {
9204 InventoryLocation r_il = new InventoryLocation;
9205 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9206
9207 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9210 {
9211 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9212 }
9214 {
9215 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9216 }
9217
9218 }
9219
9220 player.GetHumanInventory().ClearUserReservedLocation(this);
9221 }
9222
9225 }
9226
9227
9228
9229
9231 {
9232 return ItemBase.m_DebugActionsMask;
9233 }
9234
9236 {
9237 return ItemBase.m_DebugActionsMask & mask;
9238 }
9239
9241 {
9242 ItemBase.m_DebugActionsMask = mask;
9243 }
9244
9246 {
9247 ItemBase.m_DebugActionsMask |= mask;
9248 }
9249
9251 {
9252 ItemBase.m_DebugActionsMask &= ~mask;
9253 }
9254
9256 {
9258 {
9260 }
9261 else
9262 {
9264 }
9265 }
9266
9267
9269 {
9270 if (GetEconomyProfile())
9271 {
9272 float q_max = GetEconomyProfile().GetQuantityMax();
9273 if (q_max > 0)
9274 {
9275 float q_min = GetEconomyProfile().GetQuantityMin();
9276 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9277
9279 {
9280 ComponentEnergyManager comp = GetCompEM();
9282 {
9284 }
9285 }
9287 {
9289
9290 }
9291
9292 }
9293 }
9294 }
9295
9298 {
9299 EntityAI parent = GetHierarchyParent();
9300
9301 if (parent)
9302 {
9303 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9304 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9305 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9306 }
9307 }
9308
9311 {
9312 EntityAI parent = GetHierarchyParent();
9313
9314 if (parent)
9315 {
9316 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9317 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9318 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9319 }
9320 }
9321
9323 {
9324
9325
9326
9327
9329
9331 {
9332 if (ScriptInputUserData.CanStoreInputUserData())
9333 {
9334 ScriptInputUserData ctx = new ScriptInputUserData;
9340 ctx.
Write(use_stack_max);
9343
9345 {
9346 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9347 }
9348 }
9349 }
9350 else if (!
GetGame().IsMultiplayer())
9351 {
9353 }
9354 }
9355
9357 {
9359 }
9360
9362 {
9364 }
9365
9367 {
9369 }
9370
9372 {
9373
9374 return false;
9375 }
9376
9378 {
9379 return false;
9380 }
9381
9385 {
9386 return false;
9387 }
9388
9390 {
9391 return "";
9392 }
9393
9395
9397 {
9398 return false;
9399 }
9400
9402 {
9403 return true;
9404 }
9405
9406
9407
9409 {
9410 return true;
9411 }
9412
9414 {
9415 return true;
9416 }
9417
9419 {
9420 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9422 }
9423
9425 {
9427 }
9428
9430 {
9432 if (!is_being_placed)
9434 SetSynchDirty();
9435 }
9436
9437
9439
9441 {
9443 }
9444
9446 {
9448 }
9449
9451 {
9452 return 1;
9453 }
9454
9456 {
9457 return false;
9458 }
9459
9461 {
9463 SetSynchDirty();
9464 }
9465
9466
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
9501 {
9502 super.OnMovedInsideCargo(container);
9503
9504 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9505 }
9506
9507 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9508 {
9509 super.EEItemLocationChanged(oldLoc,newLoc);
9510
9511 PlayerBase new_player = null;
9512 PlayerBase old_player = null;
9513
9514 if (newLoc.GetParent())
9515 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9516
9517 if (oldLoc.GetParent())
9518 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9519
9521 {
9522 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9523
9524 if (r_index >= 0)
9525 {
9526 InventoryLocation r_il = new InventoryLocation;
9527 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9528
9529 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9532 {
9533 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9534 }
9536 {
9537 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9538 }
9539
9540 }
9541 }
9542
9544 {
9545 if (new_player)
9546 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9547
9548 if (new_player == old_player)
9549 {
9550
9551 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9552 {
9554 {
9555 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9556 {
9557 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9558 }
9559 }
9560 else
9561 {
9562 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9563 }
9564 }
9565
9566 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9567 {
9568 int type = oldLoc.GetType();
9570 {
9571 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9572 }
9574 {
9575 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9576 }
9577 }
9578 if (!m_OldLocation)
9579 {
9580 m_OldLocation = new InventoryLocation;
9581 }
9582 m_OldLocation.Copy(oldLoc);
9583 }
9584 else
9585 {
9586 if (m_OldLocation)
9587 {
9588 m_OldLocation.Reset();
9589 }
9590 }
9591
9593 }
9594 else
9595 {
9596 if (new_player)
9597 {
9598 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9599 if (res_index >= 0)
9600 {
9601 InventoryLocation il = new InventoryLocation;
9602 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9604 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9607 {
9608 il.
GetParent().GetOnReleaseLock().Invoke(it);
9609 }
9611 {
9613 }
9614
9615 }
9616 }
9618 {
9619
9621 }
9622
9623 if (m_OldLocation)
9624 {
9625 m_OldLocation.Reset();
9626 }
9627 }
9628 }
9629
9630 override void EOnContact(IEntity other, Contact extra)
9631 {
9633 {
9634 int liquidType = -1;
9636 if (impactSpeed > 0.0)
9637 {
9639 #ifndef SERVER
9641 #else
9643 SetSynchDirty();
9644 #endif
9646 }
9647 }
9648
9649 #ifdef SERVER
9650 if (GetCompEM() && GetCompEM().IsPlugged())
9651 {
9652 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9653 GetCompEM().UnplugThis();
9654 }
9655 #endif
9656 }
9657
9659
9661 {
9663 }
9664
9666 {
9667
9668 }
9669
9671 {
9672 super.OnItemLocationChanged(old_owner, new_owner);
9673
9674 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9675 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9676
9677 if (!relatedPlayer && playerNew)
9678 relatedPlayer = playerNew;
9679
9680 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9681 {
9683 if (actionMgr)
9684 {
9685 ActionBase currentAction = actionMgr.GetRunningAction();
9686 if (currentAction)
9688 }
9689 }
9690
9691 Man ownerPlayerOld = null;
9692 Man ownerPlayerNew = null;
9693
9694 if (old_owner)
9695 {
9696 if (old_owner.
IsMan())
9697 {
9698 ownerPlayerOld = Man.Cast(old_owner);
9699 }
9700 else
9701 {
9702 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9703 }
9704 }
9705 else
9706 {
9708 {
9710
9711 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9712 {
9713 GetCompEM().UnplugThis();
9714 }
9715 }
9716 }
9717
9718 if (new_owner)
9719 {
9720 if (new_owner.
IsMan())
9721 {
9722 ownerPlayerNew = Man.Cast(new_owner);
9723 }
9724 else
9725 {
9726 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9727 }
9728 }
9729
9730 if (ownerPlayerOld != ownerPlayerNew)
9731 {
9732 if (ownerPlayerOld)
9733 {
9734 array<EntityAI> subItemsExit = new array<EntityAI>;
9736 for (int i = 0; i < subItemsExit.Count(); i++)
9737 {
9740 }
9741 }
9742
9743 if (ownerPlayerNew)
9744 {
9745 array<EntityAI> subItemsEnter = new array<EntityAI>;
9747 for (int j = 0; j < subItemsEnter.Count(); j++)
9748 {
9751 }
9752 }
9753 }
9754 else if (ownerPlayerNew != null)
9755 {
9756 PlayerBase nplayer;
9757 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9758 {
9759 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9761 for (int k = 0; k < subItemsUpdate.Count(); k++)
9762 {
9764 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9765 }
9766 }
9767 }
9768
9769 if (old_owner)
9770 old_owner.OnChildItemRemoved(this);
9771 if (new_owner)
9772 new_owner.OnChildItemReceived(this);
9773 }
9774
9775
9777 {
9778 super.EEDelete(parent);
9779 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9780 if (player)
9781 {
9783
9784 if (player.IsAlive())
9785 {
9786 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9787 if (r_index >= 0)
9788 {
9789 InventoryLocation r_il = new InventoryLocation;
9790 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9791
9792 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9795 {
9796 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9797 }
9799 {
9800 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9801 }
9802
9803 }
9804
9805 player.RemoveQuickBarEntityShortcut(this);
9806 }
9807 }
9808 }
9809
9811 {
9812 super.EEKilled(killer);
9813
9816 {
9817 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9818 {
9819 if (IsMagazine())
9820 {
9821 if (Magazine.Cast(this).GetAmmoCount() > 0)
9822 {
9824 }
9825 }
9826 else
9827 {
9829 }
9830 }
9831 }
9832 }
9833
9835 {
9836 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9837
9838 super.OnWasAttached(parent, slot_id);
9839
9842
9844 }
9845
9847 {
9848 super.OnWasDetached(parent, slot_id);
9849
9852 }
9853
9855 {
9856 int idx;
9859
9860 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9861 if (inventory_slots.Count() < 1)
9862 {
9863 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9864 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9865 }
9866 else
9867 {
9868 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9869 }
9870
9871 idx = inventory_slots.Find(slot);
9872 if (idx < 0)
9873 return "";
9874
9875 return attach_types.Get(idx);
9876 }
9877
9879 {
9880 int idx = -1;
9881 string slot;
9882
9885
9886 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9887 if (inventory_slots.Count() < 1)
9888 {
9889 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9890 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9891 }
9892 else
9893 {
9894 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9895 if (detach_types.Count() < 1)
9896 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9897 }
9898
9899 for (int i = 0; i < inventory_slots.Count(); i++)
9900 {
9901 slot = inventory_slots.Get(i);
9902 }
9903
9904 if (slot != "")
9905 {
9906 if (detach_types.Count() == 1)
9907 idx = 0;
9908 else
9909 idx = inventory_slots.Find(slot);
9910 }
9911 if (idx < 0)
9912 return "";
9913
9914 return detach_types.Get(idx);
9915 }
9916
9918 {
9919
9921
9922
9923 float min_time = 1;
9924 float max_time = 3;
9925 float delay = Math.RandomFloat(min_time, max_time);
9926
9927 explode_timer.Run(delay, this, "DoAmmoExplosion");
9928 }
9929
9931 {
9932 Magazine magazine = Magazine.Cast(this);
9933 int pop_sounds_count = 6;
9934 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9935
9936
9937 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9938 string sound_name = pop_sounds[ sound_idx ];
9940
9941
9942 magazine.ServerAddAmmoCount(-1);
9943
9944
9945 float min_temp_to_explode = 100;
9946
9947 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9948 {
9950 }
9951 }
9952
9953
9954 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9955 {
9956 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9957
9958 const int CHANCE_DAMAGE_CARGO = 4;
9959 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9960 const int CHANCE_DAMAGE_NOTHING = 2;
9961
9963 {
9964 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9965 int chances;
9966 int rnd;
9967
9968 if (GetInventory().GetCargo())
9969 {
9970 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9971 rnd = Math.RandomInt(0,chances);
9972
9973 if (rnd < CHANCE_DAMAGE_CARGO)
9974 {
9976 }
9977 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9978 {
9980 }
9981 }
9982 else
9983 {
9984 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9985 rnd = Math.RandomInt(0,chances);
9986
9987 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9988 {
9990 }
9991 }
9992 }
9993 }
9994
9996 {
9997 if (GetInventory().GetCargo())
9998 {
9999 int item_count = GetInventory().GetCargo().GetItemCount();
10000 if (item_count > 0)
10001 {
10002 int random_pick = Math.RandomInt(0, item_count);
10004 if (!item.IsExplosive())
10005 {
10006 item.AddHealth("","",damage);
10007 return true;
10008 }
10009 }
10010 }
10011 return false;
10012 }
10013
10015 {
10016 int attachment_count = GetInventory().AttachmentCount();
10017 if (attachment_count > 0)
10018 {
10019 int random_pick = Math.RandomInt(0, attachment_count);
10020 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10021 if (!attachment.IsExplosive())
10022 {
10023 attachment.AddHealth("","",damage);
10024 return true;
10025 }
10026 }
10027 return false;
10028 }
10029
10031 {
10033 }
10034
10036 {
10038 return GetInventory().CanRemoveEntity();
10039
10040 return false;
10041 }
10042
10044 {
10046 return;
10047
10049 {
10050 if (ScriptInputUserData.CanStoreInputUserData())
10051 {
10052 ScriptInputUserData ctx = new ScriptInputUserData;
10057 ctx.
Write(destination_entity);
10059 ctx.
Write(slot_id);
10061 }
10062 }
10063 else if (!
GetGame().IsMultiplayer())
10064 {
10066 }
10067 }
10068
10070 {
10072 return;
10073
10074 float split_quantity_new;
10078 InventoryLocation loc = new InventoryLocation;
10079
10080 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10081 {
10083 split_quantity_new = stack_max;
10084 else
10086
10087 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10088 if (new_item)
10089 {
10090 new_item.SetResultOfSplit(true);
10091 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10093 new_item.SetQuantity(split_quantity_new);
10094 }
10095 }
10096 else if (destination_entity && slot_id == -1)
10097 {
10098 if (quantity > stack_max)
10099 split_quantity_new = stack_max;
10100 else
10101 split_quantity_new = quantity;
10102
10104 {
10107 }
10108
10109 if (new_item)
10110 {
10111 new_item.SetResultOfSplit(true);
10112 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10114 new_item.SetQuantity(split_quantity_new);
10115 }
10116 }
10117 else
10118 {
10119 if (stack_max != 0)
10120 {
10122 {
10124 }
10125
10126 if (split_quantity_new == 0)
10127 {
10128 if (!
GetGame().IsMultiplayer())
10129 player.PhysicalPredictiveDropItem(this);
10130 else
10131 player.ServerDropEntity(this);
10132 return;
10133 }
10134
10136
10137 if (new_item)
10138 {
10139 new_item.SetResultOfSplit(true);
10140 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10142 new_item.SetQuantity(stack_max);
10143 new_item.PlaceOnSurface();
10144 }
10145 }
10146 }
10147 }
10148
10150 {
10152 return;
10153
10154 float split_quantity_new;
10158 InventoryLocation loc = new InventoryLocation;
10159
10160 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10161 {
10163 split_quantity_new = stack_max;
10164 else
10166
10167 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10168 if (new_item)
10169 {
10170 new_item.SetResultOfSplit(true);
10171 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10173 new_item.SetQuantity(split_quantity_new);
10174 }
10175 }
10176 else if (destination_entity && slot_id == -1)
10177 {
10178 if (quantity > stack_max)
10179 split_quantity_new = stack_max;
10180 else
10181 split_quantity_new = quantity;
10182
10184 {
10187 }
10188
10189 if (new_item)
10190 {
10191 new_item.SetResultOfSplit(true);
10192 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10194 new_item.SetQuantity(split_quantity_new);
10195 }
10196 }
10197 else
10198 {
10199 if (stack_max != 0)
10200 {
10202 {
10204 }
10205
10207
10208 if (new_item)
10209 {
10210 new_item.SetResultOfSplit(true);
10211 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10213 new_item.SetQuantity(stack_max);
10214 new_item.PlaceOnSurface();
10215 }
10216 }
10217 }
10218 }
10219
10221 {
10223 return;
10224
10226 {
10227 if (ScriptInputUserData.CanStoreInputUserData())
10228 {
10229 ScriptInputUserData ctx = new ScriptInputUserData;
10234 dst.WriteToContext(ctx);
10236 }
10237 }
10238 else if (!
GetGame().IsMultiplayer())
10239 {
10241 }
10242 }
10243
10245 {
10247 return;
10248
10250 {
10251 if (ScriptInputUserData.CanStoreInputUserData())
10252 {
10253 ScriptInputUserData ctx = new ScriptInputUserData;
10258 ctx.
Write(destination_entity);
10264 }
10265 }
10266 else if (!
GetGame().IsMultiplayer())
10267 {
10269 }
10270 }
10271
10273 {
10275 }
10276
10278 {
10280 return this;
10281
10283 float split_quantity_new;
10285 if (dst.IsValid())
10286 {
10287 int slot_id = dst.GetSlot();
10289
10290 if (quantity > stack_max)
10291 split_quantity_new = stack_max;
10292 else
10293 split_quantity_new = quantity;
10294
10296
10297 if (new_item)
10298 {
10299 new_item.SetResultOfSplit(true);
10300 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10303 }
10304
10305 return new_item;
10306 }
10307
10308 return null;
10309 }
10310
10312 {
10314 return;
10315
10317 float split_quantity_new;
10319 if (destination_entity)
10320 {
10322 if (quantity > stackable)
10323 split_quantity_new = stackable;
10324 else
10325 split_quantity_new = quantity;
10326
10327 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10328 if (new_item)
10329 {
10330 new_item.SetResultOfSplit(true);
10331 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10333 new_item.SetQuantity(split_quantity_new);
10334 }
10335 }
10336 }
10337
10339 {
10341 return;
10342
10344 {
10345 if (ScriptInputUserData.CanStoreInputUserData())
10346 {
10347 ScriptInputUserData ctx = new ScriptInputUserData;
10352 ItemBase destination_entity =
this;
10353 ctx.
Write(destination_entity);
10357 }
10358 }
10359 else if (!
GetGame().IsMultiplayer())
10360 {
10362 }
10363 }
10364
10366 {
10368 return;
10369
10371 float split_quantity_new;
10373 if (player)
10374 {
10376 if (quantity > stackable)
10377 split_quantity_new = stackable;
10378 else
10379 split_quantity_new = quantity;
10380
10381 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10382 new_item =
ItemBase.Cast(in_hands);
10383 if (new_item)
10384 {
10385 new_item.SetResultOfSplit(true);
10386 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10388 new_item.SetQuantity(split_quantity_new);
10389 }
10390 }
10391 }
10392
10394 {
10396 return;
10397
10399 float split_quantity_new = Math.Floor(quantity * 0.5);
10400
10402
10403 if (new_item)
10404 {
10405 if (new_item.GetQuantityMax() < split_quantity_new)
10406 {
10407 split_quantity_new = new_item.GetQuantityMax();
10408 }
10409
10410 new_item.SetResultOfSplit(true);
10411 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10412
10414 {
10417 }
10418 else
10419 {
10422 }
10423 }
10424 }
10425
10427 {
10429 return;
10430
10432 float split_quantity_new = Math.Floor(quantity / 2);
10433
10434 InventoryLocation invloc = new InventoryLocation;
10436
10438 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10439
10440 if (new_item)
10441 {
10442 if (new_item.GetQuantityMax() < split_quantity_new)
10443 {
10444 split_quantity_new = new_item.GetQuantityMax();
10445 }
10447 {
10450 }
10451 else
10452 {
10455 }
10456 }
10457 }
10458
10461 {
10462 SetWeightDirty();
10464
10465 if (parent)
10466 parent.OnAttachmentQuantityChangedEx(this, delta);
10467
10469 {
10471 {
10473 }
10475 {
10476 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10478 }
10479 }
10480
10481 }
10482
10485 {
10486
10487 }
10488
10491 {
10493 }
10494
10496 {
10497 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10498
10500 {
10501 if (newLevel == GameConstants.STATE_RUINED)
10502 {
10504 EntityAI parent = GetHierarchyParent();
10505 if (parent && parent.IsFireplace())
10506 {
10507 CargoBase cargo = GetInventory().GetCargo();
10508 if (cargo)
10509 {
10511 {
10513 }
10514 }
10515 }
10516 }
10517
10519 {
10520
10522 return;
10523 }
10524
10525 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10526 {
10528 }
10529 }
10530 }
10531
10532
10534 {
10535 super.OnRightClick();
10536
10538 {
10540 {
10541 if (ScriptInputUserData.CanStoreInputUserData())
10542 {
10543 vector m4[4];
10545
10546 EntityAI root = GetHierarchyRoot();
10547
10548 InventoryLocation dst = new InventoryLocation;
10550 {
10551 if (root)
10552 {
10553 root.GetTransform(m4);
10555 }
10556 else
10557 GetInventory().GetCurrentInventoryLocation(dst);
10558 }
10559 else
10560 {
10562
10563
10564 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10565 {
10566 if (root)
10567 {
10568 root.GetTransform(m4);
10570 }
10571 else
10572 GetInventory().GetCurrentInventoryLocation(dst);
10573 }
10574 else
10575 {
10576 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10577 }
10578 }
10579
10580 ScriptInputUserData ctx = new ScriptInputUserData;
10588 }
10589 }
10590 else if (!
GetGame().IsMultiplayer())
10591 {
10593 }
10594 }
10595 }
10596
10597 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10598 {
10599
10600 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10601 return false;
10602
10603 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10604 return false;
10605
10606
10608 return false;
10609
10610
10611 Magazine mag = Magazine.Cast(this);
10612 if (mag)
10613 {
10614 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10615 return false;
10616
10617 if (stack_max_limit)
10618 {
10619 Magazine other_mag = Magazine.Cast(other_item);
10620 if (other_item)
10621 {
10622 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10623 return false;
10624 }
10625
10626 }
10627 }
10628 else
10629 {
10630
10632 return false;
10633
10635 return false;
10636 }
10637
10638 PlayerBase player = null;
10639 if (CastTo(player, GetHierarchyRootPlayer()))
10640 {
10641 if (player.GetInventory().HasAttachment(this))
10642 return false;
10643
10644 if (player.IsItemsToDelete())
10645 return false;
10646 }
10647
10648 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10649 return false;
10650
10651 int slotID;
10653 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10654 return false;
10655
10656 return true;
10657 }
10658
10660 {
10662 }
10663
10665 {
10666 return m_IsResultOfSplit;
10667 }
10668
10670 {
10671 m_IsResultOfSplit = value;
10672 }
10673
10675 {
10677 }
10678
10680 {
10681 float other_item_quantity = other_item.GetQuantity();
10682 float this_free_space;
10683
10685
10687
10688 if (other_item_quantity > this_free_space)
10689 {
10690 return this_free_space;
10691 }
10692 else
10693 {
10694 return other_item_quantity;
10695 }
10696 }
10697
10699 {
10701 }
10702
10704 {
10706 return;
10707
10708 if (!IsMagazine() && other_item)
10709 {
10711 if (quantity_used != 0)
10712 {
10713 float hp1 = GetHealth01("","");
10714 float hp2 = other_item.GetHealth01("","");
10715 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10716 hpResult = hpResult / (
GetQuantity() + quantity_used);
10717
10718 hpResult *= GetMaxHealth();
10719 Math.Round(hpResult);
10720 SetHealth("", "Health", hpResult);
10721
10723 other_item.AddQuantity(-quantity_used);
10724 }
10725 }
10727 }
10728
10730 {
10731 #ifdef SERVER
10732 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10733 GetHierarchyParent().IncreaseLifetimeUp();
10734 #endif
10735 };
10736
10738 {
10739 PlayerBase p = PlayerBase.Cast(player);
10740
10741 array<int> recipesIds = p.m_Recipes;
10742 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10743 if (moduleRecipesManager)
10744 {
10745 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10746 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10747 }
10748
10749 for (int i = 0;i < recipesIds.Count(); i++)
10750 {
10751 int key = recipesIds.Get(i);
10752 string recipeName = moduleRecipesManager.GetRecipeName(key);
10754 }
10755 }
10756
10757
10758 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10759 {
10760 super.GetDebugActions(outputList);
10761
10762
10767
10768
10772
10776
10777
10780
10781
10783 {
10786 }
10787
10789
10792
10796 }
10797
10798
10799
10800
10802 {
10803 super.OnAction(action_id, player, ctx);
10804 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10805 {
10806 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10807 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10808 PlayerBase p = PlayerBase.Cast(player);
10809 if (
EActions.RECIPES_RANGE_START < 1000)
10810 {
10811 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10812 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10813 }
10814 }
10815 #ifndef SERVER
10816 else if (action_id ==
EActions.WATCH_PLAYER)
10817 {
10818 PluginDeveloper.SetDeveloperItemClientEx(player);
10819 }
10820 #endif
10822 {
10823 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10824 {
10825 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10826 OnDebugButtonPressServer(id + 1);
10827 }
10828
10829 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10830 {
10831 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10833 }
10834
10835 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10836 {
10837 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10839 }
10840
10841 else if (action_id ==
EActions.ADD_QUANTITY)
10842 {
10843 if (IsMagazine())
10844 {
10845 Magazine mag = Magazine.Cast(this);
10846 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10847 }
10848 else
10849 {
10851 }
10852
10853 if (m_EM)
10854 {
10855 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10856 }
10857
10858 }
10859
10860 else if (action_id ==
EActions.REMOVE_QUANTITY)
10861 {
10862 if (IsMagazine())
10863 {
10864 Magazine mag2 = Magazine.Cast(this);
10865 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10866 }
10867 else
10868 {
10870 }
10871 if (m_EM)
10872 {
10873 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10874 }
10875
10876 }
10877
10878 else if (action_id ==
EActions.SET_QUANTITY_0)
10879 {
10881
10882 if (m_EM)
10883 {
10884 m_EM.SetEnergy(0);
10885 }
10886 }
10887
10888 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10889 {
10891
10892 if (m_EM)
10893 {
10894 m_EM.SetEnergy(m_EM.GetEnergyMax());
10895 }
10896 }
10897
10898 else if (action_id ==
EActions.ADD_HEALTH)
10899 {
10900 AddHealth("","",GetMaxHealth("","Health")/5);
10901 }
10902 else if (action_id ==
EActions.REMOVE_HEALTH)
10903 {
10904 AddHealth("","",-GetMaxHealth("","Health")/5);
10905 }
10906 else if (action_id ==
EActions.DESTROY_HEALTH)
10907 {
10908 SetHealth01("","",0);
10909 }
10910 else if (action_id ==
EActions.WATCH_ITEM)
10911 {
10913 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10914 #ifdef DEVELOPER
10915 SetDebugDeveloper_item(this);
10916 #endif
10917 }
10918
10919 else if (action_id ==
EActions.ADD_TEMPERATURE)
10920 {
10921 AddTemperature(20);
10922
10923 }
10924
10925 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10926 {
10927 AddTemperature(-20);
10928
10929 }
10930
10931 else if (action_id ==
EActions.FLIP_FROZEN)
10932 {
10933 SetFrozen(!GetIsFrozen());
10934
10935 }
10936
10937 else if (action_id ==
EActions.ADD_WETNESS)
10938 {
10940
10941 }
10942
10943 else if (action_id ==
EActions.REMOVE_WETNESS)
10944 {
10946
10947 }
10948
10949 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10950 {
10953
10954
10955 }
10956
10957 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10958 {
10961 }
10962
10963 else if (action_id ==
EActions.MAKE_SPECIAL)
10964 {
10965 auto debugParams = DebugSpawnParams.WithPlayer(player);
10966 OnDebugSpawnEx(debugParams);
10967 }
10968
10969 else if (action_id ==
EActions.DELETE)
10970 {
10971 Delete();
10972 }
10973
10974 }
10975
10976
10977 return false;
10978 }
10979
10980
10981
10982
10986
10989
10990
10991
10993 {
10994 return false;
10995 }
10996
10997
10999 {
11000 return true;
11001 }
11002
11003
11005 {
11006 return true;
11007 }
11008
11009
11010
11012 {
11013 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11015 }
11016
11019 {
11020 return null;
11021 }
11022
11024 {
11025 return false;
11026 }
11027
11029 {
11030 return false;
11031 }
11032
11036
11037
11039 {
11040 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11041 return module_repairing.CanRepair(this, item_repair_kit);
11042 }
11043
11044
11045 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11046 {
11047 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11048 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11049 }
11050
11051
11053 {
11054
11055
11056
11057
11058
11059
11060
11061
11062 return 1;
11063 }
11064
11065
11066
11068 {
11070 }
11071
11072
11073
11075 {
11077 }
11078
11079
11088 {
11089 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11090
11091 if (player)
11092 {
11093 player.MessageStatus(text);
11094 }
11095 }
11096
11097
11106 {
11107 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11108
11109 if (player)
11110 {
11111 player.MessageAction(text);
11112 }
11113 }
11114
11115
11124 {
11125 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11126
11127 if (player)
11128 {
11129 player.MessageFriendly(text);
11130 }
11131 }
11132
11133
11142 {
11143 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11144
11145 if (player)
11146 {
11147 player.MessageImportant(text);
11148 }
11149 }
11150
11152 {
11153 return true;
11154 }
11155
11156
11157 override bool KindOf(
string tag)
11158 {
11159 bool found = false;
11160 string item_name = this.
GetType();
11163
11164 int array_size = item_tag_array.Count();
11165 for (int i = 0; i < array_size; i++)
11166 {
11167 if (item_tag_array.Get(i) == tag)
11168 {
11169 found = true;
11170 break;
11171 }
11172 }
11173 return found;
11174 }
11175
11176
11178 {
11179
11180 super.OnRPC(sender, rpc_type,ctx);
11181
11182
11183 switch (rpc_type)
11184 {
11185 #ifndef SERVER
11186 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11187 Param2<bool, string> p = new Param2<bool, string>(false, "");
11188
11190 return;
11191
11192 bool play = p.param1;
11193 string soundSet = p.param2;
11194
11195 if (play)
11196 {
11198 {
11200 {
11202 }
11203 }
11204 else
11205 {
11207 }
11208 }
11209 else
11210 {
11212 }
11213
11214 break;
11215 #endif
11216
11217 }
11218
11220 {
11222 }
11223 }
11224
11225
11226
11227
11229 {
11230 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11231 return plugin.GetID(
name);
11232 }
11233
11235 {
11236 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11237 return plugin.GetName(id);
11238 }
11239
11242 {
11243
11244
11245 int varFlags;
11246 if (!ctx.
Read(varFlags))
11247 return;
11248
11249 if (varFlags & ItemVariableFlags.FLOAT)
11250 {
11252 }
11253 }
11254
11256 {
11257
11258 super.SerializeNumericalVars(floats_out);
11259
11260
11261
11263 {
11265 }
11266
11268 {
11270 }
11271
11273 {
11275 }
11276
11278 {
11283 }
11284
11286 {
11288 }
11289 }
11290
11292 {
11293
11294 super.DeSerializeNumericalVars(floats);
11295
11296
11297 int index = 0;
11298 int mask = Math.Round(floats.Get(index));
11299
11300 index++;
11301
11303 {
11305 {
11307 }
11308 else
11309 {
11310 float quantity = floats.Get(index);
11311 SetQuantity(quantity,
true,
false,
false,
false);
11312 }
11313 index++;
11314 }
11315
11317 {
11318 float wet = floats.Get(index);
11320 index++;
11321 }
11322
11324 {
11325 int liquidtype = Math.Round(floats.Get(index));
11327 index++;
11328 }
11329
11331 {
11333 index++;
11335 index++;
11337 index++;
11339 index++;
11340 }
11341
11343 {
11344 int cleanness = Math.Round(floats.Get(index));
11346 index++;
11347 }
11348 }
11349
11351 {
11352 super.WriteVarsToCTX(ctx);
11353
11354
11356 {
11358 }
11359
11361 {
11363 }
11364
11366 {
11368 }
11369
11371 {
11372 int r,g,b,a;
11378 }
11379
11381 {
11383 }
11384 }
11385
11387 {
11388 if (!super.ReadVarsFromCTX(ctx,version))
11389 return false;
11390
11391 int intValue;
11392 float value;
11393
11394 if (version < 140)
11395 {
11396 if (!ctx.
Read(intValue))
11397 return false;
11398
11399 m_VariablesMask = intValue;
11400 }
11401
11403 {
11404 if (!ctx.
Read(value))
11405 return false;
11406
11408 {
11410 }
11411 else
11412 {
11414 }
11415 }
11416
11417 if (version < 140)
11418 {
11420 {
11421 if (!ctx.
Read(value))
11422 return false;
11423 SetTemperatureDirect(value);
11424 }
11425 }
11426
11428 {
11429 if (!ctx.
Read(value))
11430 return false;
11432 }
11433
11435 {
11436 if (!ctx.
Read(intValue))
11437 return false;
11439 }
11440
11442 {
11443 int r,g,b,a;
11445 return false;
11447 return false;
11449 return false;
11451 return false;
11452
11454 }
11455
11457 {
11458 if (!ctx.
Read(intValue))
11459 return false;
11461 }
11462
11463 if (version >= 138 && version < 140)
11464 {
11466 {
11467 if (!ctx.
Read(intValue))
11468 return false;
11469 SetFrozen(intValue);
11470 }
11471 }
11472
11473 return true;
11474 }
11475
11476
11478 {
11481 {
11483 }
11484
11485 if (!super.OnStoreLoad(ctx, version))
11486 {
11488 return false;
11489 }
11490
11491 if (version >= 114)
11492 {
11493 bool hasQuickBarIndexSaved;
11494
11495 if (!ctx.
Read(hasQuickBarIndexSaved))
11496 {
11498 return false;
11499 }
11500
11501 if (hasQuickBarIndexSaved)
11502 {
11503 int itmQBIndex;
11504
11505
11506 if (!ctx.
Read(itmQBIndex))
11507 {
11509 return false;
11510 }
11511
11512 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11513 if (itmQBIndex != -1 && parentPlayer)
11514 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11515 }
11516 }
11517 else
11518 {
11519
11520 PlayerBase player;
11521 int itemQBIndex;
11522 if (version ==
int.
MAX)
11523 {
11524 if (!ctx.
Read(itemQBIndex))
11525 {
11527 return false;
11528 }
11529 }
11530 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11531 {
11532
11533 if (!ctx.
Read(itemQBIndex))
11534 {
11536 return false;
11537 }
11538 if (itemQBIndex != -1 && player)
11539 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11540 }
11541 }
11542
11543 if (version < 140)
11544 {
11545
11546 if (!LoadVariables(ctx, version))
11547 {
11549 return false;
11550 }
11551 }
11552
11553
11555 {
11557 return false;
11558 }
11559 if (version >= 132)
11560 {
11562 if (raib)
11563 {
11565 {
11567 return false;
11568 }
11569 }
11570 }
11571
11573 return true;
11574 }
11575
11576
11577
11579 {
11580 super.OnStoreSave(ctx);
11581
11582 PlayerBase player;
11583 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11584 {
11586
11587 int itemQBIndex = -1;
11588 itemQBIndex = player.FindQuickBarEntityIndex(this);
11589 ctx.
Write(itemQBIndex);
11590 }
11591 else
11592 {
11594 }
11595
11597
11599 if (raib)
11600 {
11602 }
11603 }
11604
11605
11607 {
11608 super.AfterStoreLoad();
11609
11611 {
11613 }
11614
11616 {
11619 }
11620 }
11621
11623 {
11624 super.EEOnAfterLoad();
11625
11627 {
11629 }
11630
11633 }
11634
11636 {
11637 return false;
11638 }
11639
11640
11641
11643 {
11645 {
11646 #ifdef PLATFORM_CONSOLE
11647
11649 {
11651 if (menu)
11652 {
11654 }
11655 }
11656 #endif
11657 }
11658
11660 {
11663 }
11664
11666 {
11667 SetWeightDirty();
11669 }
11671 {
11674 }
11675
11677 {
11680 }
11682 {
11685 }
11686
11687 super.OnVariablesSynchronized();
11688 }
11689
11690
11691
11693 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11694 {
11695 if (!IsServerCheck(allow_client))
11696 return false;
11697
11699 return false;
11700
11703
11704 if (value <= (min + 0.001))
11705 value = min;
11706
11707 if (value == min)
11708 {
11709 if (destroy_config)
11710 {
11711 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11712 if (dstr)
11713 {
11715 this.Delete();
11716 return true;
11717 }
11718 }
11719 else if (destroy_forced)
11720 {
11722 this.Delete();
11723 return true;
11724 }
11725
11727 }
11728
11731
11733 {
11735
11736 if (delta)
11738 }
11739
11741
11742 return false;
11743 }
11744
11745
11747 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11748 {
11750 }
11751
11753 {
11756 }
11757
11759 {
11762 }
11763
11766 {
11767 float value_clamped = Math.Clamp(value, 0, 1);
11769 SetQuantity(result, destroy_config, destroy_forced);
11770 }
11771
11772
11775 {
11777 }
11778
11780 {
11782 }
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11794 {
11795 int slot = -1;
11796 if (GetInventory())
11797 {
11798 InventoryLocation il = new InventoryLocation;
11799 GetInventory().GetCurrentInventoryLocation(il);
11801 }
11802
11804 }
11805
11807 {
11808 float quantity_max = 0;
11809
11811 {
11812 if (attSlotID != -1)
11813 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11814
11815 if (quantity_max <= 0)
11817 }
11818
11819 if (quantity_max <= 0)
11821
11822 return quantity_max;
11823 }
11824
11826 {
11828 }
11829
11831 {
11833 }
11834
11835
11837 {
11839 }
11840
11842 {
11844 }
11845
11847 {
11849 }
11850
11851
11853 {
11854
11855 float weightEx = GetWeightEx();
11856 float special = GetInventoryAndCargoWeight();
11857 return weightEx - special;
11858 }
11859
11860
11862 {
11864 }
11865
11867 {
11869 {
11870 #ifdef DEVELOPER
11871 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11872 {
11873 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11875 }
11876 #endif
11877
11878 return GetQuantity() * GetConfigWeightModified();
11879 }
11880 else if (HasEnergyManager())
11881 {
11882 #ifdef DEVELOPER
11883 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11884 {
11885 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11886 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11887 }
11888 #endif
11889 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11890 }
11891 else
11892 {
11893 #ifdef DEVELOPER
11894 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11895 {
11896 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11897 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11898 }
11899 #endif
11900 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11901 }
11902 }
11903
11906 {
11907 int item_count = 0;
11909
11910 if (GetInventory().GetCargo() != NULL)
11911 {
11912 item_count = GetInventory().GetCargo().GetItemCount();
11913 }
11914
11915 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11916 {
11917 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11918 if (item)
11919 item_count += item.GetNumberOfItems();
11920 }
11921 return item_count;
11922 }
11923
11926 {
11927 float weight = 0;
11928 float wetness = 1;
11929 if (include_wetness)
11932 {
11933 weight = wetness * m_ConfigWeight;
11934 }
11936 {
11937 weight = 1;
11938 }
11939 return weight;
11940 }
11941
11942
11943
11945 {
11946 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11947 {
11948 GameInventory inv = GetInventory();
11949 array<EntityAI> items = new array<EntityAI>;
11951 for (int i = 0; i < items.Count(); i++)
11952 {
11954 if (item)
11955 {
11957 }
11958 }
11959 }
11960 }
11961
11962
11963
11964
11966 {
11967 float energy = 0;
11968 if (HasEnergyManager())
11969 {
11970 energy = GetCompEM().GetEnergy();
11971 }
11972 return energy;
11973 }
11974
11975
11977 {
11978 super.OnEnergyConsumed();
11979
11981 }
11982
11984 {
11985 super.OnEnergyAdded();
11986
11988 }
11989
11990
11992 {
11993 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11994 {
11996 {
11997 float energy_0to1 = GetCompEM().GetEnergy0To1();
11999 }
12000 }
12001 }
12002
12003
12005 {
12006 return ConfigGetFloat("heatIsolation");
12007 }
12008
12010 {
12012 }
12013
12015 {
12016 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12017 if (
GetGame().ConfigIsExisting(paramPath))
12019
12020 return 0.0;
12021 }
12022
12024 {
12025 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12026 if (
GetGame().ConfigIsExisting(paramPath))
12028
12029 return 0.0;
12030 }
12031
12032 override void SetWet(
float value,
bool allow_client =
false)
12033 {
12034 if (!IsServerCheck(allow_client))
12035 return;
12036
12039
12041
12042 m_VarWet = Math.Clamp(value, min, max);
12043
12045 {
12048 }
12049 }
12050
12051 override void AddWet(
float value)
12052 {
12054 }
12055
12057 {
12059 }
12060
12062 {
12064 }
12065
12067 {
12069 }
12070
12072 {
12074 }
12075
12077 {
12079 }
12080
12081 override void OnWetChanged(
float newVal,
float oldVal)
12082 {
12085 if (newLevel != oldLevel)
12086 {
12088 }
12089 }
12090
12092 {
12093 SetWeightDirty();
12094 }
12095
12097 {
12098 return GetWetLevelInternal(
m_VarWet);
12099 }
12100
12101
12102
12104 {
12106 }
12107
12109 {
12111 }
12112
12114 {
12116 }
12117
12119 {
12121 }
12122
12123
12124
12126 {
12127 if (ConfigIsExisting("itemModelLength"))
12128 {
12129 return ConfigGetFloat("itemModelLength");
12130 }
12131 return 0;
12132 }
12133
12135 {
12136 if (ConfigIsExisting("itemAttachOffset"))
12137 {
12138 return ConfigGetFloat("itemAttachOffset");
12139 }
12140 return 0;
12141 }
12142
12143 override void SetCleanness(
int value,
bool allow_client =
false)
12144 {
12145 if (!IsServerCheck(allow_client))
12146 return;
12147
12149
12151
12154 }
12155
12157 {
12159 }
12160
12162 {
12163 return true;
12164 }
12165
12166
12167
12168
12170 {
12172 }
12173
12175 {
12177 }
12178
12179
12180
12181
12182 override void SetColor(
int r,
int g,
int b,
int a)
12183 {
12189 }
12191 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12192 {
12197 }
12198
12200 {
12202 }
12203
12206 {
12207 int r,g,b,a;
12209 r = r/255;
12210 g = g/255;
12211 b = b/255;
12212 a = a/255;
12213 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12214 }
12215
12216
12217
12218 override void SetLiquidType(
int value,
bool allow_client =
false)
12219 {
12220 if (!IsServerCheck(allow_client))
12221 return;
12222
12227 }
12228
12230 {
12231 return ConfigGetInt("varLiquidTypeInit");
12232 }
12233
12235 {
12237 }
12238
12240 {
12242 SetFrozen(false);
12243 }
12244
12247 {
12248 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12249 }
12250
12251
12254 {
12255 PlayerBase nplayer;
12256 if (PlayerBase.CastTo(nplayer, player))
12257 {
12259
12260 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12261 }
12262 }
12263
12264
12267 {
12268 PlayerBase nplayer;
12269 if (PlayerBase.CastTo(nplayer,player))
12270 {
12271
12272 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12273
12274 }
12275
12276
12277 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12278
12279
12280 if (HasEnergyManager())
12281 {
12282 GetCompEM().UpdatePlugState();
12283 }
12284 }
12285
12286
12288 {
12289 super.OnPlacementStarted(player);
12290
12292 }
12293
12294 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12295 {
12297 {
12298 m_AdminLog.OnPlacementComplete(player,
this);
12299 }
12300
12301 super.OnPlacementComplete(player, position, orientation);
12302 }
12303
12304
12305
12306
12307
12309 {
12311 {
12312 return true;
12313 }
12314 else
12315 {
12316 return false;
12317 }
12318 }
12319
12320
12322 {
12324 {
12326 }
12327 }
12328
12329
12331 {
12333 }
12334
12336 {
12338 }
12339
12340 override void InsertAgent(
int agent,
float count = 1)
12341 {
12342 if (count < 1)
12343 return;
12344
12346 }
12347
12350 {
12352 }
12353
12354
12356 {
12358 }
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12402 {
12404 return false;
12405 return true;
12406 }
12407
12409 {
12410
12412 }
12413
12414
12417 {
12418 super.CheckForRoofLimited(timeTresholdMS);
12419
12421 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12422 {
12423 m_PreviousRoofTestTime = time;
12424 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12425 }
12426 }
12427
12428
12430 {
12432 {
12433 return 0;
12434 }
12435
12436 if (GetInventory().GetAttachmentSlotsCount() != 0)
12437 {
12438 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12439 if (filter)
12440 return filter.GetProtectionLevel(type, false, system);
12441 else
12442 return 0;
12443 }
12444
12445 string subclassPath, entryName;
12446
12447 switch (type)
12448 {
12450 entryName = "biological";
12451 break;
12453 entryName = "chemical";
12454 break;
12455 default:
12456 entryName = "biological";
12457 break;
12458 }
12459
12460 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12461
12463 }
12464
12465
12466
12469 {
12470 if (!IsMagazine())
12472
12474 }
12475
12476
12477
12478
12479
12484 {
12485 return true;
12486 }
12487
12489 {
12491 }
12492
12493
12494
12495
12496
12498 {
12499 if (parent)
12500 {
12501 if (parent.IsInherited(DayZInfected))
12502 return true;
12503
12504 if (!parent.IsRuined())
12505 return true;
12506 }
12507
12508 return true;
12509 }
12510
12512 {
12513 if (!super.CanPutAsAttachment(parent))
12514 {
12515 return false;
12516 }
12517
12518 if (!IsRuined() && !parent.IsRuined())
12519 {
12520 return true;
12521 }
12522
12523 return false;
12524 }
12525
12527 {
12528
12529
12530
12531
12532 return super.CanReceiveItemIntoCargo(item);
12533 }
12534
12536 {
12537
12538
12539
12540
12541 GameInventory attachmentInv = attachment.GetInventory();
12543 {
12544 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12545 return false;
12546 }
12547
12548 InventoryLocation loc = new InventoryLocation();
12549 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12550 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12551 return false;
12552
12553 return super.CanReceiveAttachment(attachment, slotId);
12554 }
12555
12557 {
12558 if (!super.CanReleaseAttachment(attachment))
12559 return false;
12560
12561 return GetInventory().AreChildrenAccessible();
12562 }
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12585 {
12586 int id = muzzle_owner.GetMuzzleID();
12587 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12588
12589 if (WPOF_array)
12590 {
12591 for (int i = 0; i < WPOF_array.Count(); i++)
12592 {
12593 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12594
12595 if (WPOF)
12596 {
12597 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12598 }
12599 }
12600 }
12601 }
12602
12603
12605 {
12606 int id = muzzle_owner.GetMuzzleID();
12608
12609 if (WPOBE_array)
12610 {
12611 for (int i = 0; i < WPOBE_array.Count(); i++)
12612 {
12613 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12614
12615 if (WPOBE)
12616 {
12617 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12618 }
12619 }
12620 }
12621 }
12622
12623
12625 {
12626 int id = muzzle_owner.GetMuzzleID();
12627 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12628
12629 if (WPOOH_array)
12630 {
12631 for (int i = 0; i < WPOOH_array.Count(); i++)
12632 {
12633 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12634
12635 if (WPOOH)
12636 {
12637 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12638 }
12639 }
12640 }
12641 }
12642
12643
12645 {
12646 int id = muzzle_owner.GetMuzzleID();
12647 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12648
12649 if (WPOOH_array)
12650 {
12651 for (int i = 0; i < WPOOH_array.Count(); i++)
12652 {
12653 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12654
12655 if (WPOOH)
12656 {
12657 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12658 }
12659 }
12660 }
12661 }
12662
12663
12665 {
12666 int id = muzzle_owner.GetMuzzleID();
12667 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12668
12669 if (WPOOH_array)
12670 {
12671 for (int i = 0; i < WPOOH_array.Count(); i++)
12672 {
12673 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12674
12675 if (WPOOH)
12676 {
12677 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12678 }
12679 }
12680 }
12681 }
12682
12683
12684
12686 {
12688 {
12689 return true;
12690 }
12691
12692 return false;
12693 }
12694
12696 {
12698 {
12699 return true;
12700 }
12701
12702 return false;
12703 }
12704
12706 {
12708 {
12709 return true;
12710 }
12711
12712 return false;
12713 }
12714
12716 {
12717 return false;
12718 }
12719
12722 {
12723 return UATimeSpent.DEFAULT_DEPLOY;
12724 }
12725
12726
12727
12728
12730 {
12732 SetSynchDirty();
12733 }
12734
12736 {
12738 }
12739
12740
12742 {
12743 return false;
12744 }
12745
12748 {
12749 string att_type = "None";
12750
12751 if (ConfigIsExisting("soundAttType"))
12752 {
12753 att_type = ConfigGetString("soundAttType");
12754 }
12755
12757 }
12758
12760 {
12762 }
12763
12764
12765
12766
12767
12771
12773 {
12776
12778 }
12779
12780
12782 {
12784 return;
12785
12787
12790
12793
12794 SoundParameters params = new SoundParameters();
12798 }
12799
12800
12802 {
12804 return;
12805
12807 SetSynchDirty();
12808
12811 }
12812
12813
12815 {
12817 return;
12818
12820 SetSynchDirty();
12821
12824 }
12825
12827 {
12829 }
12830
12832 {
12834 }
12835
12838 {
12839 if (!
GetGame().IsDedicatedServer())
12840 {
12841 if (ConfigIsExisting("attachSoundSet"))
12842 {
12843 string cfg_path = "";
12844 string soundset = "";
12845 string type_name =
GetType();
12846
12849 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12850 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12851
12852 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12853 {
12854 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12855 {
12856 if (cfg_slot_array[i] == slot_type)
12857 {
12858 soundset = cfg_soundset_array[i];
12859 break;
12860 }
12861 }
12862 }
12863
12864 if (soundset != "")
12865 {
12866 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12868 }
12869 }
12870 }
12871 }
12872
12874 {
12875
12876 }
12877
12878 void OnApply(PlayerBase player);
12879
12881 {
12882 return 1.0;
12883 };
12884
12886 {
12888 }
12889
12891 {
12893 }
12894
12896
12898 {
12899 SetDynamicPhysicsLifeTime(0.01);
12901 }
12902
12904 {
12905 array<string> zone_names = new array<string>;
12906 GetDamageZones(zone_names);
12907 for (int i = 0; i < zone_names.Count(); i++)
12908 {
12909 SetHealthMax(zone_names.Get(i),"Health");
12910 }
12911 SetHealthMax("","Health");
12912 }
12913
12916 {
12917 float global_health = GetHealth01("","Health");
12918 array<string> zones = new array<string>;
12919 GetDamageZones(zones);
12920
12921 for (int i = 0; i < zones.Count(); i++)
12922 {
12923 SetHealth01(zones.Get(i),"Health",global_health);
12924 }
12925 }
12926
12929 {
12930 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12931 }
12932
12934 {
12935 if (!hasRootAsPlayer)
12936 {
12937 if (refParentIB)
12938 {
12939
12940 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12941 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12942
12943 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12944 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12945
12948 }
12949 else
12950 {
12951
12954 }
12955 }
12956 }
12957
12959 {
12961 {
12962 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12963 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12964 {
12965 float heatPermCoef = 1.0;
12967 while (ent)
12968 {
12969 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12970 ent = ent.GetHierarchyParent();
12971 }
12972
12973 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12974 }
12975 }
12976 }
12977
12979 {
12980
12981 EntityAI parent = GetHierarchyParent();
12982 if (!parent)
12983 {
12984 hasParent = false;
12985 hasRootAsPlayer = false;
12986 }
12987 else
12988 {
12989 hasParent = true;
12990 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12991 refParentIB =
ItemBase.Cast(parent);
12992 }
12993 }
12994
12995 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12996 {
12997
12998 }
12999
13001 {
13002
13003 return false;
13004 }
13005
13007 {
13008
13009
13010 return false;
13011 }
13012
13014 {
13015
13016 return false;
13017 }
13018
13021 {
13022 return !GetIsFrozen() &&
IsOpen();
13023 }
13024
13026 {
13027 bool hasParent = false, hasRootAsPlayer = false;
13029
13030 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13031 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13032
13033 if (wwtu || foodDecay)
13034 {
13038
13039 if (processWetness || processTemperature || processDecay)
13040 {
13042
13043 if (processWetness)
13044 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13045
13046 if (processTemperature)
13048
13049 if (processDecay)
13050 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13051 }
13052 }
13053 }
13054
13057 {
13059 }
13060
13062 {
13065
13066 return super.GetTemperatureFreezeThreshold();
13067 }
13068
13070 {
13073
13074 return super.GetTemperatureThawThreshold();
13075 }
13076
13078 {
13081
13082 return super.GetItemOverheatThreshold();
13083 }
13084
13086 {
13088 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13089
13090 return super.GetTemperatureFreezeTime();
13091 }
13092
13094 {
13096 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13097
13098 return super.GetTemperatureThawTime();
13099 }
13100
13105
13107 {
13108 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13109 }
13110
13112 {
13113 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13114 }
13115
13118 {
13120 }
13121
13123 {
13125 }
13126
13128 {
13130 }
13131
13134 {
13135 return null;
13136 }
13137
13140 {
13141 return false;
13142 }
13143
13145 {
13147 {
13150 if (!trg)
13151 {
13153 explosive = this;
13154 }
13155
13156 explosive.PairRemote(trg);
13158
13159 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13160 trg.SetPersistentPairID(persistentID);
13161 explosive.SetPersistentPairID(persistentID);
13162
13163 return true;
13164 }
13165 return false;
13166 }
13167
13170 {
13171 float ret = 1.0;
13174 ret *= GetHealth01();
13175
13176 return ret;
13177 }
13178
13179 #ifdef DEVELOPER
13180 override void SetDebugItem()
13181 {
13182 super.SetDebugItem();
13183 _itemBase = this;
13184 }
13185
13187 {
13188 string text = super.GetDebugText();
13189
13191 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13192
13193 return text;
13194 }
13195 #endif
13196
13198 {
13199 return true;
13200 }
13201
13203
13205
13207 {
13210 }
13211
13212
13220
13236}
13237
13239{
13241 if (entity)
13242 {
13243 bool is_item = entity.IsInherited(
ItemBase);
13244 if (is_item && full_quantity)
13245 {
13248 }
13249 }
13250 else
13251 {
13253 return NULL;
13254 }
13255 return entity;
13256}
13257
13259{
13260 if (item)
13261 {
13262 if (health > 0)
13263 item.SetHealth("", "", health);
13264
13265 if (item.CanHaveTemperature())
13266 {
13268 if (item.CanFreeze())
13269 item.SetFrozen(false);
13270 }
13271
13272 if (item.HasEnergyManager())
13273 {
13274 if (quantity >= 0)
13275 {
13276 item.GetCompEM().SetEnergy0To1(quantity);
13277 }
13278 else
13279 {
13281 }
13282 }
13283 else if (item.IsMagazine())
13284 {
13285 Magazine mag = Magazine.Cast(item);
13286 if (quantity >= 0)
13287 {
13288 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13289 }
13290 else
13291 {
13293 }
13294
13295 }
13296 else
13297 {
13298 if (quantity >= 0)
13299 {
13300 item.SetQuantityNormalized(quantity, false);
13301 }
13302 else
13303 {
13305 }
13306
13307 }
13308 }
13309}
13310
13311#ifdef DEVELOPER
13313#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.