9032{
9034 {
9035 return true;
9036 }
9037};
9038
9039
9040
9042{
9046
9048
9051
9052
9053
9054
9055
9064
9070
9075
9080
9101 protected bool m_IsResultOfSplit
9102
9104
9109
9110
9111
9113
9117
9118
9119
9121
9124
9125
9126
9132
9133
9141
9144
9145
9147
9148
9150
9151
9156
9157
9162
9163
9165
9166
9168 {
9173
9174 if (!
GetGame().IsDedicatedServer())
9175 {
9177 {
9179
9181 {
9183 }
9184 }
9185
9188 }
9189
9190 m_OldLocation = null;
9191
9193 {
9195 }
9196
9197 if (ConfigIsExisting("headSelectionsToHide"))
9198 {
9201 }
9202
9204 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9205 {
9207 }
9208
9210
9211 m_IsResultOfSplit = false;
9212
9214 }
9215
9217 {
9218 super.InitItemVariables();
9219
9225 m_Count = ConfigGetInt(
"count");
9226
9229
9234
9237
9242
9254
9258
9259
9262 if (ConfigIsExisting("canBeSplit"))
9263 {
9266 }
9267
9269 if (ConfigIsExisting("itemBehaviour"))
9271
9272
9275 RegisterNetSyncVariableInt("m_VarLiquidType");
9276 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9277
9278 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9279 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9280 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9281
9282 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9283 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9284 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9285 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9286
9287 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9288 RegisterNetSyncVariableBool("m_IsTakeable");
9289 RegisterNetSyncVariableBool("m_IsHologram");
9290
9293 {
9296 }
9297
9299
9301 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9303
9304 }
9305
9307 {
9309 }
9310
9312 {
9315 {
9320 }
9321 }
9322
9323 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9324 {
9326 {
9329 }
9330
9332 }
9333
9335 {
9341 }
9342
9344
9346 {
9348
9349 if (!action)
9350 {
9351 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9352 return;
9353 }
9354
9356 if (!ai)
9357 {
9359 return;
9360 }
9361
9363 if (!action_array)
9364 {
9365 action_array = new array<ActionBase_Basic>;
9367 }
9368 if (LogManager.IsActionLogEnable())
9369 {
9370 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9371 }
9372
9373 if (action_array.Find(action) != -1)
9374 {
9375 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9376 }
9377 else
9378 {
9379 action_array.Insert(action);
9380 }
9381 }
9382
9384 {
9386 ActionBase action = player.GetActionManager().GetAction(actionName);
9389
9390 if (action_array)
9391 {
9392 action_array.RemoveItem(action);
9393 }
9394 }
9395
9396
9397
9399 {
9400 ActionOverrideData overrideData = new ActionOverrideData();
9404
9406 if (!actionMap)
9407 {
9410 }
9411
9412 actionMap.Insert(this.
Type(), overrideData);
9413
9414 }
9415
9417
9419
9420
9422 {
9425
9428
9429 string config_to_search = "CfgVehicles";
9430 string muzzle_owner_config;
9431
9433 {
9434 if (IsInherited(Weapon))
9435 config_to_search = "CfgWeapons";
9436
9437 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9438
9439 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9440
9442
9443 if (config_OnFire_subclass_count > 0)
9444 {
9445 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9446
9447 for (int i = 0; i < config_OnFire_subclass_count; i++)
9448 {
9449 string particle_class = "";
9451 string config_OnFire_entry = config_OnFire_class + particle_class;
9452 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9453 WPOF_array.Insert(WPOF);
9454 }
9455
9456
9458 }
9459 }
9460
9462 {
9463 config_to_search = "CfgWeapons";
9464 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9465
9466 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9467
9469
9470 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9471 {
9472 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9473
9474 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9475 {
9476 string particle_class2 = "";
9478 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9479 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9480 WPOBE_array.Insert(WPOBE);
9481 }
9482
9483
9485 }
9486 }
9487 }
9488
9489
9491 {
9494
9496 {
9497 string config_to_search = "CfgVehicles";
9498
9499 if (IsInherited(Weapon))
9500 config_to_search = "CfgWeapons";
9501
9502 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9503 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9504
9505 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9506 {
9507
9509
9511 {
9513 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9515 return;
9516 }
9517
9520
9521
9522
9524 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9525
9526 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9527 {
9528 string particle_class = "";
9530 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9532
9533 if (entry_type == CT_CLASS)
9534 {
9535 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9536 WPOOH_array.Insert(WPOF);
9537 }
9538 }
9539
9540
9542 }
9543 }
9544 }
9545
9547 {
9549 }
9550
9552 {
9554 {
9556
9559
9562
9563 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9564 }
9565 }
9566
9568 {
9570 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9571
9573 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9574
9576 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9577
9579 {
9581 }
9582 }
9583
9585 {
9587 }
9588
9590 {
9593 else
9595
9597 {
9600 }
9601 else
9602 {
9605
9608 }
9609
9611 }
9612
9614 {
9616 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9617 }
9618
9620 {
9622 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9624 }
9625
9627 {
9629 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9630 }
9631
9633 {
9636
9637 OverheatingParticle OP = new OverheatingParticle();
9642
9644 }
9645
9647 {
9650
9651 return -1;
9652 }
9653
9655 {
9657 {
9660
9661 for (int i = count; i > 0; --i)
9662 {
9663 int id = i - 1;
9666
9669
9670 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9671 {
9672 if (p)
9673 {
9676 }
9677 }
9678 }
9679 }
9680 }
9681
9683 {
9685 {
9687 {
9688 int id = i - 1;
9690
9691 if (OP)
9692 {
9694
9695 if (p)
9696 {
9698 }
9699
9700 delete OP;
9701 }
9702 }
9703
9706 }
9707 }
9708
9711 {
9712 return 0.0;
9713 }
9714
9715
9717 {
9718 return 250;
9719 }
9720
9722 {
9723 return 0;
9724 }
9725
9728 {
9730 return true;
9731
9732 return false;
9733 }
9734
9737 {
9740
9742 {
9744 }
9745 else
9746 {
9747
9749 }
9750
9752 }
9753
9760 {
9761 return -1;
9762 }
9763
9764
9765
9766
9768 {
9770 {
9772 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9773
9774 if (r_index >= 0)
9775 {
9776 InventoryLocation r_il = new InventoryLocation;
9777 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9778
9779 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9782 {
9783 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9784 }
9786 {
9787 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9788 }
9789
9790 }
9791
9792 player.GetHumanInventory().ClearUserReservedLocation(this);
9793 }
9794
9797 }
9798
9799
9800
9801
9803 {
9804 return ItemBase.m_DebugActionsMask;
9805 }
9806
9808 {
9809 return ItemBase.m_DebugActionsMask & mask;
9810 }
9811
9813 {
9814 ItemBase.m_DebugActionsMask = mask;
9815 }
9816
9818 {
9819 ItemBase.m_DebugActionsMask |= mask;
9820 }
9821
9823 {
9824 ItemBase.m_DebugActionsMask &= ~mask;
9825 }
9826
9828 {
9830 {
9832 }
9833 else
9834 {
9836 }
9837 }
9838
9839
9841 {
9842 if (GetEconomyProfile())
9843 {
9844 float q_max = GetEconomyProfile().GetQuantityMax();
9845 if (q_max > 0)
9846 {
9847 float q_min = GetEconomyProfile().GetQuantityMin();
9848 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9849
9851 {
9852 ComponentEnergyManager comp = GetCompEM();
9854 {
9856 }
9857 }
9859 {
9861
9862 }
9863
9864 }
9865 }
9866 }
9867
9870 {
9871 EntityAI parent = GetHierarchyParent();
9872
9873 if (parent)
9874 {
9875 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9876 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9877 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9878 }
9879 }
9880
9883 {
9884 EntityAI parent = GetHierarchyParent();
9885
9886 if (parent)
9887 {
9888 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9889 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9890 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9891 }
9892 }
9893
9895 {
9896
9897
9898
9899
9901
9903 {
9904 if (ScriptInputUserData.CanStoreInputUserData())
9905 {
9906 ScriptInputUserData ctx = new ScriptInputUserData;
9912 ctx.
Write(use_stack_max);
9915
9917 {
9918 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9919 }
9920 }
9921 }
9922 else if (!
GetGame().IsMultiplayer())
9923 {
9925 }
9926 }
9927
9929 {
9931 }
9932
9934 {
9936 }
9937
9939 {
9941 }
9942
9944 {
9945
9946 return false;
9947 }
9948
9950 {
9951 return false;
9952 }
9953
9957 {
9958 return false;
9959 }
9960
9962 {
9963 return "";
9964 }
9965
9967
9969 {
9970 return false;
9971 }
9972
9974 {
9975 return true;
9976 }
9977
9978
9979
9981 {
9982 return true;
9983 }
9984
9986 {
9987 return true;
9988 }
9989
9991 {
9992 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9994 }
9995
9997 {
9999 }
10000
10002 {
10004 if (!is_being_placed)
10006 SetSynchDirty();
10007 }
10008
10009
10011
10013 {
10015 }
10016
10018 {
10020 }
10021
10023 {
10024 return 1;
10025 }
10026
10028 {
10029 return false;
10030 }
10031
10033 {
10035 SetSynchDirty();
10036 }
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10073 {
10074 super.OnMovedInsideCargo(container);
10075
10076 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10077 }
10078
10079 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10080 {
10081 super.EEItemLocationChanged(oldLoc,newLoc);
10082
10083 PlayerBase new_player = null;
10084 PlayerBase old_player = null;
10085
10086 if (newLoc.GetParent())
10087 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10088
10089 if (oldLoc.GetParent())
10090 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10091
10093 {
10094 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10095
10096 if (r_index >= 0)
10097 {
10098 InventoryLocation r_il = new InventoryLocation;
10099 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10100
10101 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10104 {
10105 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10106 }
10108 {
10109 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10110 }
10111
10112 }
10113 }
10114
10116 {
10117 if (new_player)
10118 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10119
10120 if (new_player == old_player)
10121 {
10122
10123 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10124 {
10126 {
10127 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10128 {
10129 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10130 }
10131 }
10132 else
10133 {
10134 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10135 }
10136 }
10137
10138 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10139 {
10140 int type = oldLoc.GetType();
10142 {
10143 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10144 }
10146 {
10147 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10148 }
10149 }
10150 if (!m_OldLocation)
10151 {
10152 m_OldLocation = new InventoryLocation;
10153 }
10154 m_OldLocation.Copy(oldLoc);
10155 }
10156 else
10157 {
10158 if (m_OldLocation)
10159 {
10160 m_OldLocation.Reset();
10161 }
10162 }
10163
10165 }
10166 else
10167 {
10168 if (new_player)
10169 {
10170 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10171 if (res_index >= 0)
10172 {
10173 InventoryLocation il = new InventoryLocation;
10174 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10176 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10179 {
10180 il.
GetParent().GetOnReleaseLock().Invoke(it);
10181 }
10183 {
10185 }
10186
10187 }
10188 }
10190 {
10191
10193 }
10194
10195 if (m_OldLocation)
10196 {
10197 m_OldLocation.Reset();
10198 }
10199 }
10200 }
10201
10202 override void EOnContact(IEntity other, Contact extra)
10203 {
10205 {
10206 int liquidType = -1;
10208 if (impactSpeed > 0.0)
10209 {
10211 #ifndef SERVER
10213 #else
10215 SetSynchDirty();
10216 #endif
10218 }
10219 }
10220
10221 #ifdef SERVER
10222 if (GetCompEM() && GetCompEM().IsPlugged())
10223 {
10224 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10225 GetCompEM().UnplugThis();
10226 }
10227 #endif
10228 }
10229
10231
10233 {
10235 }
10236
10238 {
10239
10240 }
10241
10243 {
10244 super.OnItemLocationChanged(old_owner, new_owner);
10245
10246 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10247 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10248
10249 if (!relatedPlayer && playerNew)
10250 relatedPlayer = playerNew;
10251
10252 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10253 {
10255 if (actionMgr)
10256 {
10257 ActionBase currentAction = actionMgr.GetRunningAction();
10258 if (currentAction)
10260 }
10261 }
10262
10263 Man ownerPlayerOld = null;
10264 Man ownerPlayerNew = null;
10265
10266 if (old_owner)
10267 {
10268 if (old_owner.
IsMan())
10269 {
10270 ownerPlayerOld = Man.Cast(old_owner);
10271 }
10272 else
10273 {
10274 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10275 }
10276 }
10277 else
10278 {
10280 {
10282
10283 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10284 {
10285 GetCompEM().UnplugThis();
10286 }
10287 }
10288 }
10289
10290 if (new_owner)
10291 {
10292 if (new_owner.
IsMan())
10293 {
10294 ownerPlayerNew = Man.Cast(new_owner);
10295 }
10296 else
10297 {
10298 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10299 }
10300 }
10301
10302 if (ownerPlayerOld != ownerPlayerNew)
10303 {
10304 if (ownerPlayerOld)
10305 {
10306 array<EntityAI> subItemsExit = new array<EntityAI>;
10308 for (int i = 0; i < subItemsExit.Count(); i++)
10309 {
10312 }
10313 }
10314
10315 if (ownerPlayerNew)
10316 {
10317 array<EntityAI> subItemsEnter = new array<EntityAI>;
10319 for (int j = 0; j < subItemsEnter.Count(); j++)
10320 {
10323 }
10324 }
10325 }
10326 else if (ownerPlayerNew != null)
10327 {
10328 PlayerBase nplayer;
10329 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10330 {
10331 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10333 for (int k = 0; k < subItemsUpdate.Count(); k++)
10334 {
10336 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10337 }
10338 }
10339 }
10340
10341 if (old_owner)
10342 old_owner.OnChildItemRemoved(this);
10343 if (new_owner)
10344 new_owner.OnChildItemReceived(this);
10345 }
10346
10347
10349 {
10350 super.EEDelete(parent);
10351 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10352 if (player)
10353 {
10355
10356 if (player.IsAlive())
10357 {
10358 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10359 if (r_index >= 0)
10360 {
10361 InventoryLocation r_il = new InventoryLocation;
10362 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10363
10364 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10367 {
10368 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10369 }
10371 {
10372 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10373 }
10374
10375 }
10376
10377 player.RemoveQuickBarEntityShortcut(this);
10378 }
10379 }
10380 }
10381
10383 {
10384 super.EEKilled(killer);
10385
10388 {
10389 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10390 {
10391 if (IsMagazine())
10392 {
10393 if (Magazine.Cast(this).GetAmmoCount() > 0)
10394 {
10396 }
10397 }
10398 else
10399 {
10401 }
10402 }
10403 }
10404 }
10405
10407 {
10408 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10409
10410 super.OnWasAttached(parent, slot_id);
10411
10414
10416 }
10417
10419 {
10420 super.OnWasDetached(parent, slot_id);
10421
10424 }
10425
10427 {
10428 int idx;
10431
10432 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10433 if (inventory_slots.Count() < 1)
10434 {
10435 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10436 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10437 }
10438 else
10439 {
10440 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10441 }
10442
10443 idx = inventory_slots.Find(slot);
10444 if (idx < 0)
10445 return "";
10446
10447 return attach_types.Get(idx);
10448 }
10449
10451 {
10452 int idx = -1;
10453 string slot;
10454
10457
10458 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10459 if (inventory_slots.Count() < 1)
10460 {
10461 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10462 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10463 }
10464 else
10465 {
10466 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10467 if (detach_types.Count() < 1)
10468 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10469 }
10470
10471 for (int i = 0; i < inventory_slots.Count(); i++)
10472 {
10473 slot = inventory_slots.Get(i);
10474 }
10475
10476 if (slot != "")
10477 {
10478 if (detach_types.Count() == 1)
10479 idx = 0;
10480 else
10481 idx = inventory_slots.Find(slot);
10482 }
10483 if (idx < 0)
10484 return "";
10485
10486 return detach_types.Get(idx);
10487 }
10488
10490 {
10491
10493
10494
10495 float min_time = 1;
10496 float max_time = 3;
10497 float delay = Math.RandomFloat(min_time, max_time);
10498
10499 explode_timer.Run(delay, this, "DoAmmoExplosion");
10500 }
10501
10503 {
10504 Magazine magazine = Magazine.Cast(this);
10505 int pop_sounds_count = 6;
10506 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10507
10508
10509 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10510 string sound_name = pop_sounds[ sound_idx ];
10512
10513
10514 magazine.ServerAddAmmoCount(-1);
10515
10516
10517 float min_temp_to_explode = 100;
10518
10519 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10520 {
10522 }
10523 }
10524
10525
10526 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10527 {
10528 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10529
10530 const int CHANCE_DAMAGE_CARGO = 4;
10531 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10532 const int CHANCE_DAMAGE_NOTHING = 2;
10533
10535 {
10536 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10537 int chances;
10538 int rnd;
10539
10540 if (GetInventory().GetCargo())
10541 {
10542 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10543 rnd = Math.RandomInt(0,chances);
10544
10545 if (rnd < CHANCE_DAMAGE_CARGO)
10546 {
10548 }
10549 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10550 {
10552 }
10553 }
10554 else
10555 {
10556 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10557 rnd = Math.RandomInt(0,chances);
10558
10559 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10560 {
10562 }
10563 }
10564 }
10565 }
10566
10568 {
10569 if (GetInventory().GetCargo())
10570 {
10571 int item_count = GetInventory().GetCargo().GetItemCount();
10572 if (item_count > 0)
10573 {
10574 int random_pick = Math.RandomInt(0, item_count);
10576 if (!item.IsExplosive())
10577 {
10578 item.AddHealth("","",damage);
10579 return true;
10580 }
10581 }
10582 }
10583 return false;
10584 }
10585
10587 {
10588 int attachment_count = GetInventory().AttachmentCount();
10589 if (attachment_count > 0)
10590 {
10591 int random_pick = Math.RandomInt(0, attachment_count);
10592 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10593 if (!attachment.IsExplosive())
10594 {
10595 attachment.AddHealth("","",damage);
10596 return true;
10597 }
10598 }
10599 return false;
10600 }
10601
10603 {
10605 }
10606
10608 {
10610 return GetInventory().CanRemoveEntity();
10611
10612 return false;
10613 }
10614
10616 {
10618 return;
10619
10621 {
10622 if (ScriptInputUserData.CanStoreInputUserData())
10623 {
10624 ScriptInputUserData ctx = new ScriptInputUserData;
10629 ctx.
Write(destination_entity);
10631 ctx.
Write(slot_id);
10633 }
10634 }
10635 else if (!
GetGame().IsMultiplayer())
10636 {
10638 }
10639 }
10640
10642 {
10644 return;
10645
10646 float split_quantity_new;
10650 InventoryLocation loc = new InventoryLocation;
10651
10652 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10653 {
10655 split_quantity_new = stack_max;
10656 else
10658
10659 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10660 if (new_item)
10661 {
10662 new_item.SetResultOfSplit(true);
10663 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10665 new_item.SetQuantity(split_quantity_new);
10666 }
10667 }
10668 else if (destination_entity && slot_id == -1)
10669 {
10670 if (quantity > stack_max)
10671 split_quantity_new = stack_max;
10672 else
10673 split_quantity_new = quantity;
10674
10676 {
10679 }
10680
10681 if (new_item)
10682 {
10683 new_item.SetResultOfSplit(true);
10684 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10686 new_item.SetQuantity(split_quantity_new);
10687 }
10688 }
10689 else
10690 {
10691 if (stack_max != 0)
10692 {
10694 {
10696 }
10697
10698 if (split_quantity_new == 0)
10699 {
10700 if (!
GetGame().IsMultiplayer())
10701 player.PhysicalPredictiveDropItem(this);
10702 else
10703 player.ServerDropEntity(this);
10704 return;
10705 }
10706
10708
10709 if (new_item)
10710 {
10711 new_item.SetResultOfSplit(true);
10712 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10714 new_item.SetQuantity(stack_max);
10715 new_item.PlaceOnSurface();
10716 }
10717 }
10718 }
10719 }
10720
10722 {
10724 return;
10725
10726 float split_quantity_new;
10730 InventoryLocation loc = new InventoryLocation;
10731
10732 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10733 {
10735 split_quantity_new = stack_max;
10736 else
10738
10739 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10740 if (new_item)
10741 {
10742 new_item.SetResultOfSplit(true);
10743 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10745 new_item.SetQuantity(split_quantity_new);
10746 }
10747 }
10748 else if (destination_entity && slot_id == -1)
10749 {
10750 if (quantity > stack_max)
10751 split_quantity_new = stack_max;
10752 else
10753 split_quantity_new = quantity;
10754
10756 {
10759 }
10760
10761 if (new_item)
10762 {
10763 new_item.SetResultOfSplit(true);
10764 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10766 new_item.SetQuantity(split_quantity_new);
10767 }
10768 }
10769 else
10770 {
10771 if (stack_max != 0)
10772 {
10774 {
10776 }
10777
10779
10780 if (new_item)
10781 {
10782 new_item.SetResultOfSplit(true);
10783 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10785 new_item.SetQuantity(stack_max);
10786 new_item.PlaceOnSurface();
10787 }
10788 }
10789 }
10790 }
10791
10793 {
10795 return;
10796
10798 {
10799 if (ScriptInputUserData.CanStoreInputUserData())
10800 {
10801 ScriptInputUserData ctx = new ScriptInputUserData;
10806 dst.WriteToContext(ctx);
10808 }
10809 }
10810 else if (!
GetGame().IsMultiplayer())
10811 {
10813 }
10814 }
10815
10817 {
10819 return;
10820
10822 {
10823 if (ScriptInputUserData.CanStoreInputUserData())
10824 {
10825 ScriptInputUserData ctx = new ScriptInputUserData;
10830 ctx.
Write(destination_entity);
10836 }
10837 }
10838 else if (!
GetGame().IsMultiplayer())
10839 {
10841 }
10842 }
10843
10845 {
10847 }
10848
10850 {
10852 return this;
10853
10855 float split_quantity_new;
10857 if (dst.IsValid())
10858 {
10859 int slot_id = dst.GetSlot();
10861
10862 if (quantity > stack_max)
10863 split_quantity_new = stack_max;
10864 else
10865 split_quantity_new = quantity;
10866
10868
10869 if (new_item)
10870 {
10871 new_item.SetResultOfSplit(true);
10872 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10875 }
10876
10877 return new_item;
10878 }
10879
10880 return null;
10881 }
10882
10884 {
10886 return;
10887
10889 float split_quantity_new;
10891 if (destination_entity)
10892 {
10894 if (quantity > stackable)
10895 split_quantity_new = stackable;
10896 else
10897 split_quantity_new = quantity;
10898
10899 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10900 if (new_item)
10901 {
10902 new_item.SetResultOfSplit(true);
10903 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10905 new_item.SetQuantity(split_quantity_new);
10906 }
10907 }
10908 }
10909
10911 {
10913 return;
10914
10916 {
10917 if (ScriptInputUserData.CanStoreInputUserData())
10918 {
10919 ScriptInputUserData ctx = new ScriptInputUserData;
10924 ItemBase destination_entity =
this;
10925 ctx.
Write(destination_entity);
10929 }
10930 }
10931 else if (!
GetGame().IsMultiplayer())
10932 {
10934 }
10935 }
10936
10938 {
10940 return;
10941
10943 float split_quantity_new;
10945 if (player)
10946 {
10948 if (quantity > stackable)
10949 split_quantity_new = stackable;
10950 else
10951 split_quantity_new = quantity;
10952
10953 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10954 new_item =
ItemBase.Cast(in_hands);
10955 if (new_item)
10956 {
10957 new_item.SetResultOfSplit(true);
10958 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10960 new_item.SetQuantity(split_quantity_new);
10961 }
10962 }
10963 }
10964
10966 {
10968 return;
10969
10971 float split_quantity_new = Math.Floor(quantity * 0.5);
10972
10974
10975 if (new_item)
10976 {
10977 if (new_item.GetQuantityMax() < split_quantity_new)
10978 {
10979 split_quantity_new = new_item.GetQuantityMax();
10980 }
10981
10982 new_item.SetResultOfSplit(true);
10983 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10984
10986 {
10989 }
10990 else
10991 {
10994 }
10995 }
10996 }
10997
10999 {
11001 return;
11002
11004 float split_quantity_new = Math.Floor(quantity / 2);
11005
11006 InventoryLocation invloc = new InventoryLocation;
11008
11010 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11011
11012 if (new_item)
11013 {
11014 if (new_item.GetQuantityMax() < split_quantity_new)
11015 {
11016 split_quantity_new = new_item.GetQuantityMax();
11017 }
11019 {
11022 }
11023 else
11024 {
11027 }
11028 }
11029 }
11030
11033 {
11034 SetWeightDirty();
11036
11037 if (parent)
11038 parent.OnAttachmentQuantityChangedEx(this, delta);
11039
11041 {
11043 {
11045 }
11047 {
11048 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11050 }
11051 }
11052
11053 }
11054
11057 {
11058
11059 }
11060
11063 {
11065 }
11066
11068 {
11069 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11070
11072 {
11073 if (newLevel == GameConstants.STATE_RUINED)
11074 {
11076 EntityAI parent = GetHierarchyParent();
11077 if (parent && parent.IsFireplace())
11078 {
11079 CargoBase cargo = GetInventory().GetCargo();
11080 if (cargo)
11081 {
11083 {
11085 }
11086 }
11087 }
11088 }
11089
11091 {
11092
11094 return;
11095 }
11096
11097 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11098 {
11100 }
11101 }
11102 }
11103
11104
11106 {
11107 super.OnRightClick();
11108
11110 {
11112 {
11113 if (ScriptInputUserData.CanStoreInputUserData())
11114 {
11115 vector m4[4];
11117
11118 EntityAI root = GetHierarchyRoot();
11119
11120 InventoryLocation dst = new InventoryLocation;
11122 {
11123 if (root)
11124 {
11125 root.GetTransform(m4);
11127 }
11128 else
11129 GetInventory().GetCurrentInventoryLocation(dst);
11130 }
11131 else
11132 {
11134
11135
11136 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11137 {
11138 if (root)
11139 {
11140 root.GetTransform(m4);
11142 }
11143 else
11144 GetInventory().GetCurrentInventoryLocation(dst);
11145 }
11146 else
11147 {
11148 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11149 }
11150 }
11151
11152 ScriptInputUserData ctx = new ScriptInputUserData;
11160 }
11161 }
11162 else if (!
GetGame().IsMultiplayer())
11163 {
11165 }
11166 }
11167 }
11168
11169 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11170 {
11171
11172 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11173 return false;
11174
11175 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11176 return false;
11177
11178
11180 return false;
11181
11182
11183 Magazine mag = Magazine.Cast(this);
11184 if (mag)
11185 {
11186 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11187 return false;
11188
11189 if (stack_max_limit)
11190 {
11191 Magazine other_mag = Magazine.Cast(other_item);
11192 if (other_item)
11193 {
11194 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11195 return false;
11196 }
11197
11198 }
11199 }
11200 else
11201 {
11202
11204 return false;
11205
11207 return false;
11208 }
11209
11210 PlayerBase player = null;
11211 if (CastTo(player, GetHierarchyRootPlayer()))
11212 {
11213 if (player.GetInventory().HasAttachment(this))
11214 return false;
11215
11216 if (player.IsItemsToDelete())
11217 return false;
11218 }
11219
11220 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11221 return false;
11222
11223 int slotID;
11225 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11226 return false;
11227
11228 return true;
11229 }
11230
11232 {
11234 }
11235
11237 {
11238 return m_IsResultOfSplit;
11239 }
11240
11242 {
11243 m_IsResultOfSplit = value;
11244 }
11245
11247 {
11249 }
11250
11252 {
11253 float other_item_quantity = other_item.GetQuantity();
11254 float this_free_space;
11255
11257
11259
11260 if (other_item_quantity > this_free_space)
11261 {
11262 return this_free_space;
11263 }
11264 else
11265 {
11266 return other_item_quantity;
11267 }
11268 }
11269
11271 {
11273 }
11274
11276 {
11278 return;
11279
11280 if (!IsMagazine() && other_item)
11281 {
11283 if (quantity_used != 0)
11284 {
11285 float hp1 = GetHealth01("","");
11286 float hp2 = other_item.GetHealth01("","");
11287 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11288 hpResult = hpResult / (
GetQuantity() + quantity_used);
11289
11290 hpResult *= GetMaxHealth();
11291 Math.Round(hpResult);
11292 SetHealth("", "Health", hpResult);
11293
11295 other_item.AddQuantity(-quantity_used);
11296 }
11297 }
11299 }
11300
11302 {
11303 #ifdef SERVER
11304 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11305 GetHierarchyParent().IncreaseLifetimeUp();
11306 #endif
11307 };
11308
11310 {
11311 PlayerBase p = PlayerBase.Cast(player);
11312
11313 array<int> recipesIds = p.m_Recipes;
11314 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11315 if (moduleRecipesManager)
11316 {
11317 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11318 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11319 }
11320
11321 for (int i = 0;i < recipesIds.Count(); i++)
11322 {
11323 int key = recipesIds.Get(i);
11324 string recipeName = moduleRecipesManager.GetRecipeName(key);
11326 }
11327 }
11328
11329
11330 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11331 {
11332 super.GetDebugActions(outputList);
11333
11334
11339
11340
11344
11348
11349
11352
11353
11355 {
11358 }
11359
11361
11364
11368 }
11369
11370
11371
11372
11374 {
11375 super.OnAction(action_id, player, ctx);
11376 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11377 {
11378 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11379 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11380 PlayerBase p = PlayerBase.Cast(player);
11381 if (
EActions.RECIPES_RANGE_START < 1000)
11382 {
11383 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11384 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11385 }
11386 }
11387 #ifndef SERVER
11388 else if (action_id ==
EActions.WATCH_PLAYER)
11389 {
11390 PluginDeveloper.SetDeveloperItemClientEx(player);
11391 }
11392 #endif
11394 {
11395 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11396 {
11397 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11398 OnDebugButtonPressServer(id + 1);
11399 }
11400
11401 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11402 {
11403 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11405 }
11406
11407 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11408 {
11409 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11411 }
11412
11413 else if (action_id ==
EActions.ADD_QUANTITY)
11414 {
11415 if (IsMagazine())
11416 {
11417 Magazine mag = Magazine.Cast(this);
11418 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11419 }
11420 else
11421 {
11423 }
11424
11425 if (m_EM)
11426 {
11427 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11428 }
11429
11430 }
11431
11432 else if (action_id ==
EActions.REMOVE_QUANTITY)
11433 {
11434 if (IsMagazine())
11435 {
11436 Magazine mag2 = Magazine.Cast(this);
11437 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11438 }
11439 else
11440 {
11442 }
11443 if (m_EM)
11444 {
11445 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11446 }
11447
11448 }
11449
11450 else if (action_id ==
EActions.SET_QUANTITY_0)
11451 {
11453
11454 if (m_EM)
11455 {
11456 m_EM.SetEnergy(0);
11457 }
11458 }
11459
11460 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11461 {
11463
11464 if (m_EM)
11465 {
11466 m_EM.SetEnergy(m_EM.GetEnergyMax());
11467 }
11468 }
11469
11470 else if (action_id ==
EActions.ADD_HEALTH)
11471 {
11472 AddHealth("","",GetMaxHealth("","Health")/5);
11473 }
11474 else if (action_id ==
EActions.REMOVE_HEALTH)
11475 {
11476 AddHealth("","",-GetMaxHealth("","Health")/5);
11477 }
11478 else if (action_id ==
EActions.DESTROY_HEALTH)
11479 {
11480 SetHealth01("","",0);
11481 }
11482 else if (action_id ==
EActions.WATCH_ITEM)
11483 {
11485 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11486 #ifdef DEVELOPER
11487 SetDebugDeveloper_item(this);
11488 #endif
11489 }
11490
11491 else if (action_id ==
EActions.ADD_TEMPERATURE)
11492 {
11493 AddTemperature(20);
11494
11495 }
11496
11497 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11498 {
11499 AddTemperature(-20);
11500
11501 }
11502
11503 else if (action_id ==
EActions.FLIP_FROZEN)
11504 {
11505 SetFrozen(!GetIsFrozen());
11506
11507 }
11508
11509 else if (action_id ==
EActions.ADD_WETNESS)
11510 {
11512
11513 }
11514
11515 else if (action_id ==
EActions.REMOVE_WETNESS)
11516 {
11518
11519 }
11520
11521 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11522 {
11525
11526
11527 }
11528
11529 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11530 {
11533 }
11534
11535 else if (action_id ==
EActions.MAKE_SPECIAL)
11536 {
11537 auto debugParams = DebugSpawnParams.WithPlayer(player);
11538 OnDebugSpawnEx(debugParams);
11539 }
11540
11541 else if (action_id ==
EActions.DELETE)
11542 {
11543 Delete();
11544 }
11545
11546 }
11547
11548
11549 return false;
11550 }
11551
11552
11553
11554
11558
11561
11562
11563
11565 {
11566 return false;
11567 }
11568
11569
11571 {
11572 return true;
11573 }
11574
11575
11577 {
11578 return true;
11579 }
11580
11581
11582
11584 {
11585 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11587 }
11588
11591 {
11592 return null;
11593 }
11594
11596 {
11597 return false;
11598 }
11599
11601 {
11602 return false;
11603 }
11604
11608
11609
11611 {
11612 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11613 return module_repairing.CanRepair(this, item_repair_kit);
11614 }
11615
11616
11617 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11618 {
11619 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11620 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11621 }
11622
11623
11625 {
11626
11627
11628
11629
11630
11631
11632
11633
11634 return 1;
11635 }
11636
11637
11638
11640 {
11642 }
11643
11644
11645
11647 {
11649 }
11650
11651
11660 {
11661 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11662
11663 if (player)
11664 {
11665 player.MessageStatus(text);
11666 }
11667 }
11668
11669
11678 {
11679 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11680
11681 if (player)
11682 {
11683 player.MessageAction(text);
11684 }
11685 }
11686
11687
11696 {
11697 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11698
11699 if (player)
11700 {
11701 player.MessageFriendly(text);
11702 }
11703 }
11704
11705
11714 {
11715 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11716
11717 if (player)
11718 {
11719 player.MessageImportant(text);
11720 }
11721 }
11722
11724 {
11725 return true;
11726 }
11727
11728
11729 override bool KindOf(
string tag)
11730 {
11731 bool found = false;
11732 string item_name = this.
GetType();
11735
11736 int array_size = item_tag_array.Count();
11737 for (int i = 0; i < array_size; i++)
11738 {
11739 if (item_tag_array.Get(i) == tag)
11740 {
11741 found = true;
11742 break;
11743 }
11744 }
11745 return found;
11746 }
11747
11748
11750 {
11751
11752 super.OnRPC(sender, rpc_type,ctx);
11753
11754
11755 switch (rpc_type)
11756 {
11757 #ifndef SERVER
11758 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11759 Param2<bool, string> p = new Param2<bool, string>(false, "");
11760
11762 return;
11763
11764 bool play = p.param1;
11765 string soundSet = p.param2;
11766
11767 if (play)
11768 {
11770 {
11772 {
11774 }
11775 }
11776 else
11777 {
11779 }
11780 }
11781 else
11782 {
11784 }
11785
11786 break;
11787 #endif
11788
11789 }
11790
11792 {
11794 }
11795 }
11796
11797
11798
11799
11801 {
11802 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11803 return plugin.GetID(
name);
11804 }
11805
11807 {
11808 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11809 return plugin.GetName(id);
11810 }
11811
11814 {
11815
11816
11817 int varFlags;
11818 if (!ctx.
Read(varFlags))
11819 return;
11820
11821 if (varFlags & ItemVariableFlags.FLOAT)
11822 {
11824 }
11825 }
11826
11828 {
11829
11830 super.SerializeNumericalVars(floats_out);
11831
11832
11833
11835 {
11837 }
11838
11840 {
11842 }
11843
11845 {
11847 }
11848
11850 {
11855 }
11856
11858 {
11860 }
11861 }
11862
11864 {
11865
11866 super.DeSerializeNumericalVars(floats);
11867
11868
11869 int index = 0;
11870 int mask = Math.Round(floats.Get(index));
11871
11872 index++;
11873
11875 {
11877 {
11879 }
11880 else
11881 {
11882 float quantity = floats.Get(index);
11883 SetQuantity(quantity,
true,
false,
false,
false);
11884 }
11885 index++;
11886 }
11887
11889 {
11890 float wet = floats.Get(index);
11892 index++;
11893 }
11894
11896 {
11897 int liquidtype = Math.Round(floats.Get(index));
11899 index++;
11900 }
11901
11903 {
11905 index++;
11907 index++;
11909 index++;
11911 index++;
11912 }
11913
11915 {
11916 int cleanness = Math.Round(floats.Get(index));
11918 index++;
11919 }
11920 }
11921
11923 {
11924 super.WriteVarsToCTX(ctx);
11925
11926
11928 {
11930 }
11931
11933 {
11935 }
11936
11938 {
11940 }
11941
11943 {
11944 int r,g,b,a;
11950 }
11951
11953 {
11955 }
11956 }
11957
11959 {
11960 if (!super.ReadVarsFromCTX(ctx,version))
11961 return false;
11962
11963 int intValue;
11964 float value;
11965
11966 if (version < 140)
11967 {
11968 if (!ctx.
Read(intValue))
11969 return false;
11970
11971 m_VariablesMask = intValue;
11972 }
11973
11975 {
11976 if (!ctx.
Read(value))
11977 return false;
11978
11980 {
11982 }
11983 else
11984 {
11986 }
11987 }
11988
11989 if (version < 140)
11990 {
11992 {
11993 if (!ctx.
Read(value))
11994 return false;
11995 SetTemperatureDirect(value);
11996 }
11997 }
11998
12000 {
12001 if (!ctx.
Read(value))
12002 return false;
12004 }
12005
12007 {
12008 if (!ctx.
Read(intValue))
12009 return false;
12011 }
12012
12014 {
12015 int r,g,b,a;
12017 return false;
12019 return false;
12021 return false;
12023 return false;
12024
12026 }
12027
12029 {
12030 if (!ctx.
Read(intValue))
12031 return false;
12033 }
12034
12035 if (version >= 138 && version < 140)
12036 {
12038 {
12039 if (!ctx.
Read(intValue))
12040 return false;
12041 SetFrozen(intValue);
12042 }
12043 }
12044
12045 return true;
12046 }
12047
12048
12050 {
12053 {
12055 }
12056
12057 if (!super.OnStoreLoad(ctx, version))
12058 {
12060 return false;
12061 }
12062
12063 if (version >= 114)
12064 {
12065 bool hasQuickBarIndexSaved;
12066
12067 if (!ctx.
Read(hasQuickBarIndexSaved))
12068 {
12070 return false;
12071 }
12072
12073 if (hasQuickBarIndexSaved)
12074 {
12075 int itmQBIndex;
12076
12077
12078 if (!ctx.
Read(itmQBIndex))
12079 {
12081 return false;
12082 }
12083
12084 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12085 if (itmQBIndex != -1 && parentPlayer)
12086 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12087 }
12088 }
12089 else
12090 {
12091
12092 PlayerBase player;
12093 int itemQBIndex;
12094 if (version ==
int.
MAX)
12095 {
12096 if (!ctx.
Read(itemQBIndex))
12097 {
12099 return false;
12100 }
12101 }
12102 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12103 {
12104
12105 if (!ctx.
Read(itemQBIndex))
12106 {
12108 return false;
12109 }
12110 if (itemQBIndex != -1 && player)
12111 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12112 }
12113 }
12114
12115 if (version < 140)
12116 {
12117
12118 if (!LoadVariables(ctx, version))
12119 {
12121 return false;
12122 }
12123 }
12124
12125
12127 {
12129 return false;
12130 }
12131 if (version >= 132)
12132 {
12134 if (raib)
12135 {
12137 {
12139 return false;
12140 }
12141 }
12142 }
12143
12145 return true;
12146 }
12147
12148
12149
12151 {
12152 super.OnStoreSave(ctx);
12153
12154 PlayerBase player;
12155 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12156 {
12158
12159 int itemQBIndex = -1;
12160 itemQBIndex = player.FindQuickBarEntityIndex(this);
12161 ctx.
Write(itemQBIndex);
12162 }
12163 else
12164 {
12166 }
12167
12169
12171 if (raib)
12172 {
12174 }
12175 }
12176
12177
12179 {
12180 super.AfterStoreLoad();
12181
12183 {
12185 }
12186
12188 {
12191 }
12192 }
12193
12195 {
12196 super.EEOnAfterLoad();
12197
12199 {
12201 }
12202
12205 }
12206
12208 {
12209 return false;
12210 }
12211
12212
12213
12215 {
12217 {
12218 #ifdef PLATFORM_CONSOLE
12219
12221 {
12223 if (menu)
12224 {
12226 }
12227 }
12228 #endif
12229 }
12230
12232 {
12235 }
12236
12238 {
12239 SetWeightDirty();
12241 }
12243 {
12246 }
12247
12249 {
12252 }
12254 {
12257 }
12258
12259 super.OnVariablesSynchronized();
12260 }
12261
12262
12263
12265 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12266 {
12267 if (!IsServerCheck(allow_client))
12268 return false;
12269
12271 return false;
12272
12275
12276 if (value <= (min + 0.001))
12277 value = min;
12278
12279 if (value == min)
12280 {
12281 if (destroy_config)
12282 {
12283 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12284 if (dstr)
12285 {
12287 this.Delete();
12288 return true;
12289 }
12290 }
12291 else if (destroy_forced)
12292 {
12294 this.Delete();
12295 return true;
12296 }
12297
12299 }
12300
12303
12305 {
12307
12308 if (delta)
12310 }
12311
12313
12314 return false;
12315 }
12316
12317
12319 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12320 {
12322 }
12323
12325 {
12328 }
12329
12331 {
12334 }
12335
12338 {
12339 float value_clamped = Math.Clamp(value, 0, 1);
12341 SetQuantity(result, destroy_config, destroy_forced);
12342 }
12343
12344
12347 {
12349 }
12350
12352 {
12354 }
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12366 {
12367 int slot = -1;
12368 if (GetInventory())
12369 {
12370 InventoryLocation il = new InventoryLocation;
12371 GetInventory().GetCurrentInventoryLocation(il);
12373 }
12374
12376 }
12377
12379 {
12380 float quantity_max = 0;
12381
12383 {
12384 if (attSlotID != -1)
12385 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12386
12387 if (quantity_max <= 0)
12389 }
12390
12391 if (quantity_max <= 0)
12393
12394 return quantity_max;
12395 }
12396
12398 {
12400 }
12401
12403 {
12405 }
12406
12407
12409 {
12411 }
12412
12414 {
12416 }
12417
12419 {
12421 }
12422
12423
12425 {
12426
12427 float weightEx = GetWeightEx();
12428 float special = GetInventoryAndCargoWeight();
12429 return weightEx - special;
12430 }
12431
12432
12434 {
12436 }
12437
12439 {
12441 {
12442 #ifdef DEVELOPER
12443 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12444 {
12445 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12447 }
12448 #endif
12449
12450 return GetQuantity() * GetConfigWeightModified();
12451 }
12452 else if (HasEnergyManager())
12453 {
12454 #ifdef DEVELOPER
12455 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12456 {
12457 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12458 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12459 }
12460 #endif
12461 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12462 }
12463 else
12464 {
12465 #ifdef DEVELOPER
12466 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12467 {
12468 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12469 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12470 }
12471 #endif
12472 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12473 }
12474 }
12475
12478 {
12479 int item_count = 0;
12481
12482 if (GetInventory().GetCargo() != NULL)
12483 {
12484 item_count = GetInventory().GetCargo().GetItemCount();
12485 }
12486
12487 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12488 {
12489 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12490 if (item)
12491 item_count += item.GetNumberOfItems();
12492 }
12493 return item_count;
12494 }
12495
12498 {
12499 float weight = 0;
12500 float wetness = 1;
12501 if (include_wetness)
12504 {
12505 weight = wetness * m_ConfigWeight;
12506 }
12508 {
12509 weight = 1;
12510 }
12511 return weight;
12512 }
12513
12514
12515
12517 {
12518 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12519 {
12520 GameInventory inv = GetInventory();
12521 array<EntityAI> items = new array<EntityAI>;
12523 for (int i = 0; i < items.Count(); i++)
12524 {
12526 if (item)
12527 {
12529 }
12530 }
12531 }
12532 }
12533
12534
12535
12536
12538 {
12539 float energy = 0;
12540 if (HasEnergyManager())
12541 {
12542 energy = GetCompEM().GetEnergy();
12543 }
12544 return energy;
12545 }
12546
12547
12549 {
12550 super.OnEnergyConsumed();
12551
12553 }
12554
12556 {
12557 super.OnEnergyAdded();
12558
12560 }
12561
12562
12564 {
12565 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12566 {
12568 {
12569 float energy_0to1 = GetCompEM().GetEnergy0To1();
12571 }
12572 }
12573 }
12574
12575
12577 {
12578 return ConfigGetFloat("heatIsolation");
12579 }
12580
12582 {
12584 }
12585
12587 {
12588 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12589 if (
GetGame().ConfigIsExisting(paramPath))
12591
12592 return 0.0;
12593 }
12594
12596 {
12597 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12598 if (
GetGame().ConfigIsExisting(paramPath))
12600
12601 return 0.0;
12602 }
12603
12604 override void SetWet(
float value,
bool allow_client =
false)
12605 {
12606 if (!IsServerCheck(allow_client))
12607 return;
12608
12611
12613
12614 m_VarWet = Math.Clamp(value, min, max);
12615
12617 {
12620 }
12621 }
12622
12623 override void AddWet(
float value)
12624 {
12626 }
12627
12629 {
12631 }
12632
12634 {
12636 }
12637
12639 {
12641 }
12642
12644 {
12646 }
12647
12649 {
12651 }
12652
12653 override void OnWetChanged(
float newVal,
float oldVal)
12654 {
12657 if (newLevel != oldLevel)
12658 {
12660 }
12661 }
12662
12664 {
12665 SetWeightDirty();
12666 }
12667
12669 {
12670 return GetWetLevelInternal(
m_VarWet);
12671 }
12672
12673
12674
12676 {
12678 }
12679
12681 {
12683 }
12684
12686 {
12688 }
12689
12691 {
12693 }
12694
12695
12696
12698 {
12699 if (ConfigIsExisting("itemModelLength"))
12700 {
12701 return ConfigGetFloat("itemModelLength");
12702 }
12703 return 0;
12704 }
12705
12707 {
12708 if (ConfigIsExisting("itemAttachOffset"))
12709 {
12710 return ConfigGetFloat("itemAttachOffset");
12711 }
12712 return 0;
12713 }
12714
12715 override void SetCleanness(
int value,
bool allow_client =
false)
12716 {
12717 if (!IsServerCheck(allow_client))
12718 return;
12719
12721
12723
12726 }
12727
12729 {
12731 }
12732
12734 {
12735 return true;
12736 }
12737
12738
12739
12740
12742 {
12744 }
12745
12747 {
12749 }
12750
12751
12752
12753
12754 override void SetColor(
int r,
int g,
int b,
int a)
12755 {
12761 }
12763 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12764 {
12769 }
12770
12772 {
12774 }
12775
12778 {
12779 int r,g,b,a;
12781 r = r/255;
12782 g = g/255;
12783 b = b/255;
12784 a = a/255;
12785 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12786 }
12787
12788
12789
12790 override void SetLiquidType(
int value,
bool allow_client =
false)
12791 {
12792 if (!IsServerCheck(allow_client))
12793 return;
12794
12799 }
12800
12802 {
12803 return ConfigGetInt("varLiquidTypeInit");
12804 }
12805
12807 {
12809 }
12810
12812 {
12814 SetFrozen(false);
12815 }
12816
12819 {
12820 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12821 }
12822
12823
12826 {
12827 PlayerBase nplayer;
12828 if (PlayerBase.CastTo(nplayer, player))
12829 {
12831
12832 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12833 }
12834 }
12835
12836
12839 {
12840 PlayerBase nplayer;
12841 if (PlayerBase.CastTo(nplayer,player))
12842 {
12843
12844 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12845
12846 }
12847
12848
12849 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12850
12851
12852 if (HasEnergyManager())
12853 {
12854 GetCompEM().UpdatePlugState();
12855 }
12856 }
12857
12858
12860 {
12861 super.OnPlacementStarted(player);
12862
12864 }
12865
12866 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12867 {
12869 {
12870 m_AdminLog.OnPlacementComplete(player,
this);
12871 }
12872
12873 super.OnPlacementComplete(player, position, orientation);
12874 }
12875
12876
12877
12878
12879
12881 {
12883 {
12884 return true;
12885 }
12886 else
12887 {
12888 return false;
12889 }
12890 }
12891
12892
12894 {
12896 {
12898 }
12899 }
12900
12901
12903 {
12905 }
12906
12908 {
12910 }
12911
12912 override void InsertAgent(
int agent,
float count = 1)
12913 {
12914 if (count < 1)
12915 return;
12916
12918 }
12919
12922 {
12924 }
12925
12926
12928 {
12930 }
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12974 {
12976 return false;
12977 return true;
12978 }
12979
12981 {
12982
12984 }
12985
12986
12989 {
12990 super.CheckForRoofLimited(timeTresholdMS);
12991
12993 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12994 {
12995 m_PreviousRoofTestTime = time;
12996 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12997 }
12998 }
12999
13000
13002 {
13004 {
13005 return 0;
13006 }
13007
13008 if (GetInventory().GetAttachmentSlotsCount() != 0)
13009 {
13010 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13011 if (filter)
13012 return filter.GetProtectionLevel(type, false, system);
13013 else
13014 return 0;
13015 }
13016
13017 string subclassPath, entryName;
13018
13019 switch (type)
13020 {
13022 entryName = "biological";
13023 break;
13025 entryName = "chemical";
13026 break;
13027 default:
13028 entryName = "biological";
13029 break;
13030 }
13031
13032 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13033
13035 }
13036
13037
13038
13041 {
13042 if (!IsMagazine())
13044
13046 }
13047
13048
13049
13050
13051
13056 {
13057 return true;
13058 }
13059
13061 {
13063 }
13064
13065
13066
13067
13068
13070 {
13071 if (parent)
13072 {
13073 if (parent.IsInherited(DayZInfected))
13074 return true;
13075
13076 if (!parent.IsRuined())
13077 return true;
13078 }
13079
13080 return true;
13081 }
13082
13084 {
13085 if (!super.CanPutAsAttachment(parent))
13086 {
13087 return false;
13088 }
13089
13090 if (!IsRuined() && !parent.IsRuined())
13091 {
13092 return true;
13093 }
13094
13095 return false;
13096 }
13097
13099 {
13100
13101
13102
13103
13104 return super.CanReceiveItemIntoCargo(item);
13105 }
13106
13108 {
13109
13110
13111
13112
13113 GameInventory attachmentInv = attachment.GetInventory();
13115 {
13116 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13117 return false;
13118 }
13119
13120 InventoryLocation loc = new InventoryLocation();
13121 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13122 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13123 return false;
13124
13125 return super.CanReceiveAttachment(attachment, slotId);
13126 }
13127
13129 {
13130 if (!super.CanReleaseAttachment(attachment))
13131 return false;
13132
13133 return GetInventory().AreChildrenAccessible();
13134 }
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13157 {
13158 int id = muzzle_owner.GetMuzzleID();
13159 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13160
13161 if (WPOF_array)
13162 {
13163 for (int i = 0; i < WPOF_array.Count(); i++)
13164 {
13165 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13166
13167 if (WPOF)
13168 {
13169 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13170 }
13171 }
13172 }
13173 }
13174
13175
13177 {
13178 int id = muzzle_owner.GetMuzzleID();
13180
13181 if (WPOBE_array)
13182 {
13183 for (int i = 0; i < WPOBE_array.Count(); i++)
13184 {
13185 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13186
13187 if (WPOBE)
13188 {
13189 WPOBE.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.OnActivate(weapon, 0, 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.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13230 }
13231 }
13232 }
13233 }
13234
13235
13237 {
13238 int id = muzzle_owner.GetMuzzleID();
13239 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13240
13241 if (WPOOH_array)
13242 {
13243 for (int i = 0; i < WPOOH_array.Count(); i++)
13244 {
13245 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13246
13247 if (WPOOH)
13248 {
13249 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13250 }
13251 }
13252 }
13253 }
13254
13255
13256
13258 {
13260 {
13261 return true;
13262 }
13263
13264 return false;
13265 }
13266
13268 {
13270 {
13271 return true;
13272 }
13273
13274 return false;
13275 }
13276
13278 {
13280 {
13281 return true;
13282 }
13283
13284 return false;
13285 }
13286
13288 {
13289 return false;
13290 }
13291
13294 {
13295 return UATimeSpent.DEFAULT_DEPLOY;
13296 }
13297
13298
13299
13300
13302 {
13304 SetSynchDirty();
13305 }
13306
13308 {
13310 }
13311
13312
13314 {
13315 return false;
13316 }
13317
13320 {
13321 string att_type = "None";
13322
13323 if (ConfigIsExisting("soundAttType"))
13324 {
13325 att_type = ConfigGetString("soundAttType");
13326 }
13327
13329 }
13330
13332 {
13334 }
13335
13336
13337
13338
13339
13343
13345 {
13348
13350 }
13351
13352
13354 {
13356 return;
13357
13359
13362
13365
13366 SoundParameters params = new SoundParameters();
13370 }
13371
13372
13374 {
13376 return;
13377
13379 SetSynchDirty();
13380
13383 }
13384
13385
13387 {
13389 return;
13390
13392 SetSynchDirty();
13393
13396 }
13397
13399 {
13401 }
13402
13404 {
13406 }
13407
13410 {
13411 if (!
GetGame().IsDedicatedServer())
13412 {
13413 if (ConfigIsExisting("attachSoundSet"))
13414 {
13415 string cfg_path = "";
13416 string soundset = "";
13417 string type_name =
GetType();
13418
13421 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13422 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13423
13424 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13425 {
13426 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13427 {
13428 if (cfg_slot_array[i] == slot_type)
13429 {
13430 soundset = cfg_soundset_array[i];
13431 break;
13432 }
13433 }
13434 }
13435
13436 if (soundset != "")
13437 {
13438 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13440 }
13441 }
13442 }
13443 }
13444
13446 {
13447
13448 }
13449
13450 void OnApply(PlayerBase player);
13451
13453 {
13454 return 1.0;
13455 };
13456
13458 {
13460 }
13461
13463 {
13465 }
13466
13468
13470 {
13471 SetDynamicPhysicsLifeTime(0.01);
13473 }
13474
13476 {
13477 array<string> zone_names = new array<string>;
13478 GetDamageZones(zone_names);
13479 for (int i = 0; i < zone_names.Count(); i++)
13480 {
13481 SetHealthMax(zone_names.Get(i),"Health");
13482 }
13483 SetHealthMax("","Health");
13484 }
13485
13488 {
13489 float global_health = GetHealth01("","Health");
13490 array<string> zones = new array<string>;
13491 GetDamageZones(zones);
13492
13493 for (int i = 0; i < zones.Count(); i++)
13494 {
13495 SetHealth01(zones.Get(i),"Health",global_health);
13496 }
13497 }
13498
13501 {
13502 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13503 }
13504
13506 {
13507 if (!hasRootAsPlayer)
13508 {
13509 if (refParentIB)
13510 {
13511
13512 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13513 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13514
13515 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13516 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13517
13520 }
13521 else
13522 {
13523
13526 }
13527 }
13528 }
13529
13531 {
13533 {
13534 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13535 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13536 {
13537 float heatPermCoef = 1.0;
13539 while (ent)
13540 {
13541 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13542 ent = ent.GetHierarchyParent();
13543 }
13544
13545 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13546 }
13547 }
13548 }
13549
13551 {
13552
13553 EntityAI parent = GetHierarchyParent();
13554 if (!parent)
13555 {
13556 hasParent = false;
13557 hasRootAsPlayer = false;
13558 }
13559 else
13560 {
13561 hasParent = true;
13562 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13563 refParentIB =
ItemBase.Cast(parent);
13564 }
13565 }
13566
13567 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13568 {
13569
13570 }
13571
13573 {
13574
13575 return false;
13576 }
13577
13579 {
13580
13581
13582 return false;
13583 }
13584
13586 {
13587
13588 return false;
13589 }
13590
13593 {
13594 return !GetIsFrozen() &&
IsOpen();
13595 }
13596
13598 {
13599 bool hasParent = false, hasRootAsPlayer = false;
13601
13602 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13603 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13604
13605 if (wwtu || foodDecay)
13606 {
13610
13611 if (processWetness || processTemperature || processDecay)
13612 {
13614
13615 if (processWetness)
13616 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13617
13618 if (processTemperature)
13620
13621 if (processDecay)
13622 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13623 }
13624 }
13625 }
13626
13629 {
13631 }
13632
13634 {
13637
13638 return super.GetTemperatureFreezeThreshold();
13639 }
13640
13642 {
13645
13646 return super.GetTemperatureThawThreshold();
13647 }
13648
13650 {
13653
13654 return super.GetItemOverheatThreshold();
13655 }
13656
13658 {
13660 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13661
13662 return super.GetTemperatureFreezeTime();
13663 }
13664
13666 {
13668 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13669
13670 return super.GetTemperatureThawTime();
13671 }
13672
13677
13679 {
13680 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13681 }
13682
13684 {
13685 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13686 }
13687
13690 {
13692 }
13693
13695 {
13697 }
13698
13700 {
13702 }
13703
13706 {
13707 return null;
13708 }
13709
13712 {
13713 return false;
13714 }
13715
13717 {
13719 {
13722 if (!trg)
13723 {
13725 explosive = this;
13726 }
13727
13728 explosive.PairRemote(trg);
13730
13731 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13732 trg.SetPersistentPairID(persistentID);
13733 explosive.SetPersistentPairID(persistentID);
13734
13735 return true;
13736 }
13737 return false;
13738 }
13739
13742 {
13743 float ret = 1.0;
13746 ret *= GetHealth01();
13747
13748 return ret;
13749 }
13750
13751 #ifdef DEVELOPER
13752 override void SetDebugItem()
13753 {
13754 super.SetDebugItem();
13755 _itemBase = this;
13756 }
13757
13759 {
13760 string text = super.GetDebugText();
13761
13763 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13764
13765 return text;
13766 }
13767 #endif
13768
13770 {
13771 return true;
13772 }
13773
13775
13777
13779 {
13782 }
13783
13784
13792
13808}
13809
13811{
13813 if (entity)
13814 {
13815 bool is_item = entity.IsInherited(
ItemBase);
13816 if (is_item && full_quantity)
13817 {
13820 }
13821 }
13822 else
13823 {
13825 return NULL;
13826 }
13827 return entity;
13828}
13829
13831{
13832 if (item)
13833 {
13834 if (health > 0)
13835 item.SetHealth("", "", health);
13836
13837 if (item.CanHaveTemperature())
13838 {
13840 if (item.CanFreeze())
13841 item.SetFrozen(false);
13842 }
13843
13844 if (item.HasEnergyManager())
13845 {
13846 if (quantity >= 0)
13847 {
13848 item.GetCompEM().SetEnergy0To1(quantity);
13849 }
13850 else
13851 {
13853 }
13854 }
13855 else if (item.IsMagazine())
13856 {
13857 Magazine mag = Magazine.Cast(item);
13858 if (quantity >= 0)
13859 {
13860 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13861 }
13862 else
13863 {
13865 }
13866
13867 }
13868 else
13869 {
13870 if (quantity >= 0)
13871 {
13872 item.SetQuantityNormalized(quantity, false);
13873 }
13874 else
13875 {
13877 }
13878
13879 }
13880 }
13881}
13882
13883#ifdef DEVELOPER
13885#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.