9419{
9421 {
9422 return true;
9423 }
9424};
9425
9426
9427
9429{
9433
9435
9438
9439
9440
9441
9442
9451
9457
9462
9467
9488 protected bool m_IsResultOfSplit
9489
9491
9496
9497
9498
9500
9504
9505
9506
9508
9511
9512
9513
9519
9520
9528
9531
9532
9534
9535
9537
9538
9543
9544
9549
9550
9552
9553
9555 {
9560
9561 if (!
GetGame().IsDedicatedServer())
9562 {
9564 {
9566
9568 {
9570 }
9571 }
9572
9575 }
9576
9577 m_OldLocation = null;
9578
9580 {
9582 }
9583
9584 if (ConfigIsExisting("headSelectionsToHide"))
9585 {
9588 }
9589
9591 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9592 {
9594 }
9595
9597
9598 m_IsResultOfSplit = false;
9599
9601 }
9602
9604 {
9605 super.InitItemVariables();
9606
9612 m_Count = ConfigGetInt(
"count");
9613
9616
9621
9624
9629
9641
9645
9646
9649 if (ConfigIsExisting("canBeSplit"))
9650 {
9653 }
9654
9656 if (ConfigIsExisting("itemBehaviour"))
9658
9659
9662 RegisterNetSyncVariableInt("m_VarLiquidType");
9663 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9664
9665 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9666 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9667 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9668
9669 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9670 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9671 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9672 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9673
9674 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9675 RegisterNetSyncVariableBool("m_IsTakeable");
9676 RegisterNetSyncVariableBool("m_IsHologram");
9677
9680 {
9683 }
9684
9686
9688 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9690
9691 }
9692
9694 {
9696 }
9697
9699 {
9702 {
9707 }
9708 }
9709
9710 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9711 {
9713 {
9716 }
9717
9719 }
9720
9722 {
9728 }
9729
9731
9733 {
9735
9736 if (!action)
9737 {
9738 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9739 return;
9740 }
9741
9743 if (!ai)
9744 {
9746 return;
9747 }
9748
9750 if (!action_array)
9751 {
9752 action_array = new array<ActionBase_Basic>;
9754 }
9755 if (LogManager.IsActionLogEnable())
9756 {
9757 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9758 }
9759
9760 if (action_array.Find(action) != -1)
9761 {
9762 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9763 }
9764 else
9765 {
9766 action_array.Insert(action);
9767 }
9768 }
9769
9771 {
9773 ActionBase action = player.GetActionManager().GetAction(actionName);
9776
9777 if (action_array)
9778 {
9779 action_array.RemoveItem(action);
9780 }
9781 }
9782
9783
9784
9786 {
9787 ActionOverrideData overrideData = new ActionOverrideData();
9791
9793 if (!actionMap)
9794 {
9797 }
9798
9799 actionMap.Insert(this.
Type(), overrideData);
9800
9801 }
9802
9804
9806
9807
9809 {
9812
9815
9816 string config_to_search = "CfgVehicles";
9817 string muzzle_owner_config;
9818
9820 {
9821 if (IsInherited(Weapon))
9822 config_to_search = "CfgWeapons";
9823
9824 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9825
9826 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9827
9829
9830 if (config_OnFire_subclass_count > 0)
9831 {
9832 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9833
9834 for (int i = 0; i < config_OnFire_subclass_count; i++)
9835 {
9836 string particle_class = "";
9838 string config_OnFire_entry = config_OnFire_class + particle_class;
9839 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9840 WPOF_array.Insert(WPOF);
9841 }
9842
9843
9845 }
9846 }
9847
9849 {
9850 config_to_search = "CfgWeapons";
9851 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9852
9853 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9854
9856
9857 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9858 {
9859 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9860
9861 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9862 {
9863 string particle_class2 = "";
9865 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9866 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9867 WPOBE_array.Insert(WPOBE);
9868 }
9869
9870
9872 }
9873 }
9874 }
9875
9876
9878 {
9881
9883 {
9884 string config_to_search = "CfgVehicles";
9885
9886 if (IsInherited(Weapon))
9887 config_to_search = "CfgWeapons";
9888
9889 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9890 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9891
9892 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9893 {
9894
9896
9898 {
9900 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9902 return;
9903 }
9904
9907
9908
9909
9911 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9912
9913 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9914 {
9915 string particle_class = "";
9917 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9919
9920 if (entry_type == CT_CLASS)
9921 {
9922 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9923 WPOOH_array.Insert(WPOF);
9924 }
9925 }
9926
9927
9929 }
9930 }
9931 }
9932
9934 {
9936 }
9937
9939 {
9941 {
9943
9946
9949
9950 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9951 }
9952 }
9953
9955 {
9957 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9958
9960 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9961
9963 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9964
9966 {
9968 }
9969 }
9970
9972 {
9974 }
9975
9977 {
9980 else
9982
9984 {
9987 }
9988 else
9989 {
9992
9995 }
9996
9998 }
9999
10001 {
10003 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10004 }
10005
10007 {
10009 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
10011 }
10012
10014 {
10016 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10017 }
10018
10020 {
10023
10024 OverheatingParticle OP = new OverheatingParticle();
10029
10031 }
10032
10034 {
10037
10038 return -1;
10039 }
10040
10042 {
10044 {
10047
10048 for (int i = count; i > 0; --i)
10049 {
10050 int id = i - 1;
10053
10056
10057 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10058 {
10059 if (p)
10060 {
10063 }
10064 }
10065 }
10066 }
10067 }
10068
10070 {
10072 {
10074 {
10075 int id = i - 1;
10077
10078 if (OP)
10079 {
10081
10082 if (p)
10083 {
10085 }
10086
10087 delete OP;
10088 }
10089 }
10090
10093 }
10094 }
10095
10098 {
10099 return 0.0;
10100 }
10101
10102
10104 {
10105 return 250;
10106 }
10107
10109 {
10110 return 0;
10111 }
10112
10115 {
10117 return true;
10118
10119 return false;
10120 }
10121
10124 {
10127
10129 {
10131 }
10132 else
10133 {
10134
10136 }
10137
10139 }
10140
10147 {
10148 return -1;
10149 }
10150
10151
10152
10153
10155 {
10157 {
10159 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10160
10161 if (r_index >= 0)
10162 {
10163 InventoryLocation r_il = new InventoryLocation;
10164 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10165
10166 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10169 {
10170 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10171 }
10173 {
10174 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10175 }
10176
10177 }
10178
10179 player.GetHumanInventory().ClearUserReservedLocation(this);
10180 }
10181
10184 }
10185
10186
10187
10188
10190 {
10191 return ItemBase.m_DebugActionsMask;
10192 }
10193
10195 {
10196 return ItemBase.m_DebugActionsMask & mask;
10197 }
10198
10200 {
10201 ItemBase.m_DebugActionsMask = mask;
10202 }
10203
10205 {
10206 ItemBase.m_DebugActionsMask |= mask;
10207 }
10208
10210 {
10211 ItemBase.m_DebugActionsMask &= ~mask;
10212 }
10213
10215 {
10217 {
10219 }
10220 else
10221 {
10223 }
10224 }
10225
10226
10228 {
10229 if (GetEconomyProfile())
10230 {
10231 float q_max = GetEconomyProfile().GetQuantityMax();
10232 if (q_max > 0)
10233 {
10234 float q_min = GetEconomyProfile().GetQuantityMin();
10235 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10236
10238 {
10239 ComponentEnergyManager comp = GetCompEM();
10241 {
10243 }
10244 }
10246 {
10248
10249 }
10250
10251 }
10252 }
10253 }
10254
10257 {
10258 EntityAI parent = GetHierarchyParent();
10259
10260 if (parent)
10261 {
10262 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10263 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10264 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10265 }
10266 }
10267
10270 {
10271 EntityAI parent = GetHierarchyParent();
10272
10273 if (parent)
10274 {
10275 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10276 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10277 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10278 }
10279 }
10280
10282 {
10283
10284
10285
10286
10288
10290 {
10291 if (ScriptInputUserData.CanStoreInputUserData())
10292 {
10293 ScriptInputUserData ctx = new ScriptInputUserData;
10299 ctx.
Write(use_stack_max);
10302
10304 {
10305 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10306 }
10307 }
10308 }
10309 else if (!
GetGame().IsMultiplayer())
10310 {
10312 }
10313 }
10314
10316 {
10318 }
10319
10321 {
10323 }
10324
10326 {
10328 }
10329
10331 {
10332
10333 return false;
10334 }
10335
10337 {
10338 return false;
10339 }
10340
10344 {
10345 return false;
10346 }
10347
10349 {
10350 return "";
10351 }
10352
10354
10356 {
10357 return false;
10358 }
10359
10361 {
10362 return true;
10363 }
10364
10365
10366
10368 {
10369 return true;
10370 }
10371
10373 {
10374 return true;
10375 }
10376
10378 {
10379 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10381 }
10382
10384 {
10386 }
10387
10389 {
10391 if (!is_being_placed)
10393 SetSynchDirty();
10394 }
10395
10396
10398
10400 {
10402 }
10403
10405 {
10407 }
10408
10410 {
10411 return 1;
10412 }
10413
10415 {
10416 return false;
10417 }
10418
10420 {
10422 SetSynchDirty();
10423 }
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10460 {
10461 super.OnMovedInsideCargo(container);
10462
10463 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10464 }
10465
10466 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10467 {
10468 super.EEItemLocationChanged(oldLoc,newLoc);
10469
10470 PlayerBase new_player = null;
10471 PlayerBase old_player = null;
10472
10473 if (newLoc.GetParent())
10474 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10475
10476 if (oldLoc.GetParent())
10477 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10478
10480 {
10481 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10482
10483 if (r_index >= 0)
10484 {
10485 InventoryLocation r_il = new InventoryLocation;
10486 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10487
10488 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10491 {
10492 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10493 }
10495 {
10496 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10497 }
10498
10499 }
10500 }
10501
10503 {
10504 if (new_player)
10505 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10506
10507 if (new_player == old_player)
10508 {
10509
10510 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10511 {
10513 {
10514 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10515 {
10516 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10517 }
10518 }
10519 else
10520 {
10521 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10522 }
10523 }
10524
10525 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10526 {
10527 int type = oldLoc.GetType();
10529 {
10530 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10531 }
10533 {
10534 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10535 }
10536 }
10537 if (!m_OldLocation)
10538 {
10539 m_OldLocation = new InventoryLocation;
10540 }
10541 m_OldLocation.Copy(oldLoc);
10542 }
10543 else
10544 {
10545 if (m_OldLocation)
10546 {
10547 m_OldLocation.Reset();
10548 }
10549 }
10550
10552 }
10553 else
10554 {
10555 if (new_player)
10556 {
10557 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10558 if (res_index >= 0)
10559 {
10560 InventoryLocation il = new InventoryLocation;
10561 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10563 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10566 {
10567 il.
GetParent().GetOnReleaseLock().Invoke(it);
10568 }
10570 {
10572 }
10573
10574 }
10575 }
10577 {
10578
10580 }
10581
10582 if (m_OldLocation)
10583 {
10584 m_OldLocation.Reset();
10585 }
10586 }
10587 }
10588
10589 override void EOnContact(IEntity other, Contact extra)
10590 {
10592 {
10593 int liquidType = -1;
10595 if (impactSpeed > 0.0)
10596 {
10598 #ifndef SERVER
10600 #else
10602 SetSynchDirty();
10603 #endif
10605 }
10606 }
10607
10608 #ifdef SERVER
10609 if (GetCompEM() && GetCompEM().IsPlugged())
10610 {
10611 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10612 GetCompEM().UnplugThis();
10613 }
10614 #endif
10615 }
10616
10618
10620 {
10622 }
10623
10625 {
10626
10627 }
10628
10630 {
10631 super.OnItemLocationChanged(old_owner, new_owner);
10632
10633 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10634 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10635
10636 if (!relatedPlayer && playerNew)
10637 relatedPlayer = playerNew;
10638
10639 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10640 {
10642 if (actionMgr)
10643 {
10644 ActionBase currentAction = actionMgr.GetRunningAction();
10645 if (currentAction)
10647 }
10648 }
10649
10650 Man ownerPlayerOld = null;
10651 Man ownerPlayerNew = null;
10652
10653 if (old_owner)
10654 {
10655 if (old_owner.
IsMan())
10656 {
10657 ownerPlayerOld = Man.Cast(old_owner);
10658 }
10659 else
10660 {
10661 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10662 }
10663 }
10664 else
10665 {
10667 {
10669
10670 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10671 {
10672 GetCompEM().UnplugThis();
10673 }
10674 }
10675 }
10676
10677 if (new_owner)
10678 {
10679 if (new_owner.
IsMan())
10680 {
10681 ownerPlayerNew = Man.Cast(new_owner);
10682 }
10683 else
10684 {
10685 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10686 }
10687 }
10688
10689 if (ownerPlayerOld != ownerPlayerNew)
10690 {
10691 if (ownerPlayerOld)
10692 {
10693 array<EntityAI> subItemsExit = new array<EntityAI>;
10695 for (int i = 0; i < subItemsExit.Count(); i++)
10696 {
10699 }
10700 }
10701
10702 if (ownerPlayerNew)
10703 {
10704 array<EntityAI> subItemsEnter = new array<EntityAI>;
10706 for (int j = 0; j < subItemsEnter.Count(); j++)
10707 {
10710 }
10711 }
10712 }
10713 else if (ownerPlayerNew != null)
10714 {
10715 PlayerBase nplayer;
10716 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10717 {
10718 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10720 for (int k = 0; k < subItemsUpdate.Count(); k++)
10721 {
10723 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10724 }
10725 }
10726 }
10727
10728 if (old_owner)
10729 old_owner.OnChildItemRemoved(this);
10730 if (new_owner)
10731 new_owner.OnChildItemReceived(this);
10732 }
10733
10734
10736 {
10737 super.EEDelete(parent);
10738 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10739 if (player)
10740 {
10742
10743 if (player.IsAlive())
10744 {
10745 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10746 if (r_index >= 0)
10747 {
10748 InventoryLocation r_il = new InventoryLocation;
10749 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10750
10751 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10754 {
10755 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10756 }
10758 {
10759 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10760 }
10761
10762 }
10763
10764 player.RemoveQuickBarEntityShortcut(this);
10765 }
10766 }
10767 }
10768
10770 {
10771 super.EEKilled(killer);
10772
10775 {
10776 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10777 {
10778 if (IsMagazine())
10779 {
10780 if (Magazine.Cast(this).GetAmmoCount() > 0)
10781 {
10783 }
10784 }
10785 else
10786 {
10788 }
10789 }
10790 }
10791 }
10792
10794 {
10795 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10796
10797 super.OnWasAttached(parent, slot_id);
10798
10801
10803 }
10804
10806 {
10807 super.OnWasDetached(parent, slot_id);
10808
10811 }
10812
10814 {
10815 int idx;
10818
10819 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10820 if (inventory_slots.Count() < 1)
10821 {
10822 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10823 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10824 }
10825 else
10826 {
10827 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10828 }
10829
10830 idx = inventory_slots.Find(slot);
10831 if (idx < 0)
10832 return "";
10833
10834 return attach_types.Get(idx);
10835 }
10836
10838 {
10839 int idx = -1;
10840 string slot;
10841
10844
10845 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10846 if (inventory_slots.Count() < 1)
10847 {
10848 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10849 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10850 }
10851 else
10852 {
10853 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10854 if (detach_types.Count() < 1)
10855 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10856 }
10857
10858 for (int i = 0; i < inventory_slots.Count(); i++)
10859 {
10860 slot = inventory_slots.Get(i);
10861 }
10862
10863 if (slot != "")
10864 {
10865 if (detach_types.Count() == 1)
10866 idx = 0;
10867 else
10868 idx = inventory_slots.Find(slot);
10869 }
10870 if (idx < 0)
10871 return "";
10872
10873 return detach_types.Get(idx);
10874 }
10875
10877 {
10878
10880
10881
10882 float min_time = 1;
10883 float max_time = 3;
10884 float delay = Math.RandomFloat(min_time, max_time);
10885
10886 explode_timer.Run(delay, this, "DoAmmoExplosion");
10887 }
10888
10890 {
10891 Magazine magazine = Magazine.Cast(this);
10892 int pop_sounds_count = 6;
10893 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10894
10895
10896 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10897 string sound_name = pop_sounds[ sound_idx ];
10899
10900
10901 magazine.ServerAddAmmoCount(-1);
10902
10903
10904 float min_temp_to_explode = 100;
10905
10906 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10907 {
10909 }
10910 }
10911
10912
10913 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10914 {
10915 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10916
10917 const int CHANCE_DAMAGE_CARGO = 4;
10918 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10919 const int CHANCE_DAMAGE_NOTHING = 2;
10920
10922 {
10923 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10924 int chances;
10925 int rnd;
10926
10927 if (GetInventory().GetCargo())
10928 {
10929 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10930 rnd = Math.RandomInt(0,chances);
10931
10932 if (rnd < CHANCE_DAMAGE_CARGO)
10933 {
10935 }
10936 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10937 {
10939 }
10940 }
10941 else
10942 {
10943 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10944 rnd = Math.RandomInt(0,chances);
10945
10946 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10947 {
10949 }
10950 }
10951 }
10952 }
10953
10955 {
10956 if (GetInventory().GetCargo())
10957 {
10958 int item_count = GetInventory().GetCargo().GetItemCount();
10959 if (item_count > 0)
10960 {
10961 int random_pick = Math.RandomInt(0, item_count);
10963 if (!item.IsExplosive())
10964 {
10965 item.AddHealth("","",damage);
10966 return true;
10967 }
10968 }
10969 }
10970 return false;
10971 }
10972
10974 {
10975 int attachment_count = GetInventory().AttachmentCount();
10976 if (attachment_count > 0)
10977 {
10978 int random_pick = Math.RandomInt(0, attachment_count);
10979 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10980 if (!attachment.IsExplosive())
10981 {
10982 attachment.AddHealth("","",damage);
10983 return true;
10984 }
10985 }
10986 return false;
10987 }
10988
10990 {
10992 }
10993
10995 {
10997 return GetInventory().CanRemoveEntity();
10998
10999 return false;
11000 }
11001
11003 {
11004
11006 return false;
11007
11008
11010 return false;
11011
11012
11013
11015 if (delta == 0)
11016 return false;
11017
11018
11019 return true;
11020 }
11021
11023 {
11025 {
11026 if (ScriptInputUserData.CanStoreInputUserData())
11027 {
11028 ScriptInputUserData ctx = new ScriptInputUserData;
11033 ctx.
Write(destination_entity);
11035 ctx.
Write(slot_id);
11037 }
11038 }
11039 else if (!
GetGame().IsMultiplayer())
11040 {
11042 }
11043 }
11044
11046 {
11047 float split_quantity_new;
11051 InventoryLocation loc = new InventoryLocation;
11052
11053 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11054 {
11056 split_quantity_new = stack_max;
11057 else
11059
11061 {
11062 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11063 if (new_item)
11064 {
11065 new_item.SetResultOfSplit(true);
11066 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11068 new_item.
SetQuantity(split_quantity_new,
false,
true);
11069 }
11070 }
11071 }
11072 else if (destination_entity && slot_id == -1)
11073 {
11074 if (quantity > stack_max)
11075 split_quantity_new = stack_max;
11076 else
11077 split_quantity_new = quantity;
11078
11080 {
11082 {
11085 }
11086
11087 if (new_item)
11088 {
11089 new_item.SetResultOfSplit(true);
11090 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11092 new_item.
SetQuantity(split_quantity_new,
false,
true);
11093 }
11094 }
11095 }
11096 else
11097 {
11098 if (stack_max != 0)
11099 {
11101 {
11103 }
11104
11105 if (split_quantity_new == 0)
11106 {
11107 if (!
GetGame().IsMultiplayer())
11108 player.PhysicalPredictiveDropItem(this);
11109 else
11110 player.ServerDropEntity(this);
11111 return;
11112 }
11113
11115 {
11117
11118 if (new_item)
11119 {
11120 new_item.SetResultOfSplit(true);
11121 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11124 new_item.PlaceOnSurface();
11125 }
11126 }
11127 }
11128 }
11129 }
11130
11132 {
11133 float split_quantity_new;
11137 InventoryLocation loc = new InventoryLocation;
11138
11139 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11140 {
11142 split_quantity_new = stack_max;
11143 else
11145
11147 {
11148 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11149 if (new_item)
11150 {
11151 new_item.SetResultOfSplit(true);
11152 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11154 new_item.
SetQuantity(split_quantity_new,
false,
true);
11155 }
11156 }
11157 }
11158 else if (destination_entity && slot_id == -1)
11159 {
11160 if (quantity > stack_max)
11161 split_quantity_new = stack_max;
11162 else
11163 split_quantity_new = quantity;
11164
11166 {
11168 {
11171 }
11172
11173 if (new_item)
11174 {
11175 new_item.SetResultOfSplit(true);
11176 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11178 new_item.
SetQuantity(split_quantity_new,
false,
true);
11179 }
11180 }
11181 }
11182 else
11183 {
11184 if (stack_max != 0)
11185 {
11187 {
11189 }
11190
11192 {
11194
11195 if (new_item)
11196 {
11197 new_item.SetResultOfSplit(true);
11198 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11201 new_item.PlaceOnSurface();
11202 }
11203 }
11204 }
11205 }
11206 }
11207
11209 {
11211 {
11212 if (ScriptInputUserData.CanStoreInputUserData())
11213 {
11214 ScriptInputUserData ctx = new ScriptInputUserData;
11219 dst.WriteToContext(ctx);
11221 }
11222 }
11223 else if (!
GetGame().IsMultiplayer())
11224 {
11226 }
11227 }
11228
11230 {
11232 {
11233 if (ScriptInputUserData.CanStoreInputUserData())
11234 {
11235 ScriptInputUserData ctx = new ScriptInputUserData;
11240 ctx.
Write(destination_entity);
11246 }
11247 }
11248 else if (!
GetGame().IsMultiplayer())
11249 {
11251 }
11252 }
11253
11255 {
11257 }
11258
11260 {
11262 float split_quantity_new;
11264 if (dst.IsValid())
11265 {
11266 int slot_id = dst.GetSlot();
11268
11269 if (quantity > stack_max)
11270 split_quantity_new = stack_max;
11271 else
11272 split_quantity_new = quantity;
11273
11275 {
11277
11278 if (new_item)
11279 {
11280 new_item.SetResultOfSplit(true);
11281 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11283 new_item.
SetQuantity(split_quantity_new,
false,
true);
11284 }
11285
11286 return new_item;
11287 }
11288 }
11289
11290 return null;
11291 }
11292
11294 {
11296 float split_quantity_new;
11298 if (destination_entity)
11299 {
11301 if (quantity > stackable)
11302 split_quantity_new = stackable;
11303 else
11304 split_quantity_new = quantity;
11305
11307 {
11308 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11309 if (new_item)
11310 {
11311 new_item.SetResultOfSplit(true);
11312 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11314 new_item.
SetQuantity(split_quantity_new,
false,
true);
11315 }
11316 }
11317 }
11318 }
11319
11321 {
11323 {
11324 if (ScriptInputUserData.CanStoreInputUserData())
11325 {
11326 ScriptInputUserData ctx = new ScriptInputUserData;
11331 ItemBase destination_entity =
this;
11332 ctx.
Write(destination_entity);
11336 }
11337 }
11338 else if (!
GetGame().IsMultiplayer())
11339 {
11341 }
11342 }
11343
11345 {
11347 float split_quantity_new;
11349 if (player)
11350 {
11352 if (quantity > stackable)
11353 split_quantity_new = stackable;
11354 else
11355 split_quantity_new = quantity;
11356
11358 {
11359 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11360 new_item =
ItemBase.Cast(in_hands);
11361 if (new_item)
11362 {
11363 new_item.SetResultOfSplit(true);
11364 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11366 new_item.SetQuantity(split_quantity_new, false, true);
11367 }
11368 }
11369 }
11370 }
11371
11373 {
11375 float split_quantity_new = Math.Floor(quantity * 0.5);
11376
11378 return;
11379
11381
11382 if (new_item)
11383 {
11384 if (new_item.GetQuantityMax() < split_quantity_new)
11385 {
11386 split_quantity_new = new_item.GetQuantityMax();
11387 }
11388
11389 new_item.SetResultOfSplit(true);
11390 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11391
11393 {
11396 }
11397 else
11398 {
11400 new_item.
SetQuantity(split_quantity_new,
false,
true);
11401 }
11402 }
11403 }
11404
11406 {
11408 float split_quantity_new = Math.Floor(quantity / 2);
11409
11411 return;
11412
11413 InventoryLocation invloc = new InventoryLocation;
11415
11417 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11418
11419 if (new_item)
11420 {
11421 if (new_item.GetQuantityMax() < split_quantity_new)
11422 {
11423 split_quantity_new = new_item.GetQuantityMax();
11424 }
11426 {
11429 }
11430 else if (split_quantity_new > 1)
11431 {
11433 new_item.
SetQuantity(split_quantity_new,
false,
true);
11434 }
11435 }
11436 }
11437
11440 {
11441 SetWeightDirty();
11443
11444 if (parent)
11445 parent.OnAttachmentQuantityChangedEx(this, delta);
11446
11448 {
11450 {
11452 }
11454 {
11455 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11457 }
11458 }
11459
11460 }
11461
11464 {
11465
11466 }
11467
11470 {
11472 }
11473
11475 {
11476 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11477
11479 {
11480 if (newLevel == GameConstants.STATE_RUINED)
11481 {
11483 EntityAI parent = GetHierarchyParent();
11484 if (parent && parent.IsFireplace())
11485 {
11486 CargoBase cargo = GetInventory().GetCargo();
11487 if (cargo)
11488 {
11490 {
11492 }
11493 }
11494 }
11495 }
11496
11498 {
11499
11501 return;
11502 }
11503
11504 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11505 {
11507 }
11508 }
11509 }
11510
11511
11513 {
11514 super.OnRightClick();
11515
11517 {
11519 {
11520 if (ScriptInputUserData.CanStoreInputUserData())
11521 {
11522 EntityAI root = GetHierarchyRoot();
11523 Man playerOwner = GetHierarchyRootPlayer();
11524 InventoryLocation dst = new InventoryLocation;
11525
11526
11527 if (!playerOwner && root && root == this)
11528 {
11530 }
11531 else
11532 {
11533
11534 GetInventory().GetCurrentInventoryLocation(dst);
11536 {
11539 {
11541 }
11542 else
11543 {
11545
11546
11547 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11548 {
11550 }
11551 else
11552 {
11553 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11554 }
11555 }
11556 }
11557 }
11558
11559 ScriptInputUserData ctx = new ScriptInputUserData;
11567 }
11568 }
11569 else if (!
GetGame().IsMultiplayer())
11570 {
11572 }
11573 }
11574 }
11575
11577 {
11578 if (root)
11579 {
11580 vector m4[4];
11581 root.GetTransform(m4);
11582 dst.SetGround(this, m4);
11583 }
11584 else
11585 {
11586 GetInventory().GetCurrentInventoryLocation(dst);
11587 }
11588 }
11589
11590 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11591 {
11592
11593 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11594 return false;
11595
11596 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11597 return false;
11598
11599
11601 return false;
11602
11603
11604 Magazine mag = Magazine.Cast(this);
11605 if (mag)
11606 {
11607 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11608 return false;
11609
11610 if (stack_max_limit)
11611 {
11612 Magazine other_mag = Magazine.Cast(other_item);
11613 if (other_item)
11614 {
11615 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11616 return false;
11617 }
11618
11619 }
11620 }
11621 else
11622 {
11623
11625 return false;
11626
11628 return false;
11629 }
11630
11631 PlayerBase player = null;
11632 if (CastTo(player, GetHierarchyRootPlayer()))
11633 {
11634 if (player.GetInventory().HasAttachment(this))
11635 return false;
11636
11637 if (player.IsItemsToDelete())
11638 return false;
11639 }
11640
11641 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11642 return false;
11643
11644 int slotID;
11646 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11647 return false;
11648
11649 return true;
11650 }
11651
11653 {
11655 }
11656
11658 {
11659 return m_IsResultOfSplit;
11660 }
11661
11663 {
11664 m_IsResultOfSplit = value;
11665 }
11666
11668 {
11670 }
11671
11673 {
11674 float other_item_quantity = other_item.GetQuantity();
11675 float this_free_space;
11676
11678
11680
11681 if (other_item_quantity > this_free_space)
11682 {
11683 return this_free_space;
11684 }
11685 else
11686 {
11687 return other_item_quantity;
11688 }
11689 }
11690
11692 {
11694 }
11695
11697 {
11699 return;
11700
11701 if (!IsMagazine() && other_item)
11702 {
11704 if (quantity_used != 0)
11705 {
11706 float hp1 = GetHealth01("","");
11707 float hp2 = other_item.GetHealth01("","");
11708 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11709 hpResult = hpResult / (
GetQuantity() + quantity_used);
11710
11711 hpResult *= GetMaxHealth();
11712 Math.Round(hpResult);
11713 SetHealth("", "Health", hpResult);
11714
11716 other_item.AddQuantity(-quantity_used);
11717 }
11718 }
11720 }
11721
11723 {
11724 #ifdef SERVER
11725 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11726 GetHierarchyParent().IncreaseLifetimeUp();
11727 #endif
11728 };
11729
11731 {
11732 PlayerBase p = PlayerBase.Cast(player);
11733
11734 array<int> recipesIds = p.m_Recipes;
11735 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11736 if (moduleRecipesManager)
11737 {
11738 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11739 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11740 }
11741
11742 for (int i = 0;i < recipesIds.Count(); i++)
11743 {
11744 int key = recipesIds.Get(i);
11745 string recipeName = moduleRecipesManager.GetRecipeName(key);
11747 }
11748 }
11749
11750
11751 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11752 {
11753 super.GetDebugActions(outputList);
11754
11755
11761
11762
11767
11772
11773
11777
11778
11780 {
11784 }
11785
11788
11789
11793
11795
11796 InventoryLocation loc = new InventoryLocation();
11797 GetInventory().GetCurrentInventoryLocation(loc);
11799 {
11800 if (Gizmo_IsSupported())
11803 }
11804
11806 }
11807
11808
11809
11810
11812 {
11813 super.OnAction(action_id, player, ctx);
11814
11816 {
11817 switch (action_id)
11818 {
11821 return true;
11824 return true;
11825 }
11826 }
11827
11829 {
11830 switch (action_id)
11831 {
11833 Delete();
11834 return true;
11835 }
11836 }
11837
11838 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11839 {
11840 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11841 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11842 PlayerBase p = PlayerBase.Cast(player);
11843 if (
EActions.RECIPES_RANGE_START < 1000)
11844 {
11845 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11846 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11847 }
11848 }
11849 #ifndef SERVER
11850 else if (action_id ==
EActions.WATCH_PLAYER)
11851 {
11852 PluginDeveloper.SetDeveloperItemClientEx(player);
11853 }
11854 #endif
11856 {
11857 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11858 {
11859 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11860 OnDebugButtonPressServer(id + 1);
11861 }
11862
11863 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11864 {
11865 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11867 }
11868
11869 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11870 {
11871 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11873 }
11874
11875 else if (action_id ==
EActions.ADD_QUANTITY)
11876 {
11877 if (IsMagazine())
11878 {
11879 Magazine mag = Magazine.Cast(this);
11880 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11881 }
11882 else
11883 {
11885 }
11886
11887 if (m_EM)
11888 {
11889 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11890 }
11891
11892 }
11893
11894 else if (action_id ==
EActions.REMOVE_QUANTITY)
11895 {
11896 if (IsMagazine())
11897 {
11898 Magazine mag2 = Magazine.Cast(this);
11899 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11900 }
11901 else
11902 {
11904 }
11905 if (m_EM)
11906 {
11907 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11908 }
11909
11910 }
11911
11912 else if (action_id ==
EActions.SET_QUANTITY_0)
11913 {
11915
11916 if (m_EM)
11917 {
11918 m_EM.SetEnergy(0);
11919 }
11920 }
11921
11922 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11923 {
11925
11926 if (m_EM)
11927 {
11928 m_EM.SetEnergy(m_EM.GetEnergyMax());
11929 }
11930 }
11931
11932 else if (action_id ==
EActions.ADD_HEALTH)
11933 {
11934 AddHealth("","",GetMaxHealth("","Health")/5);
11935 }
11936 else if (action_id ==
EActions.REMOVE_HEALTH)
11937 {
11938 AddHealth("","",-GetMaxHealth("","Health")/5);
11939 }
11940 else if (action_id ==
EActions.DESTROY_HEALTH)
11941 {
11942 SetHealth01("","",0);
11943 }
11944 else if (action_id ==
EActions.WATCH_ITEM)
11945 {
11947 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11948 #ifdef DEVELOPER
11949 SetDebugDeveloper_item(this);
11950 #endif
11951 }
11952
11953 else if (action_id ==
EActions.ADD_TEMPERATURE)
11954 {
11955 AddTemperature(20);
11956
11957 }
11958
11959 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11960 {
11961 AddTemperature(-20);
11962
11963 }
11964
11965 else if (action_id ==
EActions.FLIP_FROZEN)
11966 {
11967 SetFrozen(!GetIsFrozen());
11968
11969 }
11970
11971 else if (action_id ==
EActions.ADD_WETNESS)
11972 {
11974
11975 }
11976
11977 else if (action_id ==
EActions.REMOVE_WETNESS)
11978 {
11980
11981 }
11982
11983 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11984 {
11987
11988
11989 }
11990
11991 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11992 {
11995 }
11996
11997 else if (action_id ==
EActions.MAKE_SPECIAL)
11998 {
11999 auto debugParams = DebugSpawnParams.WithPlayer(player);
12000 OnDebugSpawnEx(debugParams);
12001 }
12002
12003 }
12004
12005
12006 return false;
12007 }
12008
12009
12010
12011
12015
12018
12019
12020
12022 {
12023 return false;
12024 }
12025
12026
12028 {
12029 return true;
12030 }
12031
12032
12034 {
12035 return true;
12036 }
12037
12038
12039
12041 {
12042 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
12044 }
12045
12048 {
12049 return null;
12050 }
12051
12053 {
12054 return false;
12055 }
12056
12058 {
12059 return false;
12060 }
12061
12065
12066
12068 {
12069 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12070 return module_repairing.CanRepair(this, item_repair_kit);
12071 }
12072
12073
12074 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12075 {
12076 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12077 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12078 }
12079
12080
12082 {
12083
12084
12085
12086
12087
12088
12089
12090
12091 return 1;
12092 }
12093
12094
12095
12097 {
12099 }
12100
12101
12102
12104 {
12106 }
12107
12108
12117 {
12118 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12119
12120 if (player)
12121 {
12122 player.MessageStatus(text);
12123 }
12124 }
12125
12126
12135 {
12136 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12137
12138 if (player)
12139 {
12140 player.MessageAction(text);
12141 }
12142 }
12143
12144
12153 {
12154 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12155
12156 if (player)
12157 {
12158 player.MessageFriendly(text);
12159 }
12160 }
12161
12162
12171 {
12172 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12173
12174 if (player)
12175 {
12176 player.MessageImportant(text);
12177 }
12178 }
12179
12181 {
12182 return true;
12183 }
12184
12185
12186 override bool KindOf(
string tag)
12187 {
12188 bool found = false;
12189 string item_name = this.
GetType();
12192
12193 int array_size = item_tag_array.Count();
12194 for (int i = 0; i < array_size; i++)
12195 {
12196 if (item_tag_array.Get(i) == tag)
12197 {
12198 found = true;
12199 break;
12200 }
12201 }
12202 return found;
12203 }
12204
12205
12207 {
12208
12209 super.OnRPC(sender, rpc_type,ctx);
12210
12211
12212 switch (rpc_type)
12213 {
12214 #ifndef SERVER
12215 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12216 Param2<bool, string> p = new Param2<bool, string>(false, "");
12217
12219 return;
12220
12221 bool play = p.param1;
12222 string soundSet = p.param2;
12223
12224 if (play)
12225 {
12227 {
12229 {
12231 }
12232 }
12233 else
12234 {
12236 }
12237 }
12238 else
12239 {
12241 }
12242
12243 break;
12244 #endif
12245
12246 }
12247
12249 {
12251 }
12252 }
12253
12254
12255
12256
12258 {
12259 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12260 return plugin.GetID(
name);
12261 }
12262
12264 {
12265 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12266 return plugin.GetName(id);
12267 }
12268
12271 {
12272
12273
12274 int varFlags;
12275 if (!ctx.
Read(varFlags))
12276 return;
12277
12278 if (varFlags & ItemVariableFlags.FLOAT)
12279 {
12281 }
12282 }
12283
12285 {
12286
12287 super.SerializeNumericalVars(floats_out);
12288
12289
12290
12292 {
12294 }
12295
12297 {
12299 }
12300
12302 {
12304 }
12305
12307 {
12312 }
12313
12315 {
12317 }
12318 }
12319
12321 {
12322
12323 super.DeSerializeNumericalVars(floats);
12324
12325
12326 int index = 0;
12327 int mask = Math.Round(floats.Get(index));
12328
12329 index++;
12330
12332 {
12334 {
12336 }
12337 else
12338 {
12339 float quantity = floats.Get(index);
12340 SetQuantity(quantity,
true,
false,
false,
false);
12341 }
12342 index++;
12343 }
12344
12346 {
12347 float wet = floats.Get(index);
12349 index++;
12350 }
12351
12353 {
12354 int liquidtype = Math.Round(floats.Get(index));
12356 index++;
12357 }
12358
12360 {
12362 index++;
12364 index++;
12366 index++;
12368 index++;
12369 }
12370
12372 {
12373 int cleanness = Math.Round(floats.Get(index));
12375 index++;
12376 }
12377 }
12378
12380 {
12381 super.WriteVarsToCTX(ctx);
12382
12383
12385 {
12387 }
12388
12390 {
12392 }
12393
12395 {
12397 }
12398
12400 {
12401 int r,g,b,a;
12407 }
12408
12410 {
12412 }
12413 }
12414
12416 {
12417 if (!super.ReadVarsFromCTX(ctx,version))
12418 return false;
12419
12420 int intValue;
12421 float value;
12422
12423 if (version < 140)
12424 {
12425 if (!ctx.
Read(intValue))
12426 return false;
12427
12428 m_VariablesMask = intValue;
12429 }
12430
12432 {
12433 if (!ctx.
Read(value))
12434 return false;
12435
12437 {
12439 }
12440 else
12441 {
12443 }
12444 }
12445
12446 if (version < 140)
12447 {
12449 {
12450 if (!ctx.
Read(value))
12451 return false;
12452 SetTemperatureDirect(value);
12453 }
12454 }
12455
12457 {
12458 if (!ctx.
Read(value))
12459 return false;
12461 }
12462
12464 {
12465 if (!ctx.
Read(intValue))
12466 return false;
12468 }
12469
12471 {
12472 int r,g,b,a;
12474 return false;
12476 return false;
12478 return false;
12480 return false;
12481
12483 }
12484
12486 {
12487 if (!ctx.
Read(intValue))
12488 return false;
12490 }
12491
12492 if (version >= 138 && version < 140)
12493 {
12495 {
12496 if (!ctx.
Read(intValue))
12497 return false;
12498 SetFrozen(intValue);
12499 }
12500 }
12501
12502 return true;
12503 }
12504
12505
12507 {
12510 {
12512 }
12513
12514 if (!super.OnStoreLoad(ctx, version))
12515 {
12517 return false;
12518 }
12519
12520 if (version >= 114)
12521 {
12522 bool hasQuickBarIndexSaved;
12523
12524 if (!ctx.
Read(hasQuickBarIndexSaved))
12525 {
12527 return false;
12528 }
12529
12530 if (hasQuickBarIndexSaved)
12531 {
12532 int itmQBIndex;
12533
12534
12535 if (!ctx.
Read(itmQBIndex))
12536 {
12538 return false;
12539 }
12540
12541 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12542 if (itmQBIndex != -1 && parentPlayer)
12543 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12544 }
12545 }
12546 else
12547 {
12548
12549 PlayerBase player;
12550 int itemQBIndex;
12551 if (version ==
int.
MAX)
12552 {
12553 if (!ctx.
Read(itemQBIndex))
12554 {
12556 return false;
12557 }
12558 }
12559 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12560 {
12561
12562 if (!ctx.
Read(itemQBIndex))
12563 {
12565 return false;
12566 }
12567 if (itemQBIndex != -1 && player)
12568 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12569 }
12570 }
12571
12572 if (version < 140)
12573 {
12574
12575 if (!LoadVariables(ctx, version))
12576 {
12578 return false;
12579 }
12580 }
12581
12582
12584 {
12586 return false;
12587 }
12588 if (version >= 132)
12589 {
12591 if (raib)
12592 {
12594 {
12596 return false;
12597 }
12598 }
12599 }
12600
12602 return true;
12603 }
12604
12605
12606
12608 {
12609 super.OnStoreSave(ctx);
12610
12611 PlayerBase player;
12612 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12613 {
12615
12616 int itemQBIndex = -1;
12617 itemQBIndex = player.FindQuickBarEntityIndex(this);
12618 ctx.
Write(itemQBIndex);
12619 }
12620 else
12621 {
12623 }
12624
12626
12628 if (raib)
12629 {
12631 }
12632 }
12633
12634
12636 {
12637 super.AfterStoreLoad();
12638
12640 {
12642 }
12643
12645 {
12648 }
12649 }
12650
12652 {
12653 super.EEOnAfterLoad();
12654
12656 {
12658 }
12659
12662 }
12663
12665 {
12666 return false;
12667 }
12668
12669
12670
12672 {
12674 {
12675 #ifdef PLATFORM_CONSOLE
12676
12678 {
12680 if (menu)
12681 {
12683 }
12684 }
12685 #endif
12686 }
12687
12689 {
12692 }
12693
12695 {
12696 SetWeightDirty();
12698 }
12700 {
12703 }
12704
12706 {
12709 }
12711 {
12714 }
12715
12716 super.OnVariablesSynchronized();
12717 }
12718
12719
12720
12722 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12723 {
12724 if (!IsServerCheck(allow_client))
12725 return false;
12726
12728 return false;
12729
12732
12733 if (value <= (min + 0.001))
12734 value = min;
12735
12736 if (value == min)
12737 {
12738 if (destroy_config)
12739 {
12740 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12741 if (dstr)
12742 {
12744 this.Delete();
12745 return true;
12746 }
12747 }
12748 else if (destroy_forced)
12749 {
12751 this.Delete();
12752 return true;
12753 }
12754
12756 }
12757
12760
12762 {
12764
12765 if (delta)
12767 }
12768
12770
12771 return false;
12772 }
12773
12774
12776 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12777 {
12779 }
12780
12782 {
12785 }
12786
12788 {
12791 }
12792
12794 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12795 {
12796 float value_clamped = Math.Clamp(value, 0, 1);
12798 SetQuantity(result, destroy_config, destroy_forced);
12799 }
12800
12801
12804 {
12806 }
12807
12809 {
12811 }
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12823 {
12824 int slot = -1;
12825 if (GetInventory())
12826 {
12827 InventoryLocation il = new InventoryLocation;
12828 GetInventory().GetCurrentInventoryLocation(il);
12830 }
12831
12833 }
12834
12836 {
12837 float quantity_max = 0;
12838
12840 {
12841 if (attSlotID != -1)
12842 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12843
12844 if (quantity_max <= 0)
12846 }
12847
12848 if (quantity_max <= 0)
12850
12851 return quantity_max;
12852 }
12853
12855 {
12857 }
12858
12860 {
12862 }
12863
12864
12866 {
12868 }
12869
12871 {
12873 }
12874
12876 {
12878 }
12879
12880
12882 {
12883
12884 float weightEx = GetWeightEx();
12885 float special = GetInventoryAndCargoWeight();
12886 return weightEx - special;
12887 }
12888
12889
12891 {
12893 }
12894
12896 {
12898 {
12899 #ifdef DEVELOPER
12900 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12901 {
12902 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12904 }
12905 #endif
12906
12907 return GetQuantity() * GetConfigWeightModified();
12908 }
12909 else if (HasEnergyManager())
12910 {
12911 #ifdef DEVELOPER
12912 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12913 {
12914 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12915 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12916 }
12917 #endif
12918 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12919 }
12920 else
12921 {
12922 #ifdef DEVELOPER
12923 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12924 {
12925 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12926 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12927 }
12928 #endif
12929 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12930 }
12931 }
12932
12935 {
12936 int item_count = 0;
12938
12939 if (GetInventory().GetCargo() != NULL)
12940 {
12941 item_count = GetInventory().GetCargo().GetItemCount();
12942 }
12943
12944 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12945 {
12946 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12947 if (item)
12948 item_count += item.GetNumberOfItems();
12949 }
12950 return item_count;
12951 }
12952
12955 {
12956 float weight = 0;
12957 float wetness = 1;
12958 if (include_wetness)
12961 {
12962 weight = wetness * m_ConfigWeight;
12963 }
12965 {
12966 weight = 1;
12967 }
12968 return weight;
12969 }
12970
12971
12972
12974 {
12975 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12976 {
12977 GameInventory inv = GetInventory();
12978 array<EntityAI> items = new array<EntityAI>;
12980 for (int i = 0; i < items.Count(); i++)
12981 {
12983 if (item)
12984 {
12986 }
12987 }
12988 }
12989 }
12990
12991
12992
12993
12995 {
12996 float energy = 0;
12997 if (HasEnergyManager())
12998 {
12999 energy = GetCompEM().GetEnergy();
13000 }
13001 return energy;
13002 }
13003
13004
13006 {
13007 super.OnEnergyConsumed();
13008
13010 }
13011
13013 {
13014 super.OnEnergyAdded();
13015
13017 }
13018
13019
13021 {
13022 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
13023 {
13025 {
13026 float energy_0to1 = GetCompEM().GetEnergy0To1();
13028 }
13029 }
13030 }
13031
13032
13034 {
13035 return ConfigGetFloat("heatIsolation");
13036 }
13037
13039 {
13041 }
13042
13044 {
13045 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
13046 if (
GetGame().ConfigIsExisting(paramPath))
13048
13049 return 0.0;
13050 }
13051
13053 {
13054 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
13055 if (
GetGame().ConfigIsExisting(paramPath))
13057
13058 return 0.0;
13059 }
13060
13061 override void SetWet(
float value,
bool allow_client =
false)
13062 {
13063 if (!IsServerCheck(allow_client))
13064 return;
13065
13068
13070
13071 m_VarWet = Math.Clamp(value, min, max);
13072
13074 {
13077 }
13078 }
13079
13080 override void AddWet(
float value)
13081 {
13083 }
13084
13086 {
13088 }
13089
13091 {
13093 }
13094
13096 {
13098 }
13099
13101 {
13103 }
13104
13106 {
13108 }
13109
13110 override void OnWetChanged(
float newVal,
float oldVal)
13111 {
13114 if (newLevel != oldLevel)
13115 {
13117 }
13118 }
13119
13121 {
13122 SetWeightDirty();
13123 }
13124
13126 {
13127 return GetWetLevelInternal(
m_VarWet);
13128 }
13129
13130
13131
13133 {
13135 }
13136
13138 {
13140 }
13141
13143 {
13145 }
13146
13148 {
13150 }
13151
13152
13153
13155 {
13156 if (ConfigIsExisting("itemModelLength"))
13157 {
13158 return ConfigGetFloat("itemModelLength");
13159 }
13160 return 0;
13161 }
13162
13164 {
13165 if (ConfigIsExisting("itemAttachOffset"))
13166 {
13167 return ConfigGetFloat("itemAttachOffset");
13168 }
13169 return 0;
13170 }
13171
13172 override void SetCleanness(
int value,
bool allow_client =
false)
13173 {
13174 if (!IsServerCheck(allow_client))
13175 return;
13176
13178
13180
13183 }
13184
13186 {
13188 }
13189
13191 {
13192 return true;
13193 }
13194
13195
13196
13197
13199 {
13201 }
13202
13204 {
13206 }
13207
13208
13209
13210
13211 override void SetColor(
int r,
int g,
int b,
int a)
13212 {
13218 }
13220 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13221 {
13226 }
13227
13229 {
13231 }
13232
13235 {
13236 int r,g,b,a;
13238 r = r/255;
13239 g = g/255;
13240 b = b/255;
13241 a = a/255;
13242 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13243 }
13244
13245
13246
13247 override void SetLiquidType(
int value,
bool allow_client =
false)
13248 {
13249 if (!IsServerCheck(allow_client))
13250 return;
13251
13256 }
13257
13259 {
13260 return ConfigGetInt("varLiquidTypeInit");
13261 }
13262
13264 {
13266 }
13267
13269 {
13271 SetFrozen(false);
13272 }
13273
13276 {
13277 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13278 }
13279
13280
13283 {
13284 PlayerBase nplayer;
13285 if (PlayerBase.CastTo(nplayer, player))
13286 {
13288
13289 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13290 }
13291 }
13292
13293
13296 {
13297 PlayerBase nplayer;
13298 if (PlayerBase.CastTo(nplayer,player))
13299 {
13300
13301 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13302
13303 }
13304
13305
13306 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13307
13308
13309 if (HasEnergyManager())
13310 {
13311 GetCompEM().UpdatePlugState();
13312 }
13313 }
13314
13315
13317 {
13318 super.OnPlacementStarted(player);
13319
13321 }
13322
13323 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13324 {
13326 {
13327 m_AdminLog.OnPlacementComplete(player,
this);
13328 }
13329
13330 super.OnPlacementComplete(player, position, orientation);
13331 }
13332
13333
13334
13335
13336
13338 {
13340 {
13341 return true;
13342 }
13343 else
13344 {
13345 return false;
13346 }
13347 }
13348
13349
13351 {
13353 {
13355 }
13356 }
13357
13358
13360 {
13362 }
13363
13365 {
13367 }
13368
13369 override void InsertAgent(
int agent,
float count = 1)
13370 {
13371 if (count < 1)
13372 return;
13373
13375 }
13376
13379 {
13381 }
13382
13383
13385 {
13387 }
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13431 {
13433 return false;
13434 return true;
13435 }
13436
13438 {
13439
13441 }
13442
13443
13446 {
13447 super.CheckForRoofLimited(timeTresholdMS);
13448
13450 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13451 {
13452 m_PreviousRoofTestTime = time;
13453 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13454 }
13455 }
13456
13457
13459 {
13461 {
13462 return 0;
13463 }
13464
13465 if (GetInventory().GetAttachmentSlotsCount() != 0)
13466 {
13467 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13468 if (filter)
13469 return filter.GetProtectionLevel(type, false, system);
13470 else
13471 return 0;
13472 }
13473
13474 string subclassPath, entryName;
13475
13476 switch (type)
13477 {
13479 entryName = "biological";
13480 break;
13482 entryName = "chemical";
13483 break;
13484 default:
13485 entryName = "biological";
13486 break;
13487 }
13488
13489 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13490
13492 }
13493
13494
13495
13498 {
13499 if (!IsMagazine())
13501
13503 }
13504
13505
13506
13507
13508
13513 {
13514 return true;
13515 }
13516
13518 {
13520 }
13521
13522
13523
13524
13525
13527 {
13528 if (parent)
13529 {
13530 if (parent.IsInherited(DayZInfected))
13531 return true;
13532
13533 if (!parent.IsRuined())
13534 return true;
13535 }
13536
13537 return true;
13538 }
13539
13541 {
13542 if (!super.CanPutAsAttachment(parent))
13543 {
13544 return false;
13545 }
13546
13547 if (!IsRuined() && !parent.IsRuined())
13548 {
13549 return true;
13550 }
13551
13552 return false;
13553 }
13554
13556 {
13557
13558
13559
13560
13561 return super.CanReceiveItemIntoCargo(item);
13562 }
13563
13565 {
13566
13567
13568
13569
13570 GameInventory attachmentInv = attachment.GetInventory();
13572 {
13573 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13574 return false;
13575 }
13576
13577 InventoryLocation loc = new InventoryLocation();
13578 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13579 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13580 return false;
13581
13582 return super.CanReceiveAttachment(attachment, slotId);
13583 }
13584
13586 {
13587 if (!super.CanReleaseAttachment(attachment))
13588 return false;
13589
13590 return GetInventory().AreChildrenAccessible();
13591 }
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13614 {
13615 int id = muzzle_owner.GetMuzzleID();
13616 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13617
13618 if (WPOF_array)
13619 {
13620 for (int i = 0; i < WPOF_array.Count(); i++)
13621 {
13622 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13623
13624 if (WPOF)
13625 {
13626 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13627 }
13628 }
13629 }
13630 }
13631
13632
13634 {
13635 int id = muzzle_owner.GetMuzzleID();
13637
13638 if (WPOBE_array)
13639 {
13640 for (int i = 0; i < WPOBE_array.Count(); i++)
13641 {
13642 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13643
13644 if (WPOBE)
13645 {
13646 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13647 }
13648 }
13649 }
13650 }
13651
13652
13654 {
13655 int id = muzzle_owner.GetMuzzleID();
13656 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13657
13658 if (WPOOH_array)
13659 {
13660 for (int i = 0; i < WPOOH_array.Count(); i++)
13661 {
13662 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13663
13664 if (WPOOH)
13665 {
13666 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13667 }
13668 }
13669 }
13670 }
13671
13672
13674 {
13675 int id = muzzle_owner.GetMuzzleID();
13676 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13677
13678 if (WPOOH_array)
13679 {
13680 for (int i = 0; i < WPOOH_array.Count(); i++)
13681 {
13682 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13683
13684 if (WPOOH)
13685 {
13686 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13687 }
13688 }
13689 }
13690 }
13691
13692
13694 {
13695 int id = muzzle_owner.GetMuzzleID();
13696 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13697
13698 if (WPOOH_array)
13699 {
13700 for (int i = 0; i < WPOOH_array.Count(); i++)
13701 {
13702 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13703
13704 if (WPOOH)
13705 {
13706 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13707 }
13708 }
13709 }
13710 }
13711
13712
13713
13715 {
13717 {
13718 return true;
13719 }
13720
13721 return false;
13722 }
13723
13725 {
13727 {
13728 return true;
13729 }
13730
13731 return false;
13732 }
13733
13735 {
13737 {
13738 return true;
13739 }
13740
13741 return false;
13742 }
13743
13745 {
13746 return false;
13747 }
13748
13751 {
13752 return UATimeSpent.DEFAULT_DEPLOY;
13753 }
13754
13755
13756
13757
13759 {
13761 SetSynchDirty();
13762 }
13763
13765 {
13767 }
13768
13769
13771 {
13772 return false;
13773 }
13774
13777 {
13778 string att_type = "None";
13779
13780 if (ConfigIsExisting("soundAttType"))
13781 {
13782 att_type = ConfigGetString("soundAttType");
13783 }
13784
13786 }
13787
13789 {
13791 }
13792
13793
13794
13795
13796
13802
13804 {
13807
13809 }
13810
13811
13813 {
13815 return;
13816
13818
13821
13824
13825 SoundParameters params = new SoundParameters();
13829 }
13830
13831
13833 {
13835 return;
13836
13838 SetSynchDirty();
13839
13842 }
13843
13844
13846 {
13848 return;
13849
13851 SetSynchDirty();
13852
13855 }
13856
13858 {
13860 }
13861
13863 {
13865 }
13866
13869 {
13870 if (!
GetGame().IsDedicatedServer())
13871 {
13872 if (ConfigIsExisting("attachSoundSet"))
13873 {
13874 string cfg_path = "";
13875 string soundset = "";
13876 string type_name =
GetType();
13877
13880 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13881 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13882
13883 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13884 {
13885 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13886 {
13887 if (cfg_slot_array[i] == slot_type)
13888 {
13889 soundset = cfg_soundset_array[i];
13890 break;
13891 }
13892 }
13893 }
13894
13895 if (soundset != "")
13896 {
13897 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13899 }
13900 }
13901 }
13902 }
13903
13905 {
13906
13907 }
13908
13909 void OnApply(PlayerBase player);
13910
13912 {
13913 return 1.0;
13914 };
13915
13917 {
13919 }
13920
13922 {
13924 }
13925
13927
13929 {
13930 SetDynamicPhysicsLifeTime(0.01);
13932 }
13933
13935 {
13936 array<string> zone_names = new array<string>;
13937 GetDamageZones(zone_names);
13938 for (int i = 0; i < zone_names.Count(); i++)
13939 {
13940 SetHealthMax(zone_names.Get(i),"Health");
13941 }
13942 SetHealthMax("","Health");
13943 }
13944
13947 {
13948 float global_health = GetHealth01("","Health");
13949 array<string> zones = new array<string>;
13950 GetDamageZones(zones);
13951
13952 for (int i = 0; i < zones.Count(); i++)
13953 {
13954 SetHealth01(zones.Get(i),"Health",global_health);
13955 }
13956 }
13957
13960 {
13961 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13962 }
13963
13965 {
13966 if (!hasRootAsPlayer)
13967 {
13968 if (refParentIB)
13969 {
13970
13971 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13972 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13973
13974 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13975 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13976
13979 }
13980 else
13981 {
13982
13985 }
13986 }
13987 }
13988
13990 {
13992 {
13993 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13994 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13995 {
13996 float heatPermCoef = 1.0;
13998 while (ent)
13999 {
14000 heatPermCoef *= ent.GetHeatPermeabilityCoef();
14001 ent = ent.GetHierarchyParent();
14002 }
14003
14004 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
14005 }
14006 }
14007 }
14008
14010 {
14011
14012 EntityAI parent = GetHierarchyParent();
14013 if (!parent)
14014 {
14015 hasParent = false;
14016 hasRootAsPlayer = false;
14017 }
14018 else
14019 {
14020 hasParent = true;
14021 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
14022 refParentIB =
ItemBase.Cast(parent);
14023 }
14024 }
14025
14026 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
14027 {
14028
14029 }
14030
14032 {
14033
14034 return false;
14035 }
14036
14038 {
14039
14040
14041 return false;
14042 }
14043
14045 {
14046
14047 return false;
14048 }
14049
14052 {
14053 return !GetIsFrozen() &&
IsOpen();
14054 }
14055
14057 {
14058 bool hasParent = false, hasRootAsPlayer = false;
14060
14061 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
14062 bool foodDecay =
g_Game.IsFoodDecayEnabled();
14063
14064 if (wwtu || foodDecay)
14065 {
14069
14070 if (processWetness || processTemperature || processDecay)
14071 {
14073
14074 if (processWetness)
14075 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14076
14077 if (processTemperature)
14079
14080 if (processDecay)
14081 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14082 }
14083 }
14084 }
14085
14088 {
14090 }
14091
14093 {
14096
14097 return super.GetTemperatureFreezeThreshold();
14098 }
14099
14101 {
14104
14105 return super.GetTemperatureThawThreshold();
14106 }
14107
14109 {
14112
14113 return super.GetItemOverheatThreshold();
14114 }
14115
14117 {
14119 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14120
14121 return super.GetTemperatureFreezeTime();
14122 }
14123
14125 {
14127 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14128
14129 return super.GetTemperatureThawTime();
14130 }
14131
14136
14138 {
14139 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14140 }
14141
14143 {
14144 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14145 }
14146
14149 {
14151 }
14152
14154 {
14156 }
14157
14159 {
14161 }
14162
14165 {
14166 return null;
14167 }
14168
14171 {
14172 return false;
14173 }
14174
14176 {
14178 {
14181 if (!trg)
14182 {
14184 explosive = this;
14185 }
14186
14187 explosive.PairRemote(trg);
14189
14190 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14191 trg.SetPersistentPairID(persistentID);
14192 explosive.SetPersistentPairID(persistentID);
14193
14194 return true;
14195 }
14196 return false;
14197 }
14198
14201 {
14202 float ret = 1.0;
14205 ret *= GetHealth01();
14206
14207 return ret;
14208 }
14209
14210 #ifdef DEVELOPER
14211 override void SetDebugItem()
14212 {
14213 super.SetDebugItem();
14214 _itemBase = this;
14215 }
14216
14218 {
14219 string text = super.GetDebugText();
14220
14222 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14223
14224 return text;
14225 }
14226 #endif
14227
14229 {
14230 return true;
14231 }
14232
14234
14236
14238 {
14241 }
14242
14243
14251
14267}
14268
14270{
14272 if (entity)
14273 {
14274 bool is_item = entity.IsInherited(
ItemBase);
14275 if (is_item && full_quantity)
14276 {
14279 }
14280 }
14281 else
14282 {
14284 return NULL;
14285 }
14286 return entity;
14287}
14288
14290{
14291 if (item)
14292 {
14293 if (health > 0)
14294 item.SetHealth("", "", health);
14295
14296 if (item.CanHaveTemperature())
14297 {
14299 if (item.CanFreeze())
14300 item.SetFrozen(false);
14301 }
14302
14303 if (item.HasEnergyManager())
14304 {
14305 if (quantity >= 0)
14306 {
14307 item.GetCompEM().SetEnergy0To1(quantity);
14308 }
14309 else
14310 {
14312 }
14313 }
14314 else if (item.IsMagazine())
14315 {
14316 Magazine mag = Magazine.Cast(item);
14317 if (quantity >= 0)
14318 {
14319 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14320 }
14321 else
14322 {
14324 }
14325
14326 }
14327 else
14328 {
14329 if (quantity >= 0)
14330 {
14331 item.SetQuantityNormalized(quantity, false);
14332 }
14333 else
14334 {
14336 }
14337
14338 }
14339 }
14340}
14341
14342#ifdef DEVELOPER
14344#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.