8814{
8816 {
8817 return true;
8818 }
8819};
8820
8821
8822
8824{
8828
8830
8833
8834
8835
8836
8837
8846
8852
8857
8862
8883 protected bool m_IsResultOfSplit
8884
8886
8891
8892
8893
8895
8899
8900
8901
8903
8906
8907
8908
8914
8915
8923
8926
8927
8929
8930
8932
8933
8938
8939
8944
8945
8947
8948
8950 {
8955
8956 if (!
GetGame().IsDedicatedServer())
8957 {
8959 {
8961
8963 {
8965 }
8966 }
8967
8970 }
8971
8972 m_OldLocation = null;
8973
8975 {
8977 }
8978
8979 if (ConfigIsExisting("headSelectionsToHide"))
8980 {
8983 }
8984
8986 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8987 {
8989 }
8990
8992
8993 m_IsResultOfSplit = false;
8994
8996 }
8997
8999 {
9000 super.InitItemVariables();
9001
9007 m_Count = ConfigGetInt(
"count");
9008
9011
9016
9019
9024
9036
9040
9041
9044 if (ConfigIsExisting("canBeSplit"))
9045 {
9048 }
9049
9051 if (ConfigIsExisting("itemBehaviour"))
9053
9054
9057 RegisterNetSyncVariableInt("m_VarLiquidType");
9058 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9059
9060 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9061 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9062 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9063
9064 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9065 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9066 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9067 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9068
9069 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9070 RegisterNetSyncVariableBool("m_IsTakeable");
9071 RegisterNetSyncVariableBool("m_IsHologram");
9072
9075 {
9078 }
9079
9081
9083 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9085
9086 }
9087
9089 {
9091 }
9092
9094 {
9097 {
9102 }
9103 }
9104
9105 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9106 {
9108 {
9111 }
9112
9114 }
9115
9117 {
9123 }
9124
9126
9128 {
9130
9131 if (!action)
9132 {
9133 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9134 return;
9135 }
9136
9138 if (!ai)
9139 {
9141 return;
9142 }
9143
9145 if (!action_array)
9146 {
9147 action_array = new array<ActionBase_Basic>;
9149 }
9150 if (LogManager.IsActionLogEnable())
9151 {
9152 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9153 }
9154
9155 if (action_array.Find(action) != -1)
9156 {
9157 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9158 }
9159 else
9160 {
9161 action_array.Insert(action);
9162 }
9163 }
9164
9166 {
9168 ActionBase action = player.GetActionManager().GetAction(actionName);
9171
9172 if (action_array)
9173 {
9174 action_array.RemoveItem(action);
9175 }
9176 }
9177
9178
9179
9181 {
9182 ActionOverrideData overrideData = new ActionOverrideData();
9186
9188 if (!actionMap)
9189 {
9192 }
9193
9194 actionMap.Insert(this.
Type(), overrideData);
9195
9196 }
9197
9199
9201
9202
9204 {
9207
9210
9211 string config_to_search = "CfgVehicles";
9212 string muzzle_owner_config;
9213
9215 {
9216 if (IsInherited(Weapon))
9217 config_to_search = "CfgWeapons";
9218
9219 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9220
9221 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9222
9224
9225 if (config_OnFire_subclass_count > 0)
9226 {
9227 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9228
9229 for (int i = 0; i < config_OnFire_subclass_count; i++)
9230 {
9231 string particle_class = "";
9233 string config_OnFire_entry = config_OnFire_class + particle_class;
9234 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9235 WPOF_array.Insert(WPOF);
9236 }
9237
9238
9240 }
9241 }
9242
9244 {
9245 config_to_search = "CfgWeapons";
9246 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9247
9248 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9249
9251
9252 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9253 {
9254 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9255
9256 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9257 {
9258 string particle_class2 = "";
9260 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9261 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9262 WPOBE_array.Insert(WPOBE);
9263 }
9264
9265
9267 }
9268 }
9269 }
9270
9271
9273 {
9276
9278 {
9279 string config_to_search = "CfgVehicles";
9280
9281 if (IsInherited(Weapon))
9282 config_to_search = "CfgWeapons";
9283
9284 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9285 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9286
9287 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9288 {
9289
9291
9293 {
9295 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9297 return;
9298 }
9299
9302
9303
9304
9306 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9307
9308 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9309 {
9310 string particle_class = "";
9312 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9314
9315 if (entry_type == CT_CLASS)
9316 {
9317 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9318 WPOOH_array.Insert(WPOF);
9319 }
9320 }
9321
9322
9324 }
9325 }
9326 }
9327
9329 {
9331 }
9332
9334 {
9336 {
9338
9341
9344
9345 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9346 }
9347 }
9348
9350 {
9352 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9353
9355 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9356
9358 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9359
9361 {
9363 }
9364 }
9365
9367 {
9369 }
9370
9372 {
9375 else
9377
9379 {
9382 }
9383 else
9384 {
9387
9390 }
9391
9393 }
9394
9396 {
9398 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9399 }
9400
9402 {
9404 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9406 }
9407
9409 {
9411 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9412 }
9413
9415 {
9418
9419 OverheatingParticle OP = new OverheatingParticle();
9424
9426 }
9427
9429 {
9432
9433 return -1;
9434 }
9435
9437 {
9439 {
9442
9443 for (int i = count; i > 0; --i)
9444 {
9445 int id = i - 1;
9448
9451
9452 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9453 {
9454 if (p)
9455 {
9458 }
9459 }
9460 }
9461 }
9462 }
9463
9465 {
9467 {
9469 {
9470 int id = i - 1;
9472
9473 if (OP)
9474 {
9476
9477 if (p)
9478 {
9480 }
9481
9482 delete OP;
9483 }
9484 }
9485
9488 }
9489 }
9490
9493 {
9494 return 0.0;
9495 }
9496
9497
9499 {
9500 return 250;
9501 }
9502
9504 {
9505 return 0;
9506 }
9507
9510 {
9512 return true;
9513
9514 return false;
9515 }
9516
9519 {
9522
9524 {
9526 }
9527 else
9528 {
9529
9531 }
9532
9534 }
9535
9542 {
9543 return -1;
9544 }
9545
9546
9547
9548
9550 {
9552 {
9554 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9555
9556 if (r_index >= 0)
9557 {
9558 InventoryLocation r_il = new InventoryLocation;
9559 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9560
9561 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9564 {
9565 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9566 }
9568 {
9569 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9570 }
9571
9572 }
9573
9574 player.GetHumanInventory().ClearUserReservedLocation(this);
9575 }
9576
9579 }
9580
9581
9582
9583
9585 {
9586 return ItemBase.m_DebugActionsMask;
9587 }
9588
9590 {
9591 return ItemBase.m_DebugActionsMask & mask;
9592 }
9593
9595 {
9596 ItemBase.m_DebugActionsMask = mask;
9597 }
9598
9600 {
9601 ItemBase.m_DebugActionsMask |= mask;
9602 }
9603
9605 {
9606 ItemBase.m_DebugActionsMask &= ~mask;
9607 }
9608
9610 {
9612 {
9614 }
9615 else
9616 {
9618 }
9619 }
9620
9621
9623 {
9624 if (GetEconomyProfile())
9625 {
9626 float q_max = GetEconomyProfile().GetQuantityMax();
9627 if (q_max > 0)
9628 {
9629 float q_min = GetEconomyProfile().GetQuantityMin();
9630 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9631
9633 {
9634 ComponentEnergyManager comp = GetCompEM();
9636 {
9638 }
9639 }
9641 {
9643
9644 }
9645
9646 }
9647 }
9648 }
9649
9652 {
9653 EntityAI parent = GetHierarchyParent();
9654
9655 if (parent)
9656 {
9657 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9658 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9659 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9660 }
9661 }
9662
9665 {
9666 EntityAI parent = GetHierarchyParent();
9667
9668 if (parent)
9669 {
9670 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9671 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9672 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9673 }
9674 }
9675
9677 {
9678
9679
9680
9681
9683
9685 {
9686 if (ScriptInputUserData.CanStoreInputUserData())
9687 {
9688 ScriptInputUserData ctx = new ScriptInputUserData;
9694 ctx.
Write(use_stack_max);
9697
9699 {
9700 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9701 }
9702 }
9703 }
9704 else if (!
GetGame().IsMultiplayer())
9705 {
9707 }
9708 }
9709
9711 {
9713 }
9714
9716 {
9718 }
9719
9721 {
9723 }
9724
9726 {
9727
9728 return false;
9729 }
9730
9732 {
9733 return false;
9734 }
9735
9739 {
9740 return false;
9741 }
9742
9744 {
9745 return "";
9746 }
9747
9749
9751 {
9752 return false;
9753 }
9754
9756 {
9757 return true;
9758 }
9759
9760
9761
9763 {
9764 return true;
9765 }
9766
9768 {
9769 return true;
9770 }
9771
9773 {
9774 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9776 }
9777
9779 {
9781 }
9782
9784 {
9786 if (!is_being_placed)
9788 SetSynchDirty();
9789 }
9790
9791
9793
9795 {
9797 }
9798
9800 {
9802 }
9803
9805 {
9806 return 1;
9807 }
9808
9810 {
9811 return false;
9812 }
9813
9815 {
9817 SetSynchDirty();
9818 }
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9855 {
9856 super.OnMovedInsideCargo(container);
9857
9858 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9859 }
9860
9861 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9862 {
9863 super.EEItemLocationChanged(oldLoc,newLoc);
9864
9865 PlayerBase new_player = null;
9866 PlayerBase old_player = null;
9867
9868 if (newLoc.GetParent())
9869 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9870
9871 if (oldLoc.GetParent())
9872 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9873
9875 {
9876 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9877
9878 if (r_index >= 0)
9879 {
9880 InventoryLocation r_il = new InventoryLocation;
9881 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9882
9883 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9886 {
9887 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9888 }
9890 {
9891 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9892 }
9893
9894 }
9895 }
9896
9898 {
9899 if (new_player)
9900 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9901
9902 if (new_player == old_player)
9903 {
9904
9905 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9906 {
9908 {
9909 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9910 {
9911 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9912 }
9913 }
9914 else
9915 {
9916 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9917 }
9918 }
9919
9920 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9921 {
9922 int type = oldLoc.GetType();
9924 {
9925 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9926 }
9928 {
9929 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9930 }
9931 }
9932 if (!m_OldLocation)
9933 {
9934 m_OldLocation = new InventoryLocation;
9935 }
9936 m_OldLocation.Copy(oldLoc);
9937 }
9938 else
9939 {
9940 if (m_OldLocation)
9941 {
9942 m_OldLocation.Reset();
9943 }
9944 }
9945
9947 }
9948 else
9949 {
9950 if (new_player)
9951 {
9952 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9953 if (res_index >= 0)
9954 {
9955 InventoryLocation il = new InventoryLocation;
9956 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9958 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9961 {
9962 il.
GetParent().GetOnReleaseLock().Invoke(it);
9963 }
9965 {
9967 }
9968
9969 }
9970 }
9972 {
9973
9975 }
9976
9977 if (m_OldLocation)
9978 {
9979 m_OldLocation.Reset();
9980 }
9981 }
9982 }
9983
9984 override void EOnContact(IEntity other, Contact extra)
9985 {
9987 {
9988 int liquidType = -1;
9990 if (impactSpeed > 0.0)
9991 {
9993 #ifndef SERVER
9995 #else
9997 SetSynchDirty();
9998 #endif
10000 }
10001 }
10002
10003 #ifdef SERVER
10004 if (GetCompEM() && GetCompEM().IsPlugged())
10005 {
10006 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10007 GetCompEM().UnplugThis();
10008 }
10009 #endif
10010 }
10011
10013
10015 {
10017 }
10018
10020 {
10021
10022 }
10023
10025 {
10026 super.OnItemLocationChanged(old_owner, new_owner);
10027
10028 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10029 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10030
10031 if (!relatedPlayer && playerNew)
10032 relatedPlayer = playerNew;
10033
10034 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10035 {
10037 if (actionMgr)
10038 {
10039 ActionBase currentAction = actionMgr.GetRunningAction();
10040 if (currentAction)
10042 }
10043 }
10044
10045 Man ownerPlayerOld = null;
10046 Man ownerPlayerNew = null;
10047
10048 if (old_owner)
10049 {
10050 if (old_owner.
IsMan())
10051 {
10052 ownerPlayerOld = Man.Cast(old_owner);
10053 }
10054 else
10055 {
10056 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10057 }
10058 }
10059 else
10060 {
10062 {
10064
10065 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10066 {
10067 GetCompEM().UnplugThis();
10068 }
10069 }
10070 }
10071
10072 if (new_owner)
10073 {
10074 if (new_owner.
IsMan())
10075 {
10076 ownerPlayerNew = Man.Cast(new_owner);
10077 }
10078 else
10079 {
10080 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10081 }
10082 }
10083
10084 if (ownerPlayerOld != ownerPlayerNew)
10085 {
10086 if (ownerPlayerOld)
10087 {
10088 array<EntityAI> subItemsExit = new array<EntityAI>;
10090 for (int i = 0; i < subItemsExit.Count(); i++)
10091 {
10094 }
10095 }
10096
10097 if (ownerPlayerNew)
10098 {
10099 array<EntityAI> subItemsEnter = new array<EntityAI>;
10101 for (int j = 0; j < subItemsEnter.Count(); j++)
10102 {
10105 }
10106 }
10107 }
10108 else if (ownerPlayerNew != null)
10109 {
10110 PlayerBase nplayer;
10111 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10112 {
10113 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10115 for (int k = 0; k < subItemsUpdate.Count(); k++)
10116 {
10118 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10119 }
10120 }
10121 }
10122
10123 if (old_owner)
10124 old_owner.OnChildItemRemoved(this);
10125 if (new_owner)
10126 new_owner.OnChildItemReceived(this);
10127 }
10128
10129
10131 {
10132 super.EEDelete(parent);
10133 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10134 if (player)
10135 {
10137
10138 if (player.IsAlive())
10139 {
10140 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10141 if (r_index >= 0)
10142 {
10143 InventoryLocation r_il = new InventoryLocation;
10144 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10145
10146 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10149 {
10150 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10151 }
10153 {
10154 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10155 }
10156
10157 }
10158
10159 player.RemoveQuickBarEntityShortcut(this);
10160 }
10161 }
10162 }
10163
10165 {
10166 super.EEKilled(killer);
10167
10170 {
10171 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10172 {
10173 if (IsMagazine())
10174 {
10175 if (Magazine.Cast(this).GetAmmoCount() > 0)
10176 {
10178 }
10179 }
10180 else
10181 {
10183 }
10184 }
10185 }
10186 }
10187
10189 {
10190 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10191
10192 super.OnWasAttached(parent, slot_id);
10193
10196
10198 }
10199
10201 {
10202 super.OnWasDetached(parent, slot_id);
10203
10206 }
10207
10209 {
10210 int idx;
10213
10214 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10215 if (inventory_slots.Count() < 1)
10216 {
10217 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10218 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10219 }
10220 else
10221 {
10222 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10223 }
10224
10225 idx = inventory_slots.Find(slot);
10226 if (idx < 0)
10227 return "";
10228
10229 return attach_types.Get(idx);
10230 }
10231
10233 {
10234 int idx = -1;
10235 string slot;
10236
10239
10240 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10241 if (inventory_slots.Count() < 1)
10242 {
10243 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10244 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10245 }
10246 else
10247 {
10248 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10249 if (detach_types.Count() < 1)
10250 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10251 }
10252
10253 for (int i = 0; i < inventory_slots.Count(); i++)
10254 {
10255 slot = inventory_slots.Get(i);
10256 }
10257
10258 if (slot != "")
10259 {
10260 if (detach_types.Count() == 1)
10261 idx = 0;
10262 else
10263 idx = inventory_slots.Find(slot);
10264 }
10265 if (idx < 0)
10266 return "";
10267
10268 return detach_types.Get(idx);
10269 }
10270
10272 {
10273
10275
10276
10277 float min_time = 1;
10278 float max_time = 3;
10279 float delay = Math.RandomFloat(min_time, max_time);
10280
10281 explode_timer.Run(delay, this, "DoAmmoExplosion");
10282 }
10283
10285 {
10286 Magazine magazine = Magazine.Cast(this);
10287 int pop_sounds_count = 6;
10288 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10289
10290
10291 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10292 string sound_name = pop_sounds[ sound_idx ];
10294
10295
10296 magazine.ServerAddAmmoCount(-1);
10297
10298
10299 float min_temp_to_explode = 100;
10300
10301 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10302 {
10304 }
10305 }
10306
10307
10308 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10309 {
10310 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10311
10312 const int CHANCE_DAMAGE_CARGO = 4;
10313 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10314 const int CHANCE_DAMAGE_NOTHING = 2;
10315
10317 {
10318 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10319 int chances;
10320 int rnd;
10321
10322 if (GetInventory().GetCargo())
10323 {
10324 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10325 rnd = Math.RandomInt(0,chances);
10326
10327 if (rnd < CHANCE_DAMAGE_CARGO)
10328 {
10330 }
10331 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10332 {
10334 }
10335 }
10336 else
10337 {
10338 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10339 rnd = Math.RandomInt(0,chances);
10340
10341 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10342 {
10344 }
10345 }
10346 }
10347 }
10348
10350 {
10351 if (GetInventory().GetCargo())
10352 {
10353 int item_count = GetInventory().GetCargo().GetItemCount();
10354 if (item_count > 0)
10355 {
10356 int random_pick = Math.RandomInt(0, item_count);
10358 if (!item.IsExplosive())
10359 {
10360 item.AddHealth("","",damage);
10361 return true;
10362 }
10363 }
10364 }
10365 return false;
10366 }
10367
10369 {
10370 int attachment_count = GetInventory().AttachmentCount();
10371 if (attachment_count > 0)
10372 {
10373 int random_pick = Math.RandomInt(0, attachment_count);
10374 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10375 if (!attachment.IsExplosive())
10376 {
10377 attachment.AddHealth("","",damage);
10378 return true;
10379 }
10380 }
10381 return false;
10382 }
10383
10385 {
10387 }
10388
10390 {
10392 return GetInventory().CanRemoveEntity();
10393
10394 return false;
10395 }
10396
10398 {
10400 return;
10401
10403 {
10404 if (ScriptInputUserData.CanStoreInputUserData())
10405 {
10406 ScriptInputUserData ctx = new ScriptInputUserData;
10411 ctx.
Write(destination_entity);
10413 ctx.
Write(slot_id);
10415 }
10416 }
10417 else if (!
GetGame().IsMultiplayer())
10418 {
10420 }
10421 }
10422
10424 {
10426 return;
10427
10428 float split_quantity_new;
10432 InventoryLocation loc = new InventoryLocation;
10433
10434 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10435 {
10437 split_quantity_new = stack_max;
10438 else
10440
10441 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10442 if (new_item)
10443 {
10444 new_item.SetResultOfSplit(true);
10445 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10447 new_item.SetQuantity(split_quantity_new);
10448 }
10449 }
10450 else if (destination_entity && slot_id == -1)
10451 {
10452 if (quantity > stack_max)
10453 split_quantity_new = stack_max;
10454 else
10455 split_quantity_new = quantity;
10456
10458 {
10461 }
10462
10463 if (new_item)
10464 {
10465 new_item.SetResultOfSplit(true);
10466 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10468 new_item.SetQuantity(split_quantity_new);
10469 }
10470 }
10471 else
10472 {
10473 if (stack_max != 0)
10474 {
10476 {
10478 }
10479
10480 if (split_quantity_new == 0)
10481 {
10482 if (!
GetGame().IsMultiplayer())
10483 player.PhysicalPredictiveDropItem(this);
10484 else
10485 player.ServerDropEntity(this);
10486 return;
10487 }
10488
10490
10491 if (new_item)
10492 {
10493 new_item.SetResultOfSplit(true);
10494 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10496 new_item.SetQuantity(stack_max);
10497 new_item.PlaceOnSurface();
10498 }
10499 }
10500 }
10501 }
10502
10504 {
10506 return;
10507
10508 float split_quantity_new;
10512 InventoryLocation loc = new InventoryLocation;
10513
10514 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10515 {
10517 split_quantity_new = stack_max;
10518 else
10520
10521 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10522 if (new_item)
10523 {
10524 new_item.SetResultOfSplit(true);
10525 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10527 new_item.SetQuantity(split_quantity_new);
10528 }
10529 }
10530 else if (destination_entity && slot_id == -1)
10531 {
10532 if (quantity > stack_max)
10533 split_quantity_new = stack_max;
10534 else
10535 split_quantity_new = quantity;
10536
10538 {
10541 }
10542
10543 if (new_item)
10544 {
10545 new_item.SetResultOfSplit(true);
10546 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10548 new_item.SetQuantity(split_quantity_new);
10549 }
10550 }
10551 else
10552 {
10553 if (stack_max != 0)
10554 {
10556 {
10558 }
10559
10561
10562 if (new_item)
10563 {
10564 new_item.SetResultOfSplit(true);
10565 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10567 new_item.SetQuantity(stack_max);
10568 new_item.PlaceOnSurface();
10569 }
10570 }
10571 }
10572 }
10573
10575 {
10577 return;
10578
10580 {
10581 if (ScriptInputUserData.CanStoreInputUserData())
10582 {
10583 ScriptInputUserData ctx = new ScriptInputUserData;
10588 dst.WriteToContext(ctx);
10590 }
10591 }
10592 else if (!
GetGame().IsMultiplayer())
10593 {
10595 }
10596 }
10597
10599 {
10601 return;
10602
10604 {
10605 if (ScriptInputUserData.CanStoreInputUserData())
10606 {
10607 ScriptInputUserData ctx = new ScriptInputUserData;
10612 ctx.
Write(destination_entity);
10618 }
10619 }
10620 else if (!
GetGame().IsMultiplayer())
10621 {
10623 }
10624 }
10625
10627 {
10629 }
10630
10632 {
10634 return this;
10635
10637 float split_quantity_new;
10639 if (dst.IsValid())
10640 {
10641 int slot_id = dst.GetSlot();
10643
10644 if (quantity > stack_max)
10645 split_quantity_new = stack_max;
10646 else
10647 split_quantity_new = quantity;
10648
10650
10651 if (new_item)
10652 {
10653 new_item.SetResultOfSplit(true);
10654 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10657 }
10658
10659 return new_item;
10660 }
10661
10662 return null;
10663 }
10664
10666 {
10668 return;
10669
10671 float split_quantity_new;
10673 if (destination_entity)
10674 {
10676 if (quantity > stackable)
10677 split_quantity_new = stackable;
10678 else
10679 split_quantity_new = quantity;
10680
10681 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10682 if (new_item)
10683 {
10684 new_item.SetResultOfSplit(true);
10685 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10687 new_item.SetQuantity(split_quantity_new);
10688 }
10689 }
10690 }
10691
10693 {
10695 return;
10696
10698 {
10699 if (ScriptInputUserData.CanStoreInputUserData())
10700 {
10701 ScriptInputUserData ctx = new ScriptInputUserData;
10706 ItemBase destination_entity =
this;
10707 ctx.
Write(destination_entity);
10711 }
10712 }
10713 else if (!
GetGame().IsMultiplayer())
10714 {
10716 }
10717 }
10718
10720 {
10722 return;
10723
10725 float split_quantity_new;
10727 if (player)
10728 {
10730 if (quantity > stackable)
10731 split_quantity_new = stackable;
10732 else
10733 split_quantity_new = quantity;
10734
10735 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10736 new_item =
ItemBase.Cast(in_hands);
10737 if (new_item)
10738 {
10739 new_item.SetResultOfSplit(true);
10740 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10742 new_item.SetQuantity(split_quantity_new);
10743 }
10744 }
10745 }
10746
10748 {
10750 return;
10751
10753 float split_quantity_new = Math.Floor(quantity * 0.5);
10754
10756
10757 if (new_item)
10758 {
10759 if (new_item.GetQuantityMax() < split_quantity_new)
10760 {
10761 split_quantity_new = new_item.GetQuantityMax();
10762 }
10763
10764 new_item.SetResultOfSplit(true);
10765 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10766
10768 {
10771 }
10772 else
10773 {
10776 }
10777 }
10778 }
10779
10781 {
10783 return;
10784
10786 float split_quantity_new = Math.Floor(quantity / 2);
10787
10788 InventoryLocation invloc = new InventoryLocation;
10790
10792 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10793
10794 if (new_item)
10795 {
10796 if (new_item.GetQuantityMax() < split_quantity_new)
10797 {
10798 split_quantity_new = new_item.GetQuantityMax();
10799 }
10801 {
10804 }
10805 else
10806 {
10809 }
10810 }
10811 }
10812
10815 {
10816 SetWeightDirty();
10818
10819 if (parent)
10820 parent.OnAttachmentQuantityChangedEx(this, delta);
10821
10823 {
10825 {
10827 }
10829 {
10830 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10832 }
10833 }
10834
10835 }
10836
10839 {
10840
10841 }
10842
10845 {
10847 }
10848
10850 {
10851 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10852
10854 {
10855 if (newLevel == GameConstants.STATE_RUINED)
10856 {
10858 EntityAI parent = GetHierarchyParent();
10859 if (parent && parent.IsFireplace())
10860 {
10861 CargoBase cargo = GetInventory().GetCargo();
10862 if (cargo)
10863 {
10865 {
10867 }
10868 }
10869 }
10870 }
10871
10873 {
10874
10876 return;
10877 }
10878
10879 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10880 {
10882 }
10883 }
10884 }
10885
10886
10888 {
10889 super.OnRightClick();
10890
10892 {
10894 {
10895 if (ScriptInputUserData.CanStoreInputUserData())
10896 {
10897 vector m4[4];
10899
10900 EntityAI root = GetHierarchyRoot();
10901
10902 InventoryLocation dst = new InventoryLocation;
10904 {
10905 if (root)
10906 {
10907 root.GetTransform(m4);
10909 }
10910 else
10911 GetInventory().GetCurrentInventoryLocation(dst);
10912 }
10913 else
10914 {
10916
10917
10918 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10919 {
10920 if (root)
10921 {
10922 root.GetTransform(m4);
10924 }
10925 else
10926 GetInventory().GetCurrentInventoryLocation(dst);
10927 }
10928 else
10929 {
10930 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10931 }
10932 }
10933
10934 ScriptInputUserData ctx = new ScriptInputUserData;
10942 }
10943 }
10944 else if (!
GetGame().IsMultiplayer())
10945 {
10947 }
10948 }
10949 }
10950
10951 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10952 {
10953
10954 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10955 return false;
10956
10957 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10958 return false;
10959
10960
10962 return false;
10963
10964
10965 Magazine mag = Magazine.Cast(this);
10966 if (mag)
10967 {
10968 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10969 return false;
10970
10971 if (stack_max_limit)
10972 {
10973 Magazine other_mag = Magazine.Cast(other_item);
10974 if (other_item)
10975 {
10976 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10977 return false;
10978 }
10979
10980 }
10981 }
10982 else
10983 {
10984
10986 return false;
10987
10989 return false;
10990 }
10991
10992 PlayerBase player = null;
10993 if (CastTo(player, GetHierarchyRootPlayer()))
10994 {
10995 if (player.GetInventory().HasAttachment(this))
10996 return false;
10997
10998 if (player.IsItemsToDelete())
10999 return false;
11000 }
11001
11002 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11003 return false;
11004
11005 int slotID;
11007 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11008 return false;
11009
11010 return true;
11011 }
11012
11014 {
11016 }
11017
11019 {
11020 return m_IsResultOfSplit;
11021 }
11022
11024 {
11025 m_IsResultOfSplit = value;
11026 }
11027
11029 {
11031 }
11032
11034 {
11035 float other_item_quantity = other_item.GetQuantity();
11036 float this_free_space;
11037
11039
11041
11042 if (other_item_quantity > this_free_space)
11043 {
11044 return this_free_space;
11045 }
11046 else
11047 {
11048 return other_item_quantity;
11049 }
11050 }
11051
11053 {
11055 }
11056
11058 {
11060 return;
11061
11062 if (!IsMagazine() && other_item)
11063 {
11065 if (quantity_used != 0)
11066 {
11067 float hp1 = GetHealth01("","");
11068 float hp2 = other_item.GetHealth01("","");
11069 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11070 hpResult = hpResult / (
GetQuantity() + quantity_used);
11071
11072 hpResult *= GetMaxHealth();
11073 Math.Round(hpResult);
11074 SetHealth("", "Health", hpResult);
11075
11077 other_item.AddQuantity(-quantity_used);
11078 }
11079 }
11081 }
11082
11084 {
11085 #ifdef SERVER
11086 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11087 GetHierarchyParent().IncreaseLifetimeUp();
11088 #endif
11089 };
11090
11092 {
11093 PlayerBase p = PlayerBase.Cast(player);
11094
11095 array<int> recipesIds = p.m_Recipes;
11096 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11097 if (moduleRecipesManager)
11098 {
11099 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11100 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11101 }
11102
11103 for (int i = 0;i < recipesIds.Count(); i++)
11104 {
11105 int key = recipesIds.Get(i);
11106 string recipeName = moduleRecipesManager.GetRecipeName(key);
11108 }
11109 }
11110
11111
11112 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11113 {
11114 super.GetDebugActions(outputList);
11115
11116
11121
11122
11126
11130
11131
11134
11135
11137 {
11140 }
11141
11143
11146
11150 }
11151
11152
11153
11154
11156 {
11157 super.OnAction(action_id, player, ctx);
11158 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11159 {
11160 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11161 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11162 PlayerBase p = PlayerBase.Cast(player);
11163 if (
EActions.RECIPES_RANGE_START < 1000)
11164 {
11165 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11166 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11167 }
11168 }
11169 #ifndef SERVER
11170 else if (action_id ==
EActions.WATCH_PLAYER)
11171 {
11172 PluginDeveloper.SetDeveloperItemClientEx(player);
11173 }
11174 #endif
11176 {
11177 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11178 {
11179 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11180 OnDebugButtonPressServer(id + 1);
11181 }
11182
11183 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11184 {
11185 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11187 }
11188
11189 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11190 {
11191 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11193 }
11194
11195 else if (action_id ==
EActions.ADD_QUANTITY)
11196 {
11197 if (IsMagazine())
11198 {
11199 Magazine mag = Magazine.Cast(this);
11200 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11201 }
11202 else
11203 {
11205 }
11206
11207 if (m_EM)
11208 {
11209 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11210 }
11211
11212 }
11213
11214 else if (action_id ==
EActions.REMOVE_QUANTITY)
11215 {
11216 if (IsMagazine())
11217 {
11218 Magazine mag2 = Magazine.Cast(this);
11219 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11220 }
11221 else
11222 {
11224 }
11225 if (m_EM)
11226 {
11227 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11228 }
11229
11230 }
11231
11232 else if (action_id ==
EActions.SET_QUANTITY_0)
11233 {
11235
11236 if (m_EM)
11237 {
11238 m_EM.SetEnergy(0);
11239 }
11240 }
11241
11242 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11243 {
11245
11246 if (m_EM)
11247 {
11248 m_EM.SetEnergy(m_EM.GetEnergyMax());
11249 }
11250 }
11251
11252 else if (action_id ==
EActions.ADD_HEALTH)
11253 {
11254 AddHealth("","",GetMaxHealth("","Health")/5);
11255 }
11256 else if (action_id ==
EActions.REMOVE_HEALTH)
11257 {
11258 AddHealth("","",-GetMaxHealth("","Health")/5);
11259 }
11260 else if (action_id ==
EActions.DESTROY_HEALTH)
11261 {
11262 SetHealth01("","",0);
11263 }
11264 else if (action_id ==
EActions.WATCH_ITEM)
11265 {
11267 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11268 #ifdef DEVELOPER
11269 SetDebugDeveloper_item(this);
11270 #endif
11271 }
11272
11273 else if (action_id ==
EActions.ADD_TEMPERATURE)
11274 {
11275 AddTemperature(20);
11276
11277 }
11278
11279 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11280 {
11281 AddTemperature(-20);
11282
11283 }
11284
11285 else if (action_id ==
EActions.FLIP_FROZEN)
11286 {
11287 SetFrozen(!GetIsFrozen());
11288
11289 }
11290
11291 else if (action_id ==
EActions.ADD_WETNESS)
11292 {
11294
11295 }
11296
11297 else if (action_id ==
EActions.REMOVE_WETNESS)
11298 {
11300
11301 }
11302
11303 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11304 {
11307
11308
11309 }
11310
11311 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11312 {
11315 }
11316
11317 else if (action_id ==
EActions.MAKE_SPECIAL)
11318 {
11319 auto debugParams = DebugSpawnParams.WithPlayer(player);
11320 OnDebugSpawnEx(debugParams);
11321 }
11322
11323 else if (action_id ==
EActions.DELETE)
11324 {
11325 Delete();
11326 }
11327
11328 }
11329
11330
11331 return false;
11332 }
11333
11334
11335
11336
11340
11343
11344
11345
11347 {
11348 return false;
11349 }
11350
11351
11353 {
11354 return true;
11355 }
11356
11357
11359 {
11360 return true;
11361 }
11362
11363
11364
11366 {
11367 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11369 }
11370
11373 {
11374 return null;
11375 }
11376
11378 {
11379 return false;
11380 }
11381
11383 {
11384 return false;
11385 }
11386
11390
11391
11393 {
11394 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11395 return module_repairing.CanRepair(this, item_repair_kit);
11396 }
11397
11398
11399 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11400 {
11401 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11402 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11403 }
11404
11405
11407 {
11408
11409
11410
11411
11412
11413
11414
11415
11416 return 1;
11417 }
11418
11419
11420
11422 {
11424 }
11425
11426
11427
11429 {
11431 }
11432
11433
11442 {
11443 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11444
11445 if (player)
11446 {
11447 player.MessageStatus(text);
11448 }
11449 }
11450
11451
11460 {
11461 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11462
11463 if (player)
11464 {
11465 player.MessageAction(text);
11466 }
11467 }
11468
11469
11478 {
11479 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11480
11481 if (player)
11482 {
11483 player.MessageFriendly(text);
11484 }
11485 }
11486
11487
11496 {
11497 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11498
11499 if (player)
11500 {
11501 player.MessageImportant(text);
11502 }
11503 }
11504
11506 {
11507 return true;
11508 }
11509
11510
11511 override bool KindOf(
string tag)
11512 {
11513 bool found = false;
11514 string item_name = this.
GetType();
11517
11518 int array_size = item_tag_array.Count();
11519 for (int i = 0; i < array_size; i++)
11520 {
11521 if (item_tag_array.Get(i) == tag)
11522 {
11523 found = true;
11524 break;
11525 }
11526 }
11527 return found;
11528 }
11529
11530
11532 {
11533
11534 super.OnRPC(sender, rpc_type,ctx);
11535
11536
11537 switch (rpc_type)
11538 {
11539 #ifndef SERVER
11540 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11541 Param2<bool, string> p = new Param2<bool, string>(false, "");
11542
11544 return;
11545
11546 bool play = p.param1;
11547 string soundSet = p.param2;
11548
11549 if (play)
11550 {
11552 {
11554 {
11556 }
11557 }
11558 else
11559 {
11561 }
11562 }
11563 else
11564 {
11566 }
11567
11568 break;
11569 #endif
11570
11571 }
11572
11574 {
11576 }
11577 }
11578
11579
11580
11581
11583 {
11584 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11585 return plugin.GetID(
name);
11586 }
11587
11589 {
11590 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11591 return plugin.GetName(id);
11592 }
11593
11596 {
11597
11598
11599 int varFlags;
11600 if (!ctx.
Read(varFlags))
11601 return;
11602
11603 if (varFlags & ItemVariableFlags.FLOAT)
11604 {
11606 }
11607 }
11608
11610 {
11611
11612 super.SerializeNumericalVars(floats_out);
11613
11614
11615
11617 {
11619 }
11620
11622 {
11624 }
11625
11627 {
11629 }
11630
11632 {
11637 }
11638
11640 {
11642 }
11643 }
11644
11646 {
11647
11648 super.DeSerializeNumericalVars(floats);
11649
11650
11651 int index = 0;
11652 int mask = Math.Round(floats.Get(index));
11653
11654 index++;
11655
11657 {
11659 {
11661 }
11662 else
11663 {
11664 float quantity = floats.Get(index);
11665 SetQuantity(quantity,
true,
false,
false,
false);
11666 }
11667 index++;
11668 }
11669
11671 {
11672 float wet = floats.Get(index);
11674 index++;
11675 }
11676
11678 {
11679 int liquidtype = Math.Round(floats.Get(index));
11681 index++;
11682 }
11683
11685 {
11687 index++;
11689 index++;
11691 index++;
11693 index++;
11694 }
11695
11697 {
11698 int cleanness = Math.Round(floats.Get(index));
11700 index++;
11701 }
11702 }
11703
11705 {
11706 super.WriteVarsToCTX(ctx);
11707
11708
11710 {
11712 }
11713
11715 {
11717 }
11718
11720 {
11722 }
11723
11725 {
11726 int r,g,b,a;
11732 }
11733
11735 {
11737 }
11738 }
11739
11741 {
11742 if (!super.ReadVarsFromCTX(ctx,version))
11743 return false;
11744
11745 int intValue;
11746 float value;
11747
11748 if (version < 140)
11749 {
11750 if (!ctx.
Read(intValue))
11751 return false;
11752
11753 m_VariablesMask = intValue;
11754 }
11755
11757 {
11758 if (!ctx.
Read(value))
11759 return false;
11760
11762 {
11764 }
11765 else
11766 {
11768 }
11769 }
11770
11771 if (version < 140)
11772 {
11774 {
11775 if (!ctx.
Read(value))
11776 return false;
11777 SetTemperatureDirect(value);
11778 }
11779 }
11780
11782 {
11783 if (!ctx.
Read(value))
11784 return false;
11786 }
11787
11789 {
11790 if (!ctx.
Read(intValue))
11791 return false;
11793 }
11794
11796 {
11797 int r,g,b,a;
11799 return false;
11801 return false;
11803 return false;
11805 return false;
11806
11808 }
11809
11811 {
11812 if (!ctx.
Read(intValue))
11813 return false;
11815 }
11816
11817 if (version >= 138 && version < 140)
11818 {
11820 {
11821 if (!ctx.
Read(intValue))
11822 return false;
11823 SetFrozen(intValue);
11824 }
11825 }
11826
11827 return true;
11828 }
11829
11830
11832 {
11835 {
11837 }
11838
11839 if (!super.OnStoreLoad(ctx, version))
11840 {
11842 return false;
11843 }
11844
11845 if (version >= 114)
11846 {
11847 bool hasQuickBarIndexSaved;
11848
11849 if (!ctx.
Read(hasQuickBarIndexSaved))
11850 {
11852 return false;
11853 }
11854
11855 if (hasQuickBarIndexSaved)
11856 {
11857 int itmQBIndex;
11858
11859
11860 if (!ctx.
Read(itmQBIndex))
11861 {
11863 return false;
11864 }
11865
11866 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11867 if (itmQBIndex != -1 && parentPlayer)
11868 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11869 }
11870 }
11871 else
11872 {
11873
11874 PlayerBase player;
11875 int itemQBIndex;
11876 if (version ==
int.
MAX)
11877 {
11878 if (!ctx.
Read(itemQBIndex))
11879 {
11881 return false;
11882 }
11883 }
11884 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11885 {
11886
11887 if (!ctx.
Read(itemQBIndex))
11888 {
11890 return false;
11891 }
11892 if (itemQBIndex != -1 && player)
11893 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11894 }
11895 }
11896
11897 if (version < 140)
11898 {
11899
11900 if (!LoadVariables(ctx, version))
11901 {
11903 return false;
11904 }
11905 }
11906
11907
11909 {
11911 return false;
11912 }
11913 if (version >= 132)
11914 {
11916 if (raib)
11917 {
11919 {
11921 return false;
11922 }
11923 }
11924 }
11925
11927 return true;
11928 }
11929
11930
11931
11933 {
11934 super.OnStoreSave(ctx);
11935
11936 PlayerBase player;
11937 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11938 {
11940
11941 int itemQBIndex = -1;
11942 itemQBIndex = player.FindQuickBarEntityIndex(this);
11943 ctx.
Write(itemQBIndex);
11944 }
11945 else
11946 {
11948 }
11949
11951
11953 if (raib)
11954 {
11956 }
11957 }
11958
11959
11961 {
11962 super.AfterStoreLoad();
11963
11965 {
11967 }
11968
11970 {
11973 }
11974 }
11975
11977 {
11978 super.EEOnAfterLoad();
11979
11981 {
11983 }
11984
11987 }
11988
11990 {
11991 return false;
11992 }
11993
11994
11995
11997 {
11999 {
12000 #ifdef PLATFORM_CONSOLE
12001
12003 {
12005 if (menu)
12006 {
12008 }
12009 }
12010 #endif
12011 }
12012
12014 {
12017 }
12018
12020 {
12021 SetWeightDirty();
12023 }
12025 {
12028 }
12029
12031 {
12034 }
12036 {
12039 }
12040
12041 super.OnVariablesSynchronized();
12042 }
12043
12044
12045
12047 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12048 {
12049 if (!IsServerCheck(allow_client))
12050 return false;
12051
12053 return false;
12054
12057
12058 if (value <= (min + 0.001))
12059 value = min;
12060
12061 if (value == min)
12062 {
12063 if (destroy_config)
12064 {
12065 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12066 if (dstr)
12067 {
12069 this.Delete();
12070 return true;
12071 }
12072 }
12073 else if (destroy_forced)
12074 {
12076 this.Delete();
12077 return true;
12078 }
12079
12081 }
12082
12085
12087 {
12089
12090 if (delta)
12092 }
12093
12095
12096 return false;
12097 }
12098
12099
12101 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12102 {
12104 }
12105
12107 {
12110 }
12111
12113 {
12116 }
12117
12120 {
12121 float value_clamped = Math.Clamp(value, 0, 1);
12123 SetQuantity(result, destroy_config, destroy_forced);
12124 }
12125
12126
12129 {
12131 }
12132
12134 {
12136 }
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12148 {
12149 int slot = -1;
12150 if (GetInventory())
12151 {
12152 InventoryLocation il = new InventoryLocation;
12153 GetInventory().GetCurrentInventoryLocation(il);
12155 }
12156
12158 }
12159
12161 {
12162 float quantity_max = 0;
12163
12165 {
12166 if (attSlotID != -1)
12167 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12168
12169 if (quantity_max <= 0)
12171 }
12172
12173 if (quantity_max <= 0)
12175
12176 return quantity_max;
12177 }
12178
12180 {
12182 }
12183
12185 {
12187 }
12188
12189
12191 {
12193 }
12194
12196 {
12198 }
12199
12201 {
12203 }
12204
12205
12207 {
12208
12209 float weightEx = GetWeightEx();
12210 float special = GetInventoryAndCargoWeight();
12211 return weightEx - special;
12212 }
12213
12214
12216 {
12218 }
12219
12221 {
12223 {
12224 #ifdef DEVELOPER
12225 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12226 {
12227 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12229 }
12230 #endif
12231
12232 return GetQuantity() * GetConfigWeightModified();
12233 }
12234 else if (HasEnergyManager())
12235 {
12236 #ifdef DEVELOPER
12237 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12238 {
12239 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12240 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12241 }
12242 #endif
12243 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12244 }
12245 else
12246 {
12247 #ifdef DEVELOPER
12248 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12249 {
12250 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12251 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12252 }
12253 #endif
12254 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12255 }
12256 }
12257
12260 {
12261 int item_count = 0;
12263
12264 if (GetInventory().GetCargo() != NULL)
12265 {
12266 item_count = GetInventory().GetCargo().GetItemCount();
12267 }
12268
12269 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12270 {
12271 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12272 if (item)
12273 item_count += item.GetNumberOfItems();
12274 }
12275 return item_count;
12276 }
12277
12280 {
12281 float weight = 0;
12282 float wetness = 1;
12283 if (include_wetness)
12286 {
12287 weight = wetness * m_ConfigWeight;
12288 }
12290 {
12291 weight = 1;
12292 }
12293 return weight;
12294 }
12295
12296
12297
12299 {
12300 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12301 {
12302 GameInventory inv = GetInventory();
12303 array<EntityAI> items = new array<EntityAI>;
12305 for (int i = 0; i < items.Count(); i++)
12306 {
12308 if (item)
12309 {
12311 }
12312 }
12313 }
12314 }
12315
12316
12317
12318
12320 {
12321 float energy = 0;
12322 if (HasEnergyManager())
12323 {
12324 energy = GetCompEM().GetEnergy();
12325 }
12326 return energy;
12327 }
12328
12329
12331 {
12332 super.OnEnergyConsumed();
12333
12335 }
12336
12338 {
12339 super.OnEnergyAdded();
12340
12342 }
12343
12344
12346 {
12347 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12348 {
12350 {
12351 float energy_0to1 = GetCompEM().GetEnergy0To1();
12353 }
12354 }
12355 }
12356
12357
12359 {
12360 return ConfigGetFloat("heatIsolation");
12361 }
12362
12364 {
12366 }
12367
12369 {
12370 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12371 if (
GetGame().ConfigIsExisting(paramPath))
12373
12374 return 0.0;
12375 }
12376
12378 {
12379 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12380 if (
GetGame().ConfigIsExisting(paramPath))
12382
12383 return 0.0;
12384 }
12385
12386 override void SetWet(
float value,
bool allow_client =
false)
12387 {
12388 if (!IsServerCheck(allow_client))
12389 return;
12390
12393
12395
12396 m_VarWet = Math.Clamp(value, min, max);
12397
12399 {
12402 }
12403 }
12404
12405 override void AddWet(
float value)
12406 {
12408 }
12409
12411 {
12413 }
12414
12416 {
12418 }
12419
12421 {
12423 }
12424
12426 {
12428 }
12429
12431 {
12433 }
12434
12435 override void OnWetChanged(
float newVal,
float oldVal)
12436 {
12439 if (newLevel != oldLevel)
12440 {
12442 }
12443 }
12444
12446 {
12447 SetWeightDirty();
12448 }
12449
12451 {
12452 return GetWetLevelInternal(
m_VarWet);
12453 }
12454
12455
12456
12458 {
12460 }
12461
12463 {
12465 }
12466
12468 {
12470 }
12471
12473 {
12475 }
12476
12477
12478
12480 {
12481 if (ConfigIsExisting("itemModelLength"))
12482 {
12483 return ConfigGetFloat("itemModelLength");
12484 }
12485 return 0;
12486 }
12487
12489 {
12490 if (ConfigIsExisting("itemAttachOffset"))
12491 {
12492 return ConfigGetFloat("itemAttachOffset");
12493 }
12494 return 0;
12495 }
12496
12497 override void SetCleanness(
int value,
bool allow_client =
false)
12498 {
12499 if (!IsServerCheck(allow_client))
12500 return;
12501
12503
12505
12508 }
12509
12511 {
12513 }
12514
12516 {
12517 return true;
12518 }
12519
12520
12521
12522
12524 {
12526 }
12527
12529 {
12531 }
12532
12533
12534
12535
12536 override void SetColor(
int r,
int g,
int b,
int a)
12537 {
12543 }
12545 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12546 {
12551 }
12552
12554 {
12556 }
12557
12560 {
12561 int r,g,b,a;
12563 r = r/255;
12564 g = g/255;
12565 b = b/255;
12566 a = a/255;
12567 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12568 }
12569
12570
12571
12572 override void SetLiquidType(
int value,
bool allow_client =
false)
12573 {
12574 if (!IsServerCheck(allow_client))
12575 return;
12576
12581 }
12582
12584 {
12585 return ConfigGetInt("varLiquidTypeInit");
12586 }
12587
12589 {
12591 }
12592
12594 {
12596 SetFrozen(false);
12597 }
12598
12601 {
12602 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12603 }
12604
12605
12608 {
12609 PlayerBase nplayer;
12610 if (PlayerBase.CastTo(nplayer, player))
12611 {
12613
12614 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12615 }
12616 }
12617
12618
12621 {
12622 PlayerBase nplayer;
12623 if (PlayerBase.CastTo(nplayer,player))
12624 {
12625
12626 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12627
12628 }
12629
12630
12631 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12632
12633
12634 if (HasEnergyManager())
12635 {
12636 GetCompEM().UpdatePlugState();
12637 }
12638 }
12639
12640
12642 {
12643 super.OnPlacementStarted(player);
12644
12646 }
12647
12648 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12649 {
12651 {
12652 m_AdminLog.OnPlacementComplete(player,
this);
12653 }
12654
12655 super.OnPlacementComplete(player, position, orientation);
12656 }
12657
12658
12659
12660
12661
12663 {
12665 {
12666 return true;
12667 }
12668 else
12669 {
12670 return false;
12671 }
12672 }
12673
12674
12676 {
12678 {
12680 }
12681 }
12682
12683
12685 {
12687 }
12688
12690 {
12692 }
12693
12694 override void InsertAgent(
int agent,
float count = 1)
12695 {
12696 if (count < 1)
12697 return;
12698
12700 }
12701
12704 {
12706 }
12707
12708
12710 {
12712 }
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12756 {
12758 return false;
12759 return true;
12760 }
12761
12763 {
12764
12766 }
12767
12768
12771 {
12772 super.CheckForRoofLimited(timeTresholdMS);
12773
12775 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12776 {
12777 m_PreviousRoofTestTime = time;
12778 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12779 }
12780 }
12781
12782
12784 {
12786 {
12787 return 0;
12788 }
12789
12790 if (GetInventory().GetAttachmentSlotsCount() != 0)
12791 {
12792 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12793 if (filter)
12794 return filter.GetProtectionLevel(type, false, system);
12795 else
12796 return 0;
12797 }
12798
12799 string subclassPath, entryName;
12800
12801 switch (type)
12802 {
12804 entryName = "biological";
12805 break;
12807 entryName = "chemical";
12808 break;
12809 default:
12810 entryName = "biological";
12811 break;
12812 }
12813
12814 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12815
12817 }
12818
12819
12820
12823 {
12824 if (!IsMagazine())
12826
12828 }
12829
12830
12831
12832
12833
12838 {
12839 return true;
12840 }
12841
12843 {
12845 }
12846
12847
12848
12849
12850
12852 {
12853 if (parent)
12854 {
12855 if (parent.IsInherited(DayZInfected))
12856 return true;
12857
12858 if (!parent.IsRuined())
12859 return true;
12860 }
12861
12862 return true;
12863 }
12864
12866 {
12867 if (!super.CanPutAsAttachment(parent))
12868 {
12869 return false;
12870 }
12871
12872 if (!IsRuined() && !parent.IsRuined())
12873 {
12874 return true;
12875 }
12876
12877 return false;
12878 }
12879
12881 {
12882
12883
12884
12885
12886 return super.CanReceiveItemIntoCargo(item);
12887 }
12888
12890 {
12891
12892
12893
12894
12895 GameInventory attachmentInv = attachment.GetInventory();
12897 {
12898 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12899 return false;
12900 }
12901
12902 InventoryLocation loc = new InventoryLocation();
12903 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12904 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12905 return false;
12906
12907 return super.CanReceiveAttachment(attachment, slotId);
12908 }
12909
12911 {
12912 if (!super.CanReleaseAttachment(attachment))
12913 return false;
12914
12915 return GetInventory().AreChildrenAccessible();
12916 }
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12939 {
12940 int id = muzzle_owner.GetMuzzleID();
12941 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12942
12943 if (WPOF_array)
12944 {
12945 for (int i = 0; i < WPOF_array.Count(); i++)
12946 {
12947 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12948
12949 if (WPOF)
12950 {
12951 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12952 }
12953 }
12954 }
12955 }
12956
12957
12959 {
12960 int id = muzzle_owner.GetMuzzleID();
12962
12963 if (WPOBE_array)
12964 {
12965 for (int i = 0; i < WPOBE_array.Count(); i++)
12966 {
12967 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12968
12969 if (WPOBE)
12970 {
12971 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12972 }
12973 }
12974 }
12975 }
12976
12977
12979 {
12980 int id = muzzle_owner.GetMuzzleID();
12981 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12982
12983 if (WPOOH_array)
12984 {
12985 for (int i = 0; i < WPOOH_array.Count(); i++)
12986 {
12987 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12988
12989 if (WPOOH)
12990 {
12991 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12992 }
12993 }
12994 }
12995 }
12996
12997
12999 {
13000 int id = muzzle_owner.GetMuzzleID();
13001 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13002
13003 if (WPOOH_array)
13004 {
13005 for (int i = 0; i < WPOOH_array.Count(); i++)
13006 {
13007 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13008
13009 if (WPOOH)
13010 {
13011 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13012 }
13013 }
13014 }
13015 }
13016
13017
13019 {
13020 int id = muzzle_owner.GetMuzzleID();
13021 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13022
13023 if (WPOOH_array)
13024 {
13025 for (int i = 0; i < WPOOH_array.Count(); i++)
13026 {
13027 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13028
13029 if (WPOOH)
13030 {
13031 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13032 }
13033 }
13034 }
13035 }
13036
13037
13038
13040 {
13042 {
13043 return true;
13044 }
13045
13046 return false;
13047 }
13048
13050 {
13052 {
13053 return true;
13054 }
13055
13056 return false;
13057 }
13058
13060 {
13062 {
13063 return true;
13064 }
13065
13066 return false;
13067 }
13068
13070 {
13071 return false;
13072 }
13073
13076 {
13077 return UATimeSpent.DEFAULT_DEPLOY;
13078 }
13079
13080
13081
13082
13084 {
13086 SetSynchDirty();
13087 }
13088
13090 {
13092 }
13093
13094
13096 {
13097 return false;
13098 }
13099
13102 {
13103 string att_type = "None";
13104
13105 if (ConfigIsExisting("soundAttType"))
13106 {
13107 att_type = ConfigGetString("soundAttType");
13108 }
13109
13111 }
13112
13114 {
13116 }
13117
13118
13119
13120
13121
13125
13127 {
13130
13132 }
13133
13134
13136 {
13138 return;
13139
13141
13144
13147
13148 SoundParameters params = new SoundParameters();
13152 }
13153
13154
13156 {
13158 return;
13159
13161 SetSynchDirty();
13162
13165 }
13166
13167
13169 {
13171 return;
13172
13174 SetSynchDirty();
13175
13178 }
13179
13181 {
13183 }
13184
13186 {
13188 }
13189
13192 {
13193 if (!
GetGame().IsDedicatedServer())
13194 {
13195 if (ConfigIsExisting("attachSoundSet"))
13196 {
13197 string cfg_path = "";
13198 string soundset = "";
13199 string type_name =
GetType();
13200
13203 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13204 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13205
13206 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13207 {
13208 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13209 {
13210 if (cfg_slot_array[i] == slot_type)
13211 {
13212 soundset = cfg_soundset_array[i];
13213 break;
13214 }
13215 }
13216 }
13217
13218 if (soundset != "")
13219 {
13220 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13222 }
13223 }
13224 }
13225 }
13226
13228 {
13229
13230 }
13231
13232 void OnApply(PlayerBase player);
13233
13235 {
13236 return 1.0;
13237 };
13238
13240 {
13242 }
13243
13245 {
13247 }
13248
13250
13252 {
13253 SetDynamicPhysicsLifeTime(0.01);
13255 }
13256
13258 {
13259 array<string> zone_names = new array<string>;
13260 GetDamageZones(zone_names);
13261 for (int i = 0; i < zone_names.Count(); i++)
13262 {
13263 SetHealthMax(zone_names.Get(i),"Health");
13264 }
13265 SetHealthMax("","Health");
13266 }
13267
13270 {
13271 float global_health = GetHealth01("","Health");
13272 array<string> zones = new array<string>;
13273 GetDamageZones(zones);
13274
13275 for (int i = 0; i < zones.Count(); i++)
13276 {
13277 SetHealth01(zones.Get(i),"Health",global_health);
13278 }
13279 }
13280
13283 {
13284 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13285 }
13286
13288 {
13289 if (!hasRootAsPlayer)
13290 {
13291 if (refParentIB)
13292 {
13293
13294 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13295 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13296
13297 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13298 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13299
13302 }
13303 else
13304 {
13305
13308 }
13309 }
13310 }
13311
13313 {
13315 {
13316 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13317 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13318 {
13319 float heatPermCoef = 1.0;
13321 while (ent)
13322 {
13323 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13324 ent = ent.GetHierarchyParent();
13325 }
13326
13327 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13328 }
13329 }
13330 }
13331
13333 {
13334
13335 EntityAI parent = GetHierarchyParent();
13336 if (!parent)
13337 {
13338 hasParent = false;
13339 hasRootAsPlayer = false;
13340 }
13341 else
13342 {
13343 hasParent = true;
13344 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13345 refParentIB =
ItemBase.Cast(parent);
13346 }
13347 }
13348
13349 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13350 {
13351
13352 }
13353
13355 {
13356
13357 return false;
13358 }
13359
13361 {
13362
13363
13364 return false;
13365 }
13366
13368 {
13369
13370 return false;
13371 }
13372
13375 {
13376 return !GetIsFrozen() &&
IsOpen();
13377 }
13378
13380 {
13381 bool hasParent = false, hasRootAsPlayer = false;
13383
13384 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13385 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13386
13387 if (wwtu || foodDecay)
13388 {
13392
13393 if (processWetness || processTemperature || processDecay)
13394 {
13396
13397 if (processWetness)
13398 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13399
13400 if (processTemperature)
13402
13403 if (processDecay)
13404 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13405 }
13406 }
13407 }
13408
13411 {
13413 }
13414
13416 {
13419
13420 return super.GetTemperatureFreezeThreshold();
13421 }
13422
13424 {
13427
13428 return super.GetTemperatureThawThreshold();
13429 }
13430
13432 {
13435
13436 return super.GetItemOverheatThreshold();
13437 }
13438
13440 {
13442 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13443
13444 return super.GetTemperatureFreezeTime();
13445 }
13446
13448 {
13450 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13451
13452 return super.GetTemperatureThawTime();
13453 }
13454
13459
13461 {
13462 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13463 }
13464
13466 {
13467 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13468 }
13469
13472 {
13474 }
13475
13477 {
13479 }
13480
13482 {
13484 }
13485
13488 {
13489 return null;
13490 }
13491
13494 {
13495 return false;
13496 }
13497
13499 {
13501 {
13504 if (!trg)
13505 {
13507 explosive = this;
13508 }
13509
13510 explosive.PairRemote(trg);
13512
13513 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13514 trg.SetPersistentPairID(persistentID);
13515 explosive.SetPersistentPairID(persistentID);
13516
13517 return true;
13518 }
13519 return false;
13520 }
13521
13524 {
13525 float ret = 1.0;
13528 ret *= GetHealth01();
13529
13530 return ret;
13531 }
13532
13533 #ifdef DEVELOPER
13534 override void SetDebugItem()
13535 {
13536 super.SetDebugItem();
13537 _itemBase = this;
13538 }
13539
13541 {
13542 string text = super.GetDebugText();
13543
13545 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13546
13547 return text;
13548 }
13549 #endif
13550
13552 {
13553 return true;
13554 }
13555
13557
13559
13561 {
13564 }
13565
13566
13574
13590}
13591
13593{
13595 if (entity)
13596 {
13597 bool is_item = entity.IsInherited(
ItemBase);
13598 if (is_item && full_quantity)
13599 {
13602 }
13603 }
13604 else
13605 {
13607 return NULL;
13608 }
13609 return entity;
13610}
13611
13613{
13614 if (item)
13615 {
13616 if (health > 0)
13617 item.SetHealth("", "", health);
13618
13619 if (item.CanHaveTemperature())
13620 {
13622 if (item.CanFreeze())
13623 item.SetFrozen(false);
13624 }
13625
13626 if (item.HasEnergyManager())
13627 {
13628 if (quantity >= 0)
13629 {
13630 item.GetCompEM().SetEnergy0To1(quantity);
13631 }
13632 else
13633 {
13635 }
13636 }
13637 else if (item.IsMagazine())
13638 {
13639 Magazine mag = Magazine.Cast(item);
13640 if (quantity >= 0)
13641 {
13642 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13643 }
13644 else
13645 {
13647 }
13648
13649 }
13650 else
13651 {
13652 if (quantity >= 0)
13653 {
13654 item.SetQuantityNormalized(quantity, false);
13655 }
13656 else
13657 {
13659 }
13660
13661 }
13662 }
13663}
13664
13665#ifdef DEVELOPER
13667#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.