8942{
8944 {
8945 return true;
8946 }
8947};
8948
8949
8950
8952{
8956
8958
8961
8962
8963
8964
8965
8974
8980
8985
8990
9011 protected bool m_IsResultOfSplit
9012
9014
9019
9020
9021
9023
9027
9028
9029
9031
9034
9035
9036
9042
9043
9051
9054
9055
9057
9058
9060
9061
9066
9067
9072
9073
9075
9076
9078 {
9083
9084 if (!
GetGame().IsDedicatedServer())
9085 {
9087 {
9089
9091 {
9093 }
9094 }
9095
9098 }
9099
9100 m_OldLocation = null;
9101
9103 {
9105 }
9106
9107 if (ConfigIsExisting("headSelectionsToHide"))
9108 {
9111 }
9112
9114 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9115 {
9117 }
9118
9120
9121 m_IsResultOfSplit = false;
9122
9124 }
9125
9127 {
9128 super.InitItemVariables();
9129
9135 m_Count = ConfigGetInt(
"count");
9136
9139
9144
9147
9152
9164
9168
9169
9172 if (ConfigIsExisting("canBeSplit"))
9173 {
9176 }
9177
9179 if (ConfigIsExisting("itemBehaviour"))
9181
9182
9185 RegisterNetSyncVariableInt("m_VarLiquidType");
9186 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9187
9188 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9189 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9190 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9191
9192 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9193 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9194 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9195 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9196
9197 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9198 RegisterNetSyncVariableBool("m_IsTakeable");
9199 RegisterNetSyncVariableBool("m_IsHologram");
9200
9203 {
9206 }
9207
9209
9211 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9213
9214 }
9215
9217 {
9219 }
9220
9222 {
9225 {
9230 }
9231 }
9232
9233 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9234 {
9236 {
9239 }
9240
9242 }
9243
9245 {
9251 }
9252
9254
9256 {
9258
9259 if (!action)
9260 {
9261 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9262 return;
9263 }
9264
9266 if (!ai)
9267 {
9269 return;
9270 }
9271
9273 if (!action_array)
9274 {
9275 action_array = new array<ActionBase_Basic>;
9277 }
9278 if (LogManager.IsActionLogEnable())
9279 {
9280 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9281 }
9282
9283 if (action_array.Find(action) != -1)
9284 {
9285 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9286 }
9287 else
9288 {
9289 action_array.Insert(action);
9290 }
9291 }
9292
9294 {
9296 ActionBase action = player.GetActionManager().GetAction(actionName);
9299
9300 if (action_array)
9301 {
9302 action_array.RemoveItem(action);
9303 }
9304 }
9305
9306
9307
9309 {
9310 ActionOverrideData overrideData = new ActionOverrideData();
9314
9316 if (!actionMap)
9317 {
9320 }
9321
9322 actionMap.Insert(this.
Type(), overrideData);
9323
9324 }
9325
9327
9329
9330
9332 {
9335
9338
9339 string config_to_search = "CfgVehicles";
9340 string muzzle_owner_config;
9341
9343 {
9344 if (IsInherited(Weapon))
9345 config_to_search = "CfgWeapons";
9346
9347 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9348
9349 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9350
9352
9353 if (config_OnFire_subclass_count > 0)
9354 {
9355 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9356
9357 for (int i = 0; i < config_OnFire_subclass_count; i++)
9358 {
9359 string particle_class = "";
9361 string config_OnFire_entry = config_OnFire_class + particle_class;
9362 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9363 WPOF_array.Insert(WPOF);
9364 }
9365
9366
9368 }
9369 }
9370
9372 {
9373 config_to_search = "CfgWeapons";
9374 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9375
9376 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9377
9379
9380 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9381 {
9382 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9383
9384 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9385 {
9386 string particle_class2 = "";
9388 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9389 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9390 WPOBE_array.Insert(WPOBE);
9391 }
9392
9393
9395 }
9396 }
9397 }
9398
9399
9401 {
9404
9406 {
9407 string config_to_search = "CfgVehicles";
9408
9409 if (IsInherited(Weapon))
9410 config_to_search = "CfgWeapons";
9411
9412 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9413 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9414
9415 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9416 {
9417
9419
9421 {
9423 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9425 return;
9426 }
9427
9430
9431
9432
9434 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9435
9436 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9437 {
9438 string particle_class = "";
9440 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9442
9443 if (entry_type == CT_CLASS)
9444 {
9445 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9446 WPOOH_array.Insert(WPOF);
9447 }
9448 }
9449
9450
9452 }
9453 }
9454 }
9455
9457 {
9459 }
9460
9462 {
9464 {
9466
9469
9472
9473 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9474 }
9475 }
9476
9478 {
9480 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9481
9483 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9484
9486 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9487
9489 {
9491 }
9492 }
9493
9495 {
9497 }
9498
9500 {
9503 else
9505
9507 {
9510 }
9511 else
9512 {
9515
9518 }
9519
9521 }
9522
9524 {
9526 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9527 }
9528
9530 {
9532 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9534 }
9535
9537 {
9539 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9540 }
9541
9543 {
9546
9547 OverheatingParticle OP = new OverheatingParticle();
9552
9554 }
9555
9557 {
9560
9561 return -1;
9562 }
9563
9565 {
9567 {
9570
9571 for (int i = count; i > 0; --i)
9572 {
9573 int id = i - 1;
9576
9579
9580 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9581 {
9582 if (p)
9583 {
9586 }
9587 }
9588 }
9589 }
9590 }
9591
9593 {
9595 {
9597 {
9598 int id = i - 1;
9600
9601 if (OP)
9602 {
9604
9605 if (p)
9606 {
9608 }
9609
9610 delete OP;
9611 }
9612 }
9613
9616 }
9617 }
9618
9621 {
9622 return 0.0;
9623 }
9624
9625
9627 {
9628 return 250;
9629 }
9630
9632 {
9633 return 0;
9634 }
9635
9638 {
9640 return true;
9641
9642 return false;
9643 }
9644
9647 {
9650
9652 {
9654 }
9655 else
9656 {
9657
9659 }
9660
9662 }
9663
9670 {
9671 return -1;
9672 }
9673
9674
9675
9676
9678 {
9680 {
9682 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9683
9684 if (r_index >= 0)
9685 {
9686 InventoryLocation r_il = new InventoryLocation;
9687 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9688
9689 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9692 {
9693 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9694 }
9696 {
9697 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9698 }
9699
9700 }
9701
9702 player.GetHumanInventory().ClearUserReservedLocation(this);
9703 }
9704
9707 }
9708
9709
9710
9711
9713 {
9714 return ItemBase.m_DebugActionsMask;
9715 }
9716
9718 {
9719 return ItemBase.m_DebugActionsMask & mask;
9720 }
9721
9723 {
9724 ItemBase.m_DebugActionsMask = mask;
9725 }
9726
9728 {
9729 ItemBase.m_DebugActionsMask |= mask;
9730 }
9731
9733 {
9734 ItemBase.m_DebugActionsMask &= ~mask;
9735 }
9736
9738 {
9740 {
9742 }
9743 else
9744 {
9746 }
9747 }
9748
9749
9751 {
9752 if (GetEconomyProfile())
9753 {
9754 float q_max = GetEconomyProfile().GetQuantityMax();
9755 if (q_max > 0)
9756 {
9757 float q_min = GetEconomyProfile().GetQuantityMin();
9758 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9759
9761 {
9762 ComponentEnergyManager comp = GetCompEM();
9764 {
9766 }
9767 }
9769 {
9771
9772 }
9773
9774 }
9775 }
9776 }
9777
9780 {
9781 EntityAI parent = GetHierarchyParent();
9782
9783 if (parent)
9784 {
9785 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9786 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9787 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9788 }
9789 }
9790
9793 {
9794 EntityAI parent = GetHierarchyParent();
9795
9796 if (parent)
9797 {
9798 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9799 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9800 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9801 }
9802 }
9803
9805 {
9806
9807
9808
9809
9811
9813 {
9814 if (ScriptInputUserData.CanStoreInputUserData())
9815 {
9816 ScriptInputUserData ctx = new ScriptInputUserData;
9822 ctx.
Write(use_stack_max);
9825
9827 {
9828 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9829 }
9830 }
9831 }
9832 else if (!
GetGame().IsMultiplayer())
9833 {
9835 }
9836 }
9837
9839 {
9841 }
9842
9844 {
9846 }
9847
9849 {
9851 }
9852
9854 {
9855
9856 return false;
9857 }
9858
9860 {
9861 return false;
9862 }
9863
9867 {
9868 return false;
9869 }
9870
9872 {
9873 return "";
9874 }
9875
9877
9879 {
9880 return false;
9881 }
9882
9884 {
9885 return true;
9886 }
9887
9888
9889
9891 {
9892 return true;
9893 }
9894
9896 {
9897 return true;
9898 }
9899
9901 {
9902 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9904 }
9905
9907 {
9909 }
9910
9912 {
9914 if (!is_being_placed)
9916 SetSynchDirty();
9917 }
9918
9919
9921
9923 {
9925 }
9926
9928 {
9930 }
9931
9933 {
9934 return 1;
9935 }
9936
9938 {
9939 return false;
9940 }
9941
9943 {
9945 SetSynchDirty();
9946 }
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9983 {
9984 super.OnMovedInsideCargo(container);
9985
9986 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9987 }
9988
9989 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9990 {
9991 super.EEItemLocationChanged(oldLoc,newLoc);
9992
9993 PlayerBase new_player = null;
9994 PlayerBase old_player = null;
9995
9996 if (newLoc.GetParent())
9997 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9998
9999 if (oldLoc.GetParent())
10000 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10001
10003 {
10004 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10005
10006 if (r_index >= 0)
10007 {
10008 InventoryLocation r_il = new InventoryLocation;
10009 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10010
10011 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10014 {
10015 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10016 }
10018 {
10019 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10020 }
10021
10022 }
10023 }
10024
10026 {
10027 if (new_player)
10028 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10029
10030 if (new_player == old_player)
10031 {
10032
10033 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10034 {
10036 {
10037 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10038 {
10039 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10040 }
10041 }
10042 else
10043 {
10044 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10045 }
10046 }
10047
10048 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10049 {
10050 int type = oldLoc.GetType();
10052 {
10053 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10054 }
10056 {
10057 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10058 }
10059 }
10060 if (!m_OldLocation)
10061 {
10062 m_OldLocation = new InventoryLocation;
10063 }
10064 m_OldLocation.Copy(oldLoc);
10065 }
10066 else
10067 {
10068 if (m_OldLocation)
10069 {
10070 m_OldLocation.Reset();
10071 }
10072 }
10073
10075 }
10076 else
10077 {
10078 if (new_player)
10079 {
10080 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10081 if (res_index >= 0)
10082 {
10083 InventoryLocation il = new InventoryLocation;
10084 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10086 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10089 {
10090 il.
GetParent().GetOnReleaseLock().Invoke(it);
10091 }
10093 {
10095 }
10096
10097 }
10098 }
10100 {
10101
10103 }
10104
10105 if (m_OldLocation)
10106 {
10107 m_OldLocation.Reset();
10108 }
10109 }
10110 }
10111
10112 override void EOnContact(IEntity other, Contact extra)
10113 {
10115 {
10116 int liquidType = -1;
10118 if (impactSpeed > 0.0)
10119 {
10121 #ifndef SERVER
10123 #else
10125 SetSynchDirty();
10126 #endif
10128 }
10129 }
10130
10131 #ifdef SERVER
10132 if (GetCompEM() && GetCompEM().IsPlugged())
10133 {
10134 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10135 GetCompEM().UnplugThis();
10136 }
10137 #endif
10138 }
10139
10141
10143 {
10145 }
10146
10148 {
10149
10150 }
10151
10153 {
10154 super.OnItemLocationChanged(old_owner, new_owner);
10155
10156 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10157 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10158
10159 if (!relatedPlayer && playerNew)
10160 relatedPlayer = playerNew;
10161
10162 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10163 {
10165 if (actionMgr)
10166 {
10167 ActionBase currentAction = actionMgr.GetRunningAction();
10168 if (currentAction)
10170 }
10171 }
10172
10173 Man ownerPlayerOld = null;
10174 Man ownerPlayerNew = null;
10175
10176 if (old_owner)
10177 {
10178 if (old_owner.
IsMan())
10179 {
10180 ownerPlayerOld = Man.Cast(old_owner);
10181 }
10182 else
10183 {
10184 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10185 }
10186 }
10187 else
10188 {
10190 {
10192
10193 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10194 {
10195 GetCompEM().UnplugThis();
10196 }
10197 }
10198 }
10199
10200 if (new_owner)
10201 {
10202 if (new_owner.
IsMan())
10203 {
10204 ownerPlayerNew = Man.Cast(new_owner);
10205 }
10206 else
10207 {
10208 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10209 }
10210 }
10211
10212 if (ownerPlayerOld != ownerPlayerNew)
10213 {
10214 if (ownerPlayerOld)
10215 {
10216 array<EntityAI> subItemsExit = new array<EntityAI>;
10218 for (int i = 0; i < subItemsExit.Count(); i++)
10219 {
10222 }
10223 }
10224
10225 if (ownerPlayerNew)
10226 {
10227 array<EntityAI> subItemsEnter = new array<EntityAI>;
10229 for (int j = 0; j < subItemsEnter.Count(); j++)
10230 {
10233 }
10234 }
10235 }
10236 else if (ownerPlayerNew != null)
10237 {
10238 PlayerBase nplayer;
10239 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10240 {
10241 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10243 for (int k = 0; k < subItemsUpdate.Count(); k++)
10244 {
10246 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10247 }
10248 }
10249 }
10250
10251 if (old_owner)
10252 old_owner.OnChildItemRemoved(this);
10253 if (new_owner)
10254 new_owner.OnChildItemReceived(this);
10255 }
10256
10257
10259 {
10260 super.EEDelete(parent);
10261 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10262 if (player)
10263 {
10265
10266 if (player.IsAlive())
10267 {
10268 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10269 if (r_index >= 0)
10270 {
10271 InventoryLocation r_il = new InventoryLocation;
10272 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10273
10274 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10277 {
10278 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10279 }
10281 {
10282 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10283 }
10284
10285 }
10286
10287 player.RemoveQuickBarEntityShortcut(this);
10288 }
10289 }
10290 }
10291
10293 {
10294 super.EEKilled(killer);
10295
10298 {
10299 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10300 {
10301 if (IsMagazine())
10302 {
10303 if (Magazine.Cast(this).GetAmmoCount() > 0)
10304 {
10306 }
10307 }
10308 else
10309 {
10311 }
10312 }
10313 }
10314 }
10315
10317 {
10318 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10319
10320 super.OnWasAttached(parent, slot_id);
10321
10324
10326 }
10327
10329 {
10330 super.OnWasDetached(parent, slot_id);
10331
10334 }
10335
10337 {
10338 int idx;
10341
10342 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10343 if (inventory_slots.Count() < 1)
10344 {
10345 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10346 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10347 }
10348 else
10349 {
10350 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10351 }
10352
10353 idx = inventory_slots.Find(slot);
10354 if (idx < 0)
10355 return "";
10356
10357 return attach_types.Get(idx);
10358 }
10359
10361 {
10362 int idx = -1;
10363 string slot;
10364
10367
10368 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10369 if (inventory_slots.Count() < 1)
10370 {
10371 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10372 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10373 }
10374 else
10375 {
10376 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10377 if (detach_types.Count() < 1)
10378 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10379 }
10380
10381 for (int i = 0; i < inventory_slots.Count(); i++)
10382 {
10383 slot = inventory_slots.Get(i);
10384 }
10385
10386 if (slot != "")
10387 {
10388 if (detach_types.Count() == 1)
10389 idx = 0;
10390 else
10391 idx = inventory_slots.Find(slot);
10392 }
10393 if (idx < 0)
10394 return "";
10395
10396 return detach_types.Get(idx);
10397 }
10398
10400 {
10401
10403
10404
10405 float min_time = 1;
10406 float max_time = 3;
10407 float delay = Math.RandomFloat(min_time, max_time);
10408
10409 explode_timer.Run(delay, this, "DoAmmoExplosion");
10410 }
10411
10413 {
10414 Magazine magazine = Magazine.Cast(this);
10415 int pop_sounds_count = 6;
10416 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10417
10418
10419 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10420 string sound_name = pop_sounds[ sound_idx ];
10422
10423
10424 magazine.ServerAddAmmoCount(-1);
10425
10426
10427 float min_temp_to_explode = 100;
10428
10429 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10430 {
10432 }
10433 }
10434
10435
10436 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10437 {
10438 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10439
10440 const int CHANCE_DAMAGE_CARGO = 4;
10441 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10442 const int CHANCE_DAMAGE_NOTHING = 2;
10443
10445 {
10446 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10447 int chances;
10448 int rnd;
10449
10450 if (GetInventory().GetCargo())
10451 {
10452 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10453 rnd = Math.RandomInt(0,chances);
10454
10455 if (rnd < CHANCE_DAMAGE_CARGO)
10456 {
10458 }
10459 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10460 {
10462 }
10463 }
10464 else
10465 {
10466 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10467 rnd = Math.RandomInt(0,chances);
10468
10469 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10470 {
10472 }
10473 }
10474 }
10475 }
10476
10478 {
10479 if (GetInventory().GetCargo())
10480 {
10481 int item_count = GetInventory().GetCargo().GetItemCount();
10482 if (item_count > 0)
10483 {
10484 int random_pick = Math.RandomInt(0, item_count);
10486 if (!item.IsExplosive())
10487 {
10488 item.AddHealth("","",damage);
10489 return true;
10490 }
10491 }
10492 }
10493 return false;
10494 }
10495
10497 {
10498 int attachment_count = GetInventory().AttachmentCount();
10499 if (attachment_count > 0)
10500 {
10501 int random_pick = Math.RandomInt(0, attachment_count);
10502 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10503 if (!attachment.IsExplosive())
10504 {
10505 attachment.AddHealth("","",damage);
10506 return true;
10507 }
10508 }
10509 return false;
10510 }
10511
10513 {
10515 }
10516
10518 {
10520 return GetInventory().CanRemoveEntity();
10521
10522 return false;
10523 }
10524
10526 {
10527
10529 return false;
10530
10531
10533 return false;
10534
10535
10536
10538 if (delta == 0)
10539 return false;
10540
10541
10542 return true;
10543 }
10544
10546 {
10548 {
10549 if (ScriptInputUserData.CanStoreInputUserData())
10550 {
10551 ScriptInputUserData ctx = new ScriptInputUserData;
10556 ctx.
Write(destination_entity);
10558 ctx.
Write(slot_id);
10560 }
10561 }
10562 else if (!
GetGame().IsMultiplayer())
10563 {
10565 }
10566 }
10567
10569 {
10570 float split_quantity_new;
10574 InventoryLocation loc = new InventoryLocation;
10575
10576 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10577 {
10579 split_quantity_new = stack_max;
10580 else
10582
10584 {
10585 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10586 if (new_item)
10587 {
10588 new_item.SetResultOfSplit(true);
10589 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10591 new_item.
SetQuantity(split_quantity_new,
false,
true);
10592 }
10593 }
10594 }
10595 else if (destination_entity && slot_id == -1)
10596 {
10597 if (quantity > stack_max)
10598 split_quantity_new = stack_max;
10599 else
10600 split_quantity_new = quantity;
10601
10603 {
10605 {
10608 }
10609
10610 if (new_item)
10611 {
10612 new_item.SetResultOfSplit(true);
10613 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10615 new_item.
SetQuantity(split_quantity_new,
false,
true);
10616 }
10617 }
10618 }
10619 else
10620 {
10621 if (stack_max != 0)
10622 {
10624 {
10626 }
10627
10628 if (split_quantity_new == 0)
10629 {
10630 if (!
GetGame().IsMultiplayer())
10631 player.PhysicalPredictiveDropItem(this);
10632 else
10633 player.ServerDropEntity(this);
10634 return;
10635 }
10636
10638 {
10640
10641 if (new_item)
10642 {
10643 new_item.SetResultOfSplit(true);
10644 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10647 new_item.PlaceOnSurface();
10648 }
10649 }
10650 }
10651 }
10652 }
10653
10655 {
10656 float split_quantity_new;
10660 InventoryLocation loc = new InventoryLocation;
10661
10662 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10663 {
10665 split_quantity_new = stack_max;
10666 else
10668
10670 {
10671 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10672 if (new_item)
10673 {
10674 new_item.SetResultOfSplit(true);
10675 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10677 new_item.
SetQuantity(split_quantity_new,
false,
true);
10678 }
10679 }
10680 }
10681 else if (destination_entity && slot_id == -1)
10682 {
10683 if (quantity > stack_max)
10684 split_quantity_new = stack_max;
10685 else
10686 split_quantity_new = quantity;
10687
10689 {
10691 {
10694 }
10695
10696 if (new_item)
10697 {
10698 new_item.SetResultOfSplit(true);
10699 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10701 new_item.
SetQuantity(split_quantity_new,
false,
true);
10702 }
10703 }
10704 }
10705 else
10706 {
10707 if (stack_max != 0)
10708 {
10710 {
10712 }
10713
10715 {
10717
10718 if (new_item)
10719 {
10720 new_item.SetResultOfSplit(true);
10721 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10724 new_item.PlaceOnSurface();
10725 }
10726 }
10727 }
10728 }
10729 }
10730
10732 {
10734 {
10735 if (ScriptInputUserData.CanStoreInputUserData())
10736 {
10737 ScriptInputUserData ctx = new ScriptInputUserData;
10742 dst.WriteToContext(ctx);
10744 }
10745 }
10746 else if (!
GetGame().IsMultiplayer())
10747 {
10749 }
10750 }
10751
10753 {
10755 {
10756 if (ScriptInputUserData.CanStoreInputUserData())
10757 {
10758 ScriptInputUserData ctx = new ScriptInputUserData;
10763 ctx.
Write(destination_entity);
10769 }
10770 }
10771 else if (!
GetGame().IsMultiplayer())
10772 {
10774 }
10775 }
10776
10778 {
10780 }
10781
10783 {
10785 float split_quantity_new;
10787 if (dst.IsValid())
10788 {
10789 int slot_id = dst.GetSlot();
10791
10792 if (quantity > stack_max)
10793 split_quantity_new = stack_max;
10794 else
10795 split_quantity_new = quantity;
10796
10798 {
10800
10801 if (new_item)
10802 {
10803 new_item.SetResultOfSplit(true);
10804 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10806 new_item.
SetQuantity(split_quantity_new,
false,
true);
10807 }
10808
10809 return new_item;
10810 }
10811 }
10812
10813 return null;
10814 }
10815
10817 {
10819 float split_quantity_new;
10821 if (destination_entity)
10822 {
10824 if (quantity > stackable)
10825 split_quantity_new = stackable;
10826 else
10827 split_quantity_new = quantity;
10828
10830 {
10831 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10832 if (new_item)
10833 {
10834 new_item.SetResultOfSplit(true);
10835 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10837 new_item.
SetQuantity(split_quantity_new,
false,
true);
10838 }
10839 }
10840 }
10841 }
10842
10844 {
10846 {
10847 if (ScriptInputUserData.CanStoreInputUserData())
10848 {
10849 ScriptInputUserData ctx = new ScriptInputUserData;
10854 ItemBase destination_entity =
this;
10855 ctx.
Write(destination_entity);
10859 }
10860 }
10861 else if (!
GetGame().IsMultiplayer())
10862 {
10864 }
10865 }
10866
10868 {
10870 float split_quantity_new;
10872 if (player)
10873 {
10875 if (quantity > stackable)
10876 split_quantity_new = stackable;
10877 else
10878 split_quantity_new = quantity;
10879
10881 {
10882 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10883 new_item =
ItemBase.Cast(in_hands);
10884 if (new_item)
10885 {
10886 new_item.SetResultOfSplit(true);
10887 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10889 new_item.SetQuantity(split_quantity_new, false, true);
10890 }
10891 }
10892 }
10893 }
10894
10896 {
10898 float split_quantity_new = Math.Floor(quantity * 0.5);
10899
10901 return;
10902
10904
10905 if (new_item)
10906 {
10907 if (new_item.GetQuantityMax() < split_quantity_new)
10908 {
10909 split_quantity_new = new_item.GetQuantityMax();
10910 }
10911
10912 new_item.SetResultOfSplit(true);
10913 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10914
10916 {
10919 }
10920 else
10921 {
10923 new_item.
SetQuantity(split_quantity_new,
false,
true);
10924 }
10925 }
10926 }
10927
10929 {
10931 float split_quantity_new = Math.Floor(quantity / 2);
10932
10934 return;
10935
10936 InventoryLocation invloc = new InventoryLocation;
10938
10940 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10941
10942 if (new_item)
10943 {
10944 if (new_item.GetQuantityMax() < split_quantity_new)
10945 {
10946 split_quantity_new = new_item.GetQuantityMax();
10947 }
10949 {
10952 }
10953 else if (split_quantity_new > 1)
10954 {
10956 new_item.
SetQuantity(split_quantity_new,
false,
true);
10957 }
10958 }
10959 }
10960
10963 {
10964 SetWeightDirty();
10966
10967 if (parent)
10968 parent.OnAttachmentQuantityChangedEx(this, delta);
10969
10971 {
10973 {
10975 }
10977 {
10978 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10980 }
10981 }
10982
10983 }
10984
10987 {
10988
10989 }
10990
10993 {
10995 }
10996
10998 {
10999 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11000
11002 {
11003 if (newLevel == GameConstants.STATE_RUINED)
11004 {
11006 EntityAI parent = GetHierarchyParent();
11007 if (parent && parent.IsFireplace())
11008 {
11009 CargoBase cargo = GetInventory().GetCargo();
11010 if (cargo)
11011 {
11013 {
11015 }
11016 }
11017 }
11018 }
11019
11021 {
11022
11024 return;
11025 }
11026
11027 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11028 {
11030 }
11031 }
11032 }
11033
11034
11036 {
11037 super.OnRightClick();
11038
11040 {
11042 {
11043 if (ScriptInputUserData.CanStoreInputUserData())
11044 {
11045 EntityAI root = GetHierarchyRoot();
11046 Man playerOwner = GetHierarchyRootPlayer();
11047 InventoryLocation dst = new InventoryLocation;
11048
11049
11050 if (!playerOwner && root && root == this)
11051 {
11053 }
11054 else
11055 {
11056
11057 GetInventory().GetCurrentInventoryLocation(dst);
11059 {
11062 {
11064 }
11065 else
11066 {
11068
11069
11070 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11071 {
11073 }
11074 else
11075 {
11076 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11077 }
11078 }
11079 }
11080 }
11081
11082 ScriptInputUserData ctx = new ScriptInputUserData;
11090 }
11091 }
11092 else if (!
GetGame().IsMultiplayer())
11093 {
11095 }
11096 }
11097 }
11098
11100 {
11101 if (root)
11102 {
11103 vector m4[4];
11104 root.GetTransform(m4);
11105 dst.SetGround(this, m4);
11106 }
11107 else
11108 {
11109 GetInventory().GetCurrentInventoryLocation(dst);
11110 }
11111 }
11112
11113 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11114 {
11115
11116 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11117 return false;
11118
11119 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11120 return false;
11121
11122
11124 return false;
11125
11126
11127 Magazine mag = Magazine.Cast(this);
11128 if (mag)
11129 {
11130 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11131 return false;
11132
11133 if (stack_max_limit)
11134 {
11135 Magazine other_mag = Magazine.Cast(other_item);
11136 if (other_item)
11137 {
11138 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11139 return false;
11140 }
11141
11142 }
11143 }
11144 else
11145 {
11146
11148 return false;
11149
11151 return false;
11152 }
11153
11154 PlayerBase player = null;
11155 if (CastTo(player, GetHierarchyRootPlayer()))
11156 {
11157 if (player.GetInventory().HasAttachment(this))
11158 return false;
11159
11160 if (player.IsItemsToDelete())
11161 return false;
11162 }
11163
11164 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11165 return false;
11166
11167 int slotID;
11169 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11170 return false;
11171
11172 return true;
11173 }
11174
11176 {
11178 }
11179
11181 {
11182 return m_IsResultOfSplit;
11183 }
11184
11186 {
11187 m_IsResultOfSplit = value;
11188 }
11189
11191 {
11193 }
11194
11196 {
11197 float other_item_quantity = other_item.GetQuantity();
11198 float this_free_space;
11199
11201
11203
11204 if (other_item_quantity > this_free_space)
11205 {
11206 return this_free_space;
11207 }
11208 else
11209 {
11210 return other_item_quantity;
11211 }
11212 }
11213
11215 {
11217 }
11218
11220 {
11222 return;
11223
11224 if (!IsMagazine() && other_item)
11225 {
11227 if (quantity_used != 0)
11228 {
11229 float hp1 = GetHealth01("","");
11230 float hp2 = other_item.GetHealth01("","");
11231 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11232 hpResult = hpResult / (
GetQuantity() + quantity_used);
11233
11234 hpResult *= GetMaxHealth();
11235 Math.Round(hpResult);
11236 SetHealth("", "Health", hpResult);
11237
11239 other_item.AddQuantity(-quantity_used);
11240 }
11241 }
11243 }
11244
11246 {
11247 #ifdef SERVER
11248 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11249 GetHierarchyParent().IncreaseLifetimeUp();
11250 #endif
11251 };
11252
11254 {
11255 PlayerBase p = PlayerBase.Cast(player);
11256
11257 array<int> recipesIds = p.m_Recipes;
11258 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11259 if (moduleRecipesManager)
11260 {
11261 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11262 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11263 }
11264
11265 for (int i = 0;i < recipesIds.Count(); i++)
11266 {
11267 int key = recipesIds.Get(i);
11268 string recipeName = moduleRecipesManager.GetRecipeName(key);
11270 }
11271 }
11272
11273
11274 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11275 {
11276 super.GetDebugActions(outputList);
11277
11278
11284
11285
11290
11295
11296
11300
11301
11303 {
11307 }
11308
11311
11312
11316
11318
11319 InventoryLocation loc = new InventoryLocation();
11320 GetInventory().GetCurrentInventoryLocation(loc);
11322 {
11323 if (Gizmo_IsSupported())
11326 }
11327
11329 }
11330
11331
11332
11333
11335 {
11336 super.OnAction(action_id, player, ctx);
11337
11339 {
11340 switch (action_id)
11341 {
11344 return true;
11347 return true;
11348 }
11349 }
11350
11352 {
11353 switch (action_id)
11354 {
11356 Delete();
11357 return true;
11358 }
11359 }
11360
11361 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11362 {
11363 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11364 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11365 PlayerBase p = PlayerBase.Cast(player);
11366 if (
EActions.RECIPES_RANGE_START < 1000)
11367 {
11368 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11369 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11370 }
11371 }
11372 #ifndef SERVER
11373 else if (action_id ==
EActions.WATCH_PLAYER)
11374 {
11375 PluginDeveloper.SetDeveloperItemClientEx(player);
11376 }
11377 #endif
11379 {
11380 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11381 {
11382 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11383 OnDebugButtonPressServer(id + 1);
11384 }
11385
11386 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11387 {
11388 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11390 }
11391
11392 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11393 {
11394 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11396 }
11397
11398 else if (action_id ==
EActions.ADD_QUANTITY)
11399 {
11400 if (IsMagazine())
11401 {
11402 Magazine mag = Magazine.Cast(this);
11403 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11404 }
11405 else
11406 {
11408 }
11409
11410 if (m_EM)
11411 {
11412 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11413 }
11414
11415 }
11416
11417 else if (action_id ==
EActions.REMOVE_QUANTITY)
11418 {
11419 if (IsMagazine())
11420 {
11421 Magazine mag2 = Magazine.Cast(this);
11422 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11423 }
11424 else
11425 {
11427 }
11428 if (m_EM)
11429 {
11430 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11431 }
11432
11433 }
11434
11435 else if (action_id ==
EActions.SET_QUANTITY_0)
11436 {
11438
11439 if (m_EM)
11440 {
11441 m_EM.SetEnergy(0);
11442 }
11443 }
11444
11445 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11446 {
11448
11449 if (m_EM)
11450 {
11451 m_EM.SetEnergy(m_EM.GetEnergyMax());
11452 }
11453 }
11454
11455 else if (action_id ==
EActions.ADD_HEALTH)
11456 {
11457 AddHealth("","",GetMaxHealth("","Health")/5);
11458 }
11459 else if (action_id ==
EActions.REMOVE_HEALTH)
11460 {
11461 AddHealth("","",-GetMaxHealth("","Health")/5);
11462 }
11463 else if (action_id ==
EActions.DESTROY_HEALTH)
11464 {
11465 SetHealth01("","",0);
11466 }
11467 else if (action_id ==
EActions.WATCH_ITEM)
11468 {
11470 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11471 #ifdef DEVELOPER
11472 SetDebugDeveloper_item(this);
11473 #endif
11474 }
11475
11476 else if (action_id ==
EActions.ADD_TEMPERATURE)
11477 {
11478 AddTemperature(20);
11479
11480 }
11481
11482 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11483 {
11484 AddTemperature(-20);
11485
11486 }
11487
11488 else if (action_id ==
EActions.FLIP_FROZEN)
11489 {
11490 SetFrozen(!GetIsFrozen());
11491
11492 }
11493
11494 else if (action_id ==
EActions.ADD_WETNESS)
11495 {
11497
11498 }
11499
11500 else if (action_id ==
EActions.REMOVE_WETNESS)
11501 {
11503
11504 }
11505
11506 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11507 {
11510
11511
11512 }
11513
11514 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11515 {
11518 }
11519
11520 else if (action_id ==
EActions.MAKE_SPECIAL)
11521 {
11522 auto debugParams = DebugSpawnParams.WithPlayer(player);
11523 OnDebugSpawnEx(debugParams);
11524 }
11525
11526 }
11527
11528
11529 return false;
11530 }
11531
11532
11533
11534
11538
11541
11542
11543
11545 {
11546 return false;
11547 }
11548
11549
11551 {
11552 return true;
11553 }
11554
11555
11557 {
11558 return true;
11559 }
11560
11561
11562
11564 {
11565 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11567 }
11568
11571 {
11572 return null;
11573 }
11574
11576 {
11577 return false;
11578 }
11579
11581 {
11582 return false;
11583 }
11584
11588
11589
11591 {
11592 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11593 return module_repairing.CanRepair(this, item_repair_kit);
11594 }
11595
11596
11597 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11598 {
11599 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11600 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11601 }
11602
11603
11605 {
11606
11607
11608
11609
11610
11611
11612
11613
11614 return 1;
11615 }
11616
11617
11618
11620 {
11622 }
11623
11624
11625
11627 {
11629 }
11630
11631
11640 {
11641 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11642
11643 if (player)
11644 {
11645 player.MessageStatus(text);
11646 }
11647 }
11648
11649
11658 {
11659 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11660
11661 if (player)
11662 {
11663 player.MessageAction(text);
11664 }
11665 }
11666
11667
11676 {
11677 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11678
11679 if (player)
11680 {
11681 player.MessageFriendly(text);
11682 }
11683 }
11684
11685
11694 {
11695 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11696
11697 if (player)
11698 {
11699 player.MessageImportant(text);
11700 }
11701 }
11702
11704 {
11705 return true;
11706 }
11707
11708
11709 override bool KindOf(
string tag)
11710 {
11711 bool found = false;
11712 string item_name = this.
GetType();
11715
11716 int array_size = item_tag_array.Count();
11717 for (int i = 0; i < array_size; i++)
11718 {
11719 if (item_tag_array.Get(i) == tag)
11720 {
11721 found = true;
11722 break;
11723 }
11724 }
11725 return found;
11726 }
11727
11728
11730 {
11731
11732 super.OnRPC(sender, rpc_type,ctx);
11733
11734
11735 switch (rpc_type)
11736 {
11737 #ifndef SERVER
11738 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11739 Param2<bool, string> p = new Param2<bool, string>(false, "");
11740
11742 return;
11743
11744 bool play = p.param1;
11745 string soundSet = p.param2;
11746
11747 if (play)
11748 {
11750 {
11752 {
11754 }
11755 }
11756 else
11757 {
11759 }
11760 }
11761 else
11762 {
11764 }
11765
11766 break;
11767 #endif
11768
11769 }
11770
11772 {
11774 }
11775 }
11776
11777
11778
11779
11781 {
11782 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11783 return plugin.GetID(
name);
11784 }
11785
11787 {
11788 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11789 return plugin.GetName(id);
11790 }
11791
11794 {
11795
11796
11797 int varFlags;
11798 if (!ctx.
Read(varFlags))
11799 return;
11800
11801 if (varFlags & ItemVariableFlags.FLOAT)
11802 {
11804 }
11805 }
11806
11808 {
11809
11810 super.SerializeNumericalVars(floats_out);
11811
11812
11813
11815 {
11817 }
11818
11820 {
11822 }
11823
11825 {
11827 }
11828
11830 {
11835 }
11836
11838 {
11840 }
11841 }
11842
11844 {
11845
11846 super.DeSerializeNumericalVars(floats);
11847
11848
11849 int index = 0;
11850 int mask = Math.Round(floats.Get(index));
11851
11852 index++;
11853
11855 {
11857 {
11859 }
11860 else
11861 {
11862 float quantity = floats.Get(index);
11863 SetQuantity(quantity,
true,
false,
false,
false);
11864 }
11865 index++;
11866 }
11867
11869 {
11870 float wet = floats.Get(index);
11872 index++;
11873 }
11874
11876 {
11877 int liquidtype = Math.Round(floats.Get(index));
11879 index++;
11880 }
11881
11883 {
11885 index++;
11887 index++;
11889 index++;
11891 index++;
11892 }
11893
11895 {
11896 int cleanness = Math.Round(floats.Get(index));
11898 index++;
11899 }
11900 }
11901
11903 {
11904 super.WriteVarsToCTX(ctx);
11905
11906
11908 {
11910 }
11911
11913 {
11915 }
11916
11918 {
11920 }
11921
11923 {
11924 int r,g,b,a;
11930 }
11931
11933 {
11935 }
11936 }
11937
11939 {
11940 if (!super.ReadVarsFromCTX(ctx,version))
11941 return false;
11942
11943 int intValue;
11944 float value;
11945
11946 if (version < 140)
11947 {
11948 if (!ctx.
Read(intValue))
11949 return false;
11950
11951 m_VariablesMask = intValue;
11952 }
11953
11955 {
11956 if (!ctx.
Read(value))
11957 return false;
11958
11960 {
11962 }
11963 else
11964 {
11966 }
11967 }
11968
11969 if (version < 140)
11970 {
11972 {
11973 if (!ctx.
Read(value))
11974 return false;
11975 SetTemperatureDirect(value);
11976 }
11977 }
11978
11980 {
11981 if (!ctx.
Read(value))
11982 return false;
11984 }
11985
11987 {
11988 if (!ctx.
Read(intValue))
11989 return false;
11991 }
11992
11994 {
11995 int r,g,b,a;
11997 return false;
11999 return false;
12001 return false;
12003 return false;
12004
12006 }
12007
12009 {
12010 if (!ctx.
Read(intValue))
12011 return false;
12013 }
12014
12015 if (version >= 138 && version < 140)
12016 {
12018 {
12019 if (!ctx.
Read(intValue))
12020 return false;
12021 SetFrozen(intValue);
12022 }
12023 }
12024
12025 return true;
12026 }
12027
12028
12030 {
12033 {
12035 }
12036
12037 if (!super.OnStoreLoad(ctx, version))
12038 {
12040 return false;
12041 }
12042
12043 if (version >= 114)
12044 {
12045 bool hasQuickBarIndexSaved;
12046
12047 if (!ctx.
Read(hasQuickBarIndexSaved))
12048 {
12050 return false;
12051 }
12052
12053 if (hasQuickBarIndexSaved)
12054 {
12055 int itmQBIndex;
12056
12057
12058 if (!ctx.
Read(itmQBIndex))
12059 {
12061 return false;
12062 }
12063
12064 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12065 if (itmQBIndex != -1 && parentPlayer)
12066 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12067 }
12068 }
12069 else
12070 {
12071
12072 PlayerBase player;
12073 int itemQBIndex;
12074 if (version ==
int.
MAX)
12075 {
12076 if (!ctx.
Read(itemQBIndex))
12077 {
12079 return false;
12080 }
12081 }
12082 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12083 {
12084
12085 if (!ctx.
Read(itemQBIndex))
12086 {
12088 return false;
12089 }
12090 if (itemQBIndex != -1 && player)
12091 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12092 }
12093 }
12094
12095 if (version < 140)
12096 {
12097
12098 if (!LoadVariables(ctx, version))
12099 {
12101 return false;
12102 }
12103 }
12104
12105
12107 {
12109 return false;
12110 }
12111 if (version >= 132)
12112 {
12114 if (raib)
12115 {
12117 {
12119 return false;
12120 }
12121 }
12122 }
12123
12125 return true;
12126 }
12127
12128
12129
12131 {
12132 super.OnStoreSave(ctx);
12133
12134 PlayerBase player;
12135 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12136 {
12138
12139 int itemQBIndex = -1;
12140 itemQBIndex = player.FindQuickBarEntityIndex(this);
12141 ctx.
Write(itemQBIndex);
12142 }
12143 else
12144 {
12146 }
12147
12149
12151 if (raib)
12152 {
12154 }
12155 }
12156
12157
12159 {
12160 super.AfterStoreLoad();
12161
12163 {
12165 }
12166
12168 {
12171 }
12172 }
12173
12175 {
12176 super.EEOnAfterLoad();
12177
12179 {
12181 }
12182
12185 }
12186
12188 {
12189 return false;
12190 }
12191
12192
12193
12195 {
12197 {
12198 #ifdef PLATFORM_CONSOLE
12199
12201 {
12203 if (menu)
12204 {
12206 }
12207 }
12208 #endif
12209 }
12210
12212 {
12215 }
12216
12218 {
12219 SetWeightDirty();
12221 }
12223 {
12226 }
12227
12229 {
12232 }
12234 {
12237 }
12238
12239 super.OnVariablesSynchronized();
12240 }
12241
12242
12243
12245 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12246 {
12247 if (!IsServerCheck(allow_client))
12248 return false;
12249
12251 return false;
12252
12255
12256 if (value <= (min + 0.001))
12257 value = min;
12258
12259 if (value == min)
12260 {
12261 if (destroy_config)
12262 {
12263 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12264 if (dstr)
12265 {
12267 this.Delete();
12268 return true;
12269 }
12270 }
12271 else if (destroy_forced)
12272 {
12274 this.Delete();
12275 return true;
12276 }
12277
12279 }
12280
12283
12285 {
12287
12288 if (delta)
12290 }
12291
12293
12294 return false;
12295 }
12296
12297
12299 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12300 {
12302 }
12303
12305 {
12308 }
12309
12311 {
12314 }
12315
12317 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12318 {
12319 float value_clamped = Math.Clamp(value, 0, 1);
12321 SetQuantity(result, destroy_config, destroy_forced);
12322 }
12323
12324
12327 {
12329 }
12330
12332 {
12334 }
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12346 {
12347 int slot = -1;
12348 if (GetInventory())
12349 {
12350 InventoryLocation il = new InventoryLocation;
12351 GetInventory().GetCurrentInventoryLocation(il);
12353 }
12354
12356 }
12357
12359 {
12360 float quantity_max = 0;
12361
12363 {
12364 if (attSlotID != -1)
12365 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12366
12367 if (quantity_max <= 0)
12369 }
12370
12371 if (quantity_max <= 0)
12373
12374 return quantity_max;
12375 }
12376
12378 {
12380 }
12381
12383 {
12385 }
12386
12387
12389 {
12391 }
12392
12394 {
12396 }
12397
12399 {
12401 }
12402
12403
12405 {
12406
12407 float weightEx = GetWeightEx();
12408 float special = GetInventoryAndCargoWeight();
12409 return weightEx - special;
12410 }
12411
12412
12414 {
12416 }
12417
12419 {
12421 {
12422 #ifdef DEVELOPER
12423 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12424 {
12425 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12427 }
12428 #endif
12429
12430 return GetQuantity() * GetConfigWeightModified();
12431 }
12432 else if (HasEnergyManager())
12433 {
12434 #ifdef DEVELOPER
12435 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12436 {
12437 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12438 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12439 }
12440 #endif
12441 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12442 }
12443 else
12444 {
12445 #ifdef DEVELOPER
12446 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12447 {
12448 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12449 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12450 }
12451 #endif
12452 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12453 }
12454 }
12455
12458 {
12459 int item_count = 0;
12461
12462 if (GetInventory().GetCargo() != NULL)
12463 {
12464 item_count = GetInventory().GetCargo().GetItemCount();
12465 }
12466
12467 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12468 {
12469 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12470 if (item)
12471 item_count += item.GetNumberOfItems();
12472 }
12473 return item_count;
12474 }
12475
12478 {
12479 float weight = 0;
12480 float wetness = 1;
12481 if (include_wetness)
12484 {
12485 weight = wetness * m_ConfigWeight;
12486 }
12488 {
12489 weight = 1;
12490 }
12491 return weight;
12492 }
12493
12494
12495
12497 {
12498 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12499 {
12500 GameInventory inv = GetInventory();
12501 array<EntityAI> items = new array<EntityAI>;
12503 for (int i = 0; i < items.Count(); i++)
12504 {
12506 if (item)
12507 {
12509 }
12510 }
12511 }
12512 }
12513
12514
12515
12516
12518 {
12519 float energy = 0;
12520 if (HasEnergyManager())
12521 {
12522 energy = GetCompEM().GetEnergy();
12523 }
12524 return energy;
12525 }
12526
12527
12529 {
12530 super.OnEnergyConsumed();
12531
12533 }
12534
12536 {
12537 super.OnEnergyAdded();
12538
12540 }
12541
12542
12544 {
12545 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12546 {
12548 {
12549 float energy_0to1 = GetCompEM().GetEnergy0To1();
12551 }
12552 }
12553 }
12554
12555
12557 {
12558 return ConfigGetFloat("heatIsolation");
12559 }
12560
12562 {
12564 }
12565
12567 {
12568 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12569 if (
GetGame().ConfigIsExisting(paramPath))
12571
12572 return 0.0;
12573 }
12574
12576 {
12577 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12578 if (
GetGame().ConfigIsExisting(paramPath))
12580
12581 return 0.0;
12582 }
12583
12584 override void SetWet(
float value,
bool allow_client =
false)
12585 {
12586 if (!IsServerCheck(allow_client))
12587 return;
12588
12591
12593
12594 m_VarWet = Math.Clamp(value, min, max);
12595
12597 {
12600 }
12601 }
12602
12603 override void AddWet(
float value)
12604 {
12606 }
12607
12609 {
12611 }
12612
12614 {
12616 }
12617
12619 {
12621 }
12622
12624 {
12626 }
12627
12629 {
12631 }
12632
12633 override void OnWetChanged(
float newVal,
float oldVal)
12634 {
12637 if (newLevel != oldLevel)
12638 {
12640 }
12641 }
12642
12644 {
12645 SetWeightDirty();
12646 }
12647
12649 {
12650 return GetWetLevelInternal(
m_VarWet);
12651 }
12652
12653
12654
12656 {
12658 }
12659
12661 {
12663 }
12664
12666 {
12668 }
12669
12671 {
12673 }
12674
12675
12676
12678 {
12679 if (ConfigIsExisting("itemModelLength"))
12680 {
12681 return ConfigGetFloat("itemModelLength");
12682 }
12683 return 0;
12684 }
12685
12687 {
12688 if (ConfigIsExisting("itemAttachOffset"))
12689 {
12690 return ConfigGetFloat("itemAttachOffset");
12691 }
12692 return 0;
12693 }
12694
12695 override void SetCleanness(
int value,
bool allow_client =
false)
12696 {
12697 if (!IsServerCheck(allow_client))
12698 return;
12699
12701
12703
12706 }
12707
12709 {
12711 }
12712
12714 {
12715 return true;
12716 }
12717
12718
12719
12720
12722 {
12724 }
12725
12727 {
12729 }
12730
12731
12732
12733
12734 override void SetColor(
int r,
int g,
int b,
int a)
12735 {
12741 }
12743 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12744 {
12749 }
12750
12752 {
12754 }
12755
12758 {
12759 int r,g,b,a;
12761 r = r/255;
12762 g = g/255;
12763 b = b/255;
12764 a = a/255;
12765 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12766 }
12767
12768
12769
12770 override void SetLiquidType(
int value,
bool allow_client =
false)
12771 {
12772 if (!IsServerCheck(allow_client))
12773 return;
12774
12779 }
12780
12782 {
12783 return ConfigGetInt("varLiquidTypeInit");
12784 }
12785
12787 {
12789 }
12790
12792 {
12794 SetFrozen(false);
12795 }
12796
12799 {
12800 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12801 }
12802
12803
12806 {
12807 PlayerBase nplayer;
12808 if (PlayerBase.CastTo(nplayer, player))
12809 {
12811
12812 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12813 }
12814 }
12815
12816
12819 {
12820 PlayerBase nplayer;
12821 if (PlayerBase.CastTo(nplayer,player))
12822 {
12823
12824 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12825
12826 }
12827
12828
12829 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12830
12831
12832 if (HasEnergyManager())
12833 {
12834 GetCompEM().UpdatePlugState();
12835 }
12836 }
12837
12838
12840 {
12841 super.OnPlacementStarted(player);
12842
12844 }
12845
12846 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12847 {
12849 {
12850 m_AdminLog.OnPlacementComplete(player,
this);
12851 }
12852
12853 super.OnPlacementComplete(player, position, orientation);
12854 }
12855
12856
12857
12858
12859
12861 {
12863 {
12864 return true;
12865 }
12866 else
12867 {
12868 return false;
12869 }
12870 }
12871
12872
12874 {
12876 {
12878 }
12879 }
12880
12881
12883 {
12885 }
12886
12888 {
12890 }
12891
12892 override void InsertAgent(
int agent,
float count = 1)
12893 {
12894 if (count < 1)
12895 return;
12896
12898 }
12899
12902 {
12904 }
12905
12906
12908 {
12910 }
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12954 {
12956 return false;
12957 return true;
12958 }
12959
12961 {
12962
12964 }
12965
12966
12969 {
12970 super.CheckForRoofLimited(timeTresholdMS);
12971
12973 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12974 {
12975 m_PreviousRoofTestTime = time;
12976 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12977 }
12978 }
12979
12980
12982 {
12984 {
12985 return 0;
12986 }
12987
12988 if (GetInventory().GetAttachmentSlotsCount() != 0)
12989 {
12990 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12991 if (filter)
12992 return filter.GetProtectionLevel(type, false, system);
12993 else
12994 return 0;
12995 }
12996
12997 string subclassPath, entryName;
12998
12999 switch (type)
13000 {
13002 entryName = "biological";
13003 break;
13005 entryName = "chemical";
13006 break;
13007 default:
13008 entryName = "biological";
13009 break;
13010 }
13011
13012 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13013
13015 }
13016
13017
13018
13021 {
13022 if (!IsMagazine())
13024
13026 }
13027
13028
13029
13030
13031
13036 {
13037 return true;
13038 }
13039
13041 {
13043 }
13044
13045
13046
13047
13048
13050 {
13051 if (parent)
13052 {
13053 if (parent.IsInherited(DayZInfected))
13054 return true;
13055
13056 if (!parent.IsRuined())
13057 return true;
13058 }
13059
13060 return true;
13061 }
13062
13064 {
13065 if (!super.CanPutAsAttachment(parent))
13066 {
13067 return false;
13068 }
13069
13070 if (!IsRuined() && !parent.IsRuined())
13071 {
13072 return true;
13073 }
13074
13075 return false;
13076 }
13077
13079 {
13080
13081
13082
13083
13084 return super.CanReceiveItemIntoCargo(item);
13085 }
13086
13088 {
13089
13090
13091
13092
13093 GameInventory attachmentInv = attachment.GetInventory();
13095 {
13096 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13097 return false;
13098 }
13099
13100 InventoryLocation loc = new InventoryLocation();
13101 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13102 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13103 return false;
13104
13105 return super.CanReceiveAttachment(attachment, slotId);
13106 }
13107
13109 {
13110 if (!super.CanReleaseAttachment(attachment))
13111 return false;
13112
13113 return GetInventory().AreChildrenAccessible();
13114 }
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13137 {
13138 int id = muzzle_owner.GetMuzzleID();
13139 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13140
13141 if (WPOF_array)
13142 {
13143 for (int i = 0; i < WPOF_array.Count(); i++)
13144 {
13145 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13146
13147 if (WPOF)
13148 {
13149 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13150 }
13151 }
13152 }
13153 }
13154
13155
13157 {
13158 int id = muzzle_owner.GetMuzzleID();
13160
13161 if (WPOBE_array)
13162 {
13163 for (int i = 0; i < WPOBE_array.Count(); i++)
13164 {
13165 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13166
13167 if (WPOBE)
13168 {
13169 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13170 }
13171 }
13172 }
13173 }
13174
13175
13177 {
13178 int id = muzzle_owner.GetMuzzleID();
13179 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13180
13181 if (WPOOH_array)
13182 {
13183 for (int i = 0; i < WPOOH_array.Count(); i++)
13184 {
13185 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13186
13187 if (WPOOH)
13188 {
13189 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13190 }
13191 }
13192 }
13193 }
13194
13195
13197 {
13198 int id = muzzle_owner.GetMuzzleID();
13199 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13200
13201 if (WPOOH_array)
13202 {
13203 for (int i = 0; i < WPOOH_array.Count(); i++)
13204 {
13205 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13206
13207 if (WPOOH)
13208 {
13209 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13210 }
13211 }
13212 }
13213 }
13214
13215
13217 {
13218 int id = muzzle_owner.GetMuzzleID();
13219 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13220
13221 if (WPOOH_array)
13222 {
13223 for (int i = 0; i < WPOOH_array.Count(); i++)
13224 {
13225 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13226
13227 if (WPOOH)
13228 {
13229 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13230 }
13231 }
13232 }
13233 }
13234
13235
13236
13238 {
13240 {
13241 return true;
13242 }
13243
13244 return false;
13245 }
13246
13248 {
13250 {
13251 return true;
13252 }
13253
13254 return false;
13255 }
13256
13258 {
13260 {
13261 return true;
13262 }
13263
13264 return false;
13265 }
13266
13268 {
13269 return false;
13270 }
13271
13274 {
13275 return UATimeSpent.DEFAULT_DEPLOY;
13276 }
13277
13278
13279
13280
13282 {
13284 SetSynchDirty();
13285 }
13286
13288 {
13290 }
13291
13292
13294 {
13295 return false;
13296 }
13297
13300 {
13301 string att_type = "None";
13302
13303 if (ConfigIsExisting("soundAttType"))
13304 {
13305 att_type = ConfigGetString("soundAttType");
13306 }
13307
13309 }
13310
13312 {
13314 }
13315
13316
13317
13318
13319
13325
13327 {
13330
13332 }
13333
13334
13336 {
13338 return;
13339
13341
13344
13347
13348 SoundParameters params = new SoundParameters();
13352 }
13353
13354
13356 {
13358 return;
13359
13361 SetSynchDirty();
13362
13365 }
13366
13367
13369 {
13371 return;
13372
13374 SetSynchDirty();
13375
13378 }
13379
13381 {
13383 }
13384
13386 {
13388 }
13389
13392 {
13393 if (!
GetGame().IsDedicatedServer())
13394 {
13395 if (ConfigIsExisting("attachSoundSet"))
13396 {
13397 string cfg_path = "";
13398 string soundset = "";
13399 string type_name =
GetType();
13400
13403 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13404 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13405
13406 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13407 {
13408 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13409 {
13410 if (cfg_slot_array[i] == slot_type)
13411 {
13412 soundset = cfg_soundset_array[i];
13413 break;
13414 }
13415 }
13416 }
13417
13418 if (soundset != "")
13419 {
13420 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13422 }
13423 }
13424 }
13425 }
13426
13428 {
13429
13430 }
13431
13432 void OnApply(PlayerBase player);
13433
13435 {
13436 return 1.0;
13437 };
13438
13440 {
13442 }
13443
13445 {
13447 }
13448
13450
13452 {
13453 SetDynamicPhysicsLifeTime(0.01);
13455 }
13456
13458 {
13459 array<string> zone_names = new array<string>;
13460 GetDamageZones(zone_names);
13461 for (int i = 0; i < zone_names.Count(); i++)
13462 {
13463 SetHealthMax(zone_names.Get(i),"Health");
13464 }
13465 SetHealthMax("","Health");
13466 }
13467
13470 {
13471 float global_health = GetHealth01("","Health");
13472 array<string> zones = new array<string>;
13473 GetDamageZones(zones);
13474
13475 for (int i = 0; i < zones.Count(); i++)
13476 {
13477 SetHealth01(zones.Get(i),"Health",global_health);
13478 }
13479 }
13480
13483 {
13484 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13485 }
13486
13488 {
13489 if (!hasRootAsPlayer)
13490 {
13491 if (refParentIB)
13492 {
13493
13494 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13495 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13496
13497 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13498 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13499
13502 }
13503 else
13504 {
13505
13508 }
13509 }
13510 }
13511
13513 {
13515 {
13516 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13517 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13518 {
13519 float heatPermCoef = 1.0;
13521 while (ent)
13522 {
13523 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13524 ent = ent.GetHierarchyParent();
13525 }
13526
13527 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13528 }
13529 }
13530 }
13531
13533 {
13534
13535 EntityAI parent = GetHierarchyParent();
13536 if (!parent)
13537 {
13538 hasParent = false;
13539 hasRootAsPlayer = false;
13540 }
13541 else
13542 {
13543 hasParent = true;
13544 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13545 refParentIB =
ItemBase.Cast(parent);
13546 }
13547 }
13548
13549 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13550 {
13551
13552 }
13553
13555 {
13556
13557 return false;
13558 }
13559
13561 {
13562
13563
13564 return false;
13565 }
13566
13568 {
13569
13570 return false;
13571 }
13572
13575 {
13576 return !GetIsFrozen() &&
IsOpen();
13577 }
13578
13580 {
13581 bool hasParent = false, hasRootAsPlayer = false;
13583
13584 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13585 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13586
13587 if (wwtu || foodDecay)
13588 {
13592
13593 if (processWetness || processTemperature || processDecay)
13594 {
13596
13597 if (processWetness)
13598 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13599
13600 if (processTemperature)
13602
13603 if (processDecay)
13604 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13605 }
13606 }
13607 }
13608
13611 {
13613 }
13614
13616 {
13619
13620 return super.GetTemperatureFreezeThreshold();
13621 }
13622
13624 {
13627
13628 return super.GetTemperatureThawThreshold();
13629 }
13630
13632 {
13635
13636 return super.GetItemOverheatThreshold();
13637 }
13638
13640 {
13642 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13643
13644 return super.GetTemperatureFreezeTime();
13645 }
13646
13648 {
13650 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13651
13652 return super.GetTemperatureThawTime();
13653 }
13654
13659
13661 {
13662 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13663 }
13664
13666 {
13667 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13668 }
13669
13672 {
13674 }
13675
13677 {
13679 }
13680
13682 {
13684 }
13685
13688 {
13689 return null;
13690 }
13691
13694 {
13695 return false;
13696 }
13697
13699 {
13701 {
13704 if (!trg)
13705 {
13707 explosive = this;
13708 }
13709
13710 explosive.PairRemote(trg);
13712
13713 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13714 trg.SetPersistentPairID(persistentID);
13715 explosive.SetPersistentPairID(persistentID);
13716
13717 return true;
13718 }
13719 return false;
13720 }
13721
13724 {
13725 float ret = 1.0;
13728 ret *= GetHealth01();
13729
13730 return ret;
13731 }
13732
13733 #ifdef DEVELOPER
13734 override void SetDebugItem()
13735 {
13736 super.SetDebugItem();
13737 _itemBase = this;
13738 }
13739
13741 {
13742 string text = super.GetDebugText();
13743
13745 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13746
13747 return text;
13748 }
13749 #endif
13750
13752 {
13753 return true;
13754 }
13755
13757
13759
13761 {
13764 }
13765
13766
13774
13790}
13791
13793{
13795 if (entity)
13796 {
13797 bool is_item = entity.IsInherited(
ItemBase);
13798 if (is_item && full_quantity)
13799 {
13802 }
13803 }
13804 else
13805 {
13807 return NULL;
13808 }
13809 return entity;
13810}
13811
13813{
13814 if (item)
13815 {
13816 if (health > 0)
13817 item.SetHealth("", "", health);
13818
13819 if (item.CanHaveTemperature())
13820 {
13822 if (item.CanFreeze())
13823 item.SetFrozen(false);
13824 }
13825
13826 if (item.HasEnergyManager())
13827 {
13828 if (quantity >= 0)
13829 {
13830 item.GetCompEM().SetEnergy0To1(quantity);
13831 }
13832 else
13833 {
13835 }
13836 }
13837 else if (item.IsMagazine())
13838 {
13839 Magazine mag = Magazine.Cast(item);
13840 if (quantity >= 0)
13841 {
13842 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13843 }
13844 else
13845 {
13847 }
13848
13849 }
13850 else
13851 {
13852 if (quantity >= 0)
13853 {
13854 item.SetQuantityNormalized(quantity, false);
13855 }
13856 else
13857 {
13859 }
13860
13861 }
13862 }
13863}
13864
13865#ifdef DEVELOPER
13867#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.