Event called on item when it is placed in the player(Man) inventory, passes the owner as a parameter.
8570{
8572 {
8573 return true;
8574 }
8575};
8576
8577
8578
8580{
8584
8586
8589
8590
8591
8592
8593
8602
8608
8613
8618
8639 protected bool m_IsResultOfSplit
8640
8642
8647
8648
8649
8651
8655
8656
8657
8659
8662
8663
8664
8670
8671
8679
8682
8683
8685
8686
8688
8689
8694
8695
8700
8701
8703
8704
8706 {
8711
8712 if (!
GetGame().IsDedicatedServer())
8713 {
8715 {
8717
8719 {
8721 }
8722 }
8723
8726 }
8727
8728 m_OldLocation = null;
8729
8731 {
8733 }
8734
8735 if (ConfigIsExisting("headSelectionsToHide"))
8736 {
8739 }
8740
8742 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8743 {
8745 }
8746
8748
8749 m_IsResultOfSplit = false;
8750
8752 }
8753
8755 {
8756 super.InitItemVariables();
8757
8763 m_Count = ConfigGetInt(
"count");
8764
8767
8772
8775
8780
8792
8796
8797
8800 if (ConfigIsExisting("canBeSplit"))
8801 {
8804 }
8805
8807 if (ConfigIsExisting("itemBehaviour"))
8809
8810
8813 RegisterNetSyncVariableInt("m_VarLiquidType");
8814 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8815
8816 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8817 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8818 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8819
8820 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8821 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8822 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8823 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8824
8825 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8826 RegisterNetSyncVariableBool("m_IsTakeable");
8827 RegisterNetSyncVariableBool("m_IsHologram");
8828
8831 {
8834 }
8835
8837
8839 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8841
8842 }
8843
8845 {
8847 }
8848
8850 {
8853 {
8858 }
8859 }
8860
8861 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8862 {
8864 {
8867 }
8868
8870 }
8871
8873 {
8879 }
8880
8882
8884 {
8886
8887 if (!action)
8888 {
8889 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8890 return;
8891 }
8892
8894 if (!ai)
8895 {
8897 return;
8898 }
8899
8901 if (!action_array)
8902 {
8903 action_array = new array<ActionBase_Basic>;
8905 }
8906 if (LogManager.IsActionLogEnable())
8907 {
8908 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8909 }
8910
8911 if (action_array.Find(action) != -1)
8912 {
8913 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8914 }
8915 else
8916 {
8917 action_array.Insert(action);
8918 }
8919 }
8920
8922 {
8924 ActionBase action = player.GetActionManager().GetAction(actionName);
8927
8928 if (action_array)
8929 {
8930 action_array.RemoveItem(action);
8931 }
8932 }
8933
8934
8935
8937 {
8938 ActionOverrideData overrideData = new ActionOverrideData();
8942
8944 if (!actionMap)
8945 {
8948 }
8949
8950 actionMap.Insert(this.
Type(), overrideData);
8951
8952 }
8953
8955
8957
8958
8960 {
8963
8966
8967 string config_to_search = "CfgVehicles";
8968 string muzzle_owner_config;
8969
8971 {
8972 if (IsInherited(Weapon))
8973 config_to_search = "CfgWeapons";
8974
8975 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8976
8977 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8978
8980
8981 if (config_OnFire_subclass_count > 0)
8982 {
8983 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8984
8985 for (int i = 0; i < config_OnFire_subclass_count; i++)
8986 {
8987 string particle_class = "";
8989 string config_OnFire_entry = config_OnFire_class + particle_class;
8990 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8991 WPOF_array.Insert(WPOF);
8992 }
8993
8994
8996 }
8997 }
8998
9000 {
9001 config_to_search = "CfgWeapons";
9002 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9003
9004 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9005
9007
9008 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9009 {
9010 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9011
9012 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9013 {
9014 string particle_class2 = "";
9016 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9017 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9018 WPOBE_array.Insert(WPOBE);
9019 }
9020
9021
9023 }
9024 }
9025 }
9026
9027
9029 {
9032
9034 {
9035 string config_to_search = "CfgVehicles";
9036
9037 if (IsInherited(Weapon))
9038 config_to_search = "CfgWeapons";
9039
9040 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9041 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9042
9043 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9044 {
9045
9047
9049 {
9051 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9053 return;
9054 }
9055
9058
9059
9060
9062 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9063
9064 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9065 {
9066 string particle_class = "";
9068 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9070
9071 if (entry_type == CT_CLASS)
9072 {
9073 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9074 WPOOH_array.Insert(WPOF);
9075 }
9076 }
9077
9078
9080 }
9081 }
9082 }
9083
9085 {
9087 }
9088
9090 {
9092 {
9094
9097
9100
9101 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9102 }
9103 }
9104
9106 {
9108 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9109
9111 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9112
9114 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9115
9117 {
9119 }
9120 }
9121
9123 {
9125 }
9126
9128 {
9131 else
9133
9135 {
9138 }
9139 else
9140 {
9143
9146 }
9147
9149 }
9150
9152 {
9154 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9155 }
9156
9158 {
9160 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9162 }
9163
9165 {
9167 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9168 }
9169
9171 {
9174
9175 OverheatingParticle OP = new OverheatingParticle();
9180
9182 }
9183
9185 {
9188
9189 return -1;
9190 }
9191
9193 {
9195 {
9198
9199 for (int i = count; i > 0; --i)
9200 {
9201 int id = i - 1;
9204
9207
9208 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9209 {
9210 if (p)
9211 {
9214 }
9215 }
9216 }
9217 }
9218 }
9219
9221 {
9223 {
9225 {
9226 int id = i - 1;
9228
9229 if (OP)
9230 {
9232
9233 if (p)
9234 {
9236 }
9237
9238 delete OP;
9239 }
9240 }
9241
9244 }
9245 }
9246
9249 {
9250 return 0.0;
9251 }
9252
9253
9255 {
9256 return 250;
9257 }
9258
9260 {
9261 return 0;
9262 }
9263
9266 {
9268 return true;
9269
9270 return false;
9271 }
9272
9275 {
9278
9280 {
9282 }
9283 else
9284 {
9285
9287 }
9288
9290 }
9291
9298 {
9299 return -1;
9300 }
9301
9302
9303
9304
9306 {
9308 {
9310 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9311
9312 if (r_index >= 0)
9313 {
9314 InventoryLocation r_il = new InventoryLocation;
9315 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9316
9317 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9320 {
9321 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9322 }
9324 {
9325 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9326 }
9327
9328 }
9329
9330 player.GetHumanInventory().ClearUserReservedLocation(this);
9331 }
9332
9335 }
9336
9337
9338
9339
9341 {
9342 return ItemBase.m_DebugActionsMask;
9343 }
9344
9346 {
9347 return ItemBase.m_DebugActionsMask & mask;
9348 }
9349
9351 {
9352 ItemBase.m_DebugActionsMask = mask;
9353 }
9354
9356 {
9357 ItemBase.m_DebugActionsMask |= mask;
9358 }
9359
9361 {
9362 ItemBase.m_DebugActionsMask &= ~mask;
9363 }
9364
9366 {
9368 {
9370 }
9371 else
9372 {
9374 }
9375 }
9376
9377
9379 {
9380 if (GetEconomyProfile())
9381 {
9382 float q_max = GetEconomyProfile().GetQuantityMax();
9383 if (q_max > 0)
9384 {
9385 float q_min = GetEconomyProfile().GetQuantityMin();
9386 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9387
9389 {
9390 ComponentEnergyManager comp = GetCompEM();
9392 {
9394 }
9395 }
9397 {
9399
9400 }
9401
9402 }
9403 }
9404 }
9405
9408 {
9409 EntityAI parent = GetHierarchyParent();
9410
9411 if (parent)
9412 {
9413 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9414 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9415 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9416 }
9417 }
9418
9421 {
9422 EntityAI parent = GetHierarchyParent();
9423
9424 if (parent)
9425 {
9426 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9427 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9428 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9429 }
9430 }
9431
9433 {
9434
9435
9436
9437
9439
9441 {
9442 if (ScriptInputUserData.CanStoreInputUserData())
9443 {
9444 ScriptInputUserData ctx = new ScriptInputUserData;
9450 ctx.
Write(use_stack_max);
9453
9455 {
9456 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9457 }
9458 }
9459 }
9460 else if (!
GetGame().IsMultiplayer())
9461 {
9463 }
9464 }
9465
9467 {
9469 }
9470
9472 {
9474 }
9475
9477 {
9479 }
9480
9482 {
9483
9484 return false;
9485 }
9486
9488 {
9489 return false;
9490 }
9491
9495 {
9496 return false;
9497 }
9498
9500 {
9501 return "";
9502 }
9503
9505
9507 {
9508 return false;
9509 }
9510
9512 {
9513 return true;
9514 }
9515
9516
9517
9519 {
9520 return true;
9521 }
9522
9524 {
9525 return true;
9526 }
9527
9529 {
9530 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9532 }
9533
9535 {
9537 }
9538
9540 {
9542 if (!is_being_placed)
9544 SetSynchDirty();
9545 }
9546
9547
9549
9551 {
9553 }
9554
9556 {
9558 }
9559
9561 {
9562 return 1;
9563 }
9564
9566 {
9567 return false;
9568 }
9569
9571 {
9573 SetSynchDirty();
9574 }
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9611 {
9612 super.OnMovedInsideCargo(container);
9613
9614 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9615 }
9616
9617 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9618 {
9619 super.EEItemLocationChanged(oldLoc,newLoc);
9620
9621 PlayerBase new_player = null;
9622 PlayerBase old_player = null;
9623
9624 if (newLoc.GetParent())
9625 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9626
9627 if (oldLoc.GetParent())
9628 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9629
9631 {
9632 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9633
9634 if (r_index >= 0)
9635 {
9636 InventoryLocation r_il = new InventoryLocation;
9637 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9638
9639 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9642 {
9643 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9644 }
9646 {
9647 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9648 }
9649
9650 }
9651 }
9652
9654 {
9655 if (new_player)
9656 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9657
9658 if (new_player == old_player)
9659 {
9660
9661 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9662 {
9664 {
9665 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9666 {
9667 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9668 }
9669 }
9670 else
9671 {
9672 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9673 }
9674 }
9675
9676 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9677 {
9678 int type = oldLoc.GetType();
9680 {
9681 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9682 }
9684 {
9685 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9686 }
9687 }
9688 if (!m_OldLocation)
9689 {
9690 m_OldLocation = new InventoryLocation;
9691 }
9692 m_OldLocation.Copy(oldLoc);
9693 }
9694 else
9695 {
9696 if (m_OldLocation)
9697 {
9698 m_OldLocation.Reset();
9699 }
9700 }
9701
9703 }
9704 else
9705 {
9706 if (new_player)
9707 {
9708 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9709 if (res_index >= 0)
9710 {
9711 InventoryLocation il = new InventoryLocation;
9712 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9714 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9717 {
9718 il.
GetParent().GetOnReleaseLock().Invoke(it);
9719 }
9721 {
9723 }
9724
9725 }
9726 }
9728 {
9729
9731 }
9732
9733 if (m_OldLocation)
9734 {
9735 m_OldLocation.Reset();
9736 }
9737 }
9738 }
9739
9740 override void EOnContact(IEntity other, Contact extra)
9741 {
9743 {
9744 int liquidType = -1;
9746 if (impactSpeed > 0.0)
9747 {
9749 #ifndef SERVER
9751 #else
9753 SetSynchDirty();
9754 #endif
9756 }
9757 }
9758
9759 #ifdef SERVER
9760 if (GetCompEM() && GetCompEM().IsPlugged())
9761 {
9762 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9763 GetCompEM().UnplugThis();
9764 }
9765 #endif
9766 }
9767
9769
9771 {
9773 }
9774
9776 {
9777
9778 }
9779
9781 {
9782 super.OnItemLocationChanged(old_owner, new_owner);
9783
9784 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9785 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9786
9787 if (!relatedPlayer && playerNew)
9788 relatedPlayer = playerNew;
9789
9790 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9791 {
9793 if (actionMgr)
9794 {
9795 ActionBase currentAction = actionMgr.GetRunningAction();
9796 if (currentAction)
9798 }
9799 }
9800
9801 Man ownerPlayerOld = null;
9802 Man ownerPlayerNew = null;
9803
9804 if (old_owner)
9805 {
9806 if (old_owner.
IsMan())
9807 {
9808 ownerPlayerOld = Man.Cast(old_owner);
9809 }
9810 else
9811 {
9812 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9813 }
9814 }
9815 else
9816 {
9818 {
9820
9821 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9822 {
9823 GetCompEM().UnplugThis();
9824 }
9825 }
9826 }
9827
9828 if (new_owner)
9829 {
9830 if (new_owner.
IsMan())
9831 {
9832 ownerPlayerNew = Man.Cast(new_owner);
9833 }
9834 else
9835 {
9836 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9837 }
9838 }
9839
9840 if (ownerPlayerOld != ownerPlayerNew)
9841 {
9842 if (ownerPlayerOld)
9843 {
9844 array<EntityAI> subItemsExit = new array<EntityAI>;
9846 for (int i = 0; i < subItemsExit.Count(); i++)
9847 {
9850 }
9851 }
9852
9853 if (ownerPlayerNew)
9854 {
9855 array<EntityAI> subItemsEnter = new array<EntityAI>;
9857 for (int j = 0; j < subItemsEnter.Count(); j++)
9858 {
9861 }
9862 }
9863 }
9864 else if (ownerPlayerNew != null)
9865 {
9866 PlayerBase nplayer;
9867 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9868 {
9869 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9871 for (int k = 0; k < subItemsUpdate.Count(); k++)
9872 {
9874 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9875 }
9876 }
9877 }
9878
9879 if (old_owner)
9880 old_owner.OnChildItemRemoved(this);
9881 if (new_owner)
9882 new_owner.OnChildItemReceived(this);
9883 }
9884
9885
9887 {
9888 super.EEDelete(parent);
9889 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9890 if (player)
9891 {
9893
9894 if (player.IsAlive())
9895 {
9896 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9897 if (r_index >= 0)
9898 {
9899 InventoryLocation r_il = new InventoryLocation;
9900 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9901
9902 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9905 {
9906 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9907 }
9909 {
9910 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9911 }
9912
9913 }
9914
9915 player.RemoveQuickBarEntityShortcut(this);
9916 }
9917 }
9918 }
9919
9921 {
9922 super.EEKilled(killer);
9923
9926 {
9927 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9928 {
9929 if (IsMagazine())
9930 {
9931 if (Magazine.Cast(this).GetAmmoCount() > 0)
9932 {
9934 }
9935 }
9936 else
9937 {
9939 }
9940 }
9941 }
9942 }
9943
9945 {
9946 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9947
9948 super.OnWasAttached(parent, slot_id);
9949
9952
9954 }
9955
9957 {
9958 super.OnWasDetached(parent, slot_id);
9959
9962 }
9963
9965 {
9966 int idx;
9969
9970 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9971 if (inventory_slots.Count() < 1)
9972 {
9973 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9974 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9975 }
9976 else
9977 {
9978 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9979 }
9980
9981 idx = inventory_slots.Find(slot);
9982 if (idx < 0)
9983 return "";
9984
9985 return attach_types.Get(idx);
9986 }
9987
9989 {
9990 int idx = -1;
9991 string slot;
9992
9995
9996 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9997 if (inventory_slots.Count() < 1)
9998 {
9999 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10000 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10001 }
10002 else
10003 {
10004 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10005 if (detach_types.Count() < 1)
10006 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10007 }
10008
10009 for (int i = 0; i < inventory_slots.Count(); i++)
10010 {
10011 slot = inventory_slots.Get(i);
10012 }
10013
10014 if (slot != "")
10015 {
10016 if (detach_types.Count() == 1)
10017 idx = 0;
10018 else
10019 idx = inventory_slots.Find(slot);
10020 }
10021 if (idx < 0)
10022 return "";
10023
10024 return detach_types.Get(idx);
10025 }
10026
10028 {
10029
10031
10032
10033 float min_time = 1;
10034 float max_time = 3;
10035 float delay = Math.RandomFloat(min_time, max_time);
10036
10037 explode_timer.Run(delay, this, "DoAmmoExplosion");
10038 }
10039
10041 {
10042 Magazine magazine = Magazine.Cast(this);
10043 int pop_sounds_count = 6;
10044 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10045
10046
10047 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10048 string sound_name = pop_sounds[ sound_idx ];
10050
10051
10052 magazine.ServerAddAmmoCount(-1);
10053
10054
10055 float min_temp_to_explode = 100;
10056
10057 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10058 {
10060 }
10061 }
10062
10063
10064 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10065 {
10066 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10067
10068 const int CHANCE_DAMAGE_CARGO = 4;
10069 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10070 const int CHANCE_DAMAGE_NOTHING = 2;
10071
10073 {
10074 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10075 int chances;
10076 int rnd;
10077
10078 if (GetInventory().GetCargo())
10079 {
10080 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10081 rnd = Math.RandomInt(0,chances);
10082
10083 if (rnd < CHANCE_DAMAGE_CARGO)
10084 {
10086 }
10087 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10088 {
10090 }
10091 }
10092 else
10093 {
10094 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10095 rnd = Math.RandomInt(0,chances);
10096
10097 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10098 {
10100 }
10101 }
10102 }
10103 }
10104
10106 {
10107 if (GetInventory().GetCargo())
10108 {
10109 int item_count = GetInventory().GetCargo().GetItemCount();
10110 if (item_count > 0)
10111 {
10112 int random_pick = Math.RandomInt(0, item_count);
10114 if (!item.IsExplosive())
10115 {
10116 item.AddHealth("","",damage);
10117 return true;
10118 }
10119 }
10120 }
10121 return false;
10122 }
10123
10125 {
10126 int attachment_count = GetInventory().AttachmentCount();
10127 if (attachment_count > 0)
10128 {
10129 int random_pick = Math.RandomInt(0, attachment_count);
10130 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10131 if (!attachment.IsExplosive())
10132 {
10133 attachment.AddHealth("","",damage);
10134 return true;
10135 }
10136 }
10137 return false;
10138 }
10139
10141 {
10143 }
10144
10146 {
10148 return GetInventory().CanRemoveEntity();
10149
10150 return false;
10151 }
10152
10154 {
10156 return;
10157
10159 {
10160 if (ScriptInputUserData.CanStoreInputUserData())
10161 {
10162 ScriptInputUserData ctx = new ScriptInputUserData;
10167 ctx.
Write(destination_entity);
10169 ctx.
Write(slot_id);
10171 }
10172 }
10173 else if (!
GetGame().IsMultiplayer())
10174 {
10176 }
10177 }
10178
10180 {
10182 return;
10183
10184 float split_quantity_new;
10188 InventoryLocation loc = new InventoryLocation;
10189
10190 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10191 {
10193 split_quantity_new = stack_max;
10194 else
10196
10197 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10198 if (new_item)
10199 {
10200 new_item.SetResultOfSplit(true);
10201 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10203 new_item.SetQuantity(split_quantity_new);
10204 }
10205 }
10206 else if (destination_entity && slot_id == -1)
10207 {
10208 if (quantity > stack_max)
10209 split_quantity_new = stack_max;
10210 else
10211 split_quantity_new = quantity;
10212
10214 {
10217 }
10218
10219 if (new_item)
10220 {
10221 new_item.SetResultOfSplit(true);
10222 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10224 new_item.SetQuantity(split_quantity_new);
10225 }
10226 }
10227 else
10228 {
10229 if (stack_max != 0)
10230 {
10232 {
10234 }
10235
10236 if (split_quantity_new == 0)
10237 {
10238 if (!
GetGame().IsMultiplayer())
10239 player.PhysicalPredictiveDropItem(this);
10240 else
10241 player.ServerDropEntity(this);
10242 return;
10243 }
10244
10246
10247 if (new_item)
10248 {
10249 new_item.SetResultOfSplit(true);
10250 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10252 new_item.SetQuantity(stack_max);
10253 new_item.PlaceOnSurface();
10254 }
10255 }
10256 }
10257 }
10258
10260 {
10262 return;
10263
10264 float split_quantity_new;
10268 InventoryLocation loc = new InventoryLocation;
10269
10270 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10271 {
10273 split_quantity_new = stack_max;
10274 else
10276
10277 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10278 if (new_item)
10279 {
10280 new_item.SetResultOfSplit(true);
10281 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10283 new_item.SetQuantity(split_quantity_new);
10284 }
10285 }
10286 else if (destination_entity && slot_id == -1)
10287 {
10288 if (quantity > stack_max)
10289 split_quantity_new = stack_max;
10290 else
10291 split_quantity_new = quantity;
10292
10294 {
10297 }
10298
10299 if (new_item)
10300 {
10301 new_item.SetResultOfSplit(true);
10302 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10304 new_item.SetQuantity(split_quantity_new);
10305 }
10306 }
10307 else
10308 {
10309 if (stack_max != 0)
10310 {
10312 {
10314 }
10315
10317
10318 if (new_item)
10319 {
10320 new_item.SetResultOfSplit(true);
10321 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10323 new_item.SetQuantity(stack_max);
10324 new_item.PlaceOnSurface();
10325 }
10326 }
10327 }
10328 }
10329
10331 {
10333 return;
10334
10336 {
10337 if (ScriptInputUserData.CanStoreInputUserData())
10338 {
10339 ScriptInputUserData ctx = new ScriptInputUserData;
10344 dst.WriteToContext(ctx);
10346 }
10347 }
10348 else if (!
GetGame().IsMultiplayer())
10349 {
10351 }
10352 }
10353
10355 {
10357 return;
10358
10360 {
10361 if (ScriptInputUserData.CanStoreInputUserData())
10362 {
10363 ScriptInputUserData ctx = new ScriptInputUserData;
10368 ctx.
Write(destination_entity);
10374 }
10375 }
10376 else if (!
GetGame().IsMultiplayer())
10377 {
10379 }
10380 }
10381
10383 {
10385 }
10386
10388 {
10390 return this;
10391
10393 float split_quantity_new;
10395 if (dst.IsValid())
10396 {
10397 int slot_id = dst.GetSlot();
10399
10400 if (quantity > stack_max)
10401 split_quantity_new = stack_max;
10402 else
10403 split_quantity_new = quantity;
10404
10406
10407 if (new_item)
10408 {
10409 new_item.SetResultOfSplit(true);
10410 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10413 }
10414
10415 return new_item;
10416 }
10417
10418 return null;
10419 }
10420
10422 {
10424 return;
10425
10427 float split_quantity_new;
10429 if (destination_entity)
10430 {
10432 if (quantity > stackable)
10433 split_quantity_new = stackable;
10434 else
10435 split_quantity_new = quantity;
10436
10437 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10438 if (new_item)
10439 {
10440 new_item.SetResultOfSplit(true);
10441 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10443 new_item.SetQuantity(split_quantity_new);
10444 }
10445 }
10446 }
10447
10449 {
10451 return;
10452
10454 {
10455 if (ScriptInputUserData.CanStoreInputUserData())
10456 {
10457 ScriptInputUserData ctx = new ScriptInputUserData;
10462 ItemBase destination_entity =
this;
10463 ctx.
Write(destination_entity);
10467 }
10468 }
10469 else if (!
GetGame().IsMultiplayer())
10470 {
10472 }
10473 }
10474
10476 {
10478 return;
10479
10481 float split_quantity_new;
10483 if (player)
10484 {
10486 if (quantity > stackable)
10487 split_quantity_new = stackable;
10488 else
10489 split_quantity_new = quantity;
10490
10491 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10492 new_item =
ItemBase.Cast(in_hands);
10493 if (new_item)
10494 {
10495 new_item.SetResultOfSplit(true);
10496 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10498 new_item.SetQuantity(split_quantity_new);
10499 }
10500 }
10501 }
10502
10504 {
10506 return;
10507
10509 float split_quantity_new = Math.Floor(quantity * 0.5);
10510
10512
10513 if (new_item)
10514 {
10515 if (new_item.GetQuantityMax() < split_quantity_new)
10516 {
10517 split_quantity_new = new_item.GetQuantityMax();
10518 }
10519
10520 new_item.SetResultOfSplit(true);
10521 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10522
10524 {
10527 }
10528 else
10529 {
10532 }
10533 }
10534 }
10535
10537 {
10539 return;
10540
10542 float split_quantity_new = Math.Floor(quantity / 2);
10543
10544 InventoryLocation invloc = new InventoryLocation;
10546
10548 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10549
10550 if (new_item)
10551 {
10552 if (new_item.GetQuantityMax() < split_quantity_new)
10553 {
10554 split_quantity_new = new_item.GetQuantityMax();
10555 }
10557 {
10560 }
10561 else
10562 {
10565 }
10566 }
10567 }
10568
10571 {
10572 SetWeightDirty();
10574
10575 if (parent)
10576 parent.OnAttachmentQuantityChangedEx(this, delta);
10577
10579 {
10581 {
10583 }
10585 {
10586 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10588 }
10589 }
10590
10591 }
10592
10595 {
10596
10597 }
10598
10601 {
10603 }
10604
10606 {
10607 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10608
10610 {
10611 if (newLevel == GameConstants.STATE_RUINED)
10612 {
10614 EntityAI parent = GetHierarchyParent();
10615 if (parent && parent.IsFireplace())
10616 {
10617 CargoBase cargo = GetInventory().GetCargo();
10618 if (cargo)
10619 {
10621 {
10623 }
10624 }
10625 }
10626 }
10627
10629 {
10630
10632 return;
10633 }
10634
10635 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10636 {
10638 }
10639 }
10640 }
10641
10642
10644 {
10645 super.OnRightClick();
10646
10648 {
10650 {
10651 if (ScriptInputUserData.CanStoreInputUserData())
10652 {
10653 vector m4[4];
10655
10656 EntityAI root = GetHierarchyRoot();
10657
10658 InventoryLocation dst = new InventoryLocation;
10660 {
10661 if (root)
10662 {
10663 root.GetTransform(m4);
10665 }
10666 else
10667 GetInventory().GetCurrentInventoryLocation(dst);
10668 }
10669 else
10670 {
10672
10673
10674 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10675 {
10676 if (root)
10677 {
10678 root.GetTransform(m4);
10680 }
10681 else
10682 GetInventory().GetCurrentInventoryLocation(dst);
10683 }
10684 else
10685 {
10686 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10687 }
10688 }
10689
10690 ScriptInputUserData ctx = new ScriptInputUserData;
10698 }
10699 }
10700 else if (!
GetGame().IsMultiplayer())
10701 {
10703 }
10704 }
10705 }
10706
10707 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10708 {
10709
10710 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10711 return false;
10712
10713 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10714 return false;
10715
10716
10718 return false;
10719
10720
10721 Magazine mag = Magazine.Cast(this);
10722 if (mag)
10723 {
10724 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10725 return false;
10726
10727 if (stack_max_limit)
10728 {
10729 Magazine other_mag = Magazine.Cast(other_item);
10730 if (other_item)
10731 {
10732 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10733 return false;
10734 }
10735
10736 }
10737 }
10738 else
10739 {
10740
10742 return false;
10743
10745 return false;
10746 }
10747
10748 PlayerBase player = null;
10749 if (CastTo(player, GetHierarchyRootPlayer()))
10750 {
10751 if (player.GetInventory().HasAttachment(this))
10752 return false;
10753
10754 if (player.IsItemsToDelete())
10755 return false;
10756 }
10757
10758 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10759 return false;
10760
10761 int slotID;
10763 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10764 return false;
10765
10766 return true;
10767 }
10768
10770 {
10772 }
10773
10775 {
10776 return m_IsResultOfSplit;
10777 }
10778
10780 {
10781 m_IsResultOfSplit = value;
10782 }
10783
10785 {
10787 }
10788
10790 {
10791 float other_item_quantity = other_item.GetQuantity();
10792 float this_free_space;
10793
10795
10797
10798 if (other_item_quantity > this_free_space)
10799 {
10800 return this_free_space;
10801 }
10802 else
10803 {
10804 return other_item_quantity;
10805 }
10806 }
10807
10809 {
10811 }
10812
10814 {
10816 return;
10817
10818 if (!IsMagazine() && other_item)
10819 {
10821 if (quantity_used != 0)
10822 {
10823 float hp1 = GetHealth01("","");
10824 float hp2 = other_item.GetHealth01("","");
10825 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10826 hpResult = hpResult / (
GetQuantity() + quantity_used);
10827
10828 hpResult *= GetMaxHealth();
10829 Math.Round(hpResult);
10830 SetHealth("", "Health", hpResult);
10831
10833 other_item.AddQuantity(-quantity_used);
10834 }
10835 }
10837 }
10838
10840 {
10841 #ifdef SERVER
10842 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10843 GetHierarchyParent().IncreaseLifetimeUp();
10844 #endif
10845 };
10846
10848 {
10849 PlayerBase p = PlayerBase.Cast(player);
10850
10851 array<int> recipesIds = p.m_Recipes;
10852 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10853 if (moduleRecipesManager)
10854 {
10855 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10856 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10857 }
10858
10859 for (int i = 0;i < recipesIds.Count(); i++)
10860 {
10861 int key = recipesIds.Get(i);
10862 string recipeName = moduleRecipesManager.GetRecipeName(key);
10864 }
10865 }
10866
10867
10868 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10869 {
10870 super.GetDebugActions(outputList);
10871
10872
10877
10878
10882
10886
10887
10890
10891
10893 {
10896 }
10897
10899
10902
10906 }
10907
10908
10909
10910
10912 {
10913 super.OnAction(action_id, player, ctx);
10914 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10915 {
10916 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10917 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10918 PlayerBase p = PlayerBase.Cast(player);
10919 if (
EActions.RECIPES_RANGE_START < 1000)
10920 {
10921 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10922 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10923 }
10924 }
10925 #ifndef SERVER
10926 else if (action_id ==
EActions.WATCH_PLAYER)
10927 {
10928 PluginDeveloper.SetDeveloperItemClientEx(player);
10929 }
10930 #endif
10932 {
10933 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10934 {
10935 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10936 OnDebugButtonPressServer(id + 1);
10937 }
10938
10939 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10940 {
10941 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10943 }
10944
10945 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10946 {
10947 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10949 }
10950
10951 else if (action_id ==
EActions.ADD_QUANTITY)
10952 {
10953 if (IsMagazine())
10954 {
10955 Magazine mag = Magazine.Cast(this);
10956 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10957 }
10958 else
10959 {
10961 }
10962
10963 if (m_EM)
10964 {
10965 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10966 }
10967
10968 }
10969
10970 else if (action_id ==
EActions.REMOVE_QUANTITY)
10971 {
10972 if (IsMagazine())
10973 {
10974 Magazine mag2 = Magazine.Cast(this);
10975 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10976 }
10977 else
10978 {
10980 }
10981 if (m_EM)
10982 {
10983 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10984 }
10985
10986 }
10987
10988 else if (action_id ==
EActions.SET_QUANTITY_0)
10989 {
10991
10992 if (m_EM)
10993 {
10994 m_EM.SetEnergy(0);
10995 }
10996 }
10997
10998 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10999 {
11001
11002 if (m_EM)
11003 {
11004 m_EM.SetEnergy(m_EM.GetEnergyMax());
11005 }
11006 }
11007
11008 else if (action_id ==
EActions.ADD_HEALTH)
11009 {
11010 AddHealth("","",GetMaxHealth("","Health")/5);
11011 }
11012 else if (action_id ==
EActions.REMOVE_HEALTH)
11013 {
11014 AddHealth("","",-GetMaxHealth("","Health")/5);
11015 }
11016 else if (action_id ==
EActions.DESTROY_HEALTH)
11017 {
11018 SetHealth01("","",0);
11019 }
11020 else if (action_id ==
EActions.WATCH_ITEM)
11021 {
11023 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11024 #ifdef DEVELOPER
11025 SetDebugDeveloper_item(this);
11026 #endif
11027 }
11028
11029 else if (action_id ==
EActions.ADD_TEMPERATURE)
11030 {
11031 AddTemperature(20);
11032
11033 }
11034
11035 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11036 {
11037 AddTemperature(-20);
11038
11039 }
11040
11041 else if (action_id ==
EActions.FLIP_FROZEN)
11042 {
11043 SetFrozen(!GetIsFrozen());
11044
11045 }
11046
11047 else if (action_id ==
EActions.ADD_WETNESS)
11048 {
11050
11051 }
11052
11053 else if (action_id ==
EActions.REMOVE_WETNESS)
11054 {
11056
11057 }
11058
11059 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11060 {
11063
11064
11065 }
11066
11067 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11068 {
11071 }
11072
11073 else if (action_id ==
EActions.MAKE_SPECIAL)
11074 {
11075 auto debugParams = DebugSpawnParams.WithPlayer(player);
11076 OnDebugSpawnEx(debugParams);
11077 }
11078
11079 else if (action_id ==
EActions.DELETE)
11080 {
11081 Delete();
11082 }
11083
11084 }
11085
11086
11087 return false;
11088 }
11089
11090
11091
11092
11096
11099
11100
11101
11103 {
11104 return false;
11105 }
11106
11107
11109 {
11110 return true;
11111 }
11112
11113
11115 {
11116 return true;
11117 }
11118
11119
11120
11122 {
11123 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11125 }
11126
11129 {
11130 return null;
11131 }
11132
11134 {
11135 return false;
11136 }
11137
11139 {
11140 return false;
11141 }
11142
11146
11147
11149 {
11150 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11151 return module_repairing.CanRepair(this, item_repair_kit);
11152 }
11153
11154
11155 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11156 {
11157 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11158 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11159 }
11160
11161
11163 {
11164
11165
11166
11167
11168
11169
11170
11171
11172 return 1;
11173 }
11174
11175
11176
11178 {
11180 }
11181
11182
11183
11185 {
11187 }
11188
11189
11198 {
11199 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11200
11201 if (player)
11202 {
11203 player.MessageStatus(text);
11204 }
11205 }
11206
11207
11216 {
11217 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11218
11219 if (player)
11220 {
11221 player.MessageAction(text);
11222 }
11223 }
11224
11225
11234 {
11235 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11236
11237 if (player)
11238 {
11239 player.MessageFriendly(text);
11240 }
11241 }
11242
11243
11252 {
11253 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11254
11255 if (player)
11256 {
11257 player.MessageImportant(text);
11258 }
11259 }
11260
11262 {
11263 return true;
11264 }
11265
11266
11267 override bool KindOf(
string tag)
11268 {
11269 bool found = false;
11270 string item_name = this.
GetType();
11273
11274 int array_size = item_tag_array.Count();
11275 for (int i = 0; i < array_size; i++)
11276 {
11277 if (item_tag_array.Get(i) == tag)
11278 {
11279 found = true;
11280 break;
11281 }
11282 }
11283 return found;
11284 }
11285
11286
11288 {
11289
11290 super.OnRPC(sender, rpc_type,ctx);
11291
11292
11293 switch (rpc_type)
11294 {
11295 #ifndef SERVER
11296 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11297 Param2<bool, string> p = new Param2<bool, string>(false, "");
11298
11300 return;
11301
11302 bool play = p.param1;
11303 string soundSet = p.param2;
11304
11305 if (play)
11306 {
11308 {
11310 {
11312 }
11313 }
11314 else
11315 {
11317 }
11318 }
11319 else
11320 {
11322 }
11323
11324 break;
11325 #endif
11326
11327 }
11328
11330 {
11332 }
11333 }
11334
11335
11336
11337
11339 {
11340 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11341 return plugin.GetID(
name);
11342 }
11343
11345 {
11346 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11347 return plugin.GetName(id);
11348 }
11349
11352 {
11353
11354
11355 int varFlags;
11356 if (!ctx.
Read(varFlags))
11357 return;
11358
11359 if (varFlags & ItemVariableFlags.FLOAT)
11360 {
11362 }
11363 }
11364
11366 {
11367
11368 super.SerializeNumericalVars(floats_out);
11369
11370
11371
11373 {
11375 }
11376
11378 {
11380 }
11381
11383 {
11385 }
11386
11388 {
11393 }
11394
11396 {
11398 }
11399 }
11400
11402 {
11403
11404 super.DeSerializeNumericalVars(floats);
11405
11406
11407 int index = 0;
11408 int mask = Math.Round(floats.Get(index));
11409
11410 index++;
11411
11413 {
11415 {
11417 }
11418 else
11419 {
11420 float quantity = floats.Get(index);
11421 SetQuantity(quantity,
true,
false,
false,
false);
11422 }
11423 index++;
11424 }
11425
11427 {
11428 float wet = floats.Get(index);
11430 index++;
11431 }
11432
11434 {
11435 int liquidtype = Math.Round(floats.Get(index));
11437 index++;
11438 }
11439
11441 {
11443 index++;
11445 index++;
11447 index++;
11449 index++;
11450 }
11451
11453 {
11454 int cleanness = Math.Round(floats.Get(index));
11456 index++;
11457 }
11458 }
11459
11461 {
11462 super.WriteVarsToCTX(ctx);
11463
11464
11466 {
11468 }
11469
11471 {
11473 }
11474
11476 {
11478 }
11479
11481 {
11482 int r,g,b,a;
11488 }
11489
11491 {
11493 }
11494 }
11495
11497 {
11498 if (!super.ReadVarsFromCTX(ctx,version))
11499 return false;
11500
11501 int intValue;
11502 float value;
11503
11504 if (version < 140)
11505 {
11506 if (!ctx.
Read(intValue))
11507 return false;
11508
11509 m_VariablesMask = intValue;
11510 }
11511
11513 {
11514 if (!ctx.
Read(value))
11515 return false;
11516
11518 {
11520 }
11521 else
11522 {
11524 }
11525 }
11526
11527 if (version < 140)
11528 {
11530 {
11531 if (!ctx.
Read(value))
11532 return false;
11533 SetTemperatureDirect(value);
11534 }
11535 }
11536
11538 {
11539 if (!ctx.
Read(value))
11540 return false;
11542 }
11543
11545 {
11546 if (!ctx.
Read(intValue))
11547 return false;
11549 }
11550
11552 {
11553 int r,g,b,a;
11555 return false;
11557 return false;
11559 return false;
11561 return false;
11562
11564 }
11565
11567 {
11568 if (!ctx.
Read(intValue))
11569 return false;
11571 }
11572
11573 if (version >= 138 && version < 140)
11574 {
11576 {
11577 if (!ctx.
Read(intValue))
11578 return false;
11579 SetFrozen(intValue);
11580 }
11581 }
11582
11583 return true;
11584 }
11585
11586
11588 {
11591 {
11593 }
11594
11595 if (!super.OnStoreLoad(ctx, version))
11596 {
11598 return false;
11599 }
11600
11601 if (version >= 114)
11602 {
11603 bool hasQuickBarIndexSaved;
11604
11605 if (!ctx.
Read(hasQuickBarIndexSaved))
11606 {
11608 return false;
11609 }
11610
11611 if (hasQuickBarIndexSaved)
11612 {
11613 int itmQBIndex;
11614
11615
11616 if (!ctx.
Read(itmQBIndex))
11617 {
11619 return false;
11620 }
11621
11622 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11623 if (itmQBIndex != -1 && parentPlayer)
11624 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11625 }
11626 }
11627 else
11628 {
11629
11630 PlayerBase player;
11631 int itemQBIndex;
11632 if (version ==
int.
MAX)
11633 {
11634 if (!ctx.
Read(itemQBIndex))
11635 {
11637 return false;
11638 }
11639 }
11640 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11641 {
11642
11643 if (!ctx.
Read(itemQBIndex))
11644 {
11646 return false;
11647 }
11648 if (itemQBIndex != -1 && player)
11649 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11650 }
11651 }
11652
11653 if (version < 140)
11654 {
11655
11656 if (!LoadVariables(ctx, version))
11657 {
11659 return false;
11660 }
11661 }
11662
11663
11665 {
11667 return false;
11668 }
11669 if (version >= 132)
11670 {
11672 if (raib)
11673 {
11675 {
11677 return false;
11678 }
11679 }
11680 }
11681
11683 return true;
11684 }
11685
11686
11687
11689 {
11690 super.OnStoreSave(ctx);
11691
11692 PlayerBase player;
11693 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11694 {
11696
11697 int itemQBIndex = -1;
11698 itemQBIndex = player.FindQuickBarEntityIndex(this);
11699 ctx.
Write(itemQBIndex);
11700 }
11701 else
11702 {
11704 }
11705
11707
11709 if (raib)
11710 {
11712 }
11713 }
11714
11715
11717 {
11718 super.AfterStoreLoad();
11719
11721 {
11723 }
11724
11726 {
11729 }
11730 }
11731
11733 {
11734 super.EEOnAfterLoad();
11735
11737 {
11739 }
11740
11743 }
11744
11746 {
11747 return false;
11748 }
11749
11750
11751
11753 {
11755 {
11756 #ifdef PLATFORM_CONSOLE
11757
11759 {
11761 if (menu)
11762 {
11764 }
11765 }
11766 #endif
11767 }
11768
11770 {
11773 }
11774
11776 {
11777 SetWeightDirty();
11779 }
11781 {
11784 }
11785
11787 {
11790 }
11792 {
11795 }
11796
11797 super.OnVariablesSynchronized();
11798 }
11799
11800
11801
11803 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11804 {
11805 if (!IsServerCheck(allow_client))
11806 return false;
11807
11809 return false;
11810
11813
11814 if (value <= (min + 0.001))
11815 value = min;
11816
11817 if (value == min)
11818 {
11819 if (destroy_config)
11820 {
11821 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11822 if (dstr)
11823 {
11825 this.Delete();
11826 return true;
11827 }
11828 }
11829 else if (destroy_forced)
11830 {
11832 this.Delete();
11833 return true;
11834 }
11835
11837 }
11838
11841
11843 {
11845
11846 if (delta)
11848 }
11849
11851
11852 return false;
11853 }
11854
11855
11857 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11858 {
11860 }
11861
11863 {
11866 }
11867
11869 {
11872 }
11873
11876 {
11877 float value_clamped = Math.Clamp(value, 0, 1);
11879 SetQuantity(result, destroy_config, destroy_forced);
11880 }
11881
11882
11885 {
11887 }
11888
11890 {
11892 }
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11904 {
11905 int slot = -1;
11906 if (GetInventory())
11907 {
11908 InventoryLocation il = new InventoryLocation;
11909 GetInventory().GetCurrentInventoryLocation(il);
11911 }
11912
11914 }
11915
11917 {
11918 float quantity_max = 0;
11919
11921 {
11922 if (attSlotID != -1)
11923 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11924
11925 if (quantity_max <= 0)
11927 }
11928
11929 if (quantity_max <= 0)
11931
11932 return quantity_max;
11933 }
11934
11936 {
11938 }
11939
11941 {
11943 }
11944
11945
11947 {
11949 }
11950
11952 {
11954 }
11955
11957 {
11959 }
11960
11961
11963 {
11964
11965 float weightEx = GetWeightEx();
11966 float special = GetInventoryAndCargoWeight();
11967 return weightEx - special;
11968 }
11969
11970
11972 {
11974 }
11975
11977 {
11979 {
11980 #ifdef DEVELOPER
11981 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11982 {
11983 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11985 }
11986 #endif
11987
11988 return GetQuantity() * GetConfigWeightModified();
11989 }
11990 else if (HasEnergyManager())
11991 {
11992 #ifdef DEVELOPER
11993 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11994 {
11995 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11996 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11997 }
11998 #endif
11999 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12000 }
12001 else
12002 {
12003 #ifdef DEVELOPER
12004 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12005 {
12006 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12007 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12008 }
12009 #endif
12010 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12011 }
12012 }
12013
12016 {
12017 int item_count = 0;
12019
12020 if (GetInventory().GetCargo() != NULL)
12021 {
12022 item_count = GetInventory().GetCargo().GetItemCount();
12023 }
12024
12025 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12026 {
12027 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12028 if (item)
12029 item_count += item.GetNumberOfItems();
12030 }
12031 return item_count;
12032 }
12033
12036 {
12037 float weight = 0;
12038 float wetness = 1;
12039 if (include_wetness)
12042 {
12043 weight = wetness * m_ConfigWeight;
12044 }
12046 {
12047 weight = 1;
12048 }
12049 return weight;
12050 }
12051
12052
12053
12055 {
12056 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12057 {
12058 GameInventory inv = GetInventory();
12059 array<EntityAI> items = new array<EntityAI>;
12061 for (int i = 0; i < items.Count(); i++)
12062 {
12064 if (item)
12065 {
12067 }
12068 }
12069 }
12070 }
12071
12072
12073
12074
12076 {
12077 float energy = 0;
12078 if (HasEnergyManager())
12079 {
12080 energy = GetCompEM().GetEnergy();
12081 }
12082 return energy;
12083 }
12084
12085
12087 {
12088 super.OnEnergyConsumed();
12089
12091 }
12092
12094 {
12095 super.OnEnergyAdded();
12096
12098 }
12099
12100
12102 {
12103 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12104 {
12106 {
12107 float energy_0to1 = GetCompEM().GetEnergy0To1();
12109 }
12110 }
12111 }
12112
12113
12115 {
12116 return ConfigGetFloat("heatIsolation");
12117 }
12118
12120 {
12122 }
12123
12125 {
12126 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12127 if (
GetGame().ConfigIsExisting(paramPath))
12129
12130 return 0.0;
12131 }
12132
12134 {
12135 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12136 if (
GetGame().ConfigIsExisting(paramPath))
12138
12139 return 0.0;
12140 }
12141
12142 override void SetWet(
float value,
bool allow_client =
false)
12143 {
12144 if (!IsServerCheck(allow_client))
12145 return;
12146
12149
12151
12152 m_VarWet = Math.Clamp(value, min, max);
12153
12155 {
12158 }
12159 }
12160
12161 override void AddWet(
float value)
12162 {
12164 }
12165
12167 {
12169 }
12170
12172 {
12174 }
12175
12177 {
12179 }
12180
12182 {
12184 }
12185
12187 {
12189 }
12190
12191 override void OnWetChanged(
float newVal,
float oldVal)
12192 {
12195 if (newLevel != oldLevel)
12196 {
12198 }
12199 }
12200
12202 {
12203 SetWeightDirty();
12204 }
12205
12207 {
12208 return GetWetLevelInternal(
m_VarWet);
12209 }
12210
12211
12212
12214 {
12216 }
12217
12219 {
12221 }
12222
12224 {
12226 }
12227
12229 {
12231 }
12232
12233
12234
12236 {
12237 if (ConfigIsExisting("itemModelLength"))
12238 {
12239 return ConfigGetFloat("itemModelLength");
12240 }
12241 return 0;
12242 }
12243
12245 {
12246 if (ConfigIsExisting("itemAttachOffset"))
12247 {
12248 return ConfigGetFloat("itemAttachOffset");
12249 }
12250 return 0;
12251 }
12252
12253 override void SetCleanness(
int value,
bool allow_client =
false)
12254 {
12255 if (!IsServerCheck(allow_client))
12256 return;
12257
12259
12261
12264 }
12265
12267 {
12269 }
12270
12272 {
12273 return true;
12274 }
12275
12276
12277
12278
12280 {
12282 }
12283
12285 {
12287 }
12288
12289
12290
12291
12292 override void SetColor(
int r,
int g,
int b,
int a)
12293 {
12299 }
12301 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12302 {
12307 }
12308
12310 {
12312 }
12313
12316 {
12317 int r,g,b,a;
12319 r = r/255;
12320 g = g/255;
12321 b = b/255;
12322 a = a/255;
12323 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12324 }
12325
12326
12327
12328 override void SetLiquidType(
int value,
bool allow_client =
false)
12329 {
12330 if (!IsServerCheck(allow_client))
12331 return;
12332
12337 }
12338
12340 {
12341 return ConfigGetInt("varLiquidTypeInit");
12342 }
12343
12345 {
12347 }
12348
12350 {
12352 SetFrozen(false);
12353 }
12354
12357 {
12358 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12359 }
12360
12361
12364 {
12365 PlayerBase nplayer;
12366 if (PlayerBase.CastTo(nplayer, player))
12367 {
12369
12370 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12371 }
12372 }
12373
12374
12377 {
12378 PlayerBase nplayer;
12379 if (PlayerBase.CastTo(nplayer,player))
12380 {
12381
12382 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12383
12384 }
12385
12386
12387 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12388
12389
12390 if (HasEnergyManager())
12391 {
12392 GetCompEM().UpdatePlugState();
12393 }
12394 }
12395
12396
12398 {
12399 super.OnPlacementStarted(player);
12400
12402 }
12403
12404 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12405 {
12407 {
12408 m_AdminLog.OnPlacementComplete(player,
this);
12409 }
12410
12411 super.OnPlacementComplete(player, position, orientation);
12412 }
12413
12414
12415
12416
12417
12419 {
12421 {
12422 return true;
12423 }
12424 else
12425 {
12426 return false;
12427 }
12428 }
12429
12430
12432 {
12434 {
12436 }
12437 }
12438
12439
12441 {
12443 }
12444
12446 {
12448 }
12449
12450 override void InsertAgent(
int agent,
float count = 1)
12451 {
12452 if (count < 1)
12453 return;
12454
12456 }
12457
12460 {
12462 }
12463
12464
12466 {
12468 }
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12512 {
12514 return false;
12515 return true;
12516 }
12517
12519 {
12520
12522 }
12523
12524
12527 {
12528 super.CheckForRoofLimited(timeTresholdMS);
12529
12531 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12532 {
12533 m_PreviousRoofTestTime = time;
12534 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12535 }
12536 }
12537
12538
12540 {
12542 {
12543 return 0;
12544 }
12545
12546 if (GetInventory().GetAttachmentSlotsCount() != 0)
12547 {
12548 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12549 if (filter)
12550 return filter.GetProtectionLevel(type, false, system);
12551 else
12552 return 0;
12553 }
12554
12555 string subclassPath, entryName;
12556
12557 switch (type)
12558 {
12560 entryName = "biological";
12561 break;
12563 entryName = "chemical";
12564 break;
12565 default:
12566 entryName = "biological";
12567 break;
12568 }
12569
12570 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12571
12573 }
12574
12575
12576
12579 {
12580 if (!IsMagazine())
12582
12584 }
12585
12586
12587
12588
12589
12594 {
12595 return true;
12596 }
12597
12599 {
12601 }
12602
12603
12604
12605
12606
12608 {
12609 if (parent)
12610 {
12611 if (parent.IsInherited(DayZInfected))
12612 return true;
12613
12614 if (!parent.IsRuined())
12615 return true;
12616 }
12617
12618 return true;
12619 }
12620
12622 {
12623 if (!super.CanPutAsAttachment(parent))
12624 {
12625 return false;
12626 }
12627
12628 if (!IsRuined() && !parent.IsRuined())
12629 {
12630 return true;
12631 }
12632
12633 return false;
12634 }
12635
12637 {
12638
12639
12640
12641
12642 return super.CanReceiveItemIntoCargo(item);
12643 }
12644
12646 {
12647
12648
12649
12650
12651 GameInventory attachmentInv = attachment.GetInventory();
12653 {
12654 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12655 return false;
12656 }
12657
12658 InventoryLocation loc = new InventoryLocation();
12659 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12660 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12661 return false;
12662
12663 return super.CanReceiveAttachment(attachment, slotId);
12664 }
12665
12667 {
12668 if (!super.CanReleaseAttachment(attachment))
12669 return false;
12670
12671 return GetInventory().AreChildrenAccessible();
12672 }
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12695 {
12696 int id = muzzle_owner.GetMuzzleID();
12697 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12698
12699 if (WPOF_array)
12700 {
12701 for (int i = 0; i < WPOF_array.Count(); i++)
12702 {
12703 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12704
12705 if (WPOF)
12706 {
12707 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12708 }
12709 }
12710 }
12711 }
12712
12713
12715 {
12716 int id = muzzle_owner.GetMuzzleID();
12718
12719 if (WPOBE_array)
12720 {
12721 for (int i = 0; i < WPOBE_array.Count(); i++)
12722 {
12723 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12724
12725 if (WPOBE)
12726 {
12727 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12728 }
12729 }
12730 }
12731 }
12732
12733
12735 {
12736 int id = muzzle_owner.GetMuzzleID();
12737 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12738
12739 if (WPOOH_array)
12740 {
12741 for (int i = 0; i < WPOOH_array.Count(); i++)
12742 {
12743 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12744
12745 if (WPOOH)
12746 {
12747 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12748 }
12749 }
12750 }
12751 }
12752
12753
12755 {
12756 int id = muzzle_owner.GetMuzzleID();
12757 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12758
12759 if (WPOOH_array)
12760 {
12761 for (int i = 0; i < WPOOH_array.Count(); i++)
12762 {
12763 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12764
12765 if (WPOOH)
12766 {
12767 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12768 }
12769 }
12770 }
12771 }
12772
12773
12775 {
12776 int id = muzzle_owner.GetMuzzleID();
12777 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12778
12779 if (WPOOH_array)
12780 {
12781 for (int i = 0; i < WPOOH_array.Count(); i++)
12782 {
12783 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12784
12785 if (WPOOH)
12786 {
12787 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12788 }
12789 }
12790 }
12791 }
12792
12793
12794
12796 {
12798 {
12799 return true;
12800 }
12801
12802 return false;
12803 }
12804
12806 {
12808 {
12809 return true;
12810 }
12811
12812 return false;
12813 }
12814
12816 {
12818 {
12819 return true;
12820 }
12821
12822 return false;
12823 }
12824
12826 {
12827 return false;
12828 }
12829
12832 {
12833 return UATimeSpent.DEFAULT_DEPLOY;
12834 }
12835
12836
12837
12838
12840 {
12842 SetSynchDirty();
12843 }
12844
12846 {
12848 }
12849
12850
12852 {
12853 return false;
12854 }
12855
12858 {
12859 string att_type = "None";
12860
12861 if (ConfigIsExisting("soundAttType"))
12862 {
12863 att_type = ConfigGetString("soundAttType");
12864 }
12865
12867 }
12868
12870 {
12872 }
12873
12874
12875
12876
12877
12881
12883 {
12886
12888 }
12889
12890
12892 {
12894 return;
12895
12897
12900
12903
12904 SoundParameters params = new SoundParameters();
12908 }
12909
12910
12912 {
12914 return;
12915
12917 SetSynchDirty();
12918
12921 }
12922
12923
12925 {
12927 return;
12928
12930 SetSynchDirty();
12931
12934 }
12935
12937 {
12939 }
12940
12942 {
12944 }
12945
12948 {
12949 if (!
GetGame().IsDedicatedServer())
12950 {
12951 if (ConfigIsExisting("attachSoundSet"))
12952 {
12953 string cfg_path = "";
12954 string soundset = "";
12955 string type_name =
GetType();
12956
12959 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12960 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12961
12962 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12963 {
12964 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12965 {
12966 if (cfg_slot_array[i] == slot_type)
12967 {
12968 soundset = cfg_soundset_array[i];
12969 break;
12970 }
12971 }
12972 }
12973
12974 if (soundset != "")
12975 {
12976 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12978 }
12979 }
12980 }
12981 }
12982
12984 {
12985
12986 }
12987
12988 void OnApply(PlayerBase player);
12989
12991 {
12992 return 1.0;
12993 };
12994
12996 {
12998 }
12999
13001 {
13003 }
13004
13006
13008 {
13009 SetDynamicPhysicsLifeTime(0.01);
13011 }
13012
13014 {
13015 array<string> zone_names = new array<string>;
13016 GetDamageZones(zone_names);
13017 for (int i = 0; i < zone_names.Count(); i++)
13018 {
13019 SetHealthMax(zone_names.Get(i),"Health");
13020 }
13021 SetHealthMax("","Health");
13022 }
13023
13026 {
13027 float global_health = GetHealth01("","Health");
13028 array<string> zones = new array<string>;
13029 GetDamageZones(zones);
13030
13031 for (int i = 0; i < zones.Count(); i++)
13032 {
13033 SetHealth01(zones.Get(i),"Health",global_health);
13034 }
13035 }
13036
13039 {
13040 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13041 }
13042
13044 {
13045 if (!hasRootAsPlayer)
13046 {
13047 if (refParentIB)
13048 {
13049
13050 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13051 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13052
13053 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13054 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13055
13058 }
13059 else
13060 {
13061
13064 }
13065 }
13066 }
13067
13069 {
13071 {
13072 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13073 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13074 {
13075 float heatPermCoef = 1.0;
13077 while (ent)
13078 {
13079 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13080 ent = ent.GetHierarchyParent();
13081 }
13082
13083 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13084 }
13085 }
13086 }
13087
13089 {
13090
13091 EntityAI parent = GetHierarchyParent();
13092 if (!parent)
13093 {
13094 hasParent = false;
13095 hasRootAsPlayer = false;
13096 }
13097 else
13098 {
13099 hasParent = true;
13100 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13101 refParentIB =
ItemBase.Cast(parent);
13102 }
13103 }
13104
13105 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13106 {
13107
13108 }
13109
13111 {
13112
13113 return false;
13114 }
13115
13117 {
13118
13119
13120 return false;
13121 }
13122
13124 {
13125
13126 return false;
13127 }
13128
13131 {
13132 return !GetIsFrozen() &&
IsOpen();
13133 }
13134
13136 {
13137 bool hasParent = false, hasRootAsPlayer = false;
13139
13140 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13141 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13142
13143 if (wwtu || foodDecay)
13144 {
13148
13149 if (processWetness || processTemperature || processDecay)
13150 {
13152
13153 if (processWetness)
13154 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13155
13156 if (processTemperature)
13158
13159 if (processDecay)
13160 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13161 }
13162 }
13163 }
13164
13167 {
13169 }
13170
13172 {
13175
13176 return super.GetTemperatureFreezeThreshold();
13177 }
13178
13180 {
13183
13184 return super.GetTemperatureThawThreshold();
13185 }
13186
13188 {
13191
13192 return super.GetItemOverheatThreshold();
13193 }
13194
13196 {
13198 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13199
13200 return super.GetTemperatureFreezeTime();
13201 }
13202
13204 {
13206 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13207
13208 return super.GetTemperatureThawTime();
13209 }
13210
13215
13217 {
13218 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13219 }
13220
13222 {
13223 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13224 }
13225
13228 {
13230 }
13231
13233 {
13235 }
13236
13238 {
13240 }
13241
13244 {
13245 return null;
13246 }
13247
13250 {
13251 return false;
13252 }
13253
13255 {
13257 {
13260 if (!trg)
13261 {
13263 explosive = this;
13264 }
13265
13266 explosive.PairRemote(trg);
13268
13269 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13270 trg.SetPersistentPairID(persistentID);
13271 explosive.SetPersistentPairID(persistentID);
13272
13273 return true;
13274 }
13275 return false;
13276 }
13277
13280 {
13281 float ret = 1.0;
13284 ret *= GetHealth01();
13285
13286 return ret;
13287 }
13288
13289 #ifdef DEVELOPER
13290 override void SetDebugItem()
13291 {
13292 super.SetDebugItem();
13293 _itemBase = this;
13294 }
13295
13297 {
13298 string text = super.GetDebugText();
13299
13301 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13302
13303 return text;
13304 }
13305 #endif
13306
13308 {
13309 return true;
13310 }
13311
13313
13315
13317 {
13320 }
13321
13322
13330
13346}
13347
13349{
13351 if (entity)
13352 {
13353 bool is_item = entity.IsInherited(
ItemBase);
13354 if (is_item && full_quantity)
13355 {
13358 }
13359 }
13360 else
13361 {
13363 return NULL;
13364 }
13365 return entity;
13366}
13367
13369{
13370 if (item)
13371 {
13372 if (health > 0)
13373 item.SetHealth("", "", health);
13374
13375 if (item.CanHaveTemperature())
13376 {
13378 if (item.CanFreeze())
13379 item.SetFrozen(false);
13380 }
13381
13382 if (item.HasEnergyManager())
13383 {
13384 if (quantity >= 0)
13385 {
13386 item.GetCompEM().SetEnergy0To1(quantity);
13387 }
13388 else
13389 {
13391 }
13392 }
13393 else if (item.IsMagazine())
13394 {
13395 Magazine mag = Magazine.Cast(item);
13396 if (quantity >= 0)
13397 {
13398 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13399 }
13400 else
13401 {
13403 }
13404
13405 }
13406 else
13407 {
13408 if (quantity >= 0)
13409 {
13410 item.SetQuantityNormalized(quantity, false);
13411 }
13412 else
13413 {
13415 }
13416
13417 }
13418 }
13419}
13420
13421#ifdef DEVELOPER
13423#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.