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 {
10399
10401 return false;
10402
10403
10405 return false;
10406
10407
10408
10410 if (delta == 0)
10411 return false;
10412
10413
10414 return true;
10415 }
10416
10418 {
10420 {
10421 if (ScriptInputUserData.CanStoreInputUserData())
10422 {
10423 ScriptInputUserData ctx = new ScriptInputUserData;
10428 ctx.
Write(destination_entity);
10430 ctx.
Write(slot_id);
10432 }
10433 }
10434 else if (!
GetGame().IsMultiplayer())
10435 {
10437 }
10438 }
10439
10441 {
10442 float split_quantity_new;
10446 InventoryLocation loc = new InventoryLocation;
10447
10448 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10449 {
10451 split_quantity_new = stack_max;
10452 else
10454
10456 {
10457 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10458 if (new_item)
10459 {
10460 new_item.SetResultOfSplit(true);
10461 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10463 new_item.
SetQuantity(split_quantity_new,
false,
true);
10464 }
10465 }
10466 }
10467 else if (destination_entity && slot_id == -1)
10468 {
10469 if (quantity > stack_max)
10470 split_quantity_new = stack_max;
10471 else
10472 split_quantity_new = quantity;
10473
10475 {
10477 {
10480 }
10481
10482 if (new_item)
10483 {
10484 new_item.SetResultOfSplit(true);
10485 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10487 new_item.
SetQuantity(split_quantity_new,
false,
true);
10488 }
10489 }
10490 }
10491 else
10492 {
10493 if (stack_max != 0)
10494 {
10496 {
10498 }
10499
10500 if (split_quantity_new == 0)
10501 {
10502 if (!
GetGame().IsMultiplayer())
10503 player.PhysicalPredictiveDropItem(this);
10504 else
10505 player.ServerDropEntity(this);
10506 return;
10507 }
10508
10510 {
10512
10513 if (new_item)
10514 {
10515 new_item.SetResultOfSplit(true);
10516 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10519 new_item.PlaceOnSurface();
10520 }
10521 }
10522 }
10523 }
10524 }
10525
10527 {
10528 float split_quantity_new;
10532 InventoryLocation loc = new InventoryLocation;
10533
10534 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10535 {
10537 split_quantity_new = stack_max;
10538 else
10540
10542 {
10543 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10544 if (new_item)
10545 {
10546 new_item.SetResultOfSplit(true);
10547 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10549 new_item.
SetQuantity(split_quantity_new,
false,
true);
10550 }
10551 }
10552 }
10553 else if (destination_entity && slot_id == -1)
10554 {
10555 if (quantity > stack_max)
10556 split_quantity_new = stack_max;
10557 else
10558 split_quantity_new = quantity;
10559
10561 {
10563 {
10566 }
10567
10568 if (new_item)
10569 {
10570 new_item.SetResultOfSplit(true);
10571 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10573 new_item.
SetQuantity(split_quantity_new,
false,
true);
10574 }
10575 }
10576 }
10577 else
10578 {
10579 if (stack_max != 0)
10580 {
10582 {
10584 }
10585
10587 {
10589
10590 if (new_item)
10591 {
10592 new_item.SetResultOfSplit(true);
10593 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10596 new_item.PlaceOnSurface();
10597 }
10598 }
10599 }
10600 }
10601 }
10602
10604 {
10606 {
10607 if (ScriptInputUserData.CanStoreInputUserData())
10608 {
10609 ScriptInputUserData ctx = new ScriptInputUserData;
10614 dst.WriteToContext(ctx);
10616 }
10617 }
10618 else if (!
GetGame().IsMultiplayer())
10619 {
10621 }
10622 }
10623
10625 {
10627 {
10628 if (ScriptInputUserData.CanStoreInputUserData())
10629 {
10630 ScriptInputUserData ctx = new ScriptInputUserData;
10635 ctx.
Write(destination_entity);
10641 }
10642 }
10643 else if (!
GetGame().IsMultiplayer())
10644 {
10646 }
10647 }
10648
10650 {
10652 }
10653
10655 {
10657 float split_quantity_new;
10659 if (dst.IsValid())
10660 {
10661 int slot_id = dst.GetSlot();
10663
10664 if (quantity > stack_max)
10665 split_quantity_new = stack_max;
10666 else
10667 split_quantity_new = quantity;
10668
10670 {
10672
10673 if (new_item)
10674 {
10675 new_item.SetResultOfSplit(true);
10676 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10678 new_item.
SetQuantity(split_quantity_new,
false,
true);
10679 }
10680
10681 return new_item;
10682 }
10683 }
10684
10685 return null;
10686 }
10687
10689 {
10691 float split_quantity_new;
10693 if (destination_entity)
10694 {
10696 if (quantity > stackable)
10697 split_quantity_new = stackable;
10698 else
10699 split_quantity_new = quantity;
10700
10702 {
10703 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10704 if (new_item)
10705 {
10706 new_item.SetResultOfSplit(true);
10707 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10709 new_item.
SetQuantity(split_quantity_new,
false,
true);
10710 }
10711 }
10712 }
10713 }
10714
10716 {
10718 {
10719 if (ScriptInputUserData.CanStoreInputUserData())
10720 {
10721 ScriptInputUserData ctx = new ScriptInputUserData;
10726 ItemBase destination_entity =
this;
10727 ctx.
Write(destination_entity);
10731 }
10732 }
10733 else if (!
GetGame().IsMultiplayer())
10734 {
10736 }
10737 }
10738
10740 {
10742 float split_quantity_new;
10744 if (player)
10745 {
10747 if (quantity > stackable)
10748 split_quantity_new = stackable;
10749 else
10750 split_quantity_new = quantity;
10751
10753 {
10754 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10755 new_item =
ItemBase.Cast(in_hands);
10756 if (new_item)
10757 {
10758 new_item.SetResultOfSplit(true);
10759 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10761 new_item.SetQuantity(split_quantity_new, false, true);
10762 }
10763 }
10764 }
10765 }
10766
10768 {
10770 float split_quantity_new = Math.Floor(quantity * 0.5);
10771
10773 return;
10774
10776
10777 if (new_item)
10778 {
10779 if (new_item.GetQuantityMax() < split_quantity_new)
10780 {
10781 split_quantity_new = new_item.GetQuantityMax();
10782 }
10783
10784 new_item.SetResultOfSplit(true);
10785 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10786
10788 {
10791 }
10792 else
10793 {
10795 new_item.
SetQuantity(split_quantity_new,
false,
true);
10796 }
10797 }
10798 }
10799
10801 {
10803 float split_quantity_new = Math.Floor(quantity / 2);
10804
10806 return;
10807
10808 InventoryLocation invloc = new InventoryLocation;
10810
10812 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10813
10814 if (new_item)
10815 {
10816 if (new_item.GetQuantityMax() < split_quantity_new)
10817 {
10818 split_quantity_new = new_item.GetQuantityMax();
10819 }
10821 {
10824 }
10825 else if (split_quantity_new > 1)
10826 {
10828 new_item.
SetQuantity(split_quantity_new,
false,
true);
10829 }
10830 }
10831 }
10832
10835 {
10836 SetWeightDirty();
10838
10839 if (parent)
10840 parent.OnAttachmentQuantityChangedEx(this, delta);
10841
10843 {
10845 {
10847 }
10849 {
10850 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10852 }
10853 }
10854
10855 }
10856
10859 {
10860
10861 }
10862
10865 {
10867 }
10868
10870 {
10871 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10872
10874 {
10875 if (newLevel == GameConstants.STATE_RUINED)
10876 {
10878 EntityAI parent = GetHierarchyParent();
10879 if (parent && parent.IsFireplace())
10880 {
10881 CargoBase cargo = GetInventory().GetCargo();
10882 if (cargo)
10883 {
10885 {
10887 }
10888 }
10889 }
10890 }
10891
10893 {
10894
10896 return;
10897 }
10898
10899 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10900 {
10902 }
10903 }
10904 }
10905
10906
10908 {
10909 super.OnRightClick();
10910
10912 {
10914 {
10915 if (ScriptInputUserData.CanStoreInputUserData())
10916 {
10917 EntityAI root = GetHierarchyRoot();
10918 Man playerOwner = GetHierarchyRootPlayer();
10919 InventoryLocation dst = new InventoryLocation;
10920
10921
10922 if (!playerOwner && root && root == this)
10923 {
10925 }
10926 else
10927 {
10928
10929 GetInventory().GetCurrentInventoryLocation(dst);
10931 {
10934 {
10936 }
10937 else
10938 {
10940
10941
10942 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10943 {
10945 }
10946 else
10947 {
10948 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10949 }
10950 }
10951 }
10952 }
10953
10954 ScriptInputUserData ctx = new ScriptInputUserData;
10962 }
10963 }
10964 else if (!
GetGame().IsMultiplayer())
10965 {
10967 }
10968 }
10969 }
10970
10972 {
10973 if (root)
10974 {
10975 vector m4[4];
10976 root.GetTransform(m4);
10977 dst.SetGround(this, m4);
10978 }
10979 else
10980 {
10981 GetInventory().GetCurrentInventoryLocation(dst);
10982 }
10983 }
10984
10985 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10986 {
10987
10988 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10989 return false;
10990
10991 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10992 return false;
10993
10994
10996 return false;
10997
10998
10999 Magazine mag = Magazine.Cast(this);
11000 if (mag)
11001 {
11002 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11003 return false;
11004
11005 if (stack_max_limit)
11006 {
11007 Magazine other_mag = Magazine.Cast(other_item);
11008 if (other_item)
11009 {
11010 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11011 return false;
11012 }
11013
11014 }
11015 }
11016 else
11017 {
11018
11020 return false;
11021
11023 return false;
11024 }
11025
11026 PlayerBase player = null;
11027 if (CastTo(player, GetHierarchyRootPlayer()))
11028 {
11029 if (player.GetInventory().HasAttachment(this))
11030 return false;
11031
11032 if (player.IsItemsToDelete())
11033 return false;
11034 }
11035
11036 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11037 return false;
11038
11039 int slotID;
11041 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11042 return false;
11043
11044 return true;
11045 }
11046
11048 {
11050 }
11051
11053 {
11054 return m_IsResultOfSplit;
11055 }
11056
11058 {
11059 m_IsResultOfSplit = value;
11060 }
11061
11063 {
11065 }
11066
11068 {
11069 float other_item_quantity = other_item.GetQuantity();
11070 float this_free_space;
11071
11073
11075
11076 if (other_item_quantity > this_free_space)
11077 {
11078 return this_free_space;
11079 }
11080 else
11081 {
11082 return other_item_quantity;
11083 }
11084 }
11085
11087 {
11089 }
11090
11092 {
11094 return;
11095
11096 if (!IsMagazine() && other_item)
11097 {
11099 if (quantity_used != 0)
11100 {
11101 float hp1 = GetHealth01("","");
11102 float hp2 = other_item.GetHealth01("","");
11103 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11104 hpResult = hpResult / (
GetQuantity() + quantity_used);
11105
11106 hpResult *= GetMaxHealth();
11107 Math.Round(hpResult);
11108 SetHealth("", "Health", hpResult);
11109
11111 other_item.AddQuantity(-quantity_used);
11112 }
11113 }
11115 }
11116
11118 {
11119 #ifdef SERVER
11120 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11121 GetHierarchyParent().IncreaseLifetimeUp();
11122 #endif
11123 };
11124
11126 {
11127 PlayerBase p = PlayerBase.Cast(player);
11128
11129 array<int> recipesIds = p.m_Recipes;
11130 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11131 if (moduleRecipesManager)
11132 {
11133 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11134 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11135 }
11136
11137 for (int i = 0;i < recipesIds.Count(); i++)
11138 {
11139 int key = recipesIds.Get(i);
11140 string recipeName = moduleRecipesManager.GetRecipeName(key);
11142 }
11143 }
11144
11145
11146 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11147 {
11148 super.GetDebugActions(outputList);
11149
11150
11156
11157
11162
11167
11168
11172
11173
11175 {
11179 }
11180
11183
11184
11188
11190
11191 InventoryLocation loc = new InventoryLocation();
11192 GetInventory().GetCurrentInventoryLocation(loc);
11194 {
11195 if (Gizmo_IsSupported())
11198 }
11199
11201 }
11202
11203
11204
11205
11207 {
11208 super.OnAction(action_id, player, ctx);
11209
11211 {
11212 switch (action_id)
11213 {
11216 return true;
11219 return true;
11220 }
11221 }
11222
11224 {
11225 switch (action_id)
11226 {
11228 Delete();
11229 return true;
11230 }
11231 }
11232
11233 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11234 {
11235 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11236 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11237 PlayerBase p = PlayerBase.Cast(player);
11238 if (
EActions.RECIPES_RANGE_START < 1000)
11239 {
11240 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11241 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11242 }
11243 }
11244 #ifndef SERVER
11245 else if (action_id ==
EActions.WATCH_PLAYER)
11246 {
11247 PluginDeveloper.SetDeveloperItemClientEx(player);
11248 }
11249 #endif
11251 {
11252 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11253 {
11254 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11255 OnDebugButtonPressServer(id + 1);
11256 }
11257
11258 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11259 {
11260 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11262 }
11263
11264 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11265 {
11266 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11268 }
11269
11270 else if (action_id ==
EActions.ADD_QUANTITY)
11271 {
11272 if (IsMagazine())
11273 {
11274 Magazine mag = Magazine.Cast(this);
11275 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11276 }
11277 else
11278 {
11280 }
11281
11282 if (m_EM)
11283 {
11284 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11285 }
11286
11287 }
11288
11289 else if (action_id ==
EActions.REMOVE_QUANTITY)
11290 {
11291 if (IsMagazine())
11292 {
11293 Magazine mag2 = Magazine.Cast(this);
11294 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11295 }
11296 else
11297 {
11299 }
11300 if (m_EM)
11301 {
11302 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11303 }
11304
11305 }
11306
11307 else if (action_id ==
EActions.SET_QUANTITY_0)
11308 {
11310
11311 if (m_EM)
11312 {
11313 m_EM.SetEnergy(0);
11314 }
11315 }
11316
11317 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11318 {
11320
11321 if (m_EM)
11322 {
11323 m_EM.SetEnergy(m_EM.GetEnergyMax());
11324 }
11325 }
11326
11327 else if (action_id ==
EActions.ADD_HEALTH)
11328 {
11329 AddHealth("","",GetMaxHealth("","Health")/5);
11330 }
11331 else if (action_id ==
EActions.REMOVE_HEALTH)
11332 {
11333 AddHealth("","",-GetMaxHealth("","Health")/5);
11334 }
11335 else if (action_id ==
EActions.DESTROY_HEALTH)
11336 {
11337 SetHealth01("","",0);
11338 }
11339 else if (action_id ==
EActions.WATCH_ITEM)
11340 {
11342 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11343 #ifdef DEVELOPER
11344 SetDebugDeveloper_item(this);
11345 #endif
11346 }
11347
11348 else if (action_id ==
EActions.ADD_TEMPERATURE)
11349 {
11350 AddTemperature(20);
11351
11352 }
11353
11354 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11355 {
11356 AddTemperature(-20);
11357
11358 }
11359
11360 else if (action_id ==
EActions.FLIP_FROZEN)
11361 {
11362 SetFrozen(!GetIsFrozen());
11363
11364 }
11365
11366 else if (action_id ==
EActions.ADD_WETNESS)
11367 {
11369
11370 }
11371
11372 else if (action_id ==
EActions.REMOVE_WETNESS)
11373 {
11375
11376 }
11377
11378 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11379 {
11382
11383
11384 }
11385
11386 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11387 {
11390 }
11391
11392 else if (action_id ==
EActions.MAKE_SPECIAL)
11393 {
11394 auto debugParams = DebugSpawnParams.WithPlayer(player);
11395 OnDebugSpawnEx(debugParams);
11396 }
11397
11398 }
11399
11400
11401 return false;
11402 }
11403
11404
11405
11406
11410
11413
11414
11415
11417 {
11418 return false;
11419 }
11420
11421
11423 {
11424 return true;
11425 }
11426
11427
11429 {
11430 return true;
11431 }
11432
11433
11434
11436 {
11437 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11439 }
11440
11443 {
11444 return null;
11445 }
11446
11448 {
11449 return false;
11450 }
11451
11453 {
11454 return false;
11455 }
11456
11460
11461
11463 {
11464 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11465 return module_repairing.CanRepair(this, item_repair_kit);
11466 }
11467
11468
11469 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11470 {
11471 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11472 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11473 }
11474
11475
11477 {
11478
11479
11480
11481
11482
11483
11484
11485
11486 return 1;
11487 }
11488
11489
11490
11492 {
11494 }
11495
11496
11497
11499 {
11501 }
11502
11503
11512 {
11513 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11514
11515 if (player)
11516 {
11517 player.MessageStatus(text);
11518 }
11519 }
11520
11521
11530 {
11531 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11532
11533 if (player)
11534 {
11535 player.MessageAction(text);
11536 }
11537 }
11538
11539
11548 {
11549 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11550
11551 if (player)
11552 {
11553 player.MessageFriendly(text);
11554 }
11555 }
11556
11557
11566 {
11567 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11568
11569 if (player)
11570 {
11571 player.MessageImportant(text);
11572 }
11573 }
11574
11576 {
11577 return true;
11578 }
11579
11580
11581 override bool KindOf(
string tag)
11582 {
11583 bool found = false;
11584 string item_name = this.
GetType();
11587
11588 int array_size = item_tag_array.Count();
11589 for (int i = 0; i < array_size; i++)
11590 {
11591 if (item_tag_array.Get(i) == tag)
11592 {
11593 found = true;
11594 break;
11595 }
11596 }
11597 return found;
11598 }
11599
11600
11602 {
11603
11604 super.OnRPC(sender, rpc_type,ctx);
11605
11606
11607 switch (rpc_type)
11608 {
11609 #ifndef SERVER
11610 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11611 Param2<bool, string> p = new Param2<bool, string>(false, "");
11612
11614 return;
11615
11616 bool play = p.param1;
11617 string soundSet = p.param2;
11618
11619 if (play)
11620 {
11622 {
11624 {
11626 }
11627 }
11628 else
11629 {
11631 }
11632 }
11633 else
11634 {
11636 }
11637
11638 break;
11639 #endif
11640
11641 }
11642
11644 {
11646 }
11647 }
11648
11649
11650
11651
11653 {
11654 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11655 return plugin.GetID(
name);
11656 }
11657
11659 {
11660 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11661 return plugin.GetName(id);
11662 }
11663
11666 {
11667
11668
11669 int varFlags;
11670 if (!ctx.
Read(varFlags))
11671 return;
11672
11673 if (varFlags & ItemVariableFlags.FLOAT)
11674 {
11676 }
11677 }
11678
11680 {
11681
11682 super.SerializeNumericalVars(floats_out);
11683
11684
11685
11687 {
11689 }
11690
11692 {
11694 }
11695
11697 {
11699 }
11700
11702 {
11707 }
11708
11710 {
11712 }
11713 }
11714
11716 {
11717
11718 super.DeSerializeNumericalVars(floats);
11719
11720
11721 int index = 0;
11722 int mask = Math.Round(floats.Get(index));
11723
11724 index++;
11725
11727 {
11729 {
11731 }
11732 else
11733 {
11734 float quantity = floats.Get(index);
11735 SetQuantity(quantity,
true,
false,
false,
false);
11736 }
11737 index++;
11738 }
11739
11741 {
11742 float wet = floats.Get(index);
11744 index++;
11745 }
11746
11748 {
11749 int liquidtype = Math.Round(floats.Get(index));
11751 index++;
11752 }
11753
11755 {
11757 index++;
11759 index++;
11761 index++;
11763 index++;
11764 }
11765
11767 {
11768 int cleanness = Math.Round(floats.Get(index));
11770 index++;
11771 }
11772 }
11773
11775 {
11776 super.WriteVarsToCTX(ctx);
11777
11778
11780 {
11782 }
11783
11785 {
11787 }
11788
11790 {
11792 }
11793
11795 {
11796 int r,g,b,a;
11802 }
11803
11805 {
11807 }
11808 }
11809
11811 {
11812 if (!super.ReadVarsFromCTX(ctx,version))
11813 return false;
11814
11815 int intValue;
11816 float value;
11817
11818 if (version < 140)
11819 {
11820 if (!ctx.
Read(intValue))
11821 return false;
11822
11823 m_VariablesMask = intValue;
11824 }
11825
11827 {
11828 if (!ctx.
Read(value))
11829 return false;
11830
11832 {
11834 }
11835 else
11836 {
11838 }
11839 }
11840
11841 if (version < 140)
11842 {
11844 {
11845 if (!ctx.
Read(value))
11846 return false;
11847 SetTemperatureDirect(value);
11848 }
11849 }
11850
11852 {
11853 if (!ctx.
Read(value))
11854 return false;
11856 }
11857
11859 {
11860 if (!ctx.
Read(intValue))
11861 return false;
11863 }
11864
11866 {
11867 int r,g,b,a;
11869 return false;
11871 return false;
11873 return false;
11875 return false;
11876
11878 }
11879
11881 {
11882 if (!ctx.
Read(intValue))
11883 return false;
11885 }
11886
11887 if (version >= 138 && version < 140)
11888 {
11890 {
11891 if (!ctx.
Read(intValue))
11892 return false;
11893 SetFrozen(intValue);
11894 }
11895 }
11896
11897 return true;
11898 }
11899
11900
11902 {
11905 {
11907 }
11908
11909 if (!super.OnStoreLoad(ctx, version))
11910 {
11912 return false;
11913 }
11914
11915 if (version >= 114)
11916 {
11917 bool hasQuickBarIndexSaved;
11918
11919 if (!ctx.
Read(hasQuickBarIndexSaved))
11920 {
11922 return false;
11923 }
11924
11925 if (hasQuickBarIndexSaved)
11926 {
11927 int itmQBIndex;
11928
11929
11930 if (!ctx.
Read(itmQBIndex))
11931 {
11933 return false;
11934 }
11935
11936 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11937 if (itmQBIndex != -1 && parentPlayer)
11938 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11939 }
11940 }
11941 else
11942 {
11943
11944 PlayerBase player;
11945 int itemQBIndex;
11946 if (version ==
int.
MAX)
11947 {
11948 if (!ctx.
Read(itemQBIndex))
11949 {
11951 return false;
11952 }
11953 }
11954 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11955 {
11956
11957 if (!ctx.
Read(itemQBIndex))
11958 {
11960 return false;
11961 }
11962 if (itemQBIndex != -1 && player)
11963 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11964 }
11965 }
11966
11967 if (version < 140)
11968 {
11969
11970 if (!LoadVariables(ctx, version))
11971 {
11973 return false;
11974 }
11975 }
11976
11977
11979 {
11981 return false;
11982 }
11983 if (version >= 132)
11984 {
11986 if (raib)
11987 {
11989 {
11991 return false;
11992 }
11993 }
11994 }
11995
11997 return true;
11998 }
11999
12000
12001
12003 {
12004 super.OnStoreSave(ctx);
12005
12006 PlayerBase player;
12007 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12008 {
12010
12011 int itemQBIndex = -1;
12012 itemQBIndex = player.FindQuickBarEntityIndex(this);
12013 ctx.
Write(itemQBIndex);
12014 }
12015 else
12016 {
12018 }
12019
12021
12023 if (raib)
12024 {
12026 }
12027 }
12028
12029
12031 {
12032 super.AfterStoreLoad();
12033
12035 {
12037 }
12038
12040 {
12043 }
12044 }
12045
12047 {
12048 super.EEOnAfterLoad();
12049
12051 {
12053 }
12054
12057 }
12058
12060 {
12061 return false;
12062 }
12063
12064
12065
12067 {
12069 {
12070 #ifdef PLATFORM_CONSOLE
12071
12073 {
12075 if (menu)
12076 {
12078 }
12079 }
12080 #endif
12081 }
12082
12084 {
12087 }
12088
12090 {
12091 SetWeightDirty();
12093 }
12095 {
12098 }
12099
12101 {
12104 }
12106 {
12109 }
12110
12111 super.OnVariablesSynchronized();
12112 }
12113
12114
12115
12117 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12118 {
12119 if (!IsServerCheck(allow_client))
12120 return false;
12121
12123 return false;
12124
12127
12128 if (value <= (min + 0.001))
12129 value = min;
12130
12131 if (value == min)
12132 {
12133 if (destroy_config)
12134 {
12135 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12136 if (dstr)
12137 {
12139 this.Delete();
12140 return true;
12141 }
12142 }
12143 else if (destroy_forced)
12144 {
12146 this.Delete();
12147 return true;
12148 }
12149
12151 }
12152
12155
12157 {
12159
12160 if (delta)
12162 }
12163
12165
12166 return false;
12167 }
12168
12169
12171 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12172 {
12174 }
12175
12177 {
12180 }
12181
12183 {
12186 }
12187
12189 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12190 {
12191 float value_clamped = Math.Clamp(value, 0, 1);
12193 SetQuantity(result, destroy_config, destroy_forced);
12194 }
12195
12196
12199 {
12201 }
12202
12204 {
12206 }
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12218 {
12219 int slot = -1;
12220 if (GetInventory())
12221 {
12222 InventoryLocation il = new InventoryLocation;
12223 GetInventory().GetCurrentInventoryLocation(il);
12225 }
12226
12228 }
12229
12231 {
12232 float quantity_max = 0;
12233
12235 {
12236 if (attSlotID != -1)
12237 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12238
12239 if (quantity_max <= 0)
12241 }
12242
12243 if (quantity_max <= 0)
12245
12246 return quantity_max;
12247 }
12248
12250 {
12252 }
12253
12255 {
12257 }
12258
12259
12261 {
12263 }
12264
12266 {
12268 }
12269
12271 {
12273 }
12274
12275
12277 {
12278
12279 float weightEx = GetWeightEx();
12280 float special = GetInventoryAndCargoWeight();
12281 return weightEx - special;
12282 }
12283
12284
12286 {
12288 }
12289
12291 {
12293 {
12294 #ifdef DEVELOPER
12295 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12296 {
12297 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12299 }
12300 #endif
12301
12302 return GetQuantity() * GetConfigWeightModified();
12303 }
12304 else if (HasEnergyManager())
12305 {
12306 #ifdef DEVELOPER
12307 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12308 {
12309 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12310 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12311 }
12312 #endif
12313 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12314 }
12315 else
12316 {
12317 #ifdef DEVELOPER
12318 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12319 {
12320 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12321 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12322 }
12323 #endif
12324 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12325 }
12326 }
12327
12330 {
12331 int item_count = 0;
12333
12334 if (GetInventory().GetCargo() != NULL)
12335 {
12336 item_count = GetInventory().GetCargo().GetItemCount();
12337 }
12338
12339 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12340 {
12341 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12342 if (item)
12343 item_count += item.GetNumberOfItems();
12344 }
12345 return item_count;
12346 }
12347
12350 {
12351 float weight = 0;
12352 float wetness = 1;
12353 if (include_wetness)
12356 {
12357 weight = wetness * m_ConfigWeight;
12358 }
12360 {
12361 weight = 1;
12362 }
12363 return weight;
12364 }
12365
12366
12367
12369 {
12370 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12371 {
12372 GameInventory inv = GetInventory();
12373 array<EntityAI> items = new array<EntityAI>;
12375 for (int i = 0; i < items.Count(); i++)
12376 {
12378 if (item)
12379 {
12381 }
12382 }
12383 }
12384 }
12385
12386
12387
12388
12390 {
12391 float energy = 0;
12392 if (HasEnergyManager())
12393 {
12394 energy = GetCompEM().GetEnergy();
12395 }
12396 return energy;
12397 }
12398
12399
12401 {
12402 super.OnEnergyConsumed();
12403
12405 }
12406
12408 {
12409 super.OnEnergyAdded();
12410
12412 }
12413
12414
12416 {
12417 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12418 {
12420 {
12421 float energy_0to1 = GetCompEM().GetEnergy0To1();
12423 }
12424 }
12425 }
12426
12427
12429 {
12430 return ConfigGetFloat("heatIsolation");
12431 }
12432
12434 {
12436 }
12437
12439 {
12440 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12441 if (
GetGame().ConfigIsExisting(paramPath))
12443
12444 return 0.0;
12445 }
12446
12448 {
12449 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12450 if (
GetGame().ConfigIsExisting(paramPath))
12452
12453 return 0.0;
12454 }
12455
12456 override void SetWet(
float value,
bool allow_client =
false)
12457 {
12458 if (!IsServerCheck(allow_client))
12459 return;
12460
12463
12465
12466 m_VarWet = Math.Clamp(value, min, max);
12467
12469 {
12472 }
12473 }
12474
12475 override void AddWet(
float value)
12476 {
12478 }
12479
12481 {
12483 }
12484
12486 {
12488 }
12489
12491 {
12493 }
12494
12496 {
12498 }
12499
12501 {
12503 }
12504
12505 override void OnWetChanged(
float newVal,
float oldVal)
12506 {
12509 if (newLevel != oldLevel)
12510 {
12512 }
12513 }
12514
12516 {
12517 SetWeightDirty();
12518 }
12519
12521 {
12522 return GetWetLevelInternal(
m_VarWet);
12523 }
12524
12525
12526
12528 {
12530 }
12531
12533 {
12535 }
12536
12538 {
12540 }
12541
12543 {
12545 }
12546
12547
12548
12550 {
12551 if (ConfigIsExisting("itemModelLength"))
12552 {
12553 return ConfigGetFloat("itemModelLength");
12554 }
12555 return 0;
12556 }
12557
12559 {
12560 if (ConfigIsExisting("itemAttachOffset"))
12561 {
12562 return ConfigGetFloat("itemAttachOffset");
12563 }
12564 return 0;
12565 }
12566
12567 override void SetCleanness(
int value,
bool allow_client =
false)
12568 {
12569 if (!IsServerCheck(allow_client))
12570 return;
12571
12573
12575
12578 }
12579
12581 {
12583 }
12584
12586 {
12587 return true;
12588 }
12589
12590
12591
12592
12594 {
12596 }
12597
12599 {
12601 }
12602
12603
12604
12605
12606 override void SetColor(
int r,
int g,
int b,
int a)
12607 {
12613 }
12615 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12616 {
12621 }
12622
12624 {
12626 }
12627
12630 {
12631 int r,g,b,a;
12633 r = r/255;
12634 g = g/255;
12635 b = b/255;
12636 a = a/255;
12637 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12638 }
12639
12640
12641
12642 override void SetLiquidType(
int value,
bool allow_client =
false)
12643 {
12644 if (!IsServerCheck(allow_client))
12645 return;
12646
12651 }
12652
12654 {
12655 return ConfigGetInt("varLiquidTypeInit");
12656 }
12657
12659 {
12661 }
12662
12664 {
12666 SetFrozen(false);
12667 }
12668
12671 {
12672 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12673 }
12674
12675
12678 {
12679 PlayerBase nplayer;
12680 if (PlayerBase.CastTo(nplayer, player))
12681 {
12683
12684 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12685 }
12686 }
12687
12688
12691 {
12692 PlayerBase nplayer;
12693 if (PlayerBase.CastTo(nplayer,player))
12694 {
12695
12696 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12697
12698 }
12699
12700
12701 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12702
12703
12704 if (HasEnergyManager())
12705 {
12706 GetCompEM().UpdatePlugState();
12707 }
12708 }
12709
12710
12712 {
12713 super.OnPlacementStarted(player);
12714
12716 }
12717
12718 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12719 {
12721 {
12722 m_AdminLog.OnPlacementComplete(player,
this);
12723 }
12724
12725 super.OnPlacementComplete(player, position, orientation);
12726 }
12727
12728
12729
12730
12731
12733 {
12735 {
12736 return true;
12737 }
12738 else
12739 {
12740 return false;
12741 }
12742 }
12743
12744
12746 {
12748 {
12750 }
12751 }
12752
12753
12755 {
12757 }
12758
12760 {
12762 }
12763
12764 override void InsertAgent(
int agent,
float count = 1)
12765 {
12766 if (count < 1)
12767 return;
12768
12770 }
12771
12774 {
12776 }
12777
12778
12780 {
12782 }
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12826 {
12828 return false;
12829 return true;
12830 }
12831
12833 {
12834
12836 }
12837
12838
12841 {
12842 super.CheckForRoofLimited(timeTresholdMS);
12843
12845 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12846 {
12847 m_PreviousRoofTestTime = time;
12848 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12849 }
12850 }
12851
12852
12854 {
12856 {
12857 return 0;
12858 }
12859
12860 if (GetInventory().GetAttachmentSlotsCount() != 0)
12861 {
12862 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12863 if (filter)
12864 return filter.GetProtectionLevel(type, false, system);
12865 else
12866 return 0;
12867 }
12868
12869 string subclassPath, entryName;
12870
12871 switch (type)
12872 {
12874 entryName = "biological";
12875 break;
12877 entryName = "chemical";
12878 break;
12879 default:
12880 entryName = "biological";
12881 break;
12882 }
12883
12884 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12885
12887 }
12888
12889
12890
12893 {
12894 if (!IsMagazine())
12896
12898 }
12899
12900
12901
12902
12903
12908 {
12909 return true;
12910 }
12911
12913 {
12915 }
12916
12917
12918
12919
12920
12922 {
12923 if (parent)
12924 {
12925 if (parent.IsInherited(DayZInfected))
12926 return true;
12927
12928 if (!parent.IsRuined())
12929 return true;
12930 }
12931
12932 return true;
12933 }
12934
12936 {
12937 if (!super.CanPutAsAttachment(parent))
12938 {
12939 return false;
12940 }
12941
12942 if (!IsRuined() && !parent.IsRuined())
12943 {
12944 return true;
12945 }
12946
12947 return false;
12948 }
12949
12951 {
12952
12953
12954
12955
12956 return super.CanReceiveItemIntoCargo(item);
12957 }
12958
12960 {
12961
12962
12963
12964
12965 GameInventory attachmentInv = attachment.GetInventory();
12967 {
12968 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12969 return false;
12970 }
12971
12972 InventoryLocation loc = new InventoryLocation();
12973 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12974 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12975 return false;
12976
12977 return super.CanReceiveAttachment(attachment, slotId);
12978 }
12979
12981 {
12982 if (!super.CanReleaseAttachment(attachment))
12983 return false;
12984
12985 return GetInventory().AreChildrenAccessible();
12986 }
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13009 {
13010 int id = muzzle_owner.GetMuzzleID();
13011 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13012
13013 if (WPOF_array)
13014 {
13015 for (int i = 0; i < WPOF_array.Count(); i++)
13016 {
13017 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13018
13019 if (WPOF)
13020 {
13021 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13022 }
13023 }
13024 }
13025 }
13026
13027
13029 {
13030 int id = muzzle_owner.GetMuzzleID();
13032
13033 if (WPOBE_array)
13034 {
13035 for (int i = 0; i < WPOBE_array.Count(); i++)
13036 {
13037 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13038
13039 if (WPOBE)
13040 {
13041 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13042 }
13043 }
13044 }
13045 }
13046
13047
13049 {
13050 int id = muzzle_owner.GetMuzzleID();
13051 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13052
13053 if (WPOOH_array)
13054 {
13055 for (int i = 0; i < WPOOH_array.Count(); i++)
13056 {
13057 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13058
13059 if (WPOOH)
13060 {
13061 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13062 }
13063 }
13064 }
13065 }
13066
13067
13069 {
13070 int id = muzzle_owner.GetMuzzleID();
13071 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13072
13073 if (WPOOH_array)
13074 {
13075 for (int i = 0; i < WPOOH_array.Count(); i++)
13076 {
13077 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13078
13079 if (WPOOH)
13080 {
13081 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13082 }
13083 }
13084 }
13085 }
13086
13087
13089 {
13090 int id = muzzle_owner.GetMuzzleID();
13091 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13092
13093 if (WPOOH_array)
13094 {
13095 for (int i = 0; i < WPOOH_array.Count(); i++)
13096 {
13097 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13098
13099 if (WPOOH)
13100 {
13101 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13102 }
13103 }
13104 }
13105 }
13106
13107
13108
13110 {
13112 {
13113 return true;
13114 }
13115
13116 return false;
13117 }
13118
13120 {
13122 {
13123 return true;
13124 }
13125
13126 return false;
13127 }
13128
13130 {
13132 {
13133 return true;
13134 }
13135
13136 return false;
13137 }
13138
13140 {
13141 return false;
13142 }
13143
13146 {
13147 return UATimeSpent.DEFAULT_DEPLOY;
13148 }
13149
13150
13151
13152
13154 {
13156 SetSynchDirty();
13157 }
13158
13160 {
13162 }
13163
13164
13166 {
13167 return false;
13168 }
13169
13172 {
13173 string att_type = "None";
13174
13175 if (ConfigIsExisting("soundAttType"))
13176 {
13177 att_type = ConfigGetString("soundAttType");
13178 }
13179
13181 }
13182
13184 {
13186 }
13187
13188
13189
13190
13191
13197
13199 {
13202
13204 }
13205
13206
13208 {
13210 return;
13211
13213
13216
13219
13220 SoundParameters params = new SoundParameters();
13224 }
13225
13226
13228 {
13230 return;
13231
13233 SetSynchDirty();
13234
13237 }
13238
13239
13241 {
13243 return;
13244
13246 SetSynchDirty();
13247
13250 }
13251
13253 {
13255 }
13256
13258 {
13260 }
13261
13264 {
13265 if (!
GetGame().IsDedicatedServer())
13266 {
13267 if (ConfigIsExisting("attachSoundSet"))
13268 {
13269 string cfg_path = "";
13270 string soundset = "";
13271 string type_name =
GetType();
13272
13275 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13276 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13277
13278 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13279 {
13280 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13281 {
13282 if (cfg_slot_array[i] == slot_type)
13283 {
13284 soundset = cfg_soundset_array[i];
13285 break;
13286 }
13287 }
13288 }
13289
13290 if (soundset != "")
13291 {
13292 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13294 }
13295 }
13296 }
13297 }
13298
13300 {
13301
13302 }
13303
13304 void OnApply(PlayerBase player);
13305
13307 {
13308 return 1.0;
13309 };
13310
13312 {
13314 }
13315
13317 {
13319 }
13320
13322
13324 {
13325 SetDynamicPhysicsLifeTime(0.01);
13327 }
13328
13330 {
13331 array<string> zone_names = new array<string>;
13332 GetDamageZones(zone_names);
13333 for (int i = 0; i < zone_names.Count(); i++)
13334 {
13335 SetHealthMax(zone_names.Get(i),"Health");
13336 }
13337 SetHealthMax("","Health");
13338 }
13339
13342 {
13343 float global_health = GetHealth01("","Health");
13344 array<string> zones = new array<string>;
13345 GetDamageZones(zones);
13346
13347 for (int i = 0; i < zones.Count(); i++)
13348 {
13349 SetHealth01(zones.Get(i),"Health",global_health);
13350 }
13351 }
13352
13355 {
13356 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13357 }
13358
13360 {
13361 if (!hasRootAsPlayer)
13362 {
13363 if (refParentIB)
13364 {
13365
13366 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13367 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13368
13369 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13370 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13371
13374 }
13375 else
13376 {
13377
13380 }
13381 }
13382 }
13383
13385 {
13387 {
13388 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13389 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13390 {
13391 float heatPermCoef = 1.0;
13393 while (ent)
13394 {
13395 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13396 ent = ent.GetHierarchyParent();
13397 }
13398
13399 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13400 }
13401 }
13402 }
13403
13405 {
13406
13407 EntityAI parent = GetHierarchyParent();
13408 if (!parent)
13409 {
13410 hasParent = false;
13411 hasRootAsPlayer = false;
13412 }
13413 else
13414 {
13415 hasParent = true;
13416 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13417 refParentIB =
ItemBase.Cast(parent);
13418 }
13419 }
13420
13421 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13422 {
13423
13424 }
13425
13427 {
13428
13429 return false;
13430 }
13431
13433 {
13434
13435
13436 return false;
13437 }
13438
13440 {
13441
13442 return false;
13443 }
13444
13447 {
13448 return !GetIsFrozen() &&
IsOpen();
13449 }
13450
13452 {
13453 bool hasParent = false, hasRootAsPlayer = false;
13455
13456 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13457 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13458
13459 if (wwtu || foodDecay)
13460 {
13464
13465 if (processWetness || processTemperature || processDecay)
13466 {
13468
13469 if (processWetness)
13470 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13471
13472 if (processTemperature)
13474
13475 if (processDecay)
13476 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13477 }
13478 }
13479 }
13480
13483 {
13485 }
13486
13488 {
13491
13492 return super.GetTemperatureFreezeThreshold();
13493 }
13494
13496 {
13499
13500 return super.GetTemperatureThawThreshold();
13501 }
13502
13504 {
13507
13508 return super.GetItemOverheatThreshold();
13509 }
13510
13512 {
13514 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13515
13516 return super.GetTemperatureFreezeTime();
13517 }
13518
13520 {
13522 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13523
13524 return super.GetTemperatureThawTime();
13525 }
13526
13531
13533 {
13534 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13535 }
13536
13538 {
13539 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13540 }
13541
13544 {
13546 }
13547
13549 {
13551 }
13552
13554 {
13556 }
13557
13560 {
13561 return null;
13562 }
13563
13566 {
13567 return false;
13568 }
13569
13571 {
13573 {
13576 if (!trg)
13577 {
13579 explosive = this;
13580 }
13581
13582 explosive.PairRemote(trg);
13584
13585 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13586 trg.SetPersistentPairID(persistentID);
13587 explosive.SetPersistentPairID(persistentID);
13588
13589 return true;
13590 }
13591 return false;
13592 }
13593
13596 {
13597 float ret = 1.0;
13600 ret *= GetHealth01();
13601
13602 return ret;
13603 }
13604
13605 #ifdef DEVELOPER
13606 override void SetDebugItem()
13607 {
13608 super.SetDebugItem();
13609 _itemBase = this;
13610 }
13611
13613 {
13614 string text = super.GetDebugText();
13615
13617 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13618
13619 return text;
13620 }
13621 #endif
13622
13624 {
13625 return true;
13626 }
13627
13629
13631
13633 {
13636 }
13637
13638
13646
13662}
13663
13665{
13667 if (entity)
13668 {
13669 bool is_item = entity.IsInherited(
ItemBase);
13670 if (is_item && full_quantity)
13671 {
13674 }
13675 }
13676 else
13677 {
13679 return NULL;
13680 }
13681 return entity;
13682}
13683
13685{
13686 if (item)
13687 {
13688 if (health > 0)
13689 item.SetHealth("", "", health);
13690
13691 if (item.CanHaveTemperature())
13692 {
13694 if (item.CanFreeze())
13695 item.SetFrozen(false);
13696 }
13697
13698 if (item.HasEnergyManager())
13699 {
13700 if (quantity >= 0)
13701 {
13702 item.GetCompEM().SetEnergy0To1(quantity);
13703 }
13704 else
13705 {
13707 }
13708 }
13709 else if (item.IsMagazine())
13710 {
13711 Magazine mag = Magazine.Cast(item);
13712 if (quantity >= 0)
13713 {
13714 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13715 }
13716 else
13717 {
13719 }
13720
13721 }
13722 else
13723 {
13724 if (quantity >= 0)
13725 {
13726 item.SetQuantityNormalized(quantity, false);
13727 }
13728 else
13729 {
13731 }
13732
13733 }
13734 }
13735}
13736
13737#ifdef DEVELOPER
13739#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.