9373{
9375 {
9376 return true;
9377 }
9378};
9379
9380
9381
9383{
9387
9389
9392
9393
9394
9395
9396
9405
9411
9416
9421
9442 protected bool m_IsResultOfSplit
9443
9445
9450
9451
9452
9454
9458
9459
9460
9462
9465
9466
9467
9473
9474
9482
9485
9486
9488
9489
9491
9492
9497
9498
9503
9504
9506
9507
9509 {
9514
9515 if (!
GetGame().IsDedicatedServer())
9516 {
9518 {
9520
9522 {
9524 }
9525 }
9526
9529 }
9530
9531 m_OldLocation = null;
9532
9534 {
9536 }
9537
9538 if (ConfigIsExisting("headSelectionsToHide"))
9539 {
9542 }
9543
9545 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9546 {
9548 }
9549
9551
9552 m_IsResultOfSplit = false;
9553
9555 }
9556
9558 {
9559 super.InitItemVariables();
9560
9566 m_Count = ConfigGetInt(
"count");
9567
9570
9575
9578
9583
9595
9599
9600
9603 if (ConfigIsExisting("canBeSplit"))
9604 {
9607 }
9608
9610 if (ConfigIsExisting("itemBehaviour"))
9612
9613
9616 RegisterNetSyncVariableInt("m_VarLiquidType");
9617 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9618
9619 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9620 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9621 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9622
9623 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9624 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9625 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9626 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9627
9628 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9629 RegisterNetSyncVariableBool("m_IsTakeable");
9630 RegisterNetSyncVariableBool("m_IsHologram");
9631
9634 {
9637 }
9638
9640
9642 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9644
9645 }
9646
9648 {
9650 }
9651
9653 {
9656 {
9661 }
9662 }
9663
9664 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9665 {
9667 {
9670 }
9671
9673 }
9674
9676 {
9682 }
9683
9685
9687 {
9689
9690 if (!action)
9691 {
9692 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9693 return;
9694 }
9695
9697 if (!ai)
9698 {
9700 return;
9701 }
9702
9704 if (!action_array)
9705 {
9706 action_array = new array<ActionBase_Basic>;
9708 }
9709 if (LogManager.IsActionLogEnable())
9710 {
9711 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9712 }
9713
9714 if (action_array.Find(action) != -1)
9715 {
9716 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9717 }
9718 else
9719 {
9720 action_array.Insert(action);
9721 }
9722 }
9723
9725 {
9727 ActionBase action = player.GetActionManager().GetAction(actionName);
9730
9731 if (action_array)
9732 {
9733 action_array.RemoveItem(action);
9734 }
9735 }
9736
9737
9738
9740 {
9741 ActionOverrideData overrideData = new ActionOverrideData();
9745
9747 if (!actionMap)
9748 {
9751 }
9752
9753 actionMap.Insert(this.
Type(), overrideData);
9754
9755 }
9756
9758
9760
9761
9763 {
9766
9769
9770 string config_to_search = "CfgVehicles";
9771 string muzzle_owner_config;
9772
9774 {
9775 if (IsInherited(Weapon))
9776 config_to_search = "CfgWeapons";
9777
9778 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9779
9780 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9781
9783
9784 if (config_OnFire_subclass_count > 0)
9785 {
9786 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9787
9788 for (int i = 0; i < config_OnFire_subclass_count; i++)
9789 {
9790 string particle_class = "";
9792 string config_OnFire_entry = config_OnFire_class + particle_class;
9793 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9794 WPOF_array.Insert(WPOF);
9795 }
9796
9797
9799 }
9800 }
9801
9803 {
9804 config_to_search = "CfgWeapons";
9805 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9806
9807 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9808
9810
9811 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9812 {
9813 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9814
9815 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9816 {
9817 string particle_class2 = "";
9819 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9820 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9821 WPOBE_array.Insert(WPOBE);
9822 }
9823
9824
9826 }
9827 }
9828 }
9829
9830
9832 {
9835
9837 {
9838 string config_to_search = "CfgVehicles";
9839
9840 if (IsInherited(Weapon))
9841 config_to_search = "CfgWeapons";
9842
9843 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9844 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9845
9846 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9847 {
9848
9850
9852 {
9854 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9856 return;
9857 }
9858
9861
9862
9863
9865 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9866
9867 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9868 {
9869 string particle_class = "";
9871 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9873
9874 if (entry_type == CT_CLASS)
9875 {
9876 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9877 WPOOH_array.Insert(WPOF);
9878 }
9879 }
9880
9881
9883 }
9884 }
9885 }
9886
9888 {
9890 }
9891
9893 {
9895 {
9897
9900
9903
9904 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9905 }
9906 }
9907
9909 {
9911 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9912
9914 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9915
9917 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9918
9920 {
9922 }
9923 }
9924
9926 {
9928 }
9929
9931 {
9934 else
9936
9938 {
9941 }
9942 else
9943 {
9946
9949 }
9950
9952 }
9953
9955 {
9957 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9958 }
9959
9961 {
9963 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9965 }
9966
9968 {
9970 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9971 }
9972
9974 {
9977
9978 OverheatingParticle OP = new OverheatingParticle();
9983
9985 }
9986
9988 {
9991
9992 return -1;
9993 }
9994
9996 {
9998 {
10001
10002 for (int i = count; i > 0; --i)
10003 {
10004 int id = i - 1;
10007
10010
10011 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10012 {
10013 if (p)
10014 {
10017 }
10018 }
10019 }
10020 }
10021 }
10022
10024 {
10026 {
10028 {
10029 int id = i - 1;
10031
10032 if (OP)
10033 {
10035
10036 if (p)
10037 {
10039 }
10040
10041 delete OP;
10042 }
10043 }
10044
10047 }
10048 }
10049
10052 {
10053 return 0.0;
10054 }
10055
10056
10058 {
10059 return 250;
10060 }
10061
10063 {
10064 return 0;
10065 }
10066
10069 {
10071 return true;
10072
10073 return false;
10074 }
10075
10078 {
10081
10083 {
10085 }
10086 else
10087 {
10088
10090 }
10091
10093 }
10094
10101 {
10102 return -1;
10103 }
10104
10105
10106
10107
10109 {
10111 {
10113 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10114
10115 if (r_index >= 0)
10116 {
10117 InventoryLocation r_il = new InventoryLocation;
10118 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10119
10120 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10123 {
10124 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10125 }
10127 {
10128 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10129 }
10130
10131 }
10132
10133 player.GetHumanInventory().ClearUserReservedLocation(this);
10134 }
10135
10138 }
10139
10140
10141
10142
10144 {
10145 return ItemBase.m_DebugActionsMask;
10146 }
10147
10149 {
10150 return ItemBase.m_DebugActionsMask & mask;
10151 }
10152
10154 {
10155 ItemBase.m_DebugActionsMask = mask;
10156 }
10157
10159 {
10160 ItemBase.m_DebugActionsMask |= mask;
10161 }
10162
10164 {
10165 ItemBase.m_DebugActionsMask &= ~mask;
10166 }
10167
10169 {
10171 {
10173 }
10174 else
10175 {
10177 }
10178 }
10179
10180
10182 {
10183 if (GetEconomyProfile())
10184 {
10185 float q_max = GetEconomyProfile().GetQuantityMax();
10186 if (q_max > 0)
10187 {
10188 float q_min = GetEconomyProfile().GetQuantityMin();
10189 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10190
10192 {
10193 ComponentEnergyManager comp = GetCompEM();
10195 {
10197 }
10198 }
10200 {
10202
10203 }
10204
10205 }
10206 }
10207 }
10208
10211 {
10212 EntityAI parent = GetHierarchyParent();
10213
10214 if (parent)
10215 {
10216 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10217 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10218 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10219 }
10220 }
10221
10224 {
10225 EntityAI parent = GetHierarchyParent();
10226
10227 if (parent)
10228 {
10229 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10230 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10231 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10232 }
10233 }
10234
10236 {
10237
10238
10239
10240
10242
10244 {
10245 if (ScriptInputUserData.CanStoreInputUserData())
10246 {
10247 ScriptInputUserData ctx = new ScriptInputUserData;
10253 ctx.
Write(use_stack_max);
10256
10258 {
10259 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10260 }
10261 }
10262 }
10263 else if (!
GetGame().IsMultiplayer())
10264 {
10266 }
10267 }
10268
10270 {
10272 }
10273
10275 {
10277 }
10278
10280 {
10282 }
10283
10285 {
10286
10287 return false;
10288 }
10289
10291 {
10292 return false;
10293 }
10294
10298 {
10299 return false;
10300 }
10301
10303 {
10304 return "";
10305 }
10306
10308
10310 {
10311 return false;
10312 }
10313
10315 {
10316 return true;
10317 }
10318
10319
10320
10322 {
10323 return true;
10324 }
10325
10327 {
10328 return true;
10329 }
10330
10332 {
10333 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10335 }
10336
10338 {
10340 }
10341
10343 {
10345 if (!is_being_placed)
10347 SetSynchDirty();
10348 }
10349
10350
10352
10354 {
10356 }
10357
10359 {
10361 }
10362
10364 {
10365 return 1;
10366 }
10367
10369 {
10370 return false;
10371 }
10372
10374 {
10376 SetSynchDirty();
10377 }
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10414 {
10415 super.OnMovedInsideCargo(container);
10416
10417 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10418 }
10419
10420 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10421 {
10422 super.EEItemLocationChanged(oldLoc,newLoc);
10423
10424 PlayerBase new_player = null;
10425 PlayerBase old_player = null;
10426
10427 if (newLoc.GetParent())
10428 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10429
10430 if (oldLoc.GetParent())
10431 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10432
10434 {
10435 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10436
10437 if (r_index >= 0)
10438 {
10439 InventoryLocation r_il = new InventoryLocation;
10440 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10441
10442 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10445 {
10446 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10447 }
10449 {
10450 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10451 }
10452
10453 }
10454 }
10455
10457 {
10458 if (new_player)
10459 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10460
10461 if (new_player == old_player)
10462 {
10463
10464 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10465 {
10467 {
10468 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10469 {
10470 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10471 }
10472 }
10473 else
10474 {
10475 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10476 }
10477 }
10478
10479 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10480 {
10481 int type = oldLoc.GetType();
10483 {
10484 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10485 }
10487 {
10488 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10489 }
10490 }
10491 if (!m_OldLocation)
10492 {
10493 m_OldLocation = new InventoryLocation;
10494 }
10495 m_OldLocation.Copy(oldLoc);
10496 }
10497 else
10498 {
10499 if (m_OldLocation)
10500 {
10501 m_OldLocation.Reset();
10502 }
10503 }
10504
10506 }
10507 else
10508 {
10509 if (new_player)
10510 {
10511 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10512 if (res_index >= 0)
10513 {
10514 InventoryLocation il = new InventoryLocation;
10515 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10517 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10520 {
10521 il.
GetParent().GetOnReleaseLock().Invoke(it);
10522 }
10524 {
10526 }
10527
10528 }
10529 }
10531 {
10532
10534 }
10535
10536 if (m_OldLocation)
10537 {
10538 m_OldLocation.Reset();
10539 }
10540 }
10541 }
10542
10543 override void EOnContact(IEntity other, Contact extra)
10544 {
10546 {
10547 int liquidType = -1;
10549 if (impactSpeed > 0.0)
10550 {
10552 #ifndef SERVER
10554 #else
10556 SetSynchDirty();
10557 #endif
10559 }
10560 }
10561
10562 #ifdef SERVER
10563 if (GetCompEM() && GetCompEM().IsPlugged())
10564 {
10565 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10566 GetCompEM().UnplugThis();
10567 }
10568 #endif
10569 }
10570
10572
10574 {
10576 }
10577
10579 {
10580
10581 }
10582
10584 {
10585 super.OnItemLocationChanged(old_owner, new_owner);
10586
10587 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10588 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10589
10590 if (!relatedPlayer && playerNew)
10591 relatedPlayer = playerNew;
10592
10593 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10594 {
10596 if (actionMgr)
10597 {
10598 ActionBase currentAction = actionMgr.GetRunningAction();
10599 if (currentAction)
10601 }
10602 }
10603
10604 Man ownerPlayerOld = null;
10605 Man ownerPlayerNew = null;
10606
10607 if (old_owner)
10608 {
10609 if (old_owner.
IsMan())
10610 {
10611 ownerPlayerOld = Man.Cast(old_owner);
10612 }
10613 else
10614 {
10615 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10616 }
10617 }
10618 else
10619 {
10621 {
10623
10624 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10625 {
10626 GetCompEM().UnplugThis();
10627 }
10628 }
10629 }
10630
10631 if (new_owner)
10632 {
10633 if (new_owner.
IsMan())
10634 {
10635 ownerPlayerNew = Man.Cast(new_owner);
10636 }
10637 else
10638 {
10639 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10640 }
10641 }
10642
10643 if (ownerPlayerOld != ownerPlayerNew)
10644 {
10645 if (ownerPlayerOld)
10646 {
10647 array<EntityAI> subItemsExit = new array<EntityAI>;
10649 for (int i = 0; i < subItemsExit.Count(); i++)
10650 {
10653 }
10654 }
10655
10656 if (ownerPlayerNew)
10657 {
10658 array<EntityAI> subItemsEnter = new array<EntityAI>;
10660 for (int j = 0; j < subItemsEnter.Count(); j++)
10661 {
10664 }
10665 }
10666 }
10667 else if (ownerPlayerNew != null)
10668 {
10669 PlayerBase nplayer;
10670 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10671 {
10672 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10674 for (int k = 0; k < subItemsUpdate.Count(); k++)
10675 {
10677 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10678 }
10679 }
10680 }
10681
10682 if (old_owner)
10683 old_owner.OnChildItemRemoved(this);
10684 if (new_owner)
10685 new_owner.OnChildItemReceived(this);
10686 }
10687
10688
10690 {
10691 super.EEDelete(parent);
10692 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10693 if (player)
10694 {
10696
10697 if (player.IsAlive())
10698 {
10699 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10700 if (r_index >= 0)
10701 {
10702 InventoryLocation r_il = new InventoryLocation;
10703 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10704
10705 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10708 {
10709 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10710 }
10712 {
10713 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10714 }
10715
10716 }
10717
10718 player.RemoveQuickBarEntityShortcut(this);
10719 }
10720 }
10721 }
10722
10724 {
10725 super.EEKilled(killer);
10726
10729 {
10730 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10731 {
10732 if (IsMagazine())
10733 {
10734 if (Magazine.Cast(this).GetAmmoCount() > 0)
10735 {
10737 }
10738 }
10739 else
10740 {
10742 }
10743 }
10744 }
10745 }
10746
10748 {
10749 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10750
10751 super.OnWasAttached(parent, slot_id);
10752
10755
10757 }
10758
10760 {
10761 super.OnWasDetached(parent, slot_id);
10762
10765 }
10766
10768 {
10769 int idx;
10772
10773 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10774 if (inventory_slots.Count() < 1)
10775 {
10776 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10777 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10778 }
10779 else
10780 {
10781 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10782 }
10783
10784 idx = inventory_slots.Find(slot);
10785 if (idx < 0)
10786 return "";
10787
10788 return attach_types.Get(idx);
10789 }
10790
10792 {
10793 int idx = -1;
10794 string slot;
10795
10798
10799 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10800 if (inventory_slots.Count() < 1)
10801 {
10802 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10803 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10804 }
10805 else
10806 {
10807 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10808 if (detach_types.Count() < 1)
10809 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10810 }
10811
10812 for (int i = 0; i < inventory_slots.Count(); i++)
10813 {
10814 slot = inventory_slots.Get(i);
10815 }
10816
10817 if (slot != "")
10818 {
10819 if (detach_types.Count() == 1)
10820 idx = 0;
10821 else
10822 idx = inventory_slots.Find(slot);
10823 }
10824 if (idx < 0)
10825 return "";
10826
10827 return detach_types.Get(idx);
10828 }
10829
10831 {
10832
10834
10835
10836 float min_time = 1;
10837 float max_time = 3;
10838 float delay = Math.RandomFloat(min_time, max_time);
10839
10840 explode_timer.Run(delay, this, "DoAmmoExplosion");
10841 }
10842
10844 {
10845 Magazine magazine = Magazine.Cast(this);
10846 int pop_sounds_count = 6;
10847 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10848
10849
10850 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10851 string sound_name = pop_sounds[ sound_idx ];
10853
10854
10855 magazine.ServerAddAmmoCount(-1);
10856
10857
10858 float min_temp_to_explode = 100;
10859
10860 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10861 {
10863 }
10864 }
10865
10866
10867 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10868 {
10869 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10870
10871 const int CHANCE_DAMAGE_CARGO = 4;
10872 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10873 const int CHANCE_DAMAGE_NOTHING = 2;
10874
10876 {
10877 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10878 int chances;
10879 int rnd;
10880
10881 if (GetInventory().GetCargo())
10882 {
10883 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10884 rnd = Math.RandomInt(0,chances);
10885
10886 if (rnd < CHANCE_DAMAGE_CARGO)
10887 {
10889 }
10890 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10891 {
10893 }
10894 }
10895 else
10896 {
10897 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10898 rnd = Math.RandomInt(0,chances);
10899
10900 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10901 {
10903 }
10904 }
10905 }
10906 }
10907
10909 {
10910 if (GetInventory().GetCargo())
10911 {
10912 int item_count = GetInventory().GetCargo().GetItemCount();
10913 if (item_count > 0)
10914 {
10915 int random_pick = Math.RandomInt(0, item_count);
10917 if (!item.IsExplosive())
10918 {
10919 item.AddHealth("","",damage);
10920 return true;
10921 }
10922 }
10923 }
10924 return false;
10925 }
10926
10928 {
10929 int attachment_count = GetInventory().AttachmentCount();
10930 if (attachment_count > 0)
10931 {
10932 int random_pick = Math.RandomInt(0, attachment_count);
10933 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10934 if (!attachment.IsExplosive())
10935 {
10936 attachment.AddHealth("","",damage);
10937 return true;
10938 }
10939 }
10940 return false;
10941 }
10942
10944 {
10946 }
10947
10949 {
10951 return GetInventory().CanRemoveEntity();
10952
10953 return false;
10954 }
10955
10957 {
10959 return;
10960
10962 {
10963 if (ScriptInputUserData.CanStoreInputUserData())
10964 {
10965 ScriptInputUserData ctx = new ScriptInputUserData;
10970 ctx.
Write(destination_entity);
10972 ctx.
Write(slot_id);
10974 }
10975 }
10976 else if (!
GetGame().IsMultiplayer())
10977 {
10979 }
10980 }
10981
10983 {
10985 return;
10986
10987 float split_quantity_new;
10991 InventoryLocation loc = new InventoryLocation;
10992
10993 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10994 {
10996 split_quantity_new = stack_max;
10997 else
10999
11000 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11001 if (new_item)
11002 {
11003 new_item.SetResultOfSplit(true);
11004 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11006 new_item.SetQuantity(split_quantity_new);
11007 }
11008 }
11009 else if (destination_entity && slot_id == -1)
11010 {
11011 if (quantity > stack_max)
11012 split_quantity_new = stack_max;
11013 else
11014 split_quantity_new = quantity;
11015
11017 {
11020 }
11021
11022 if (new_item)
11023 {
11024 new_item.SetResultOfSplit(true);
11025 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11027 new_item.SetQuantity(split_quantity_new);
11028 }
11029 }
11030 else
11031 {
11032 if (stack_max != 0)
11033 {
11035 {
11037 }
11038
11039 if (split_quantity_new == 0)
11040 {
11041 if (!
GetGame().IsMultiplayer())
11042 player.PhysicalPredictiveDropItem(this);
11043 else
11044 player.ServerDropEntity(this);
11045 return;
11046 }
11047
11049
11050 if (new_item)
11051 {
11052 new_item.SetResultOfSplit(true);
11053 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11055 new_item.SetQuantity(stack_max);
11056 new_item.PlaceOnSurface();
11057 }
11058 }
11059 }
11060 }
11061
11063 {
11065 return;
11066
11067 float split_quantity_new;
11071 InventoryLocation loc = new InventoryLocation;
11072
11073 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11074 {
11076 split_quantity_new = stack_max;
11077 else
11079
11080 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11081 if (new_item)
11082 {
11083 new_item.SetResultOfSplit(true);
11084 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11086 new_item.SetQuantity(split_quantity_new);
11087 }
11088 }
11089 else if (destination_entity && slot_id == -1)
11090 {
11091 if (quantity > stack_max)
11092 split_quantity_new = stack_max;
11093 else
11094 split_quantity_new = quantity;
11095
11097 {
11100 }
11101
11102 if (new_item)
11103 {
11104 new_item.SetResultOfSplit(true);
11105 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11107 new_item.SetQuantity(split_quantity_new);
11108 }
11109 }
11110 else
11111 {
11112 if (stack_max != 0)
11113 {
11115 {
11117 }
11118
11120
11121 if (new_item)
11122 {
11123 new_item.SetResultOfSplit(true);
11124 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11126 new_item.SetQuantity(stack_max);
11127 new_item.PlaceOnSurface();
11128 }
11129 }
11130 }
11131 }
11132
11134 {
11136 return;
11137
11139 {
11140 if (ScriptInputUserData.CanStoreInputUserData())
11141 {
11142 ScriptInputUserData ctx = new ScriptInputUserData;
11147 dst.WriteToContext(ctx);
11149 }
11150 }
11151 else if (!
GetGame().IsMultiplayer())
11152 {
11154 }
11155 }
11156
11158 {
11160 return;
11161
11163 {
11164 if (ScriptInputUserData.CanStoreInputUserData())
11165 {
11166 ScriptInputUserData ctx = new ScriptInputUserData;
11171 ctx.
Write(destination_entity);
11177 }
11178 }
11179 else if (!
GetGame().IsMultiplayer())
11180 {
11182 }
11183 }
11184
11186 {
11188 }
11189
11191 {
11193 return this;
11194
11196 float split_quantity_new;
11198 if (dst.IsValid())
11199 {
11200 int slot_id = dst.GetSlot();
11202
11203 if (quantity > stack_max)
11204 split_quantity_new = stack_max;
11205 else
11206 split_quantity_new = quantity;
11207
11209
11210 if (new_item)
11211 {
11212 new_item.SetResultOfSplit(true);
11213 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11216 }
11217
11218 return new_item;
11219 }
11220
11221 return null;
11222 }
11223
11225 {
11227 return;
11228
11230 float split_quantity_new;
11232 if (destination_entity)
11233 {
11235 if (quantity > stackable)
11236 split_quantity_new = stackable;
11237 else
11238 split_quantity_new = quantity;
11239
11240 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11241 if (new_item)
11242 {
11243 new_item.SetResultOfSplit(true);
11244 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11246 new_item.SetQuantity(split_quantity_new);
11247 }
11248 }
11249 }
11250
11252 {
11254 return;
11255
11257 {
11258 if (ScriptInputUserData.CanStoreInputUserData())
11259 {
11260 ScriptInputUserData ctx = new ScriptInputUserData;
11265 ItemBase destination_entity =
this;
11266 ctx.
Write(destination_entity);
11270 }
11271 }
11272 else if (!
GetGame().IsMultiplayer())
11273 {
11275 }
11276 }
11277
11279 {
11281 return;
11282
11284 float split_quantity_new;
11286 if (player)
11287 {
11289 if (quantity > stackable)
11290 split_quantity_new = stackable;
11291 else
11292 split_quantity_new = quantity;
11293
11294 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11295 new_item =
ItemBase.Cast(in_hands);
11296 if (new_item)
11297 {
11298 new_item.SetResultOfSplit(true);
11299 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11301 new_item.SetQuantity(split_quantity_new);
11302 }
11303 }
11304 }
11305
11307 {
11309 return;
11310
11312 float split_quantity_new = Math.Floor(quantity * 0.5);
11313
11315
11316 if (new_item)
11317 {
11318 if (new_item.GetQuantityMax() < split_quantity_new)
11319 {
11320 split_quantity_new = new_item.GetQuantityMax();
11321 }
11322
11323 new_item.SetResultOfSplit(true);
11324 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11325
11327 {
11330 }
11331 else
11332 {
11335 }
11336 }
11337 }
11338
11340 {
11342 return;
11343
11345 float split_quantity_new = Math.Floor(quantity / 2);
11346
11347 InventoryLocation invloc = new InventoryLocation;
11349
11351 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11352
11353 if (new_item)
11354 {
11355 if (new_item.GetQuantityMax() < split_quantity_new)
11356 {
11357 split_quantity_new = new_item.GetQuantityMax();
11358 }
11360 {
11363 }
11364 else
11365 {
11368 }
11369 }
11370 }
11371
11374 {
11375 SetWeightDirty();
11377
11378 if (parent)
11379 parent.OnAttachmentQuantityChangedEx(this, delta);
11380
11382 {
11384 {
11386 }
11388 {
11389 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11391 }
11392 }
11393
11394 }
11395
11398 {
11399
11400 }
11401
11404 {
11406 }
11407
11409 {
11410 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11411
11413 {
11414 if (newLevel == GameConstants.STATE_RUINED)
11415 {
11417 EntityAI parent = GetHierarchyParent();
11418 if (parent && parent.IsFireplace())
11419 {
11420 CargoBase cargo = GetInventory().GetCargo();
11421 if (cargo)
11422 {
11424 {
11426 }
11427 }
11428 }
11429 }
11430
11432 {
11433
11435 return;
11436 }
11437
11438 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11439 {
11441 }
11442 }
11443 }
11444
11445
11447 {
11448 super.OnRightClick();
11449
11451 {
11453 {
11454 if (ScriptInputUserData.CanStoreInputUserData())
11455 {
11456 vector m4[4];
11458
11459 EntityAI root = GetHierarchyRoot();
11460
11461 InventoryLocation dst = new InventoryLocation;
11463 {
11464 if (root)
11465 {
11466 root.GetTransform(m4);
11468 }
11469 else
11470 GetInventory().GetCurrentInventoryLocation(dst);
11471 }
11472 else
11473 {
11475
11476
11477 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11478 {
11479 if (root)
11480 {
11481 root.GetTransform(m4);
11483 }
11484 else
11485 GetInventory().GetCurrentInventoryLocation(dst);
11486 }
11487 else
11488 {
11489 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11490 }
11491 }
11492
11493 ScriptInputUserData ctx = new ScriptInputUserData;
11501 }
11502 }
11503 else if (!
GetGame().IsMultiplayer())
11504 {
11506 }
11507 }
11508 }
11509
11510 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11511 {
11512
11513 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11514 return false;
11515
11516 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11517 return false;
11518
11519
11521 return false;
11522
11523
11524 Magazine mag = Magazine.Cast(this);
11525 if (mag)
11526 {
11527 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11528 return false;
11529
11530 if (stack_max_limit)
11531 {
11532 Magazine other_mag = Magazine.Cast(other_item);
11533 if (other_item)
11534 {
11535 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11536 return false;
11537 }
11538
11539 }
11540 }
11541 else
11542 {
11543
11545 return false;
11546
11548 return false;
11549 }
11550
11551 PlayerBase player = null;
11552 if (CastTo(player, GetHierarchyRootPlayer()))
11553 {
11554 if (player.GetInventory().HasAttachment(this))
11555 return false;
11556
11557 if (player.IsItemsToDelete())
11558 return false;
11559 }
11560
11561 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11562 return false;
11563
11564 int slotID;
11566 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11567 return false;
11568
11569 return true;
11570 }
11571
11573 {
11575 }
11576
11578 {
11579 return m_IsResultOfSplit;
11580 }
11581
11583 {
11584 m_IsResultOfSplit = value;
11585 }
11586
11588 {
11590 }
11591
11593 {
11594 float other_item_quantity = other_item.GetQuantity();
11595 float this_free_space;
11596
11598
11600
11601 if (other_item_quantity > this_free_space)
11602 {
11603 return this_free_space;
11604 }
11605 else
11606 {
11607 return other_item_quantity;
11608 }
11609 }
11610
11612 {
11614 }
11615
11617 {
11619 return;
11620
11621 if (!IsMagazine() && other_item)
11622 {
11624 if (quantity_used != 0)
11625 {
11626 float hp1 = GetHealth01("","");
11627 float hp2 = other_item.GetHealth01("","");
11628 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11629 hpResult = hpResult / (
GetQuantity() + quantity_used);
11630
11631 hpResult *= GetMaxHealth();
11632 Math.Round(hpResult);
11633 SetHealth("", "Health", hpResult);
11634
11636 other_item.AddQuantity(-quantity_used);
11637 }
11638 }
11640 }
11641
11643 {
11644 #ifdef SERVER
11645 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11646 GetHierarchyParent().IncreaseLifetimeUp();
11647 #endif
11648 };
11649
11651 {
11652 PlayerBase p = PlayerBase.Cast(player);
11653
11654 array<int> recipesIds = p.m_Recipes;
11655 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11656 if (moduleRecipesManager)
11657 {
11658 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11659 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11660 }
11661
11662 for (int i = 0;i < recipesIds.Count(); i++)
11663 {
11664 int key = recipesIds.Get(i);
11665 string recipeName = moduleRecipesManager.GetRecipeName(key);
11667 }
11668 }
11669
11670
11671 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11672 {
11673 super.GetDebugActions(outputList);
11674
11675
11680
11681
11685
11689
11690
11693
11694
11696 {
11699 }
11700
11702
11705
11709 }
11710
11711
11712
11713
11715 {
11716 super.OnAction(action_id, player, ctx);
11717 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11718 {
11719 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11720 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11721 PlayerBase p = PlayerBase.Cast(player);
11722 if (
EActions.RECIPES_RANGE_START < 1000)
11723 {
11724 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11725 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11726 }
11727 }
11728 #ifndef SERVER
11729 else if (action_id ==
EActions.WATCH_PLAYER)
11730 {
11731 PluginDeveloper.SetDeveloperItemClientEx(player);
11732 }
11733 #endif
11735 {
11736 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11737 {
11738 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11739 OnDebugButtonPressServer(id + 1);
11740 }
11741
11742 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11743 {
11744 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11746 }
11747
11748 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11749 {
11750 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11752 }
11753
11754 else if (action_id ==
EActions.ADD_QUANTITY)
11755 {
11756 if (IsMagazine())
11757 {
11758 Magazine mag = Magazine.Cast(this);
11759 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11760 }
11761 else
11762 {
11764 }
11765
11766 if (m_EM)
11767 {
11768 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11769 }
11770
11771 }
11772
11773 else if (action_id ==
EActions.REMOVE_QUANTITY)
11774 {
11775 if (IsMagazine())
11776 {
11777 Magazine mag2 = Magazine.Cast(this);
11778 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11779 }
11780 else
11781 {
11783 }
11784 if (m_EM)
11785 {
11786 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11787 }
11788
11789 }
11790
11791 else if (action_id ==
EActions.SET_QUANTITY_0)
11792 {
11794
11795 if (m_EM)
11796 {
11797 m_EM.SetEnergy(0);
11798 }
11799 }
11800
11801 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11802 {
11804
11805 if (m_EM)
11806 {
11807 m_EM.SetEnergy(m_EM.GetEnergyMax());
11808 }
11809 }
11810
11811 else if (action_id ==
EActions.ADD_HEALTH)
11812 {
11813 AddHealth("","",GetMaxHealth("","Health")/5);
11814 }
11815 else if (action_id ==
EActions.REMOVE_HEALTH)
11816 {
11817 AddHealth("","",-GetMaxHealth("","Health")/5);
11818 }
11819 else if (action_id ==
EActions.DESTROY_HEALTH)
11820 {
11821 SetHealth01("","",0);
11822 }
11823 else if (action_id ==
EActions.WATCH_ITEM)
11824 {
11826 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11827 #ifdef DEVELOPER
11828 SetDebugDeveloper_item(this);
11829 #endif
11830 }
11831
11832 else if (action_id ==
EActions.ADD_TEMPERATURE)
11833 {
11834 AddTemperature(20);
11835
11836 }
11837
11838 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11839 {
11840 AddTemperature(-20);
11841
11842 }
11843
11844 else if (action_id ==
EActions.FLIP_FROZEN)
11845 {
11846 SetFrozen(!GetIsFrozen());
11847
11848 }
11849
11850 else if (action_id ==
EActions.ADD_WETNESS)
11851 {
11853
11854 }
11855
11856 else if (action_id ==
EActions.REMOVE_WETNESS)
11857 {
11859
11860 }
11861
11862 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11863 {
11866
11867
11868 }
11869
11870 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11871 {
11874 }
11875
11876 else if (action_id ==
EActions.MAKE_SPECIAL)
11877 {
11878 auto debugParams = DebugSpawnParams.WithPlayer(player);
11879 OnDebugSpawnEx(debugParams);
11880 }
11881
11882 else if (action_id ==
EActions.DELETE)
11883 {
11884 Delete();
11885 }
11886
11887 }
11888
11889
11890 return false;
11891 }
11892
11893
11894
11895
11899
11902
11903
11904
11906 {
11907 return false;
11908 }
11909
11910
11912 {
11913 return true;
11914 }
11915
11916
11918 {
11919 return true;
11920 }
11921
11922
11923
11925 {
11926 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11928 }
11929
11932 {
11933 return null;
11934 }
11935
11937 {
11938 return false;
11939 }
11940
11942 {
11943 return false;
11944 }
11945
11949
11950
11952 {
11953 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11954 return module_repairing.CanRepair(this, item_repair_kit);
11955 }
11956
11957
11958 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11959 {
11960 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11961 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11962 }
11963
11964
11966 {
11967
11968
11969
11970
11971
11972
11973
11974
11975 return 1;
11976 }
11977
11978
11979
11981 {
11983 }
11984
11985
11986
11988 {
11990 }
11991
11992
12001 {
12002 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12003
12004 if (player)
12005 {
12006 player.MessageStatus(text);
12007 }
12008 }
12009
12010
12019 {
12020 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12021
12022 if (player)
12023 {
12024 player.MessageAction(text);
12025 }
12026 }
12027
12028
12037 {
12038 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12039
12040 if (player)
12041 {
12042 player.MessageFriendly(text);
12043 }
12044 }
12045
12046
12055 {
12056 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12057
12058 if (player)
12059 {
12060 player.MessageImportant(text);
12061 }
12062 }
12063
12065 {
12066 return true;
12067 }
12068
12069
12070 override bool KindOf(
string tag)
12071 {
12072 bool found = false;
12073 string item_name = this.
GetType();
12076
12077 int array_size = item_tag_array.Count();
12078 for (int i = 0; i < array_size; i++)
12079 {
12080 if (item_tag_array.Get(i) == tag)
12081 {
12082 found = true;
12083 break;
12084 }
12085 }
12086 return found;
12087 }
12088
12089
12091 {
12092
12093 super.OnRPC(sender, rpc_type,ctx);
12094
12095
12096 switch (rpc_type)
12097 {
12098 #ifndef SERVER
12099 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12100 Param2<bool, string> p = new Param2<bool, string>(false, "");
12101
12103 return;
12104
12105 bool play = p.param1;
12106 string soundSet = p.param2;
12107
12108 if (play)
12109 {
12111 {
12113 {
12115 }
12116 }
12117 else
12118 {
12120 }
12121 }
12122 else
12123 {
12125 }
12126
12127 break;
12128 #endif
12129
12130 }
12131
12133 {
12135 }
12136 }
12137
12138
12139
12140
12142 {
12143 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12144 return plugin.GetID(
name);
12145 }
12146
12148 {
12149 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12150 return plugin.GetName(id);
12151 }
12152
12155 {
12156
12157
12158 int varFlags;
12159 if (!ctx.
Read(varFlags))
12160 return;
12161
12162 if (varFlags & ItemVariableFlags.FLOAT)
12163 {
12165 }
12166 }
12167
12169 {
12170
12171 super.SerializeNumericalVars(floats_out);
12172
12173
12174
12176 {
12178 }
12179
12181 {
12183 }
12184
12186 {
12188 }
12189
12191 {
12196 }
12197
12199 {
12201 }
12202 }
12203
12205 {
12206
12207 super.DeSerializeNumericalVars(floats);
12208
12209
12210 int index = 0;
12211 int mask = Math.Round(floats.Get(index));
12212
12213 index++;
12214
12216 {
12218 {
12220 }
12221 else
12222 {
12223 float quantity = floats.Get(index);
12224 SetQuantity(quantity,
true,
false,
false,
false);
12225 }
12226 index++;
12227 }
12228
12230 {
12231 float wet = floats.Get(index);
12233 index++;
12234 }
12235
12237 {
12238 int liquidtype = Math.Round(floats.Get(index));
12240 index++;
12241 }
12242
12244 {
12246 index++;
12248 index++;
12250 index++;
12252 index++;
12253 }
12254
12256 {
12257 int cleanness = Math.Round(floats.Get(index));
12259 index++;
12260 }
12261 }
12262
12264 {
12265 super.WriteVarsToCTX(ctx);
12266
12267
12269 {
12271 }
12272
12274 {
12276 }
12277
12279 {
12281 }
12282
12284 {
12285 int r,g,b,a;
12291 }
12292
12294 {
12296 }
12297 }
12298
12300 {
12301 if (!super.ReadVarsFromCTX(ctx,version))
12302 return false;
12303
12304 int intValue;
12305 float value;
12306
12307 if (version < 140)
12308 {
12309 if (!ctx.
Read(intValue))
12310 return false;
12311
12312 m_VariablesMask = intValue;
12313 }
12314
12316 {
12317 if (!ctx.
Read(value))
12318 return false;
12319
12321 {
12323 }
12324 else
12325 {
12327 }
12328 }
12329
12330 if (version < 140)
12331 {
12333 {
12334 if (!ctx.
Read(value))
12335 return false;
12336 SetTemperatureDirect(value);
12337 }
12338 }
12339
12341 {
12342 if (!ctx.
Read(value))
12343 return false;
12345 }
12346
12348 {
12349 if (!ctx.
Read(intValue))
12350 return false;
12352 }
12353
12355 {
12356 int r,g,b,a;
12358 return false;
12360 return false;
12362 return false;
12364 return false;
12365
12367 }
12368
12370 {
12371 if (!ctx.
Read(intValue))
12372 return false;
12374 }
12375
12376 if (version >= 138 && version < 140)
12377 {
12379 {
12380 if (!ctx.
Read(intValue))
12381 return false;
12382 SetFrozen(intValue);
12383 }
12384 }
12385
12386 return true;
12387 }
12388
12389
12391 {
12394 {
12396 }
12397
12398 if (!super.OnStoreLoad(ctx, version))
12399 {
12401 return false;
12402 }
12403
12404 if (version >= 114)
12405 {
12406 bool hasQuickBarIndexSaved;
12407
12408 if (!ctx.
Read(hasQuickBarIndexSaved))
12409 {
12411 return false;
12412 }
12413
12414 if (hasQuickBarIndexSaved)
12415 {
12416 int itmQBIndex;
12417
12418
12419 if (!ctx.
Read(itmQBIndex))
12420 {
12422 return false;
12423 }
12424
12425 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12426 if (itmQBIndex != -1 && parentPlayer)
12427 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12428 }
12429 }
12430 else
12431 {
12432
12433 PlayerBase player;
12434 int itemQBIndex;
12435 if (version ==
int.
MAX)
12436 {
12437 if (!ctx.
Read(itemQBIndex))
12438 {
12440 return false;
12441 }
12442 }
12443 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12444 {
12445
12446 if (!ctx.
Read(itemQBIndex))
12447 {
12449 return false;
12450 }
12451 if (itemQBIndex != -1 && player)
12452 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12453 }
12454 }
12455
12456 if (version < 140)
12457 {
12458
12459 if (!LoadVariables(ctx, version))
12460 {
12462 return false;
12463 }
12464 }
12465
12466
12468 {
12470 return false;
12471 }
12472 if (version >= 132)
12473 {
12475 if (raib)
12476 {
12478 {
12480 return false;
12481 }
12482 }
12483 }
12484
12486 return true;
12487 }
12488
12489
12490
12492 {
12493 super.OnStoreSave(ctx);
12494
12495 PlayerBase player;
12496 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12497 {
12499
12500 int itemQBIndex = -1;
12501 itemQBIndex = player.FindQuickBarEntityIndex(this);
12502 ctx.
Write(itemQBIndex);
12503 }
12504 else
12505 {
12507 }
12508
12510
12512 if (raib)
12513 {
12515 }
12516 }
12517
12518
12520 {
12521 super.AfterStoreLoad();
12522
12524 {
12526 }
12527
12529 {
12532 }
12533 }
12534
12536 {
12537 super.EEOnAfterLoad();
12538
12540 {
12542 }
12543
12546 }
12547
12549 {
12550 return false;
12551 }
12552
12553
12554
12556 {
12558 {
12559 #ifdef PLATFORM_CONSOLE
12560
12562 {
12564 if (menu)
12565 {
12567 }
12568 }
12569 #endif
12570 }
12571
12573 {
12576 }
12577
12579 {
12580 SetWeightDirty();
12582 }
12584 {
12587 }
12588
12590 {
12593 }
12595 {
12598 }
12599
12600 super.OnVariablesSynchronized();
12601 }
12602
12603
12604
12606 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12607 {
12608 if (!IsServerCheck(allow_client))
12609 return false;
12610
12612 return false;
12613
12616
12617 if (value <= (min + 0.001))
12618 value = min;
12619
12620 if (value == min)
12621 {
12622 if (destroy_config)
12623 {
12624 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12625 if (dstr)
12626 {
12628 this.Delete();
12629 return true;
12630 }
12631 }
12632 else if (destroy_forced)
12633 {
12635 this.Delete();
12636 return true;
12637 }
12638
12640 }
12641
12644
12646 {
12648
12649 if (delta)
12651 }
12652
12654
12655 return false;
12656 }
12657
12658
12660 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12661 {
12663 }
12664
12666 {
12669 }
12670
12672 {
12675 }
12676
12679 {
12680 float value_clamped = Math.Clamp(value, 0, 1);
12682 SetQuantity(result, destroy_config, destroy_forced);
12683 }
12684
12685
12688 {
12690 }
12691
12693 {
12695 }
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12707 {
12708 int slot = -1;
12709 if (GetInventory())
12710 {
12711 InventoryLocation il = new InventoryLocation;
12712 GetInventory().GetCurrentInventoryLocation(il);
12714 }
12715
12717 }
12718
12720 {
12721 float quantity_max = 0;
12722
12724 {
12725 if (attSlotID != -1)
12726 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12727
12728 if (quantity_max <= 0)
12730 }
12731
12732 if (quantity_max <= 0)
12734
12735 return quantity_max;
12736 }
12737
12739 {
12741 }
12742
12744 {
12746 }
12747
12748
12750 {
12752 }
12753
12755 {
12757 }
12758
12760 {
12762 }
12763
12764
12766 {
12767
12768 float weightEx = GetWeightEx();
12769 float special = GetInventoryAndCargoWeight();
12770 return weightEx - special;
12771 }
12772
12773
12775 {
12777 }
12778
12780 {
12782 {
12783 #ifdef DEVELOPER
12784 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12785 {
12786 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12788 }
12789 #endif
12790
12791 return GetQuantity() * GetConfigWeightModified();
12792 }
12793 else if (HasEnergyManager())
12794 {
12795 #ifdef DEVELOPER
12796 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12797 {
12798 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12799 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12800 }
12801 #endif
12802 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12803 }
12804 else
12805 {
12806 #ifdef DEVELOPER
12807 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12808 {
12809 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12810 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12811 }
12812 #endif
12813 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12814 }
12815 }
12816
12819 {
12820 int item_count = 0;
12822
12823 if (GetInventory().GetCargo() != NULL)
12824 {
12825 item_count = GetInventory().GetCargo().GetItemCount();
12826 }
12827
12828 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12829 {
12830 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12831 if (item)
12832 item_count += item.GetNumberOfItems();
12833 }
12834 return item_count;
12835 }
12836
12839 {
12840 float weight = 0;
12841 float wetness = 1;
12842 if (include_wetness)
12845 {
12846 weight = wetness * m_ConfigWeight;
12847 }
12849 {
12850 weight = 1;
12851 }
12852 return weight;
12853 }
12854
12855
12856
12858 {
12859 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12860 {
12861 GameInventory inv = GetInventory();
12862 array<EntityAI> items = new array<EntityAI>;
12864 for (int i = 0; i < items.Count(); i++)
12865 {
12867 if (item)
12868 {
12870 }
12871 }
12872 }
12873 }
12874
12875
12876
12877
12879 {
12880 float energy = 0;
12881 if (HasEnergyManager())
12882 {
12883 energy = GetCompEM().GetEnergy();
12884 }
12885 return energy;
12886 }
12887
12888
12890 {
12891 super.OnEnergyConsumed();
12892
12894 }
12895
12897 {
12898 super.OnEnergyAdded();
12899
12901 }
12902
12903
12905 {
12906 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12907 {
12909 {
12910 float energy_0to1 = GetCompEM().GetEnergy0To1();
12912 }
12913 }
12914 }
12915
12916
12918 {
12919 return ConfigGetFloat("heatIsolation");
12920 }
12921
12923 {
12925 }
12926
12928 {
12929 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12930 if (
GetGame().ConfigIsExisting(paramPath))
12932
12933 return 0.0;
12934 }
12935
12937 {
12938 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12939 if (
GetGame().ConfigIsExisting(paramPath))
12941
12942 return 0.0;
12943 }
12944
12945 override void SetWet(
float value,
bool allow_client =
false)
12946 {
12947 if (!IsServerCheck(allow_client))
12948 return;
12949
12952
12954
12955 m_VarWet = Math.Clamp(value, min, max);
12956
12958 {
12961 }
12962 }
12963
12964 override void AddWet(
float value)
12965 {
12967 }
12968
12970 {
12972 }
12973
12975 {
12977 }
12978
12980 {
12982 }
12983
12985 {
12987 }
12988
12990 {
12992 }
12993
12994 override void OnWetChanged(
float newVal,
float oldVal)
12995 {
12998 if (newLevel != oldLevel)
12999 {
13001 }
13002 }
13003
13005 {
13006 SetWeightDirty();
13007 }
13008
13010 {
13011 return GetWetLevelInternal(
m_VarWet);
13012 }
13013
13014
13015
13017 {
13019 }
13020
13022 {
13024 }
13025
13027 {
13029 }
13030
13032 {
13034 }
13035
13036
13037
13039 {
13040 if (ConfigIsExisting("itemModelLength"))
13041 {
13042 return ConfigGetFloat("itemModelLength");
13043 }
13044 return 0;
13045 }
13046
13048 {
13049 if (ConfigIsExisting("itemAttachOffset"))
13050 {
13051 return ConfigGetFloat("itemAttachOffset");
13052 }
13053 return 0;
13054 }
13055
13056 override void SetCleanness(
int value,
bool allow_client =
false)
13057 {
13058 if (!IsServerCheck(allow_client))
13059 return;
13060
13062
13064
13067 }
13068
13070 {
13072 }
13073
13075 {
13076 return true;
13077 }
13078
13079
13080
13081
13083 {
13085 }
13086
13088 {
13090 }
13091
13092
13093
13094
13095 override void SetColor(
int r,
int g,
int b,
int a)
13096 {
13102 }
13104 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13105 {
13110 }
13111
13113 {
13115 }
13116
13119 {
13120 int r,g,b,a;
13122 r = r/255;
13123 g = g/255;
13124 b = b/255;
13125 a = a/255;
13126 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13127 }
13128
13129
13130
13131 override void SetLiquidType(
int value,
bool allow_client =
false)
13132 {
13133 if (!IsServerCheck(allow_client))
13134 return;
13135
13140 }
13141
13143 {
13144 return ConfigGetInt("varLiquidTypeInit");
13145 }
13146
13148 {
13150 }
13151
13153 {
13155 SetFrozen(false);
13156 }
13157
13160 {
13161 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13162 }
13163
13164
13167 {
13168 PlayerBase nplayer;
13169 if (PlayerBase.CastTo(nplayer, player))
13170 {
13172
13173 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13174 }
13175 }
13176
13177
13180 {
13181 PlayerBase nplayer;
13182 if (PlayerBase.CastTo(nplayer,player))
13183 {
13184
13185 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13186
13187 }
13188
13189
13190 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13191
13192
13193 if (HasEnergyManager())
13194 {
13195 GetCompEM().UpdatePlugState();
13196 }
13197 }
13198
13199
13201 {
13202 super.OnPlacementStarted(player);
13203
13205 }
13206
13207 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13208 {
13210 {
13211 m_AdminLog.OnPlacementComplete(player,
this);
13212 }
13213
13214 super.OnPlacementComplete(player, position, orientation);
13215 }
13216
13217
13218
13219
13220
13222 {
13224 {
13225 return true;
13226 }
13227 else
13228 {
13229 return false;
13230 }
13231 }
13232
13233
13235 {
13237 {
13239 }
13240 }
13241
13242
13244 {
13246 }
13247
13249 {
13251 }
13252
13253 override void InsertAgent(
int agent,
float count = 1)
13254 {
13255 if (count < 1)
13256 return;
13257
13259 }
13260
13263 {
13265 }
13266
13267
13269 {
13271 }
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13315 {
13317 return false;
13318 return true;
13319 }
13320
13322 {
13323
13325 }
13326
13327
13330 {
13331 super.CheckForRoofLimited(timeTresholdMS);
13332
13334 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13335 {
13336 m_PreviousRoofTestTime = time;
13337 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13338 }
13339 }
13340
13341
13343 {
13345 {
13346 return 0;
13347 }
13348
13349 if (GetInventory().GetAttachmentSlotsCount() != 0)
13350 {
13351 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13352 if (filter)
13353 return filter.GetProtectionLevel(type, false, system);
13354 else
13355 return 0;
13356 }
13357
13358 string subclassPath, entryName;
13359
13360 switch (type)
13361 {
13363 entryName = "biological";
13364 break;
13366 entryName = "chemical";
13367 break;
13368 default:
13369 entryName = "biological";
13370 break;
13371 }
13372
13373 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13374
13376 }
13377
13378
13379
13382 {
13383 if (!IsMagazine())
13385
13387 }
13388
13389
13390
13391
13392
13397 {
13398 return true;
13399 }
13400
13402 {
13404 }
13405
13406
13407
13408
13409
13411 {
13412 if (parent)
13413 {
13414 if (parent.IsInherited(DayZInfected))
13415 return true;
13416
13417 if (!parent.IsRuined())
13418 return true;
13419 }
13420
13421 return true;
13422 }
13423
13425 {
13426 if (!super.CanPutAsAttachment(parent))
13427 {
13428 return false;
13429 }
13430
13431 if (!IsRuined() && !parent.IsRuined())
13432 {
13433 return true;
13434 }
13435
13436 return false;
13437 }
13438
13440 {
13441
13442
13443
13444
13445 return super.CanReceiveItemIntoCargo(item);
13446 }
13447
13449 {
13450
13451
13452
13453
13454 GameInventory attachmentInv = attachment.GetInventory();
13456 {
13457 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13458 return false;
13459 }
13460
13461 InventoryLocation loc = new InventoryLocation();
13462 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13463 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13464 return false;
13465
13466 return super.CanReceiveAttachment(attachment, slotId);
13467 }
13468
13470 {
13471 if (!super.CanReleaseAttachment(attachment))
13472 return false;
13473
13474 return GetInventory().AreChildrenAccessible();
13475 }
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13498 {
13499 int id = muzzle_owner.GetMuzzleID();
13500 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13501
13502 if (WPOF_array)
13503 {
13504 for (int i = 0; i < WPOF_array.Count(); i++)
13505 {
13506 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13507
13508 if (WPOF)
13509 {
13510 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13511 }
13512 }
13513 }
13514 }
13515
13516
13518 {
13519 int id = muzzle_owner.GetMuzzleID();
13521
13522 if (WPOBE_array)
13523 {
13524 for (int i = 0; i < WPOBE_array.Count(); i++)
13525 {
13526 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13527
13528 if (WPOBE)
13529 {
13530 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13531 }
13532 }
13533 }
13534 }
13535
13536
13538 {
13539 int id = muzzle_owner.GetMuzzleID();
13540 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13541
13542 if (WPOOH_array)
13543 {
13544 for (int i = 0; i < WPOOH_array.Count(); i++)
13545 {
13546 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13547
13548 if (WPOOH)
13549 {
13550 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13551 }
13552 }
13553 }
13554 }
13555
13556
13558 {
13559 int id = muzzle_owner.GetMuzzleID();
13560 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13561
13562 if (WPOOH_array)
13563 {
13564 for (int i = 0; i < WPOOH_array.Count(); i++)
13565 {
13566 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13567
13568 if (WPOOH)
13569 {
13570 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13571 }
13572 }
13573 }
13574 }
13575
13576
13578 {
13579 int id = muzzle_owner.GetMuzzleID();
13580 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13581
13582 if (WPOOH_array)
13583 {
13584 for (int i = 0; i < WPOOH_array.Count(); i++)
13585 {
13586 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13587
13588 if (WPOOH)
13589 {
13590 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13591 }
13592 }
13593 }
13594 }
13595
13596
13597
13599 {
13601 {
13602 return true;
13603 }
13604
13605 return false;
13606 }
13607
13609 {
13611 {
13612 return true;
13613 }
13614
13615 return false;
13616 }
13617
13619 {
13621 {
13622 return true;
13623 }
13624
13625 return false;
13626 }
13627
13629 {
13630 return false;
13631 }
13632
13635 {
13636 return UATimeSpent.DEFAULT_DEPLOY;
13637 }
13638
13639
13640
13641
13643 {
13645 SetSynchDirty();
13646 }
13647
13649 {
13651 }
13652
13653
13655 {
13656 return false;
13657 }
13658
13661 {
13662 string att_type = "None";
13663
13664 if (ConfigIsExisting("soundAttType"))
13665 {
13666 att_type = ConfigGetString("soundAttType");
13667 }
13668
13670 }
13671
13673 {
13675 }
13676
13677
13678
13679
13680
13684
13686 {
13689
13691 }
13692
13693
13695 {
13697 return;
13698
13700
13703
13706
13707 SoundParameters params = new SoundParameters();
13711 }
13712
13713
13715 {
13717 return;
13718
13720 SetSynchDirty();
13721
13724 }
13725
13726
13728 {
13730 return;
13731
13733 SetSynchDirty();
13734
13737 }
13738
13740 {
13742 }
13743
13745 {
13747 }
13748
13751 {
13752 if (!
GetGame().IsDedicatedServer())
13753 {
13754 if (ConfigIsExisting("attachSoundSet"))
13755 {
13756 string cfg_path = "";
13757 string soundset = "";
13758 string type_name =
GetType();
13759
13762 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13763 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13764
13765 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13766 {
13767 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13768 {
13769 if (cfg_slot_array[i] == slot_type)
13770 {
13771 soundset = cfg_soundset_array[i];
13772 break;
13773 }
13774 }
13775 }
13776
13777 if (soundset != "")
13778 {
13779 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13781 }
13782 }
13783 }
13784 }
13785
13787 {
13788
13789 }
13790
13791 void OnApply(PlayerBase player);
13792
13794 {
13795 return 1.0;
13796 };
13797
13799 {
13801 }
13802
13804 {
13806 }
13807
13809
13811 {
13812 SetDynamicPhysicsLifeTime(0.01);
13814 }
13815
13817 {
13818 array<string> zone_names = new array<string>;
13819 GetDamageZones(zone_names);
13820 for (int i = 0; i < zone_names.Count(); i++)
13821 {
13822 SetHealthMax(zone_names.Get(i),"Health");
13823 }
13824 SetHealthMax("","Health");
13825 }
13826
13829 {
13830 float global_health = GetHealth01("","Health");
13831 array<string> zones = new array<string>;
13832 GetDamageZones(zones);
13833
13834 for (int i = 0; i < zones.Count(); i++)
13835 {
13836 SetHealth01(zones.Get(i),"Health",global_health);
13837 }
13838 }
13839
13842 {
13843 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13844 }
13845
13847 {
13848 if (!hasRootAsPlayer)
13849 {
13850 if (refParentIB)
13851 {
13852
13853 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13854 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13855
13856 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13857 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13858
13861 }
13862 else
13863 {
13864
13867 }
13868 }
13869 }
13870
13872 {
13874 {
13875 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13876 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13877 {
13878 float heatPermCoef = 1.0;
13880 while (ent)
13881 {
13882 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13883 ent = ent.GetHierarchyParent();
13884 }
13885
13886 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13887 }
13888 }
13889 }
13890
13892 {
13893
13894 EntityAI parent = GetHierarchyParent();
13895 if (!parent)
13896 {
13897 hasParent = false;
13898 hasRootAsPlayer = false;
13899 }
13900 else
13901 {
13902 hasParent = true;
13903 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13904 refParentIB =
ItemBase.Cast(parent);
13905 }
13906 }
13907
13908 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13909 {
13910
13911 }
13912
13914 {
13915
13916 return false;
13917 }
13918
13920 {
13921
13922
13923 return false;
13924 }
13925
13927 {
13928
13929 return false;
13930 }
13931
13934 {
13935 return !GetIsFrozen() &&
IsOpen();
13936 }
13937
13939 {
13940 bool hasParent = false, hasRootAsPlayer = false;
13942
13943 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13944 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13945
13946 if (wwtu || foodDecay)
13947 {
13951
13952 if (processWetness || processTemperature || processDecay)
13953 {
13955
13956 if (processWetness)
13957 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13958
13959 if (processTemperature)
13961
13962 if (processDecay)
13963 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13964 }
13965 }
13966 }
13967
13970 {
13972 }
13973
13975 {
13978
13979 return super.GetTemperatureFreezeThreshold();
13980 }
13981
13983 {
13986
13987 return super.GetTemperatureThawThreshold();
13988 }
13989
13991 {
13994
13995 return super.GetItemOverheatThreshold();
13996 }
13997
13999 {
14001 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14002
14003 return super.GetTemperatureFreezeTime();
14004 }
14005
14007 {
14009 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14010
14011 return super.GetTemperatureThawTime();
14012 }
14013
14018
14020 {
14021 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14022 }
14023
14025 {
14026 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14027 }
14028
14031 {
14033 }
14034
14036 {
14038 }
14039
14041 {
14043 }
14044
14047 {
14048 return null;
14049 }
14050
14053 {
14054 return false;
14055 }
14056
14058 {
14060 {
14063 if (!trg)
14064 {
14066 explosive = this;
14067 }
14068
14069 explosive.PairRemote(trg);
14071
14072 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14073 trg.SetPersistentPairID(persistentID);
14074 explosive.SetPersistentPairID(persistentID);
14075
14076 return true;
14077 }
14078 return false;
14079 }
14080
14083 {
14084 float ret = 1.0;
14087 ret *= GetHealth01();
14088
14089 return ret;
14090 }
14091
14092 #ifdef DEVELOPER
14093 override void SetDebugItem()
14094 {
14095 super.SetDebugItem();
14096 _itemBase = this;
14097 }
14098
14100 {
14101 string text = super.GetDebugText();
14102
14104 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14105
14106 return text;
14107 }
14108 #endif
14109
14111 {
14112 return true;
14113 }
14114
14116
14118
14120 {
14123 }
14124
14125
14133
14149}
14150
14152{
14154 if (entity)
14155 {
14156 bool is_item = entity.IsInherited(
ItemBase);
14157 if (is_item && full_quantity)
14158 {
14161 }
14162 }
14163 else
14164 {
14166 return NULL;
14167 }
14168 return entity;
14169}
14170
14172{
14173 if (item)
14174 {
14175 if (health > 0)
14176 item.SetHealth("", "", health);
14177
14178 if (item.CanHaveTemperature())
14179 {
14181 if (item.CanFreeze())
14182 item.SetFrozen(false);
14183 }
14184
14185 if (item.HasEnergyManager())
14186 {
14187 if (quantity >= 0)
14188 {
14189 item.GetCompEM().SetEnergy0To1(quantity);
14190 }
14191 else
14192 {
14194 }
14195 }
14196 else if (item.IsMagazine())
14197 {
14198 Magazine mag = Magazine.Cast(item);
14199 if (quantity >= 0)
14200 {
14201 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14202 }
14203 else
14204 {
14206 }
14207
14208 }
14209 else
14210 {
14211 if (quantity >= 0)
14212 {
14213 item.SetQuantityNormalized(quantity, false);
14214 }
14215 else
14216 {
14218 }
14219
14220 }
14221 }
14222}
14223
14224#ifdef DEVELOPER
14226#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.