8767{
8769 {
8770 return true;
8771 }
8772};
8773
8774
8775
8777{
8781
8783
8786
8787
8788
8789
8790
8799
8805
8810
8815
8836 protected bool m_IsResultOfSplit
8837
8839
8844
8845
8846
8848
8852
8853
8854
8856
8859
8860
8861
8867
8868
8876
8879
8880
8882
8883
8885
8886
8891
8892
8897
8898
8900
8901
8903 {
8908
8909 if (!
GetGame().IsDedicatedServer())
8910 {
8912 {
8914
8916 {
8918 }
8919 }
8920
8923 }
8924
8925 m_OldLocation = null;
8926
8928 {
8930 }
8931
8932 if (ConfigIsExisting("headSelectionsToHide"))
8933 {
8936 }
8937
8939 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8940 {
8942 }
8943
8945
8946 m_IsResultOfSplit = false;
8947
8949 }
8950
8952 {
8953 super.InitItemVariables();
8954
8960 m_Count = ConfigGetInt(
"count");
8961
8964
8969
8972
8977
8989
8993
8994
8997 if (ConfigIsExisting("canBeSplit"))
8998 {
9001 }
9002
9004 if (ConfigIsExisting("itemBehaviour"))
9006
9007
9010 RegisterNetSyncVariableInt("m_VarLiquidType");
9011 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9012
9013 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9014 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9015 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9016
9017 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9018 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9019 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9020 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9021
9022 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9023 RegisterNetSyncVariableBool("m_IsTakeable");
9024 RegisterNetSyncVariableBool("m_IsHologram");
9025
9028 {
9031 }
9032
9034
9036 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9038
9039 }
9040
9042 {
9044 }
9045
9047 {
9050 {
9055 }
9056 }
9057
9058 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9059 {
9061 {
9064 }
9065
9067 }
9068
9070 {
9076 }
9077
9079
9081 {
9083
9084 if (!action)
9085 {
9086 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9087 return;
9088 }
9089
9091 if (!ai)
9092 {
9094 return;
9095 }
9096
9098 if (!action_array)
9099 {
9100 action_array = new array<ActionBase_Basic>;
9102 }
9103 if (LogManager.IsActionLogEnable())
9104 {
9105 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9106 }
9107
9108 if (action_array.Find(action) != -1)
9109 {
9110 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9111 }
9112 else
9113 {
9114 action_array.Insert(action);
9115 }
9116 }
9117
9119 {
9121 ActionBase action = player.GetActionManager().GetAction(actionName);
9124
9125 if (action_array)
9126 {
9127 action_array.RemoveItem(action);
9128 }
9129 }
9130
9131
9132
9134 {
9135 ActionOverrideData overrideData = new ActionOverrideData();
9139
9141 if (!actionMap)
9142 {
9145 }
9146
9147 actionMap.Insert(this.
Type(), overrideData);
9148
9149 }
9150
9152
9154
9155
9157 {
9160
9163
9164 string config_to_search = "CfgVehicles";
9165 string muzzle_owner_config;
9166
9168 {
9169 if (IsInherited(Weapon))
9170 config_to_search = "CfgWeapons";
9171
9172 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9173
9174 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9175
9177
9178 if (config_OnFire_subclass_count > 0)
9179 {
9180 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9181
9182 for (int i = 0; i < config_OnFire_subclass_count; i++)
9183 {
9184 string particle_class = "";
9186 string config_OnFire_entry = config_OnFire_class + particle_class;
9187 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9188 WPOF_array.Insert(WPOF);
9189 }
9190
9191
9193 }
9194 }
9195
9197 {
9198 config_to_search = "CfgWeapons";
9199 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9200
9201 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9202
9204
9205 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9206 {
9207 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9208
9209 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9210 {
9211 string particle_class2 = "";
9213 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9214 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9215 WPOBE_array.Insert(WPOBE);
9216 }
9217
9218
9220 }
9221 }
9222 }
9223
9224
9226 {
9229
9231 {
9232 string config_to_search = "CfgVehicles";
9233
9234 if (IsInherited(Weapon))
9235 config_to_search = "CfgWeapons";
9236
9237 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9238 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9239
9240 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9241 {
9242
9244
9246 {
9248 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9250 return;
9251 }
9252
9255
9256
9257
9259 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9260
9261 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9262 {
9263 string particle_class = "";
9265 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9267
9268 if (entry_type == CT_CLASS)
9269 {
9270 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9271 WPOOH_array.Insert(WPOF);
9272 }
9273 }
9274
9275
9277 }
9278 }
9279 }
9280
9282 {
9284 }
9285
9287 {
9289 {
9291
9294
9297
9298 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9299 }
9300 }
9301
9303 {
9305 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9306
9308 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9309
9311 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9312
9314 {
9316 }
9317 }
9318
9320 {
9322 }
9323
9325 {
9328 else
9330
9332 {
9335 }
9336 else
9337 {
9340
9343 }
9344
9346 }
9347
9349 {
9351 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9352 }
9353
9355 {
9357 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9359 }
9360
9362 {
9364 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9365 }
9366
9368 {
9371
9372 OverheatingParticle OP = new OverheatingParticle();
9377
9379 }
9380
9382 {
9385
9386 return -1;
9387 }
9388
9390 {
9392 {
9395
9396 for (int i = count; i > 0; --i)
9397 {
9398 int id = i - 1;
9401
9404
9405 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9406 {
9407 if (p)
9408 {
9411 }
9412 }
9413 }
9414 }
9415 }
9416
9418 {
9420 {
9422 {
9423 int id = i - 1;
9425
9426 if (OP)
9427 {
9429
9430 if (p)
9431 {
9433 }
9434
9435 delete OP;
9436 }
9437 }
9438
9441 }
9442 }
9443
9446 {
9447 return 0.0;
9448 }
9449
9450
9452 {
9453 return 250;
9454 }
9455
9457 {
9458 return 0;
9459 }
9460
9463 {
9465 return true;
9466
9467 return false;
9468 }
9469
9472 {
9475
9477 {
9479 }
9480 else
9481 {
9482
9484 }
9485
9487 }
9488
9495 {
9496 return -1;
9497 }
9498
9499
9500
9501
9503 {
9505 {
9507 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9508
9509 if (r_index >= 0)
9510 {
9511 InventoryLocation r_il = new InventoryLocation;
9512 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9513
9514 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9517 {
9518 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9519 }
9521 {
9522 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9523 }
9524
9525 }
9526
9527 player.GetHumanInventory().ClearUserReservedLocation(this);
9528 }
9529
9532 }
9533
9534
9535
9536
9538 {
9539 return ItemBase.m_DebugActionsMask;
9540 }
9541
9543 {
9544 return ItemBase.m_DebugActionsMask & mask;
9545 }
9546
9548 {
9549 ItemBase.m_DebugActionsMask = mask;
9550 }
9551
9553 {
9554 ItemBase.m_DebugActionsMask |= mask;
9555 }
9556
9558 {
9559 ItemBase.m_DebugActionsMask &= ~mask;
9560 }
9561
9563 {
9565 {
9567 }
9568 else
9569 {
9571 }
9572 }
9573
9574
9576 {
9577 if (GetEconomyProfile())
9578 {
9579 float q_max = GetEconomyProfile().GetQuantityMax();
9580 if (q_max > 0)
9581 {
9582 float q_min = GetEconomyProfile().GetQuantityMin();
9583 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9584
9586 {
9587 ComponentEnergyManager comp = GetCompEM();
9589 {
9591 }
9592 }
9594 {
9596
9597 }
9598
9599 }
9600 }
9601 }
9602
9605 {
9606 EntityAI parent = GetHierarchyParent();
9607
9608 if (parent)
9609 {
9610 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9611 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9612 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9613 }
9614 }
9615
9618 {
9619 EntityAI parent = GetHierarchyParent();
9620
9621 if (parent)
9622 {
9623 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9624 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9625 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9626 }
9627 }
9628
9630 {
9631
9632
9633
9634
9636
9638 {
9639 if (ScriptInputUserData.CanStoreInputUserData())
9640 {
9641 ScriptInputUserData ctx = new ScriptInputUserData;
9647 ctx.
Write(use_stack_max);
9650
9652 {
9653 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9654 }
9655 }
9656 }
9657 else if (!
GetGame().IsMultiplayer())
9658 {
9660 }
9661 }
9662
9664 {
9666 }
9667
9669 {
9671 }
9672
9674 {
9676 }
9677
9679 {
9680
9681 return false;
9682 }
9683
9685 {
9686 return false;
9687 }
9688
9692 {
9693 return false;
9694 }
9695
9697 {
9698 return "";
9699 }
9700
9702
9704 {
9705 return false;
9706 }
9707
9709 {
9710 return true;
9711 }
9712
9713
9714
9716 {
9717 return true;
9718 }
9719
9721 {
9722 return true;
9723 }
9724
9726 {
9727 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9729 }
9730
9732 {
9734 }
9735
9737 {
9739 if (!is_being_placed)
9741 SetSynchDirty();
9742 }
9743
9744
9746
9748 {
9750 }
9751
9753 {
9755 }
9756
9758 {
9759 return 1;
9760 }
9761
9763 {
9764 return false;
9765 }
9766
9768 {
9770 SetSynchDirty();
9771 }
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9808 {
9809 super.OnMovedInsideCargo(container);
9810
9811 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9812 }
9813
9814 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9815 {
9816 super.EEItemLocationChanged(oldLoc,newLoc);
9817
9818 PlayerBase new_player = null;
9819 PlayerBase old_player = null;
9820
9821 if (newLoc.GetParent())
9822 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9823
9824 if (oldLoc.GetParent())
9825 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9826
9828 {
9829 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9830
9831 if (r_index >= 0)
9832 {
9833 InventoryLocation r_il = new InventoryLocation;
9834 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9835
9836 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9839 {
9840 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9841 }
9843 {
9844 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9845 }
9846
9847 }
9848 }
9849
9851 {
9852 if (new_player)
9853 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9854
9855 if (new_player == old_player)
9856 {
9857
9858 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9859 {
9861 {
9862 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9863 {
9864 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9865 }
9866 }
9867 else
9868 {
9869 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9870 }
9871 }
9872
9873 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9874 {
9875 int type = oldLoc.GetType();
9877 {
9878 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9879 }
9881 {
9882 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9883 }
9884 }
9885 if (!m_OldLocation)
9886 {
9887 m_OldLocation = new InventoryLocation;
9888 }
9889 m_OldLocation.Copy(oldLoc);
9890 }
9891 else
9892 {
9893 if (m_OldLocation)
9894 {
9895 m_OldLocation.Reset();
9896 }
9897 }
9898
9900 }
9901 else
9902 {
9903 if (new_player)
9904 {
9905 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9906 if (res_index >= 0)
9907 {
9908 InventoryLocation il = new InventoryLocation;
9909 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9911 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9914 {
9915 il.
GetParent().GetOnReleaseLock().Invoke(it);
9916 }
9918 {
9920 }
9921
9922 }
9923 }
9925 {
9926
9928 }
9929
9930 if (m_OldLocation)
9931 {
9932 m_OldLocation.Reset();
9933 }
9934 }
9935 }
9936
9937 override void EOnContact(IEntity other, Contact extra)
9938 {
9940 {
9941 int liquidType = -1;
9943 if (impactSpeed > 0.0)
9944 {
9946 #ifndef SERVER
9948 #else
9950 SetSynchDirty();
9951 #endif
9953 }
9954 }
9955
9956 #ifdef SERVER
9957 if (GetCompEM() && GetCompEM().IsPlugged())
9958 {
9959 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9960 GetCompEM().UnplugThis();
9961 }
9962 #endif
9963 }
9964
9966
9968 {
9970 }
9971
9973 {
9974
9975 }
9976
9978 {
9979 super.OnItemLocationChanged(old_owner, new_owner);
9980
9981 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9982 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9983
9984 if (!relatedPlayer && playerNew)
9985 relatedPlayer = playerNew;
9986
9987 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9988 {
9990 if (actionMgr)
9991 {
9992 ActionBase currentAction = actionMgr.GetRunningAction();
9993 if (currentAction)
9995 }
9996 }
9997
9998 Man ownerPlayerOld = null;
9999 Man ownerPlayerNew = null;
10000
10001 if (old_owner)
10002 {
10003 if (old_owner.
IsMan())
10004 {
10005 ownerPlayerOld = Man.Cast(old_owner);
10006 }
10007 else
10008 {
10009 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10010 }
10011 }
10012 else
10013 {
10015 {
10017
10018 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10019 {
10020 GetCompEM().UnplugThis();
10021 }
10022 }
10023 }
10024
10025 if (new_owner)
10026 {
10027 if (new_owner.
IsMan())
10028 {
10029 ownerPlayerNew = Man.Cast(new_owner);
10030 }
10031 else
10032 {
10033 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10034 }
10035 }
10036
10037 if (ownerPlayerOld != ownerPlayerNew)
10038 {
10039 if (ownerPlayerOld)
10040 {
10041 array<EntityAI> subItemsExit = new array<EntityAI>;
10043 for (int i = 0; i < subItemsExit.Count(); i++)
10044 {
10047 }
10048 }
10049
10050 if (ownerPlayerNew)
10051 {
10052 array<EntityAI> subItemsEnter = new array<EntityAI>;
10054 for (int j = 0; j < subItemsEnter.Count(); j++)
10055 {
10058 }
10059 }
10060 }
10061 else if (ownerPlayerNew != null)
10062 {
10063 PlayerBase nplayer;
10064 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10065 {
10066 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10068 for (int k = 0; k < subItemsUpdate.Count(); k++)
10069 {
10071 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10072 }
10073 }
10074 }
10075
10076 if (old_owner)
10077 old_owner.OnChildItemRemoved(this);
10078 if (new_owner)
10079 new_owner.OnChildItemReceived(this);
10080 }
10081
10082
10084 {
10085 super.EEDelete(parent);
10086 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10087 if (player)
10088 {
10090
10091 if (player.IsAlive())
10092 {
10093 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10094 if (r_index >= 0)
10095 {
10096 InventoryLocation r_il = new InventoryLocation;
10097 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10098
10099 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10102 {
10103 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10104 }
10106 {
10107 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10108 }
10109
10110 }
10111
10112 player.RemoveQuickBarEntityShortcut(this);
10113 }
10114 }
10115 }
10116
10118 {
10119 super.EEKilled(killer);
10120
10123 {
10124 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10125 {
10126 if (IsMagazine())
10127 {
10128 if (Magazine.Cast(this).GetAmmoCount() > 0)
10129 {
10131 }
10132 }
10133 else
10134 {
10136 }
10137 }
10138 }
10139 }
10140
10142 {
10143 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10144
10145 super.OnWasAttached(parent, slot_id);
10146
10149
10151 }
10152
10154 {
10155 super.OnWasDetached(parent, slot_id);
10156
10159 }
10160
10162 {
10163 int idx;
10166
10167 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10168 if (inventory_slots.Count() < 1)
10169 {
10170 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10171 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10172 }
10173 else
10174 {
10175 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10176 }
10177
10178 idx = inventory_slots.Find(slot);
10179 if (idx < 0)
10180 return "";
10181
10182 return attach_types.Get(idx);
10183 }
10184
10186 {
10187 int idx = -1;
10188 string slot;
10189
10192
10193 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10194 if (inventory_slots.Count() < 1)
10195 {
10196 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10197 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10198 }
10199 else
10200 {
10201 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10202 if (detach_types.Count() < 1)
10203 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10204 }
10205
10206 for (int i = 0; i < inventory_slots.Count(); i++)
10207 {
10208 slot = inventory_slots.Get(i);
10209 }
10210
10211 if (slot != "")
10212 {
10213 if (detach_types.Count() == 1)
10214 idx = 0;
10215 else
10216 idx = inventory_slots.Find(slot);
10217 }
10218 if (idx < 0)
10219 return "";
10220
10221 return detach_types.Get(idx);
10222 }
10223
10225 {
10226
10228
10229
10230 float min_time = 1;
10231 float max_time = 3;
10232 float delay = Math.RandomFloat(min_time, max_time);
10233
10234 explode_timer.Run(delay, this, "DoAmmoExplosion");
10235 }
10236
10238 {
10239 Magazine magazine = Magazine.Cast(this);
10240 int pop_sounds_count = 6;
10241 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10242
10243
10244 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10245 string sound_name = pop_sounds[ sound_idx ];
10247
10248
10249 magazine.ServerAddAmmoCount(-1);
10250
10251
10252 float min_temp_to_explode = 100;
10253
10254 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10255 {
10257 }
10258 }
10259
10260
10261 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10262 {
10263 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10264
10265 const int CHANCE_DAMAGE_CARGO = 4;
10266 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10267 const int CHANCE_DAMAGE_NOTHING = 2;
10268
10270 {
10271 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10272 int chances;
10273 int rnd;
10274
10275 if (GetInventory().GetCargo())
10276 {
10277 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10278 rnd = Math.RandomInt(0,chances);
10279
10280 if (rnd < CHANCE_DAMAGE_CARGO)
10281 {
10283 }
10284 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10285 {
10287 }
10288 }
10289 else
10290 {
10291 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10292 rnd = Math.RandomInt(0,chances);
10293
10294 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10295 {
10297 }
10298 }
10299 }
10300 }
10301
10303 {
10304 if (GetInventory().GetCargo())
10305 {
10306 int item_count = GetInventory().GetCargo().GetItemCount();
10307 if (item_count > 0)
10308 {
10309 int random_pick = Math.RandomInt(0, item_count);
10311 if (!item.IsExplosive())
10312 {
10313 item.AddHealth("","",damage);
10314 return true;
10315 }
10316 }
10317 }
10318 return false;
10319 }
10320
10322 {
10323 int attachment_count = GetInventory().AttachmentCount();
10324 if (attachment_count > 0)
10325 {
10326 int random_pick = Math.RandomInt(0, attachment_count);
10327 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10328 if (!attachment.IsExplosive())
10329 {
10330 attachment.AddHealth("","",damage);
10331 return true;
10332 }
10333 }
10334 return false;
10335 }
10336
10338 {
10340 }
10341
10343 {
10345 return GetInventory().CanRemoveEntity();
10346
10347 return false;
10348 }
10349
10351 {
10352
10354 return false;
10355
10356
10358 return false;
10359
10360
10361
10363 if (delta == 0)
10364 return false;
10365
10366
10367 return true;
10368 }
10369
10371 {
10373 {
10374 if (ScriptInputUserData.CanStoreInputUserData())
10375 {
10376 ScriptInputUserData ctx = new ScriptInputUserData;
10381 ctx.
Write(destination_entity);
10383 ctx.
Write(slot_id);
10385 }
10386 }
10387 else if (!
GetGame().IsMultiplayer())
10388 {
10390 }
10391 }
10392
10394 {
10395 float split_quantity_new;
10399 InventoryLocation loc = new InventoryLocation;
10400
10401 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10402 {
10404 split_quantity_new = stack_max;
10405 else
10407
10409 {
10410 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10411 if (new_item)
10412 {
10413 new_item.SetResultOfSplit(true);
10414 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10416 new_item.
SetQuantity(split_quantity_new,
false,
true);
10417 }
10418 }
10419 }
10420 else if (destination_entity && slot_id == -1)
10421 {
10422 if (quantity > stack_max)
10423 split_quantity_new = stack_max;
10424 else
10425 split_quantity_new = quantity;
10426
10428 {
10430 {
10433 }
10434
10435 if (new_item)
10436 {
10437 new_item.SetResultOfSplit(true);
10438 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10440 new_item.
SetQuantity(split_quantity_new,
false,
true);
10441 }
10442 }
10443 }
10444 else
10445 {
10446 if (stack_max != 0)
10447 {
10449 {
10451 }
10452
10453 if (split_quantity_new == 0)
10454 {
10455 if (!
GetGame().IsMultiplayer())
10456 player.PhysicalPredictiveDropItem(this);
10457 else
10458 player.ServerDropEntity(this);
10459 return;
10460 }
10461
10463 {
10465
10466 if (new_item)
10467 {
10468 new_item.SetResultOfSplit(true);
10469 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10472 new_item.PlaceOnSurface();
10473 }
10474 }
10475 }
10476 }
10477 }
10478
10480 {
10481 float split_quantity_new;
10485 InventoryLocation loc = new InventoryLocation;
10486
10487 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10488 {
10490 split_quantity_new = stack_max;
10491 else
10493
10495 {
10496 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10497 if (new_item)
10498 {
10499 new_item.SetResultOfSplit(true);
10500 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10502 new_item.
SetQuantity(split_quantity_new,
false,
true);
10503 }
10504 }
10505 }
10506 else if (destination_entity && slot_id == -1)
10507 {
10508 if (quantity > stack_max)
10509 split_quantity_new = stack_max;
10510 else
10511 split_quantity_new = quantity;
10512
10514 {
10516 {
10519 }
10520
10521 if (new_item)
10522 {
10523 new_item.SetResultOfSplit(true);
10524 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10526 new_item.
SetQuantity(split_quantity_new,
false,
true);
10527 }
10528 }
10529 }
10530 else
10531 {
10532 if (stack_max != 0)
10533 {
10535 {
10537 }
10538
10540 {
10542
10543 if (new_item)
10544 {
10545 new_item.SetResultOfSplit(true);
10546 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10549 new_item.PlaceOnSurface();
10550 }
10551 }
10552 }
10553 }
10554 }
10555
10557 {
10559 {
10560 if (ScriptInputUserData.CanStoreInputUserData())
10561 {
10562 ScriptInputUserData ctx = new ScriptInputUserData;
10567 dst.WriteToContext(ctx);
10569 }
10570 }
10571 else if (!
GetGame().IsMultiplayer())
10572 {
10574 }
10575 }
10576
10578 {
10580 {
10581 if (ScriptInputUserData.CanStoreInputUserData())
10582 {
10583 ScriptInputUserData ctx = new ScriptInputUserData;
10588 ctx.
Write(destination_entity);
10594 }
10595 }
10596 else if (!
GetGame().IsMultiplayer())
10597 {
10599 }
10600 }
10601
10603 {
10605 }
10606
10608 {
10610 float split_quantity_new;
10612 if (dst.IsValid())
10613 {
10614 int slot_id = dst.GetSlot();
10616
10617 if (quantity > stack_max)
10618 split_quantity_new = stack_max;
10619 else
10620 split_quantity_new = quantity;
10621
10623 {
10625
10626 if (new_item)
10627 {
10628 new_item.SetResultOfSplit(true);
10629 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10631 new_item.
SetQuantity(split_quantity_new,
false,
true);
10632 }
10633
10634 return new_item;
10635 }
10636 }
10637
10638 return null;
10639 }
10640
10642 {
10644 float split_quantity_new;
10646 if (destination_entity)
10647 {
10649 if (quantity > stackable)
10650 split_quantity_new = stackable;
10651 else
10652 split_quantity_new = quantity;
10653
10655 {
10656 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10657 if (new_item)
10658 {
10659 new_item.SetResultOfSplit(true);
10660 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10662 new_item.
SetQuantity(split_quantity_new,
false,
true);
10663 }
10664 }
10665 }
10666 }
10667
10669 {
10671 {
10672 if (ScriptInputUserData.CanStoreInputUserData())
10673 {
10674 ScriptInputUserData ctx = new ScriptInputUserData;
10679 ItemBase destination_entity =
this;
10680 ctx.
Write(destination_entity);
10684 }
10685 }
10686 else if (!
GetGame().IsMultiplayer())
10687 {
10689 }
10690 }
10691
10693 {
10695 float split_quantity_new;
10697 if (player)
10698 {
10700 if (quantity > stackable)
10701 split_quantity_new = stackable;
10702 else
10703 split_quantity_new = quantity;
10704
10706 {
10707 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10708 new_item =
ItemBase.Cast(in_hands);
10709 if (new_item)
10710 {
10711 new_item.SetResultOfSplit(true);
10712 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10714 new_item.SetQuantity(split_quantity_new, false, true);
10715 }
10716 }
10717 }
10718 }
10719
10721 {
10723 float split_quantity_new = Math.Floor(quantity * 0.5);
10724
10726 return;
10727
10729
10730 if (new_item)
10731 {
10732 if (new_item.GetQuantityMax() < split_quantity_new)
10733 {
10734 split_quantity_new = new_item.GetQuantityMax();
10735 }
10736
10737 new_item.SetResultOfSplit(true);
10738 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10739
10741 {
10744 }
10745 else
10746 {
10748 new_item.
SetQuantity(split_quantity_new,
false,
true);
10749 }
10750 }
10751 }
10752
10754 {
10756 float split_quantity_new = Math.Floor(quantity / 2);
10757
10759 return;
10760
10761 InventoryLocation invloc = new InventoryLocation;
10763
10765 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10766
10767 if (new_item)
10768 {
10769 if (new_item.GetQuantityMax() < split_quantity_new)
10770 {
10771 split_quantity_new = new_item.GetQuantityMax();
10772 }
10774 {
10777 }
10778 else if (split_quantity_new > 1)
10779 {
10781 new_item.
SetQuantity(split_quantity_new,
false,
true);
10782 }
10783 }
10784 }
10785
10788 {
10789 SetWeightDirty();
10791
10792 if (parent)
10793 parent.OnAttachmentQuantityChangedEx(this, delta);
10794
10796 {
10798 {
10800 }
10802 {
10803 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10805 }
10806 }
10807
10808 }
10809
10812 {
10813
10814 }
10815
10818 {
10820 }
10821
10823 {
10824 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10825
10827 {
10828 if (newLevel == GameConstants.STATE_RUINED)
10829 {
10831 EntityAI parent = GetHierarchyParent();
10832 if (parent && parent.IsFireplace())
10833 {
10834 CargoBase cargo = GetInventory().GetCargo();
10835 if (cargo)
10836 {
10838 {
10840 }
10841 }
10842 }
10843 }
10844
10846 {
10847
10849 return;
10850 }
10851
10852 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10853 {
10855 }
10856 }
10857 }
10858
10859
10861 {
10862 super.OnRightClick();
10863
10865 {
10867 {
10868 if (ScriptInputUserData.CanStoreInputUserData())
10869 {
10870 EntityAI root = GetHierarchyRoot();
10871 Man playerOwner = GetHierarchyRootPlayer();
10872 InventoryLocation dst = new InventoryLocation;
10873
10874
10875 if (!playerOwner && root && root == this)
10876 {
10878 }
10879 else
10880 {
10881
10882 GetInventory().GetCurrentInventoryLocation(dst);
10884 {
10887 {
10889 }
10890 else
10891 {
10893
10894
10895 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10896 {
10898 }
10899 else
10900 {
10901 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10902 }
10903 }
10904 }
10905 }
10906
10907 ScriptInputUserData ctx = new ScriptInputUserData;
10915 }
10916 }
10917 else if (!
GetGame().IsMultiplayer())
10918 {
10920 }
10921 }
10922 }
10923
10925 {
10926 if (root)
10927 {
10928 vector m4[4];
10929 root.GetTransform(m4);
10930 dst.SetGround(this, m4);
10931 }
10932 else
10933 {
10934 GetInventory().GetCurrentInventoryLocation(dst);
10935 }
10936 }
10937
10938 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10939 {
10940
10941 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10942 return false;
10943
10944 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10945 return false;
10946
10947
10949 return false;
10950
10951
10952 Magazine mag = Magazine.Cast(this);
10953 if (mag)
10954 {
10955 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10956 return false;
10957
10958 if (stack_max_limit)
10959 {
10960 Magazine other_mag = Magazine.Cast(other_item);
10961 if (other_item)
10962 {
10963 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10964 return false;
10965 }
10966
10967 }
10968 }
10969 else
10970 {
10971
10973 return false;
10974
10976 return false;
10977 }
10978
10979 PlayerBase player = null;
10980 if (CastTo(player, GetHierarchyRootPlayer()))
10981 {
10982 if (player.GetInventory().HasAttachment(this))
10983 return false;
10984
10985 if (player.IsItemsToDelete())
10986 return false;
10987 }
10988
10989 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10990 return false;
10991
10992 int slotID;
10994 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10995 return false;
10996
10997 return true;
10998 }
10999
11001 {
11003 }
11004
11006 {
11007 return m_IsResultOfSplit;
11008 }
11009
11011 {
11012 m_IsResultOfSplit = value;
11013 }
11014
11016 {
11018 }
11019
11021 {
11022 float other_item_quantity = other_item.GetQuantity();
11023 float this_free_space;
11024
11026
11028
11029 if (other_item_quantity > this_free_space)
11030 {
11031 return this_free_space;
11032 }
11033 else
11034 {
11035 return other_item_quantity;
11036 }
11037 }
11038
11040 {
11042 }
11043
11045 {
11047 return;
11048
11049 if (!IsMagazine() && other_item)
11050 {
11052 if (quantity_used != 0)
11053 {
11054 float hp1 = GetHealth01("","");
11055 float hp2 = other_item.GetHealth01("","");
11056 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11057 hpResult = hpResult / (
GetQuantity() + quantity_used);
11058
11059 hpResult *= GetMaxHealth();
11060 Math.Round(hpResult);
11061 SetHealth("", "Health", hpResult);
11062
11064 other_item.AddQuantity(-quantity_used);
11065 }
11066 }
11068 }
11069
11071 {
11072 #ifdef SERVER
11073 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11074 GetHierarchyParent().IncreaseLifetimeUp();
11075 #endif
11076 };
11077
11079 {
11080 PlayerBase p = PlayerBase.Cast(player);
11081
11082 array<int> recipesIds = p.m_Recipes;
11083 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11084 if (moduleRecipesManager)
11085 {
11086 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11087 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11088 }
11089
11090 for (int i = 0;i < recipesIds.Count(); i++)
11091 {
11092 int key = recipesIds.Get(i);
11093 string recipeName = moduleRecipesManager.GetRecipeName(key);
11095 }
11096 }
11097
11098
11099 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11100 {
11101 super.GetDebugActions(outputList);
11102
11103
11109
11110
11115
11120
11121
11125
11126
11128 {
11132 }
11133
11136
11137
11141
11143
11144 InventoryLocation loc = new InventoryLocation();
11145 GetInventory().GetCurrentInventoryLocation(loc);
11147 {
11148 if (Gizmo_IsSupported())
11151 }
11152
11154 }
11155
11156
11157
11158
11160 {
11161 super.OnAction(action_id, player, ctx);
11162
11164 {
11165 switch (action_id)
11166 {
11169 return true;
11172 return true;
11173 }
11174 }
11175
11177 {
11178 switch (action_id)
11179 {
11181 Delete();
11182 return true;
11183 }
11184 }
11185
11186 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11187 {
11188 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11189 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11190 PlayerBase p = PlayerBase.Cast(player);
11191 if (
EActions.RECIPES_RANGE_START < 1000)
11192 {
11193 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11194 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11195 }
11196 }
11197 #ifndef SERVER
11198 else if (action_id ==
EActions.WATCH_PLAYER)
11199 {
11200 PluginDeveloper.SetDeveloperItemClientEx(player);
11201 }
11202 #endif
11204 {
11205 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11206 {
11207 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11208 OnDebugButtonPressServer(id + 1);
11209 }
11210
11211 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11212 {
11213 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11215 }
11216
11217 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11218 {
11219 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11221 }
11222
11223 else if (action_id ==
EActions.ADD_QUANTITY)
11224 {
11225 if (IsMagazine())
11226 {
11227 Magazine mag = Magazine.Cast(this);
11228 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11229 }
11230 else
11231 {
11233 }
11234
11235 if (m_EM)
11236 {
11237 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11238 }
11239
11240 }
11241
11242 else if (action_id ==
EActions.REMOVE_QUANTITY)
11243 {
11244 if (IsMagazine())
11245 {
11246 Magazine mag2 = Magazine.Cast(this);
11247 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11248 }
11249 else
11250 {
11252 }
11253 if (m_EM)
11254 {
11255 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11256 }
11257
11258 }
11259
11260 else if (action_id ==
EActions.SET_QUANTITY_0)
11261 {
11263
11264 if (m_EM)
11265 {
11266 m_EM.SetEnergy(0);
11267 }
11268 }
11269
11270 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11271 {
11273
11274 if (m_EM)
11275 {
11276 m_EM.SetEnergy(m_EM.GetEnergyMax());
11277 }
11278 }
11279
11280 else if (action_id ==
EActions.ADD_HEALTH)
11281 {
11282 AddHealth("","",GetMaxHealth("","Health")/5);
11283 }
11284 else if (action_id ==
EActions.REMOVE_HEALTH)
11285 {
11286 AddHealth("","",-GetMaxHealth("","Health")/5);
11287 }
11288 else if (action_id ==
EActions.DESTROY_HEALTH)
11289 {
11290 SetHealth01("","",0);
11291 }
11292 else if (action_id ==
EActions.WATCH_ITEM)
11293 {
11295 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11296 #ifdef DEVELOPER
11297 SetDebugDeveloper_item(this);
11298 #endif
11299 }
11300
11301 else if (action_id ==
EActions.ADD_TEMPERATURE)
11302 {
11303 AddTemperature(20);
11304
11305 }
11306
11307 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11308 {
11309 AddTemperature(-20);
11310
11311 }
11312
11313 else if (action_id ==
EActions.FLIP_FROZEN)
11314 {
11315 SetFrozen(!GetIsFrozen());
11316
11317 }
11318
11319 else if (action_id ==
EActions.ADD_WETNESS)
11320 {
11322
11323 }
11324
11325 else if (action_id ==
EActions.REMOVE_WETNESS)
11326 {
11328
11329 }
11330
11331 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11332 {
11335
11336
11337 }
11338
11339 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11340 {
11343 }
11344
11345 else if (action_id ==
EActions.MAKE_SPECIAL)
11346 {
11347 auto debugParams = DebugSpawnParams.WithPlayer(player);
11348 OnDebugSpawnEx(debugParams);
11349 }
11350
11351 }
11352
11353
11354 return false;
11355 }
11356
11357
11358
11359
11363
11366
11367
11368
11370 {
11371 return false;
11372 }
11373
11374
11376 {
11377 return true;
11378 }
11379
11380
11382 {
11383 return true;
11384 }
11385
11386
11387
11389 {
11390 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11392 }
11393
11396 {
11397 return null;
11398 }
11399
11401 {
11402 return false;
11403 }
11404
11406 {
11407 return false;
11408 }
11409
11413
11414
11416 {
11417 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11418 return module_repairing.CanRepair(this, item_repair_kit);
11419 }
11420
11421
11422 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11423 {
11424 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11425 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11426 }
11427
11428
11430 {
11431
11432
11433
11434
11435
11436
11437
11438
11439 return 1;
11440 }
11441
11442
11443
11445 {
11447 }
11448
11449
11450
11452 {
11454 }
11455
11456
11465 {
11466 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11467
11468 if (player)
11469 {
11470 player.MessageStatus(text);
11471 }
11472 }
11473
11474
11483 {
11484 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11485
11486 if (player)
11487 {
11488 player.MessageAction(text);
11489 }
11490 }
11491
11492
11501 {
11502 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11503
11504 if (player)
11505 {
11506 player.MessageFriendly(text);
11507 }
11508 }
11509
11510
11519 {
11520 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11521
11522 if (player)
11523 {
11524 player.MessageImportant(text);
11525 }
11526 }
11527
11529 {
11530 return true;
11531 }
11532
11533
11534 override bool KindOf(
string tag)
11535 {
11536 bool found = false;
11537 string item_name = this.
GetType();
11540
11541 int array_size = item_tag_array.Count();
11542 for (int i = 0; i < array_size; i++)
11543 {
11544 if (item_tag_array.Get(i) == tag)
11545 {
11546 found = true;
11547 break;
11548 }
11549 }
11550 return found;
11551 }
11552
11553
11555 {
11556
11557 super.OnRPC(sender, rpc_type,ctx);
11558
11559
11560 switch (rpc_type)
11561 {
11562 #ifndef SERVER
11563 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11564 Param2<bool, string> p = new Param2<bool, string>(false, "");
11565
11567 return;
11568
11569 bool play = p.param1;
11570 string soundSet = p.param2;
11571
11572 if (play)
11573 {
11575 {
11577 {
11579 }
11580 }
11581 else
11582 {
11584 }
11585 }
11586 else
11587 {
11589 }
11590
11591 break;
11592 #endif
11593
11594 }
11595
11597 {
11599 }
11600 }
11601
11602
11603
11604
11606 {
11607 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11608 return plugin.GetID(
name);
11609 }
11610
11612 {
11613 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11614 return plugin.GetName(id);
11615 }
11616
11619 {
11620
11621
11622 int varFlags;
11623 if (!ctx.
Read(varFlags))
11624 return;
11625
11626 if (varFlags & ItemVariableFlags.FLOAT)
11627 {
11629 }
11630 }
11631
11633 {
11634
11635 super.SerializeNumericalVars(floats_out);
11636
11637
11638
11640 {
11642 }
11643
11645 {
11647 }
11648
11650 {
11652 }
11653
11655 {
11660 }
11661
11663 {
11665 }
11666 }
11667
11669 {
11670
11671 super.DeSerializeNumericalVars(floats);
11672
11673
11674 int index = 0;
11675 int mask = Math.Round(floats.Get(index));
11676
11677 index++;
11678
11680 {
11682 {
11684 }
11685 else
11686 {
11687 float quantity = floats.Get(index);
11688 SetQuantity(quantity,
true,
false,
false,
false);
11689 }
11690 index++;
11691 }
11692
11694 {
11695 float wet = floats.Get(index);
11697 index++;
11698 }
11699
11701 {
11702 int liquidtype = Math.Round(floats.Get(index));
11704 index++;
11705 }
11706
11708 {
11710 index++;
11712 index++;
11714 index++;
11716 index++;
11717 }
11718
11720 {
11721 int cleanness = Math.Round(floats.Get(index));
11723 index++;
11724 }
11725 }
11726
11728 {
11729 super.WriteVarsToCTX(ctx);
11730
11731
11733 {
11735 }
11736
11738 {
11740 }
11741
11743 {
11745 }
11746
11748 {
11749 int r,g,b,a;
11755 }
11756
11758 {
11760 }
11761 }
11762
11764 {
11765 if (!super.ReadVarsFromCTX(ctx,version))
11766 return false;
11767
11768 int intValue;
11769 float value;
11770
11771 if (version < 140)
11772 {
11773 if (!ctx.
Read(intValue))
11774 return false;
11775
11776 m_VariablesMask = intValue;
11777 }
11778
11780 {
11781 if (!ctx.
Read(value))
11782 return false;
11783
11785 {
11787 }
11788 else
11789 {
11791 }
11792 }
11793
11794 if (version < 140)
11795 {
11797 {
11798 if (!ctx.
Read(value))
11799 return false;
11800 SetTemperatureDirect(value);
11801 }
11802 }
11803
11805 {
11806 if (!ctx.
Read(value))
11807 return false;
11809 }
11810
11812 {
11813 if (!ctx.
Read(intValue))
11814 return false;
11816 }
11817
11819 {
11820 int r,g,b,a;
11822 return false;
11824 return false;
11826 return false;
11828 return false;
11829
11831 }
11832
11834 {
11835 if (!ctx.
Read(intValue))
11836 return false;
11838 }
11839
11840 if (version >= 138 && version < 140)
11841 {
11843 {
11844 if (!ctx.
Read(intValue))
11845 return false;
11846 SetFrozen(intValue);
11847 }
11848 }
11849
11850 return true;
11851 }
11852
11853
11855 {
11858 {
11860 }
11861
11862 if (!super.OnStoreLoad(ctx, version))
11863 {
11865 return false;
11866 }
11867
11868 if (version >= 114)
11869 {
11870 bool hasQuickBarIndexSaved;
11871
11872 if (!ctx.
Read(hasQuickBarIndexSaved))
11873 {
11875 return false;
11876 }
11877
11878 if (hasQuickBarIndexSaved)
11879 {
11880 int itmQBIndex;
11881
11882
11883 if (!ctx.
Read(itmQBIndex))
11884 {
11886 return false;
11887 }
11888
11889 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11890 if (itmQBIndex != -1 && parentPlayer)
11891 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11892 }
11893 }
11894 else
11895 {
11896
11897 PlayerBase player;
11898 int itemQBIndex;
11899 if (version ==
int.
MAX)
11900 {
11901 if (!ctx.
Read(itemQBIndex))
11902 {
11904 return false;
11905 }
11906 }
11907 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11908 {
11909
11910 if (!ctx.
Read(itemQBIndex))
11911 {
11913 return false;
11914 }
11915 if (itemQBIndex != -1 && player)
11916 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11917 }
11918 }
11919
11920 if (version < 140)
11921 {
11922
11923 if (!LoadVariables(ctx, version))
11924 {
11926 return false;
11927 }
11928 }
11929
11930
11932 {
11934 return false;
11935 }
11936 if (version >= 132)
11937 {
11939 if (raib)
11940 {
11942 {
11944 return false;
11945 }
11946 }
11947 }
11948
11950 return true;
11951 }
11952
11953
11954
11956 {
11957 super.OnStoreSave(ctx);
11958
11959 PlayerBase player;
11960 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11961 {
11963
11964 int itemQBIndex = -1;
11965 itemQBIndex = player.FindQuickBarEntityIndex(this);
11966 ctx.
Write(itemQBIndex);
11967 }
11968 else
11969 {
11971 }
11972
11974
11976 if (raib)
11977 {
11979 }
11980 }
11981
11982
11984 {
11985 super.AfterStoreLoad();
11986
11988 {
11990 }
11991
11993 {
11996 }
11997 }
11998
12000 {
12001 super.EEOnAfterLoad();
12002
12004 {
12006 }
12007
12010 }
12011
12013 {
12014 return false;
12015 }
12016
12017
12018
12020 {
12022 {
12023 #ifdef PLATFORM_CONSOLE
12024
12026 {
12028 if (menu)
12029 {
12031 }
12032 }
12033 #endif
12034 }
12035
12037 {
12040 }
12041
12043 {
12044 SetWeightDirty();
12046 }
12048 {
12051 }
12052
12054 {
12057 }
12059 {
12062 }
12063
12064 super.OnVariablesSynchronized();
12065 }
12066
12067
12068
12070 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12071 {
12072 if (!IsServerCheck(allow_client))
12073 return false;
12074
12076 return false;
12077
12080
12081 if (value <= (min + 0.001))
12082 value = min;
12083
12084 if (value == min)
12085 {
12086 if (destroy_config)
12087 {
12088 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12089 if (dstr)
12090 {
12092 this.Delete();
12093 return true;
12094 }
12095 }
12096 else if (destroy_forced)
12097 {
12099 this.Delete();
12100 return true;
12101 }
12102
12104 }
12105
12108
12110 {
12112
12113 if (delta)
12115 }
12116
12118
12119 return false;
12120 }
12121
12122
12124 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12125 {
12127 }
12128
12130 {
12133 }
12134
12136 {
12139 }
12140
12142 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12143 {
12144 float value_clamped = Math.Clamp(value, 0, 1);
12146 SetQuantity(result, destroy_config, destroy_forced);
12147 }
12148
12149
12152 {
12154 }
12155
12157 {
12159 }
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12171 {
12172 int slot = -1;
12173 if (GetInventory())
12174 {
12175 InventoryLocation il = new InventoryLocation;
12176 GetInventory().GetCurrentInventoryLocation(il);
12178 }
12179
12181 }
12182
12184 {
12185 float quantity_max = 0;
12186
12188 {
12189 if (attSlotID != -1)
12190 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12191
12192 if (quantity_max <= 0)
12194 }
12195
12196 if (quantity_max <= 0)
12198
12199 return quantity_max;
12200 }
12201
12203 {
12205 }
12206
12208 {
12210 }
12211
12212
12214 {
12216 }
12217
12219 {
12221 }
12222
12224 {
12226 }
12227
12228
12230 {
12231
12232 float weightEx = GetWeightEx();
12233 float special = GetInventoryAndCargoWeight();
12234 return weightEx - special;
12235 }
12236
12237
12239 {
12241 }
12242
12244 {
12246 {
12247 #ifdef DEVELOPER
12248 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12249 {
12250 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12252 }
12253 #endif
12254
12255 return GetQuantity() * GetConfigWeightModified();
12256 }
12257 else if (HasEnergyManager())
12258 {
12259 #ifdef DEVELOPER
12260 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12261 {
12262 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12263 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12264 }
12265 #endif
12266 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12267 }
12268 else
12269 {
12270 #ifdef DEVELOPER
12271 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12272 {
12273 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12274 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12275 }
12276 #endif
12277 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12278 }
12279 }
12280
12283 {
12284 int item_count = 0;
12286
12287 if (GetInventory().GetCargo() != NULL)
12288 {
12289 item_count = GetInventory().GetCargo().GetItemCount();
12290 }
12291
12292 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12293 {
12294 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12295 if (item)
12296 item_count += item.GetNumberOfItems();
12297 }
12298 return item_count;
12299 }
12300
12303 {
12304 float weight = 0;
12305 float wetness = 1;
12306 if (include_wetness)
12309 {
12310 weight = wetness * m_ConfigWeight;
12311 }
12313 {
12314 weight = 1;
12315 }
12316 return weight;
12317 }
12318
12319
12320
12322 {
12323 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12324 {
12325 GameInventory inv = GetInventory();
12326 array<EntityAI> items = new array<EntityAI>;
12328 for (int i = 0; i < items.Count(); i++)
12329 {
12331 if (item)
12332 {
12334 }
12335 }
12336 }
12337 }
12338
12339
12340
12341
12343 {
12344 float energy = 0;
12345 if (HasEnergyManager())
12346 {
12347 energy = GetCompEM().GetEnergy();
12348 }
12349 return energy;
12350 }
12351
12352
12354 {
12355 super.OnEnergyConsumed();
12356
12358 }
12359
12361 {
12362 super.OnEnergyAdded();
12363
12365 }
12366
12367
12369 {
12370 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12371 {
12373 {
12374 float energy_0to1 = GetCompEM().GetEnergy0To1();
12376 }
12377 }
12378 }
12379
12380
12382 {
12383 return ConfigGetFloat("heatIsolation");
12384 }
12385
12387 {
12389 }
12390
12392 {
12393 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12394 if (
GetGame().ConfigIsExisting(paramPath))
12396
12397 return 0.0;
12398 }
12399
12401 {
12402 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12403 if (
GetGame().ConfigIsExisting(paramPath))
12405
12406 return 0.0;
12407 }
12408
12409 override void SetWet(
float value,
bool allow_client =
false)
12410 {
12411 if (!IsServerCheck(allow_client))
12412 return;
12413
12416
12418
12419 m_VarWet = Math.Clamp(value, min, max);
12420
12422 {
12425 }
12426 }
12427
12428 override void AddWet(
float value)
12429 {
12431 }
12432
12434 {
12436 }
12437
12439 {
12441 }
12442
12444 {
12446 }
12447
12449 {
12451 }
12452
12454 {
12456 }
12457
12458 override void OnWetChanged(
float newVal,
float oldVal)
12459 {
12462 if (newLevel != oldLevel)
12463 {
12465 }
12466 }
12467
12469 {
12470 SetWeightDirty();
12471 }
12472
12474 {
12475 return GetWetLevelInternal(
m_VarWet);
12476 }
12477
12478
12479
12481 {
12483 }
12484
12486 {
12488 }
12489
12491 {
12493 }
12494
12496 {
12498 }
12499
12500
12501
12503 {
12504 if (ConfigIsExisting("itemModelLength"))
12505 {
12506 return ConfigGetFloat("itemModelLength");
12507 }
12508 return 0;
12509 }
12510
12512 {
12513 if (ConfigIsExisting("itemAttachOffset"))
12514 {
12515 return ConfigGetFloat("itemAttachOffset");
12516 }
12517 return 0;
12518 }
12519
12520 override void SetCleanness(
int value,
bool allow_client =
false)
12521 {
12522 if (!IsServerCheck(allow_client))
12523 return;
12524
12526
12528
12531 }
12532
12534 {
12536 }
12537
12539 {
12540 return true;
12541 }
12542
12543
12544
12545
12547 {
12549 }
12550
12552 {
12554 }
12555
12556
12557
12558
12559 override void SetColor(
int r,
int g,
int b,
int a)
12560 {
12566 }
12568 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12569 {
12574 }
12575
12577 {
12579 }
12580
12583 {
12584 int r,g,b,a;
12586 r = r/255;
12587 g = g/255;
12588 b = b/255;
12589 a = a/255;
12590 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12591 }
12592
12593
12594
12595 override void SetLiquidType(
int value,
bool allow_client =
false)
12596 {
12597 if (!IsServerCheck(allow_client))
12598 return;
12599
12604 }
12605
12607 {
12608 return ConfigGetInt("varLiquidTypeInit");
12609 }
12610
12612 {
12614 }
12615
12617 {
12619 SetFrozen(false);
12620 }
12621
12624 {
12625 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12626 }
12627
12628
12631 {
12632 PlayerBase nplayer;
12633 if (PlayerBase.CastTo(nplayer, player))
12634 {
12636
12637 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12638 }
12639 }
12640
12641
12644 {
12645 PlayerBase nplayer;
12646 if (PlayerBase.CastTo(nplayer,player))
12647 {
12648
12649 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12650
12651 }
12652
12653
12654 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12655
12656
12657 if (HasEnergyManager())
12658 {
12659 GetCompEM().UpdatePlugState();
12660 }
12661 }
12662
12663
12665 {
12666 super.OnPlacementStarted(player);
12667
12669 }
12670
12671 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12672 {
12674 {
12675 m_AdminLog.OnPlacementComplete(player,
this);
12676 }
12677
12678 super.OnPlacementComplete(player, position, orientation);
12679 }
12680
12681
12682
12683
12684
12686 {
12688 {
12689 return true;
12690 }
12691 else
12692 {
12693 return false;
12694 }
12695 }
12696
12697
12699 {
12701 {
12703 }
12704 }
12705
12706
12708 {
12710 }
12711
12713 {
12715 }
12716
12717 override void InsertAgent(
int agent,
float count = 1)
12718 {
12719 if (count < 1)
12720 return;
12721
12723 }
12724
12727 {
12729 }
12730
12731
12733 {
12735 }
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12779 {
12781 return false;
12782 return true;
12783 }
12784
12786 {
12787
12789 }
12790
12791
12794 {
12795 super.CheckForRoofLimited(timeTresholdMS);
12796
12798 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12799 {
12800 m_PreviousRoofTestTime = time;
12801 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12802 }
12803 }
12804
12805
12807 {
12809 {
12810 return 0;
12811 }
12812
12813 if (GetInventory().GetAttachmentSlotsCount() != 0)
12814 {
12815 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12816 if (filter)
12817 return filter.GetProtectionLevel(type, false, system);
12818 else
12819 return 0;
12820 }
12821
12822 string subclassPath, entryName;
12823
12824 switch (type)
12825 {
12827 entryName = "biological";
12828 break;
12830 entryName = "chemical";
12831 break;
12832 default:
12833 entryName = "biological";
12834 break;
12835 }
12836
12837 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12838
12840 }
12841
12842
12843
12846 {
12847 if (!IsMagazine())
12849
12851 }
12852
12853
12854
12855
12856
12861 {
12862 return true;
12863 }
12864
12866 {
12868 }
12869
12870
12871
12872
12873
12875 {
12876 if (parent)
12877 {
12878 if (parent.IsInherited(DayZInfected))
12879 return true;
12880
12881 if (!parent.IsRuined())
12882 return true;
12883 }
12884
12885 return true;
12886 }
12887
12889 {
12890 if (!super.CanPutAsAttachment(parent))
12891 {
12892 return false;
12893 }
12894
12895 if (!IsRuined() && !parent.IsRuined())
12896 {
12897 return true;
12898 }
12899
12900 return false;
12901 }
12902
12904 {
12905
12906
12907
12908
12909 return super.CanReceiveItemIntoCargo(item);
12910 }
12911
12913 {
12914
12915
12916
12917
12918 GameInventory attachmentInv = attachment.GetInventory();
12920 {
12921 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12922 return false;
12923 }
12924
12925 InventoryLocation loc = new InventoryLocation();
12926 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12927 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12928 return false;
12929
12930 return super.CanReceiveAttachment(attachment, slotId);
12931 }
12932
12934 {
12935 if (!super.CanReleaseAttachment(attachment))
12936 return false;
12937
12938 return GetInventory().AreChildrenAccessible();
12939 }
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12962 {
12963 int id = muzzle_owner.GetMuzzleID();
12964 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12965
12966 if (WPOF_array)
12967 {
12968 for (int i = 0; i < WPOF_array.Count(); i++)
12969 {
12970 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12971
12972 if (WPOF)
12973 {
12974 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12975 }
12976 }
12977 }
12978 }
12979
12980
12982 {
12983 int id = muzzle_owner.GetMuzzleID();
12985
12986 if (WPOBE_array)
12987 {
12988 for (int i = 0; i < WPOBE_array.Count(); i++)
12989 {
12990 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12991
12992 if (WPOBE)
12993 {
12994 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12995 }
12996 }
12997 }
12998 }
12999
13000
13002 {
13003 int id = muzzle_owner.GetMuzzleID();
13004 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13005
13006 if (WPOOH_array)
13007 {
13008 for (int i = 0; i < WPOOH_array.Count(); i++)
13009 {
13010 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13011
13012 if (WPOOH)
13013 {
13014 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13015 }
13016 }
13017 }
13018 }
13019
13020
13022 {
13023 int id = muzzle_owner.GetMuzzleID();
13024 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13025
13026 if (WPOOH_array)
13027 {
13028 for (int i = 0; i < WPOOH_array.Count(); i++)
13029 {
13030 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13031
13032 if (WPOOH)
13033 {
13034 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13035 }
13036 }
13037 }
13038 }
13039
13040
13042 {
13043 int id = muzzle_owner.GetMuzzleID();
13044 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13045
13046 if (WPOOH_array)
13047 {
13048 for (int i = 0; i < WPOOH_array.Count(); i++)
13049 {
13050 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13051
13052 if (WPOOH)
13053 {
13054 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13055 }
13056 }
13057 }
13058 }
13059
13060
13061
13063 {
13065 {
13066 return true;
13067 }
13068
13069 return false;
13070 }
13071
13073 {
13075 {
13076 return true;
13077 }
13078
13079 return false;
13080 }
13081
13083 {
13085 {
13086 return true;
13087 }
13088
13089 return false;
13090 }
13091
13093 {
13094 return false;
13095 }
13096
13099 {
13100 return UATimeSpent.DEFAULT_DEPLOY;
13101 }
13102
13103
13104
13105
13107 {
13109 SetSynchDirty();
13110 }
13111
13113 {
13115 }
13116
13117
13119 {
13120 return false;
13121 }
13122
13125 {
13126 string att_type = "None";
13127
13128 if (ConfigIsExisting("soundAttType"))
13129 {
13130 att_type = ConfigGetString("soundAttType");
13131 }
13132
13134 }
13135
13137 {
13139 }
13140
13141
13142
13143
13144
13150
13152 {
13155
13157 }
13158
13159
13161 {
13163 return;
13164
13166
13169
13172
13173 SoundParameters params = new SoundParameters();
13177 }
13178
13179
13181 {
13183 return;
13184
13186 SetSynchDirty();
13187
13190 }
13191
13192
13194 {
13196 return;
13197
13199 SetSynchDirty();
13200
13203 }
13204
13206 {
13208 }
13209
13211 {
13213 }
13214
13217 {
13218 if (!
GetGame().IsDedicatedServer())
13219 {
13220 if (ConfigIsExisting("attachSoundSet"))
13221 {
13222 string cfg_path = "";
13223 string soundset = "";
13224 string type_name =
GetType();
13225
13228 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13229 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13230
13231 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13232 {
13233 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13234 {
13235 if (cfg_slot_array[i] == slot_type)
13236 {
13237 soundset = cfg_soundset_array[i];
13238 break;
13239 }
13240 }
13241 }
13242
13243 if (soundset != "")
13244 {
13245 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13247 }
13248 }
13249 }
13250 }
13251
13253 {
13254
13255 }
13256
13257 void OnApply(PlayerBase player);
13258
13260 {
13261 return 1.0;
13262 };
13263
13265 {
13267 }
13268
13270 {
13272 }
13273
13275
13277 {
13278 SetDynamicPhysicsLifeTime(0.01);
13280 }
13281
13283 {
13284 array<string> zone_names = new array<string>;
13285 GetDamageZones(zone_names);
13286 for (int i = 0; i < zone_names.Count(); i++)
13287 {
13288 SetHealthMax(zone_names.Get(i),"Health");
13289 }
13290 SetHealthMax("","Health");
13291 }
13292
13295 {
13296 float global_health = GetHealth01("","Health");
13297 array<string> zones = new array<string>;
13298 GetDamageZones(zones);
13299
13300 for (int i = 0; i < zones.Count(); i++)
13301 {
13302 SetHealth01(zones.Get(i),"Health",global_health);
13303 }
13304 }
13305
13308 {
13309 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13310 }
13311
13313 {
13314 if (!hasRootAsPlayer)
13315 {
13316 if (refParentIB)
13317 {
13318
13319 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13320 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13321
13322 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13323 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13324
13327 }
13328 else
13329 {
13330
13333 }
13334 }
13335 }
13336
13338 {
13340 {
13341 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13342 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13343 {
13344 float heatPermCoef = 1.0;
13346 while (ent)
13347 {
13348 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13349 ent = ent.GetHierarchyParent();
13350 }
13351
13352 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13353 }
13354 }
13355 }
13356
13358 {
13359
13360 EntityAI parent = GetHierarchyParent();
13361 if (!parent)
13362 {
13363 hasParent = false;
13364 hasRootAsPlayer = false;
13365 }
13366 else
13367 {
13368 hasParent = true;
13369 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13370 refParentIB =
ItemBase.Cast(parent);
13371 }
13372 }
13373
13374 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13375 {
13376
13377 }
13378
13380 {
13381
13382 return false;
13383 }
13384
13386 {
13387
13388
13389 return false;
13390 }
13391
13393 {
13394
13395 return false;
13396 }
13397
13400 {
13401 return !GetIsFrozen() &&
IsOpen();
13402 }
13403
13405 {
13406 bool hasParent = false, hasRootAsPlayer = false;
13408
13409 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13410 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13411
13412 if (wwtu || foodDecay)
13413 {
13417
13418 if (processWetness || processTemperature || processDecay)
13419 {
13421
13422 if (processWetness)
13423 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13424
13425 if (processTemperature)
13427
13428 if (processDecay)
13429 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13430 }
13431 }
13432 }
13433
13436 {
13438 }
13439
13441 {
13444
13445 return super.GetTemperatureFreezeThreshold();
13446 }
13447
13449 {
13452
13453 return super.GetTemperatureThawThreshold();
13454 }
13455
13457 {
13460
13461 return super.GetItemOverheatThreshold();
13462 }
13463
13465 {
13467 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13468
13469 return super.GetTemperatureFreezeTime();
13470 }
13471
13473 {
13475 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13476
13477 return super.GetTemperatureThawTime();
13478 }
13479
13484
13486 {
13487 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13488 }
13489
13491 {
13492 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13493 }
13494
13497 {
13499 }
13500
13502 {
13504 }
13505
13507 {
13509 }
13510
13513 {
13514 return null;
13515 }
13516
13519 {
13520 return false;
13521 }
13522
13524 {
13526 {
13529 if (!trg)
13530 {
13532 explosive = this;
13533 }
13534
13535 explosive.PairRemote(trg);
13537
13538 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13539 trg.SetPersistentPairID(persistentID);
13540 explosive.SetPersistentPairID(persistentID);
13541
13542 return true;
13543 }
13544 return false;
13545 }
13546
13549 {
13550 float ret = 1.0;
13553 ret *= GetHealth01();
13554
13555 return ret;
13556 }
13557
13558 #ifdef DEVELOPER
13559 override void SetDebugItem()
13560 {
13561 super.SetDebugItem();
13562 _itemBase = this;
13563 }
13564
13566 {
13567 string text = super.GetDebugText();
13568
13570 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13571
13572 return text;
13573 }
13574 #endif
13575
13577 {
13578 return true;
13579 }
13580
13582
13584
13586 {
13589 }
13590
13591
13599
13615}
13616
13618{
13620 if (entity)
13621 {
13622 bool is_item = entity.IsInherited(
ItemBase);
13623 if (is_item && full_quantity)
13624 {
13627 }
13628 }
13629 else
13630 {
13632 return NULL;
13633 }
13634 return entity;
13635}
13636
13638{
13639 if (item)
13640 {
13641 if (health > 0)
13642 item.SetHealth("", "", health);
13643
13644 if (item.CanHaveTemperature())
13645 {
13647 if (item.CanFreeze())
13648 item.SetFrozen(false);
13649 }
13650
13651 if (item.HasEnergyManager())
13652 {
13653 if (quantity >= 0)
13654 {
13655 item.GetCompEM().SetEnergy0To1(quantity);
13656 }
13657 else
13658 {
13660 }
13661 }
13662 else if (item.IsMagazine())
13663 {
13664 Magazine mag = Magazine.Cast(item);
13665 if (quantity >= 0)
13666 {
13667 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13668 }
13669 else
13670 {
13672 }
13673
13674 }
13675 else
13676 {
13677 if (quantity >= 0)
13678 {
13679 item.SetQuantityNormalized(quantity, false);
13680 }
13681 else
13682 {
13684 }
13685
13686 }
13687 }
13688}
13689
13690#ifdef DEVELOPER
13692#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.