8473{
8475 {
8476 return true;
8477 }
8478};
8479
8480
8481
8483{
8487
8489
8492
8493
8494
8495
8496
8505
8511
8516
8521
8542 protected bool m_IsResultOfSplit
8543
8545
8550
8551
8552
8554
8558
8559
8560
8562
8565
8566
8567
8573
8574
8582
8585
8586
8588
8589
8591
8592
8597
8598
8603
8604
8606
8607
8609 {
8614
8615 if (!
GetGame().IsDedicatedServer())
8616 {
8618 {
8620
8622 {
8624 }
8625 }
8626
8629 }
8630
8631 m_OldLocation = null;
8632
8634 {
8636 }
8637
8638 if (ConfigIsExisting("headSelectionsToHide"))
8639 {
8642 }
8643
8645 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8646 {
8648 }
8649
8651
8652 m_IsResultOfSplit = false;
8653
8655 }
8656
8658 {
8659 super.InitItemVariables();
8660
8666 m_Count = ConfigGetInt(
"count");
8667
8670
8675
8678
8683
8695
8699
8700
8703 if (ConfigIsExisting("canBeSplit"))
8704 {
8707 }
8708
8710 if (ConfigIsExisting("itemBehaviour"))
8712
8713
8716 RegisterNetSyncVariableInt("m_VarLiquidType");
8717 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8718
8719 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8720 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8721 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8722
8723 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8724 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8725 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8726 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8727
8728 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8729 RegisterNetSyncVariableBool("m_IsTakeable");
8730 RegisterNetSyncVariableBool("m_IsHologram");
8731
8734 {
8737 }
8738
8740
8742 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8744
8745 }
8746
8748 {
8750 }
8751
8753 {
8756 {
8761 }
8762 }
8763
8764 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8765 {
8767 {
8770 }
8771
8773 }
8774
8776 {
8782 }
8783
8785
8787 {
8789
8790 if (!action)
8791 {
8792 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8793 return;
8794 }
8795
8797 if (!ai)
8798 {
8800 return;
8801 }
8802
8804 if (!action_array)
8805 {
8806 action_array = new array<ActionBase_Basic>;
8808 }
8809 if (LogManager.IsActionLogEnable())
8810 {
8811 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8812 }
8813
8814 if (action_array.Find(action) != -1)
8815 {
8816 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8817 }
8818 else
8819 {
8820 action_array.Insert(action);
8821 }
8822 }
8823
8825 {
8827 ActionBase action = player.GetActionManager().GetAction(actionName);
8830
8831 if (action_array)
8832 {
8833 action_array.RemoveItem(action);
8834 }
8835 }
8836
8837
8838
8840 {
8841 ActionOverrideData overrideData = new ActionOverrideData();
8845
8847 if (!actionMap)
8848 {
8851 }
8852
8853 actionMap.Insert(this.
Type(), overrideData);
8854
8855 }
8856
8858
8860
8861
8863 {
8866
8869
8870 string config_to_search = "CfgVehicles";
8871 string muzzle_owner_config;
8872
8874 {
8875 if (IsInherited(Weapon))
8876 config_to_search = "CfgWeapons";
8877
8878 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8879
8880 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8881
8883
8884 if (config_OnFire_subclass_count > 0)
8885 {
8886 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8887
8888 for (int i = 0; i < config_OnFire_subclass_count; i++)
8889 {
8890 string particle_class = "";
8892 string config_OnFire_entry = config_OnFire_class + particle_class;
8893 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8894 WPOF_array.Insert(WPOF);
8895 }
8896
8897
8899 }
8900 }
8901
8903 {
8904 config_to_search = "CfgWeapons";
8905 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8906
8907 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8908
8910
8911 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8912 {
8913 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8914
8915 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8916 {
8917 string particle_class2 = "";
8919 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8920 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8921 WPOBE_array.Insert(WPOBE);
8922 }
8923
8924
8926 }
8927 }
8928 }
8929
8930
8932 {
8935
8937 {
8938 string config_to_search = "CfgVehicles";
8939
8940 if (IsInherited(Weapon))
8941 config_to_search = "CfgWeapons";
8942
8943 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8944 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8945
8946 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8947 {
8948
8950
8952 {
8954 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8956 return;
8957 }
8958
8961
8962
8963
8965 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8966
8967 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8968 {
8969 string particle_class = "";
8971 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8973
8974 if (entry_type == CT_CLASS)
8975 {
8976 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8977 WPOOH_array.Insert(WPOF);
8978 }
8979 }
8980
8981
8983 }
8984 }
8985 }
8986
8988 {
8990 }
8991
8993 {
8995 {
8997
9000
9003
9004 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9005 }
9006 }
9007
9009 {
9011 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9012
9014 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9015
9017 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9018
9020 {
9022 }
9023 }
9024
9026 {
9028 }
9029
9031 {
9034 else
9036
9038 {
9041 }
9042 else
9043 {
9046
9049 }
9050
9052 }
9053
9055 {
9057 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9058 }
9059
9061 {
9063 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9065 }
9066
9068 {
9070 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9071 }
9072
9074 {
9077
9078 OverheatingParticle OP = new OverheatingParticle();
9083
9085 }
9086
9088 {
9091
9092 return -1;
9093 }
9094
9096 {
9098 {
9101
9102 for (int i = count; i > 0; --i)
9103 {
9104 int id = i - 1;
9107
9110
9111 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9112 {
9113 if (p)
9114 {
9117 }
9118 }
9119 }
9120 }
9121 }
9122
9124 {
9126 {
9128 {
9129 int id = i - 1;
9131
9132 if (OP)
9133 {
9135
9136 if (p)
9137 {
9139 }
9140
9141 delete OP;
9142 }
9143 }
9144
9147 }
9148 }
9149
9152 {
9153 return 0.0;
9154 }
9155
9156
9158 {
9159 return 250;
9160 }
9161
9163 {
9164 return 0;
9165 }
9166
9169 {
9171 return true;
9172
9173 return false;
9174 }
9175
9178 {
9181
9183 {
9185 }
9186 else
9187 {
9188
9190 }
9191
9193 }
9194
9201 {
9202 return -1;
9203 }
9204
9205
9206
9207
9209 {
9211 {
9213 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9214
9215 if (r_index >= 0)
9216 {
9217 InventoryLocation r_il = new InventoryLocation;
9218 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9219
9220 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9223 {
9224 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9225 }
9227 {
9228 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9229 }
9230
9231 }
9232
9233 player.GetHumanInventory().ClearUserReservedLocation(this);
9234 }
9235
9238 }
9239
9240
9241
9242
9244 {
9245 return ItemBase.m_DebugActionsMask;
9246 }
9247
9249 {
9250 return ItemBase.m_DebugActionsMask & mask;
9251 }
9252
9254 {
9255 ItemBase.m_DebugActionsMask = mask;
9256 }
9257
9259 {
9260 ItemBase.m_DebugActionsMask |= mask;
9261 }
9262
9264 {
9265 ItemBase.m_DebugActionsMask &= ~mask;
9266 }
9267
9269 {
9271 {
9273 }
9274 else
9275 {
9277 }
9278 }
9279
9280
9282 {
9283 if (GetEconomyProfile())
9284 {
9285 float q_max = GetEconomyProfile().GetQuantityMax();
9286 if (q_max > 0)
9287 {
9288 float q_min = GetEconomyProfile().GetQuantityMin();
9289 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9290
9292 {
9293 ComponentEnergyManager comp = GetCompEM();
9295 {
9297 }
9298 }
9300 {
9302
9303 }
9304
9305 }
9306 }
9307 }
9308
9311 {
9312 EntityAI parent = GetHierarchyParent();
9313
9314 if (parent)
9315 {
9316 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9317 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9318 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9319 }
9320 }
9321
9324 {
9325 EntityAI parent = GetHierarchyParent();
9326
9327 if (parent)
9328 {
9329 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9330 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9331 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9332 }
9333 }
9334
9336 {
9337
9338
9339
9340
9342
9344 {
9345 if (ScriptInputUserData.CanStoreInputUserData())
9346 {
9347 ScriptInputUserData ctx = new ScriptInputUserData;
9353 ctx.
Write(use_stack_max);
9356
9358 {
9359 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9360 }
9361 }
9362 }
9363 else if (!
GetGame().IsMultiplayer())
9364 {
9366 }
9367 }
9368
9370 {
9372 }
9373
9375 {
9377 }
9378
9380 {
9382 }
9383
9385 {
9386
9387 return false;
9388 }
9389
9391 {
9392 return false;
9393 }
9394
9398 {
9399 return false;
9400 }
9401
9403 {
9404 return "";
9405 }
9406
9408
9410 {
9411 return false;
9412 }
9413
9415 {
9416 return true;
9417 }
9418
9419
9420
9422 {
9423 return true;
9424 }
9425
9427 {
9428 return true;
9429 }
9430
9432 {
9433 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9435 }
9436
9438 {
9440 }
9441
9443 {
9445 if (!is_being_placed)
9447 SetSynchDirty();
9448 }
9449
9450
9452
9454 {
9456 }
9457
9459 {
9461 }
9462
9464 {
9465 return 1;
9466 }
9467
9469 {
9470 return false;
9471 }
9472
9474 {
9476 SetSynchDirty();
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
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9514 {
9515 super.OnMovedInsideCargo(container);
9516
9517 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9518 }
9519
9520 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9521 {
9522 super.EEItemLocationChanged(oldLoc,newLoc);
9523
9524 PlayerBase new_player = null;
9525 PlayerBase old_player = null;
9526
9527 if (newLoc.GetParent())
9528 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9529
9530 if (oldLoc.GetParent())
9531 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9532
9534 {
9535 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9536
9537 if (r_index >= 0)
9538 {
9539 InventoryLocation r_il = new InventoryLocation;
9540 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9541
9542 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9545 {
9546 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9547 }
9549 {
9550 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9551 }
9552
9553 }
9554 }
9555
9557 {
9558 if (new_player)
9559 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9560
9561 if (new_player == old_player)
9562 {
9563
9564 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9565 {
9567 {
9568 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9569 {
9570 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9571 }
9572 }
9573 else
9574 {
9575 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9576 }
9577 }
9578
9579 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9580 {
9581 int type = oldLoc.GetType();
9583 {
9584 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9585 }
9587 {
9588 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9589 }
9590 }
9591 if (!m_OldLocation)
9592 {
9593 m_OldLocation = new InventoryLocation;
9594 }
9595 m_OldLocation.Copy(oldLoc);
9596 }
9597 else
9598 {
9599 if (m_OldLocation)
9600 {
9601 m_OldLocation.Reset();
9602 }
9603 }
9604
9606 }
9607 else
9608 {
9609 if (new_player)
9610 {
9611 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9612 if (res_index >= 0)
9613 {
9614 InventoryLocation il = new InventoryLocation;
9615 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9617 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9620 {
9621 il.
GetParent().GetOnReleaseLock().Invoke(it);
9622 }
9624 {
9626 }
9627
9628 }
9629 }
9631 {
9632
9634 }
9635
9636 if (m_OldLocation)
9637 {
9638 m_OldLocation.Reset();
9639 }
9640 }
9641 }
9642
9643 override void EOnContact(IEntity other, Contact extra)
9644 {
9646 {
9647 int liquidType = -1;
9649 if (impactSpeed > 0.0)
9650 {
9652 #ifndef SERVER
9654 #else
9656 SetSynchDirty();
9657 #endif
9659 }
9660 }
9661
9662 #ifdef SERVER
9663 if (GetCompEM() && GetCompEM().IsPlugged())
9664 {
9665 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9666 GetCompEM().UnplugThis();
9667 }
9668 #endif
9669 }
9670
9672
9674 {
9676 }
9677
9679 {
9680
9681 }
9682
9684 {
9685 super.OnItemLocationChanged(old_owner, new_owner);
9686
9687 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9688 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9689
9690 if (!relatedPlayer && playerNew)
9691 relatedPlayer = playerNew;
9692
9693 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9694 {
9696 if (actionMgr)
9697 {
9698 ActionBase currentAction = actionMgr.GetRunningAction();
9699 if (currentAction)
9701 }
9702 }
9703
9704 Man ownerPlayerOld = null;
9705 Man ownerPlayerNew = null;
9706
9707 if (old_owner)
9708 {
9709 if (old_owner.
IsMan())
9710 {
9711 ownerPlayerOld = Man.Cast(old_owner);
9712 }
9713 else
9714 {
9715 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9716 }
9717 }
9718 else
9719 {
9721 {
9723
9724 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9725 {
9726 GetCompEM().UnplugThis();
9727 }
9728 }
9729 }
9730
9731 if (new_owner)
9732 {
9733 if (new_owner.
IsMan())
9734 {
9735 ownerPlayerNew = Man.Cast(new_owner);
9736 }
9737 else
9738 {
9739 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9740 }
9741 }
9742
9743 if (ownerPlayerOld != ownerPlayerNew)
9744 {
9745 if (ownerPlayerOld)
9746 {
9747 array<EntityAI> subItemsExit = new array<EntityAI>;
9749 for (int i = 0; i < subItemsExit.Count(); i++)
9750 {
9753 }
9754 }
9755
9756 if (ownerPlayerNew)
9757 {
9758 array<EntityAI> subItemsEnter = new array<EntityAI>;
9760 for (int j = 0; j < subItemsEnter.Count(); j++)
9761 {
9764 }
9765 }
9766 }
9767 else if (ownerPlayerNew != null)
9768 {
9769 PlayerBase nplayer;
9770 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9771 {
9772 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9774 for (int k = 0; k < subItemsUpdate.Count(); k++)
9775 {
9777 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9778 }
9779 }
9780 }
9781
9782 if (old_owner)
9783 old_owner.OnChildItemRemoved(this);
9784 if (new_owner)
9785 new_owner.OnChildItemReceived(this);
9786 }
9787
9788
9790 {
9791 super.EEDelete(parent);
9792 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9793 if (player)
9794 {
9796
9797 if (player.IsAlive())
9798 {
9799 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9800 if (r_index >= 0)
9801 {
9802 InventoryLocation r_il = new InventoryLocation;
9803 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9804
9805 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9808 {
9809 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9810 }
9812 {
9813 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9814 }
9815
9816 }
9817
9818 player.RemoveQuickBarEntityShortcut(this);
9819 }
9820 }
9821 }
9822
9824 {
9825 super.EEKilled(killer);
9826
9829 {
9830 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9831 {
9832 if (IsMagazine())
9833 {
9834 if (Magazine.Cast(this).GetAmmoCount() > 0)
9835 {
9837 }
9838 }
9839 else
9840 {
9842 }
9843 }
9844 }
9845 }
9846
9848 {
9849 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9850
9851 super.OnWasAttached(parent, slot_id);
9852
9855
9857 }
9858
9860 {
9861 super.OnWasDetached(parent, slot_id);
9862
9865 }
9866
9868 {
9869 int idx;
9872
9873 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9874 if (inventory_slots.Count() < 1)
9875 {
9876 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9877 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9878 }
9879 else
9880 {
9881 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9882 }
9883
9884 idx = inventory_slots.Find(slot);
9885 if (idx < 0)
9886 return "";
9887
9888 return attach_types.Get(idx);
9889 }
9890
9892 {
9893 int idx = -1;
9894 string slot;
9895
9898
9899 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9900 if (inventory_slots.Count() < 1)
9901 {
9902 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9903 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9904 }
9905 else
9906 {
9907 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9908 if (detach_types.Count() < 1)
9909 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9910 }
9911
9912 for (int i = 0; i < inventory_slots.Count(); i++)
9913 {
9914 slot = inventory_slots.Get(i);
9915 }
9916
9917 if (slot != "")
9918 {
9919 if (detach_types.Count() == 1)
9920 idx = 0;
9921 else
9922 idx = inventory_slots.Find(slot);
9923 }
9924 if (idx < 0)
9925 return "";
9926
9927 return detach_types.Get(idx);
9928 }
9929
9931 {
9932
9934
9935
9936 float min_time = 1;
9937 float max_time = 3;
9938 float delay = Math.RandomFloat(min_time, max_time);
9939
9940 explode_timer.Run(delay, this, "DoAmmoExplosion");
9941 }
9942
9944 {
9945 Magazine magazine = Magazine.Cast(this);
9946 int pop_sounds_count = 6;
9947 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9948
9949
9950 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9951 string sound_name = pop_sounds[ sound_idx ];
9953
9954
9955 magazine.ServerAddAmmoCount(-1);
9956
9957
9958 float min_temp_to_explode = 100;
9959
9960 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9961 {
9963 }
9964 }
9965
9966
9967 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9968 {
9969 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9970
9971 const int CHANCE_DAMAGE_CARGO = 4;
9972 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9973 const int CHANCE_DAMAGE_NOTHING = 2;
9974
9976 {
9977 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9978 int chances;
9979 int rnd;
9980
9981 if (GetInventory().GetCargo())
9982 {
9983 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9984 rnd = Math.RandomInt(0,chances);
9985
9986 if (rnd < CHANCE_DAMAGE_CARGO)
9987 {
9989 }
9990 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9991 {
9993 }
9994 }
9995 else
9996 {
9997 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9998 rnd = Math.RandomInt(0,chances);
9999
10000 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10001 {
10003 }
10004 }
10005 }
10006 }
10007
10009 {
10010 if (GetInventory().GetCargo())
10011 {
10012 int item_count = GetInventory().GetCargo().GetItemCount();
10013 if (item_count > 0)
10014 {
10015 int random_pick = Math.RandomInt(0, item_count);
10017 if (!item.IsExplosive())
10018 {
10019 item.AddHealth("","",damage);
10020 return true;
10021 }
10022 }
10023 }
10024 return false;
10025 }
10026
10028 {
10029 int attachment_count = GetInventory().AttachmentCount();
10030 if (attachment_count > 0)
10031 {
10032 int random_pick = Math.RandomInt(0, attachment_count);
10033 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10034 if (!attachment.IsExplosive())
10035 {
10036 attachment.AddHealth("","",damage);
10037 return true;
10038 }
10039 }
10040 return false;
10041 }
10042
10044 {
10046 }
10047
10049 {
10051 return GetInventory().CanRemoveEntity();
10052
10053 return false;
10054 }
10055
10057 {
10058
10060 return false;
10061
10062
10064 return false;
10065
10066
10067
10069 if (delta == 0)
10070 return false;
10071
10072
10073 return true;
10074 }
10075
10077 {
10079 {
10080 if (ScriptInputUserData.CanStoreInputUserData())
10081 {
10082 ScriptInputUserData ctx = new ScriptInputUserData;
10087 ctx.
Write(destination_entity);
10089 ctx.
Write(slot_id);
10091 }
10092 }
10093 else if (!
GetGame().IsMultiplayer())
10094 {
10096 }
10097 }
10098
10100 {
10101 float split_quantity_new;
10105 InventoryLocation loc = new InventoryLocation;
10106
10107 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10108 {
10110 split_quantity_new = stack_max;
10111 else
10113
10115 {
10116 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10117 if (new_item)
10118 {
10119 new_item.SetResultOfSplit(true);
10120 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10122 new_item.
SetQuantity(split_quantity_new,
false,
true);
10123 }
10124 }
10125 }
10126 else if (destination_entity && slot_id == -1)
10127 {
10128 if (quantity > stack_max)
10129 split_quantity_new = stack_max;
10130 else
10131 split_quantity_new = quantity;
10132
10134 {
10136 {
10139 }
10140
10141 if (new_item)
10142 {
10143 new_item.SetResultOfSplit(true);
10144 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10146 new_item.
SetQuantity(split_quantity_new,
false,
true);
10147 }
10148 }
10149 }
10150 else
10151 {
10152 if (stack_max != 0)
10153 {
10155 {
10157 }
10158
10159 if (split_quantity_new == 0)
10160 {
10161 if (!
GetGame().IsMultiplayer())
10162 player.PhysicalPredictiveDropItem(this);
10163 else
10164 player.ServerDropEntity(this);
10165 return;
10166 }
10167
10169 {
10171
10172 if (new_item)
10173 {
10174 new_item.SetResultOfSplit(true);
10175 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10178 new_item.PlaceOnSurface();
10179 }
10180 }
10181 }
10182 }
10183 }
10184
10186 {
10187 float split_quantity_new;
10191 InventoryLocation loc = new InventoryLocation;
10192
10193 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10194 {
10196 split_quantity_new = stack_max;
10197 else
10199
10201 {
10202 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10203 if (new_item)
10204 {
10205 new_item.SetResultOfSplit(true);
10206 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10208 new_item.
SetQuantity(split_quantity_new,
false,
true);
10209 }
10210 }
10211 }
10212 else if (destination_entity && slot_id == -1)
10213 {
10214 if (quantity > stack_max)
10215 split_quantity_new = stack_max;
10216 else
10217 split_quantity_new = quantity;
10218
10220 {
10222 {
10225 }
10226
10227 if (new_item)
10228 {
10229 new_item.SetResultOfSplit(true);
10230 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10232 new_item.
SetQuantity(split_quantity_new,
false,
true);
10233 }
10234 }
10235 }
10236 else
10237 {
10238 if (stack_max != 0)
10239 {
10241 {
10243 }
10244
10246 {
10248
10249 if (new_item)
10250 {
10251 new_item.SetResultOfSplit(true);
10252 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10255 new_item.PlaceOnSurface();
10256 }
10257 }
10258 }
10259 }
10260 }
10261
10263 {
10265 {
10266 if (ScriptInputUserData.CanStoreInputUserData())
10267 {
10268 ScriptInputUserData ctx = new ScriptInputUserData;
10273 dst.WriteToContext(ctx);
10275 }
10276 }
10277 else if (!
GetGame().IsMultiplayer())
10278 {
10280 }
10281 }
10282
10284 {
10286 {
10287 if (ScriptInputUserData.CanStoreInputUserData())
10288 {
10289 ScriptInputUserData ctx = new ScriptInputUserData;
10294 ctx.
Write(destination_entity);
10300 }
10301 }
10302 else if (!
GetGame().IsMultiplayer())
10303 {
10305 }
10306 }
10307
10309 {
10311 }
10312
10314 {
10316 float split_quantity_new;
10318 if (dst.IsValid())
10319 {
10320 int slot_id = dst.GetSlot();
10322
10323 if (quantity > stack_max)
10324 split_quantity_new = stack_max;
10325 else
10326 split_quantity_new = quantity;
10327
10329 {
10331
10332 if (new_item)
10333 {
10334 new_item.SetResultOfSplit(true);
10335 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10337 new_item.
SetQuantity(split_quantity_new,
false,
true);
10338 }
10339
10340 return new_item;
10341 }
10342 }
10343
10344 return null;
10345 }
10346
10348 {
10350 float split_quantity_new;
10352 if (destination_entity)
10353 {
10355 if (quantity > stackable)
10356 split_quantity_new = stackable;
10357 else
10358 split_quantity_new = quantity;
10359
10361 {
10362 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10363 if (new_item)
10364 {
10365 new_item.SetResultOfSplit(true);
10366 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10368 new_item.
SetQuantity(split_quantity_new,
false,
true);
10369 }
10370 }
10371 }
10372 }
10373
10375 {
10377 {
10378 if (ScriptInputUserData.CanStoreInputUserData())
10379 {
10380 ScriptInputUserData ctx = new ScriptInputUserData;
10385 ItemBase destination_entity =
this;
10386 ctx.
Write(destination_entity);
10390 }
10391 }
10392 else if (!
GetGame().IsMultiplayer())
10393 {
10395 }
10396 }
10397
10399 {
10401 float split_quantity_new;
10403 if (player)
10404 {
10406 if (quantity > stackable)
10407 split_quantity_new = stackable;
10408 else
10409 split_quantity_new = quantity;
10410
10412 {
10413 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10414 new_item =
ItemBase.Cast(in_hands);
10415 if (new_item)
10416 {
10417 new_item.SetResultOfSplit(true);
10418 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10420 new_item.SetQuantity(split_quantity_new, false, true);
10421 }
10422 }
10423 }
10424 }
10425
10427 {
10429 float split_quantity_new = Math.Floor(quantity * 0.5);
10430
10432 return;
10433
10435
10436 if (new_item)
10437 {
10438 if (new_item.GetQuantityMax() < split_quantity_new)
10439 {
10440 split_quantity_new = new_item.GetQuantityMax();
10441 }
10442
10443 new_item.SetResultOfSplit(true);
10444 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10445
10447 {
10450 }
10451 else
10452 {
10454 new_item.
SetQuantity(split_quantity_new,
false,
true);
10455 }
10456 }
10457 }
10458
10460 {
10462 float split_quantity_new = Math.Floor(quantity / 2);
10463
10465 return;
10466
10467 InventoryLocation invloc = new InventoryLocation;
10469
10471 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10472
10473 if (new_item)
10474 {
10475 if (new_item.GetQuantityMax() < split_quantity_new)
10476 {
10477 split_quantity_new = new_item.GetQuantityMax();
10478 }
10480 {
10483 }
10484 else if (split_quantity_new > 1)
10485 {
10487 new_item.
SetQuantity(split_quantity_new,
false,
true);
10488 }
10489 }
10490 }
10491
10494 {
10495 SetWeightDirty();
10497
10498 if (parent)
10499 parent.OnAttachmentQuantityChangedEx(this, delta);
10500
10502 {
10504 {
10506 }
10508 {
10509 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10511 }
10512 }
10513
10514 }
10515
10518 {
10519
10520 }
10521
10524 {
10526 }
10527
10529 {
10530 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10531
10533 {
10534 if (newLevel == GameConstants.STATE_RUINED)
10535 {
10537 EntityAI parent = GetHierarchyParent();
10538 if (parent && parent.IsFireplace())
10539 {
10540 CargoBase cargo = GetInventory().GetCargo();
10541 if (cargo)
10542 {
10544 {
10546 }
10547 }
10548 }
10549 }
10550
10552 {
10553
10555 return;
10556 }
10557
10558 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10559 {
10561 }
10562 }
10563 }
10564
10565
10567 {
10568 super.OnRightClick();
10569
10571 {
10573 {
10574 if (ScriptInputUserData.CanStoreInputUserData())
10575 {
10576 EntityAI root = GetHierarchyRoot();
10577 Man playerOwner = GetHierarchyRootPlayer();
10578 InventoryLocation dst = new InventoryLocation;
10579
10580
10581 if (!playerOwner && root && root == this)
10582 {
10584 }
10585 else
10586 {
10587
10588 GetInventory().GetCurrentInventoryLocation(dst);
10590 {
10593 {
10595 }
10596 else
10597 {
10599
10600
10601 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10602 {
10604 }
10605 else
10606 {
10607 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10608 }
10609 }
10610 }
10611 }
10612
10613 ScriptInputUserData ctx = new ScriptInputUserData;
10621 }
10622 }
10623 else if (!
GetGame().IsMultiplayer())
10624 {
10626 }
10627 }
10628 }
10629
10631 {
10632 if (root)
10633 {
10634 vector m4[4];
10635 root.GetTransform(m4);
10636 dst.SetGround(this, m4);
10637 }
10638 else
10639 {
10640 GetInventory().GetCurrentInventoryLocation(dst);
10641 }
10642 }
10643
10644 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10645 {
10646
10647 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10648 return false;
10649
10650 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10651 return false;
10652
10653
10655 return false;
10656
10657
10658 Magazine mag = Magazine.Cast(this);
10659 if (mag)
10660 {
10661 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10662 return false;
10663
10664 if (stack_max_limit)
10665 {
10666 Magazine other_mag = Magazine.Cast(other_item);
10667 if (other_item)
10668 {
10669 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10670 return false;
10671 }
10672
10673 }
10674 }
10675 else
10676 {
10677
10679 return false;
10680
10682 return false;
10683 }
10684
10685 PlayerBase player = null;
10686 if (CastTo(player, GetHierarchyRootPlayer()))
10687 {
10688 if (player.GetInventory().HasAttachment(this))
10689 return false;
10690
10691 if (player.IsItemsToDelete())
10692 return false;
10693 }
10694
10695 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10696 return false;
10697
10698 int slotID;
10700 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10701 return false;
10702
10703 return true;
10704 }
10705
10707 {
10709 }
10710
10712 {
10713 return m_IsResultOfSplit;
10714 }
10715
10717 {
10718 m_IsResultOfSplit = value;
10719 }
10720
10722 {
10724 }
10725
10727 {
10728 float other_item_quantity = other_item.GetQuantity();
10729 float this_free_space;
10730
10732
10734
10735 if (other_item_quantity > this_free_space)
10736 {
10737 return this_free_space;
10738 }
10739 else
10740 {
10741 return other_item_quantity;
10742 }
10743 }
10744
10746 {
10748 }
10749
10751 {
10753 return;
10754
10755 if (!IsMagazine() && other_item)
10756 {
10758 if (quantity_used != 0)
10759 {
10760 float hp1 = GetHealth01("","");
10761 float hp2 = other_item.GetHealth01("","");
10762 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10763 hpResult = hpResult / (
GetQuantity() + quantity_used);
10764
10765 hpResult *= GetMaxHealth();
10766 Math.Round(hpResult);
10767 SetHealth("", "Health", hpResult);
10768
10770 other_item.AddQuantity(-quantity_used);
10771 }
10772 }
10774 }
10775
10777 {
10778 #ifdef SERVER
10779 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10780 GetHierarchyParent().IncreaseLifetimeUp();
10781 #endif
10782 };
10783
10785 {
10786 PlayerBase p = PlayerBase.Cast(player);
10787
10788 array<int> recipesIds = p.m_Recipes;
10789 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10790 if (moduleRecipesManager)
10791 {
10792 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10793 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10794 }
10795
10796 for (int i = 0;i < recipesIds.Count(); i++)
10797 {
10798 int key = recipesIds.Get(i);
10799 string recipeName = moduleRecipesManager.GetRecipeName(key);
10801 }
10802 }
10803
10804
10805 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10806 {
10807 super.GetDebugActions(outputList);
10808
10809
10815
10816
10821
10826
10827
10831
10832
10834 {
10838 }
10839
10842
10843
10847
10849
10850 InventoryLocation loc = new InventoryLocation();
10851 GetInventory().GetCurrentInventoryLocation(loc);
10853 {
10854 if (Gizmo_IsSupported())
10857 }
10858
10860 }
10861
10862
10863
10864
10866 {
10867 super.OnAction(action_id, player, ctx);
10868
10870 {
10871 switch (action_id)
10872 {
10875 return true;
10878 return true;
10879 }
10880 }
10881
10883 {
10884 switch (action_id)
10885 {
10887 Delete();
10888 return true;
10889 }
10890 }
10891
10892 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10893 {
10894 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10895 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10896 PlayerBase p = PlayerBase.Cast(player);
10897 if (
EActions.RECIPES_RANGE_START < 1000)
10898 {
10899 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10900 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10901 }
10902 }
10903 #ifndef SERVER
10904 else if (action_id ==
EActions.WATCH_PLAYER)
10905 {
10906 PluginDeveloper.SetDeveloperItemClientEx(player);
10907 }
10908 #endif
10910 {
10911 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10912 {
10913 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10914 OnDebugButtonPressServer(id + 1);
10915 }
10916
10917 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10918 {
10919 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10921 }
10922
10923 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10924 {
10925 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10927 }
10928
10929 else if (action_id ==
EActions.ADD_QUANTITY)
10930 {
10931 if (IsMagazine())
10932 {
10933 Magazine mag = Magazine.Cast(this);
10934 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10935 }
10936 else
10937 {
10939 }
10940
10941 if (m_EM)
10942 {
10943 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10944 }
10945
10946 }
10947
10948 else if (action_id ==
EActions.REMOVE_QUANTITY)
10949 {
10950 if (IsMagazine())
10951 {
10952 Magazine mag2 = Magazine.Cast(this);
10953 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10954 }
10955 else
10956 {
10958 }
10959 if (m_EM)
10960 {
10961 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10962 }
10963
10964 }
10965
10966 else if (action_id ==
EActions.SET_QUANTITY_0)
10967 {
10969
10970 if (m_EM)
10971 {
10972 m_EM.SetEnergy(0);
10973 }
10974 }
10975
10976 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10977 {
10979
10980 if (m_EM)
10981 {
10982 m_EM.SetEnergy(m_EM.GetEnergyMax());
10983 }
10984 }
10985
10986 else if (action_id ==
EActions.ADD_HEALTH)
10987 {
10988 AddHealth("","",GetMaxHealth("","Health")/5);
10989 }
10990 else if (action_id ==
EActions.REMOVE_HEALTH)
10991 {
10992 AddHealth("","",-GetMaxHealth("","Health")/5);
10993 }
10994 else if (action_id ==
EActions.DESTROY_HEALTH)
10995 {
10996 SetHealth01("","",0);
10997 }
10998 else if (action_id ==
EActions.WATCH_ITEM)
10999 {
11001 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11002 #ifdef DEVELOPER
11003 SetDebugDeveloper_item(this);
11004 #endif
11005 }
11006
11007 else if (action_id ==
EActions.ADD_TEMPERATURE)
11008 {
11009 AddTemperature(20);
11010
11011 }
11012
11013 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11014 {
11015 AddTemperature(-20);
11016
11017 }
11018
11019 else if (action_id ==
EActions.FLIP_FROZEN)
11020 {
11021 SetFrozen(!GetIsFrozen());
11022
11023 }
11024
11025 else if (action_id ==
EActions.ADD_WETNESS)
11026 {
11028
11029 }
11030
11031 else if (action_id ==
EActions.REMOVE_WETNESS)
11032 {
11034
11035 }
11036
11037 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11038 {
11041
11042
11043 }
11044
11045 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11046 {
11049 }
11050
11051 else if (action_id ==
EActions.MAKE_SPECIAL)
11052 {
11053 auto debugParams = DebugSpawnParams.WithPlayer(player);
11054 OnDebugSpawnEx(debugParams);
11055 }
11056
11057 }
11058
11059
11060 return false;
11061 }
11062
11063
11064
11065
11069
11072
11073
11074
11076 {
11077 return false;
11078 }
11079
11080
11082 {
11083 return true;
11084 }
11085
11086
11088 {
11089 return true;
11090 }
11091
11092
11093
11095 {
11096 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11098 }
11099
11102 {
11103 return null;
11104 }
11105
11107 {
11108 return false;
11109 }
11110
11112 {
11113 return false;
11114 }
11115
11119
11120
11122 {
11123 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11124 return module_repairing.CanRepair(this, item_repair_kit);
11125 }
11126
11127
11128 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11129 {
11130 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11131 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11132 }
11133
11134
11136 {
11137
11138
11139
11140
11141
11142
11143
11144
11145 return 1;
11146 }
11147
11148
11149
11151 {
11153 }
11154
11155
11156
11158 {
11160 }
11161
11162
11171 {
11172 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11173
11174 if (player)
11175 {
11176 player.MessageStatus(text);
11177 }
11178 }
11179
11180
11189 {
11190 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11191
11192 if (player)
11193 {
11194 player.MessageAction(text);
11195 }
11196 }
11197
11198
11207 {
11208 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11209
11210 if (player)
11211 {
11212 player.MessageFriendly(text);
11213 }
11214 }
11215
11216
11225 {
11226 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11227
11228 if (player)
11229 {
11230 player.MessageImportant(text);
11231 }
11232 }
11233
11235 {
11236 return true;
11237 }
11238
11239
11240 override bool KindOf(
string tag)
11241 {
11242 bool found = false;
11243 string item_name = this.
GetType();
11246
11247 int array_size = item_tag_array.Count();
11248 for (int i = 0; i < array_size; i++)
11249 {
11250 if (item_tag_array.Get(i) == tag)
11251 {
11252 found = true;
11253 break;
11254 }
11255 }
11256 return found;
11257 }
11258
11259
11261 {
11262
11263 super.OnRPC(sender, rpc_type,ctx);
11264
11265
11266 switch (rpc_type)
11267 {
11268 #ifndef SERVER
11269 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11270 Param2<bool, string> p = new Param2<bool, string>(false, "");
11271
11273 return;
11274
11275 bool play = p.param1;
11276 string soundSet = p.param2;
11277
11278 if (play)
11279 {
11281 {
11283 {
11285 }
11286 }
11287 else
11288 {
11290 }
11291 }
11292 else
11293 {
11295 }
11296
11297 break;
11298 #endif
11299
11300 }
11301
11303 {
11305 }
11306 }
11307
11308
11309
11310
11312 {
11313 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11314 return plugin.GetID(
name);
11315 }
11316
11318 {
11319 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11320 return plugin.GetName(id);
11321 }
11322
11325 {
11326
11327
11328 int varFlags;
11329 if (!ctx.
Read(varFlags))
11330 return;
11331
11332 if (varFlags & ItemVariableFlags.FLOAT)
11333 {
11335 }
11336 }
11337
11339 {
11340
11341 super.SerializeNumericalVars(floats_out);
11342
11343
11344
11346 {
11348 }
11349
11351 {
11353 }
11354
11356 {
11358 }
11359
11361 {
11366 }
11367
11369 {
11371 }
11372 }
11373
11375 {
11376
11377 super.DeSerializeNumericalVars(floats);
11378
11379
11380 int index = 0;
11381 int mask = Math.Round(floats.Get(index));
11382
11383 index++;
11384
11386 {
11388 {
11390 }
11391 else
11392 {
11393 float quantity = floats.Get(index);
11394 SetQuantity(quantity,
true,
false,
false,
false);
11395 }
11396 index++;
11397 }
11398
11400 {
11401 float wet = floats.Get(index);
11403 index++;
11404 }
11405
11407 {
11408 int liquidtype = Math.Round(floats.Get(index));
11410 index++;
11411 }
11412
11414 {
11416 index++;
11418 index++;
11420 index++;
11422 index++;
11423 }
11424
11426 {
11427 int cleanness = Math.Round(floats.Get(index));
11429 index++;
11430 }
11431 }
11432
11434 {
11435 super.WriteVarsToCTX(ctx);
11436
11437
11439 {
11441 }
11442
11444 {
11446 }
11447
11449 {
11451 }
11452
11454 {
11455 int r,g,b,a;
11461 }
11462
11464 {
11466 }
11467 }
11468
11470 {
11471 if (!super.ReadVarsFromCTX(ctx,version))
11472 return false;
11473
11474 int intValue;
11475 float value;
11476
11477 if (version < 140)
11478 {
11479 if (!ctx.
Read(intValue))
11480 return false;
11481
11482 m_VariablesMask = intValue;
11483 }
11484
11486 {
11487 if (!ctx.
Read(value))
11488 return false;
11489
11491 {
11493 }
11494 else
11495 {
11497 }
11498 }
11499
11500 if (version < 140)
11501 {
11503 {
11504 if (!ctx.
Read(value))
11505 return false;
11506 SetTemperatureDirect(value);
11507 }
11508 }
11509
11511 {
11512 if (!ctx.
Read(value))
11513 return false;
11515 }
11516
11518 {
11519 if (!ctx.
Read(intValue))
11520 return false;
11522 }
11523
11525 {
11526 int r,g,b,a;
11528 return false;
11530 return false;
11532 return false;
11534 return false;
11535
11537 }
11538
11540 {
11541 if (!ctx.
Read(intValue))
11542 return false;
11544 }
11545
11546 if (version >= 138 && version < 140)
11547 {
11549 {
11550 if (!ctx.
Read(intValue))
11551 return false;
11552 SetFrozen(intValue);
11553 }
11554 }
11555
11556 return true;
11557 }
11558
11559
11561 {
11564 {
11566 }
11567
11568 if (!super.OnStoreLoad(ctx, version))
11569 {
11571 return false;
11572 }
11573
11574 if (version >= 114)
11575 {
11576 bool hasQuickBarIndexSaved;
11577
11578 if (!ctx.
Read(hasQuickBarIndexSaved))
11579 {
11581 return false;
11582 }
11583
11584 if (hasQuickBarIndexSaved)
11585 {
11586 int itmQBIndex;
11587
11588
11589 if (!ctx.
Read(itmQBIndex))
11590 {
11592 return false;
11593 }
11594
11595 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11596 if (itmQBIndex != -1 && parentPlayer)
11597 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11598 }
11599 }
11600 else
11601 {
11602
11603 PlayerBase player;
11604 int itemQBIndex;
11605 if (version ==
int.
MAX)
11606 {
11607 if (!ctx.
Read(itemQBIndex))
11608 {
11610 return false;
11611 }
11612 }
11613 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11614 {
11615
11616 if (!ctx.
Read(itemQBIndex))
11617 {
11619 return false;
11620 }
11621 if (itemQBIndex != -1 && player)
11622 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11623 }
11624 }
11625
11626 if (version < 140)
11627 {
11628
11629 if (!LoadVariables(ctx, version))
11630 {
11632 return false;
11633 }
11634 }
11635
11636
11638 {
11640 return false;
11641 }
11642 if (version >= 132)
11643 {
11645 if (raib)
11646 {
11648 {
11650 return false;
11651 }
11652 }
11653 }
11654
11656 return true;
11657 }
11658
11659
11660
11662 {
11663 super.OnStoreSave(ctx);
11664
11665 PlayerBase player;
11666 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11667 {
11669
11670 int itemQBIndex = -1;
11671 itemQBIndex = player.FindQuickBarEntityIndex(this);
11672 ctx.
Write(itemQBIndex);
11673 }
11674 else
11675 {
11677 }
11678
11680
11682 if (raib)
11683 {
11685 }
11686 }
11687
11688
11690 {
11691 super.AfterStoreLoad();
11692
11694 {
11696 }
11697
11699 {
11702 }
11703 }
11704
11706 {
11707 super.EEOnAfterLoad();
11708
11710 {
11712 }
11713
11716 }
11717
11719 {
11720 return false;
11721 }
11722
11723
11724
11726 {
11728 {
11729 #ifdef PLATFORM_CONSOLE
11730
11732 {
11734 if (menu)
11735 {
11737 }
11738 }
11739 #endif
11740 }
11741
11743 {
11746 }
11747
11749 {
11750 SetWeightDirty();
11752 }
11754 {
11757 }
11758
11760 {
11763 }
11765 {
11768 }
11769
11770 super.OnVariablesSynchronized();
11771 }
11772
11773
11774
11776 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11777 {
11778 if (!IsServerCheck(allow_client))
11779 return false;
11780
11782 return false;
11783
11786
11787 if (value <= (min + 0.001))
11788 value = min;
11789
11790 if (value == min)
11791 {
11792 if (destroy_config)
11793 {
11794 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11795 if (dstr)
11796 {
11798 this.Delete();
11799 return true;
11800 }
11801 }
11802 else if (destroy_forced)
11803 {
11805 this.Delete();
11806 return true;
11807 }
11808
11810 }
11811
11814
11816 {
11818
11819 if (delta)
11821 }
11822
11824
11825 return false;
11826 }
11827
11828
11830 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11831 {
11833 }
11834
11836 {
11839 }
11840
11842 {
11845 }
11846
11848 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11849 {
11850 float value_clamped = Math.Clamp(value, 0, 1);
11852 SetQuantity(result, destroy_config, destroy_forced);
11853 }
11854
11855
11858 {
11860 }
11861
11863 {
11865 }
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11877 {
11878 int slot = -1;
11879 if (GetInventory())
11880 {
11881 InventoryLocation il = new InventoryLocation;
11882 GetInventory().GetCurrentInventoryLocation(il);
11884 }
11885
11887 }
11888
11890 {
11891 float quantity_max = 0;
11892
11894 {
11895 if (attSlotID != -1)
11896 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11897
11898 if (quantity_max <= 0)
11900 }
11901
11902 if (quantity_max <= 0)
11904
11905 return quantity_max;
11906 }
11907
11909 {
11911 }
11912
11914 {
11916 }
11917
11918
11920 {
11922 }
11923
11925 {
11927 }
11928
11930 {
11932 }
11933
11934
11936 {
11937
11938 float weightEx = GetWeightEx();
11939 float special = GetInventoryAndCargoWeight();
11940 return weightEx - special;
11941 }
11942
11943
11945 {
11947 }
11948
11950 {
11952 {
11953 #ifdef DEVELOPER
11954 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11955 {
11956 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11958 }
11959 #endif
11960
11961 return GetQuantity() * GetConfigWeightModified();
11962 }
11963 else if (HasEnergyManager())
11964 {
11965 #ifdef DEVELOPER
11966 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11967 {
11968 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11969 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11970 }
11971 #endif
11972 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11973 }
11974 else
11975 {
11976 #ifdef DEVELOPER
11977 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11978 {
11979 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11980 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11981 }
11982 #endif
11983 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11984 }
11985 }
11986
11989 {
11990 int item_count = 0;
11992
11993 if (GetInventory().GetCargo() != NULL)
11994 {
11995 item_count = GetInventory().GetCargo().GetItemCount();
11996 }
11997
11998 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11999 {
12000 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12001 if (item)
12002 item_count += item.GetNumberOfItems();
12003 }
12004 return item_count;
12005 }
12006
12009 {
12010 float weight = 0;
12011 float wetness = 1;
12012 if (include_wetness)
12015 {
12016 weight = wetness * m_ConfigWeight;
12017 }
12019 {
12020 weight = 1;
12021 }
12022 return weight;
12023 }
12024
12025
12026
12028 {
12029 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12030 {
12031 GameInventory inv = GetInventory();
12032 array<EntityAI> items = new array<EntityAI>;
12034 for (int i = 0; i < items.Count(); i++)
12035 {
12037 if (item)
12038 {
12040 }
12041 }
12042 }
12043 }
12044
12045
12046
12047
12049 {
12050 float energy = 0;
12051 if (HasEnergyManager())
12052 {
12053 energy = GetCompEM().GetEnergy();
12054 }
12055 return energy;
12056 }
12057
12058
12060 {
12061 super.OnEnergyConsumed();
12062
12064 }
12065
12067 {
12068 super.OnEnergyAdded();
12069
12071 }
12072
12073
12075 {
12076 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12077 {
12079 {
12080 float energy_0to1 = GetCompEM().GetEnergy0To1();
12082 }
12083 }
12084 }
12085
12086
12088 {
12089 return ConfigGetFloat("heatIsolation");
12090 }
12091
12093 {
12095 }
12096
12098 {
12099 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12100 if (
GetGame().ConfigIsExisting(paramPath))
12102
12103 return 0.0;
12104 }
12105
12107 {
12108 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12109 if (
GetGame().ConfigIsExisting(paramPath))
12111
12112 return 0.0;
12113 }
12114
12115 override void SetWet(
float value,
bool allow_client =
false)
12116 {
12117 if (!IsServerCheck(allow_client))
12118 return;
12119
12122
12124
12125 m_VarWet = Math.Clamp(value, min, max);
12126
12128 {
12131 }
12132 }
12133
12134 override void AddWet(
float value)
12135 {
12137 }
12138
12140 {
12142 }
12143
12145 {
12147 }
12148
12150 {
12152 }
12153
12155 {
12157 }
12158
12160 {
12162 }
12163
12164 override void OnWetChanged(
float newVal,
float oldVal)
12165 {
12168 if (newLevel != oldLevel)
12169 {
12171 }
12172 }
12173
12175 {
12176 SetWeightDirty();
12177 }
12178
12180 {
12181 return GetWetLevelInternal(
m_VarWet);
12182 }
12183
12184
12185
12187 {
12189 }
12190
12192 {
12194 }
12195
12197 {
12199 }
12200
12202 {
12204 }
12205
12206
12207
12209 {
12210 if (ConfigIsExisting("itemModelLength"))
12211 {
12212 return ConfigGetFloat("itemModelLength");
12213 }
12214 return 0;
12215 }
12216
12218 {
12219 if (ConfigIsExisting("itemAttachOffset"))
12220 {
12221 return ConfigGetFloat("itemAttachOffset");
12222 }
12223 return 0;
12224 }
12225
12226 override void SetCleanness(
int value,
bool allow_client =
false)
12227 {
12228 if (!IsServerCheck(allow_client))
12229 return;
12230
12232
12234
12237 }
12238
12240 {
12242 }
12243
12245 {
12246 return true;
12247 }
12248
12249
12250
12251
12253 {
12255 }
12256
12258 {
12260 }
12261
12262
12263
12264
12265 override void SetColor(
int r,
int g,
int b,
int a)
12266 {
12272 }
12274 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12275 {
12280 }
12281
12283 {
12285 }
12286
12289 {
12290 int r,g,b,a;
12292 r = r/255;
12293 g = g/255;
12294 b = b/255;
12295 a = a/255;
12296 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12297 }
12298
12299
12300
12301 override void SetLiquidType(
int value,
bool allow_client =
false)
12302 {
12303 if (!IsServerCheck(allow_client))
12304 return;
12305
12310 }
12311
12313 {
12314 return ConfigGetInt("varLiquidTypeInit");
12315 }
12316
12318 {
12320 }
12321
12323 {
12325 SetFrozen(false);
12326 }
12327
12330 {
12331 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12332 }
12333
12334
12337 {
12338 PlayerBase nplayer;
12339 if (PlayerBase.CastTo(nplayer, player))
12340 {
12342
12343 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12344 }
12345 }
12346
12347
12350 {
12351 PlayerBase nplayer;
12352 if (PlayerBase.CastTo(nplayer,player))
12353 {
12354
12355 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12356
12357 }
12358
12359
12360 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12361
12362
12363 if (HasEnergyManager())
12364 {
12365 GetCompEM().UpdatePlugState();
12366 }
12367 }
12368
12369
12371 {
12372 super.OnPlacementStarted(player);
12373
12375 }
12376
12377 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12378 {
12380 {
12381 m_AdminLog.OnPlacementComplete(player,
this);
12382 }
12383
12384 super.OnPlacementComplete(player, position, orientation);
12385 }
12386
12387
12388
12389
12390
12392 {
12394 {
12395 return true;
12396 }
12397 else
12398 {
12399 return false;
12400 }
12401 }
12402
12403
12405 {
12407 {
12409 }
12410 }
12411
12412
12414 {
12416 }
12417
12419 {
12421 }
12422
12423 override void InsertAgent(
int agent,
float count = 1)
12424 {
12425 if (count < 1)
12426 return;
12427
12429 }
12430
12433 {
12435 }
12436
12437
12439 {
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
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12485 {
12487 return false;
12488 return true;
12489 }
12490
12492 {
12493
12495 }
12496
12497
12500 {
12501 super.CheckForRoofLimited(timeTresholdMS);
12502
12504 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12505 {
12506 m_PreviousRoofTestTime = time;
12507 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12508 }
12509 }
12510
12511
12513 {
12515 {
12516 return 0;
12517 }
12518
12519 if (GetInventory().GetAttachmentSlotsCount() != 0)
12520 {
12521 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12522 if (filter)
12523 return filter.GetProtectionLevel(type, false, system);
12524 else
12525 return 0;
12526 }
12527
12528 string subclassPath, entryName;
12529
12530 switch (type)
12531 {
12533 entryName = "biological";
12534 break;
12536 entryName = "chemical";
12537 break;
12538 default:
12539 entryName = "biological";
12540 break;
12541 }
12542
12543 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12544
12546 }
12547
12548
12549
12552 {
12553 if (!IsMagazine())
12555
12557 }
12558
12559
12560
12561
12562
12567 {
12568 return true;
12569 }
12570
12572 {
12574 }
12575
12576
12577
12578
12579
12581 {
12582 if (parent)
12583 {
12584 if (parent.IsInherited(DayZInfected))
12585 return true;
12586
12587 if (!parent.IsRuined())
12588 return true;
12589 }
12590
12591 return true;
12592 }
12593
12595 {
12596 if (!super.CanPutAsAttachment(parent))
12597 {
12598 return false;
12599 }
12600
12601 if (!IsRuined() && !parent.IsRuined())
12602 {
12603 return true;
12604 }
12605
12606 return false;
12607 }
12608
12610 {
12611
12612
12613
12614
12615 return super.CanReceiveItemIntoCargo(item);
12616 }
12617
12619 {
12620
12621
12622
12623
12624 GameInventory attachmentInv = attachment.GetInventory();
12626 {
12627 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12628 return false;
12629 }
12630
12631 InventoryLocation loc = new InventoryLocation();
12632 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12633 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12634 return false;
12635
12636 return super.CanReceiveAttachment(attachment, slotId);
12637 }
12638
12640 {
12641 if (!super.CanReleaseAttachment(attachment))
12642 return false;
12643
12644 return GetInventory().AreChildrenAccessible();
12645 }
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12668 {
12669 int id = muzzle_owner.GetMuzzleID();
12670 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12671
12672 if (WPOF_array)
12673 {
12674 for (int i = 0; i < WPOF_array.Count(); i++)
12675 {
12676 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12677
12678 if (WPOF)
12679 {
12680 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12681 }
12682 }
12683 }
12684 }
12685
12686
12688 {
12689 int id = muzzle_owner.GetMuzzleID();
12691
12692 if (WPOBE_array)
12693 {
12694 for (int i = 0; i < WPOBE_array.Count(); i++)
12695 {
12696 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12697
12698 if (WPOBE)
12699 {
12700 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12701 }
12702 }
12703 }
12704 }
12705
12706
12708 {
12709 int id = muzzle_owner.GetMuzzleID();
12710 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12711
12712 if (WPOOH_array)
12713 {
12714 for (int i = 0; i < WPOOH_array.Count(); i++)
12715 {
12716 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12717
12718 if (WPOOH)
12719 {
12720 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12721 }
12722 }
12723 }
12724 }
12725
12726
12728 {
12729 int id = muzzle_owner.GetMuzzleID();
12730 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12731
12732 if (WPOOH_array)
12733 {
12734 for (int i = 0; i < WPOOH_array.Count(); i++)
12735 {
12736 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12737
12738 if (WPOOH)
12739 {
12740 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12741 }
12742 }
12743 }
12744 }
12745
12746
12748 {
12749 int id = muzzle_owner.GetMuzzleID();
12750 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12751
12752 if (WPOOH_array)
12753 {
12754 for (int i = 0; i < WPOOH_array.Count(); i++)
12755 {
12756 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12757
12758 if (WPOOH)
12759 {
12760 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12761 }
12762 }
12763 }
12764 }
12765
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 {
12791 {
12792 return true;
12793 }
12794
12795 return false;
12796 }
12797
12799 {
12800 return false;
12801 }
12802
12805 {
12806 return UATimeSpent.DEFAULT_DEPLOY;
12807 }
12808
12809
12810
12811
12813 {
12815 SetSynchDirty();
12816 }
12817
12819 {
12821 }
12822
12823
12825 {
12826 return false;
12827 }
12828
12831 {
12832 string att_type = "None";
12833
12834 if (ConfigIsExisting("soundAttType"))
12835 {
12836 att_type = ConfigGetString("soundAttType");
12837 }
12838
12840 }
12841
12843 {
12845 }
12846
12847
12848
12849
12850
12856
12858 {
12861
12863 }
12864
12865
12867 {
12869 return;
12870
12872
12875
12878
12879 SoundParameters params = new SoundParameters();
12883 }
12884
12885
12887 {
12889 return;
12890
12892 SetSynchDirty();
12893
12896 }
12897
12898
12900 {
12902 return;
12903
12905 SetSynchDirty();
12906
12909 }
12910
12912 {
12914 }
12915
12917 {
12919 }
12920
12923 {
12924 if (!
GetGame().IsDedicatedServer())
12925 {
12926 if (ConfigIsExisting("attachSoundSet"))
12927 {
12928 string cfg_path = "";
12929 string soundset = "";
12930 string type_name =
GetType();
12931
12934 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12935 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12936
12937 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12938 {
12939 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12940 {
12941 if (cfg_slot_array[i] == slot_type)
12942 {
12943 soundset = cfg_soundset_array[i];
12944 break;
12945 }
12946 }
12947 }
12948
12949 if (soundset != "")
12950 {
12951 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12953 }
12954 }
12955 }
12956 }
12957
12959 {
12960
12961 }
12962
12963 void OnApply(PlayerBase player);
12964
12966 {
12967 return 1.0;
12968 };
12969
12971 {
12973 }
12974
12976 {
12978 }
12979
12981
12983 {
12984 SetDynamicPhysicsLifeTime(0.01);
12986 }
12987
12989 {
12990 array<string> zone_names = new array<string>;
12991 GetDamageZones(zone_names);
12992 for (int i = 0; i < zone_names.Count(); i++)
12993 {
12994 SetHealthMax(zone_names.Get(i),"Health");
12995 }
12996 SetHealthMax("","Health");
12997 }
12998
13001 {
13002 float global_health = GetHealth01("","Health");
13003 array<string> zones = new array<string>;
13004 GetDamageZones(zones);
13005
13006 for (int i = 0; i < zones.Count(); i++)
13007 {
13008 SetHealth01(zones.Get(i),"Health",global_health);
13009 }
13010 }
13011
13014 {
13015 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13016 }
13017
13019 {
13020 if (!hasRootAsPlayer)
13021 {
13022 if (refParentIB)
13023 {
13024
13025 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13026 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13027
13028 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13029 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13030
13033 }
13034 else
13035 {
13036
13039 }
13040 }
13041 }
13042
13044 {
13046 {
13047 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13048 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13049 {
13050 float heatPermCoef = 1.0;
13052 while (ent)
13053 {
13054 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13055 ent = ent.GetHierarchyParent();
13056 }
13057
13058 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13059 }
13060 }
13061 }
13062
13064 {
13065
13066 EntityAI parent = GetHierarchyParent();
13067 if (!parent)
13068 {
13069 hasParent = false;
13070 hasRootAsPlayer = false;
13071 }
13072 else
13073 {
13074 hasParent = true;
13075 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13076 refParentIB =
ItemBase.Cast(parent);
13077 }
13078 }
13079
13080 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13081 {
13082
13083 }
13084
13086 {
13087
13088 return false;
13089 }
13090
13092 {
13093
13094
13095 return false;
13096 }
13097
13099 {
13100
13101 return false;
13102 }
13103
13106 {
13107 return !GetIsFrozen() &&
IsOpen();
13108 }
13109
13111 {
13112 bool hasParent = false, hasRootAsPlayer = false;
13114
13115 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13116 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13117
13118 if (wwtu || foodDecay)
13119 {
13123
13124 if (processWetness || processTemperature || processDecay)
13125 {
13127
13128 if (processWetness)
13129 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13130
13131 if (processTemperature)
13133
13134 if (processDecay)
13135 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13136 }
13137 }
13138 }
13139
13142 {
13144 }
13145
13147 {
13150
13151 return super.GetTemperatureFreezeThreshold();
13152 }
13153
13155 {
13158
13159 return super.GetTemperatureThawThreshold();
13160 }
13161
13163 {
13166
13167 return super.GetItemOverheatThreshold();
13168 }
13169
13171 {
13173 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13174
13175 return super.GetTemperatureFreezeTime();
13176 }
13177
13179 {
13181 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13182
13183 return super.GetTemperatureThawTime();
13184 }
13185
13190
13192 {
13193 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13194 }
13195
13197 {
13198 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13199 }
13200
13203 {
13205 }
13206
13208 {
13210 }
13211
13213 {
13215 }
13216
13219 {
13220 return null;
13221 }
13222
13225 {
13226 return false;
13227 }
13228
13230 {
13232 {
13235 if (!trg)
13236 {
13238 explosive = this;
13239 }
13240
13241 explosive.PairRemote(trg);
13243
13244 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13245 trg.SetPersistentPairID(persistentID);
13246 explosive.SetPersistentPairID(persistentID);
13247
13248 return true;
13249 }
13250 return false;
13251 }
13252
13255 {
13256 float ret = 1.0;
13259 ret *= GetHealth01();
13260
13261 return ret;
13262 }
13263
13264 #ifdef DEVELOPER
13265 override void SetDebugItem()
13266 {
13267 super.SetDebugItem();
13268 _itemBase = this;
13269 }
13270
13272 {
13273 string text = super.GetDebugText();
13274
13276 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13277
13278 return text;
13279 }
13280 #endif
13281
13283 {
13284 return true;
13285 }
13286
13288
13290
13292 {
13295 }
13296
13297
13305
13321}
13322
13324{
13326 if (entity)
13327 {
13328 bool is_item = entity.IsInherited(
ItemBase);
13329 if (is_item && full_quantity)
13330 {
13333 }
13334 }
13335 else
13336 {
13338 return NULL;
13339 }
13340 return entity;
13341}
13342
13344{
13345 if (item)
13346 {
13347 if (health > 0)
13348 item.SetHealth("", "", health);
13349
13350 if (item.CanHaveTemperature())
13351 {
13353 if (item.CanFreeze())
13354 item.SetFrozen(false);
13355 }
13356
13357 if (item.HasEnergyManager())
13358 {
13359 if (quantity >= 0)
13360 {
13361 item.GetCompEM().SetEnergy0To1(quantity);
13362 }
13363 else
13364 {
13366 }
13367 }
13368 else if (item.IsMagazine())
13369 {
13370 Magazine mag = Magazine.Cast(item);
13371 if (quantity >= 0)
13372 {
13373 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13374 }
13375 else
13376 {
13378 }
13379
13380 }
13381 else
13382 {
13383 if (quantity >= 0)
13384 {
13385 item.SetQuantityNormalized(quantity, false);
13386 }
13387 else
13388 {
13390 }
13391
13392 }
13393 }
13394}
13395
13396#ifdef DEVELOPER
13398#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.