9402{
9404 {
9405 return true;
9406 }
9407};
9408
9409
9410
9412{
9416
9418
9421
9422
9423
9424
9425
9434
9440
9445
9450
9471 protected bool m_IsResultOfSplit
9472
9474
9479
9480
9481
9483
9487
9488
9489
9491
9494
9495
9496
9502
9503
9511
9514
9515
9517
9518
9520
9521
9526
9527
9532
9533
9535
9536
9538 {
9543
9544 if (!
GetGame().IsDedicatedServer())
9545 {
9547 {
9549
9551 {
9553 }
9554 }
9555
9558 }
9559
9560 m_OldLocation = null;
9561
9563 {
9565 }
9566
9567 if (ConfigIsExisting("headSelectionsToHide"))
9568 {
9571 }
9572
9574 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9575 {
9577 }
9578
9580
9581 m_IsResultOfSplit = false;
9582
9584 }
9585
9587 {
9588 super.InitItemVariables();
9589
9595 m_Count = ConfigGetInt(
"count");
9596
9599
9604
9607
9612
9624
9628
9629
9632 if (ConfigIsExisting("canBeSplit"))
9633 {
9636 }
9637
9639 if (ConfigIsExisting("itemBehaviour"))
9641
9642
9645 RegisterNetSyncVariableInt("m_VarLiquidType");
9646 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9647
9648 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9649 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9650 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9651
9652 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9653 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9654 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9655 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9656
9657 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9658 RegisterNetSyncVariableBool("m_IsTakeable");
9659 RegisterNetSyncVariableBool("m_IsHologram");
9660
9663 {
9666 }
9667
9669
9671 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9673
9674 }
9675
9677 {
9679 }
9680
9682 {
9685 {
9690 }
9691 }
9692
9693 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9694 {
9696 {
9699 }
9700
9702 }
9703
9705 {
9711 }
9712
9714
9716 {
9718
9719 if (!action)
9720 {
9721 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9722 return;
9723 }
9724
9726 if (!ai)
9727 {
9729 return;
9730 }
9731
9733 if (!action_array)
9734 {
9735 action_array = new array<ActionBase_Basic>;
9737 }
9738 if (LogManager.IsActionLogEnable())
9739 {
9740 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9741 }
9742
9743 if (action_array.Find(action) != -1)
9744 {
9745 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9746 }
9747 else
9748 {
9749 action_array.Insert(action);
9750 }
9751 }
9752
9754 {
9756 ActionBase action = player.GetActionManager().GetAction(actionName);
9759
9760 if (action_array)
9761 {
9762 action_array.RemoveItem(action);
9763 }
9764 }
9765
9766
9767
9769 {
9770 ActionOverrideData overrideData = new ActionOverrideData();
9774
9776 if (!actionMap)
9777 {
9780 }
9781
9782 actionMap.Insert(this.
Type(), overrideData);
9783
9784 }
9785
9787
9789
9790
9792 {
9795
9798
9799 string config_to_search = "CfgVehicles";
9800 string muzzle_owner_config;
9801
9803 {
9804 if (IsInherited(Weapon))
9805 config_to_search = "CfgWeapons";
9806
9807 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9808
9809 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9810
9812
9813 if (config_OnFire_subclass_count > 0)
9814 {
9815 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9816
9817 for (int i = 0; i < config_OnFire_subclass_count; i++)
9818 {
9819 string particle_class = "";
9821 string config_OnFire_entry = config_OnFire_class + particle_class;
9822 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9823 WPOF_array.Insert(WPOF);
9824 }
9825
9826
9828 }
9829 }
9830
9832 {
9833 config_to_search = "CfgWeapons";
9834 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9835
9836 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9837
9839
9840 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9841 {
9842 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9843
9844 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9845 {
9846 string particle_class2 = "";
9848 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9849 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9850 WPOBE_array.Insert(WPOBE);
9851 }
9852
9853
9855 }
9856 }
9857 }
9858
9859
9861 {
9864
9866 {
9867 string config_to_search = "CfgVehicles";
9868
9869 if (IsInherited(Weapon))
9870 config_to_search = "CfgWeapons";
9871
9872 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9873 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9874
9875 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9876 {
9877
9879
9881 {
9883 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9885 return;
9886 }
9887
9890
9891
9892
9894 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9895
9896 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9897 {
9898 string particle_class = "";
9900 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9902
9903 if (entry_type == CT_CLASS)
9904 {
9905 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9906 WPOOH_array.Insert(WPOF);
9907 }
9908 }
9909
9910
9912 }
9913 }
9914 }
9915
9917 {
9919 }
9920
9922 {
9924 {
9926
9929
9932
9933 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9934 }
9935 }
9936
9938 {
9940 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9941
9943 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9944
9946 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9947
9949 {
9951 }
9952 }
9953
9955 {
9957 }
9958
9960 {
9963 else
9965
9967 {
9970 }
9971 else
9972 {
9975
9978 }
9979
9981 }
9982
9984 {
9986 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9987 }
9988
9990 {
9992 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9994 }
9995
9997 {
9999 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10000 }
10001
10003 {
10006
10007 OverheatingParticle OP = new OverheatingParticle();
10012
10014 }
10015
10017 {
10020
10021 return -1;
10022 }
10023
10025 {
10027 {
10030
10031 for (int i = count; i > 0; --i)
10032 {
10033 int id = i - 1;
10036
10039
10040 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10041 {
10042 if (p)
10043 {
10046 }
10047 }
10048 }
10049 }
10050 }
10051
10053 {
10055 {
10057 {
10058 int id = i - 1;
10060
10061 if (OP)
10062 {
10064
10065 if (p)
10066 {
10068 }
10069
10070 delete OP;
10071 }
10072 }
10073
10076 }
10077 }
10078
10081 {
10082 return 0.0;
10083 }
10084
10085
10087 {
10088 return 250;
10089 }
10090
10092 {
10093 return 0;
10094 }
10095
10098 {
10100 return true;
10101
10102 return false;
10103 }
10104
10107 {
10110
10112 {
10114 }
10115 else
10116 {
10117
10119 }
10120
10122 }
10123
10130 {
10131 return -1;
10132 }
10133
10134
10135
10136
10138 {
10140 {
10142 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10143
10144 if (r_index >= 0)
10145 {
10146 InventoryLocation r_il = new InventoryLocation;
10147 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10148
10149 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10152 {
10153 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10154 }
10156 {
10157 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10158 }
10159
10160 }
10161
10162 player.GetHumanInventory().ClearUserReservedLocation(this);
10163 }
10164
10167 }
10168
10169
10170
10171
10173 {
10174 return ItemBase.m_DebugActionsMask;
10175 }
10176
10178 {
10179 return ItemBase.m_DebugActionsMask & mask;
10180 }
10181
10183 {
10184 ItemBase.m_DebugActionsMask = mask;
10185 }
10186
10188 {
10189 ItemBase.m_DebugActionsMask |= mask;
10190 }
10191
10193 {
10194 ItemBase.m_DebugActionsMask &= ~mask;
10195 }
10196
10198 {
10200 {
10202 }
10203 else
10204 {
10206 }
10207 }
10208
10209
10211 {
10212 if (GetEconomyProfile())
10213 {
10214 float q_max = GetEconomyProfile().GetQuantityMax();
10215 if (q_max > 0)
10216 {
10217 float q_min = GetEconomyProfile().GetQuantityMin();
10218 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10219
10221 {
10222 ComponentEnergyManager comp = GetCompEM();
10224 {
10226 }
10227 }
10229 {
10231
10232 }
10233
10234 }
10235 }
10236 }
10237
10240 {
10241 EntityAI parent = GetHierarchyParent();
10242
10243 if (parent)
10244 {
10245 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10246 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10247 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10248 }
10249 }
10250
10253 {
10254 EntityAI parent = GetHierarchyParent();
10255
10256 if (parent)
10257 {
10258 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10259 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10260 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10261 }
10262 }
10263
10265 {
10266
10267
10268
10269
10271
10273 {
10274 if (ScriptInputUserData.CanStoreInputUserData())
10275 {
10276 ScriptInputUserData ctx = new ScriptInputUserData;
10282 ctx.
Write(use_stack_max);
10285
10287 {
10288 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10289 }
10290 }
10291 }
10292 else if (!
GetGame().IsMultiplayer())
10293 {
10295 }
10296 }
10297
10299 {
10301 }
10302
10304 {
10306 }
10307
10309 {
10311 }
10312
10314 {
10315
10316 return false;
10317 }
10318
10320 {
10321 return false;
10322 }
10323
10327 {
10328 return false;
10329 }
10330
10332 {
10333 return "";
10334 }
10335
10337
10339 {
10340 return false;
10341 }
10342
10344 {
10345 return true;
10346 }
10347
10348
10349
10351 {
10352 return true;
10353 }
10354
10356 {
10357 return true;
10358 }
10359
10361 {
10362 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10364 }
10365
10367 {
10369 }
10370
10372 {
10374 if (!is_being_placed)
10376 SetSynchDirty();
10377 }
10378
10379
10381
10383 {
10385 }
10386
10388 {
10390 }
10391
10393 {
10394 return 1;
10395 }
10396
10398 {
10399 return false;
10400 }
10401
10403 {
10405 SetSynchDirty();
10406 }
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10443 {
10444 super.OnMovedInsideCargo(container);
10445
10446 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10447 }
10448
10449 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10450 {
10451 super.EEItemLocationChanged(oldLoc,newLoc);
10452
10453 PlayerBase new_player = null;
10454 PlayerBase old_player = null;
10455
10456 if (newLoc.GetParent())
10457 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10458
10459 if (oldLoc.GetParent())
10460 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10461
10463 {
10464 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10465
10466 if (r_index >= 0)
10467 {
10468 InventoryLocation r_il = new InventoryLocation;
10469 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10470
10471 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10474 {
10475 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10476 }
10478 {
10479 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10480 }
10481
10482 }
10483 }
10484
10486 {
10487 if (new_player)
10488 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10489
10490 if (new_player == old_player)
10491 {
10492
10493 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10494 {
10496 {
10497 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10498 {
10499 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10500 }
10501 }
10502 else
10503 {
10504 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10505 }
10506 }
10507
10508 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10509 {
10510 int type = oldLoc.GetType();
10512 {
10513 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10514 }
10516 {
10517 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10518 }
10519 }
10520 if (!m_OldLocation)
10521 {
10522 m_OldLocation = new InventoryLocation;
10523 }
10524 m_OldLocation.Copy(oldLoc);
10525 }
10526 else
10527 {
10528 if (m_OldLocation)
10529 {
10530 m_OldLocation.Reset();
10531 }
10532 }
10533
10535 }
10536 else
10537 {
10538 if (new_player)
10539 {
10540 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10541 if (res_index >= 0)
10542 {
10543 InventoryLocation il = new InventoryLocation;
10544 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10546 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10549 {
10550 il.
GetParent().GetOnReleaseLock().Invoke(it);
10551 }
10553 {
10555 }
10556
10557 }
10558 }
10560 {
10561
10563 }
10564
10565 if (m_OldLocation)
10566 {
10567 m_OldLocation.Reset();
10568 }
10569 }
10570 }
10571
10572 override void EOnContact(IEntity other, Contact extra)
10573 {
10575 {
10576 int liquidType = -1;
10578 if (impactSpeed > 0.0)
10579 {
10581 #ifndef SERVER
10583 #else
10585 SetSynchDirty();
10586 #endif
10588 }
10589 }
10590
10591 #ifdef SERVER
10592 if (GetCompEM() && GetCompEM().IsPlugged())
10593 {
10594 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10595 GetCompEM().UnplugThis();
10596 }
10597 #endif
10598 }
10599
10601
10603 {
10605 }
10606
10608 {
10609
10610 }
10611
10613 {
10614 super.OnItemLocationChanged(old_owner, new_owner);
10615
10616 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10617 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10618
10619 if (!relatedPlayer && playerNew)
10620 relatedPlayer = playerNew;
10621
10622 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10623 {
10625 if (actionMgr)
10626 {
10627 ActionBase currentAction = actionMgr.GetRunningAction();
10628 if (currentAction)
10630 }
10631 }
10632
10633 Man ownerPlayerOld = null;
10634 Man ownerPlayerNew = null;
10635
10636 if (old_owner)
10637 {
10638 if (old_owner.
IsMan())
10639 {
10640 ownerPlayerOld = Man.Cast(old_owner);
10641 }
10642 else
10643 {
10644 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10645 }
10646 }
10647 else
10648 {
10650 {
10652
10653 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10654 {
10655 GetCompEM().UnplugThis();
10656 }
10657 }
10658 }
10659
10660 if (new_owner)
10661 {
10662 if (new_owner.
IsMan())
10663 {
10664 ownerPlayerNew = Man.Cast(new_owner);
10665 }
10666 else
10667 {
10668 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10669 }
10670 }
10671
10672 if (ownerPlayerOld != ownerPlayerNew)
10673 {
10674 if (ownerPlayerOld)
10675 {
10676 array<EntityAI> subItemsExit = new array<EntityAI>;
10678 for (int i = 0; i < subItemsExit.Count(); i++)
10679 {
10682 }
10683 }
10684
10685 if (ownerPlayerNew)
10686 {
10687 array<EntityAI> subItemsEnter = new array<EntityAI>;
10689 for (int j = 0; j < subItemsEnter.Count(); j++)
10690 {
10693 }
10694 }
10695 }
10696 else if (ownerPlayerNew != null)
10697 {
10698 PlayerBase nplayer;
10699 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10700 {
10701 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10703 for (int k = 0; k < subItemsUpdate.Count(); k++)
10704 {
10706 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10707 }
10708 }
10709 }
10710
10711 if (old_owner)
10712 old_owner.OnChildItemRemoved(this);
10713 if (new_owner)
10714 new_owner.OnChildItemReceived(this);
10715 }
10716
10717
10719 {
10720 super.EEDelete(parent);
10721 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10722 if (player)
10723 {
10725
10726 if (player.IsAlive())
10727 {
10728 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10729 if (r_index >= 0)
10730 {
10731 InventoryLocation r_il = new InventoryLocation;
10732 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10733
10734 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10737 {
10738 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10739 }
10741 {
10742 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10743 }
10744
10745 }
10746
10747 player.RemoveQuickBarEntityShortcut(this);
10748 }
10749 }
10750 }
10751
10753 {
10754 super.EEKilled(killer);
10755
10758 {
10759 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10760 {
10761 if (IsMagazine())
10762 {
10763 if (Magazine.Cast(this).GetAmmoCount() > 0)
10764 {
10766 }
10767 }
10768 else
10769 {
10771 }
10772 }
10773 }
10774 }
10775
10777 {
10778 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10779
10780 super.OnWasAttached(parent, slot_id);
10781
10784
10786 }
10787
10789 {
10790 super.OnWasDetached(parent, slot_id);
10791
10794 }
10795
10797 {
10798 int idx;
10801
10802 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10803 if (inventory_slots.Count() < 1)
10804 {
10805 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10806 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10807 }
10808 else
10809 {
10810 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10811 }
10812
10813 idx = inventory_slots.Find(slot);
10814 if (idx < 0)
10815 return "";
10816
10817 return attach_types.Get(idx);
10818 }
10819
10821 {
10822 int idx = -1;
10823 string slot;
10824
10827
10828 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10829 if (inventory_slots.Count() < 1)
10830 {
10831 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10832 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10833 }
10834 else
10835 {
10836 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10837 if (detach_types.Count() < 1)
10838 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10839 }
10840
10841 for (int i = 0; i < inventory_slots.Count(); i++)
10842 {
10843 slot = inventory_slots.Get(i);
10844 }
10845
10846 if (slot != "")
10847 {
10848 if (detach_types.Count() == 1)
10849 idx = 0;
10850 else
10851 idx = inventory_slots.Find(slot);
10852 }
10853 if (idx < 0)
10854 return "";
10855
10856 return detach_types.Get(idx);
10857 }
10858
10860 {
10861
10863
10864
10865 float min_time = 1;
10866 float max_time = 3;
10867 float delay = Math.RandomFloat(min_time, max_time);
10868
10869 explode_timer.Run(delay, this, "DoAmmoExplosion");
10870 }
10871
10873 {
10874 Magazine magazine = Magazine.Cast(this);
10875 int pop_sounds_count = 6;
10876 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10877
10878
10879 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10880 string sound_name = pop_sounds[ sound_idx ];
10882
10883
10884 magazine.ServerAddAmmoCount(-1);
10885
10886
10887 float min_temp_to_explode = 100;
10888
10889 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10890 {
10892 }
10893 }
10894
10895
10896 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10897 {
10898 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10899
10900 const int CHANCE_DAMAGE_CARGO = 4;
10901 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10902 const int CHANCE_DAMAGE_NOTHING = 2;
10903
10905 {
10906 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10907 int chances;
10908 int rnd;
10909
10910 if (GetInventory().GetCargo())
10911 {
10912 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10913 rnd = Math.RandomInt(0,chances);
10914
10915 if (rnd < CHANCE_DAMAGE_CARGO)
10916 {
10918 }
10919 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10920 {
10922 }
10923 }
10924 else
10925 {
10926 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10927 rnd = Math.RandomInt(0,chances);
10928
10929 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10930 {
10932 }
10933 }
10934 }
10935 }
10936
10938 {
10939 if (GetInventory().GetCargo())
10940 {
10941 int item_count = GetInventory().GetCargo().GetItemCount();
10942 if (item_count > 0)
10943 {
10944 int random_pick = Math.RandomInt(0, item_count);
10946 if (!item.IsExplosive())
10947 {
10948 item.AddHealth("","",damage);
10949 return true;
10950 }
10951 }
10952 }
10953 return false;
10954 }
10955
10957 {
10958 int attachment_count = GetInventory().AttachmentCount();
10959 if (attachment_count > 0)
10960 {
10961 int random_pick = Math.RandomInt(0, attachment_count);
10962 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10963 if (!attachment.IsExplosive())
10964 {
10965 attachment.AddHealth("","",damage);
10966 return true;
10967 }
10968 }
10969 return false;
10970 }
10971
10973 {
10975 }
10976
10978 {
10980 return GetInventory().CanRemoveEntity();
10981
10982 return false;
10983 }
10984
10986 {
10988 return;
10989
10991 {
10992 if (ScriptInputUserData.CanStoreInputUserData())
10993 {
10994 ScriptInputUserData ctx = new ScriptInputUserData;
10999 ctx.
Write(destination_entity);
11001 ctx.
Write(slot_id);
11003 }
11004 }
11005 else if (!
GetGame().IsMultiplayer())
11006 {
11008 }
11009 }
11010
11012 {
11014 return;
11015
11016 float split_quantity_new;
11020 InventoryLocation loc = new InventoryLocation;
11021
11022 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11023 {
11025 split_quantity_new = stack_max;
11026 else
11028
11029 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11030 if (new_item)
11031 {
11032 new_item.SetResultOfSplit(true);
11033 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11035 new_item.SetQuantity(split_quantity_new);
11036 }
11037 }
11038 else if (destination_entity && slot_id == -1)
11039 {
11040 if (quantity > stack_max)
11041 split_quantity_new = stack_max;
11042 else
11043 split_quantity_new = quantity;
11044
11046 {
11049 }
11050
11051 if (new_item)
11052 {
11053 new_item.SetResultOfSplit(true);
11054 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11056 new_item.SetQuantity(split_quantity_new);
11057 }
11058 }
11059 else
11060 {
11061 if (stack_max != 0)
11062 {
11064 {
11066 }
11067
11068 if (split_quantity_new == 0)
11069 {
11070 if (!
GetGame().IsMultiplayer())
11071 player.PhysicalPredictiveDropItem(this);
11072 else
11073 player.ServerDropEntity(this);
11074 return;
11075 }
11076
11078
11079 if (new_item)
11080 {
11081 new_item.SetResultOfSplit(true);
11082 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11084 new_item.SetQuantity(stack_max);
11085 new_item.PlaceOnSurface();
11086 }
11087 }
11088 }
11089 }
11090
11092 {
11094 return;
11095
11096 float split_quantity_new;
11100 InventoryLocation loc = new InventoryLocation;
11101
11102 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11103 {
11105 split_quantity_new = stack_max;
11106 else
11108
11109 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11110 if (new_item)
11111 {
11112 new_item.SetResultOfSplit(true);
11113 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11115 new_item.SetQuantity(split_quantity_new);
11116 }
11117 }
11118 else if (destination_entity && slot_id == -1)
11119 {
11120 if (quantity > stack_max)
11121 split_quantity_new = stack_max;
11122 else
11123 split_quantity_new = quantity;
11124
11126 {
11129 }
11130
11131 if (new_item)
11132 {
11133 new_item.SetResultOfSplit(true);
11134 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11136 new_item.SetQuantity(split_quantity_new);
11137 }
11138 }
11139 else
11140 {
11141 if (stack_max != 0)
11142 {
11144 {
11146 }
11147
11149
11150 if (new_item)
11151 {
11152 new_item.SetResultOfSplit(true);
11153 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11155 new_item.SetQuantity(stack_max);
11156 new_item.PlaceOnSurface();
11157 }
11158 }
11159 }
11160 }
11161
11163 {
11165 return;
11166
11168 {
11169 if (ScriptInputUserData.CanStoreInputUserData())
11170 {
11171 ScriptInputUserData ctx = new ScriptInputUserData;
11176 dst.WriteToContext(ctx);
11178 }
11179 }
11180 else if (!
GetGame().IsMultiplayer())
11181 {
11183 }
11184 }
11185
11187 {
11189 return;
11190
11192 {
11193 if (ScriptInputUserData.CanStoreInputUserData())
11194 {
11195 ScriptInputUserData ctx = new ScriptInputUserData;
11200 ctx.
Write(destination_entity);
11206 }
11207 }
11208 else if (!
GetGame().IsMultiplayer())
11209 {
11211 }
11212 }
11213
11215 {
11217 }
11218
11220 {
11222 return this;
11223
11225 float split_quantity_new;
11227 if (dst.IsValid())
11228 {
11229 int slot_id = dst.GetSlot();
11231
11232 if (quantity > stack_max)
11233 split_quantity_new = stack_max;
11234 else
11235 split_quantity_new = quantity;
11236
11238
11239 if (new_item)
11240 {
11241 new_item.SetResultOfSplit(true);
11242 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11245 }
11246
11247 return new_item;
11248 }
11249
11250 return null;
11251 }
11252
11254 {
11256 return;
11257
11259 float split_quantity_new;
11261 if (destination_entity)
11262 {
11264 if (quantity > stackable)
11265 split_quantity_new = stackable;
11266 else
11267 split_quantity_new = quantity;
11268
11269 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11270 if (new_item)
11271 {
11272 new_item.SetResultOfSplit(true);
11273 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11275 new_item.SetQuantity(split_quantity_new);
11276 }
11277 }
11278 }
11279
11281 {
11283 return;
11284
11286 {
11287 if (ScriptInputUserData.CanStoreInputUserData())
11288 {
11289 ScriptInputUserData ctx = new ScriptInputUserData;
11294 ItemBase destination_entity =
this;
11295 ctx.
Write(destination_entity);
11299 }
11300 }
11301 else if (!
GetGame().IsMultiplayer())
11302 {
11304 }
11305 }
11306
11308 {
11310 return;
11311
11313 float split_quantity_new;
11315 if (player)
11316 {
11318 if (quantity > stackable)
11319 split_quantity_new = stackable;
11320 else
11321 split_quantity_new = quantity;
11322
11323 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11324 new_item =
ItemBase.Cast(in_hands);
11325 if (new_item)
11326 {
11327 new_item.SetResultOfSplit(true);
11328 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11330 new_item.SetQuantity(split_quantity_new);
11331 }
11332 }
11333 }
11334
11336 {
11338 return;
11339
11341 float split_quantity_new = Math.Floor(quantity * 0.5);
11342
11344
11345 if (new_item)
11346 {
11347 if (new_item.GetQuantityMax() < split_quantity_new)
11348 {
11349 split_quantity_new = new_item.GetQuantityMax();
11350 }
11351
11352 new_item.SetResultOfSplit(true);
11353 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11354
11356 {
11359 }
11360 else
11361 {
11364 }
11365 }
11366 }
11367
11369 {
11371 return;
11372
11374 float split_quantity_new = Math.Floor(quantity / 2);
11375
11376 InventoryLocation invloc = new InventoryLocation;
11378
11380 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11381
11382 if (new_item)
11383 {
11384 if (new_item.GetQuantityMax() < split_quantity_new)
11385 {
11386 split_quantity_new = new_item.GetQuantityMax();
11387 }
11389 {
11392 }
11393 else
11394 {
11397 }
11398 }
11399 }
11400
11403 {
11404 SetWeightDirty();
11406
11407 if (parent)
11408 parent.OnAttachmentQuantityChangedEx(this, delta);
11409
11411 {
11413 {
11415 }
11417 {
11418 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11420 }
11421 }
11422
11423 }
11424
11427 {
11428
11429 }
11430
11433 {
11435 }
11436
11438 {
11439 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11440
11442 {
11443 if (newLevel == GameConstants.STATE_RUINED)
11444 {
11446 EntityAI parent = GetHierarchyParent();
11447 if (parent && parent.IsFireplace())
11448 {
11449 CargoBase cargo = GetInventory().GetCargo();
11450 if (cargo)
11451 {
11453 {
11455 }
11456 }
11457 }
11458 }
11459
11461 {
11462
11464 return;
11465 }
11466
11467 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11468 {
11470 }
11471 }
11472 }
11473
11474
11476 {
11477 super.OnRightClick();
11478
11480 {
11482 {
11483 if (ScriptInputUserData.CanStoreInputUserData())
11484 {
11485 vector m4[4];
11487
11488 EntityAI root = GetHierarchyRoot();
11489
11490 InventoryLocation dst = new InventoryLocation;
11492 {
11493 if (root)
11494 {
11495 root.GetTransform(m4);
11497 }
11498 else
11499 GetInventory().GetCurrentInventoryLocation(dst);
11500 }
11501 else
11502 {
11504
11505
11506 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11507 {
11508 if (root)
11509 {
11510 root.GetTransform(m4);
11512 }
11513 else
11514 GetInventory().GetCurrentInventoryLocation(dst);
11515 }
11516 else
11517 {
11518 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11519 }
11520 }
11521
11522 ScriptInputUserData ctx = new ScriptInputUserData;
11530 }
11531 }
11532 else if (!
GetGame().IsMultiplayer())
11533 {
11535 }
11536 }
11537 }
11538
11539 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11540 {
11541
11542 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11543 return false;
11544
11545 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11546 return false;
11547
11548
11550 return false;
11551
11552
11553 Magazine mag = Magazine.Cast(this);
11554 if (mag)
11555 {
11556 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11557 return false;
11558
11559 if (stack_max_limit)
11560 {
11561 Magazine other_mag = Magazine.Cast(other_item);
11562 if (other_item)
11563 {
11564 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11565 return false;
11566 }
11567
11568 }
11569 }
11570 else
11571 {
11572
11574 return false;
11575
11577 return false;
11578 }
11579
11580 PlayerBase player = null;
11581 if (CastTo(player, GetHierarchyRootPlayer()))
11582 {
11583 if (player.GetInventory().HasAttachment(this))
11584 return false;
11585
11586 if (player.IsItemsToDelete())
11587 return false;
11588 }
11589
11590 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11591 return false;
11592
11593 int slotID;
11595 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11596 return false;
11597
11598 return true;
11599 }
11600
11602 {
11604 }
11605
11607 {
11608 return m_IsResultOfSplit;
11609 }
11610
11612 {
11613 m_IsResultOfSplit = value;
11614 }
11615
11617 {
11619 }
11620
11622 {
11623 float other_item_quantity = other_item.GetQuantity();
11624 float this_free_space;
11625
11627
11629
11630 if (other_item_quantity > this_free_space)
11631 {
11632 return this_free_space;
11633 }
11634 else
11635 {
11636 return other_item_quantity;
11637 }
11638 }
11639
11641 {
11643 }
11644
11646 {
11648 return;
11649
11650 if (!IsMagazine() && other_item)
11651 {
11653 if (quantity_used != 0)
11654 {
11655 float hp1 = GetHealth01("","");
11656 float hp2 = other_item.GetHealth01("","");
11657 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11658 hpResult = hpResult / (
GetQuantity() + quantity_used);
11659
11660 hpResult *= GetMaxHealth();
11661 Math.Round(hpResult);
11662 SetHealth("", "Health", hpResult);
11663
11665 other_item.AddQuantity(-quantity_used);
11666 }
11667 }
11669 }
11670
11672 {
11673 #ifdef SERVER
11674 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11675 GetHierarchyParent().IncreaseLifetimeUp();
11676 #endif
11677 };
11678
11680 {
11681 PlayerBase p = PlayerBase.Cast(player);
11682
11683 array<int> recipesIds = p.m_Recipes;
11684 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11685 if (moduleRecipesManager)
11686 {
11687 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11688 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11689 }
11690
11691 for (int i = 0;i < recipesIds.Count(); i++)
11692 {
11693 int key = recipesIds.Get(i);
11694 string recipeName = moduleRecipesManager.GetRecipeName(key);
11696 }
11697 }
11698
11699
11700 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11701 {
11702 super.GetDebugActions(outputList);
11703
11704
11709
11710
11714
11718
11719
11722
11723
11725 {
11728 }
11729
11731
11734
11738 }
11739
11740
11741
11742
11744 {
11745 super.OnAction(action_id, player, ctx);
11746 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11747 {
11748 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11749 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11750 PlayerBase p = PlayerBase.Cast(player);
11751 if (
EActions.RECIPES_RANGE_START < 1000)
11752 {
11753 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11754 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11755 }
11756 }
11757 #ifndef SERVER
11758 else if (action_id ==
EActions.WATCH_PLAYER)
11759 {
11760 PluginDeveloper.SetDeveloperItemClientEx(player);
11761 }
11762 #endif
11764 {
11765 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11766 {
11767 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11768 OnDebugButtonPressServer(id + 1);
11769 }
11770
11771 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11772 {
11773 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11775 }
11776
11777 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11778 {
11779 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11781 }
11782
11783 else if (action_id ==
EActions.ADD_QUANTITY)
11784 {
11785 if (IsMagazine())
11786 {
11787 Magazine mag = Magazine.Cast(this);
11788 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11789 }
11790 else
11791 {
11793 }
11794
11795 if (m_EM)
11796 {
11797 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11798 }
11799
11800 }
11801
11802 else if (action_id ==
EActions.REMOVE_QUANTITY)
11803 {
11804 if (IsMagazine())
11805 {
11806 Magazine mag2 = Magazine.Cast(this);
11807 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11808 }
11809 else
11810 {
11812 }
11813 if (m_EM)
11814 {
11815 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11816 }
11817
11818 }
11819
11820 else if (action_id ==
EActions.SET_QUANTITY_0)
11821 {
11823
11824 if (m_EM)
11825 {
11826 m_EM.SetEnergy(0);
11827 }
11828 }
11829
11830 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11831 {
11833
11834 if (m_EM)
11835 {
11836 m_EM.SetEnergy(m_EM.GetEnergyMax());
11837 }
11838 }
11839
11840 else if (action_id ==
EActions.ADD_HEALTH)
11841 {
11842 AddHealth("","",GetMaxHealth("","Health")/5);
11843 }
11844 else if (action_id ==
EActions.REMOVE_HEALTH)
11845 {
11846 AddHealth("","",-GetMaxHealth("","Health")/5);
11847 }
11848 else if (action_id ==
EActions.DESTROY_HEALTH)
11849 {
11850 SetHealth01("","",0);
11851 }
11852 else if (action_id ==
EActions.WATCH_ITEM)
11853 {
11855 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11856 #ifdef DEVELOPER
11857 SetDebugDeveloper_item(this);
11858 #endif
11859 }
11860
11861 else if (action_id ==
EActions.ADD_TEMPERATURE)
11862 {
11863 AddTemperature(20);
11864
11865 }
11866
11867 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11868 {
11869 AddTemperature(-20);
11870
11871 }
11872
11873 else if (action_id ==
EActions.FLIP_FROZEN)
11874 {
11875 SetFrozen(!GetIsFrozen());
11876
11877 }
11878
11879 else if (action_id ==
EActions.ADD_WETNESS)
11880 {
11882
11883 }
11884
11885 else if (action_id ==
EActions.REMOVE_WETNESS)
11886 {
11888
11889 }
11890
11891 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11892 {
11895
11896
11897 }
11898
11899 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11900 {
11903 }
11904
11905 else if (action_id ==
EActions.MAKE_SPECIAL)
11906 {
11907 auto debugParams = DebugSpawnParams.WithPlayer(player);
11908 OnDebugSpawnEx(debugParams);
11909 }
11910
11911 else if (action_id ==
EActions.DELETE)
11912 {
11913 Delete();
11914 }
11915
11916 }
11917
11918
11919 return false;
11920 }
11921
11922
11923
11924
11928
11931
11932
11933
11935 {
11936 return false;
11937 }
11938
11939
11941 {
11942 return true;
11943 }
11944
11945
11947 {
11948 return true;
11949 }
11950
11951
11952
11954 {
11955 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11957 }
11958
11961 {
11962 return null;
11963 }
11964
11966 {
11967 return false;
11968 }
11969
11971 {
11972 return false;
11973 }
11974
11978
11979
11981 {
11982 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11983 return module_repairing.CanRepair(this, item_repair_kit);
11984 }
11985
11986
11987 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11988 {
11989 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11990 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11991 }
11992
11993
11995 {
11996
11997
11998
11999
12000
12001
12002
12003
12004 return 1;
12005 }
12006
12007
12008
12010 {
12012 }
12013
12014
12015
12017 {
12019 }
12020
12021
12030 {
12031 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12032
12033 if (player)
12034 {
12035 player.MessageStatus(text);
12036 }
12037 }
12038
12039
12048 {
12049 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12050
12051 if (player)
12052 {
12053 player.MessageAction(text);
12054 }
12055 }
12056
12057
12066 {
12067 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12068
12069 if (player)
12070 {
12071 player.MessageFriendly(text);
12072 }
12073 }
12074
12075
12084 {
12085 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12086
12087 if (player)
12088 {
12089 player.MessageImportant(text);
12090 }
12091 }
12092
12094 {
12095 return true;
12096 }
12097
12098
12099 override bool KindOf(
string tag)
12100 {
12101 bool found = false;
12102 string item_name = this.
GetType();
12105
12106 int array_size = item_tag_array.Count();
12107 for (int i = 0; i < array_size; i++)
12108 {
12109 if (item_tag_array.Get(i) == tag)
12110 {
12111 found = true;
12112 break;
12113 }
12114 }
12115 return found;
12116 }
12117
12118
12120 {
12121
12122 super.OnRPC(sender, rpc_type,ctx);
12123
12124
12125 switch (rpc_type)
12126 {
12127 #ifndef SERVER
12128 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12129 Param2<bool, string> p = new Param2<bool, string>(false, "");
12130
12132 return;
12133
12134 bool play = p.param1;
12135 string soundSet = p.param2;
12136
12137 if (play)
12138 {
12140 {
12142 {
12144 }
12145 }
12146 else
12147 {
12149 }
12150 }
12151 else
12152 {
12154 }
12155
12156 break;
12157 #endif
12158
12159 }
12160
12162 {
12164 }
12165 }
12166
12167
12168
12169
12171 {
12172 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12173 return plugin.GetID(
name);
12174 }
12175
12177 {
12178 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12179 return plugin.GetName(id);
12180 }
12181
12184 {
12185
12186
12187 int varFlags;
12188 if (!ctx.
Read(varFlags))
12189 return;
12190
12191 if (varFlags & ItemVariableFlags.FLOAT)
12192 {
12194 }
12195 }
12196
12198 {
12199
12200 super.SerializeNumericalVars(floats_out);
12201
12202
12203
12205 {
12207 }
12208
12210 {
12212 }
12213
12215 {
12217 }
12218
12220 {
12225 }
12226
12228 {
12230 }
12231 }
12232
12234 {
12235
12236 super.DeSerializeNumericalVars(floats);
12237
12238
12239 int index = 0;
12240 int mask = Math.Round(floats.Get(index));
12241
12242 index++;
12243
12245 {
12247 {
12249 }
12250 else
12251 {
12252 float quantity = floats.Get(index);
12253 SetQuantity(quantity,
true,
false,
false,
false);
12254 }
12255 index++;
12256 }
12257
12259 {
12260 float wet = floats.Get(index);
12262 index++;
12263 }
12264
12266 {
12267 int liquidtype = Math.Round(floats.Get(index));
12269 index++;
12270 }
12271
12273 {
12275 index++;
12277 index++;
12279 index++;
12281 index++;
12282 }
12283
12285 {
12286 int cleanness = Math.Round(floats.Get(index));
12288 index++;
12289 }
12290 }
12291
12293 {
12294 super.WriteVarsToCTX(ctx);
12295
12296
12298 {
12300 }
12301
12303 {
12305 }
12306
12308 {
12310 }
12311
12313 {
12314 int r,g,b,a;
12320 }
12321
12323 {
12325 }
12326 }
12327
12329 {
12330 if (!super.ReadVarsFromCTX(ctx,version))
12331 return false;
12332
12333 int intValue;
12334 float value;
12335
12336 if (version < 140)
12337 {
12338 if (!ctx.
Read(intValue))
12339 return false;
12340
12341 m_VariablesMask = intValue;
12342 }
12343
12345 {
12346 if (!ctx.
Read(value))
12347 return false;
12348
12350 {
12352 }
12353 else
12354 {
12356 }
12357 }
12358
12359 if (version < 140)
12360 {
12362 {
12363 if (!ctx.
Read(value))
12364 return false;
12365 SetTemperatureDirect(value);
12366 }
12367 }
12368
12370 {
12371 if (!ctx.
Read(value))
12372 return false;
12374 }
12375
12377 {
12378 if (!ctx.
Read(intValue))
12379 return false;
12381 }
12382
12384 {
12385 int r,g,b,a;
12387 return false;
12389 return false;
12391 return false;
12393 return false;
12394
12396 }
12397
12399 {
12400 if (!ctx.
Read(intValue))
12401 return false;
12403 }
12404
12405 if (version >= 138 && version < 140)
12406 {
12408 {
12409 if (!ctx.
Read(intValue))
12410 return false;
12411 SetFrozen(intValue);
12412 }
12413 }
12414
12415 return true;
12416 }
12417
12418
12420 {
12423 {
12425 }
12426
12427 if (!super.OnStoreLoad(ctx, version))
12428 {
12430 return false;
12431 }
12432
12433 if (version >= 114)
12434 {
12435 bool hasQuickBarIndexSaved;
12436
12437 if (!ctx.
Read(hasQuickBarIndexSaved))
12438 {
12440 return false;
12441 }
12442
12443 if (hasQuickBarIndexSaved)
12444 {
12445 int itmQBIndex;
12446
12447
12448 if (!ctx.
Read(itmQBIndex))
12449 {
12451 return false;
12452 }
12453
12454 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12455 if (itmQBIndex != -1 && parentPlayer)
12456 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12457 }
12458 }
12459 else
12460 {
12461
12462 PlayerBase player;
12463 int itemQBIndex;
12464 if (version ==
int.
MAX)
12465 {
12466 if (!ctx.
Read(itemQBIndex))
12467 {
12469 return false;
12470 }
12471 }
12472 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12473 {
12474
12475 if (!ctx.
Read(itemQBIndex))
12476 {
12478 return false;
12479 }
12480 if (itemQBIndex != -1 && player)
12481 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12482 }
12483 }
12484
12485 if (version < 140)
12486 {
12487
12488 if (!LoadVariables(ctx, version))
12489 {
12491 return false;
12492 }
12493 }
12494
12495
12497 {
12499 return false;
12500 }
12501 if (version >= 132)
12502 {
12504 if (raib)
12505 {
12507 {
12509 return false;
12510 }
12511 }
12512 }
12513
12515 return true;
12516 }
12517
12518
12519
12521 {
12522 super.OnStoreSave(ctx);
12523
12524 PlayerBase player;
12525 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12526 {
12528
12529 int itemQBIndex = -1;
12530 itemQBIndex = player.FindQuickBarEntityIndex(this);
12531 ctx.
Write(itemQBIndex);
12532 }
12533 else
12534 {
12536 }
12537
12539
12541 if (raib)
12542 {
12544 }
12545 }
12546
12547
12549 {
12550 super.AfterStoreLoad();
12551
12553 {
12555 }
12556
12558 {
12561 }
12562 }
12563
12565 {
12566 super.EEOnAfterLoad();
12567
12569 {
12571 }
12572
12575 }
12576
12578 {
12579 return false;
12580 }
12581
12582
12583
12585 {
12587 {
12588 #ifdef PLATFORM_CONSOLE
12589
12591 {
12593 if (menu)
12594 {
12596 }
12597 }
12598 #endif
12599 }
12600
12602 {
12605 }
12606
12608 {
12609 SetWeightDirty();
12611 }
12613 {
12616 }
12617
12619 {
12622 }
12624 {
12627 }
12628
12629 super.OnVariablesSynchronized();
12630 }
12631
12632
12633
12635 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12636 {
12637 if (!IsServerCheck(allow_client))
12638 return false;
12639
12641 return false;
12642
12645
12646 if (value <= (min + 0.001))
12647 value = min;
12648
12649 if (value == min)
12650 {
12651 if (destroy_config)
12652 {
12653 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12654 if (dstr)
12655 {
12657 this.Delete();
12658 return true;
12659 }
12660 }
12661 else if (destroy_forced)
12662 {
12664 this.Delete();
12665 return true;
12666 }
12667
12669 }
12670
12673
12675 {
12677
12678 if (delta)
12680 }
12681
12683
12684 return false;
12685 }
12686
12687
12689 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12690 {
12692 }
12693
12695 {
12698 }
12699
12701 {
12704 }
12705
12708 {
12709 float value_clamped = Math.Clamp(value, 0, 1);
12711 SetQuantity(result, destroy_config, destroy_forced);
12712 }
12713
12714
12717 {
12719 }
12720
12722 {
12724 }
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12736 {
12737 int slot = -1;
12738 if (GetInventory())
12739 {
12740 InventoryLocation il = new InventoryLocation;
12741 GetInventory().GetCurrentInventoryLocation(il);
12743 }
12744
12746 }
12747
12749 {
12750 float quantity_max = 0;
12751
12753 {
12754 if (attSlotID != -1)
12755 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12756
12757 if (quantity_max <= 0)
12759 }
12760
12761 if (quantity_max <= 0)
12763
12764 return quantity_max;
12765 }
12766
12768 {
12770 }
12771
12773 {
12775 }
12776
12777
12779 {
12781 }
12782
12784 {
12786 }
12787
12789 {
12791 }
12792
12793
12795 {
12796
12797 float weightEx = GetWeightEx();
12798 float special = GetInventoryAndCargoWeight();
12799 return weightEx - special;
12800 }
12801
12802
12804 {
12806 }
12807
12809 {
12811 {
12812 #ifdef DEVELOPER
12813 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12814 {
12815 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12817 }
12818 #endif
12819
12820 return GetQuantity() * GetConfigWeightModified();
12821 }
12822 else if (HasEnergyManager())
12823 {
12824 #ifdef DEVELOPER
12825 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12826 {
12827 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12828 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12829 }
12830 #endif
12831 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12832 }
12833 else
12834 {
12835 #ifdef DEVELOPER
12836 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12837 {
12838 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12839 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12840 }
12841 #endif
12842 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12843 }
12844 }
12845
12848 {
12849 int item_count = 0;
12851
12852 if (GetInventory().GetCargo() != NULL)
12853 {
12854 item_count = GetInventory().GetCargo().GetItemCount();
12855 }
12856
12857 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12858 {
12859 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12860 if (item)
12861 item_count += item.GetNumberOfItems();
12862 }
12863 return item_count;
12864 }
12865
12868 {
12869 float weight = 0;
12870 float wetness = 1;
12871 if (include_wetness)
12874 {
12875 weight = wetness * m_ConfigWeight;
12876 }
12878 {
12879 weight = 1;
12880 }
12881 return weight;
12882 }
12883
12884
12885
12887 {
12888 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12889 {
12890 GameInventory inv = GetInventory();
12891 array<EntityAI> items = new array<EntityAI>;
12893 for (int i = 0; i < items.Count(); i++)
12894 {
12896 if (item)
12897 {
12899 }
12900 }
12901 }
12902 }
12903
12904
12905
12906
12908 {
12909 float energy = 0;
12910 if (HasEnergyManager())
12911 {
12912 energy = GetCompEM().GetEnergy();
12913 }
12914 return energy;
12915 }
12916
12917
12919 {
12920 super.OnEnergyConsumed();
12921
12923 }
12924
12926 {
12927 super.OnEnergyAdded();
12928
12930 }
12931
12932
12934 {
12935 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12936 {
12938 {
12939 float energy_0to1 = GetCompEM().GetEnergy0To1();
12941 }
12942 }
12943 }
12944
12945
12947 {
12948 return ConfigGetFloat("heatIsolation");
12949 }
12950
12952 {
12954 }
12955
12957 {
12958 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12959 if (
GetGame().ConfigIsExisting(paramPath))
12961
12962 return 0.0;
12963 }
12964
12966 {
12967 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12968 if (
GetGame().ConfigIsExisting(paramPath))
12970
12971 return 0.0;
12972 }
12973
12974 override void SetWet(
float value,
bool allow_client =
false)
12975 {
12976 if (!IsServerCheck(allow_client))
12977 return;
12978
12981
12983
12984 m_VarWet = Math.Clamp(value, min, max);
12985
12987 {
12990 }
12991 }
12992
12993 override void AddWet(
float value)
12994 {
12996 }
12997
12999 {
13001 }
13002
13004 {
13006 }
13007
13009 {
13011 }
13012
13014 {
13016 }
13017
13019 {
13021 }
13022
13023 override void OnWetChanged(
float newVal,
float oldVal)
13024 {
13027 if (newLevel != oldLevel)
13028 {
13030 }
13031 }
13032
13034 {
13035 SetWeightDirty();
13036 }
13037
13039 {
13040 return GetWetLevelInternal(
m_VarWet);
13041 }
13042
13043
13044
13046 {
13048 }
13049
13051 {
13053 }
13054
13056 {
13058 }
13059
13061 {
13063 }
13064
13065
13066
13068 {
13069 if (ConfigIsExisting("itemModelLength"))
13070 {
13071 return ConfigGetFloat("itemModelLength");
13072 }
13073 return 0;
13074 }
13075
13077 {
13078 if (ConfigIsExisting("itemAttachOffset"))
13079 {
13080 return ConfigGetFloat("itemAttachOffset");
13081 }
13082 return 0;
13083 }
13084
13085 override void SetCleanness(
int value,
bool allow_client =
false)
13086 {
13087 if (!IsServerCheck(allow_client))
13088 return;
13089
13091
13093
13096 }
13097
13099 {
13101 }
13102
13104 {
13105 return true;
13106 }
13107
13108
13109
13110
13112 {
13114 }
13115
13117 {
13119 }
13120
13121
13122
13123
13124 override void SetColor(
int r,
int g,
int b,
int a)
13125 {
13131 }
13133 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13134 {
13139 }
13140
13142 {
13144 }
13145
13148 {
13149 int r,g,b,a;
13151 r = r/255;
13152 g = g/255;
13153 b = b/255;
13154 a = a/255;
13155 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13156 }
13157
13158
13159
13160 override void SetLiquidType(
int value,
bool allow_client =
false)
13161 {
13162 if (!IsServerCheck(allow_client))
13163 return;
13164
13169 }
13170
13172 {
13173 return ConfigGetInt("varLiquidTypeInit");
13174 }
13175
13177 {
13179 }
13180
13182 {
13184 SetFrozen(false);
13185 }
13186
13189 {
13190 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13191 }
13192
13193
13196 {
13197 PlayerBase nplayer;
13198 if (PlayerBase.CastTo(nplayer, player))
13199 {
13201
13202 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13203 }
13204 }
13205
13206
13209 {
13210 PlayerBase nplayer;
13211 if (PlayerBase.CastTo(nplayer,player))
13212 {
13213
13214 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13215
13216 }
13217
13218
13219 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13220
13221
13222 if (HasEnergyManager())
13223 {
13224 GetCompEM().UpdatePlugState();
13225 }
13226 }
13227
13228
13230 {
13231 super.OnPlacementStarted(player);
13232
13234 }
13235
13236 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13237 {
13239 {
13240 m_AdminLog.OnPlacementComplete(player,
this);
13241 }
13242
13243 super.OnPlacementComplete(player, position, orientation);
13244 }
13245
13246
13247
13248
13249
13251 {
13253 {
13254 return true;
13255 }
13256 else
13257 {
13258 return false;
13259 }
13260 }
13261
13262
13264 {
13266 {
13268 }
13269 }
13270
13271
13273 {
13275 }
13276
13278 {
13280 }
13281
13282 override void InsertAgent(
int agent,
float count = 1)
13283 {
13284 if (count < 1)
13285 return;
13286
13288 }
13289
13292 {
13294 }
13295
13296
13298 {
13300 }
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13344 {
13346 return false;
13347 return true;
13348 }
13349
13351 {
13352
13354 }
13355
13356
13359 {
13360 super.CheckForRoofLimited(timeTresholdMS);
13361
13363 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13364 {
13365 m_PreviousRoofTestTime = time;
13366 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13367 }
13368 }
13369
13370
13372 {
13374 {
13375 return 0;
13376 }
13377
13378 if (GetInventory().GetAttachmentSlotsCount() != 0)
13379 {
13380 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13381 if (filter)
13382 return filter.GetProtectionLevel(type, false, system);
13383 else
13384 return 0;
13385 }
13386
13387 string subclassPath, entryName;
13388
13389 switch (type)
13390 {
13392 entryName = "biological";
13393 break;
13395 entryName = "chemical";
13396 break;
13397 default:
13398 entryName = "biological";
13399 break;
13400 }
13401
13402 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13403
13405 }
13406
13407
13408
13411 {
13412 if (!IsMagazine())
13414
13416 }
13417
13418
13419
13420
13421
13426 {
13427 return true;
13428 }
13429
13431 {
13433 }
13434
13435
13436
13437
13438
13440 {
13441 if (parent)
13442 {
13443 if (parent.IsInherited(DayZInfected))
13444 return true;
13445
13446 if (!parent.IsRuined())
13447 return true;
13448 }
13449
13450 return true;
13451 }
13452
13454 {
13455 if (!super.CanPutAsAttachment(parent))
13456 {
13457 return false;
13458 }
13459
13460 if (!IsRuined() && !parent.IsRuined())
13461 {
13462 return true;
13463 }
13464
13465 return false;
13466 }
13467
13469 {
13470
13471
13472
13473
13474 return super.CanReceiveItemIntoCargo(item);
13475 }
13476
13478 {
13479
13480
13481
13482
13483 GameInventory attachmentInv = attachment.GetInventory();
13485 {
13486 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13487 return false;
13488 }
13489
13490 InventoryLocation loc = new InventoryLocation();
13491 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13492 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13493 return false;
13494
13495 return super.CanReceiveAttachment(attachment, slotId);
13496 }
13497
13499 {
13500 if (!super.CanReleaseAttachment(attachment))
13501 return false;
13502
13503 return GetInventory().AreChildrenAccessible();
13504 }
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13527 {
13528 int id = muzzle_owner.GetMuzzleID();
13529 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13530
13531 if (WPOF_array)
13532 {
13533 for (int i = 0; i < WPOF_array.Count(); i++)
13534 {
13535 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13536
13537 if (WPOF)
13538 {
13539 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13540 }
13541 }
13542 }
13543 }
13544
13545
13547 {
13548 int id = muzzle_owner.GetMuzzleID();
13550
13551 if (WPOBE_array)
13552 {
13553 for (int i = 0; i < WPOBE_array.Count(); i++)
13554 {
13555 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13556
13557 if (WPOBE)
13558 {
13559 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13560 }
13561 }
13562 }
13563 }
13564
13565
13567 {
13568 int id = muzzle_owner.GetMuzzleID();
13569 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13570
13571 if (WPOOH_array)
13572 {
13573 for (int i = 0; i < WPOOH_array.Count(); i++)
13574 {
13575 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13576
13577 if (WPOOH)
13578 {
13579 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13580 }
13581 }
13582 }
13583 }
13584
13585
13587 {
13588 int id = muzzle_owner.GetMuzzleID();
13589 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13590
13591 if (WPOOH_array)
13592 {
13593 for (int i = 0; i < WPOOH_array.Count(); i++)
13594 {
13595 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13596
13597 if (WPOOH)
13598 {
13599 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13600 }
13601 }
13602 }
13603 }
13604
13605
13607 {
13608 int id = muzzle_owner.GetMuzzleID();
13609 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13610
13611 if (WPOOH_array)
13612 {
13613 for (int i = 0; i < WPOOH_array.Count(); i++)
13614 {
13615 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13616
13617 if (WPOOH)
13618 {
13619 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13620 }
13621 }
13622 }
13623 }
13624
13625
13626
13628 {
13630 {
13631 return true;
13632 }
13633
13634 return false;
13635 }
13636
13638 {
13640 {
13641 return true;
13642 }
13643
13644 return false;
13645 }
13646
13648 {
13650 {
13651 return true;
13652 }
13653
13654 return false;
13655 }
13656
13658 {
13659 return false;
13660 }
13661
13664 {
13665 return UATimeSpent.DEFAULT_DEPLOY;
13666 }
13667
13668
13669
13670
13672 {
13674 SetSynchDirty();
13675 }
13676
13678 {
13680 }
13681
13682
13684 {
13685 return false;
13686 }
13687
13690 {
13691 string att_type = "None";
13692
13693 if (ConfigIsExisting("soundAttType"))
13694 {
13695 att_type = ConfigGetString("soundAttType");
13696 }
13697
13699 }
13700
13702 {
13704 }
13705
13706
13707
13708
13709
13713
13715 {
13718
13720 }
13721
13722
13724 {
13726 return;
13727
13729
13732
13735
13736 SoundParameters params = new SoundParameters();
13740 }
13741
13742
13744 {
13746 return;
13747
13749 SetSynchDirty();
13750
13753 }
13754
13755
13757 {
13759 return;
13760
13762 SetSynchDirty();
13763
13766 }
13767
13769 {
13771 }
13772
13774 {
13776 }
13777
13780 {
13781 if (!
GetGame().IsDedicatedServer())
13782 {
13783 if (ConfigIsExisting("attachSoundSet"))
13784 {
13785 string cfg_path = "";
13786 string soundset = "";
13787 string type_name =
GetType();
13788
13791 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13792 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13793
13794 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13795 {
13796 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13797 {
13798 if (cfg_slot_array[i] == slot_type)
13799 {
13800 soundset = cfg_soundset_array[i];
13801 break;
13802 }
13803 }
13804 }
13805
13806 if (soundset != "")
13807 {
13808 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13810 }
13811 }
13812 }
13813 }
13814
13816 {
13817
13818 }
13819
13820 void OnApply(PlayerBase player);
13821
13823 {
13824 return 1.0;
13825 };
13826
13828 {
13830 }
13831
13833 {
13835 }
13836
13838
13840 {
13841 SetDynamicPhysicsLifeTime(0.01);
13843 }
13844
13846 {
13847 array<string> zone_names = new array<string>;
13848 GetDamageZones(zone_names);
13849 for (int i = 0; i < zone_names.Count(); i++)
13850 {
13851 SetHealthMax(zone_names.Get(i),"Health");
13852 }
13853 SetHealthMax("","Health");
13854 }
13855
13858 {
13859 float global_health = GetHealth01("","Health");
13860 array<string> zones = new array<string>;
13861 GetDamageZones(zones);
13862
13863 for (int i = 0; i < zones.Count(); i++)
13864 {
13865 SetHealth01(zones.Get(i),"Health",global_health);
13866 }
13867 }
13868
13871 {
13872 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13873 }
13874
13876 {
13877 if (!hasRootAsPlayer)
13878 {
13879 if (refParentIB)
13880 {
13881
13882 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13883 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13884
13885 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13886 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13887
13890 }
13891 else
13892 {
13893
13896 }
13897 }
13898 }
13899
13901 {
13903 {
13904 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13905 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13906 {
13907 float heatPermCoef = 1.0;
13909 while (ent)
13910 {
13911 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13912 ent = ent.GetHierarchyParent();
13913 }
13914
13915 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13916 }
13917 }
13918 }
13919
13921 {
13922
13923 EntityAI parent = GetHierarchyParent();
13924 if (!parent)
13925 {
13926 hasParent = false;
13927 hasRootAsPlayer = false;
13928 }
13929 else
13930 {
13931 hasParent = true;
13932 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13933 refParentIB =
ItemBase.Cast(parent);
13934 }
13935 }
13936
13937 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13938 {
13939
13940 }
13941
13943 {
13944
13945 return false;
13946 }
13947
13949 {
13950
13951
13952 return false;
13953 }
13954
13956 {
13957
13958 return false;
13959 }
13960
13963 {
13964 return !GetIsFrozen() &&
IsOpen();
13965 }
13966
13968 {
13969 bool hasParent = false, hasRootAsPlayer = false;
13971
13972 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13973 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13974
13975 if (wwtu || foodDecay)
13976 {
13980
13981 if (processWetness || processTemperature || processDecay)
13982 {
13984
13985 if (processWetness)
13986 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13987
13988 if (processTemperature)
13990
13991 if (processDecay)
13992 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13993 }
13994 }
13995 }
13996
13999 {
14001 }
14002
14004 {
14007
14008 return super.GetTemperatureFreezeThreshold();
14009 }
14010
14012 {
14015
14016 return super.GetTemperatureThawThreshold();
14017 }
14018
14020 {
14023
14024 return super.GetItemOverheatThreshold();
14025 }
14026
14028 {
14030 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14031
14032 return super.GetTemperatureFreezeTime();
14033 }
14034
14036 {
14038 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14039
14040 return super.GetTemperatureThawTime();
14041 }
14042
14047
14049 {
14050 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14051 }
14052
14054 {
14055 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14056 }
14057
14060 {
14062 }
14063
14065 {
14067 }
14068
14070 {
14072 }
14073
14076 {
14077 return null;
14078 }
14079
14082 {
14083 return false;
14084 }
14085
14087 {
14089 {
14092 if (!trg)
14093 {
14095 explosive = this;
14096 }
14097
14098 explosive.PairRemote(trg);
14100
14101 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14102 trg.SetPersistentPairID(persistentID);
14103 explosive.SetPersistentPairID(persistentID);
14104
14105 return true;
14106 }
14107 return false;
14108 }
14109
14112 {
14113 float ret = 1.0;
14116 ret *= GetHealth01();
14117
14118 return ret;
14119 }
14120
14121 #ifdef DEVELOPER
14122 override void SetDebugItem()
14123 {
14124 super.SetDebugItem();
14125 _itemBase = this;
14126 }
14127
14129 {
14130 string text = super.GetDebugText();
14131
14133 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14134
14135 return text;
14136 }
14137 #endif
14138
14140 {
14141 return true;
14142 }
14143
14145
14147
14149 {
14152 }
14153
14154
14162
14178}
14179
14181{
14183 if (entity)
14184 {
14185 bool is_item = entity.IsInherited(
ItemBase);
14186 if (is_item && full_quantity)
14187 {
14190 }
14191 }
14192 else
14193 {
14195 return NULL;
14196 }
14197 return entity;
14198}
14199
14201{
14202 if (item)
14203 {
14204 if (health > 0)
14205 item.SetHealth("", "", health);
14206
14207 if (item.CanHaveTemperature())
14208 {
14210 if (item.CanFreeze())
14211 item.SetFrozen(false);
14212 }
14213
14214 if (item.HasEnergyManager())
14215 {
14216 if (quantity >= 0)
14217 {
14218 item.GetCompEM().SetEnergy0To1(quantity);
14219 }
14220 else
14221 {
14223 }
14224 }
14225 else if (item.IsMagazine())
14226 {
14227 Magazine mag = Magazine.Cast(item);
14228 if (quantity >= 0)
14229 {
14230 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14231 }
14232 else
14233 {
14235 }
14236
14237 }
14238 else
14239 {
14240 if (quantity >= 0)
14241 {
14242 item.SetQuantityNormalized(quantity, false);
14243 }
14244 else
14245 {
14247 }
14248
14249 }
14250 }
14251}
14252
14253#ifdef DEVELOPER
14255#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.