9378{
9380 {
9381 return true;
9382 }
9383};
9384
9385
9386
9388{
9392
9394
9397
9398
9399
9400
9401
9410
9416
9421
9426
9447 protected bool m_IsResultOfSplit
9448
9450
9455
9456
9457
9459
9463
9464
9465
9467
9470
9471
9472
9478
9479
9487
9490
9491
9493
9494
9496
9497
9502
9503
9508
9509
9511
9512
9514 {
9519
9520 if (!
GetGame().IsDedicatedServer())
9521 {
9523 {
9525
9527 {
9529 }
9530 }
9531
9534 }
9535
9536 m_OldLocation = null;
9537
9539 {
9541 }
9542
9543 if (ConfigIsExisting("headSelectionsToHide"))
9544 {
9547 }
9548
9550 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9551 {
9553 }
9554
9556
9557 m_IsResultOfSplit = false;
9558
9560 }
9561
9563 {
9564 super.InitItemVariables();
9565
9571 m_Count = ConfigGetInt(
"count");
9572
9575
9580
9583
9588
9600
9604
9605
9608 if (ConfigIsExisting("canBeSplit"))
9609 {
9612 }
9613
9615 if (ConfigIsExisting("itemBehaviour"))
9617
9618
9621 RegisterNetSyncVariableInt("m_VarLiquidType");
9622 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9623
9624 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9625 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9626 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9627
9628 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9629 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9630 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9631 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9632
9633 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9634 RegisterNetSyncVariableBool("m_IsTakeable");
9635 RegisterNetSyncVariableBool("m_IsHologram");
9636
9639 {
9642 }
9643
9645
9647 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9649
9650 }
9651
9653 {
9655 }
9656
9658 {
9661 {
9666 }
9667 }
9668
9669 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9670 {
9672 {
9675 }
9676
9678 }
9679
9681 {
9687 }
9688
9690
9692 {
9694
9695 if (!action)
9696 {
9697 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9698 return;
9699 }
9700
9702 if (!ai)
9703 {
9705 return;
9706 }
9707
9709 if (!action_array)
9710 {
9711 action_array = new array<ActionBase_Basic>;
9713 }
9714 if (LogManager.IsActionLogEnable())
9715 {
9716 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9717 }
9718
9719 if (action_array.Find(action) != -1)
9720 {
9721 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9722 }
9723 else
9724 {
9725 action_array.Insert(action);
9726 }
9727 }
9728
9730 {
9732 ActionBase action = player.GetActionManager().GetAction(actionName);
9735
9736 if (action_array)
9737 {
9738 action_array.RemoveItem(action);
9739 }
9740 }
9741
9742
9743
9745 {
9746 ActionOverrideData overrideData = new ActionOverrideData();
9750
9752 if (!actionMap)
9753 {
9756 }
9757
9758 actionMap.Insert(this.
Type(), overrideData);
9759
9760 }
9761
9763
9765
9766
9768 {
9771
9774
9775 string config_to_search = "CfgVehicles";
9776 string muzzle_owner_config;
9777
9779 {
9780 if (IsInherited(Weapon))
9781 config_to_search = "CfgWeapons";
9782
9783 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9784
9785 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9786
9788
9789 if (config_OnFire_subclass_count > 0)
9790 {
9791 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9792
9793 for (int i = 0; i < config_OnFire_subclass_count; i++)
9794 {
9795 string particle_class = "";
9797 string config_OnFire_entry = config_OnFire_class + particle_class;
9798 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9799 WPOF_array.Insert(WPOF);
9800 }
9801
9802
9804 }
9805 }
9806
9808 {
9809 config_to_search = "CfgWeapons";
9810 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9811
9812 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9813
9815
9816 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9817 {
9818 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9819
9820 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9821 {
9822 string particle_class2 = "";
9824 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9825 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9826 WPOBE_array.Insert(WPOBE);
9827 }
9828
9829
9831 }
9832 }
9833 }
9834
9835
9837 {
9840
9842 {
9843 string config_to_search = "CfgVehicles";
9844
9845 if (IsInherited(Weapon))
9846 config_to_search = "CfgWeapons";
9847
9848 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9849 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9850
9851 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9852 {
9853
9855
9857 {
9859 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9861 return;
9862 }
9863
9866
9867
9868
9870 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9871
9872 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9873 {
9874 string particle_class = "";
9876 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9878
9879 if (entry_type == CT_CLASS)
9880 {
9881 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9882 WPOOH_array.Insert(WPOF);
9883 }
9884 }
9885
9886
9888 }
9889 }
9890 }
9891
9893 {
9895 }
9896
9898 {
9900 {
9902
9905
9908
9909 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9910 }
9911 }
9912
9914 {
9916 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9917
9919 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9920
9922 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9923
9925 {
9927 }
9928 }
9929
9931 {
9933 }
9934
9936 {
9939 else
9941
9943 {
9946 }
9947 else
9948 {
9951
9954 }
9955
9957 }
9958
9960 {
9962 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9963 }
9964
9966 {
9968 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9970 }
9971
9973 {
9975 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9976 }
9977
9979 {
9982
9983 OverheatingParticle OP = new OverheatingParticle();
9988
9990 }
9991
9993 {
9996
9997 return -1;
9998 }
9999
10001 {
10003 {
10006
10007 for (int i = count; i > 0; --i)
10008 {
10009 int id = i - 1;
10012
10015
10016 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
10017 {
10018 if (p)
10019 {
10022 }
10023 }
10024 }
10025 }
10026 }
10027
10029 {
10031 {
10033 {
10034 int id = i - 1;
10036
10037 if (OP)
10038 {
10040
10041 if (p)
10042 {
10044 }
10045
10046 delete OP;
10047 }
10048 }
10049
10052 }
10053 }
10054
10057 {
10058 return 0.0;
10059 }
10060
10061
10063 {
10064 return 250;
10065 }
10066
10068 {
10069 return 0;
10070 }
10071
10074 {
10076 return true;
10077
10078 return false;
10079 }
10080
10083 {
10086
10088 {
10090 }
10091 else
10092 {
10093
10095 }
10096
10098 }
10099
10106 {
10107 return -1;
10108 }
10109
10110
10111
10112
10114 {
10116 {
10118 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10119
10120 if (r_index >= 0)
10121 {
10122 InventoryLocation r_il = new InventoryLocation;
10123 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10124
10125 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10128 {
10129 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10130 }
10132 {
10133 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10134 }
10135
10136 }
10137
10138 player.GetHumanInventory().ClearUserReservedLocation(this);
10139 }
10140
10143 }
10144
10145
10146
10147
10149 {
10150 return ItemBase.m_DebugActionsMask;
10151 }
10152
10154 {
10155 return ItemBase.m_DebugActionsMask & mask;
10156 }
10157
10159 {
10160 ItemBase.m_DebugActionsMask = mask;
10161 }
10162
10164 {
10165 ItemBase.m_DebugActionsMask |= mask;
10166 }
10167
10169 {
10170 ItemBase.m_DebugActionsMask &= ~mask;
10171 }
10172
10174 {
10176 {
10178 }
10179 else
10180 {
10182 }
10183 }
10184
10185
10187 {
10188 if (GetEconomyProfile())
10189 {
10190 float q_max = GetEconomyProfile().GetQuantityMax();
10191 if (q_max > 0)
10192 {
10193 float q_min = GetEconomyProfile().GetQuantityMin();
10194 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10195
10197 {
10198 ComponentEnergyManager comp = GetCompEM();
10200 {
10202 }
10203 }
10205 {
10207
10208 }
10209
10210 }
10211 }
10212 }
10213
10216 {
10217 EntityAI parent = GetHierarchyParent();
10218
10219 if (parent)
10220 {
10221 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10222 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10223 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10224 }
10225 }
10226
10229 {
10230 EntityAI parent = GetHierarchyParent();
10231
10232 if (parent)
10233 {
10234 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10235 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10236 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10237 }
10238 }
10239
10241 {
10242
10243
10244
10245
10247
10249 {
10250 if (ScriptInputUserData.CanStoreInputUserData())
10251 {
10252 ScriptInputUserData ctx = new ScriptInputUserData;
10258 ctx.
Write(use_stack_max);
10261
10263 {
10264 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10265 }
10266 }
10267 }
10268 else if (!
GetGame().IsMultiplayer())
10269 {
10271 }
10272 }
10273
10275 {
10277 }
10278
10280 {
10282 }
10283
10285 {
10287 }
10288
10290 {
10291
10292 return false;
10293 }
10294
10296 {
10297 return false;
10298 }
10299
10303 {
10304 return false;
10305 }
10306
10308 {
10309 return "";
10310 }
10311
10313
10315 {
10316 return false;
10317 }
10318
10320 {
10321 return true;
10322 }
10323
10324
10325
10327 {
10328 return true;
10329 }
10330
10332 {
10333 return true;
10334 }
10335
10337 {
10338 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10340 }
10341
10343 {
10345 }
10346
10348 {
10350 if (!is_being_placed)
10352 SetSynchDirty();
10353 }
10354
10355
10357
10359 {
10361 }
10362
10364 {
10366 }
10367
10369 {
10370 return 1;
10371 }
10372
10374 {
10375 return false;
10376 }
10377
10379 {
10381 SetSynchDirty();
10382 }
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10419 {
10420 super.OnMovedInsideCargo(container);
10421
10422 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10423 }
10424
10425 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10426 {
10427 super.EEItemLocationChanged(oldLoc,newLoc);
10428
10429 PlayerBase new_player = null;
10430 PlayerBase old_player = null;
10431
10432 if (newLoc.GetParent())
10433 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10434
10435 if (oldLoc.GetParent())
10436 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10437
10439 {
10440 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10441
10442 if (r_index >= 0)
10443 {
10444 InventoryLocation r_il = new InventoryLocation;
10445 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10446
10447 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10450 {
10451 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10452 }
10454 {
10455 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10456 }
10457
10458 }
10459 }
10460
10462 {
10463 if (new_player)
10464 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10465
10466 if (new_player == old_player)
10467 {
10468
10469 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10470 {
10472 {
10473 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10474 {
10475 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10476 }
10477 }
10478 else
10479 {
10480 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10481 }
10482 }
10483
10484 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10485 {
10486 int type = oldLoc.GetType();
10488 {
10489 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10490 }
10492 {
10493 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10494 }
10495 }
10496 if (!m_OldLocation)
10497 {
10498 m_OldLocation = new InventoryLocation;
10499 }
10500 m_OldLocation.Copy(oldLoc);
10501 }
10502 else
10503 {
10504 if (m_OldLocation)
10505 {
10506 m_OldLocation.Reset();
10507 }
10508 }
10509
10511 }
10512 else
10513 {
10514 if (new_player)
10515 {
10516 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10517 if (res_index >= 0)
10518 {
10519 InventoryLocation il = new InventoryLocation;
10520 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10522 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10525 {
10526 il.
GetParent().GetOnReleaseLock().Invoke(it);
10527 }
10529 {
10531 }
10532
10533 }
10534 }
10536 {
10537
10539 }
10540
10541 if (m_OldLocation)
10542 {
10543 m_OldLocation.Reset();
10544 }
10545 }
10546 }
10547
10548 override void EOnContact(IEntity other, Contact extra)
10549 {
10551 {
10552 int liquidType = -1;
10554 if (impactSpeed > 0.0)
10555 {
10557 #ifndef SERVER
10559 #else
10561 SetSynchDirty();
10562 #endif
10564 }
10565 }
10566
10567 #ifdef SERVER
10568 if (GetCompEM() && GetCompEM().IsPlugged())
10569 {
10570 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10571 GetCompEM().UnplugThis();
10572 }
10573 #endif
10574 }
10575
10577
10579 {
10581 }
10582
10584 {
10585
10586 }
10587
10589 {
10590 super.OnItemLocationChanged(old_owner, new_owner);
10591
10592 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10593 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10594
10595 if (!relatedPlayer && playerNew)
10596 relatedPlayer = playerNew;
10597
10598 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10599 {
10601 if (actionMgr)
10602 {
10603 ActionBase currentAction = actionMgr.GetRunningAction();
10604 if (currentAction)
10606 }
10607 }
10608
10609 Man ownerPlayerOld = null;
10610 Man ownerPlayerNew = null;
10611
10612 if (old_owner)
10613 {
10614 if (old_owner.
IsMan())
10615 {
10616 ownerPlayerOld = Man.Cast(old_owner);
10617 }
10618 else
10619 {
10620 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10621 }
10622 }
10623 else
10624 {
10626 {
10628
10629 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10630 {
10631 GetCompEM().UnplugThis();
10632 }
10633 }
10634 }
10635
10636 if (new_owner)
10637 {
10638 if (new_owner.
IsMan())
10639 {
10640 ownerPlayerNew = Man.Cast(new_owner);
10641 }
10642 else
10643 {
10644 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10645 }
10646 }
10647
10648 if (ownerPlayerOld != ownerPlayerNew)
10649 {
10650 if (ownerPlayerOld)
10651 {
10652 array<EntityAI> subItemsExit = new array<EntityAI>;
10654 for (int i = 0; i < subItemsExit.Count(); i++)
10655 {
10658 }
10659 }
10660
10661 if (ownerPlayerNew)
10662 {
10663 array<EntityAI> subItemsEnter = new array<EntityAI>;
10665 for (int j = 0; j < subItemsEnter.Count(); j++)
10666 {
10669 }
10670 }
10671 }
10672 else if (ownerPlayerNew != null)
10673 {
10674 PlayerBase nplayer;
10675 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10676 {
10677 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10679 for (int k = 0; k < subItemsUpdate.Count(); k++)
10680 {
10682 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10683 }
10684 }
10685 }
10686
10687 if (old_owner)
10688 old_owner.OnChildItemRemoved(this);
10689 if (new_owner)
10690 new_owner.OnChildItemReceived(this);
10691 }
10692
10693
10695 {
10696 super.EEDelete(parent);
10697 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10698 if (player)
10699 {
10701
10702 if (player.IsAlive())
10703 {
10704 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10705 if (r_index >= 0)
10706 {
10707 InventoryLocation r_il = new InventoryLocation;
10708 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10709
10710 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10713 {
10714 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10715 }
10717 {
10718 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10719 }
10720
10721 }
10722
10723 player.RemoveQuickBarEntityShortcut(this);
10724 }
10725 }
10726 }
10727
10729 {
10730 super.EEKilled(killer);
10731
10734 {
10735 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10736 {
10737 if (IsMagazine())
10738 {
10739 if (Magazine.Cast(this).GetAmmoCount() > 0)
10740 {
10742 }
10743 }
10744 else
10745 {
10747 }
10748 }
10749 }
10750 }
10751
10753 {
10754 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10755
10756 super.OnWasAttached(parent, slot_id);
10757
10760
10762 }
10763
10765 {
10766 super.OnWasDetached(parent, slot_id);
10767
10770 }
10771
10773 {
10774 int idx;
10777
10778 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10779 if (inventory_slots.Count() < 1)
10780 {
10781 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10782 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10783 }
10784 else
10785 {
10786 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10787 }
10788
10789 idx = inventory_slots.Find(slot);
10790 if (idx < 0)
10791 return "";
10792
10793 return attach_types.Get(idx);
10794 }
10795
10797 {
10798 int idx = -1;
10799 string slot;
10800
10803
10804 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10805 if (inventory_slots.Count() < 1)
10806 {
10807 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10808 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10809 }
10810 else
10811 {
10812 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10813 if (detach_types.Count() < 1)
10814 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10815 }
10816
10817 for (int i = 0; i < inventory_slots.Count(); i++)
10818 {
10819 slot = inventory_slots.Get(i);
10820 }
10821
10822 if (slot != "")
10823 {
10824 if (detach_types.Count() == 1)
10825 idx = 0;
10826 else
10827 idx = inventory_slots.Find(slot);
10828 }
10829 if (idx < 0)
10830 return "";
10831
10832 return detach_types.Get(idx);
10833 }
10834
10836 {
10837
10839
10840
10841 float min_time = 1;
10842 float max_time = 3;
10843 float delay = Math.RandomFloat(min_time, max_time);
10844
10845 explode_timer.Run(delay, this, "DoAmmoExplosion");
10846 }
10847
10849 {
10850 Magazine magazine = Magazine.Cast(this);
10851 int pop_sounds_count = 6;
10852 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10853
10854
10855 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10856 string sound_name = pop_sounds[ sound_idx ];
10858
10859
10860 magazine.ServerAddAmmoCount(-1);
10861
10862
10863 float min_temp_to_explode = 100;
10864
10865 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10866 {
10868 }
10869 }
10870
10871
10872 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10873 {
10874 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10875
10876 const int CHANCE_DAMAGE_CARGO = 4;
10877 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10878 const int CHANCE_DAMAGE_NOTHING = 2;
10879
10881 {
10882 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10883 int chances;
10884 int rnd;
10885
10886 if (GetInventory().GetCargo())
10887 {
10888 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10889 rnd = Math.RandomInt(0,chances);
10890
10891 if (rnd < CHANCE_DAMAGE_CARGO)
10892 {
10894 }
10895 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10896 {
10898 }
10899 }
10900 else
10901 {
10902 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10903 rnd = Math.RandomInt(0,chances);
10904
10905 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10906 {
10908 }
10909 }
10910 }
10911 }
10912
10914 {
10915 if (GetInventory().GetCargo())
10916 {
10917 int item_count = GetInventory().GetCargo().GetItemCount();
10918 if (item_count > 0)
10919 {
10920 int random_pick = Math.RandomInt(0, item_count);
10922 if (!item.IsExplosive())
10923 {
10924 item.AddHealth("","",damage);
10925 return true;
10926 }
10927 }
10928 }
10929 return false;
10930 }
10931
10933 {
10934 int attachment_count = GetInventory().AttachmentCount();
10935 if (attachment_count > 0)
10936 {
10937 int random_pick = Math.RandomInt(0, attachment_count);
10938 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10939 if (!attachment.IsExplosive())
10940 {
10941 attachment.AddHealth("","",damage);
10942 return true;
10943 }
10944 }
10945 return false;
10946 }
10947
10949 {
10951 }
10952
10954 {
10956 return GetInventory().CanRemoveEntity();
10957
10958 return false;
10959 }
10960
10962 {
10964 return;
10965
10967 {
10968 if (ScriptInputUserData.CanStoreInputUserData())
10969 {
10970 ScriptInputUserData ctx = new ScriptInputUserData;
10975 ctx.
Write(destination_entity);
10977 ctx.
Write(slot_id);
10979 }
10980 }
10981 else if (!
GetGame().IsMultiplayer())
10982 {
10984 }
10985 }
10986
10988 {
10990 return;
10991
10992 float split_quantity_new;
10996 InventoryLocation loc = new InventoryLocation;
10997
10998 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10999 {
11001 split_quantity_new = stack_max;
11002 else
11004
11005 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11006 if (new_item)
11007 {
11008 new_item.SetResultOfSplit(true);
11009 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11011 new_item.SetQuantity(split_quantity_new);
11012 }
11013 }
11014 else if (destination_entity && slot_id == -1)
11015 {
11016 if (quantity > stack_max)
11017 split_quantity_new = stack_max;
11018 else
11019 split_quantity_new = quantity;
11020
11022 {
11025 }
11026
11027 if (new_item)
11028 {
11029 new_item.SetResultOfSplit(true);
11030 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11032 new_item.SetQuantity(split_quantity_new);
11033 }
11034 }
11035 else
11036 {
11037 if (stack_max != 0)
11038 {
11040 {
11042 }
11043
11044 if (split_quantity_new == 0)
11045 {
11046 if (!
GetGame().IsMultiplayer())
11047 player.PhysicalPredictiveDropItem(this);
11048 else
11049 player.ServerDropEntity(this);
11050 return;
11051 }
11052
11054
11055 if (new_item)
11056 {
11057 new_item.SetResultOfSplit(true);
11058 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11060 new_item.SetQuantity(stack_max);
11061 new_item.PlaceOnSurface();
11062 }
11063 }
11064 }
11065 }
11066
11068 {
11070 return;
11071
11072 float split_quantity_new;
11076 InventoryLocation loc = new InventoryLocation;
11077
11078 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11079 {
11081 split_quantity_new = stack_max;
11082 else
11084
11085 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11086 if (new_item)
11087 {
11088 new_item.SetResultOfSplit(true);
11089 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11091 new_item.SetQuantity(split_quantity_new);
11092 }
11093 }
11094 else if (destination_entity && slot_id == -1)
11095 {
11096 if (quantity > stack_max)
11097 split_quantity_new = stack_max;
11098 else
11099 split_quantity_new = quantity;
11100
11102 {
11105 }
11106
11107 if (new_item)
11108 {
11109 new_item.SetResultOfSplit(true);
11110 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11112 new_item.SetQuantity(split_quantity_new);
11113 }
11114 }
11115 else
11116 {
11117 if (stack_max != 0)
11118 {
11120 {
11122 }
11123
11125
11126 if (new_item)
11127 {
11128 new_item.SetResultOfSplit(true);
11129 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11131 new_item.SetQuantity(stack_max);
11132 new_item.PlaceOnSurface();
11133 }
11134 }
11135 }
11136 }
11137
11139 {
11141 return;
11142
11144 {
11145 if (ScriptInputUserData.CanStoreInputUserData())
11146 {
11147 ScriptInputUserData ctx = new ScriptInputUserData;
11152 dst.WriteToContext(ctx);
11154 }
11155 }
11156 else if (!
GetGame().IsMultiplayer())
11157 {
11159 }
11160 }
11161
11163 {
11165 return;
11166
11168 {
11169 if (ScriptInputUserData.CanStoreInputUserData())
11170 {
11171 ScriptInputUserData ctx = new ScriptInputUserData;
11176 ctx.
Write(destination_entity);
11182 }
11183 }
11184 else if (!
GetGame().IsMultiplayer())
11185 {
11187 }
11188 }
11189
11191 {
11193 }
11194
11196 {
11198 return this;
11199
11201 float split_quantity_new;
11203 if (dst.IsValid())
11204 {
11205 int slot_id = dst.GetSlot();
11207
11208 if (quantity > stack_max)
11209 split_quantity_new = stack_max;
11210 else
11211 split_quantity_new = quantity;
11212
11214
11215 if (new_item)
11216 {
11217 new_item.SetResultOfSplit(true);
11218 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11221 }
11222
11223 return new_item;
11224 }
11225
11226 return null;
11227 }
11228
11230 {
11232 return;
11233
11235 float split_quantity_new;
11237 if (destination_entity)
11238 {
11240 if (quantity > stackable)
11241 split_quantity_new = stackable;
11242 else
11243 split_quantity_new = quantity;
11244
11245 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11246 if (new_item)
11247 {
11248 new_item.SetResultOfSplit(true);
11249 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11251 new_item.SetQuantity(split_quantity_new);
11252 }
11253 }
11254 }
11255
11257 {
11259 return;
11260
11262 {
11263 if (ScriptInputUserData.CanStoreInputUserData())
11264 {
11265 ScriptInputUserData ctx = new ScriptInputUserData;
11270 ItemBase destination_entity =
this;
11271 ctx.
Write(destination_entity);
11275 }
11276 }
11277 else if (!
GetGame().IsMultiplayer())
11278 {
11280 }
11281 }
11282
11284 {
11286 return;
11287
11289 float split_quantity_new;
11291 if (player)
11292 {
11294 if (quantity > stackable)
11295 split_quantity_new = stackable;
11296 else
11297 split_quantity_new = quantity;
11298
11299 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11300 new_item =
ItemBase.Cast(in_hands);
11301 if (new_item)
11302 {
11303 new_item.SetResultOfSplit(true);
11304 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11306 new_item.SetQuantity(split_quantity_new);
11307 }
11308 }
11309 }
11310
11312 {
11314 return;
11315
11317 float split_quantity_new = Math.Floor(quantity * 0.5);
11318
11320
11321 if (new_item)
11322 {
11323 if (new_item.GetQuantityMax() < split_quantity_new)
11324 {
11325 split_quantity_new = new_item.GetQuantityMax();
11326 }
11327
11328 new_item.SetResultOfSplit(true);
11329 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11330
11332 {
11335 }
11336 else
11337 {
11340 }
11341 }
11342 }
11343
11345 {
11347 return;
11348
11350 float split_quantity_new = Math.Floor(quantity / 2);
11351
11352 InventoryLocation invloc = new InventoryLocation;
11354
11356 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11357
11358 if (new_item)
11359 {
11360 if (new_item.GetQuantityMax() < split_quantity_new)
11361 {
11362 split_quantity_new = new_item.GetQuantityMax();
11363 }
11365 {
11368 }
11369 else
11370 {
11373 }
11374 }
11375 }
11376
11379 {
11380 SetWeightDirty();
11382
11383 if (parent)
11384 parent.OnAttachmentQuantityChangedEx(this, delta);
11385
11387 {
11389 {
11391 }
11393 {
11394 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11396 }
11397 }
11398
11399 }
11400
11403 {
11404
11405 }
11406
11409 {
11411 }
11412
11414 {
11415 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11416
11418 {
11419 if (newLevel == GameConstants.STATE_RUINED)
11420 {
11422 EntityAI parent = GetHierarchyParent();
11423 if (parent && parent.IsFireplace())
11424 {
11425 CargoBase cargo = GetInventory().GetCargo();
11426 if (cargo)
11427 {
11429 {
11431 }
11432 }
11433 }
11434 }
11435
11437 {
11438
11440 return;
11441 }
11442
11443 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11444 {
11446 }
11447 }
11448 }
11449
11450
11452 {
11453 super.OnRightClick();
11454
11456 {
11458 {
11459 if (ScriptInputUserData.CanStoreInputUserData())
11460 {
11461 vector m4[4];
11463
11464 EntityAI root = GetHierarchyRoot();
11465
11466 InventoryLocation dst = new InventoryLocation;
11468 {
11469 if (root)
11470 {
11471 root.GetTransform(m4);
11473 }
11474 else
11475 GetInventory().GetCurrentInventoryLocation(dst);
11476 }
11477 else
11478 {
11480
11481
11482 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11483 {
11484 if (root)
11485 {
11486 root.GetTransform(m4);
11488 }
11489 else
11490 GetInventory().GetCurrentInventoryLocation(dst);
11491 }
11492 else
11493 {
11494 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11495 }
11496 }
11497
11498 ScriptInputUserData ctx = new ScriptInputUserData;
11506 }
11507 }
11508 else if (!
GetGame().IsMultiplayer())
11509 {
11511 }
11512 }
11513 }
11514
11515 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11516 {
11517
11518 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11519 return false;
11520
11521 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11522 return false;
11523
11524
11526 return false;
11527
11528
11529 Magazine mag = Magazine.Cast(this);
11530 if (mag)
11531 {
11532 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11533 return false;
11534
11535 if (stack_max_limit)
11536 {
11537 Magazine other_mag = Magazine.Cast(other_item);
11538 if (other_item)
11539 {
11540 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11541 return false;
11542 }
11543
11544 }
11545 }
11546 else
11547 {
11548
11550 return false;
11551
11553 return false;
11554 }
11555
11556 PlayerBase player = null;
11557 if (CastTo(player, GetHierarchyRootPlayer()))
11558 {
11559 if (player.GetInventory().HasAttachment(this))
11560 return false;
11561
11562 if (player.IsItemsToDelete())
11563 return false;
11564 }
11565
11566 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11567 return false;
11568
11569 int slotID;
11571 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11572 return false;
11573
11574 return true;
11575 }
11576
11578 {
11580 }
11581
11583 {
11584 return m_IsResultOfSplit;
11585 }
11586
11588 {
11589 m_IsResultOfSplit = value;
11590 }
11591
11593 {
11595 }
11596
11598 {
11599 float other_item_quantity = other_item.GetQuantity();
11600 float this_free_space;
11601
11603
11605
11606 if (other_item_quantity > this_free_space)
11607 {
11608 return this_free_space;
11609 }
11610 else
11611 {
11612 return other_item_quantity;
11613 }
11614 }
11615
11617 {
11619 }
11620
11622 {
11624 return;
11625
11626 if (!IsMagazine() && other_item)
11627 {
11629 if (quantity_used != 0)
11630 {
11631 float hp1 = GetHealth01("","");
11632 float hp2 = other_item.GetHealth01("","");
11633 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11634 hpResult = hpResult / (
GetQuantity() + quantity_used);
11635
11636 hpResult *= GetMaxHealth();
11637 Math.Round(hpResult);
11638 SetHealth("", "Health", hpResult);
11639
11641 other_item.AddQuantity(-quantity_used);
11642 }
11643 }
11645 }
11646
11648 {
11649 #ifdef SERVER
11650 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11651 GetHierarchyParent().IncreaseLifetimeUp();
11652 #endif
11653 };
11654
11656 {
11657 PlayerBase p = PlayerBase.Cast(player);
11658
11659 array<int> recipesIds = p.m_Recipes;
11660 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11661 if (moduleRecipesManager)
11662 {
11663 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11664 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11665 }
11666
11667 for (int i = 0;i < recipesIds.Count(); i++)
11668 {
11669 int key = recipesIds.Get(i);
11670 string recipeName = moduleRecipesManager.GetRecipeName(key);
11672 }
11673 }
11674
11675
11676 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11677 {
11678 super.GetDebugActions(outputList);
11679
11680
11685
11686
11690
11694
11695
11698
11699
11701 {
11704 }
11705
11707
11710
11714 }
11715
11716
11717
11718
11720 {
11721 super.OnAction(action_id, player, ctx);
11722 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11723 {
11724 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11725 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11726 PlayerBase p = PlayerBase.Cast(player);
11727 if (
EActions.RECIPES_RANGE_START < 1000)
11728 {
11729 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11730 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11731 }
11732 }
11733 #ifndef SERVER
11734 else if (action_id ==
EActions.WATCH_PLAYER)
11735 {
11736 PluginDeveloper.SetDeveloperItemClientEx(player);
11737 }
11738 #endif
11740 {
11741 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11742 {
11743 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11744 OnDebugButtonPressServer(id + 1);
11745 }
11746
11747 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11748 {
11749 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11751 }
11752
11753 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11754 {
11755 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11757 }
11758
11759 else if (action_id ==
EActions.ADD_QUANTITY)
11760 {
11761 if (IsMagazine())
11762 {
11763 Magazine mag = Magazine.Cast(this);
11764 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11765 }
11766 else
11767 {
11769 }
11770
11771 if (m_EM)
11772 {
11773 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11774 }
11775
11776 }
11777
11778 else if (action_id ==
EActions.REMOVE_QUANTITY)
11779 {
11780 if (IsMagazine())
11781 {
11782 Magazine mag2 = Magazine.Cast(this);
11783 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11784 }
11785 else
11786 {
11788 }
11789 if (m_EM)
11790 {
11791 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11792 }
11793
11794 }
11795
11796 else if (action_id ==
EActions.SET_QUANTITY_0)
11797 {
11799
11800 if (m_EM)
11801 {
11802 m_EM.SetEnergy(0);
11803 }
11804 }
11805
11806 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11807 {
11809
11810 if (m_EM)
11811 {
11812 m_EM.SetEnergy(m_EM.GetEnergyMax());
11813 }
11814 }
11815
11816 else if (action_id ==
EActions.ADD_HEALTH)
11817 {
11818 AddHealth("","",GetMaxHealth("","Health")/5);
11819 }
11820 else if (action_id ==
EActions.REMOVE_HEALTH)
11821 {
11822 AddHealth("","",-GetMaxHealth("","Health")/5);
11823 }
11824 else if (action_id ==
EActions.DESTROY_HEALTH)
11825 {
11826 SetHealth01("","",0);
11827 }
11828 else if (action_id ==
EActions.WATCH_ITEM)
11829 {
11831 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11832 #ifdef DEVELOPER
11833 SetDebugDeveloper_item(this);
11834 #endif
11835 }
11836
11837 else if (action_id ==
EActions.ADD_TEMPERATURE)
11838 {
11839 AddTemperature(20);
11840
11841 }
11842
11843 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11844 {
11845 AddTemperature(-20);
11846
11847 }
11848
11849 else if (action_id ==
EActions.FLIP_FROZEN)
11850 {
11851 SetFrozen(!GetIsFrozen());
11852
11853 }
11854
11855 else if (action_id ==
EActions.ADD_WETNESS)
11856 {
11858
11859 }
11860
11861 else if (action_id ==
EActions.REMOVE_WETNESS)
11862 {
11864
11865 }
11866
11867 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11868 {
11871
11872
11873 }
11874
11875 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11876 {
11879 }
11880
11881 else if (action_id ==
EActions.MAKE_SPECIAL)
11882 {
11883 auto debugParams = DebugSpawnParams.WithPlayer(player);
11884 OnDebugSpawnEx(debugParams);
11885 }
11886
11887 else if (action_id ==
EActions.DELETE)
11888 {
11889 Delete();
11890 }
11891
11892 }
11893
11894
11895 return false;
11896 }
11897
11898
11899
11900
11904
11907
11908
11909
11911 {
11912 return false;
11913 }
11914
11915
11917 {
11918 return true;
11919 }
11920
11921
11923 {
11924 return true;
11925 }
11926
11927
11928
11930 {
11931 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11933 }
11934
11937 {
11938 return null;
11939 }
11940
11942 {
11943 return false;
11944 }
11945
11947 {
11948 return false;
11949 }
11950
11954
11955
11957 {
11958 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11959 return module_repairing.CanRepair(this, item_repair_kit);
11960 }
11961
11962
11963 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11964 {
11965 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11966 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11967 }
11968
11969
11971 {
11972
11973
11974
11975
11976
11977
11978
11979
11980 return 1;
11981 }
11982
11983
11984
11986 {
11988 }
11989
11990
11991
11993 {
11995 }
11996
11997
12006 {
12007 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12008
12009 if (player)
12010 {
12011 player.MessageStatus(text);
12012 }
12013 }
12014
12015
12024 {
12025 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12026
12027 if (player)
12028 {
12029 player.MessageAction(text);
12030 }
12031 }
12032
12033
12042 {
12043 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12044
12045 if (player)
12046 {
12047 player.MessageFriendly(text);
12048 }
12049 }
12050
12051
12060 {
12061 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12062
12063 if (player)
12064 {
12065 player.MessageImportant(text);
12066 }
12067 }
12068
12070 {
12071 return true;
12072 }
12073
12074
12075 override bool KindOf(
string tag)
12076 {
12077 bool found = false;
12078 string item_name = this.
GetType();
12081
12082 int array_size = item_tag_array.Count();
12083 for (int i = 0; i < array_size; i++)
12084 {
12085 if (item_tag_array.Get(i) == tag)
12086 {
12087 found = true;
12088 break;
12089 }
12090 }
12091 return found;
12092 }
12093
12094
12096 {
12097
12098 super.OnRPC(sender, rpc_type,ctx);
12099
12100
12101 switch (rpc_type)
12102 {
12103 #ifndef SERVER
12104 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12105 Param2<bool, string> p = new Param2<bool, string>(false, "");
12106
12108 return;
12109
12110 bool play = p.param1;
12111 string soundSet = p.param2;
12112
12113 if (play)
12114 {
12116 {
12118 {
12120 }
12121 }
12122 else
12123 {
12125 }
12126 }
12127 else
12128 {
12130 }
12131
12132 break;
12133 #endif
12134
12135 }
12136
12138 {
12140 }
12141 }
12142
12143
12144
12145
12147 {
12148 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12149 return plugin.GetID(
name);
12150 }
12151
12153 {
12154 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12155 return plugin.GetName(id);
12156 }
12157
12160 {
12161
12162
12163 int varFlags;
12164 if (!ctx.
Read(varFlags))
12165 return;
12166
12167 if (varFlags & ItemVariableFlags.FLOAT)
12168 {
12170 }
12171 }
12172
12174 {
12175
12176 super.SerializeNumericalVars(floats_out);
12177
12178
12179
12181 {
12183 }
12184
12186 {
12188 }
12189
12191 {
12193 }
12194
12196 {
12201 }
12202
12204 {
12206 }
12207 }
12208
12210 {
12211
12212 super.DeSerializeNumericalVars(floats);
12213
12214
12215 int index = 0;
12216 int mask = Math.Round(floats.Get(index));
12217
12218 index++;
12219
12221 {
12223 {
12225 }
12226 else
12227 {
12228 float quantity = floats.Get(index);
12229 SetQuantity(quantity,
true,
false,
false,
false);
12230 }
12231 index++;
12232 }
12233
12235 {
12236 float wet = floats.Get(index);
12238 index++;
12239 }
12240
12242 {
12243 int liquidtype = Math.Round(floats.Get(index));
12245 index++;
12246 }
12247
12249 {
12251 index++;
12253 index++;
12255 index++;
12257 index++;
12258 }
12259
12261 {
12262 int cleanness = Math.Round(floats.Get(index));
12264 index++;
12265 }
12266 }
12267
12269 {
12270 super.WriteVarsToCTX(ctx);
12271
12272
12274 {
12276 }
12277
12279 {
12281 }
12282
12284 {
12286 }
12287
12289 {
12290 int r,g,b,a;
12296 }
12297
12299 {
12301 }
12302 }
12303
12305 {
12306 if (!super.ReadVarsFromCTX(ctx,version))
12307 return false;
12308
12309 int intValue;
12310 float value;
12311
12312 if (version < 140)
12313 {
12314 if (!ctx.
Read(intValue))
12315 return false;
12316
12317 m_VariablesMask = intValue;
12318 }
12319
12321 {
12322 if (!ctx.
Read(value))
12323 return false;
12324
12326 {
12328 }
12329 else
12330 {
12332 }
12333 }
12334
12335 if (version < 140)
12336 {
12338 {
12339 if (!ctx.
Read(value))
12340 return false;
12341 SetTemperatureDirect(value);
12342 }
12343 }
12344
12346 {
12347 if (!ctx.
Read(value))
12348 return false;
12350 }
12351
12353 {
12354 if (!ctx.
Read(intValue))
12355 return false;
12357 }
12358
12360 {
12361 int r,g,b,a;
12363 return false;
12365 return false;
12367 return false;
12369 return false;
12370
12372 }
12373
12375 {
12376 if (!ctx.
Read(intValue))
12377 return false;
12379 }
12380
12381 if (version >= 138 && version < 140)
12382 {
12384 {
12385 if (!ctx.
Read(intValue))
12386 return false;
12387 SetFrozen(intValue);
12388 }
12389 }
12390
12391 return true;
12392 }
12393
12394
12396 {
12399 {
12401 }
12402
12403 if (!super.OnStoreLoad(ctx, version))
12404 {
12406 return false;
12407 }
12408
12409 if (version >= 114)
12410 {
12411 bool hasQuickBarIndexSaved;
12412
12413 if (!ctx.
Read(hasQuickBarIndexSaved))
12414 {
12416 return false;
12417 }
12418
12419 if (hasQuickBarIndexSaved)
12420 {
12421 int itmQBIndex;
12422
12423
12424 if (!ctx.
Read(itmQBIndex))
12425 {
12427 return false;
12428 }
12429
12430 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12431 if (itmQBIndex != -1 && parentPlayer)
12432 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12433 }
12434 }
12435 else
12436 {
12437
12438 PlayerBase player;
12439 int itemQBIndex;
12440 if (version ==
int.
MAX)
12441 {
12442 if (!ctx.
Read(itemQBIndex))
12443 {
12445 return false;
12446 }
12447 }
12448 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12449 {
12450
12451 if (!ctx.
Read(itemQBIndex))
12452 {
12454 return false;
12455 }
12456 if (itemQBIndex != -1 && player)
12457 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12458 }
12459 }
12460
12461 if (version < 140)
12462 {
12463
12464 if (!LoadVariables(ctx, version))
12465 {
12467 return false;
12468 }
12469 }
12470
12471
12473 {
12475 return false;
12476 }
12477 if (version >= 132)
12478 {
12480 if (raib)
12481 {
12483 {
12485 return false;
12486 }
12487 }
12488 }
12489
12491 return true;
12492 }
12493
12494
12495
12497 {
12498 super.OnStoreSave(ctx);
12499
12500 PlayerBase player;
12501 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12502 {
12504
12505 int itemQBIndex = -1;
12506 itemQBIndex = player.FindQuickBarEntityIndex(this);
12507 ctx.
Write(itemQBIndex);
12508 }
12509 else
12510 {
12512 }
12513
12515
12517 if (raib)
12518 {
12520 }
12521 }
12522
12523
12525 {
12526 super.AfterStoreLoad();
12527
12529 {
12531 }
12532
12534 {
12537 }
12538 }
12539
12541 {
12542 super.EEOnAfterLoad();
12543
12545 {
12547 }
12548
12551 }
12552
12554 {
12555 return false;
12556 }
12557
12558
12559
12561 {
12563 {
12564 #ifdef PLATFORM_CONSOLE
12565
12567 {
12569 if (menu)
12570 {
12572 }
12573 }
12574 #endif
12575 }
12576
12578 {
12581 }
12582
12584 {
12585 SetWeightDirty();
12587 }
12589 {
12592 }
12593
12595 {
12598 }
12600 {
12603 }
12604
12605 super.OnVariablesSynchronized();
12606 }
12607
12608
12609
12611 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12612 {
12613 if (!IsServerCheck(allow_client))
12614 return false;
12615
12617 return false;
12618
12621
12622 if (value <= (min + 0.001))
12623 value = min;
12624
12625 if (value == min)
12626 {
12627 if (destroy_config)
12628 {
12629 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12630 if (dstr)
12631 {
12633 this.Delete();
12634 return true;
12635 }
12636 }
12637 else if (destroy_forced)
12638 {
12640 this.Delete();
12641 return true;
12642 }
12643
12645 }
12646
12649
12651 {
12653
12654 if (delta)
12656 }
12657
12659
12660 return false;
12661 }
12662
12663
12665 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12666 {
12668 }
12669
12671 {
12674 }
12675
12677 {
12680 }
12681
12684 {
12685 float value_clamped = Math.Clamp(value, 0, 1);
12687 SetQuantity(result, destroy_config, destroy_forced);
12688 }
12689
12690
12693 {
12695 }
12696
12698 {
12700 }
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12712 {
12713 int slot = -1;
12714 if (GetInventory())
12715 {
12716 InventoryLocation il = new InventoryLocation;
12717 GetInventory().GetCurrentInventoryLocation(il);
12719 }
12720
12722 }
12723
12725 {
12726 float quantity_max = 0;
12727
12729 {
12730 if (attSlotID != -1)
12731 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12732
12733 if (quantity_max <= 0)
12735 }
12736
12737 if (quantity_max <= 0)
12739
12740 return quantity_max;
12741 }
12742
12744 {
12746 }
12747
12749 {
12751 }
12752
12753
12755 {
12757 }
12758
12760 {
12762 }
12763
12765 {
12767 }
12768
12769
12771 {
12772
12773 float weightEx = GetWeightEx();
12774 float special = GetInventoryAndCargoWeight();
12775 return weightEx - special;
12776 }
12777
12778
12780 {
12782 }
12783
12785 {
12787 {
12788 #ifdef DEVELOPER
12789 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12790 {
12791 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12793 }
12794 #endif
12795
12796 return GetQuantity() * GetConfigWeightModified();
12797 }
12798 else if (HasEnergyManager())
12799 {
12800 #ifdef DEVELOPER
12801 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12802 {
12803 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12804 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12805 }
12806 #endif
12807 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12808 }
12809 else
12810 {
12811 #ifdef DEVELOPER
12812 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12813 {
12814 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12815 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12816 }
12817 #endif
12818 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12819 }
12820 }
12821
12824 {
12825 int item_count = 0;
12827
12828 if (GetInventory().GetCargo() != NULL)
12829 {
12830 item_count = GetInventory().GetCargo().GetItemCount();
12831 }
12832
12833 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12834 {
12835 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12836 if (item)
12837 item_count += item.GetNumberOfItems();
12838 }
12839 return item_count;
12840 }
12841
12844 {
12845 float weight = 0;
12846 float wetness = 1;
12847 if (include_wetness)
12850 {
12851 weight = wetness * m_ConfigWeight;
12852 }
12854 {
12855 weight = 1;
12856 }
12857 return weight;
12858 }
12859
12860
12861
12863 {
12864 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12865 {
12866 GameInventory inv = GetInventory();
12867 array<EntityAI> items = new array<EntityAI>;
12869 for (int i = 0; i < items.Count(); i++)
12870 {
12872 if (item)
12873 {
12875 }
12876 }
12877 }
12878 }
12879
12880
12881
12882
12884 {
12885 float energy = 0;
12886 if (HasEnergyManager())
12887 {
12888 energy = GetCompEM().GetEnergy();
12889 }
12890 return energy;
12891 }
12892
12893
12895 {
12896 super.OnEnergyConsumed();
12897
12899 }
12900
12902 {
12903 super.OnEnergyAdded();
12904
12906 }
12907
12908
12910 {
12911 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12912 {
12914 {
12915 float energy_0to1 = GetCompEM().GetEnergy0To1();
12917 }
12918 }
12919 }
12920
12921
12923 {
12924 return ConfigGetFloat("heatIsolation");
12925 }
12926
12928 {
12930 }
12931
12933 {
12934 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12935 if (
GetGame().ConfigIsExisting(paramPath))
12937
12938 return 0.0;
12939 }
12940
12942 {
12943 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12944 if (
GetGame().ConfigIsExisting(paramPath))
12946
12947 return 0.0;
12948 }
12949
12950 override void SetWet(
float value,
bool allow_client =
false)
12951 {
12952 if (!IsServerCheck(allow_client))
12953 return;
12954
12957
12959
12960 m_VarWet = Math.Clamp(value, min, max);
12961
12963 {
12966 }
12967 }
12968
12969 override void AddWet(
float value)
12970 {
12972 }
12973
12975 {
12977 }
12978
12980 {
12982 }
12983
12985 {
12987 }
12988
12990 {
12992 }
12993
12995 {
12997 }
12998
12999 override void OnWetChanged(
float newVal,
float oldVal)
13000 {
13003 if (newLevel != oldLevel)
13004 {
13006 }
13007 }
13008
13010 {
13011 SetWeightDirty();
13012 }
13013
13015 {
13016 return GetWetLevelInternal(
m_VarWet);
13017 }
13018
13019
13020
13022 {
13024 }
13025
13027 {
13029 }
13030
13032 {
13034 }
13035
13037 {
13039 }
13040
13041
13042
13044 {
13045 if (ConfigIsExisting("itemModelLength"))
13046 {
13047 return ConfigGetFloat("itemModelLength");
13048 }
13049 return 0;
13050 }
13051
13053 {
13054 if (ConfigIsExisting("itemAttachOffset"))
13055 {
13056 return ConfigGetFloat("itemAttachOffset");
13057 }
13058 return 0;
13059 }
13060
13061 override void SetCleanness(
int value,
bool allow_client =
false)
13062 {
13063 if (!IsServerCheck(allow_client))
13064 return;
13065
13067
13069
13072 }
13073
13075 {
13077 }
13078
13080 {
13081 return true;
13082 }
13083
13084
13085
13086
13088 {
13090 }
13091
13093 {
13095 }
13096
13097
13098
13099
13100 override void SetColor(
int r,
int g,
int b,
int a)
13101 {
13107 }
13109 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13110 {
13115 }
13116
13118 {
13120 }
13121
13124 {
13125 int r,g,b,a;
13127 r = r/255;
13128 g = g/255;
13129 b = b/255;
13130 a = a/255;
13131 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13132 }
13133
13134
13135
13136 override void SetLiquidType(
int value,
bool allow_client =
false)
13137 {
13138 if (!IsServerCheck(allow_client))
13139 return;
13140
13145 }
13146
13148 {
13149 return ConfigGetInt("varLiquidTypeInit");
13150 }
13151
13153 {
13155 }
13156
13158 {
13160 SetFrozen(false);
13161 }
13162
13165 {
13166 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13167 }
13168
13169
13172 {
13173 PlayerBase nplayer;
13174 if (PlayerBase.CastTo(nplayer, player))
13175 {
13177
13178 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13179 }
13180 }
13181
13182
13185 {
13186 PlayerBase nplayer;
13187 if (PlayerBase.CastTo(nplayer,player))
13188 {
13189
13190 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13191
13192 }
13193
13194
13195 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13196
13197
13198 if (HasEnergyManager())
13199 {
13200 GetCompEM().UpdatePlugState();
13201 }
13202 }
13203
13204
13206 {
13207 super.OnPlacementStarted(player);
13208
13210 }
13211
13212 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13213 {
13215 {
13216 m_AdminLog.OnPlacementComplete(player,
this);
13217 }
13218
13219 super.OnPlacementComplete(player, position, orientation);
13220 }
13221
13222
13223
13224
13225
13227 {
13229 {
13230 return true;
13231 }
13232 else
13233 {
13234 return false;
13235 }
13236 }
13237
13238
13240 {
13242 {
13244 }
13245 }
13246
13247
13249 {
13251 }
13252
13254 {
13256 }
13257
13258 override void InsertAgent(
int agent,
float count = 1)
13259 {
13260 if (count < 1)
13261 return;
13262
13264 }
13265
13268 {
13270 }
13271
13272
13274 {
13276 }
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13320 {
13322 return false;
13323 return true;
13324 }
13325
13327 {
13328
13330 }
13331
13332
13335 {
13336 super.CheckForRoofLimited(timeTresholdMS);
13337
13339 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13340 {
13341 m_PreviousRoofTestTime = time;
13342 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13343 }
13344 }
13345
13346
13348 {
13350 {
13351 return 0;
13352 }
13353
13354 if (GetInventory().GetAttachmentSlotsCount() != 0)
13355 {
13356 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13357 if (filter)
13358 return filter.GetProtectionLevel(type, false, system);
13359 else
13360 return 0;
13361 }
13362
13363 string subclassPath, entryName;
13364
13365 switch (type)
13366 {
13368 entryName = "biological";
13369 break;
13371 entryName = "chemical";
13372 break;
13373 default:
13374 entryName = "biological";
13375 break;
13376 }
13377
13378 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13379
13381 }
13382
13383
13384
13387 {
13388 if (!IsMagazine())
13390
13392 }
13393
13394
13395
13396
13397
13402 {
13403 return true;
13404 }
13405
13407 {
13409 }
13410
13411
13412
13413
13414
13416 {
13417 if (parent)
13418 {
13419 if (parent.IsInherited(DayZInfected))
13420 return true;
13421
13422 if (!parent.IsRuined())
13423 return true;
13424 }
13425
13426 return true;
13427 }
13428
13430 {
13431 if (!super.CanPutAsAttachment(parent))
13432 {
13433 return false;
13434 }
13435
13436 if (!IsRuined() && !parent.IsRuined())
13437 {
13438 return true;
13439 }
13440
13441 return false;
13442 }
13443
13445 {
13446
13447
13448
13449
13450 return super.CanReceiveItemIntoCargo(item);
13451 }
13452
13454 {
13455
13456
13457
13458
13459 GameInventory attachmentInv = attachment.GetInventory();
13461 {
13462 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13463 return false;
13464 }
13465
13466 InventoryLocation loc = new InventoryLocation();
13467 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13468 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13469 return false;
13470
13471 return super.CanReceiveAttachment(attachment, slotId);
13472 }
13473
13475 {
13476 if (!super.CanReleaseAttachment(attachment))
13477 return false;
13478
13479 return GetInventory().AreChildrenAccessible();
13480 }
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13503 {
13504 int id = muzzle_owner.GetMuzzleID();
13505 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13506
13507 if (WPOF_array)
13508 {
13509 for (int i = 0; i < WPOF_array.Count(); i++)
13510 {
13511 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13512
13513 if (WPOF)
13514 {
13515 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13516 }
13517 }
13518 }
13519 }
13520
13521
13523 {
13524 int id = muzzle_owner.GetMuzzleID();
13526
13527 if (WPOBE_array)
13528 {
13529 for (int i = 0; i < WPOBE_array.Count(); i++)
13530 {
13531 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13532
13533 if (WPOBE)
13534 {
13535 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13536 }
13537 }
13538 }
13539 }
13540
13541
13543 {
13544 int id = muzzle_owner.GetMuzzleID();
13545 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13546
13547 if (WPOOH_array)
13548 {
13549 for (int i = 0; i < WPOOH_array.Count(); i++)
13550 {
13551 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13552
13553 if (WPOOH)
13554 {
13555 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13556 }
13557 }
13558 }
13559 }
13560
13561
13563 {
13564 int id = muzzle_owner.GetMuzzleID();
13565 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13566
13567 if (WPOOH_array)
13568 {
13569 for (int i = 0; i < WPOOH_array.Count(); i++)
13570 {
13571 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13572
13573 if (WPOOH)
13574 {
13575 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13576 }
13577 }
13578 }
13579 }
13580
13581
13583 {
13584 int id = muzzle_owner.GetMuzzleID();
13585 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13586
13587 if (WPOOH_array)
13588 {
13589 for (int i = 0; i < WPOOH_array.Count(); i++)
13590 {
13591 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13592
13593 if (WPOOH)
13594 {
13595 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13596 }
13597 }
13598 }
13599 }
13600
13601
13602
13604 {
13606 {
13607 return true;
13608 }
13609
13610 return false;
13611 }
13612
13614 {
13616 {
13617 return true;
13618 }
13619
13620 return false;
13621 }
13622
13624 {
13626 {
13627 return true;
13628 }
13629
13630 return false;
13631 }
13632
13634 {
13635 return false;
13636 }
13637
13640 {
13641 return UATimeSpent.DEFAULT_DEPLOY;
13642 }
13643
13644
13645
13646
13648 {
13650 SetSynchDirty();
13651 }
13652
13654 {
13656 }
13657
13658
13660 {
13661 return false;
13662 }
13663
13666 {
13667 string att_type = "None";
13668
13669 if (ConfigIsExisting("soundAttType"))
13670 {
13671 att_type = ConfigGetString("soundAttType");
13672 }
13673
13675 }
13676
13678 {
13680 }
13681
13682
13683
13684
13685
13689
13691 {
13694
13696 }
13697
13698
13700 {
13702 return;
13703
13705
13708
13711
13712 SoundParameters params = new SoundParameters();
13716 }
13717
13718
13720 {
13722 return;
13723
13725 SetSynchDirty();
13726
13729 }
13730
13731
13733 {
13735 return;
13736
13738 SetSynchDirty();
13739
13742 }
13743
13745 {
13747 }
13748
13750 {
13752 }
13753
13756 {
13757 if (!
GetGame().IsDedicatedServer())
13758 {
13759 if (ConfigIsExisting("attachSoundSet"))
13760 {
13761 string cfg_path = "";
13762 string soundset = "";
13763 string type_name =
GetType();
13764
13767 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13768 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13769
13770 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13771 {
13772 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13773 {
13774 if (cfg_slot_array[i] == slot_type)
13775 {
13776 soundset = cfg_soundset_array[i];
13777 break;
13778 }
13779 }
13780 }
13781
13782 if (soundset != "")
13783 {
13784 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13786 }
13787 }
13788 }
13789 }
13790
13792 {
13793
13794 }
13795
13796 void OnApply(PlayerBase player);
13797
13799 {
13800 return 1.0;
13801 };
13802
13804 {
13806 }
13807
13809 {
13811 }
13812
13814
13816 {
13817 SetDynamicPhysicsLifeTime(0.01);
13819 }
13820
13822 {
13823 array<string> zone_names = new array<string>;
13824 GetDamageZones(zone_names);
13825 for (int i = 0; i < zone_names.Count(); i++)
13826 {
13827 SetHealthMax(zone_names.Get(i),"Health");
13828 }
13829 SetHealthMax("","Health");
13830 }
13831
13834 {
13835 float global_health = GetHealth01("","Health");
13836 array<string> zones = new array<string>;
13837 GetDamageZones(zones);
13838
13839 for (int i = 0; i < zones.Count(); i++)
13840 {
13841 SetHealth01(zones.Get(i),"Health",global_health);
13842 }
13843 }
13844
13847 {
13848 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13849 }
13850
13852 {
13853 if (!hasRootAsPlayer)
13854 {
13855 if (refParentIB)
13856 {
13857
13858 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13859 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13860
13861 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13862 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13863
13866 }
13867 else
13868 {
13869
13872 }
13873 }
13874 }
13875
13877 {
13879 {
13880 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13881 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13882 {
13883 float heatPermCoef = 1.0;
13885 while (ent)
13886 {
13887 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13888 ent = ent.GetHierarchyParent();
13889 }
13890
13891 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13892 }
13893 }
13894 }
13895
13897 {
13898
13899 EntityAI parent = GetHierarchyParent();
13900 if (!parent)
13901 {
13902 hasParent = false;
13903 hasRootAsPlayer = false;
13904 }
13905 else
13906 {
13907 hasParent = true;
13908 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13909 refParentIB =
ItemBase.Cast(parent);
13910 }
13911 }
13912
13913 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13914 {
13915
13916 }
13917
13919 {
13920
13921 return false;
13922 }
13923
13925 {
13926
13927
13928 return false;
13929 }
13930
13932 {
13933
13934 return false;
13935 }
13936
13939 {
13940 return !GetIsFrozen() &&
IsOpen();
13941 }
13942
13944 {
13945 bool hasParent = false, hasRootAsPlayer = false;
13947
13948 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13949 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13950
13951 if (wwtu || foodDecay)
13952 {
13956
13957 if (processWetness || processTemperature || processDecay)
13958 {
13960
13961 if (processWetness)
13962 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13963
13964 if (processTemperature)
13966
13967 if (processDecay)
13968 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13969 }
13970 }
13971 }
13972
13975 {
13977 }
13978
13980 {
13983
13984 return super.GetTemperatureFreezeThreshold();
13985 }
13986
13988 {
13991
13992 return super.GetTemperatureThawThreshold();
13993 }
13994
13996 {
13999
14000 return super.GetItemOverheatThreshold();
14001 }
14002
14004 {
14006 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14007
14008 return super.GetTemperatureFreezeTime();
14009 }
14010
14012 {
14014 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14015
14016 return super.GetTemperatureThawTime();
14017 }
14018
14023
14025 {
14026 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14027 }
14028
14030 {
14031 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14032 }
14033
14036 {
14038 }
14039
14041 {
14043 }
14044
14046 {
14048 }
14049
14052 {
14053 return null;
14054 }
14055
14058 {
14059 return false;
14060 }
14061
14063 {
14065 {
14068 if (!trg)
14069 {
14071 explosive = this;
14072 }
14073
14074 explosive.PairRemote(trg);
14076
14077 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14078 trg.SetPersistentPairID(persistentID);
14079 explosive.SetPersistentPairID(persistentID);
14080
14081 return true;
14082 }
14083 return false;
14084 }
14085
14088 {
14089 float ret = 1.0;
14092 ret *= GetHealth01();
14093
14094 return ret;
14095 }
14096
14097 #ifdef DEVELOPER
14098 override void SetDebugItem()
14099 {
14100 super.SetDebugItem();
14101 _itemBase = this;
14102 }
14103
14105 {
14106 string text = super.GetDebugText();
14107
14109 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14110
14111 return text;
14112 }
14113 #endif
14114
14116 {
14117 return true;
14118 }
14119
14121
14123
14125 {
14128 }
14129
14130
14138
14154}
14155
14157{
14159 if (entity)
14160 {
14161 bool is_item = entity.IsInherited(
ItemBase);
14162 if (is_item && full_quantity)
14163 {
14166 }
14167 }
14168 else
14169 {
14171 return NULL;
14172 }
14173 return entity;
14174}
14175
14177{
14178 if (item)
14179 {
14180 if (health > 0)
14181 item.SetHealth("", "", health);
14182
14183 if (item.CanHaveTemperature())
14184 {
14186 if (item.CanFreeze())
14187 item.SetFrozen(false);
14188 }
14189
14190 if (item.HasEnergyManager())
14191 {
14192 if (quantity >= 0)
14193 {
14194 item.GetCompEM().SetEnergy0To1(quantity);
14195 }
14196 else
14197 {
14199 }
14200 }
14201 else if (item.IsMagazine())
14202 {
14203 Magazine mag = Magazine.Cast(item);
14204 if (quantity >= 0)
14205 {
14206 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14207 }
14208 else
14209 {
14211 }
14212
14213 }
14214 else
14215 {
14216 if (quantity >= 0)
14217 {
14218 item.SetQuantityNormalized(quantity, false);
14219 }
14220 else
14221 {
14223 }
14224
14225 }
14226 }
14227}
14228
14229#ifdef DEVELOPER
14231#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.