8473{
8475 {
8476 return true;
8477 }
8478};
8479
8480
8481
8483{
8487
8489
8492
8493
8494
8495
8496
8505
8511
8516
8521
8542 protected bool m_IsResultOfSplit
8543
8545
8550
8551
8552
8554
8558
8559
8560
8562
8565
8566
8567
8573
8574
8582
8585
8586
8588
8589
8591
8592
8597
8598
8603
8604
8606
8607
8609 {
8614
8615 if (!
GetGame().IsDedicatedServer())
8616 {
8618 {
8620
8622 {
8624 }
8625 }
8626
8629 }
8630
8631 m_OldLocation = null;
8632
8634 {
8636 }
8637
8638 if (ConfigIsExisting("headSelectionsToHide"))
8639 {
8642 }
8643
8645 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8646 {
8648 }
8649
8651
8652 m_IsResultOfSplit = false;
8653
8655 }
8656
8658 {
8659 super.InitItemVariables();
8660
8666 m_Count = ConfigGetInt(
"count");
8667
8670
8675
8678
8683
8695
8699
8700
8703 if (ConfigIsExisting("canBeSplit"))
8704 {
8707 }
8708
8710 if (ConfigIsExisting("itemBehaviour"))
8712
8713
8716 RegisterNetSyncVariableInt("m_VarLiquidType");
8717 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8718
8719 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8720 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8721 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8722
8723 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8724 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8725 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8726 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8727
8728 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8729 RegisterNetSyncVariableBool("m_IsTakeable");
8730 RegisterNetSyncVariableBool("m_IsHologram");
8731
8734 {
8737 }
8738
8740
8742 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8744
8745 }
8746
8748 {
8750 }
8751
8753 {
8756 {
8761 }
8762 }
8763
8764 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8765 {
8767 {
8770 }
8771
8773 }
8774
8776 {
8782 }
8783
8785
8787 {
8789
8790 if (!action)
8791 {
8792 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8793 return;
8794 }
8795
8797 if (!ai)
8798 {
8800 return;
8801 }
8802
8804 if (!action_array)
8805 {
8806 action_array = new array<ActionBase_Basic>;
8808 }
8809 if (LogManager.IsActionLogEnable())
8810 {
8811 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8812 }
8813
8814 if (action_array.Find(action) != -1)
8815 {
8816 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8817 }
8818 else
8819 {
8820 action_array.Insert(action);
8821 }
8822 }
8823
8825 {
8827 ActionBase action = player.GetActionManager().GetAction(actionName);
8830
8831 if (action_array)
8832 {
8833 action_array.RemoveItem(action);
8834 }
8835 }
8836
8837
8838
8840 {
8841 ActionOverrideData overrideData = new ActionOverrideData();
8845
8847 if (!actionMap)
8848 {
8851 }
8852
8853 actionMap.Insert(this.
Type(), overrideData);
8854
8855 }
8856
8858
8860
8861
8863 {
8866
8869
8870 string config_to_search = "CfgVehicles";
8871 string muzzle_owner_config;
8872
8874 {
8875 if (IsInherited(Weapon))
8876 config_to_search = "CfgWeapons";
8877
8878 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8879
8880 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8881
8883
8884 if (config_OnFire_subclass_count > 0)
8885 {
8886 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8887
8888 for (int i = 0; i < config_OnFire_subclass_count; i++)
8889 {
8890 string particle_class = "";
8892 string config_OnFire_entry = config_OnFire_class + particle_class;
8893 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8894 WPOF_array.Insert(WPOF);
8895 }
8896
8897
8899 }
8900 }
8901
8903 {
8904 config_to_search = "CfgWeapons";
8905 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8906
8907 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8908
8910
8911 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8912 {
8913 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8914
8915 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8916 {
8917 string particle_class2 = "";
8919 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8920 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8921 WPOBE_array.Insert(WPOBE);
8922 }
8923
8924
8926 }
8927 }
8928 }
8929
8930
8932 {
8935
8937 {
8938 string config_to_search = "CfgVehicles";
8939
8940 if (IsInherited(Weapon))
8941 config_to_search = "CfgWeapons";
8942
8943 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8944 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8945
8946 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8947 {
8948
8950
8952 {
8954 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8956 return;
8957 }
8958
8961
8962
8963
8965 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8966
8967 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8968 {
8969 string particle_class = "";
8971 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8973
8974 if (entry_type == CT_CLASS)
8975 {
8976 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8977 WPOOH_array.Insert(WPOF);
8978 }
8979 }
8980
8981
8983 }
8984 }
8985 }
8986
8988 {
8990 }
8991
8993 {
8995 {
8997
9000
9003
9004 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9005 }
9006 }
9007
9009 {
9011 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9012
9014 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9015
9017 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9018
9020 {
9022 }
9023 }
9024
9026 {
9028 }
9029
9031 {
9034 else
9036
9038 {
9041 }
9042 else
9043 {
9046
9049 }
9050
9052 }
9053
9055 {
9057 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9058 }
9059
9061 {
9063 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9065 }
9066
9068 {
9070 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9071 }
9072
9074 {
9077
9078 OverheatingParticle OP = new OverheatingParticle();
9083
9085 }
9086
9088 {
9091
9092 return -1;
9093 }
9094
9096 {
9098 {
9101
9102 for (int i = count; i > 0; --i)
9103 {
9104 int id = i - 1;
9107
9110
9111 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9112 {
9113 if (p)
9114 {
9117 }
9118 }
9119 }
9120 }
9121 }
9122
9124 {
9126 {
9128 {
9129 int id = i - 1;
9131
9132 if (OP)
9133 {
9135
9136 if (p)
9137 {
9139 }
9140
9141 delete OP;
9142 }
9143 }
9144
9147 }
9148 }
9149
9152 {
9153 return 0.0;
9154 }
9155
9156
9158 {
9159 return 250;
9160 }
9161
9163 {
9164 return 0;
9165 }
9166
9169 {
9171 return true;
9172
9173 return false;
9174 }
9175
9178 {
9181
9183 {
9185 }
9186 else
9187 {
9188
9190 }
9191
9193 }
9194
9201 {
9202 return -1;
9203 }
9204
9205
9206
9207
9209 {
9211 {
9213 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9214
9215 if (r_index >= 0)
9216 {
9217 InventoryLocation r_il = new InventoryLocation;
9218 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9219
9220 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9223 {
9224 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9225 }
9227 {
9228 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9229 }
9230
9231 }
9232
9233 player.GetHumanInventory().ClearUserReservedLocation(this);
9234 }
9235
9238 }
9239
9240
9241
9242
9244 {
9245 return ItemBase.m_DebugActionsMask;
9246 }
9247
9249 {
9250 return ItemBase.m_DebugActionsMask & mask;
9251 }
9252
9254 {
9255 ItemBase.m_DebugActionsMask = mask;
9256 }
9257
9259 {
9260 ItemBase.m_DebugActionsMask |= mask;
9261 }
9262
9264 {
9265 ItemBase.m_DebugActionsMask &= ~mask;
9266 }
9267
9269 {
9271 {
9273 }
9274 else
9275 {
9277 }
9278 }
9279
9280
9282 {
9283 if (GetEconomyProfile())
9284 {
9285 float q_max = GetEconomyProfile().GetQuantityMax();
9286 if (q_max > 0)
9287 {
9288 float q_min = GetEconomyProfile().GetQuantityMin();
9289 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9290
9292 {
9293 ComponentEnergyManager comp = GetCompEM();
9295 {
9297 }
9298 }
9300 {
9302
9303 }
9304
9305 }
9306 }
9307 }
9308
9311 {
9312 EntityAI parent = GetHierarchyParent();
9313
9314 if (parent)
9315 {
9316 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9317 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9318 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9319 }
9320 }
9321
9324 {
9325 EntityAI parent = GetHierarchyParent();
9326
9327 if (parent)
9328 {
9329 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9330 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9331 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9332 }
9333 }
9334
9336 {
9337
9338
9339
9340
9342
9344 {
9345 if (ScriptInputUserData.CanStoreInputUserData())
9346 {
9347 ScriptInputUserData ctx = new ScriptInputUserData;
9353 ctx.
Write(use_stack_max);
9356
9358 {
9359 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9360 }
9361 }
9362 }
9363 else if (!
GetGame().IsMultiplayer())
9364 {
9366 }
9367 }
9368
9370 {
9372 }
9373
9375 {
9377 }
9378
9380 {
9382 }
9383
9385 {
9386
9387 return false;
9388 }
9389
9391 {
9392 return false;
9393 }
9394
9398 {
9399 return false;
9400 }
9401
9403 {
9404 return "";
9405 }
9406
9408
9410 {
9411 return false;
9412 }
9413
9415 {
9416 return true;
9417 }
9418
9419
9420
9422 {
9423 return true;
9424 }
9425
9427 {
9428 return true;
9429 }
9430
9432 {
9433 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9435 }
9436
9438 {
9440 }
9441
9443 {
9445 if (!is_being_placed)
9447 SetSynchDirty();
9448 }
9449
9450
9452
9454 {
9456 }
9457
9459 {
9461 }
9462
9464 {
9465 return 1;
9466 }
9467
9469 {
9470 return false;
9471 }
9472
9474 {
9476 SetSynchDirty();
9477 }
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9514 {
9515 super.OnMovedInsideCargo(container);
9516
9517 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9518 }
9519
9520 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9521 {
9522 super.EEItemLocationChanged(oldLoc,newLoc);
9523
9524 PlayerBase new_player = null;
9525 PlayerBase old_player = null;
9526
9527 if (newLoc.GetParent())
9528 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9529
9530 if (oldLoc.GetParent())
9531 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9532
9534 {
9535 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9536
9537 if (r_index >= 0)
9538 {
9539 InventoryLocation r_il = new InventoryLocation;
9540 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9541
9542 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9545 {
9546 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9547 }
9549 {
9550 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9551 }
9552
9553 }
9554 }
9555
9557 {
9558 if (new_player)
9559 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9560
9561 if (new_player == old_player)
9562 {
9563
9564 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9565 {
9567 {
9568 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9569 {
9570 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9571 }
9572 }
9573 else
9574 {
9575 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9576 }
9577 }
9578
9579 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9580 {
9581 int type = oldLoc.GetType();
9583 {
9584 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9585 }
9587 {
9588 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9589 }
9590 }
9591 if (!m_OldLocation)
9592 {
9593 m_OldLocation = new InventoryLocation;
9594 }
9595 m_OldLocation.Copy(oldLoc);
9596 }
9597 else
9598 {
9599 if (m_OldLocation)
9600 {
9601 m_OldLocation.Reset();
9602 }
9603 }
9604
9606 }
9607 else
9608 {
9609 if (new_player)
9610 {
9611 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9612 if (res_index >= 0)
9613 {
9614 InventoryLocation il = new InventoryLocation;
9615 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9617 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9620 {
9621 il.
GetParent().GetOnReleaseLock().Invoke(it);
9622 }
9624 {
9626 }
9627
9628 }
9629 }
9631 {
9632
9634 }
9635
9636 if (m_OldLocation)
9637 {
9638 m_OldLocation.Reset();
9639 }
9640 }
9641 }
9642
9643 override void EOnContact(IEntity other, Contact extra)
9644 {
9646 {
9647 int liquidType = -1;
9649 if (impactSpeed > 0.0)
9650 {
9652 #ifndef SERVER
9654 #else
9656 SetSynchDirty();
9657 #endif
9659 }
9660 }
9661
9662 #ifdef SERVER
9663 if (GetCompEM() && GetCompEM().IsPlugged())
9664 {
9665 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9666 GetCompEM().UnplugThis();
9667 }
9668 #endif
9669 }
9670
9672
9674 {
9676 }
9677
9679 {
9680
9681 }
9682
9684 {
9685 super.OnItemLocationChanged(old_owner, new_owner);
9686
9687 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9688 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9689
9690 if (!relatedPlayer && playerNew)
9691 relatedPlayer = playerNew;
9692
9693 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9694 {
9696 if (actionMgr)
9697 {
9698 ActionBase currentAction = actionMgr.GetRunningAction();
9699 if (currentAction)
9701 }
9702 }
9703
9704 Man ownerPlayerOld = null;
9705 Man ownerPlayerNew = null;
9706
9707 if (old_owner)
9708 {
9709 if (old_owner.
IsMan())
9710 {
9711 ownerPlayerOld = Man.Cast(old_owner);
9712 }
9713 else
9714 {
9715 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9716 }
9717 }
9718 else
9719 {
9721 {
9723
9724 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9725 {
9726 GetCompEM().UnplugThis();
9727 }
9728 }
9729 }
9730
9731 if (new_owner)
9732 {
9733 if (new_owner.
IsMan())
9734 {
9735 ownerPlayerNew = Man.Cast(new_owner);
9736 }
9737 else
9738 {
9739 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9740 }
9741 }
9742
9743 if (ownerPlayerOld != ownerPlayerNew)
9744 {
9745 if (ownerPlayerOld)
9746 {
9747 array<EntityAI> subItemsExit = new array<EntityAI>;
9749 for (int i = 0; i < subItemsExit.Count(); i++)
9750 {
9753 }
9754 }
9755
9756 if (ownerPlayerNew)
9757 {
9758 array<EntityAI> subItemsEnter = new array<EntityAI>;
9760 for (int j = 0; j < subItemsEnter.Count(); j++)
9761 {
9764 }
9765 }
9766 }
9767 else if (ownerPlayerNew != null)
9768 {
9769 PlayerBase nplayer;
9770 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9771 {
9772 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9774 for (int k = 0; k < subItemsUpdate.Count(); k++)
9775 {
9777 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9778 }
9779 }
9780 }
9781
9782 if (old_owner)
9783 old_owner.OnChildItemRemoved(this);
9784 if (new_owner)
9785 new_owner.OnChildItemReceived(this);
9786 }
9787
9788
9790 {
9791 super.EEDelete(parent);
9792 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9793 if (player)
9794 {
9796
9797 if (player.IsAlive())
9798 {
9799 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9800 if (r_index >= 0)
9801 {
9802 InventoryLocation r_il = new InventoryLocation;
9803 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9804
9805 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9808 {
9809 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9810 }
9812 {
9813 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9814 }
9815
9816 }
9817
9818 player.RemoveQuickBarEntityShortcut(this);
9819 }
9820 }
9821 }
9822
9824 {
9825 super.EEKilled(killer);
9826
9829 {
9830 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9831 {
9832 if (IsMagazine())
9833 {
9834 if (Magazine.Cast(this).GetAmmoCount() > 0)
9835 {
9837 }
9838 }
9839 else
9840 {
9842 }
9843 }
9844 }
9845 }
9846
9848 {
9849 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9850
9851 super.OnWasAttached(parent, slot_id);
9852
9855
9857 }
9858
9860 {
9861 super.OnWasDetached(parent, slot_id);
9862
9865 }
9866
9868 {
9869 int idx;
9872
9873 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9874 if (inventory_slots.Count() < 1)
9875 {
9876 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9877 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9878 }
9879 else
9880 {
9881 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9882 }
9883
9884 idx = inventory_slots.Find(slot);
9885 if (idx < 0)
9886 return "";
9887
9888 return attach_types.Get(idx);
9889 }
9890
9892 {
9893 int idx = -1;
9894 string slot;
9895
9898
9899 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9900 if (inventory_slots.Count() < 1)
9901 {
9902 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9903 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9904 }
9905 else
9906 {
9907 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9908 if (detach_types.Count() < 1)
9909 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9910 }
9911
9912 for (int i = 0; i < inventory_slots.Count(); i++)
9913 {
9914 slot = inventory_slots.Get(i);
9915 }
9916
9917 if (slot != "")
9918 {
9919 if (detach_types.Count() == 1)
9920 idx = 0;
9921 else
9922 idx = inventory_slots.Find(slot);
9923 }
9924 if (idx < 0)
9925 return "";
9926
9927 return detach_types.Get(idx);
9928 }
9929
9931 {
9932
9934
9935
9936 float min_time = 1;
9937 float max_time = 3;
9938 float delay = Math.RandomFloat(min_time, max_time);
9939
9940 explode_timer.Run(delay, this, "DoAmmoExplosion");
9941 }
9942
9944 {
9945 Magazine magazine = Magazine.Cast(this);
9946 int pop_sounds_count = 6;
9947 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9948
9949
9950 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9951 string sound_name = pop_sounds[ sound_idx ];
9953
9954
9955 magazine.ServerAddAmmoCount(-1);
9956
9957
9958 float min_temp_to_explode = 100;
9959
9960 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9961 {
9963 }
9964 }
9965
9966
9967 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9968 {
9969 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9970
9971 const int CHANCE_DAMAGE_CARGO = 4;
9972 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9973 const int CHANCE_DAMAGE_NOTHING = 2;
9974
9976 {
9977 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9978 int chances;
9979 int rnd;
9980
9981 if (GetInventory().GetCargo())
9982 {
9983 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9984 rnd = Math.RandomInt(0,chances);
9985
9986 if (rnd < CHANCE_DAMAGE_CARGO)
9987 {
9989 }
9990 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9991 {
9993 }
9994 }
9995 else
9996 {
9997 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9998 rnd = Math.RandomInt(0,chances);
9999
10000 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10001 {
10003 }
10004 }
10005 }
10006 }
10007
10009 {
10010 if (GetInventory().GetCargo())
10011 {
10012 int item_count = GetInventory().GetCargo().GetItemCount();
10013 if (item_count > 0)
10014 {
10015 int random_pick = Math.RandomInt(0, item_count);
10017 if (!item.IsExplosive())
10018 {
10019 item.AddHealth("","",damage);
10020 return true;
10021 }
10022 }
10023 }
10024 return false;
10025 }
10026
10028 {
10029 int attachment_count = GetInventory().AttachmentCount();
10030 if (attachment_count > 0)
10031 {
10032 int random_pick = Math.RandomInt(0, attachment_count);
10033 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10034 if (!attachment.IsExplosive())
10035 {
10036 attachment.AddHealth("","",damage);
10037 return true;
10038 }
10039 }
10040 return false;
10041 }
10042
10044 {
10046 }
10047
10049 {
10051 return GetInventory().CanRemoveEntity();
10052
10053 return false;
10054 }
10055
10057 {
10059 return;
10060
10062 {
10063 if (ScriptInputUserData.CanStoreInputUserData())
10064 {
10065 ScriptInputUserData ctx = new ScriptInputUserData;
10070 ctx.
Write(destination_entity);
10072 ctx.
Write(slot_id);
10074 }
10075 }
10076 else if (!
GetGame().IsMultiplayer())
10077 {
10079 }
10080 }
10081
10083 {
10085 return;
10086
10087 float split_quantity_new;
10091 InventoryLocation loc = new InventoryLocation;
10092
10093 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10094 {
10096 split_quantity_new = stack_max;
10097 else
10099
10100 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10101 if (new_item)
10102 {
10103 new_item.SetResultOfSplit(true);
10104 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10106 new_item.SetQuantity(split_quantity_new);
10107 }
10108 }
10109 else if (destination_entity && slot_id == -1)
10110 {
10111 if (quantity > stack_max)
10112 split_quantity_new = stack_max;
10113 else
10114 split_quantity_new = quantity;
10115
10117 {
10120 }
10121
10122 if (new_item)
10123 {
10124 new_item.SetResultOfSplit(true);
10125 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10127 new_item.SetQuantity(split_quantity_new);
10128 }
10129 }
10130 else
10131 {
10132 if (stack_max != 0)
10133 {
10135 {
10137 }
10138
10139 if (split_quantity_new == 0)
10140 {
10141 if (!
GetGame().IsMultiplayer())
10142 player.PhysicalPredictiveDropItem(this);
10143 else
10144 player.ServerDropEntity(this);
10145 return;
10146 }
10147
10149
10150 if (new_item)
10151 {
10152 new_item.SetResultOfSplit(true);
10153 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10155 new_item.SetQuantity(stack_max);
10156 new_item.PlaceOnSurface();
10157 }
10158 }
10159 }
10160 }
10161
10163 {
10165 return;
10166
10167 float split_quantity_new;
10171 InventoryLocation loc = new InventoryLocation;
10172
10173 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10174 {
10176 split_quantity_new = stack_max;
10177 else
10179
10180 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10181 if (new_item)
10182 {
10183 new_item.SetResultOfSplit(true);
10184 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10186 new_item.SetQuantity(split_quantity_new);
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 {
10200 }
10201
10202 if (new_item)
10203 {
10204 new_item.SetResultOfSplit(true);
10205 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10207 new_item.SetQuantity(split_quantity_new);
10208 }
10209 }
10210 else
10211 {
10212 if (stack_max != 0)
10213 {
10215 {
10217 }
10218
10220
10221 if (new_item)
10222 {
10223 new_item.SetResultOfSplit(true);
10224 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10226 new_item.SetQuantity(stack_max);
10227 new_item.PlaceOnSurface();
10228 }
10229 }
10230 }
10231 }
10232
10234 {
10236 return;
10237
10239 {
10240 if (ScriptInputUserData.CanStoreInputUserData())
10241 {
10242 ScriptInputUserData ctx = new ScriptInputUserData;
10247 dst.WriteToContext(ctx);
10249 }
10250 }
10251 else if (!
GetGame().IsMultiplayer())
10252 {
10254 }
10255 }
10256
10258 {
10260 return;
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 return this;
10294
10296 float split_quantity_new;
10298 if (dst.IsValid())
10299 {
10300 int slot_id = dst.GetSlot();
10302
10303 if (quantity > stack_max)
10304 split_quantity_new = stack_max;
10305 else
10306 split_quantity_new = quantity;
10307
10309
10310 if (new_item)
10311 {
10312 new_item.SetResultOfSplit(true);
10313 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10316 }
10317
10318 return new_item;
10319 }
10320
10321 return null;
10322 }
10323
10325 {
10327 return;
10328
10330 float split_quantity_new;
10332 if (destination_entity)
10333 {
10335 if (quantity > stackable)
10336 split_quantity_new = stackable;
10337 else
10338 split_quantity_new = quantity;
10339
10340 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10341 if (new_item)
10342 {
10343 new_item.SetResultOfSplit(true);
10344 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10346 new_item.SetQuantity(split_quantity_new);
10347 }
10348 }
10349 }
10350
10352 {
10354 return;
10355
10357 {
10358 if (ScriptInputUserData.CanStoreInputUserData())
10359 {
10360 ScriptInputUserData ctx = new ScriptInputUserData;
10365 ItemBase destination_entity =
this;
10366 ctx.
Write(destination_entity);
10370 }
10371 }
10372 else if (!
GetGame().IsMultiplayer())
10373 {
10375 }
10376 }
10377
10379 {
10381 return;
10382
10384 float split_quantity_new;
10386 if (player)
10387 {
10389 if (quantity > stackable)
10390 split_quantity_new = stackable;
10391 else
10392 split_quantity_new = quantity;
10393
10394 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10395 new_item =
ItemBase.Cast(in_hands);
10396 if (new_item)
10397 {
10398 new_item.SetResultOfSplit(true);
10399 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10401 new_item.SetQuantity(split_quantity_new);
10402 }
10403 }
10404 }
10405
10407 {
10409 return;
10410
10412 float split_quantity_new = Math.Floor(quantity * 0.5);
10413
10415
10416 if (new_item)
10417 {
10418 if (new_item.GetQuantityMax() < split_quantity_new)
10419 {
10420 split_quantity_new = new_item.GetQuantityMax();
10421 }
10422
10423 new_item.SetResultOfSplit(true);
10424 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10425
10427 {
10430 }
10431 else
10432 {
10435 }
10436 }
10437 }
10438
10440 {
10442 return;
10443
10445 float split_quantity_new = Math.Floor(quantity / 2);
10446
10447 InventoryLocation invloc = new InventoryLocation;
10449
10451 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10452
10453 if (new_item)
10454 {
10455 if (new_item.GetQuantityMax() < split_quantity_new)
10456 {
10457 split_quantity_new = new_item.GetQuantityMax();
10458 }
10460 {
10463 }
10464 else
10465 {
10468 }
10469 }
10470 }
10471
10474 {
10475 SetWeightDirty();
10477
10478 if (parent)
10479 parent.OnAttachmentQuantityChangedEx(this, delta);
10480
10482 {
10484 {
10486 }
10488 {
10489 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10491 }
10492 }
10493
10494 }
10495
10498 {
10499
10500 }
10501
10504 {
10506 }
10507
10509 {
10510 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10511
10513 {
10514 if (newLevel == GameConstants.STATE_RUINED)
10515 {
10517 EntityAI parent = GetHierarchyParent();
10518 if (parent && parent.IsFireplace())
10519 {
10520 CargoBase cargo = GetInventory().GetCargo();
10521 if (cargo)
10522 {
10524 {
10526 }
10527 }
10528 }
10529 }
10530
10532 {
10533
10535 return;
10536 }
10537
10538 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10539 {
10541 }
10542 }
10543 }
10544
10545
10547 {
10548 super.OnRightClick();
10549
10551 {
10553 {
10554 if (ScriptInputUserData.CanStoreInputUserData())
10555 {
10556 vector m4[4];
10558
10559 EntityAI root = GetHierarchyRoot();
10560
10561 InventoryLocation dst = new InventoryLocation;
10563 {
10564 if (root)
10565 {
10566 root.GetTransform(m4);
10568 }
10569 else
10570 GetInventory().GetCurrentInventoryLocation(dst);
10571 }
10572 else
10573 {
10575
10576
10577 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10578 {
10579 if (root)
10580 {
10581 root.GetTransform(m4);
10583 }
10584 else
10585 GetInventory().GetCurrentInventoryLocation(dst);
10586 }
10587 else
10588 {
10589 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10590 }
10591 }
10592
10593 ScriptInputUserData ctx = new ScriptInputUserData;
10601 }
10602 }
10603 else if (!
GetGame().IsMultiplayer())
10604 {
10606 }
10607 }
10608 }
10609
10610 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10611 {
10612
10613 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10614 return false;
10615
10616 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10617 return false;
10618
10619
10621 return false;
10622
10623
10624 Magazine mag = Magazine.Cast(this);
10625 if (mag)
10626 {
10627 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10628 return false;
10629
10630 if (stack_max_limit)
10631 {
10632 Magazine other_mag = Magazine.Cast(other_item);
10633 if (other_item)
10634 {
10635 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10636 return false;
10637 }
10638
10639 }
10640 }
10641 else
10642 {
10643
10645 return false;
10646
10648 return false;
10649 }
10650
10651 PlayerBase player = null;
10652 if (CastTo(player, GetHierarchyRootPlayer()))
10653 {
10654 if (player.GetInventory().HasAttachment(this))
10655 return false;
10656
10657 if (player.IsItemsToDelete())
10658 return false;
10659 }
10660
10661 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10662 return false;
10663
10664 int slotID;
10666 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10667 return false;
10668
10669 return true;
10670 }
10671
10673 {
10675 }
10676
10678 {
10679 return m_IsResultOfSplit;
10680 }
10681
10683 {
10684 m_IsResultOfSplit = value;
10685 }
10686
10688 {
10690 }
10691
10693 {
10694 float other_item_quantity = other_item.GetQuantity();
10695 float this_free_space;
10696
10698
10700
10701 if (other_item_quantity > this_free_space)
10702 {
10703 return this_free_space;
10704 }
10705 else
10706 {
10707 return other_item_quantity;
10708 }
10709 }
10710
10712 {
10714 }
10715
10717 {
10719 return;
10720
10721 if (!IsMagazine() && other_item)
10722 {
10724 if (quantity_used != 0)
10725 {
10726 float hp1 = GetHealth01("","");
10727 float hp2 = other_item.GetHealth01("","");
10728 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10729 hpResult = hpResult / (
GetQuantity() + quantity_used);
10730
10731 hpResult *= GetMaxHealth();
10732 Math.Round(hpResult);
10733 SetHealth("", "Health", hpResult);
10734
10736 other_item.AddQuantity(-quantity_used);
10737 }
10738 }
10740 }
10741
10743 {
10744 #ifdef SERVER
10745 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10746 GetHierarchyParent().IncreaseLifetimeUp();
10747 #endif
10748 };
10749
10751 {
10752 PlayerBase p = PlayerBase.Cast(player);
10753
10754 array<int> recipesIds = p.m_Recipes;
10755 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10756 if (moduleRecipesManager)
10757 {
10758 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10759 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10760 }
10761
10762 for (int i = 0;i < recipesIds.Count(); i++)
10763 {
10764 int key = recipesIds.Get(i);
10765 string recipeName = moduleRecipesManager.GetRecipeName(key);
10767 }
10768 }
10769
10770
10771 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10772 {
10773 super.GetDebugActions(outputList);
10774
10775
10780
10781
10785
10789
10790
10793
10794
10796 {
10799 }
10800
10802
10805
10809 }
10810
10811
10812
10813
10815 {
10816 super.OnAction(action_id, player, ctx);
10817 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10818 {
10819 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10820 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10821 PlayerBase p = PlayerBase.Cast(player);
10822 if (
EActions.RECIPES_RANGE_START < 1000)
10823 {
10824 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10825 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10826 }
10827 }
10828 #ifndef SERVER
10829 else if (action_id ==
EActions.WATCH_PLAYER)
10830 {
10831 PluginDeveloper.SetDeveloperItemClientEx(player);
10832 }
10833 #endif
10835 {
10836 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10837 {
10838 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10839 OnDebugButtonPressServer(id + 1);
10840 }
10841
10842 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10843 {
10844 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10846 }
10847
10848 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10849 {
10850 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10852 }
10853
10854 else if (action_id ==
EActions.ADD_QUANTITY)
10855 {
10856 if (IsMagazine())
10857 {
10858 Magazine mag = Magazine.Cast(this);
10859 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10860 }
10861 else
10862 {
10864 }
10865
10866 if (m_EM)
10867 {
10868 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10869 }
10870
10871 }
10872
10873 else if (action_id ==
EActions.REMOVE_QUANTITY)
10874 {
10875 if (IsMagazine())
10876 {
10877 Magazine mag2 = Magazine.Cast(this);
10878 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10879 }
10880 else
10881 {
10883 }
10884 if (m_EM)
10885 {
10886 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10887 }
10888
10889 }
10890
10891 else if (action_id ==
EActions.SET_QUANTITY_0)
10892 {
10894
10895 if (m_EM)
10896 {
10897 m_EM.SetEnergy(0);
10898 }
10899 }
10900
10901 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10902 {
10904
10905 if (m_EM)
10906 {
10907 m_EM.SetEnergy(m_EM.GetEnergyMax());
10908 }
10909 }
10910
10911 else if (action_id ==
EActions.ADD_HEALTH)
10912 {
10913 AddHealth("","",GetMaxHealth("","Health")/5);
10914 }
10915 else if (action_id ==
EActions.REMOVE_HEALTH)
10916 {
10917 AddHealth("","",-GetMaxHealth("","Health")/5);
10918 }
10919 else if (action_id ==
EActions.DESTROY_HEALTH)
10920 {
10921 SetHealth01("","",0);
10922 }
10923 else if (action_id ==
EActions.WATCH_ITEM)
10924 {
10926 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10927 #ifdef DEVELOPER
10928 SetDebugDeveloper_item(this);
10929 #endif
10930 }
10931
10932 else if (action_id ==
EActions.ADD_TEMPERATURE)
10933 {
10934 AddTemperature(20);
10935
10936 }
10937
10938 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10939 {
10940 AddTemperature(-20);
10941
10942 }
10943
10944 else if (action_id ==
EActions.FLIP_FROZEN)
10945 {
10946 SetFrozen(!GetIsFrozen());
10947
10948 }
10949
10950 else if (action_id ==
EActions.ADD_WETNESS)
10951 {
10953
10954 }
10955
10956 else if (action_id ==
EActions.REMOVE_WETNESS)
10957 {
10959
10960 }
10961
10962 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10963 {
10966
10967
10968 }
10969
10970 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10971 {
10974 }
10975
10976 else if (action_id ==
EActions.MAKE_SPECIAL)
10977 {
10978 auto debugParams = DebugSpawnParams.WithPlayer(player);
10979 OnDebugSpawnEx(debugParams);
10980 }
10981
10982 else if (action_id ==
EActions.DELETE)
10983 {
10984 Delete();
10985 }
10986
10987 }
10988
10989
10990 return false;
10991 }
10992
10993
10994
10995
10999
11002
11003
11004
11006 {
11007 return false;
11008 }
11009
11010
11012 {
11013 return true;
11014 }
11015
11016
11018 {
11019 return true;
11020 }
11021
11022
11023
11025 {
11026 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11028 }
11029
11032 {
11033 return null;
11034 }
11035
11037 {
11038 return false;
11039 }
11040
11042 {
11043 return false;
11044 }
11045
11049
11050
11052 {
11053 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11054 return module_repairing.CanRepair(this, item_repair_kit);
11055 }
11056
11057
11058 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11059 {
11060 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11061 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11062 }
11063
11064
11066 {
11067
11068
11069
11070
11071
11072
11073
11074
11075 return 1;
11076 }
11077
11078
11079
11081 {
11083 }
11084
11085
11086
11088 {
11090 }
11091
11092
11101 {
11102 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11103
11104 if (player)
11105 {
11106 player.MessageStatus(text);
11107 }
11108 }
11109
11110
11119 {
11120 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11121
11122 if (player)
11123 {
11124 player.MessageAction(text);
11125 }
11126 }
11127
11128
11137 {
11138 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11139
11140 if (player)
11141 {
11142 player.MessageFriendly(text);
11143 }
11144 }
11145
11146
11155 {
11156 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11157
11158 if (player)
11159 {
11160 player.MessageImportant(text);
11161 }
11162 }
11163
11165 {
11166 return true;
11167 }
11168
11169
11170 override bool KindOf(
string tag)
11171 {
11172 bool found = false;
11173 string item_name = this.
GetType();
11176
11177 int array_size = item_tag_array.Count();
11178 for (int i = 0; i < array_size; i++)
11179 {
11180 if (item_tag_array.Get(i) == tag)
11181 {
11182 found = true;
11183 break;
11184 }
11185 }
11186 return found;
11187 }
11188
11189
11191 {
11192
11193 super.OnRPC(sender, rpc_type,ctx);
11194
11195
11196 switch (rpc_type)
11197 {
11198 #ifndef SERVER
11199 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11200 Param2<bool, string> p = new Param2<bool, string>(false, "");
11201
11203 return;
11204
11205 bool play = p.param1;
11206 string soundSet = p.param2;
11207
11208 if (play)
11209 {
11211 {
11213 {
11215 }
11216 }
11217 else
11218 {
11220 }
11221 }
11222 else
11223 {
11225 }
11226
11227 break;
11228 #endif
11229
11230 }
11231
11233 {
11235 }
11236 }
11237
11238
11239
11240
11242 {
11243 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11244 return plugin.GetID(
name);
11245 }
11246
11248 {
11249 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11250 return plugin.GetName(id);
11251 }
11252
11255 {
11256
11257
11258 int varFlags;
11259 if (!ctx.
Read(varFlags))
11260 return;
11261
11262 if (varFlags & ItemVariableFlags.FLOAT)
11263 {
11265 }
11266 }
11267
11269 {
11270
11271 super.SerializeNumericalVars(floats_out);
11272
11273
11274
11276 {
11278 }
11279
11281 {
11283 }
11284
11286 {
11288 }
11289
11291 {
11296 }
11297
11299 {
11301 }
11302 }
11303
11305 {
11306
11307 super.DeSerializeNumericalVars(floats);
11308
11309
11310 int index = 0;
11311 int mask = Math.Round(floats.Get(index));
11312
11313 index++;
11314
11316 {
11318 {
11320 }
11321 else
11322 {
11323 float quantity = floats.Get(index);
11324 SetQuantity(quantity,
true,
false,
false,
false);
11325 }
11326 index++;
11327 }
11328
11330 {
11331 float wet = floats.Get(index);
11333 index++;
11334 }
11335
11337 {
11338 int liquidtype = Math.Round(floats.Get(index));
11340 index++;
11341 }
11342
11344 {
11346 index++;
11348 index++;
11350 index++;
11352 index++;
11353 }
11354
11356 {
11357 int cleanness = Math.Round(floats.Get(index));
11359 index++;
11360 }
11361 }
11362
11364 {
11365 super.WriteVarsToCTX(ctx);
11366
11367
11369 {
11371 }
11372
11374 {
11376 }
11377
11379 {
11381 }
11382
11384 {
11385 int r,g,b,a;
11391 }
11392
11394 {
11396 }
11397 }
11398
11400 {
11401 if (!super.ReadVarsFromCTX(ctx,version))
11402 return false;
11403
11404 int intValue;
11405 float value;
11406
11407 if (version < 140)
11408 {
11409 if (!ctx.
Read(intValue))
11410 return false;
11411
11412 m_VariablesMask = intValue;
11413 }
11414
11416 {
11417 if (!ctx.
Read(value))
11418 return false;
11419
11421 {
11423 }
11424 else
11425 {
11427 }
11428 }
11429
11430 if (version < 140)
11431 {
11433 {
11434 if (!ctx.
Read(value))
11435 return false;
11436 SetTemperatureDirect(value);
11437 }
11438 }
11439
11441 {
11442 if (!ctx.
Read(value))
11443 return false;
11445 }
11446
11448 {
11449 if (!ctx.
Read(intValue))
11450 return false;
11452 }
11453
11455 {
11456 int r,g,b,a;
11458 return false;
11460 return false;
11462 return false;
11464 return false;
11465
11467 }
11468
11470 {
11471 if (!ctx.
Read(intValue))
11472 return false;
11474 }
11475
11476 if (version >= 138 && version < 140)
11477 {
11479 {
11480 if (!ctx.
Read(intValue))
11481 return false;
11482 SetFrozen(intValue);
11483 }
11484 }
11485
11486 return true;
11487 }
11488
11489
11491 {
11494 {
11496 }
11497
11498 if (!super.OnStoreLoad(ctx, version))
11499 {
11501 return false;
11502 }
11503
11504 if (version >= 114)
11505 {
11506 bool hasQuickBarIndexSaved;
11507
11508 if (!ctx.
Read(hasQuickBarIndexSaved))
11509 {
11511 return false;
11512 }
11513
11514 if (hasQuickBarIndexSaved)
11515 {
11516 int itmQBIndex;
11517
11518
11519 if (!ctx.
Read(itmQBIndex))
11520 {
11522 return false;
11523 }
11524
11525 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11526 if (itmQBIndex != -1 && parentPlayer)
11527 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11528 }
11529 }
11530 else
11531 {
11532
11533 PlayerBase player;
11534 int itemQBIndex;
11535 if (version ==
int.
MAX)
11536 {
11537 if (!ctx.
Read(itemQBIndex))
11538 {
11540 return false;
11541 }
11542 }
11543 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11544 {
11545
11546 if (!ctx.
Read(itemQBIndex))
11547 {
11549 return false;
11550 }
11551 if (itemQBIndex != -1 && player)
11552 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11553 }
11554 }
11555
11556 if (version < 140)
11557 {
11558
11559 if (!LoadVariables(ctx, version))
11560 {
11562 return false;
11563 }
11564 }
11565
11566
11568 {
11570 return false;
11571 }
11572 if (version >= 132)
11573 {
11575 if (raib)
11576 {
11578 {
11580 return false;
11581 }
11582 }
11583 }
11584
11586 return true;
11587 }
11588
11589
11590
11592 {
11593 super.OnStoreSave(ctx);
11594
11595 PlayerBase player;
11596 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11597 {
11599
11600 int itemQBIndex = -1;
11601 itemQBIndex = player.FindQuickBarEntityIndex(this);
11602 ctx.
Write(itemQBIndex);
11603 }
11604 else
11605 {
11607 }
11608
11610
11612 if (raib)
11613 {
11615 }
11616 }
11617
11618
11620 {
11621 super.AfterStoreLoad();
11622
11624 {
11626 }
11627
11629 {
11632 }
11633 }
11634
11636 {
11637 super.EEOnAfterLoad();
11638
11640 {
11642 }
11643
11646 }
11647
11649 {
11650 return false;
11651 }
11652
11653
11654
11656 {
11658 {
11659 #ifdef PLATFORM_CONSOLE
11660
11662 {
11664 if (menu)
11665 {
11667 }
11668 }
11669 #endif
11670 }
11671
11673 {
11676 }
11677
11679 {
11680 SetWeightDirty();
11682 }
11684 {
11687 }
11688
11690 {
11693 }
11695 {
11698 }
11699
11700 super.OnVariablesSynchronized();
11701 }
11702
11703
11704
11706 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11707 {
11708 if (!IsServerCheck(allow_client))
11709 return false;
11710
11712 return false;
11713
11716
11717 if (value <= (min + 0.001))
11718 value = min;
11719
11720 if (value == min)
11721 {
11722 if (destroy_config)
11723 {
11724 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11725 if (dstr)
11726 {
11728 this.Delete();
11729 return true;
11730 }
11731 }
11732 else if (destroy_forced)
11733 {
11735 this.Delete();
11736 return true;
11737 }
11738
11740 }
11741
11744
11746 {
11748
11749 if (delta)
11751 }
11752
11754
11755 return false;
11756 }
11757
11758
11760 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11761 {
11763 }
11764
11766 {
11769 }
11770
11772 {
11775 }
11776
11779 {
11780 float value_clamped = Math.Clamp(value, 0, 1);
11782 SetQuantity(result, destroy_config, destroy_forced);
11783 }
11784
11785
11788 {
11790 }
11791
11793 {
11795 }
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11807 {
11808 int slot = -1;
11809 if (GetInventory())
11810 {
11811 InventoryLocation il = new InventoryLocation;
11812 GetInventory().GetCurrentInventoryLocation(il);
11814 }
11815
11817 }
11818
11820 {
11821 float quantity_max = 0;
11822
11824 {
11825 if (attSlotID != -1)
11826 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11827
11828 if (quantity_max <= 0)
11830 }
11831
11832 if (quantity_max <= 0)
11834
11835 return quantity_max;
11836 }
11837
11839 {
11841 }
11842
11844 {
11846 }
11847
11848
11850 {
11852 }
11853
11855 {
11857 }
11858
11860 {
11862 }
11863
11864
11866 {
11867
11868 float weightEx = GetWeightEx();
11869 float special = GetInventoryAndCargoWeight();
11870 return weightEx - special;
11871 }
11872
11873
11875 {
11877 }
11878
11880 {
11882 {
11883 #ifdef DEVELOPER
11884 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11885 {
11886 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11888 }
11889 #endif
11890
11891 return GetQuantity() * GetConfigWeightModified();
11892 }
11893 else if (HasEnergyManager())
11894 {
11895 #ifdef DEVELOPER
11896 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11897 {
11898 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11899 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11900 }
11901 #endif
11902 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11903 }
11904 else
11905 {
11906 #ifdef DEVELOPER
11907 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11908 {
11909 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11910 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11911 }
11912 #endif
11913 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11914 }
11915 }
11916
11919 {
11920 int item_count = 0;
11922
11923 if (GetInventory().GetCargo() != NULL)
11924 {
11925 item_count = GetInventory().GetCargo().GetItemCount();
11926 }
11927
11928 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11929 {
11930 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11931 if (item)
11932 item_count += item.GetNumberOfItems();
11933 }
11934 return item_count;
11935 }
11936
11939 {
11940 float weight = 0;
11941 float wetness = 1;
11942 if (include_wetness)
11945 {
11946 weight = wetness * m_ConfigWeight;
11947 }
11949 {
11950 weight = 1;
11951 }
11952 return weight;
11953 }
11954
11955
11956
11958 {
11959 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11960 {
11961 GameInventory inv = GetInventory();
11962 array<EntityAI> items = new array<EntityAI>;
11964 for (int i = 0; i < items.Count(); i++)
11965 {
11967 if (item)
11968 {
11970 }
11971 }
11972 }
11973 }
11974
11975
11976
11977
11979 {
11980 float energy = 0;
11981 if (HasEnergyManager())
11982 {
11983 energy = GetCompEM().GetEnergy();
11984 }
11985 return energy;
11986 }
11987
11988
11990 {
11991 super.OnEnergyConsumed();
11992
11994 }
11995
11997 {
11998 super.OnEnergyAdded();
11999
12001 }
12002
12003
12005 {
12006 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12007 {
12009 {
12010 float energy_0to1 = GetCompEM().GetEnergy0To1();
12012 }
12013 }
12014 }
12015
12016
12018 {
12019 return ConfigGetFloat("heatIsolation");
12020 }
12021
12023 {
12025 }
12026
12028 {
12029 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12030 if (
GetGame().ConfigIsExisting(paramPath))
12032
12033 return 0.0;
12034 }
12035
12037 {
12038 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12039 if (
GetGame().ConfigIsExisting(paramPath))
12041
12042 return 0.0;
12043 }
12044
12045 override void SetWet(
float value,
bool allow_client =
false)
12046 {
12047 if (!IsServerCheck(allow_client))
12048 return;
12049
12052
12054
12055 m_VarWet = Math.Clamp(value, min, max);
12056
12058 {
12061 }
12062 }
12063
12064 override void AddWet(
float value)
12065 {
12067 }
12068
12070 {
12072 }
12073
12075 {
12077 }
12078
12080 {
12082 }
12083
12085 {
12087 }
12088
12090 {
12092 }
12093
12094 override void OnWetChanged(
float newVal,
float oldVal)
12095 {
12098 if (newLevel != oldLevel)
12099 {
12101 }
12102 }
12103
12105 {
12106 SetWeightDirty();
12107 }
12108
12110 {
12111 return GetWetLevelInternal(
m_VarWet);
12112 }
12113
12114
12115
12117 {
12119 }
12120
12122 {
12124 }
12125
12127 {
12129 }
12130
12132 {
12134 }
12135
12136
12137
12139 {
12140 if (ConfigIsExisting("itemModelLength"))
12141 {
12142 return ConfigGetFloat("itemModelLength");
12143 }
12144 return 0;
12145 }
12146
12148 {
12149 if (ConfigIsExisting("itemAttachOffset"))
12150 {
12151 return ConfigGetFloat("itemAttachOffset");
12152 }
12153 return 0;
12154 }
12155
12156 override void SetCleanness(
int value,
bool allow_client =
false)
12157 {
12158 if (!IsServerCheck(allow_client))
12159 return;
12160
12162
12164
12167 }
12168
12170 {
12172 }
12173
12175 {
12176 return true;
12177 }
12178
12179
12180
12181
12183 {
12185 }
12186
12188 {
12190 }
12191
12192
12193
12194
12195 override void SetColor(
int r,
int g,
int b,
int a)
12196 {
12202 }
12204 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12205 {
12210 }
12211
12213 {
12215 }
12216
12219 {
12220 int r,g,b,a;
12222 r = r/255;
12223 g = g/255;
12224 b = b/255;
12225 a = a/255;
12226 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12227 }
12228
12229
12230
12231 override void SetLiquidType(
int value,
bool allow_client =
false)
12232 {
12233 if (!IsServerCheck(allow_client))
12234 return;
12235
12240 }
12241
12243 {
12244 return ConfigGetInt("varLiquidTypeInit");
12245 }
12246
12248 {
12250 }
12251
12253 {
12255 SetFrozen(false);
12256 }
12257
12260 {
12261 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12262 }
12263
12264
12267 {
12268 PlayerBase nplayer;
12269 if (PlayerBase.CastTo(nplayer, player))
12270 {
12272
12273 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12274 }
12275 }
12276
12277
12280 {
12281 PlayerBase nplayer;
12282 if (PlayerBase.CastTo(nplayer,player))
12283 {
12284
12285 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12286
12287 }
12288
12289
12290 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12291
12292
12293 if (HasEnergyManager())
12294 {
12295 GetCompEM().UpdatePlugState();
12296 }
12297 }
12298
12299
12301 {
12302 super.OnPlacementStarted(player);
12303
12305 }
12306
12307 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12308 {
12310 {
12311 m_AdminLog.OnPlacementComplete(player,
this);
12312 }
12313
12314 super.OnPlacementComplete(player, position, orientation);
12315 }
12316
12317
12318
12319
12320
12322 {
12324 {
12325 return true;
12326 }
12327 else
12328 {
12329 return false;
12330 }
12331 }
12332
12333
12335 {
12337 {
12339 }
12340 }
12341
12342
12344 {
12346 }
12347
12349 {
12351 }
12352
12353 override void InsertAgent(
int agent,
float count = 1)
12354 {
12355 if (count < 1)
12356 return;
12357
12359 }
12360
12363 {
12365 }
12366
12367
12369 {
12371 }
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12415 {
12417 return false;
12418 return true;
12419 }
12420
12422 {
12423
12425 }
12426
12427
12430 {
12431 super.CheckForRoofLimited(timeTresholdMS);
12432
12434 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12435 {
12436 m_PreviousRoofTestTime = time;
12437 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12438 }
12439 }
12440
12441
12443 {
12445 {
12446 return 0;
12447 }
12448
12449 if (GetInventory().GetAttachmentSlotsCount() != 0)
12450 {
12451 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12452 if (filter)
12453 return filter.GetProtectionLevel(type, false, system);
12454 else
12455 return 0;
12456 }
12457
12458 string subclassPath, entryName;
12459
12460 switch (type)
12461 {
12463 entryName = "biological";
12464 break;
12466 entryName = "chemical";
12467 break;
12468 default:
12469 entryName = "biological";
12470 break;
12471 }
12472
12473 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12474
12476 }
12477
12478
12479
12482 {
12483 if (!IsMagazine())
12485
12487 }
12488
12489
12490
12491
12492
12497 {
12498 return true;
12499 }
12500
12502 {
12504 }
12505
12506
12507
12508
12509
12511 {
12512 if (parent)
12513 {
12514 if (parent.IsInherited(DayZInfected))
12515 return true;
12516
12517 if (!parent.IsRuined())
12518 return true;
12519 }
12520
12521 return true;
12522 }
12523
12525 {
12526 if (!super.CanPutAsAttachment(parent))
12527 {
12528 return false;
12529 }
12530
12531 if (!IsRuined() && !parent.IsRuined())
12532 {
12533 return true;
12534 }
12535
12536 return false;
12537 }
12538
12540 {
12541
12542
12543
12544
12545 return super.CanReceiveItemIntoCargo(item);
12546 }
12547
12549 {
12550
12551
12552
12553
12554 GameInventory attachmentInv = attachment.GetInventory();
12556 {
12557 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12558 return false;
12559 }
12560
12561 InventoryLocation loc = new InventoryLocation();
12562 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12563 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12564 return false;
12565
12566 return super.CanReceiveAttachment(attachment, slotId);
12567 }
12568
12570 {
12571 if (!super.CanReleaseAttachment(attachment))
12572 return false;
12573
12574 return GetInventory().AreChildrenAccessible();
12575 }
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12598 {
12599 int id = muzzle_owner.GetMuzzleID();
12600 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12601
12602 if (WPOF_array)
12603 {
12604 for (int i = 0; i < WPOF_array.Count(); i++)
12605 {
12606 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12607
12608 if (WPOF)
12609 {
12610 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12611 }
12612 }
12613 }
12614 }
12615
12616
12618 {
12619 int id = muzzle_owner.GetMuzzleID();
12621
12622 if (WPOBE_array)
12623 {
12624 for (int i = 0; i < WPOBE_array.Count(); i++)
12625 {
12626 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12627
12628 if (WPOBE)
12629 {
12630 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12631 }
12632 }
12633 }
12634 }
12635
12636
12638 {
12639 int id = muzzle_owner.GetMuzzleID();
12640 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12641
12642 if (WPOOH_array)
12643 {
12644 for (int i = 0; i < WPOOH_array.Count(); i++)
12645 {
12646 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12647
12648 if (WPOOH)
12649 {
12650 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12651 }
12652 }
12653 }
12654 }
12655
12656
12658 {
12659 int id = muzzle_owner.GetMuzzleID();
12660 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12661
12662 if (WPOOH_array)
12663 {
12664 for (int i = 0; i < WPOOH_array.Count(); i++)
12665 {
12666 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12667
12668 if (WPOOH)
12669 {
12670 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12671 }
12672 }
12673 }
12674 }
12675
12676
12678 {
12679 int id = muzzle_owner.GetMuzzleID();
12680 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12681
12682 if (WPOOH_array)
12683 {
12684 for (int i = 0; i < WPOOH_array.Count(); i++)
12685 {
12686 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12687
12688 if (WPOOH)
12689 {
12690 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12691 }
12692 }
12693 }
12694 }
12695
12696
12697
12699 {
12701 {
12702 return true;
12703 }
12704
12705 return false;
12706 }
12707
12709 {
12711 {
12712 return true;
12713 }
12714
12715 return false;
12716 }
12717
12719 {
12721 {
12722 return true;
12723 }
12724
12725 return false;
12726 }
12727
12729 {
12730 return false;
12731 }
12732
12735 {
12736 return UATimeSpent.DEFAULT_DEPLOY;
12737 }
12738
12739
12740
12741
12743 {
12745 SetSynchDirty();
12746 }
12747
12749 {
12751 }
12752
12753
12755 {
12756 return false;
12757 }
12758
12761 {
12762 string att_type = "None";
12763
12764 if (ConfigIsExisting("soundAttType"))
12765 {
12766 att_type = ConfigGetString("soundAttType");
12767 }
12768
12770 }
12771
12773 {
12775 }
12776
12777
12778
12779
12780
12784
12786 {
12789
12791 }
12792
12793
12795 {
12797 return;
12798
12800
12803
12806
12807 SoundParameters params = new SoundParameters();
12811 }
12812
12813
12815 {
12817 return;
12818
12820 SetSynchDirty();
12821
12824 }
12825
12826
12828 {
12830 return;
12831
12833 SetSynchDirty();
12834
12837 }
12838
12840 {
12842 }
12843
12845 {
12847 }
12848
12851 {
12852 if (!
GetGame().IsDedicatedServer())
12853 {
12854 if (ConfigIsExisting("attachSoundSet"))
12855 {
12856 string cfg_path = "";
12857 string soundset = "";
12858 string type_name =
GetType();
12859
12862 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12863 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12864
12865 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12866 {
12867 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12868 {
12869 if (cfg_slot_array[i] == slot_type)
12870 {
12871 soundset = cfg_soundset_array[i];
12872 break;
12873 }
12874 }
12875 }
12876
12877 if (soundset != "")
12878 {
12879 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12881 }
12882 }
12883 }
12884 }
12885
12887 {
12888
12889 }
12890
12891 void OnApply(PlayerBase player);
12892
12894 {
12895 return 1.0;
12896 };
12897
12899 {
12901 }
12902
12904 {
12906 }
12907
12909
12911 {
12912 SetDynamicPhysicsLifeTime(0.01);
12914 }
12915
12917 {
12918 array<string> zone_names = new array<string>;
12919 GetDamageZones(zone_names);
12920 for (int i = 0; i < zone_names.Count(); i++)
12921 {
12922 SetHealthMax(zone_names.Get(i),"Health");
12923 }
12924 SetHealthMax("","Health");
12925 }
12926
12929 {
12930 float global_health = GetHealth01("","Health");
12931 array<string> zones = new array<string>;
12932 GetDamageZones(zones);
12933
12934 for (int i = 0; i < zones.Count(); i++)
12935 {
12936 SetHealth01(zones.Get(i),"Health",global_health);
12937 }
12938 }
12939
12942 {
12943 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12944 }
12945
12947 {
12948 if (!hasRootAsPlayer)
12949 {
12950 if (refParentIB)
12951 {
12952
12953 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12954 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12955
12956 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12957 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12958
12961 }
12962 else
12963 {
12964
12967 }
12968 }
12969 }
12970
12972 {
12974 {
12975 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12976 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12977 {
12978 float heatPermCoef = 1.0;
12980 while (ent)
12981 {
12982 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12983 ent = ent.GetHierarchyParent();
12984 }
12985
12986 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12987 }
12988 }
12989 }
12990
12992 {
12993
12994 EntityAI parent = GetHierarchyParent();
12995 if (!parent)
12996 {
12997 hasParent = false;
12998 hasRootAsPlayer = false;
12999 }
13000 else
13001 {
13002 hasParent = true;
13003 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13004 refParentIB =
ItemBase.Cast(parent);
13005 }
13006 }
13007
13008 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13009 {
13010
13011 }
13012
13014 {
13015
13016 return false;
13017 }
13018
13020 {
13021
13022
13023 return false;
13024 }
13025
13027 {
13028
13029 return false;
13030 }
13031
13034 {
13035 return !GetIsFrozen() &&
IsOpen();
13036 }
13037
13039 {
13040 bool hasParent = false, hasRootAsPlayer = false;
13042
13043 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13044 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13045
13046 if (wwtu || foodDecay)
13047 {
13051
13052 if (processWetness || processTemperature || processDecay)
13053 {
13055
13056 if (processWetness)
13057 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13058
13059 if (processTemperature)
13061
13062 if (processDecay)
13063 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13064 }
13065 }
13066 }
13067
13070 {
13072 }
13073
13075 {
13078
13079 return super.GetTemperatureFreezeThreshold();
13080 }
13081
13083 {
13086
13087 return super.GetTemperatureThawThreshold();
13088 }
13089
13091 {
13094
13095 return super.GetItemOverheatThreshold();
13096 }
13097
13099 {
13101 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13102
13103 return super.GetTemperatureFreezeTime();
13104 }
13105
13107 {
13109 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13110
13111 return super.GetTemperatureThawTime();
13112 }
13113
13118
13120 {
13121 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13122 }
13123
13125 {
13126 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13127 }
13128
13131 {
13133 }
13134
13136 {
13138 }
13139
13141 {
13143 }
13144
13147 {
13148 return null;
13149 }
13150
13153 {
13154 return false;
13155 }
13156
13158 {
13160 {
13163 if (!trg)
13164 {
13166 explosive = this;
13167 }
13168
13169 explosive.PairRemote(trg);
13171
13172 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13173 trg.SetPersistentPairID(persistentID);
13174 explosive.SetPersistentPairID(persistentID);
13175
13176 return true;
13177 }
13178 return false;
13179 }
13180
13183 {
13184 float ret = 1.0;
13187 ret *= GetHealth01();
13188
13189 return ret;
13190 }
13191
13192 #ifdef DEVELOPER
13193 override void SetDebugItem()
13194 {
13195 super.SetDebugItem();
13196 _itemBase = this;
13197 }
13198
13200 {
13201 string text = super.GetDebugText();
13202
13204 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13205
13206 return text;
13207 }
13208 #endif
13209
13211 {
13212 return true;
13213 }
13214
13216
13218
13220 {
13223 }
13224
13225
13233
13249}
13250
13252{
13254 if (entity)
13255 {
13256 bool is_item = entity.IsInherited(
ItemBase);
13257 if (is_item && full_quantity)
13258 {
13261 }
13262 }
13263 else
13264 {
13266 return NULL;
13267 }
13268 return entity;
13269}
13270
13272{
13273 if (item)
13274 {
13275 if (health > 0)
13276 item.SetHealth("", "", health);
13277
13278 if (item.CanHaveTemperature())
13279 {
13281 if (item.CanFreeze())
13282 item.SetFrozen(false);
13283 }
13284
13285 if (item.HasEnergyManager())
13286 {
13287 if (quantity >= 0)
13288 {
13289 item.GetCompEM().SetEnergy0To1(quantity);
13290 }
13291 else
13292 {
13294 }
13295 }
13296 else if (item.IsMagazine())
13297 {
13298 Magazine mag = Magazine.Cast(item);
13299 if (quantity >= 0)
13300 {
13301 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13302 }
13303 else
13304 {
13306 }
13307
13308 }
13309 else
13310 {
13311 if (quantity >= 0)
13312 {
13313 item.SetQuantityNormalized(quantity, false);
13314 }
13315 else
13316 {
13318 }
13319
13320 }
13321 }
13322}
13323
13324#ifdef DEVELOPER
13326#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.