9214{
9216 {
9217 return true;
9218 }
9219};
9220
9221
9222
9224{
9228
9230
9233
9234
9235
9236
9237
9246
9252
9257
9262
9283 protected bool m_IsResultOfSplit
9284
9286
9291
9292
9293
9295
9299
9300
9301
9303
9306
9307
9308
9314
9315
9323
9326
9327
9329
9330
9332
9333
9338
9339
9344
9345
9347
9348
9350 {
9355
9356 if (!
GetGame().IsDedicatedServer())
9357 {
9359 {
9361
9363 {
9365 }
9366 }
9367
9370 }
9371
9372 m_OldLocation = null;
9373
9375 {
9377 }
9378
9379 if (ConfigIsExisting("headSelectionsToHide"))
9380 {
9383 }
9384
9386 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9387 {
9389 }
9390
9392
9393 m_IsResultOfSplit = false;
9394
9396 }
9397
9399 {
9400 super.InitItemVariables();
9401
9407 m_Count = ConfigGetInt(
"count");
9408
9411
9416
9419
9424
9436
9440
9441
9444 if (ConfigIsExisting("canBeSplit"))
9445 {
9448 }
9449
9451 if (ConfigIsExisting("itemBehaviour"))
9453
9454
9457 RegisterNetSyncVariableInt("m_VarLiquidType");
9458 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9459
9460 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9461 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9462 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9463
9464 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9465 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9466 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9467 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9468
9469 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9470 RegisterNetSyncVariableBool("m_IsTakeable");
9471 RegisterNetSyncVariableBool("m_IsHologram");
9472
9475 {
9478 }
9479
9481
9483 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9485
9486 }
9487
9489 {
9491 }
9492
9494 {
9497 {
9502 }
9503 }
9504
9505 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9506 {
9508 {
9511 }
9512
9514 }
9515
9517 {
9523 }
9524
9526
9528 {
9530
9531 if (!action)
9532 {
9533 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9534 return;
9535 }
9536
9538 if (!ai)
9539 {
9541 return;
9542 }
9543
9545 if (!action_array)
9546 {
9547 action_array = new array<ActionBase_Basic>;
9549 }
9550 if (LogManager.IsActionLogEnable())
9551 {
9552 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9553 }
9554
9555 if (action_array.Find(action) != -1)
9556 {
9557 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9558 }
9559 else
9560 {
9561 action_array.Insert(action);
9562 }
9563 }
9564
9566 {
9568 ActionBase action = player.GetActionManager().GetAction(actionName);
9571
9572 if (action_array)
9573 {
9574 action_array.RemoveItem(action);
9575 }
9576 }
9577
9578
9579
9581 {
9582 ActionOverrideData overrideData = new ActionOverrideData();
9586
9588 if (!actionMap)
9589 {
9592 }
9593
9594 actionMap.Insert(this.
Type(), overrideData);
9595
9596 }
9597
9599
9601
9602
9604 {
9607
9610
9611 string config_to_search = "CfgVehicles";
9612 string muzzle_owner_config;
9613
9615 {
9616 if (IsInherited(Weapon))
9617 config_to_search = "CfgWeapons";
9618
9619 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9620
9621 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9622
9624
9625 if (config_OnFire_subclass_count > 0)
9626 {
9627 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9628
9629 for (int i = 0; i < config_OnFire_subclass_count; i++)
9630 {
9631 string particle_class = "";
9633 string config_OnFire_entry = config_OnFire_class + particle_class;
9634 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9635 WPOF_array.Insert(WPOF);
9636 }
9637
9638
9640 }
9641 }
9642
9644 {
9645 config_to_search = "CfgWeapons";
9646 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9647
9648 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9649
9651
9652 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9653 {
9654 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9655
9656 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9657 {
9658 string particle_class2 = "";
9660 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9661 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9662 WPOBE_array.Insert(WPOBE);
9663 }
9664
9665
9667 }
9668 }
9669 }
9670
9671
9673 {
9676
9678 {
9679 string config_to_search = "CfgVehicles";
9680
9681 if (IsInherited(Weapon))
9682 config_to_search = "CfgWeapons";
9683
9684 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9685 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9686
9687 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9688 {
9689
9691
9693 {
9695 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9697 return;
9698 }
9699
9702
9703
9704
9706 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9707
9708 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9709 {
9710 string particle_class = "";
9712 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9714
9715 if (entry_type == CT_CLASS)
9716 {
9717 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9718 WPOOH_array.Insert(WPOF);
9719 }
9720 }
9721
9722
9724 }
9725 }
9726 }
9727
9729 {
9731 }
9732
9734 {
9736 {
9738
9741
9744
9745 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9746 }
9747 }
9748
9750 {
9752 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9753
9755 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9756
9758 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9759
9761 {
9763 }
9764 }
9765
9767 {
9769 }
9770
9772 {
9775 else
9777
9779 {
9782 }
9783 else
9784 {
9787
9790 }
9791
9793 }
9794
9796 {
9798 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9799 }
9800
9802 {
9804 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9806 }
9807
9809 {
9811 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9812 }
9813
9815 {
9818
9819 OverheatingParticle OP = new OverheatingParticle();
9824
9826 }
9827
9829 {
9832
9833 return -1;
9834 }
9835
9837 {
9839 {
9842
9843 for (int i = count; i > 0; --i)
9844 {
9845 int id = i - 1;
9848
9851
9852 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9853 {
9854 if (p)
9855 {
9858 }
9859 }
9860 }
9861 }
9862 }
9863
9865 {
9867 {
9869 {
9870 int id = i - 1;
9872
9873 if (OP)
9874 {
9876
9877 if (p)
9878 {
9880 }
9881
9882 delete OP;
9883 }
9884 }
9885
9888 }
9889 }
9890
9893 {
9894 return 0.0;
9895 }
9896
9897
9899 {
9900 return 250;
9901 }
9902
9904 {
9905 return 0;
9906 }
9907
9910 {
9912 return true;
9913
9914 return false;
9915 }
9916
9919 {
9922
9924 {
9926 }
9927 else
9928 {
9929
9931 }
9932
9934 }
9935
9942 {
9943 return -1;
9944 }
9945
9946
9947
9948
9950 {
9952 {
9954 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9955
9956 if (r_index >= 0)
9957 {
9958 InventoryLocation r_il = new InventoryLocation;
9959 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9960
9961 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9964 {
9965 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9966 }
9968 {
9969 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9970 }
9971
9972 }
9973
9974 player.GetHumanInventory().ClearUserReservedLocation(this);
9975 }
9976
9979 }
9980
9981
9982
9983
9985 {
9986 return ItemBase.m_DebugActionsMask;
9987 }
9988
9990 {
9991 return ItemBase.m_DebugActionsMask & mask;
9992 }
9993
9995 {
9996 ItemBase.m_DebugActionsMask = mask;
9997 }
9998
10000 {
10001 ItemBase.m_DebugActionsMask |= mask;
10002 }
10003
10005 {
10006 ItemBase.m_DebugActionsMask &= ~mask;
10007 }
10008
10010 {
10012 {
10014 }
10015 else
10016 {
10018 }
10019 }
10020
10021
10023 {
10024 if (GetEconomyProfile())
10025 {
10026 float q_max = GetEconomyProfile().GetQuantityMax();
10027 if (q_max > 0)
10028 {
10029 float q_min = GetEconomyProfile().GetQuantityMin();
10030 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10031
10033 {
10034 ComponentEnergyManager comp = GetCompEM();
10036 {
10038 }
10039 }
10041 {
10043
10044 }
10045
10046 }
10047 }
10048 }
10049
10052 {
10053 EntityAI parent = GetHierarchyParent();
10054
10055 if (parent)
10056 {
10057 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10058 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10059 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10060 }
10061 }
10062
10065 {
10066 EntityAI parent = GetHierarchyParent();
10067
10068 if (parent)
10069 {
10070 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10071 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10072 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10073 }
10074 }
10075
10077 {
10078
10079
10080
10081
10083
10085 {
10086 if (ScriptInputUserData.CanStoreInputUserData())
10087 {
10088 ScriptInputUserData ctx = new ScriptInputUserData;
10094 ctx.
Write(use_stack_max);
10097
10099 {
10100 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10101 }
10102 }
10103 }
10104 else if (!
GetGame().IsMultiplayer())
10105 {
10107 }
10108 }
10109
10111 {
10113 }
10114
10116 {
10118 }
10119
10121 {
10123 }
10124
10126 {
10127
10128 return false;
10129 }
10130
10132 {
10133 return false;
10134 }
10135
10139 {
10140 return false;
10141 }
10142
10144 {
10145 return "";
10146 }
10147
10149
10151 {
10152 return false;
10153 }
10154
10156 {
10157 return true;
10158 }
10159
10160
10161
10163 {
10164 return true;
10165 }
10166
10168 {
10169 return true;
10170 }
10171
10173 {
10174 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10176 }
10177
10179 {
10181 }
10182
10184 {
10186 if (!is_being_placed)
10188 SetSynchDirty();
10189 }
10190
10191
10193
10195 {
10197 }
10198
10200 {
10202 }
10203
10205 {
10206 return 1;
10207 }
10208
10210 {
10211 return false;
10212 }
10213
10215 {
10217 SetSynchDirty();
10218 }
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10255 {
10256 super.OnMovedInsideCargo(container);
10257
10258 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10259 }
10260
10261 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10262 {
10263 super.EEItemLocationChanged(oldLoc,newLoc);
10264
10265 PlayerBase new_player = null;
10266 PlayerBase old_player = null;
10267
10268 if (newLoc.GetParent())
10269 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10270
10271 if (oldLoc.GetParent())
10272 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10273
10275 {
10276 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10277
10278 if (r_index >= 0)
10279 {
10280 InventoryLocation r_il = new InventoryLocation;
10281 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10282
10283 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10286 {
10287 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10288 }
10290 {
10291 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10292 }
10293
10294 }
10295 }
10296
10298 {
10299 if (new_player)
10300 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10301
10302 if (new_player == old_player)
10303 {
10304
10305 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10306 {
10308 {
10309 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10310 {
10311 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10312 }
10313 }
10314 else
10315 {
10316 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10317 }
10318 }
10319
10320 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10321 {
10322 int type = oldLoc.GetType();
10324 {
10325 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10326 }
10328 {
10329 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10330 }
10331 }
10332 if (!m_OldLocation)
10333 {
10334 m_OldLocation = new InventoryLocation;
10335 }
10336 m_OldLocation.Copy(oldLoc);
10337 }
10338 else
10339 {
10340 if (m_OldLocation)
10341 {
10342 m_OldLocation.Reset();
10343 }
10344 }
10345
10347 }
10348 else
10349 {
10350 if (new_player)
10351 {
10352 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10353 if (res_index >= 0)
10354 {
10355 InventoryLocation il = new InventoryLocation;
10356 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10358 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10361 {
10362 il.
GetParent().GetOnReleaseLock().Invoke(it);
10363 }
10365 {
10367 }
10368
10369 }
10370 }
10372 {
10373
10375 }
10376
10377 if (m_OldLocation)
10378 {
10379 m_OldLocation.Reset();
10380 }
10381 }
10382 }
10383
10384 override void EOnContact(IEntity other, Contact extra)
10385 {
10387 {
10388 int liquidType = -1;
10390 if (impactSpeed > 0.0)
10391 {
10393 #ifndef SERVER
10395 #else
10397 SetSynchDirty();
10398 #endif
10400 }
10401 }
10402
10403 #ifdef SERVER
10404 if (GetCompEM() && GetCompEM().IsPlugged())
10405 {
10406 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10407 GetCompEM().UnplugThis();
10408 }
10409 #endif
10410 }
10411
10413
10415 {
10417 }
10418
10420 {
10421
10422 }
10423
10425 {
10426 super.OnItemLocationChanged(old_owner, new_owner);
10427
10428 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10429 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10430
10431 if (!relatedPlayer && playerNew)
10432 relatedPlayer = playerNew;
10433
10434 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10435 {
10437 if (actionMgr)
10438 {
10439 ActionBase currentAction = actionMgr.GetRunningAction();
10440 if (currentAction)
10442 }
10443 }
10444
10445 Man ownerPlayerOld = null;
10446 Man ownerPlayerNew = null;
10447
10448 if (old_owner)
10449 {
10450 if (old_owner.
IsMan())
10451 {
10452 ownerPlayerOld = Man.Cast(old_owner);
10453 }
10454 else
10455 {
10456 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10457 }
10458 }
10459 else
10460 {
10462 {
10464
10465 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10466 {
10467 GetCompEM().UnplugThis();
10468 }
10469 }
10470 }
10471
10472 if (new_owner)
10473 {
10474 if (new_owner.
IsMan())
10475 {
10476 ownerPlayerNew = Man.Cast(new_owner);
10477 }
10478 else
10479 {
10480 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10481 }
10482 }
10483
10484 if (ownerPlayerOld != ownerPlayerNew)
10485 {
10486 if (ownerPlayerOld)
10487 {
10488 array<EntityAI> subItemsExit = new array<EntityAI>;
10490 for (int i = 0; i < subItemsExit.Count(); i++)
10491 {
10494 }
10495 }
10496
10497 if (ownerPlayerNew)
10498 {
10499 array<EntityAI> subItemsEnter = new array<EntityAI>;
10501 for (int j = 0; j < subItemsEnter.Count(); j++)
10502 {
10505 }
10506 }
10507 }
10508 else if (ownerPlayerNew != null)
10509 {
10510 PlayerBase nplayer;
10511 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10512 {
10513 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10515 for (int k = 0; k < subItemsUpdate.Count(); k++)
10516 {
10518 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10519 }
10520 }
10521 }
10522
10523 if (old_owner)
10524 old_owner.OnChildItemRemoved(this);
10525 if (new_owner)
10526 new_owner.OnChildItemReceived(this);
10527 }
10528
10529
10531 {
10532 super.EEDelete(parent);
10533 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10534 if (player)
10535 {
10537
10538 if (player.IsAlive())
10539 {
10540 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10541 if (r_index >= 0)
10542 {
10543 InventoryLocation r_il = new InventoryLocation;
10544 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10545
10546 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10549 {
10550 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10551 }
10553 {
10554 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10555 }
10556
10557 }
10558
10559 player.RemoveQuickBarEntityShortcut(this);
10560 }
10561 }
10562 }
10563
10565 {
10566 super.EEKilled(killer);
10567
10570 {
10571 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10572 {
10573 if (IsMagazine())
10574 {
10575 if (Magazine.Cast(this).GetAmmoCount() > 0)
10576 {
10578 }
10579 }
10580 else
10581 {
10583 }
10584 }
10585 }
10586 }
10587
10589 {
10590 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10591
10592 super.OnWasAttached(parent, slot_id);
10593
10596
10598 }
10599
10601 {
10602 super.OnWasDetached(parent, slot_id);
10603
10606 }
10607
10609 {
10610 int idx;
10613
10614 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10615 if (inventory_slots.Count() < 1)
10616 {
10617 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10618 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10619 }
10620 else
10621 {
10622 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10623 }
10624
10625 idx = inventory_slots.Find(slot);
10626 if (idx < 0)
10627 return "";
10628
10629 return attach_types.Get(idx);
10630 }
10631
10633 {
10634 int idx = -1;
10635 string slot;
10636
10639
10640 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10641 if (inventory_slots.Count() < 1)
10642 {
10643 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10644 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10645 }
10646 else
10647 {
10648 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10649 if (detach_types.Count() < 1)
10650 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10651 }
10652
10653 for (int i = 0; i < inventory_slots.Count(); i++)
10654 {
10655 slot = inventory_slots.Get(i);
10656 }
10657
10658 if (slot != "")
10659 {
10660 if (detach_types.Count() == 1)
10661 idx = 0;
10662 else
10663 idx = inventory_slots.Find(slot);
10664 }
10665 if (idx < 0)
10666 return "";
10667
10668 return detach_types.Get(idx);
10669 }
10670
10672 {
10673
10675
10676
10677 float min_time = 1;
10678 float max_time = 3;
10679 float delay = Math.RandomFloat(min_time, max_time);
10680
10681 explode_timer.Run(delay, this, "DoAmmoExplosion");
10682 }
10683
10685 {
10686 Magazine magazine = Magazine.Cast(this);
10687 int pop_sounds_count = 6;
10688 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10689
10690
10691 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10692 string sound_name = pop_sounds[ sound_idx ];
10694
10695
10696 magazine.ServerAddAmmoCount(-1);
10697
10698
10699 float min_temp_to_explode = 100;
10700
10701 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10702 {
10704 }
10705 }
10706
10707
10708 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10709 {
10710 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10711
10712 const int CHANCE_DAMAGE_CARGO = 4;
10713 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10714 const int CHANCE_DAMAGE_NOTHING = 2;
10715
10717 {
10718 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10719 int chances;
10720 int rnd;
10721
10722 if (GetInventory().GetCargo())
10723 {
10724 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10725 rnd = Math.RandomInt(0,chances);
10726
10727 if (rnd < CHANCE_DAMAGE_CARGO)
10728 {
10730 }
10731 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10732 {
10734 }
10735 }
10736 else
10737 {
10738 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10739 rnd = Math.RandomInt(0,chances);
10740
10741 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10742 {
10744 }
10745 }
10746 }
10747 }
10748
10750 {
10751 if (GetInventory().GetCargo())
10752 {
10753 int item_count = GetInventory().GetCargo().GetItemCount();
10754 if (item_count > 0)
10755 {
10756 int random_pick = Math.RandomInt(0, item_count);
10758 if (!item.IsExplosive())
10759 {
10760 item.AddHealth("","",damage);
10761 return true;
10762 }
10763 }
10764 }
10765 return false;
10766 }
10767
10769 {
10770 int attachment_count = GetInventory().AttachmentCount();
10771 if (attachment_count > 0)
10772 {
10773 int random_pick = Math.RandomInt(0, attachment_count);
10774 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10775 if (!attachment.IsExplosive())
10776 {
10777 attachment.AddHealth("","",damage);
10778 return true;
10779 }
10780 }
10781 return false;
10782 }
10783
10785 {
10787 }
10788
10790 {
10792 return GetInventory().CanRemoveEntity();
10793
10794 return false;
10795 }
10796
10798 {
10800 return;
10801
10803 {
10804 if (ScriptInputUserData.CanStoreInputUserData())
10805 {
10806 ScriptInputUserData ctx = new ScriptInputUserData;
10811 ctx.
Write(destination_entity);
10813 ctx.
Write(slot_id);
10815 }
10816 }
10817 else if (!
GetGame().IsMultiplayer())
10818 {
10820 }
10821 }
10822
10824 {
10826 return;
10827
10828 float split_quantity_new;
10832 InventoryLocation loc = new InventoryLocation;
10833
10834 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10835 {
10837 split_quantity_new = stack_max;
10838 else
10840
10841 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10842 if (new_item)
10843 {
10844 new_item.SetResultOfSplit(true);
10845 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10847 new_item.SetQuantity(split_quantity_new);
10848 }
10849 }
10850 else if (destination_entity && slot_id == -1)
10851 {
10852 if (quantity > stack_max)
10853 split_quantity_new = stack_max;
10854 else
10855 split_quantity_new = quantity;
10856
10858 {
10861 }
10862
10863 if (new_item)
10864 {
10865 new_item.SetResultOfSplit(true);
10866 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10868 new_item.SetQuantity(split_quantity_new);
10869 }
10870 }
10871 else
10872 {
10873 if (stack_max != 0)
10874 {
10876 {
10878 }
10879
10880 if (split_quantity_new == 0)
10881 {
10882 if (!
GetGame().IsMultiplayer())
10883 player.PhysicalPredictiveDropItem(this);
10884 else
10885 player.ServerDropEntity(this);
10886 return;
10887 }
10888
10890
10891 if (new_item)
10892 {
10893 new_item.SetResultOfSplit(true);
10894 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10896 new_item.SetQuantity(stack_max);
10897 new_item.PlaceOnSurface();
10898 }
10899 }
10900 }
10901 }
10902
10904 {
10906 return;
10907
10908 float split_quantity_new;
10912 InventoryLocation loc = new InventoryLocation;
10913
10914 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10915 {
10917 split_quantity_new = stack_max;
10918 else
10920
10921 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10922 if (new_item)
10923 {
10924 new_item.SetResultOfSplit(true);
10925 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10927 new_item.SetQuantity(split_quantity_new);
10928 }
10929 }
10930 else if (destination_entity && slot_id == -1)
10931 {
10932 if (quantity > stack_max)
10933 split_quantity_new = stack_max;
10934 else
10935 split_quantity_new = quantity;
10936
10938 {
10941 }
10942
10943 if (new_item)
10944 {
10945 new_item.SetResultOfSplit(true);
10946 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10948 new_item.SetQuantity(split_quantity_new);
10949 }
10950 }
10951 else
10952 {
10953 if (stack_max != 0)
10954 {
10956 {
10958 }
10959
10961
10962 if (new_item)
10963 {
10964 new_item.SetResultOfSplit(true);
10965 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10967 new_item.SetQuantity(stack_max);
10968 new_item.PlaceOnSurface();
10969 }
10970 }
10971 }
10972 }
10973
10975 {
10977 return;
10978
10980 {
10981 if (ScriptInputUserData.CanStoreInputUserData())
10982 {
10983 ScriptInputUserData ctx = new ScriptInputUserData;
10988 dst.WriteToContext(ctx);
10990 }
10991 }
10992 else if (!
GetGame().IsMultiplayer())
10993 {
10995 }
10996 }
10997
10999 {
11001 return;
11002
11004 {
11005 if (ScriptInputUserData.CanStoreInputUserData())
11006 {
11007 ScriptInputUserData ctx = new ScriptInputUserData;
11012 ctx.
Write(destination_entity);
11018 }
11019 }
11020 else if (!
GetGame().IsMultiplayer())
11021 {
11023 }
11024 }
11025
11027 {
11029 }
11030
11032 {
11034 return this;
11035
11037 float split_quantity_new;
11039 if (dst.IsValid())
11040 {
11041 int slot_id = dst.GetSlot();
11043
11044 if (quantity > stack_max)
11045 split_quantity_new = stack_max;
11046 else
11047 split_quantity_new = quantity;
11048
11050
11051 if (new_item)
11052 {
11053 new_item.SetResultOfSplit(true);
11054 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11057 }
11058
11059 return new_item;
11060 }
11061
11062 return null;
11063 }
11064
11066 {
11068 return;
11069
11071 float split_quantity_new;
11073 if (destination_entity)
11074 {
11076 if (quantity > stackable)
11077 split_quantity_new = stackable;
11078 else
11079 split_quantity_new = quantity;
11080
11081 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11082 if (new_item)
11083 {
11084 new_item.SetResultOfSplit(true);
11085 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11087 new_item.SetQuantity(split_quantity_new);
11088 }
11089 }
11090 }
11091
11093 {
11095 return;
11096
11098 {
11099 if (ScriptInputUserData.CanStoreInputUserData())
11100 {
11101 ScriptInputUserData ctx = new ScriptInputUserData;
11106 ItemBase destination_entity =
this;
11107 ctx.
Write(destination_entity);
11111 }
11112 }
11113 else if (!
GetGame().IsMultiplayer())
11114 {
11116 }
11117 }
11118
11120 {
11122 return;
11123
11125 float split_quantity_new;
11127 if (player)
11128 {
11130 if (quantity > stackable)
11131 split_quantity_new = stackable;
11132 else
11133 split_quantity_new = quantity;
11134
11135 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11136 new_item =
ItemBase.Cast(in_hands);
11137 if (new_item)
11138 {
11139 new_item.SetResultOfSplit(true);
11140 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11142 new_item.SetQuantity(split_quantity_new);
11143 }
11144 }
11145 }
11146
11148 {
11150 return;
11151
11153 float split_quantity_new = Math.Floor(quantity * 0.5);
11154
11156
11157 if (new_item)
11158 {
11159 if (new_item.GetQuantityMax() < split_quantity_new)
11160 {
11161 split_quantity_new = new_item.GetQuantityMax();
11162 }
11163
11164 new_item.SetResultOfSplit(true);
11165 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11166
11168 {
11171 }
11172 else
11173 {
11176 }
11177 }
11178 }
11179
11181 {
11183 return;
11184
11186 float split_quantity_new = Math.Floor(quantity / 2);
11187
11188 InventoryLocation invloc = new InventoryLocation;
11190
11192 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11193
11194 if (new_item)
11195 {
11196 if (new_item.GetQuantityMax() < split_quantity_new)
11197 {
11198 split_quantity_new = new_item.GetQuantityMax();
11199 }
11201 {
11204 }
11205 else
11206 {
11209 }
11210 }
11211 }
11212
11215 {
11216 SetWeightDirty();
11218
11219 if (parent)
11220 parent.OnAttachmentQuantityChangedEx(this, delta);
11221
11223 {
11225 {
11227 }
11229 {
11230 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11232 }
11233 }
11234
11235 }
11236
11239 {
11240
11241 }
11242
11245 {
11247 }
11248
11250 {
11251 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11252
11254 {
11255 if (newLevel == GameConstants.STATE_RUINED)
11256 {
11258 EntityAI parent = GetHierarchyParent();
11259 if (parent && parent.IsFireplace())
11260 {
11261 CargoBase cargo = GetInventory().GetCargo();
11262 if (cargo)
11263 {
11265 {
11267 }
11268 }
11269 }
11270 }
11271
11273 {
11274
11276 return;
11277 }
11278
11279 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11280 {
11282 }
11283 }
11284 }
11285
11286
11288 {
11289 super.OnRightClick();
11290
11292 {
11294 {
11295 if (ScriptInputUserData.CanStoreInputUserData())
11296 {
11297 vector m4[4];
11299
11300 EntityAI root = GetHierarchyRoot();
11301
11302 InventoryLocation dst = new InventoryLocation;
11304 {
11305 if (root)
11306 {
11307 root.GetTransform(m4);
11309 }
11310 else
11311 GetInventory().GetCurrentInventoryLocation(dst);
11312 }
11313 else
11314 {
11316
11317
11318 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11319 {
11320 if (root)
11321 {
11322 root.GetTransform(m4);
11324 }
11325 else
11326 GetInventory().GetCurrentInventoryLocation(dst);
11327 }
11328 else
11329 {
11330 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11331 }
11332 }
11333
11334 ScriptInputUserData ctx = new ScriptInputUserData;
11342 }
11343 }
11344 else if (!
GetGame().IsMultiplayer())
11345 {
11347 }
11348 }
11349 }
11350
11351 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11352 {
11353
11354 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11355 return false;
11356
11357 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11358 return false;
11359
11360
11362 return false;
11363
11364
11365 Magazine mag = Magazine.Cast(this);
11366 if (mag)
11367 {
11368 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11369 return false;
11370
11371 if (stack_max_limit)
11372 {
11373 Magazine other_mag = Magazine.Cast(other_item);
11374 if (other_item)
11375 {
11376 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11377 return false;
11378 }
11379
11380 }
11381 }
11382 else
11383 {
11384
11386 return false;
11387
11389 return false;
11390 }
11391
11392 PlayerBase player = null;
11393 if (CastTo(player, GetHierarchyRootPlayer()))
11394 {
11395 if (player.GetInventory().HasAttachment(this))
11396 return false;
11397
11398 if (player.IsItemsToDelete())
11399 return false;
11400 }
11401
11402 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11403 return false;
11404
11405 int slotID;
11407 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11408 return false;
11409
11410 return true;
11411 }
11412
11414 {
11416 }
11417
11419 {
11420 return m_IsResultOfSplit;
11421 }
11422
11424 {
11425 m_IsResultOfSplit = value;
11426 }
11427
11429 {
11431 }
11432
11434 {
11435 float other_item_quantity = other_item.GetQuantity();
11436 float this_free_space;
11437
11439
11441
11442 if (other_item_quantity > this_free_space)
11443 {
11444 return this_free_space;
11445 }
11446 else
11447 {
11448 return other_item_quantity;
11449 }
11450 }
11451
11453 {
11455 }
11456
11458 {
11460 return;
11461
11462 if (!IsMagazine() && other_item)
11463 {
11465 if (quantity_used != 0)
11466 {
11467 float hp1 = GetHealth01("","");
11468 float hp2 = other_item.GetHealth01("","");
11469 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11470 hpResult = hpResult / (
GetQuantity() + quantity_used);
11471
11472 hpResult *= GetMaxHealth();
11473 Math.Round(hpResult);
11474 SetHealth("", "Health", hpResult);
11475
11477 other_item.AddQuantity(-quantity_used);
11478 }
11479 }
11481 }
11482
11484 {
11485 #ifdef SERVER
11486 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11487 GetHierarchyParent().IncreaseLifetimeUp();
11488 #endif
11489 };
11490
11492 {
11493 PlayerBase p = PlayerBase.Cast(player);
11494
11495 array<int> recipesIds = p.m_Recipes;
11496 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11497 if (moduleRecipesManager)
11498 {
11499 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11500 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11501 }
11502
11503 for (int i = 0;i < recipesIds.Count(); i++)
11504 {
11505 int key = recipesIds.Get(i);
11506 string recipeName = moduleRecipesManager.GetRecipeName(key);
11508 }
11509 }
11510
11511
11512 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11513 {
11514 super.GetDebugActions(outputList);
11515
11516
11521
11522
11526
11530
11531
11534
11535
11537 {
11540 }
11541
11543
11546
11550 }
11551
11552
11553
11554
11556 {
11557 super.OnAction(action_id, player, ctx);
11558 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11559 {
11560 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11561 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11562 PlayerBase p = PlayerBase.Cast(player);
11563 if (
EActions.RECIPES_RANGE_START < 1000)
11564 {
11565 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11566 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11567 }
11568 }
11569 #ifndef SERVER
11570 else if (action_id ==
EActions.WATCH_PLAYER)
11571 {
11572 PluginDeveloper.SetDeveloperItemClientEx(player);
11573 }
11574 #endif
11576 {
11577 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11578 {
11579 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11580 OnDebugButtonPressServer(id + 1);
11581 }
11582
11583 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11584 {
11585 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11587 }
11588
11589 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11590 {
11591 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11593 }
11594
11595 else if (action_id ==
EActions.ADD_QUANTITY)
11596 {
11597 if (IsMagazine())
11598 {
11599 Magazine mag = Magazine.Cast(this);
11600 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11601 }
11602 else
11603 {
11605 }
11606
11607 if (m_EM)
11608 {
11609 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11610 }
11611
11612 }
11613
11614 else if (action_id ==
EActions.REMOVE_QUANTITY)
11615 {
11616 if (IsMagazine())
11617 {
11618 Magazine mag2 = Magazine.Cast(this);
11619 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11620 }
11621 else
11622 {
11624 }
11625 if (m_EM)
11626 {
11627 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11628 }
11629
11630 }
11631
11632 else if (action_id ==
EActions.SET_QUANTITY_0)
11633 {
11635
11636 if (m_EM)
11637 {
11638 m_EM.SetEnergy(0);
11639 }
11640 }
11641
11642 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11643 {
11645
11646 if (m_EM)
11647 {
11648 m_EM.SetEnergy(m_EM.GetEnergyMax());
11649 }
11650 }
11651
11652 else if (action_id ==
EActions.ADD_HEALTH)
11653 {
11654 AddHealth("","",GetMaxHealth("","Health")/5);
11655 }
11656 else if (action_id ==
EActions.REMOVE_HEALTH)
11657 {
11658 AddHealth("","",-GetMaxHealth("","Health")/5);
11659 }
11660 else if (action_id ==
EActions.DESTROY_HEALTH)
11661 {
11662 SetHealth01("","",0);
11663 }
11664 else if (action_id ==
EActions.WATCH_ITEM)
11665 {
11667 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11668 #ifdef DEVELOPER
11669 SetDebugDeveloper_item(this);
11670 #endif
11671 }
11672
11673 else if (action_id ==
EActions.ADD_TEMPERATURE)
11674 {
11675 AddTemperature(20);
11676
11677 }
11678
11679 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11680 {
11681 AddTemperature(-20);
11682
11683 }
11684
11685 else if (action_id ==
EActions.FLIP_FROZEN)
11686 {
11687 SetFrozen(!GetIsFrozen());
11688
11689 }
11690
11691 else if (action_id ==
EActions.ADD_WETNESS)
11692 {
11694
11695 }
11696
11697 else if (action_id ==
EActions.REMOVE_WETNESS)
11698 {
11700
11701 }
11702
11703 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11704 {
11707
11708
11709 }
11710
11711 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11712 {
11715 }
11716
11717 else if (action_id ==
EActions.MAKE_SPECIAL)
11718 {
11719 auto debugParams = DebugSpawnParams.WithPlayer(player);
11720 OnDebugSpawnEx(debugParams);
11721 }
11722
11723 else if (action_id ==
EActions.DELETE)
11724 {
11725 Delete();
11726 }
11727
11728 }
11729
11730
11731 return false;
11732 }
11733
11734
11735
11736
11740
11743
11744
11745
11747 {
11748 return false;
11749 }
11750
11751
11753 {
11754 return true;
11755 }
11756
11757
11759 {
11760 return true;
11761 }
11762
11763
11764
11766 {
11767 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11769 }
11770
11773 {
11774 return null;
11775 }
11776
11778 {
11779 return false;
11780 }
11781
11783 {
11784 return false;
11785 }
11786
11790
11791
11793 {
11794 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11795 return module_repairing.CanRepair(this, item_repair_kit);
11796 }
11797
11798
11799 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11800 {
11801 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11802 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11803 }
11804
11805
11807 {
11808
11809
11810
11811
11812
11813
11814
11815
11816 return 1;
11817 }
11818
11819
11820
11822 {
11824 }
11825
11826
11827
11829 {
11831 }
11832
11833
11842 {
11843 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11844
11845 if (player)
11846 {
11847 player.MessageStatus(text);
11848 }
11849 }
11850
11851
11860 {
11861 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11862
11863 if (player)
11864 {
11865 player.MessageAction(text);
11866 }
11867 }
11868
11869
11878 {
11879 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11880
11881 if (player)
11882 {
11883 player.MessageFriendly(text);
11884 }
11885 }
11886
11887
11896 {
11897 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11898
11899 if (player)
11900 {
11901 player.MessageImportant(text);
11902 }
11903 }
11904
11906 {
11907 return true;
11908 }
11909
11910
11911 override bool KindOf(
string tag)
11912 {
11913 bool found = false;
11914 string item_name = this.
GetType();
11917
11918 int array_size = item_tag_array.Count();
11919 for (int i = 0; i < array_size; i++)
11920 {
11921 if (item_tag_array.Get(i) == tag)
11922 {
11923 found = true;
11924 break;
11925 }
11926 }
11927 return found;
11928 }
11929
11930
11932 {
11933
11934 super.OnRPC(sender, rpc_type,ctx);
11935
11936
11937 switch (rpc_type)
11938 {
11939 #ifndef SERVER
11940 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11941 Param2<bool, string> p = new Param2<bool, string>(false, "");
11942
11944 return;
11945
11946 bool play = p.param1;
11947 string soundSet = p.param2;
11948
11949 if (play)
11950 {
11952 {
11954 {
11956 }
11957 }
11958 else
11959 {
11961 }
11962 }
11963 else
11964 {
11966 }
11967
11968 break;
11969 #endif
11970
11971 }
11972
11974 {
11976 }
11977 }
11978
11979
11980
11981
11983 {
11984 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11985 return plugin.GetID(
name);
11986 }
11987
11989 {
11990 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11991 return plugin.GetName(id);
11992 }
11993
11996 {
11997
11998
11999 int varFlags;
12000 if (!ctx.
Read(varFlags))
12001 return;
12002
12003 if (varFlags & ItemVariableFlags.FLOAT)
12004 {
12006 }
12007 }
12008
12010 {
12011
12012 super.SerializeNumericalVars(floats_out);
12013
12014
12015
12017 {
12019 }
12020
12022 {
12024 }
12025
12027 {
12029 }
12030
12032 {
12037 }
12038
12040 {
12042 }
12043 }
12044
12046 {
12047
12048 super.DeSerializeNumericalVars(floats);
12049
12050
12051 int index = 0;
12052 int mask = Math.Round(floats.Get(index));
12053
12054 index++;
12055
12057 {
12059 {
12061 }
12062 else
12063 {
12064 float quantity = floats.Get(index);
12065 SetQuantity(quantity,
true,
false,
false,
false);
12066 }
12067 index++;
12068 }
12069
12071 {
12072 float wet = floats.Get(index);
12074 index++;
12075 }
12076
12078 {
12079 int liquidtype = Math.Round(floats.Get(index));
12081 index++;
12082 }
12083
12085 {
12087 index++;
12089 index++;
12091 index++;
12093 index++;
12094 }
12095
12097 {
12098 int cleanness = Math.Round(floats.Get(index));
12100 index++;
12101 }
12102 }
12103
12105 {
12106 super.WriteVarsToCTX(ctx);
12107
12108
12110 {
12112 }
12113
12115 {
12117 }
12118
12120 {
12122 }
12123
12125 {
12126 int r,g,b,a;
12132 }
12133
12135 {
12137 }
12138 }
12139
12141 {
12142 if (!super.ReadVarsFromCTX(ctx,version))
12143 return false;
12144
12145 int intValue;
12146 float value;
12147
12148 if (version < 140)
12149 {
12150 if (!ctx.
Read(intValue))
12151 return false;
12152
12153 m_VariablesMask = intValue;
12154 }
12155
12157 {
12158 if (!ctx.
Read(value))
12159 return false;
12160
12162 {
12164 }
12165 else
12166 {
12168 }
12169 }
12170
12171 if (version < 140)
12172 {
12174 {
12175 if (!ctx.
Read(value))
12176 return false;
12177 SetTemperatureDirect(value);
12178 }
12179 }
12180
12182 {
12183 if (!ctx.
Read(value))
12184 return false;
12186 }
12187
12189 {
12190 if (!ctx.
Read(intValue))
12191 return false;
12193 }
12194
12196 {
12197 int r,g,b,a;
12199 return false;
12201 return false;
12203 return false;
12205 return false;
12206
12208 }
12209
12211 {
12212 if (!ctx.
Read(intValue))
12213 return false;
12215 }
12216
12217 if (version >= 138 && version < 140)
12218 {
12220 {
12221 if (!ctx.
Read(intValue))
12222 return false;
12223 SetFrozen(intValue);
12224 }
12225 }
12226
12227 return true;
12228 }
12229
12230
12232 {
12235 {
12237 }
12238
12239 if (!super.OnStoreLoad(ctx, version))
12240 {
12242 return false;
12243 }
12244
12245 if (version >= 114)
12246 {
12247 bool hasQuickBarIndexSaved;
12248
12249 if (!ctx.
Read(hasQuickBarIndexSaved))
12250 {
12252 return false;
12253 }
12254
12255 if (hasQuickBarIndexSaved)
12256 {
12257 int itmQBIndex;
12258
12259
12260 if (!ctx.
Read(itmQBIndex))
12261 {
12263 return false;
12264 }
12265
12266 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12267 if (itmQBIndex != -1 && parentPlayer)
12268 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12269 }
12270 }
12271 else
12272 {
12273
12274 PlayerBase player;
12275 int itemQBIndex;
12276 if (version ==
int.
MAX)
12277 {
12278 if (!ctx.
Read(itemQBIndex))
12279 {
12281 return false;
12282 }
12283 }
12284 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12285 {
12286
12287 if (!ctx.
Read(itemQBIndex))
12288 {
12290 return false;
12291 }
12292 if (itemQBIndex != -1 && player)
12293 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12294 }
12295 }
12296
12297 if (version < 140)
12298 {
12299
12300 if (!LoadVariables(ctx, version))
12301 {
12303 return false;
12304 }
12305 }
12306
12307
12309 {
12311 return false;
12312 }
12313 if (version >= 132)
12314 {
12316 if (raib)
12317 {
12319 {
12321 return false;
12322 }
12323 }
12324 }
12325
12327 return true;
12328 }
12329
12330
12331
12333 {
12334 super.OnStoreSave(ctx);
12335
12336 PlayerBase player;
12337 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12338 {
12340
12341 int itemQBIndex = -1;
12342 itemQBIndex = player.FindQuickBarEntityIndex(this);
12343 ctx.
Write(itemQBIndex);
12344 }
12345 else
12346 {
12348 }
12349
12351
12353 if (raib)
12354 {
12356 }
12357 }
12358
12359
12361 {
12362 super.AfterStoreLoad();
12363
12365 {
12367 }
12368
12370 {
12373 }
12374 }
12375
12377 {
12378 super.EEOnAfterLoad();
12379
12381 {
12383 }
12384
12387 }
12388
12390 {
12391 return false;
12392 }
12393
12394
12395
12397 {
12399 {
12400 #ifdef PLATFORM_CONSOLE
12401
12403 {
12405 if (menu)
12406 {
12408 }
12409 }
12410 #endif
12411 }
12412
12414 {
12417 }
12418
12420 {
12421 SetWeightDirty();
12423 }
12425 {
12428 }
12429
12431 {
12434 }
12436 {
12439 }
12440
12441 super.OnVariablesSynchronized();
12442 }
12443
12444
12445
12447 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12448 {
12449 if (!IsServerCheck(allow_client))
12450 return false;
12451
12453 return false;
12454
12457
12458 if (value <= (min + 0.001))
12459 value = min;
12460
12461 if (value == min)
12462 {
12463 if (destroy_config)
12464 {
12465 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12466 if (dstr)
12467 {
12469 this.Delete();
12470 return true;
12471 }
12472 }
12473 else if (destroy_forced)
12474 {
12476 this.Delete();
12477 return true;
12478 }
12479
12481 }
12482
12485
12487 {
12489
12490 if (delta)
12492 }
12493
12495
12496 return false;
12497 }
12498
12499
12501 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12502 {
12504 }
12505
12507 {
12510 }
12511
12513 {
12516 }
12517
12520 {
12521 float value_clamped = Math.Clamp(value, 0, 1);
12523 SetQuantity(result, destroy_config, destroy_forced);
12524 }
12525
12526
12529 {
12531 }
12532
12534 {
12536 }
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12548 {
12549 int slot = -1;
12550 if (GetInventory())
12551 {
12552 InventoryLocation il = new InventoryLocation;
12553 GetInventory().GetCurrentInventoryLocation(il);
12555 }
12556
12558 }
12559
12561 {
12562 float quantity_max = 0;
12563
12565 {
12566 if (attSlotID != -1)
12567 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12568
12569 if (quantity_max <= 0)
12571 }
12572
12573 if (quantity_max <= 0)
12575
12576 return quantity_max;
12577 }
12578
12580 {
12582 }
12583
12585 {
12587 }
12588
12589
12591 {
12593 }
12594
12596 {
12598 }
12599
12601 {
12603 }
12604
12605
12607 {
12608
12609 float weightEx = GetWeightEx();
12610 float special = GetInventoryAndCargoWeight();
12611 return weightEx - special;
12612 }
12613
12614
12616 {
12618 }
12619
12621 {
12623 {
12624 #ifdef DEVELOPER
12625 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12626 {
12627 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12629 }
12630 #endif
12631
12632 return GetQuantity() * GetConfigWeightModified();
12633 }
12634 else if (HasEnergyManager())
12635 {
12636 #ifdef DEVELOPER
12637 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12638 {
12639 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12640 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12641 }
12642 #endif
12643 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12644 }
12645 else
12646 {
12647 #ifdef DEVELOPER
12648 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12649 {
12650 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12651 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12652 }
12653 #endif
12654 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12655 }
12656 }
12657
12660 {
12661 int item_count = 0;
12663
12664 if (GetInventory().GetCargo() != NULL)
12665 {
12666 item_count = GetInventory().GetCargo().GetItemCount();
12667 }
12668
12669 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12670 {
12671 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12672 if (item)
12673 item_count += item.GetNumberOfItems();
12674 }
12675 return item_count;
12676 }
12677
12680 {
12681 float weight = 0;
12682 float wetness = 1;
12683 if (include_wetness)
12686 {
12687 weight = wetness * m_ConfigWeight;
12688 }
12690 {
12691 weight = 1;
12692 }
12693 return weight;
12694 }
12695
12696
12697
12699 {
12700 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12701 {
12702 GameInventory inv = GetInventory();
12703 array<EntityAI> items = new array<EntityAI>;
12705 for (int i = 0; i < items.Count(); i++)
12706 {
12708 if (item)
12709 {
12711 }
12712 }
12713 }
12714 }
12715
12716
12717
12718
12720 {
12721 float energy = 0;
12722 if (HasEnergyManager())
12723 {
12724 energy = GetCompEM().GetEnergy();
12725 }
12726 return energy;
12727 }
12728
12729
12731 {
12732 super.OnEnergyConsumed();
12733
12735 }
12736
12738 {
12739 super.OnEnergyAdded();
12740
12742 }
12743
12744
12746 {
12747 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12748 {
12750 {
12751 float energy_0to1 = GetCompEM().GetEnergy0To1();
12753 }
12754 }
12755 }
12756
12757
12759 {
12760 return ConfigGetFloat("heatIsolation");
12761 }
12762
12764 {
12766 }
12767
12769 {
12770 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12771 if (
GetGame().ConfigIsExisting(paramPath))
12773
12774 return 0.0;
12775 }
12776
12778 {
12779 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12780 if (
GetGame().ConfigIsExisting(paramPath))
12782
12783 return 0.0;
12784 }
12785
12786 override void SetWet(
float value,
bool allow_client =
false)
12787 {
12788 if (!IsServerCheck(allow_client))
12789 return;
12790
12793
12795
12796 m_VarWet = Math.Clamp(value, min, max);
12797
12799 {
12802 }
12803 }
12804
12805 override void AddWet(
float value)
12806 {
12808 }
12809
12811 {
12813 }
12814
12816 {
12818 }
12819
12821 {
12823 }
12824
12826 {
12828 }
12829
12831 {
12833 }
12834
12835 override void OnWetChanged(
float newVal,
float oldVal)
12836 {
12839 if (newLevel != oldLevel)
12840 {
12842 }
12843 }
12844
12846 {
12847 SetWeightDirty();
12848 }
12849
12851 {
12852 return GetWetLevelInternal(
m_VarWet);
12853 }
12854
12855
12856
12858 {
12860 }
12861
12863 {
12865 }
12866
12868 {
12870 }
12871
12873 {
12875 }
12876
12877
12878
12880 {
12881 if (ConfigIsExisting("itemModelLength"))
12882 {
12883 return ConfigGetFloat("itemModelLength");
12884 }
12885 return 0;
12886 }
12887
12889 {
12890 if (ConfigIsExisting("itemAttachOffset"))
12891 {
12892 return ConfigGetFloat("itemAttachOffset");
12893 }
12894 return 0;
12895 }
12896
12897 override void SetCleanness(
int value,
bool allow_client =
false)
12898 {
12899 if (!IsServerCheck(allow_client))
12900 return;
12901
12903
12905
12908 }
12909
12911 {
12913 }
12914
12916 {
12917 return true;
12918 }
12919
12920
12921
12922
12924 {
12926 }
12927
12929 {
12931 }
12932
12933
12934
12935
12936 override void SetColor(
int r,
int g,
int b,
int a)
12937 {
12943 }
12945 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12946 {
12951 }
12952
12954 {
12956 }
12957
12960 {
12961 int r,g,b,a;
12963 r = r/255;
12964 g = g/255;
12965 b = b/255;
12966 a = a/255;
12967 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12968 }
12969
12970
12971
12972 override void SetLiquidType(
int value,
bool allow_client =
false)
12973 {
12974 if (!IsServerCheck(allow_client))
12975 return;
12976
12981 }
12982
12984 {
12985 return ConfigGetInt("varLiquidTypeInit");
12986 }
12987
12989 {
12991 }
12992
12994 {
12996 SetFrozen(false);
12997 }
12998
13001 {
13002 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13003 }
13004
13005
13008 {
13009 PlayerBase nplayer;
13010 if (PlayerBase.CastTo(nplayer, player))
13011 {
13013
13014 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13015 }
13016 }
13017
13018
13021 {
13022 PlayerBase nplayer;
13023 if (PlayerBase.CastTo(nplayer,player))
13024 {
13025
13026 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13027
13028 }
13029
13030
13031 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13032
13033
13034 if (HasEnergyManager())
13035 {
13036 GetCompEM().UpdatePlugState();
13037 }
13038 }
13039
13040
13042 {
13043 super.OnPlacementStarted(player);
13044
13046 }
13047
13048 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13049 {
13051 {
13052 m_AdminLog.OnPlacementComplete(player,
this);
13053 }
13054
13055 super.OnPlacementComplete(player, position, orientation);
13056 }
13057
13058
13059
13060
13061
13063 {
13065 {
13066 return true;
13067 }
13068 else
13069 {
13070 return false;
13071 }
13072 }
13073
13074
13076 {
13078 {
13080 }
13081 }
13082
13083
13085 {
13087 }
13088
13090 {
13092 }
13093
13094 override void InsertAgent(
int agent,
float count = 1)
13095 {
13096 if (count < 1)
13097 return;
13098
13100 }
13101
13104 {
13106 }
13107
13108
13110 {
13112 }
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13156 {
13158 return false;
13159 return true;
13160 }
13161
13163 {
13164
13166 }
13167
13168
13171 {
13172 super.CheckForRoofLimited(timeTresholdMS);
13173
13175 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13176 {
13177 m_PreviousRoofTestTime = time;
13178 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13179 }
13180 }
13181
13182
13184 {
13186 {
13187 return 0;
13188 }
13189
13190 if (GetInventory().GetAttachmentSlotsCount() != 0)
13191 {
13192 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13193 if (filter)
13194 return filter.GetProtectionLevel(type, false, system);
13195 else
13196 return 0;
13197 }
13198
13199 string subclassPath, entryName;
13200
13201 switch (type)
13202 {
13204 entryName = "biological";
13205 break;
13207 entryName = "chemical";
13208 break;
13209 default:
13210 entryName = "biological";
13211 break;
13212 }
13213
13214 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13215
13217 }
13218
13219
13220
13223 {
13224 if (!IsMagazine())
13226
13228 }
13229
13230
13231
13232
13233
13238 {
13239 return true;
13240 }
13241
13243 {
13245 }
13246
13247
13248
13249
13250
13252 {
13253 if (parent)
13254 {
13255 if (parent.IsInherited(DayZInfected))
13256 return true;
13257
13258 if (!parent.IsRuined())
13259 return true;
13260 }
13261
13262 return true;
13263 }
13264
13266 {
13267 if (!super.CanPutAsAttachment(parent))
13268 {
13269 return false;
13270 }
13271
13272 if (!IsRuined() && !parent.IsRuined())
13273 {
13274 return true;
13275 }
13276
13277 return false;
13278 }
13279
13281 {
13282
13283
13284
13285
13286 return super.CanReceiveItemIntoCargo(item);
13287 }
13288
13290 {
13291
13292
13293
13294
13295 GameInventory attachmentInv = attachment.GetInventory();
13297 {
13298 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13299 return false;
13300 }
13301
13302 InventoryLocation loc = new InventoryLocation();
13303 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13304 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13305 return false;
13306
13307 return super.CanReceiveAttachment(attachment, slotId);
13308 }
13309
13311 {
13312 if (!super.CanReleaseAttachment(attachment))
13313 return false;
13314
13315 return GetInventory().AreChildrenAccessible();
13316 }
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13339 {
13340 int id = muzzle_owner.GetMuzzleID();
13341 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13342
13343 if (WPOF_array)
13344 {
13345 for (int i = 0; i < WPOF_array.Count(); i++)
13346 {
13347 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13348
13349 if (WPOF)
13350 {
13351 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13352 }
13353 }
13354 }
13355 }
13356
13357
13359 {
13360 int id = muzzle_owner.GetMuzzleID();
13362
13363 if (WPOBE_array)
13364 {
13365 for (int i = 0; i < WPOBE_array.Count(); i++)
13366 {
13367 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13368
13369 if (WPOBE)
13370 {
13371 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13372 }
13373 }
13374 }
13375 }
13376
13377
13379 {
13380 int id = muzzle_owner.GetMuzzleID();
13381 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13382
13383 if (WPOOH_array)
13384 {
13385 for (int i = 0; i < WPOOH_array.Count(); i++)
13386 {
13387 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13388
13389 if (WPOOH)
13390 {
13391 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13392 }
13393 }
13394 }
13395 }
13396
13397
13399 {
13400 int id = muzzle_owner.GetMuzzleID();
13401 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13402
13403 if (WPOOH_array)
13404 {
13405 for (int i = 0; i < WPOOH_array.Count(); i++)
13406 {
13407 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13408
13409 if (WPOOH)
13410 {
13411 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13412 }
13413 }
13414 }
13415 }
13416
13417
13419 {
13420 int id = muzzle_owner.GetMuzzleID();
13421 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13422
13423 if (WPOOH_array)
13424 {
13425 for (int i = 0; i < WPOOH_array.Count(); i++)
13426 {
13427 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13428
13429 if (WPOOH)
13430 {
13431 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13432 }
13433 }
13434 }
13435 }
13436
13437
13438
13440 {
13442 {
13443 return true;
13444 }
13445
13446 return false;
13447 }
13448
13450 {
13452 {
13453 return true;
13454 }
13455
13456 return false;
13457 }
13458
13460 {
13462 {
13463 return true;
13464 }
13465
13466 return false;
13467 }
13468
13470 {
13471 return false;
13472 }
13473
13476 {
13477 return UATimeSpent.DEFAULT_DEPLOY;
13478 }
13479
13480
13481
13482
13484 {
13486 SetSynchDirty();
13487 }
13488
13490 {
13492 }
13493
13494
13496 {
13497 return false;
13498 }
13499
13502 {
13503 string att_type = "None";
13504
13505 if (ConfigIsExisting("soundAttType"))
13506 {
13507 att_type = ConfigGetString("soundAttType");
13508 }
13509
13511 }
13512
13514 {
13516 }
13517
13518
13519
13520
13521
13525
13527 {
13530
13532 }
13533
13534
13536 {
13538 return;
13539
13541
13544
13547
13548 SoundParameters params = new SoundParameters();
13552 }
13553
13554
13556 {
13558 return;
13559
13561 SetSynchDirty();
13562
13565 }
13566
13567
13569 {
13571 return;
13572
13574 SetSynchDirty();
13575
13578 }
13579
13581 {
13583 }
13584
13586 {
13588 }
13589
13592 {
13593 if (!
GetGame().IsDedicatedServer())
13594 {
13595 if (ConfigIsExisting("attachSoundSet"))
13596 {
13597 string cfg_path = "";
13598 string soundset = "";
13599 string type_name =
GetType();
13600
13603 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13604 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13605
13606 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13607 {
13608 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13609 {
13610 if (cfg_slot_array[i] == slot_type)
13611 {
13612 soundset = cfg_soundset_array[i];
13613 break;
13614 }
13615 }
13616 }
13617
13618 if (soundset != "")
13619 {
13620 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13622 }
13623 }
13624 }
13625 }
13626
13628 {
13629
13630 }
13631
13632 void OnApply(PlayerBase player);
13633
13635 {
13636 return 1.0;
13637 };
13638
13640 {
13642 }
13643
13645 {
13647 }
13648
13650
13652 {
13653 SetDynamicPhysicsLifeTime(0.01);
13655 }
13656
13658 {
13659 array<string> zone_names = new array<string>;
13660 GetDamageZones(zone_names);
13661 for (int i = 0; i < zone_names.Count(); i++)
13662 {
13663 SetHealthMax(zone_names.Get(i),"Health");
13664 }
13665 SetHealthMax("","Health");
13666 }
13667
13670 {
13671 float global_health = GetHealth01("","Health");
13672 array<string> zones = new array<string>;
13673 GetDamageZones(zones);
13674
13675 for (int i = 0; i < zones.Count(); i++)
13676 {
13677 SetHealth01(zones.Get(i),"Health",global_health);
13678 }
13679 }
13680
13683 {
13684 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13685 }
13686
13688 {
13689 if (!hasRootAsPlayer)
13690 {
13691 if (refParentIB)
13692 {
13693
13694 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13695 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13696
13697 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13698 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13699
13702 }
13703 else
13704 {
13705
13708 }
13709 }
13710 }
13711
13713 {
13715 {
13716 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13717 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13718 {
13719 float heatPermCoef = 1.0;
13721 while (ent)
13722 {
13723 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13724 ent = ent.GetHierarchyParent();
13725 }
13726
13727 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13728 }
13729 }
13730 }
13731
13733 {
13734
13735 EntityAI parent = GetHierarchyParent();
13736 if (!parent)
13737 {
13738 hasParent = false;
13739 hasRootAsPlayer = false;
13740 }
13741 else
13742 {
13743 hasParent = true;
13744 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13745 refParentIB =
ItemBase.Cast(parent);
13746 }
13747 }
13748
13749 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13750 {
13751
13752 }
13753
13755 {
13756
13757 return false;
13758 }
13759
13761 {
13762
13763
13764 return false;
13765 }
13766
13768 {
13769
13770 return false;
13771 }
13772
13775 {
13776 return !GetIsFrozen() &&
IsOpen();
13777 }
13778
13780 {
13781 bool hasParent = false, hasRootAsPlayer = false;
13783
13784 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13785 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13786
13787 if (wwtu || foodDecay)
13788 {
13792
13793 if (processWetness || processTemperature || processDecay)
13794 {
13796
13797 if (processWetness)
13798 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13799
13800 if (processTemperature)
13802
13803 if (processDecay)
13804 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13805 }
13806 }
13807 }
13808
13811 {
13813 }
13814
13816 {
13819
13820 return super.GetTemperatureFreezeThreshold();
13821 }
13822
13824 {
13827
13828 return super.GetTemperatureThawThreshold();
13829 }
13830
13832 {
13835
13836 return super.GetItemOverheatThreshold();
13837 }
13838
13840 {
13842 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13843
13844 return super.GetTemperatureFreezeTime();
13845 }
13846
13848 {
13850 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13851
13852 return super.GetTemperatureThawTime();
13853 }
13854
13859
13861 {
13862 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13863 }
13864
13866 {
13867 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13868 }
13869
13872 {
13874 }
13875
13877 {
13879 }
13880
13882 {
13884 }
13885
13888 {
13889 return null;
13890 }
13891
13894 {
13895 return false;
13896 }
13897
13899 {
13901 {
13904 if (!trg)
13905 {
13907 explosive = this;
13908 }
13909
13910 explosive.PairRemote(trg);
13912
13913 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13914 trg.SetPersistentPairID(persistentID);
13915 explosive.SetPersistentPairID(persistentID);
13916
13917 return true;
13918 }
13919 return false;
13920 }
13921
13924 {
13925 float ret = 1.0;
13928 ret *= GetHealth01();
13929
13930 return ret;
13931 }
13932
13933 #ifdef DEVELOPER
13934 override void SetDebugItem()
13935 {
13936 super.SetDebugItem();
13937 _itemBase = this;
13938 }
13939
13941 {
13942 string text = super.GetDebugText();
13943
13945 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13946
13947 return text;
13948 }
13949 #endif
13950
13952 {
13953 return true;
13954 }
13955
13957
13959
13961 {
13964 }
13965
13966
13974
13990}
13991
13993{
13995 if (entity)
13996 {
13997 bool is_item = entity.IsInherited(
ItemBase);
13998 if (is_item && full_quantity)
13999 {
14002 }
14003 }
14004 else
14005 {
14007 return NULL;
14008 }
14009 return entity;
14010}
14011
14013{
14014 if (item)
14015 {
14016 if (health > 0)
14017 item.SetHealth("", "", health);
14018
14019 if (item.CanHaveTemperature())
14020 {
14022 if (item.CanFreeze())
14023 item.SetFrozen(false);
14024 }
14025
14026 if (item.HasEnergyManager())
14027 {
14028 if (quantity >= 0)
14029 {
14030 item.GetCompEM().SetEnergy0To1(quantity);
14031 }
14032 else
14033 {
14035 }
14036 }
14037 else if (item.IsMagazine())
14038 {
14039 Magazine mag = Magazine.Cast(item);
14040 if (quantity >= 0)
14041 {
14042 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14043 }
14044 else
14045 {
14047 }
14048
14049 }
14050 else
14051 {
14052 if (quantity >= 0)
14053 {
14054 item.SetQuantityNormalized(quantity, false);
14055 }
14056 else
14057 {
14059 }
14060
14061 }
14062 }
14063}
14064
14065#ifdef DEVELOPER
14067#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.