8450{
8452 {
8453 return true;
8454 }
8455};
8456
8457
8458
8460{
8464
8466
8469
8470
8471
8472
8473
8482
8488
8493
8498
8519 protected bool m_IsResultOfSplit
8520
8522
8527
8528
8529
8531
8535
8536
8537
8539
8542
8543
8544
8550
8551
8559
8562
8563
8565
8566
8568
8569
8574
8575
8580
8581
8583
8584
8586 {
8591
8592 if (!
GetGame().IsDedicatedServer())
8593 {
8595 {
8597
8599 {
8601 }
8602 }
8603
8606 }
8607
8608 m_OldLocation = null;
8609
8611 {
8613 }
8614
8615 if (ConfigIsExisting("headSelectionsToHide"))
8616 {
8619 }
8620
8622 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8623 {
8625 }
8626
8628
8629 m_IsResultOfSplit = false;
8630
8632 }
8633
8635 {
8636 super.InitItemVariables();
8637
8643 m_Count = ConfigGetInt(
"count");
8644
8647
8652
8655
8660
8672
8676
8677
8680 if (ConfigIsExisting("canBeSplit"))
8681 {
8684 }
8685
8687 if (ConfigIsExisting("itemBehaviour"))
8689
8690
8693 RegisterNetSyncVariableInt("m_VarLiquidType");
8694 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8695
8696 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8697 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8698 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8699
8700 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8701 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8702 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8703 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8704
8705 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8706 RegisterNetSyncVariableBool("m_IsTakeable");
8707 RegisterNetSyncVariableBool("m_IsHologram");
8708
8711 {
8714 }
8715
8717
8719 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8721
8722 }
8723
8725 {
8727 }
8728
8730 {
8733 {
8738 }
8739 }
8740
8741 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8742 {
8744 {
8747 }
8748
8750 }
8751
8753 {
8759 }
8760
8762
8764 {
8766
8767 if (!action)
8768 {
8769 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8770 return;
8771 }
8772
8774 if (!ai)
8775 {
8777 return;
8778 }
8779
8781 if (!action_array)
8782 {
8783 action_array = new array<ActionBase_Basic>;
8785 }
8786 if (LogManager.IsActionLogEnable())
8787 {
8788 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8789 }
8790
8791 if (action_array.Find(action) != -1)
8792 {
8793 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8794 }
8795 else
8796 {
8797 action_array.Insert(action);
8798 }
8799 }
8800
8802 {
8804 ActionBase action = player.GetActionManager().GetAction(actionName);
8807
8808 if (action_array)
8809 {
8810 action_array.RemoveItem(action);
8811 }
8812 }
8813
8814
8815
8817 {
8818 ActionOverrideData overrideData = new ActionOverrideData();
8822
8824 if (!actionMap)
8825 {
8828 }
8829
8830 actionMap.Insert(this.
Type(), overrideData);
8831
8832 }
8833
8835
8837
8838
8840 {
8843
8846
8847 string config_to_search = "CfgVehicles";
8848 string muzzle_owner_config;
8849
8851 {
8852 if (IsInherited(Weapon))
8853 config_to_search = "CfgWeapons";
8854
8855 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8856
8857 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8858
8860
8861 if (config_OnFire_subclass_count > 0)
8862 {
8863 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8864
8865 for (int i = 0; i < config_OnFire_subclass_count; i++)
8866 {
8867 string particle_class = "";
8869 string config_OnFire_entry = config_OnFire_class + particle_class;
8870 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8871 WPOF_array.Insert(WPOF);
8872 }
8873
8874
8876 }
8877 }
8878
8880 {
8881 config_to_search = "CfgWeapons";
8882 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8883
8884 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8885
8887
8888 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8889 {
8890 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8891
8892 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8893 {
8894 string particle_class2 = "";
8896 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8897 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8898 WPOBE_array.Insert(WPOBE);
8899 }
8900
8901
8903 }
8904 }
8905 }
8906
8907
8909 {
8912
8914 {
8915 string config_to_search = "CfgVehicles";
8916
8917 if (IsInherited(Weapon))
8918 config_to_search = "CfgWeapons";
8919
8920 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8921 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8922
8923 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8924 {
8925
8927
8929 {
8931 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8933 return;
8934 }
8935
8938
8939
8940
8942 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8943
8944 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8945 {
8946 string particle_class = "";
8948 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8950
8951 if (entry_type == CT_CLASS)
8952 {
8953 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8954 WPOOH_array.Insert(WPOF);
8955 }
8956 }
8957
8958
8960 }
8961 }
8962 }
8963
8965 {
8967 }
8968
8970 {
8972 {
8974
8977
8980
8981 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8982 }
8983 }
8984
8986 {
8988 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8989
8991 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8992
8994 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8995
8997 {
8999 }
9000 }
9001
9003 {
9005 }
9006
9008 {
9011 else
9013
9015 {
9018 }
9019 else
9020 {
9023
9026 }
9027
9029 }
9030
9032 {
9034 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9035 }
9036
9038 {
9040 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9042 }
9043
9045 {
9047 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9048 }
9049
9051 {
9054
9055 OverheatingParticle OP = new OverheatingParticle();
9060
9062 }
9063
9065 {
9068
9069 return -1;
9070 }
9071
9073 {
9075 {
9078
9079 for (int i = count; i > 0; --i)
9080 {
9081 int id = i - 1;
9084
9087
9088 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9089 {
9090 if (p)
9091 {
9094 }
9095 }
9096 }
9097 }
9098 }
9099
9101 {
9103 {
9105 {
9106 int id = i - 1;
9108
9109 if (OP)
9110 {
9112
9113 if (p)
9114 {
9116 }
9117
9118 delete OP;
9119 }
9120 }
9121
9124 }
9125 }
9126
9129 {
9130 return 0.0;
9131 }
9132
9133
9135 {
9136 return 250;
9137 }
9138
9140 {
9141 return 0;
9142 }
9143
9146 {
9148 return true;
9149
9150 return false;
9151 }
9152
9155 {
9158
9160 {
9162 }
9163 else
9164 {
9165
9167 }
9168
9170 }
9171
9178 {
9179 return -1;
9180 }
9181
9182
9183
9184
9186 {
9188 {
9190 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9191
9192 if (r_index >= 0)
9193 {
9194 InventoryLocation r_il = new InventoryLocation;
9195 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9196
9197 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9200 {
9201 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9202 }
9204 {
9205 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9206 }
9207
9208 }
9209
9210 player.GetHumanInventory().ClearUserReservedLocation(this);
9211 }
9212
9215 }
9216
9217
9218
9219
9221 {
9222 return ItemBase.m_DebugActionsMask;
9223 }
9224
9226 {
9227 return ItemBase.m_DebugActionsMask & mask;
9228 }
9229
9231 {
9232 ItemBase.m_DebugActionsMask = mask;
9233 }
9234
9236 {
9237 ItemBase.m_DebugActionsMask |= mask;
9238 }
9239
9241 {
9242 ItemBase.m_DebugActionsMask &= ~mask;
9243 }
9244
9246 {
9248 {
9250 }
9251 else
9252 {
9254 }
9255 }
9256
9257
9259 {
9260 if (GetEconomyProfile())
9261 {
9262 float q_max = GetEconomyProfile().GetQuantityMax();
9263 if (q_max > 0)
9264 {
9265 float q_min = GetEconomyProfile().GetQuantityMin();
9266 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9267
9269 {
9270 ComponentEnergyManager comp = GetCompEM();
9272 {
9274 }
9275 }
9277 {
9279
9280 }
9281
9282 }
9283 }
9284 }
9285
9288 {
9289 EntityAI parent = GetHierarchyParent();
9290
9291 if (parent)
9292 {
9293 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9294 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9295 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9296 }
9297 }
9298
9301 {
9302 EntityAI parent = GetHierarchyParent();
9303
9304 if (parent)
9305 {
9306 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9307 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9308 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9309 }
9310 }
9311
9313 {
9314
9315
9316
9317
9319
9321 {
9322 if (ScriptInputUserData.CanStoreInputUserData())
9323 {
9324 ScriptInputUserData ctx = new ScriptInputUserData;
9330 ctx.
Write(use_stack_max);
9333
9335 {
9336 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9337 }
9338 }
9339 }
9340 else if (!
GetGame().IsMultiplayer())
9341 {
9343 }
9344 }
9345
9347 {
9349 }
9350
9352 {
9354 }
9355
9357 {
9359 }
9360
9362 {
9363
9364 return false;
9365 }
9366
9368 {
9369 return false;
9370 }
9371
9375 {
9376 return false;
9377 }
9378
9380 {
9381 return "";
9382 }
9383
9385
9387 {
9388 return false;
9389 }
9390
9392 {
9393 return true;
9394 }
9395
9396
9397
9399 {
9400 return true;
9401 }
9402
9404 {
9405 return true;
9406 }
9407
9409 {
9410 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9412 }
9413
9415 {
9417 }
9418
9420 {
9422 if (!is_being_placed)
9424 SetSynchDirty();
9425 }
9426
9427
9429
9431 {
9433 }
9434
9436 {
9438 }
9439
9441 {
9442 return 1;
9443 }
9444
9446 {
9447 return false;
9448 }
9449
9451 {
9453 SetSynchDirty();
9454 }
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9491 {
9492 super.OnMovedInsideCargo(container);
9493
9494 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9495 }
9496
9497 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9498 {
9499 super.EEItemLocationChanged(oldLoc,newLoc);
9500
9501 PlayerBase new_player = null;
9502 PlayerBase old_player = null;
9503
9504 if (newLoc.GetParent())
9505 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9506
9507 if (oldLoc.GetParent())
9508 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9509
9511 {
9512 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9513
9514 if (r_index >= 0)
9515 {
9516 InventoryLocation r_il = new InventoryLocation;
9517 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9518
9519 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9522 {
9523 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9524 }
9526 {
9527 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9528 }
9529
9530 }
9531 }
9532
9534 {
9535 if (new_player)
9536 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9537
9538 if (new_player == old_player)
9539 {
9540
9541 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9542 {
9544 {
9545 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9546 {
9547 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9548 }
9549 }
9550 else
9551 {
9552 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9553 }
9554 }
9555
9556 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9557 {
9558 int type = oldLoc.GetType();
9560 {
9561 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9562 }
9564 {
9565 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9566 }
9567 }
9568 if (!m_OldLocation)
9569 {
9570 m_OldLocation = new InventoryLocation;
9571 }
9572 m_OldLocation.Copy(oldLoc);
9573 }
9574 else
9575 {
9576 if (m_OldLocation)
9577 {
9578 m_OldLocation.Reset();
9579 }
9580 }
9581
9583 }
9584 else
9585 {
9586 if (new_player)
9587 {
9588 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9589 if (res_index >= 0)
9590 {
9591 InventoryLocation il = new InventoryLocation;
9592 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9594 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9597 {
9598 il.
GetParent().GetOnReleaseLock().Invoke(it);
9599 }
9601 {
9603 }
9604
9605 }
9606 }
9608 {
9609
9611 }
9612
9613 if (m_OldLocation)
9614 {
9615 m_OldLocation.Reset();
9616 }
9617 }
9618 }
9619
9620 override void EOnContact(IEntity other, Contact extra)
9621 {
9623 {
9624 int liquidType = -1;
9626 if (impactSpeed > 0.0)
9627 {
9629 #ifndef SERVER
9631 #else
9633 SetSynchDirty();
9634 #endif
9636 }
9637 }
9638
9639 #ifdef SERVER
9640 if (GetCompEM() && GetCompEM().IsPlugged())
9641 {
9642 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9643 GetCompEM().UnplugThis();
9644 }
9645 #endif
9646 }
9647
9649
9651 {
9653 }
9654
9656 {
9657
9658 }
9659
9661 {
9662 super.OnItemLocationChanged(old_owner, new_owner);
9663
9664 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9665 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9666
9667 if (!relatedPlayer && playerNew)
9668 relatedPlayer = playerNew;
9669
9670 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9671 {
9673 if (actionMgr)
9674 {
9675 ActionBase currentAction = actionMgr.GetRunningAction();
9676 if (currentAction)
9678 }
9679 }
9680
9681 Man ownerPlayerOld = null;
9682 Man ownerPlayerNew = null;
9683
9684 if (old_owner)
9685 {
9686 if (old_owner.
IsMan())
9687 {
9688 ownerPlayerOld = Man.Cast(old_owner);
9689 }
9690 else
9691 {
9692 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9693 }
9694 }
9695 else
9696 {
9698 {
9700
9701 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9702 {
9703 GetCompEM().UnplugThis();
9704 }
9705 }
9706 }
9707
9708 if (new_owner)
9709 {
9710 if (new_owner.
IsMan())
9711 {
9712 ownerPlayerNew = Man.Cast(new_owner);
9713 }
9714 else
9715 {
9716 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9717 }
9718 }
9719
9720 if (ownerPlayerOld != ownerPlayerNew)
9721 {
9722 if (ownerPlayerOld)
9723 {
9724 array<EntityAI> subItemsExit = new array<EntityAI>;
9726 for (int i = 0; i < subItemsExit.Count(); i++)
9727 {
9730 }
9731 }
9732
9733 if (ownerPlayerNew)
9734 {
9735 array<EntityAI> subItemsEnter = new array<EntityAI>;
9737 for (int j = 0; j < subItemsEnter.Count(); j++)
9738 {
9741 }
9742 }
9743 }
9744 else if (ownerPlayerNew != null)
9745 {
9746 PlayerBase nplayer;
9747 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9748 {
9749 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9751 for (int k = 0; k < subItemsUpdate.Count(); k++)
9752 {
9754 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9755 }
9756 }
9757 }
9758
9759 if (old_owner)
9760 old_owner.OnChildItemRemoved(this);
9761 if (new_owner)
9762 new_owner.OnChildItemReceived(this);
9763 }
9764
9765
9767 {
9768 super.EEDelete(parent);
9769 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9770 if (player)
9771 {
9773
9774 if (player.IsAlive())
9775 {
9776 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9777 if (r_index >= 0)
9778 {
9779 InventoryLocation r_il = new InventoryLocation;
9780 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9781
9782 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9785 {
9786 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9787 }
9789 {
9790 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9791 }
9792
9793 }
9794
9795 player.RemoveQuickBarEntityShortcut(this);
9796 }
9797 }
9798 }
9799
9801 {
9802 super.EEKilled(killer);
9803
9806 {
9807 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9808 {
9809 if (IsMagazine())
9810 {
9811 if (Magazine.Cast(this).GetAmmoCount() > 0)
9812 {
9814 }
9815 }
9816 else
9817 {
9819 }
9820 }
9821 }
9822 }
9823
9825 {
9826 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9827
9828 super.OnWasAttached(parent, slot_id);
9829
9832
9834 }
9835
9837 {
9838 super.OnWasDetached(parent, slot_id);
9839
9842 }
9843
9845 {
9846 int idx;
9849
9850 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9851 if (inventory_slots.Count() < 1)
9852 {
9853 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9854 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9855 }
9856 else
9857 {
9858 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9859 }
9860
9861 idx = inventory_slots.Find(slot);
9862 if (idx < 0)
9863 return "";
9864
9865 return attach_types.Get(idx);
9866 }
9867
9869 {
9870 int idx = -1;
9871 string slot;
9872
9875
9876 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9877 if (inventory_slots.Count() < 1)
9878 {
9879 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9880 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9881 }
9882 else
9883 {
9884 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9885 if (detach_types.Count() < 1)
9886 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9887 }
9888
9889 for (int i = 0; i < inventory_slots.Count(); i++)
9890 {
9891 slot = inventory_slots.Get(i);
9892 }
9893
9894 if (slot != "")
9895 {
9896 if (detach_types.Count() == 1)
9897 idx = 0;
9898 else
9899 idx = inventory_slots.Find(slot);
9900 }
9901 if (idx < 0)
9902 return "";
9903
9904 return detach_types.Get(idx);
9905 }
9906
9908 {
9909
9911
9912
9913 float min_time = 1;
9914 float max_time = 3;
9915 float delay = Math.RandomFloat(min_time, max_time);
9916
9917 explode_timer.Run(delay, this, "DoAmmoExplosion");
9918 }
9919
9921 {
9922 Magazine magazine = Magazine.Cast(this);
9923 int pop_sounds_count = 6;
9924 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9925
9926
9927 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9928 string sound_name = pop_sounds[ sound_idx ];
9930
9931
9932 magazine.ServerAddAmmoCount(-1);
9933
9934
9935 float min_temp_to_explode = 100;
9936
9937 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9938 {
9940 }
9941 }
9942
9943
9944 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9945 {
9946 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9947
9948 const int CHANCE_DAMAGE_CARGO = 4;
9949 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9950 const int CHANCE_DAMAGE_NOTHING = 2;
9951
9953 {
9954 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9955 int chances;
9956 int rnd;
9957
9958 if (GetInventory().GetCargo())
9959 {
9960 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9961 rnd = Math.RandomInt(0,chances);
9962
9963 if (rnd < CHANCE_DAMAGE_CARGO)
9964 {
9966 }
9967 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9968 {
9970 }
9971 }
9972 else
9973 {
9974 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9975 rnd = Math.RandomInt(0,chances);
9976
9977 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9978 {
9980 }
9981 }
9982 }
9983 }
9984
9986 {
9987 if (GetInventory().GetCargo())
9988 {
9989 int item_count = GetInventory().GetCargo().GetItemCount();
9990 if (item_count > 0)
9991 {
9992 int random_pick = Math.RandomInt(0, item_count);
9994 if (!item.IsExplosive())
9995 {
9996 item.AddHealth("","",damage);
9997 return true;
9998 }
9999 }
10000 }
10001 return false;
10002 }
10003
10005 {
10006 int attachment_count = GetInventory().AttachmentCount();
10007 if (attachment_count > 0)
10008 {
10009 int random_pick = Math.RandomInt(0, attachment_count);
10010 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10011 if (!attachment.IsExplosive())
10012 {
10013 attachment.AddHealth("","",damage);
10014 return true;
10015 }
10016 }
10017 return false;
10018 }
10019
10021 {
10023 }
10024
10026 {
10028 return GetInventory().CanRemoveEntity();
10029
10030 return false;
10031 }
10032
10034 {
10035
10037 return false;
10038
10039
10041 return false;
10042
10043
10044
10046 if (delta == 0)
10047 return false;
10048
10049
10050 return true;
10051 }
10052
10054 {
10056 {
10057 if (ScriptInputUserData.CanStoreInputUserData())
10058 {
10059 ScriptInputUserData ctx = new ScriptInputUserData;
10064 ctx.
Write(destination_entity);
10066 ctx.
Write(slot_id);
10068 }
10069 }
10070 else if (!
GetGame().IsMultiplayer())
10071 {
10073 }
10074 }
10075
10077 {
10078 float split_quantity_new;
10082 InventoryLocation loc = new InventoryLocation;
10083
10084 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10085 {
10087 split_quantity_new = stack_max;
10088 else
10090
10092 {
10093 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10094 if (new_item)
10095 {
10096 new_item.SetResultOfSplit(true);
10097 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10099 new_item.
SetQuantity(split_quantity_new,
false,
true);
10100 }
10101 }
10102 }
10103 else if (destination_entity && slot_id == -1)
10104 {
10105 if (quantity > stack_max)
10106 split_quantity_new = stack_max;
10107 else
10108 split_quantity_new = quantity;
10109
10111 {
10113 {
10116 }
10117
10118 if (new_item)
10119 {
10120 new_item.SetResultOfSplit(true);
10121 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10123 new_item.
SetQuantity(split_quantity_new,
false,
true);
10124 }
10125 }
10126 }
10127 else
10128 {
10129 if (stack_max != 0)
10130 {
10132 {
10134 }
10135
10136 if (split_quantity_new == 0)
10137 {
10138 if (!
GetGame().IsMultiplayer())
10139 player.PhysicalPredictiveDropItem(this);
10140 else
10141 player.ServerDropEntity(this);
10142 return;
10143 }
10144
10146 {
10148
10149 if (new_item)
10150 {
10151 new_item.SetResultOfSplit(true);
10152 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10155 new_item.PlaceOnSurface();
10156 }
10157 }
10158 }
10159 }
10160 }
10161
10163 {
10164 float split_quantity_new;
10168 InventoryLocation loc = new InventoryLocation;
10169
10170 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10171 {
10173 split_quantity_new = stack_max;
10174 else
10176
10178 {
10179 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10180 if (new_item)
10181 {
10182 new_item.SetResultOfSplit(true);
10183 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10185 new_item.
SetQuantity(split_quantity_new,
false,
true);
10186 }
10187 }
10188 }
10189 else if (destination_entity && slot_id == -1)
10190 {
10191 if (quantity > stack_max)
10192 split_quantity_new = stack_max;
10193 else
10194 split_quantity_new = quantity;
10195
10197 {
10199 {
10202 }
10203
10204 if (new_item)
10205 {
10206 new_item.SetResultOfSplit(true);
10207 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10209 new_item.
SetQuantity(split_quantity_new,
false,
true);
10210 }
10211 }
10212 }
10213 else
10214 {
10215 if (stack_max != 0)
10216 {
10218 {
10220 }
10221
10223 {
10225
10226 if (new_item)
10227 {
10228 new_item.SetResultOfSplit(true);
10229 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10232 new_item.PlaceOnSurface();
10233 }
10234 }
10235 }
10236 }
10237 }
10238
10240 {
10242 {
10243 if (ScriptInputUserData.CanStoreInputUserData())
10244 {
10245 ScriptInputUserData ctx = new ScriptInputUserData;
10250 dst.WriteToContext(ctx);
10252 }
10253 }
10254 else if (!
GetGame().IsMultiplayer())
10255 {
10257 }
10258 }
10259
10261 {
10263 {
10264 if (ScriptInputUserData.CanStoreInputUserData())
10265 {
10266 ScriptInputUserData ctx = new ScriptInputUserData;
10271 ctx.
Write(destination_entity);
10277 }
10278 }
10279 else if (!
GetGame().IsMultiplayer())
10280 {
10282 }
10283 }
10284
10286 {
10288 }
10289
10291 {
10293 float split_quantity_new;
10295 if (dst.IsValid())
10296 {
10297 int slot_id = dst.GetSlot();
10299
10300 if (quantity > stack_max)
10301 split_quantity_new = stack_max;
10302 else
10303 split_quantity_new = quantity;
10304
10306 {
10308
10309 if (new_item)
10310 {
10311 new_item.SetResultOfSplit(true);
10312 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10314 new_item.
SetQuantity(split_quantity_new,
false,
true);
10315 }
10316
10317 return new_item;
10318 }
10319 }
10320
10321 return null;
10322 }
10323
10325 {
10327 float split_quantity_new;
10329 if (destination_entity)
10330 {
10332 if (quantity > stackable)
10333 split_quantity_new = stackable;
10334 else
10335 split_quantity_new = quantity;
10336
10338 {
10339 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10340 if (new_item)
10341 {
10342 new_item.SetResultOfSplit(true);
10343 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10345 new_item.
SetQuantity(split_quantity_new,
false,
true);
10346 }
10347 }
10348 }
10349 }
10350
10352 {
10354 {
10355 if (ScriptInputUserData.CanStoreInputUserData())
10356 {
10357 ScriptInputUserData ctx = new ScriptInputUserData;
10362 ItemBase destination_entity =
this;
10363 ctx.
Write(destination_entity);
10367 }
10368 }
10369 else if (!
GetGame().IsMultiplayer())
10370 {
10372 }
10373 }
10374
10376 {
10378 float split_quantity_new;
10380 if (player)
10381 {
10383 if (quantity > stackable)
10384 split_quantity_new = stackable;
10385 else
10386 split_quantity_new = quantity;
10387
10389 {
10390 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10391 new_item =
ItemBase.Cast(in_hands);
10392 if (new_item)
10393 {
10394 new_item.SetResultOfSplit(true);
10395 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10397 new_item.SetQuantity(split_quantity_new, false, true);
10398 }
10399 }
10400 }
10401 }
10402
10404 {
10406 float split_quantity_new = Math.Floor(quantity * 0.5);
10407
10409 return;
10410
10412
10413 if (new_item)
10414 {
10415 if (new_item.GetQuantityMax() < split_quantity_new)
10416 {
10417 split_quantity_new = new_item.GetQuantityMax();
10418 }
10419
10420 new_item.SetResultOfSplit(true);
10421 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10422
10424 {
10427 }
10428 else
10429 {
10431 new_item.
SetQuantity(split_quantity_new,
false,
true);
10432 }
10433 }
10434 }
10435
10437 {
10439 float split_quantity_new = Math.Floor(quantity / 2);
10440
10442 return;
10443
10444 InventoryLocation invloc = new InventoryLocation;
10446
10448 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10449
10450 if (new_item)
10451 {
10452 if (new_item.GetQuantityMax() < split_quantity_new)
10453 {
10454 split_quantity_new = new_item.GetQuantityMax();
10455 }
10457 {
10460 }
10461 else if (split_quantity_new > 1)
10462 {
10464 new_item.
SetQuantity(split_quantity_new,
false,
true);
10465 }
10466 }
10467 }
10468
10471 {
10472 SetWeightDirty();
10474
10475 if (parent)
10476 parent.OnAttachmentQuantityChangedEx(this, delta);
10477
10479 {
10481 {
10483 }
10485 {
10486 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10488 }
10489 }
10490
10491 }
10492
10495 {
10496
10497 }
10498
10501 {
10503 }
10504
10506 {
10507 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10508
10510 {
10511 if (newLevel == GameConstants.STATE_RUINED)
10512 {
10514 EntityAI parent = GetHierarchyParent();
10515 if (parent && parent.IsFireplace())
10516 {
10517 CargoBase cargo = GetInventory().GetCargo();
10518 if (cargo)
10519 {
10521 {
10523 }
10524 }
10525 }
10526 }
10527
10529 {
10530
10532 return;
10533 }
10534
10535 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10536 {
10538 }
10539 }
10540 }
10541
10542
10544 {
10545 super.OnRightClick();
10546
10548 {
10550 {
10551 if (ScriptInputUserData.CanStoreInputUserData())
10552 {
10553 EntityAI root = GetHierarchyRoot();
10554 Man playerOwner = GetHierarchyRootPlayer();
10555 InventoryLocation dst = new InventoryLocation;
10556
10557
10558 if (!playerOwner && root && root == this)
10559 {
10561 }
10562 else
10563 {
10564
10565 GetInventory().GetCurrentInventoryLocation(dst);
10567 {
10570 {
10572 }
10573 else
10574 {
10576
10577
10578 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10579 {
10581 }
10582 else
10583 {
10584 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10585 }
10586 }
10587 }
10588 }
10589
10590 ScriptInputUserData ctx = new ScriptInputUserData;
10598 }
10599 }
10600 else if (!
GetGame().IsMultiplayer())
10601 {
10603 }
10604 }
10605 }
10606
10608 {
10609 if (root)
10610 {
10611 vector m4[4];
10612 root.GetTransform(m4);
10613 dst.SetGround(this, m4);
10614 }
10615 else
10616 {
10617 GetInventory().GetCurrentInventoryLocation(dst);
10618 }
10619 }
10620
10621 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10622 {
10623
10624 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10625 return false;
10626
10627 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10628 return false;
10629
10630
10632 return false;
10633
10634
10635 Magazine mag = Magazine.Cast(this);
10636 if (mag)
10637 {
10638 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10639 return false;
10640
10641 if (stack_max_limit)
10642 {
10643 Magazine other_mag = Magazine.Cast(other_item);
10644 if (other_item)
10645 {
10646 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10647 return false;
10648 }
10649
10650 }
10651 }
10652 else
10653 {
10654
10656 return false;
10657
10659 return false;
10660 }
10661
10662 PlayerBase player = null;
10663 if (CastTo(player, GetHierarchyRootPlayer()))
10664 {
10665 if (player.GetInventory().HasAttachment(this))
10666 return false;
10667
10668 if (player.IsItemsToDelete())
10669 return false;
10670 }
10671
10672 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10673 return false;
10674
10675 int slotID;
10677 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10678 return false;
10679
10680 return true;
10681 }
10682
10684 {
10686 }
10687
10689 {
10690 return m_IsResultOfSplit;
10691 }
10692
10694 {
10695 m_IsResultOfSplit = value;
10696 }
10697
10699 {
10701 }
10702
10704 {
10705 float other_item_quantity = other_item.GetQuantity();
10706 float this_free_space;
10707
10709
10711
10712 if (other_item_quantity > this_free_space)
10713 {
10714 return this_free_space;
10715 }
10716 else
10717 {
10718 return other_item_quantity;
10719 }
10720 }
10721
10723 {
10725 }
10726
10728 {
10730 return;
10731
10732 if (!IsMagazine() && other_item)
10733 {
10735 if (quantity_used != 0)
10736 {
10737 float hp1 = GetHealth01("","");
10738 float hp2 = other_item.GetHealth01("","");
10739 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10740 hpResult = hpResult / (
GetQuantity() + quantity_used);
10741
10742 hpResult *= GetMaxHealth();
10743 Math.Round(hpResult);
10744 SetHealth("", "Health", hpResult);
10745
10747 other_item.AddQuantity(-quantity_used);
10748 }
10749 }
10751 }
10752
10754 {
10755 #ifdef SERVER
10756 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10757 GetHierarchyParent().IncreaseLifetimeUp();
10758 #endif
10759 };
10760
10762 {
10763 PlayerBase p = PlayerBase.Cast(player);
10764
10765 array<int> recipesIds = p.m_Recipes;
10766 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10767 if (moduleRecipesManager)
10768 {
10769 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10770 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10771 }
10772
10773 for (int i = 0;i < recipesIds.Count(); i++)
10774 {
10775 int key = recipesIds.Get(i);
10776 string recipeName = moduleRecipesManager.GetRecipeName(key);
10778 }
10779 }
10780
10781
10782 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10783 {
10784 super.GetDebugActions(outputList);
10785
10786
10792
10793
10798
10803
10804
10808
10809
10811 {
10815 }
10816
10819
10820
10824
10826
10827 InventoryLocation loc = new InventoryLocation();
10828 GetInventory().GetCurrentInventoryLocation(loc);
10830 {
10831 if (Gizmo_IsSupported())
10834 }
10835
10837 }
10838
10839
10840
10841
10843 {
10844 super.OnAction(action_id, player, ctx);
10845
10847 {
10848 switch (action_id)
10849 {
10852 return true;
10855 return true;
10856 }
10857 }
10858
10860 {
10861 switch (action_id)
10862 {
10864 Delete();
10865 return true;
10866 }
10867 }
10868
10869 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10870 {
10871 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10872 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10873 PlayerBase p = PlayerBase.Cast(player);
10874 if (
EActions.RECIPES_RANGE_START < 1000)
10875 {
10876 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10877 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10878 }
10879 }
10880 #ifndef SERVER
10881 else if (action_id ==
EActions.WATCH_PLAYER)
10882 {
10883 PluginDeveloper.SetDeveloperItemClientEx(player);
10884 }
10885 #endif
10887 {
10888 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10889 {
10890 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10891 OnDebugButtonPressServer(id + 1);
10892 }
10893
10894 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10895 {
10896 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10898 }
10899
10900 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10901 {
10902 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10904 }
10905
10906 else if (action_id ==
EActions.ADD_QUANTITY)
10907 {
10908 if (IsMagazine())
10909 {
10910 Magazine mag = Magazine.Cast(this);
10911 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10912 }
10913 else
10914 {
10916 }
10917
10918 if (m_EM)
10919 {
10920 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10921 }
10922
10923 }
10924
10925 else if (action_id ==
EActions.REMOVE_QUANTITY)
10926 {
10927 if (IsMagazine())
10928 {
10929 Magazine mag2 = Magazine.Cast(this);
10930 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10931 }
10932 else
10933 {
10935 }
10936 if (m_EM)
10937 {
10938 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10939 }
10940
10941 }
10942
10943 else if (action_id ==
EActions.SET_QUANTITY_0)
10944 {
10946
10947 if (m_EM)
10948 {
10949 m_EM.SetEnergy(0);
10950 }
10951 }
10952
10953 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10954 {
10956
10957 if (m_EM)
10958 {
10959 m_EM.SetEnergy(m_EM.GetEnergyMax());
10960 }
10961 }
10962
10963 else if (action_id ==
EActions.ADD_HEALTH)
10964 {
10965 AddHealth("","",GetMaxHealth("","Health")/5);
10966 }
10967 else if (action_id ==
EActions.REMOVE_HEALTH)
10968 {
10969 AddHealth("","",-GetMaxHealth("","Health")/5);
10970 }
10971 else if (action_id ==
EActions.DESTROY_HEALTH)
10972 {
10973 SetHealth01("","",0);
10974 }
10975 else if (action_id ==
EActions.WATCH_ITEM)
10976 {
10978 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10979 #ifdef DEVELOPER
10980 SetDebugDeveloper_item(this);
10981 #endif
10982 }
10983
10984 else if (action_id ==
EActions.ADD_TEMPERATURE)
10985 {
10986 AddTemperature(20);
10987
10988 }
10989
10990 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10991 {
10992 AddTemperature(-20);
10993
10994 }
10995
10996 else if (action_id ==
EActions.FLIP_FROZEN)
10997 {
10998 SetFrozen(!GetIsFrozen());
10999
11000 }
11001
11002 else if (action_id ==
EActions.ADD_WETNESS)
11003 {
11005
11006 }
11007
11008 else if (action_id ==
EActions.REMOVE_WETNESS)
11009 {
11011
11012 }
11013
11014 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11015 {
11018
11019
11020 }
11021
11022 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11023 {
11026 }
11027
11028 else if (action_id ==
EActions.MAKE_SPECIAL)
11029 {
11030 auto debugParams = DebugSpawnParams.WithPlayer(player);
11031 OnDebugSpawnEx(debugParams);
11032 }
11033
11034 }
11035
11036
11037 return false;
11038 }
11039
11040
11041
11042
11046
11049
11050
11051
11053 {
11054 return false;
11055 }
11056
11057
11059 {
11060 return true;
11061 }
11062
11063
11065 {
11066 return true;
11067 }
11068
11069
11070
11072 {
11073 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11075 }
11076
11079 {
11080 return null;
11081 }
11082
11084 {
11085 return false;
11086 }
11087
11089 {
11090 return false;
11091 }
11092
11096
11097
11099 {
11100 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11101 return module_repairing.CanRepair(this, item_repair_kit);
11102 }
11103
11104
11105 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11106 {
11107 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11108 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11109 }
11110
11111
11113 {
11114
11115
11116
11117
11118
11119
11120
11121
11122 return 1;
11123 }
11124
11125
11126
11128 {
11130 }
11131
11132
11133
11135 {
11137 }
11138
11139
11148 {
11149 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11150
11151 if (player)
11152 {
11153 player.MessageStatus(text);
11154 }
11155 }
11156
11157
11166 {
11167 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11168
11169 if (player)
11170 {
11171 player.MessageAction(text);
11172 }
11173 }
11174
11175
11184 {
11185 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11186
11187 if (player)
11188 {
11189 player.MessageFriendly(text);
11190 }
11191 }
11192
11193
11202 {
11203 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11204
11205 if (player)
11206 {
11207 player.MessageImportant(text);
11208 }
11209 }
11210
11212 {
11213 return true;
11214 }
11215
11216
11217 override bool KindOf(
string tag)
11218 {
11219 bool found = false;
11220 string item_name = this.
GetType();
11223
11224 int array_size = item_tag_array.Count();
11225 for (int i = 0; i < array_size; i++)
11226 {
11227 if (item_tag_array.Get(i) == tag)
11228 {
11229 found = true;
11230 break;
11231 }
11232 }
11233 return found;
11234 }
11235
11236
11238 {
11239
11240 super.OnRPC(sender, rpc_type,ctx);
11241
11242
11243 switch (rpc_type)
11244 {
11245 #ifndef SERVER
11246 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11247 Param2<bool, string> p = new Param2<bool, string>(false, "");
11248
11250 return;
11251
11252 bool play = p.param1;
11253 string soundSet = p.param2;
11254
11255 if (play)
11256 {
11258 {
11260 {
11262 }
11263 }
11264 else
11265 {
11267 }
11268 }
11269 else
11270 {
11272 }
11273
11274 break;
11275 #endif
11276
11277 }
11278
11280 {
11282 }
11283 }
11284
11285
11286
11287
11289 {
11290 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11291 return plugin.GetID(
name);
11292 }
11293
11295 {
11296 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11297 return plugin.GetName(id);
11298 }
11299
11302 {
11303
11304
11305 int varFlags;
11306 if (!ctx.
Read(varFlags))
11307 return;
11308
11309 if (varFlags & ItemVariableFlags.FLOAT)
11310 {
11312 }
11313 }
11314
11316 {
11317
11318 super.SerializeNumericalVars(floats_out);
11319
11320
11321
11323 {
11325 }
11326
11328 {
11330 }
11331
11333 {
11335 }
11336
11338 {
11343 }
11344
11346 {
11348 }
11349 }
11350
11352 {
11353
11354 super.DeSerializeNumericalVars(floats);
11355
11356
11357 int index = 0;
11358 int mask = Math.Round(floats.Get(index));
11359
11360 index++;
11361
11363 {
11365 {
11367 }
11368 else
11369 {
11370 float quantity = floats.Get(index);
11371 SetQuantity(quantity,
true,
false,
false,
false);
11372 }
11373 index++;
11374 }
11375
11377 {
11378 float wet = floats.Get(index);
11380 index++;
11381 }
11382
11384 {
11385 int liquidtype = Math.Round(floats.Get(index));
11387 index++;
11388 }
11389
11391 {
11393 index++;
11395 index++;
11397 index++;
11399 index++;
11400 }
11401
11403 {
11404 int cleanness = Math.Round(floats.Get(index));
11406 index++;
11407 }
11408 }
11409
11411 {
11412 super.WriteVarsToCTX(ctx);
11413
11414
11416 {
11418 }
11419
11421 {
11423 }
11424
11426 {
11428 }
11429
11431 {
11432 int r,g,b,a;
11438 }
11439
11441 {
11443 }
11444 }
11445
11447 {
11448 if (!super.ReadVarsFromCTX(ctx,version))
11449 return false;
11450
11451 int intValue;
11452 float value;
11453
11454 if (version < 140)
11455 {
11456 if (!ctx.
Read(intValue))
11457 return false;
11458
11459 m_VariablesMask = intValue;
11460 }
11461
11463 {
11464 if (!ctx.
Read(value))
11465 return false;
11466
11468 {
11470 }
11471 else
11472 {
11474 }
11475 }
11476
11477 if (version < 140)
11478 {
11480 {
11481 if (!ctx.
Read(value))
11482 return false;
11483 SetTemperatureDirect(value);
11484 }
11485 }
11486
11488 {
11489 if (!ctx.
Read(value))
11490 return false;
11492 }
11493
11495 {
11496 if (!ctx.
Read(intValue))
11497 return false;
11499 }
11500
11502 {
11503 int r,g,b,a;
11505 return false;
11507 return false;
11509 return false;
11511 return false;
11512
11514 }
11515
11517 {
11518 if (!ctx.
Read(intValue))
11519 return false;
11521 }
11522
11523 if (version >= 138 && version < 140)
11524 {
11526 {
11527 if (!ctx.
Read(intValue))
11528 return false;
11529 SetFrozen(intValue);
11530 }
11531 }
11532
11533 return true;
11534 }
11535
11536
11538 {
11541 {
11543 }
11544
11545 if (!super.OnStoreLoad(ctx, version))
11546 {
11548 return false;
11549 }
11550
11551 if (version >= 114)
11552 {
11553 bool hasQuickBarIndexSaved;
11554
11555 if (!ctx.
Read(hasQuickBarIndexSaved))
11556 {
11558 return false;
11559 }
11560
11561 if (hasQuickBarIndexSaved)
11562 {
11563 int itmQBIndex;
11564
11565
11566 if (!ctx.
Read(itmQBIndex))
11567 {
11569 return false;
11570 }
11571
11572 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11573 if (itmQBIndex != -1 && parentPlayer)
11574 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11575 }
11576 }
11577 else
11578 {
11579
11580 PlayerBase player;
11581 int itemQBIndex;
11582 if (version ==
int.
MAX)
11583 {
11584 if (!ctx.
Read(itemQBIndex))
11585 {
11587 return false;
11588 }
11589 }
11590 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11591 {
11592
11593 if (!ctx.
Read(itemQBIndex))
11594 {
11596 return false;
11597 }
11598 if (itemQBIndex != -1 && player)
11599 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11600 }
11601 }
11602
11603 if (version < 140)
11604 {
11605
11606 if (!LoadVariables(ctx, version))
11607 {
11609 return false;
11610 }
11611 }
11612
11613
11615 {
11617 return false;
11618 }
11619 if (version >= 132)
11620 {
11622 if (raib)
11623 {
11625 {
11627 return false;
11628 }
11629 }
11630 }
11631
11633 return true;
11634 }
11635
11636
11637
11639 {
11640 super.OnStoreSave(ctx);
11641
11642 PlayerBase player;
11643 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11644 {
11646
11647 int itemQBIndex = -1;
11648 itemQBIndex = player.FindQuickBarEntityIndex(this);
11649 ctx.
Write(itemQBIndex);
11650 }
11651 else
11652 {
11654 }
11655
11657
11659 if (raib)
11660 {
11662 }
11663 }
11664
11665
11667 {
11668 super.AfterStoreLoad();
11669
11671 {
11673 }
11674
11676 {
11679 }
11680 }
11681
11683 {
11684 super.EEOnAfterLoad();
11685
11687 {
11689 }
11690
11693 }
11694
11696 {
11697 return false;
11698 }
11699
11700
11701
11703 {
11705 {
11706 #ifdef PLATFORM_CONSOLE
11707
11709 {
11711 if (menu)
11712 {
11714 }
11715 }
11716 #endif
11717 }
11718
11720 {
11723 }
11724
11726 {
11727 SetWeightDirty();
11729 }
11731 {
11734 }
11735
11737 {
11740 }
11742 {
11745 }
11746
11747 super.OnVariablesSynchronized();
11748 }
11749
11750
11751
11753 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11754 {
11755 if (!IsServerCheck(allow_client))
11756 return false;
11757
11759 return false;
11760
11763
11764 if (value <= (min + 0.001))
11765 value = min;
11766
11767 if (value == min)
11768 {
11769 if (destroy_config)
11770 {
11771 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11772 if (dstr)
11773 {
11775 this.Delete();
11776 return true;
11777 }
11778 }
11779 else if (destroy_forced)
11780 {
11782 this.Delete();
11783 return true;
11784 }
11785
11787 }
11788
11791
11793 {
11795
11796 if (delta)
11798 }
11799
11801
11802 return false;
11803 }
11804
11805
11807 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11808 {
11810 }
11811
11813 {
11816 }
11817
11819 {
11822 }
11823
11825 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11826 {
11827 float value_clamped = Math.Clamp(value, 0, 1);
11829 SetQuantity(result, destroy_config, destroy_forced);
11830 }
11831
11832
11835 {
11837 }
11838
11840 {
11842 }
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11854 {
11855 int slot = -1;
11856 if (GetInventory())
11857 {
11858 InventoryLocation il = new InventoryLocation;
11859 GetInventory().GetCurrentInventoryLocation(il);
11861 }
11862
11864 }
11865
11867 {
11868 float quantity_max = 0;
11869
11871 {
11872 if (attSlotID != -1)
11873 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11874
11875 if (quantity_max <= 0)
11877 }
11878
11879 if (quantity_max <= 0)
11881
11882 return quantity_max;
11883 }
11884
11886 {
11888 }
11889
11891 {
11893 }
11894
11895
11897 {
11899 }
11900
11902 {
11904 }
11905
11907 {
11909 }
11910
11911
11913 {
11914
11915 float weightEx = GetWeightEx();
11916 float special = GetInventoryAndCargoWeight();
11917 return weightEx - special;
11918 }
11919
11920
11922 {
11924 }
11925
11927 {
11929 {
11930 #ifdef DEVELOPER
11931 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11932 {
11933 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11935 }
11936 #endif
11937
11938 return GetQuantity() * GetConfigWeightModified();
11939 }
11940 else if (HasEnergyManager())
11941 {
11942 #ifdef DEVELOPER
11943 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11944 {
11945 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11946 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11947 }
11948 #endif
11949 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11950 }
11951 else
11952 {
11953 #ifdef DEVELOPER
11954 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11955 {
11956 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11957 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11958 }
11959 #endif
11960 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11961 }
11962 }
11963
11966 {
11967 int item_count = 0;
11969
11970 if (GetInventory().GetCargo() != NULL)
11971 {
11972 item_count = GetInventory().GetCargo().GetItemCount();
11973 }
11974
11975 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11976 {
11977 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11978 if (item)
11979 item_count += item.GetNumberOfItems();
11980 }
11981 return item_count;
11982 }
11983
11986 {
11987 float weight = 0;
11988 float wetness = 1;
11989 if (include_wetness)
11992 {
11993 weight = wetness * m_ConfigWeight;
11994 }
11996 {
11997 weight = 1;
11998 }
11999 return weight;
12000 }
12001
12002
12003
12005 {
12006 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12007 {
12008 GameInventory inv = GetInventory();
12009 array<EntityAI> items = new array<EntityAI>;
12011 for (int i = 0; i < items.Count(); i++)
12012 {
12014 if (item)
12015 {
12017 }
12018 }
12019 }
12020 }
12021
12022
12023
12024
12026 {
12027 float energy = 0;
12028 if (HasEnergyManager())
12029 {
12030 energy = GetCompEM().GetEnergy();
12031 }
12032 return energy;
12033 }
12034
12035
12037 {
12038 super.OnEnergyConsumed();
12039
12041 }
12042
12044 {
12045 super.OnEnergyAdded();
12046
12048 }
12049
12050
12052 {
12053 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12054 {
12056 {
12057 float energy_0to1 = GetCompEM().GetEnergy0To1();
12059 }
12060 }
12061 }
12062
12063
12065 {
12066 return ConfigGetFloat("heatIsolation");
12067 }
12068
12070 {
12072 }
12073
12075 {
12076 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12077 if (
GetGame().ConfigIsExisting(paramPath))
12079
12080 return 0.0;
12081 }
12082
12084 {
12085 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12086 if (
GetGame().ConfigIsExisting(paramPath))
12088
12089 return 0.0;
12090 }
12091
12092 override void SetWet(
float value,
bool allow_client =
false)
12093 {
12094 if (!IsServerCheck(allow_client))
12095 return;
12096
12099
12101
12102 m_VarWet = Math.Clamp(value, min, max);
12103
12105 {
12108 }
12109 }
12110
12111 override void AddWet(
float value)
12112 {
12114 }
12115
12117 {
12119 }
12120
12122 {
12124 }
12125
12127 {
12129 }
12130
12132 {
12134 }
12135
12137 {
12139 }
12140
12141 override void OnWetChanged(
float newVal,
float oldVal)
12142 {
12145 if (newLevel != oldLevel)
12146 {
12148 }
12149 }
12150
12152 {
12153 SetWeightDirty();
12154 }
12155
12157 {
12158 return GetWetLevelInternal(
m_VarWet);
12159 }
12160
12161
12162
12164 {
12166 }
12167
12169 {
12171 }
12172
12174 {
12176 }
12177
12179 {
12181 }
12182
12183
12184
12186 {
12187 if (ConfigIsExisting("itemModelLength"))
12188 {
12189 return ConfigGetFloat("itemModelLength");
12190 }
12191 return 0;
12192 }
12193
12195 {
12196 if (ConfigIsExisting("itemAttachOffset"))
12197 {
12198 return ConfigGetFloat("itemAttachOffset");
12199 }
12200 return 0;
12201 }
12202
12203 override void SetCleanness(
int value,
bool allow_client =
false)
12204 {
12205 if (!IsServerCheck(allow_client))
12206 return;
12207
12209
12211
12214 }
12215
12217 {
12219 }
12220
12222 {
12223 return true;
12224 }
12225
12226
12227
12228
12230 {
12232 }
12233
12235 {
12237 }
12238
12239
12240
12241
12242 override void SetColor(
int r,
int g,
int b,
int a)
12243 {
12249 }
12251 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12252 {
12257 }
12258
12260 {
12262 }
12263
12266 {
12267 int r,g,b,a;
12269 r = r/255;
12270 g = g/255;
12271 b = b/255;
12272 a = a/255;
12273 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12274 }
12275
12276
12277
12278 override void SetLiquidType(
int value,
bool allow_client =
false)
12279 {
12280 if (!IsServerCheck(allow_client))
12281 return;
12282
12287 }
12288
12290 {
12291 return ConfigGetInt("varLiquidTypeInit");
12292 }
12293
12295 {
12297 }
12298
12300 {
12302 SetFrozen(false);
12303 }
12304
12307 {
12308 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12309 }
12310
12311
12314 {
12315 PlayerBase nplayer;
12316 if (PlayerBase.CastTo(nplayer, player))
12317 {
12319
12320 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12321 }
12322 }
12323
12324
12327 {
12328 PlayerBase nplayer;
12329 if (PlayerBase.CastTo(nplayer,player))
12330 {
12331
12332 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12333
12334 }
12335
12336
12337 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12338
12339
12340 if (HasEnergyManager())
12341 {
12342 GetCompEM().UpdatePlugState();
12343 }
12344 }
12345
12346
12348 {
12349 super.OnPlacementStarted(player);
12350
12352 }
12353
12354 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12355 {
12357 {
12358 m_AdminLog.OnPlacementComplete(player,
this);
12359 }
12360
12361 super.OnPlacementComplete(player, position, orientation);
12362 }
12363
12364
12365
12366
12367
12369 {
12371 {
12372 return true;
12373 }
12374 else
12375 {
12376 return false;
12377 }
12378 }
12379
12380
12382 {
12384 {
12386 }
12387 }
12388
12389
12391 {
12393 }
12394
12396 {
12398 }
12399
12400 override void InsertAgent(
int agent,
float count = 1)
12401 {
12402 if (count < 1)
12403 return;
12404
12406 }
12407
12410 {
12412 }
12413
12414
12416 {
12418 }
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12462 {
12464 return false;
12465 return true;
12466 }
12467
12469 {
12470
12472 }
12473
12474
12477 {
12478 super.CheckForRoofLimited(timeTresholdMS);
12479
12481 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12482 {
12483 m_PreviousRoofTestTime = time;
12484 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12485 }
12486 }
12487
12488
12490 {
12492 {
12493 return 0;
12494 }
12495
12496 if (GetInventory().GetAttachmentSlotsCount() != 0)
12497 {
12498 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12499 if (filter)
12500 return filter.GetProtectionLevel(type, false, system);
12501 else
12502 return 0;
12503 }
12504
12505 string subclassPath, entryName;
12506
12507 switch (type)
12508 {
12510 entryName = "biological";
12511 break;
12513 entryName = "chemical";
12514 break;
12515 default:
12516 entryName = "biological";
12517 break;
12518 }
12519
12520 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12521
12523 }
12524
12525
12526
12529 {
12530 if (!IsMagazine())
12532
12534 }
12535
12536
12537
12538
12539
12544 {
12545 return true;
12546 }
12547
12549 {
12551 }
12552
12553
12554
12555
12556
12558 {
12559 if (parent)
12560 {
12561 if (parent.IsInherited(DayZInfected))
12562 return true;
12563
12564 if (!parent.IsRuined())
12565 return true;
12566 }
12567
12568 return true;
12569 }
12570
12572 {
12573 if (!super.CanPutAsAttachment(parent))
12574 {
12575 return false;
12576 }
12577
12578 if (!IsRuined() && !parent.IsRuined())
12579 {
12580 return true;
12581 }
12582
12583 return false;
12584 }
12585
12587 {
12588
12589
12590
12591
12592 return super.CanReceiveItemIntoCargo(item);
12593 }
12594
12596 {
12597
12598
12599
12600
12601 GameInventory attachmentInv = attachment.GetInventory();
12603 {
12604 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12605 return false;
12606 }
12607
12608 InventoryLocation loc = new InventoryLocation();
12609 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12610 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12611 return false;
12612
12613 return super.CanReceiveAttachment(attachment, slotId);
12614 }
12615
12617 {
12618 if (!super.CanReleaseAttachment(attachment))
12619 return false;
12620
12621 return GetInventory().AreChildrenAccessible();
12622 }
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12645 {
12646 int id = muzzle_owner.GetMuzzleID();
12647 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12648
12649 if (WPOF_array)
12650 {
12651 for (int i = 0; i < WPOF_array.Count(); i++)
12652 {
12653 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12654
12655 if (WPOF)
12656 {
12657 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12658 }
12659 }
12660 }
12661 }
12662
12663
12665 {
12666 int id = muzzle_owner.GetMuzzleID();
12668
12669 if (WPOBE_array)
12670 {
12671 for (int i = 0; i < WPOBE_array.Count(); i++)
12672 {
12673 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12674
12675 if (WPOBE)
12676 {
12677 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12678 }
12679 }
12680 }
12681 }
12682
12683
12685 {
12686 int id = muzzle_owner.GetMuzzleID();
12687 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12688
12689 if (WPOOH_array)
12690 {
12691 for (int i = 0; i < WPOOH_array.Count(); i++)
12692 {
12693 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12694
12695 if (WPOOH)
12696 {
12697 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12698 }
12699 }
12700 }
12701 }
12702
12703
12705 {
12706 int id = muzzle_owner.GetMuzzleID();
12707 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12708
12709 if (WPOOH_array)
12710 {
12711 for (int i = 0; i < WPOOH_array.Count(); i++)
12712 {
12713 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12714
12715 if (WPOOH)
12716 {
12717 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12718 }
12719 }
12720 }
12721 }
12722
12723
12725 {
12726 int id = muzzle_owner.GetMuzzleID();
12727 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12728
12729 if (WPOOH_array)
12730 {
12731 for (int i = 0; i < WPOOH_array.Count(); i++)
12732 {
12733 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12734
12735 if (WPOOH)
12736 {
12737 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12738 }
12739 }
12740 }
12741 }
12742
12743
12744
12746 {
12748 {
12749 return true;
12750 }
12751
12752 return false;
12753 }
12754
12756 {
12758 {
12759 return true;
12760 }
12761
12762 return false;
12763 }
12764
12766 {
12768 {
12769 return true;
12770 }
12771
12772 return false;
12773 }
12774
12776 {
12777 return false;
12778 }
12779
12782 {
12783 return UATimeSpent.DEFAULT_DEPLOY;
12784 }
12785
12786
12787
12788
12790 {
12792 SetSynchDirty();
12793 }
12794
12796 {
12798 }
12799
12800
12802 {
12803 return false;
12804 }
12805
12808 {
12809 string att_type = "None";
12810
12811 if (ConfigIsExisting("soundAttType"))
12812 {
12813 att_type = ConfigGetString("soundAttType");
12814 }
12815
12817 }
12818
12820 {
12822 }
12823
12824
12825
12826
12827
12833
12835 {
12838
12840 }
12841
12842
12844 {
12846 return;
12847
12849
12852
12855
12856 SoundParameters params = new SoundParameters();
12860 }
12861
12862
12864 {
12866 return;
12867
12869 SetSynchDirty();
12870
12873 }
12874
12875
12877 {
12879 return;
12880
12882 SetSynchDirty();
12883
12886 }
12887
12889 {
12891 }
12892
12894 {
12896 }
12897
12900 {
12901 if (!
GetGame().IsDedicatedServer())
12902 {
12903 if (ConfigIsExisting("attachSoundSet"))
12904 {
12905 string cfg_path = "";
12906 string soundset = "";
12907 string type_name =
GetType();
12908
12911 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12912 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12913
12914 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12915 {
12916 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12917 {
12918 if (cfg_slot_array[i] == slot_type)
12919 {
12920 soundset = cfg_soundset_array[i];
12921 break;
12922 }
12923 }
12924 }
12925
12926 if (soundset != "")
12927 {
12928 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12930 }
12931 }
12932 }
12933 }
12934
12936 {
12937
12938 }
12939
12940 void OnApply(PlayerBase player);
12941
12943 {
12944 return 1.0;
12945 };
12946
12948 {
12950 }
12951
12953 {
12955 }
12956
12958
12960 {
12961 SetDynamicPhysicsLifeTime(0.01);
12963 }
12964
12966 {
12967 array<string> zone_names = new array<string>;
12968 GetDamageZones(zone_names);
12969 for (int i = 0; i < zone_names.Count(); i++)
12970 {
12971 SetHealthMax(zone_names.Get(i),"Health");
12972 }
12973 SetHealthMax("","Health");
12974 }
12975
12978 {
12979 float global_health = GetHealth01("","Health");
12980 array<string> zones = new array<string>;
12981 GetDamageZones(zones);
12982
12983 for (int i = 0; i < zones.Count(); i++)
12984 {
12985 SetHealth01(zones.Get(i),"Health",global_health);
12986 }
12987 }
12988
12991 {
12992 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12993 }
12994
12996 {
12997 if (!hasRootAsPlayer)
12998 {
12999 if (refParentIB)
13000 {
13001
13002 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13003 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13004
13005 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13006 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13007
13010 }
13011 else
13012 {
13013
13016 }
13017 }
13018 }
13019
13021 {
13023 {
13024 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13025 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13026 {
13027 float heatPermCoef = 1.0;
13029 while (ent)
13030 {
13031 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13032 ent = ent.GetHierarchyParent();
13033 }
13034
13035 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13036 }
13037 }
13038 }
13039
13041 {
13042
13043 EntityAI parent = GetHierarchyParent();
13044 if (!parent)
13045 {
13046 hasParent = false;
13047 hasRootAsPlayer = false;
13048 }
13049 else
13050 {
13051 hasParent = true;
13052 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13053 refParentIB =
ItemBase.Cast(parent);
13054 }
13055 }
13056
13057 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13058 {
13059
13060 }
13061
13063 {
13064
13065 return false;
13066 }
13067
13069 {
13070
13071
13072 return false;
13073 }
13074
13076 {
13077
13078 return false;
13079 }
13080
13083 {
13084 return !GetIsFrozen() &&
IsOpen();
13085 }
13086
13088 {
13089 bool hasParent = false, hasRootAsPlayer = false;
13091
13092 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13093 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13094
13095 if (wwtu || foodDecay)
13096 {
13100
13101 if (processWetness || processTemperature || processDecay)
13102 {
13104
13105 if (processWetness)
13106 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13107
13108 if (processTemperature)
13110
13111 if (processDecay)
13112 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13113 }
13114 }
13115 }
13116
13119 {
13121 }
13122
13124 {
13127
13128 return super.GetTemperatureFreezeThreshold();
13129 }
13130
13132 {
13135
13136 return super.GetTemperatureThawThreshold();
13137 }
13138
13140 {
13143
13144 return super.GetItemOverheatThreshold();
13145 }
13146
13148 {
13150 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13151
13152 return super.GetTemperatureFreezeTime();
13153 }
13154
13156 {
13158 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13159
13160 return super.GetTemperatureThawTime();
13161 }
13162
13167
13169 {
13170 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13171 }
13172
13174 {
13175 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13176 }
13177
13180 {
13182 }
13183
13185 {
13187 }
13188
13190 {
13192 }
13193
13196 {
13197 return null;
13198 }
13199
13202 {
13203 return false;
13204 }
13205
13207 {
13209 {
13212 if (!trg)
13213 {
13215 explosive = this;
13216 }
13217
13218 explosive.PairRemote(trg);
13220
13221 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13222 trg.SetPersistentPairID(persistentID);
13223 explosive.SetPersistentPairID(persistentID);
13224
13225 return true;
13226 }
13227 return false;
13228 }
13229
13232 {
13233 float ret = 1.0;
13236 ret *= GetHealth01();
13237
13238 return ret;
13239 }
13240
13241 #ifdef DEVELOPER
13242 override void SetDebugItem()
13243 {
13244 super.SetDebugItem();
13245 _itemBase = this;
13246 }
13247
13249 {
13250 string text = super.GetDebugText();
13251
13253 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13254
13255 return text;
13256 }
13257 #endif
13258
13260 {
13261 return true;
13262 }
13263
13265
13267
13269 {
13272 }
13273
13274
13282
13298}
13299
13301{
13303 if (entity)
13304 {
13305 bool is_item = entity.IsInherited(
ItemBase);
13306 if (is_item && full_quantity)
13307 {
13310 }
13311 }
13312 else
13313 {
13315 return NULL;
13316 }
13317 return entity;
13318}
13319
13321{
13322 if (item)
13323 {
13324 if (health > 0)
13325 item.SetHealth("", "", health);
13326
13327 if (item.CanHaveTemperature())
13328 {
13330 if (item.CanFreeze())
13331 item.SetFrozen(false);
13332 }
13333
13334 if (item.HasEnergyManager())
13335 {
13336 if (quantity >= 0)
13337 {
13338 item.GetCompEM().SetEnergy0To1(quantity);
13339 }
13340 else
13341 {
13343 }
13344 }
13345 else if (item.IsMagazine())
13346 {
13347 Magazine mag = Magazine.Cast(item);
13348 if (quantity >= 0)
13349 {
13350 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13351 }
13352 else
13353 {
13355 }
13356
13357 }
13358 else
13359 {
13360 if (quantity >= 0)
13361 {
13362 item.SetQuantityNormalized(quantity, false);
13363 }
13364 else
13365 {
13367 }
13368
13369 }
13370 }
13371}
13372
13373#ifdef DEVELOPER
13375#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.