9351{
9353 {
9354 return true;
9355 }
9356};
9357
9358
9359
9361{
9365
9367
9370
9371
9372
9373
9374
9383
9389
9394
9399
9420 protected bool m_IsResultOfSplit
9421
9423
9428
9429
9430
9432
9436
9437
9438
9440
9443
9444
9445
9451
9452
9460
9463
9464
9466
9467
9469
9470
9475
9476
9481
9482
9484
9485
9487 {
9492
9493 if (!
GetGame().IsDedicatedServer())
9494 {
9496 {
9498
9500 {
9502 }
9503 }
9504
9507 }
9508
9509 m_OldLocation = null;
9510
9512 {
9514 }
9515
9516 if (ConfigIsExisting("headSelectionsToHide"))
9517 {
9520 }
9521
9523 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9524 {
9526 }
9527
9529
9530 m_IsResultOfSplit = false;
9531
9533 }
9534
9536 {
9537 super.InitItemVariables();
9538
9544 m_Count = ConfigGetInt(
"count");
9545
9548
9553
9556
9561
9573
9577
9578
9581 if (ConfigIsExisting("canBeSplit"))
9582 {
9585 }
9586
9588 if (ConfigIsExisting("itemBehaviour"))
9590
9591
9594 RegisterNetSyncVariableInt("m_VarLiquidType");
9595 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9596
9597 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9598 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9599 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9600
9601 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9602 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9603 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9604 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9605
9606 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9607 RegisterNetSyncVariableBool("m_IsTakeable");
9608 RegisterNetSyncVariableBool("m_IsHologram");
9609
9612 {
9615 }
9616
9618
9620 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9622
9623 }
9624
9626 {
9628 }
9629
9631 {
9634 {
9639 }
9640 }
9641
9642 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9643 {
9645 {
9648 }
9649
9651 }
9652
9654 {
9660 }
9661
9663
9665 {
9667
9668 if (!action)
9669 {
9670 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9671 return;
9672 }
9673
9675 if (!ai)
9676 {
9678 return;
9679 }
9680
9682 if (!action_array)
9683 {
9684 action_array = new array<ActionBase_Basic>;
9686 }
9687 if (LogManager.IsActionLogEnable())
9688 {
9689 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9690 }
9691
9692 if (action_array.Find(action) != -1)
9693 {
9694 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9695 }
9696 else
9697 {
9698 action_array.Insert(action);
9699 }
9700 }
9701
9703 {
9705 ActionBase action = player.GetActionManager().GetAction(actionName);
9708
9709 if (action_array)
9710 {
9711 action_array.RemoveItem(action);
9712 }
9713 }
9714
9715
9716
9718 {
9719 ActionOverrideData overrideData = new ActionOverrideData();
9723
9725 if (!actionMap)
9726 {
9729 }
9730
9731 actionMap.Insert(this.
Type(), overrideData);
9732
9733 }
9734
9736
9738
9739
9741 {
9744
9747
9748 string config_to_search = "CfgVehicles";
9749 string muzzle_owner_config;
9750
9752 {
9753 if (IsInherited(Weapon))
9754 config_to_search = "CfgWeapons";
9755
9756 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9757
9758 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9759
9761
9762 if (config_OnFire_subclass_count > 0)
9763 {
9764 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9765
9766 for (int i = 0; i < config_OnFire_subclass_count; i++)
9767 {
9768 string particle_class = "";
9770 string config_OnFire_entry = config_OnFire_class + particle_class;
9771 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9772 WPOF_array.Insert(WPOF);
9773 }
9774
9775
9777 }
9778 }
9779
9781 {
9782 config_to_search = "CfgWeapons";
9783 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9784
9785 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9786
9788
9789 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9790 {
9791 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9792
9793 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9794 {
9795 string particle_class2 = "";
9797 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9798 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9799 WPOBE_array.Insert(WPOBE);
9800 }
9801
9802
9804 }
9805 }
9806 }
9807
9808
9810 {
9813
9815 {
9816 string config_to_search = "CfgVehicles";
9817
9818 if (IsInherited(Weapon))
9819 config_to_search = "CfgWeapons";
9820
9821 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9822 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9823
9824 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9825 {
9826
9828
9830 {
9832 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9834 return;
9835 }
9836
9839
9840
9841
9843 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9844
9845 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9846 {
9847 string particle_class = "";
9849 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9851
9852 if (entry_type == CT_CLASS)
9853 {
9854 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9855 WPOOH_array.Insert(WPOF);
9856 }
9857 }
9858
9859
9861 }
9862 }
9863 }
9864
9866 {
9868 }
9869
9871 {
9873 {
9875
9878
9881
9882 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9883 }
9884 }
9885
9887 {
9889 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9890
9892 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9893
9895 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9896
9898 {
9900 }
9901 }
9902
9904 {
9906 }
9907
9909 {
9912 else
9914
9916 {
9919 }
9920 else
9921 {
9924
9927 }
9928
9930 }
9931
9933 {
9935 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9936 }
9937
9939 {
9941 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9943 }
9944
9946 {
9948 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9949 }
9950
9952 {
9955
9956 OverheatingParticle OP = new OverheatingParticle();
9961
9963 }
9964
9966 {
9969
9970 return -1;
9971 }
9972
9974 {
9976 {
9979
9980 for (int i = count; i > 0; --i)
9981 {
9982 int id = i - 1;
9985
9988
9989 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9990 {
9991 if (p)
9992 {
9995 }
9996 }
9997 }
9998 }
9999 }
10000
10002 {
10004 {
10006 {
10007 int id = i - 1;
10009
10010 if (OP)
10011 {
10013
10014 if (p)
10015 {
10017 }
10018
10019 delete OP;
10020 }
10021 }
10022
10025 }
10026 }
10027
10030 {
10031 return 0.0;
10032 }
10033
10034
10036 {
10037 return 250;
10038 }
10039
10041 {
10042 return 0;
10043 }
10044
10047 {
10049 return true;
10050
10051 return false;
10052 }
10053
10056 {
10059
10061 {
10063 }
10064 else
10065 {
10066
10068 }
10069
10071 }
10072
10079 {
10080 return -1;
10081 }
10082
10083
10084
10085
10087 {
10089 {
10091 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10092
10093 if (r_index >= 0)
10094 {
10095 InventoryLocation r_il = new InventoryLocation;
10096 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10097
10098 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10101 {
10102 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10103 }
10105 {
10106 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10107 }
10108
10109 }
10110
10111 player.GetHumanInventory().ClearUserReservedLocation(this);
10112 }
10113
10116 }
10117
10118
10119
10120
10122 {
10123 return ItemBase.m_DebugActionsMask;
10124 }
10125
10127 {
10128 return ItemBase.m_DebugActionsMask & mask;
10129 }
10130
10132 {
10133 ItemBase.m_DebugActionsMask = mask;
10134 }
10135
10137 {
10138 ItemBase.m_DebugActionsMask |= mask;
10139 }
10140
10142 {
10143 ItemBase.m_DebugActionsMask &= ~mask;
10144 }
10145
10147 {
10149 {
10151 }
10152 else
10153 {
10155 }
10156 }
10157
10158
10160 {
10161 if (GetEconomyProfile())
10162 {
10163 float q_max = GetEconomyProfile().GetQuantityMax();
10164 if (q_max > 0)
10165 {
10166 float q_min = GetEconomyProfile().GetQuantityMin();
10167 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10168
10170 {
10171 ComponentEnergyManager comp = GetCompEM();
10173 {
10175 }
10176 }
10178 {
10180
10181 }
10182
10183 }
10184 }
10185 }
10186
10189 {
10190 EntityAI parent = GetHierarchyParent();
10191
10192 if (parent)
10193 {
10194 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10195 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10196 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10197 }
10198 }
10199
10202 {
10203 EntityAI parent = GetHierarchyParent();
10204
10205 if (parent)
10206 {
10207 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10208 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10209 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10210 }
10211 }
10212
10214 {
10215
10216
10217
10218
10220
10222 {
10223 if (ScriptInputUserData.CanStoreInputUserData())
10224 {
10225 ScriptInputUserData ctx = new ScriptInputUserData;
10231 ctx.
Write(use_stack_max);
10234
10236 {
10237 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10238 }
10239 }
10240 }
10241 else if (!
GetGame().IsMultiplayer())
10242 {
10244 }
10245 }
10246
10248 {
10250 }
10251
10253 {
10255 }
10256
10258 {
10260 }
10261
10263 {
10264
10265 return false;
10266 }
10267
10269 {
10270 return false;
10271 }
10272
10276 {
10277 return false;
10278 }
10279
10281 {
10282 return "";
10283 }
10284
10286
10288 {
10289 return false;
10290 }
10291
10293 {
10294 return true;
10295 }
10296
10297
10298
10300 {
10301 return true;
10302 }
10303
10305 {
10306 return true;
10307 }
10308
10310 {
10311 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10313 }
10314
10316 {
10318 }
10319
10321 {
10323 if (!is_being_placed)
10325 SetSynchDirty();
10326 }
10327
10328
10330
10332 {
10334 }
10335
10337 {
10339 }
10340
10342 {
10343 return 1;
10344 }
10345
10347 {
10348 return false;
10349 }
10350
10352 {
10354 SetSynchDirty();
10355 }
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10392 {
10393 super.OnMovedInsideCargo(container);
10394
10395 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10396 }
10397
10398 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10399 {
10400 super.EEItemLocationChanged(oldLoc,newLoc);
10401
10402 PlayerBase new_player = null;
10403 PlayerBase old_player = null;
10404
10405 if (newLoc.GetParent())
10406 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10407
10408 if (oldLoc.GetParent())
10409 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10410
10412 {
10413 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10414
10415 if (r_index >= 0)
10416 {
10417 InventoryLocation r_il = new InventoryLocation;
10418 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10419
10420 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10423 {
10424 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10425 }
10427 {
10428 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10429 }
10430
10431 }
10432 }
10433
10435 {
10436 if (new_player)
10437 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10438
10439 if (new_player == old_player)
10440 {
10441
10442 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10443 {
10445 {
10446 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10447 {
10448 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10449 }
10450 }
10451 else
10452 {
10453 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10454 }
10455 }
10456
10457 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10458 {
10459 int type = oldLoc.GetType();
10461 {
10462 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10463 }
10465 {
10466 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10467 }
10468 }
10469 if (!m_OldLocation)
10470 {
10471 m_OldLocation = new InventoryLocation;
10472 }
10473 m_OldLocation.Copy(oldLoc);
10474 }
10475 else
10476 {
10477 if (m_OldLocation)
10478 {
10479 m_OldLocation.Reset();
10480 }
10481 }
10482
10484 }
10485 else
10486 {
10487 if (new_player)
10488 {
10489 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10490 if (res_index >= 0)
10491 {
10492 InventoryLocation il = new InventoryLocation;
10493 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10495 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10498 {
10499 il.
GetParent().GetOnReleaseLock().Invoke(it);
10500 }
10502 {
10504 }
10505
10506 }
10507 }
10509 {
10510
10512 }
10513
10514 if (m_OldLocation)
10515 {
10516 m_OldLocation.Reset();
10517 }
10518 }
10519 }
10520
10521 override void EOnContact(IEntity other, Contact extra)
10522 {
10524 {
10525 int liquidType = -1;
10527 if (impactSpeed > 0.0)
10528 {
10530 #ifndef SERVER
10532 #else
10534 SetSynchDirty();
10535 #endif
10537 }
10538 }
10539
10540 #ifdef SERVER
10541 if (GetCompEM() && GetCompEM().IsPlugged())
10542 {
10543 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10544 GetCompEM().UnplugThis();
10545 }
10546 #endif
10547 }
10548
10550
10552 {
10554 }
10555
10557 {
10558
10559 }
10560
10562 {
10563 super.OnItemLocationChanged(old_owner, new_owner);
10564
10565 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10566 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10567
10568 if (!relatedPlayer && playerNew)
10569 relatedPlayer = playerNew;
10570
10571 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10572 {
10574 if (actionMgr)
10575 {
10576 ActionBase currentAction = actionMgr.GetRunningAction();
10577 if (currentAction)
10579 }
10580 }
10581
10582 Man ownerPlayerOld = null;
10583 Man ownerPlayerNew = null;
10584
10585 if (old_owner)
10586 {
10587 if (old_owner.
IsMan())
10588 {
10589 ownerPlayerOld = Man.Cast(old_owner);
10590 }
10591 else
10592 {
10593 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10594 }
10595 }
10596 else
10597 {
10599 {
10601
10602 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10603 {
10604 GetCompEM().UnplugThis();
10605 }
10606 }
10607 }
10608
10609 if (new_owner)
10610 {
10611 if (new_owner.
IsMan())
10612 {
10613 ownerPlayerNew = Man.Cast(new_owner);
10614 }
10615 else
10616 {
10617 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10618 }
10619 }
10620
10621 if (ownerPlayerOld != ownerPlayerNew)
10622 {
10623 if (ownerPlayerOld)
10624 {
10625 array<EntityAI> subItemsExit = new array<EntityAI>;
10627 for (int i = 0; i < subItemsExit.Count(); i++)
10628 {
10631 }
10632 }
10633
10634 if (ownerPlayerNew)
10635 {
10636 array<EntityAI> subItemsEnter = new array<EntityAI>;
10638 for (int j = 0; j < subItemsEnter.Count(); j++)
10639 {
10642 }
10643 }
10644 }
10645 else if (ownerPlayerNew != null)
10646 {
10647 PlayerBase nplayer;
10648 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10649 {
10650 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10652 for (int k = 0; k < subItemsUpdate.Count(); k++)
10653 {
10655 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10656 }
10657 }
10658 }
10659
10660 if (old_owner)
10661 old_owner.OnChildItemRemoved(this);
10662 if (new_owner)
10663 new_owner.OnChildItemReceived(this);
10664 }
10665
10666
10668 {
10669 super.EEDelete(parent);
10670 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10671 if (player)
10672 {
10674
10675 if (player.IsAlive())
10676 {
10677 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10678 if (r_index >= 0)
10679 {
10680 InventoryLocation r_il = new InventoryLocation;
10681 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10682
10683 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10686 {
10687 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10688 }
10690 {
10691 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10692 }
10693
10694 }
10695
10696 player.RemoveQuickBarEntityShortcut(this);
10697 }
10698 }
10699 }
10700
10702 {
10703 super.EEKilled(killer);
10704
10707 {
10708 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10709 {
10710 if (IsMagazine())
10711 {
10712 if (Magazine.Cast(this).GetAmmoCount() > 0)
10713 {
10715 }
10716 }
10717 else
10718 {
10720 }
10721 }
10722 }
10723 }
10724
10726 {
10727 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10728
10729 super.OnWasAttached(parent, slot_id);
10730
10733
10735 }
10736
10738 {
10739 super.OnWasDetached(parent, slot_id);
10740
10743 }
10744
10746 {
10747 int idx;
10750
10751 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10752 if (inventory_slots.Count() < 1)
10753 {
10754 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10755 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10756 }
10757 else
10758 {
10759 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10760 }
10761
10762 idx = inventory_slots.Find(slot);
10763 if (idx < 0)
10764 return "";
10765
10766 return attach_types.Get(idx);
10767 }
10768
10770 {
10771 int idx = -1;
10772 string slot;
10773
10776
10777 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10778 if (inventory_slots.Count() < 1)
10779 {
10780 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10781 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10782 }
10783 else
10784 {
10785 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10786 if (detach_types.Count() < 1)
10787 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10788 }
10789
10790 for (int i = 0; i < inventory_slots.Count(); i++)
10791 {
10792 slot = inventory_slots.Get(i);
10793 }
10794
10795 if (slot != "")
10796 {
10797 if (detach_types.Count() == 1)
10798 idx = 0;
10799 else
10800 idx = inventory_slots.Find(slot);
10801 }
10802 if (idx < 0)
10803 return "";
10804
10805 return detach_types.Get(idx);
10806 }
10807
10809 {
10810
10812
10813
10814 float min_time = 1;
10815 float max_time = 3;
10816 float delay = Math.RandomFloat(min_time, max_time);
10817
10818 explode_timer.Run(delay, this, "DoAmmoExplosion");
10819 }
10820
10822 {
10823 Magazine magazine = Magazine.Cast(this);
10824 int pop_sounds_count = 6;
10825 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10826
10827
10828 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10829 string sound_name = pop_sounds[ sound_idx ];
10831
10832
10833 magazine.ServerAddAmmoCount(-1);
10834
10835
10836 float min_temp_to_explode = 100;
10837
10838 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10839 {
10841 }
10842 }
10843
10844
10845 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10846 {
10847 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10848
10849 const int CHANCE_DAMAGE_CARGO = 4;
10850 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10851 const int CHANCE_DAMAGE_NOTHING = 2;
10852
10854 {
10855 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10856 int chances;
10857 int rnd;
10858
10859 if (GetInventory().GetCargo())
10860 {
10861 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10862 rnd = Math.RandomInt(0,chances);
10863
10864 if (rnd < CHANCE_DAMAGE_CARGO)
10865 {
10867 }
10868 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10869 {
10871 }
10872 }
10873 else
10874 {
10875 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10876 rnd = Math.RandomInt(0,chances);
10877
10878 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10879 {
10881 }
10882 }
10883 }
10884 }
10885
10887 {
10888 if (GetInventory().GetCargo())
10889 {
10890 int item_count = GetInventory().GetCargo().GetItemCount();
10891 if (item_count > 0)
10892 {
10893 int random_pick = Math.RandomInt(0, item_count);
10895 if (!item.IsExplosive())
10896 {
10897 item.AddHealth("","",damage);
10898 return true;
10899 }
10900 }
10901 }
10902 return false;
10903 }
10904
10906 {
10907 int attachment_count = GetInventory().AttachmentCount();
10908 if (attachment_count > 0)
10909 {
10910 int random_pick = Math.RandomInt(0, attachment_count);
10911 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10912 if (!attachment.IsExplosive())
10913 {
10914 attachment.AddHealth("","",damage);
10915 return true;
10916 }
10917 }
10918 return false;
10919 }
10920
10922 {
10924 }
10925
10927 {
10929 return GetInventory().CanRemoveEntity();
10930
10931 return false;
10932 }
10933
10935 {
10936
10938 return false;
10939
10940
10942 return false;
10943
10944
10945
10947 if (delta == 0)
10948 return false;
10949
10950
10951 return true;
10952 }
10953
10955 {
10957 {
10958 if (ScriptInputUserData.CanStoreInputUserData())
10959 {
10960 ScriptInputUserData ctx = new ScriptInputUserData;
10965 ctx.
Write(destination_entity);
10967 ctx.
Write(slot_id);
10969 }
10970 }
10971 else if (!
GetGame().IsMultiplayer())
10972 {
10974 }
10975 }
10976
10978 {
10979 float split_quantity_new;
10983 InventoryLocation loc = new InventoryLocation;
10984
10985 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10986 {
10988 split_quantity_new = stack_max;
10989 else
10991
10993 {
10994 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10995 if (new_item)
10996 {
10997 new_item.SetResultOfSplit(true);
10998 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11000 new_item.
SetQuantity(split_quantity_new,
false,
true);
11001 }
11002 }
11003 }
11004 else if (destination_entity && slot_id == -1)
11005 {
11006 if (quantity > stack_max)
11007 split_quantity_new = stack_max;
11008 else
11009 split_quantity_new = quantity;
11010
11012 {
11014 {
11017 }
11018
11019 if (new_item)
11020 {
11021 new_item.SetResultOfSplit(true);
11022 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11024 new_item.
SetQuantity(split_quantity_new,
false,
true);
11025 }
11026 }
11027 }
11028 else
11029 {
11030 if (stack_max != 0)
11031 {
11033 {
11035 }
11036
11037 if (split_quantity_new == 0)
11038 {
11039 if (!
GetGame().IsMultiplayer())
11040 player.PhysicalPredictiveDropItem(this);
11041 else
11042 player.ServerDropEntity(this);
11043 return;
11044 }
11045
11047 {
11049
11050 if (new_item)
11051 {
11052 new_item.SetResultOfSplit(true);
11053 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11056 new_item.PlaceOnSurface();
11057 }
11058 }
11059 }
11060 }
11061 }
11062
11064 {
11065 float split_quantity_new;
11069 InventoryLocation loc = new InventoryLocation;
11070
11071 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11072 {
11074 split_quantity_new = stack_max;
11075 else
11077
11079 {
11080 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11081 if (new_item)
11082 {
11083 new_item.SetResultOfSplit(true);
11084 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11086 new_item.
SetQuantity(split_quantity_new,
false,
true);
11087 }
11088 }
11089 }
11090 else if (destination_entity && slot_id == -1)
11091 {
11092 if (quantity > stack_max)
11093 split_quantity_new = stack_max;
11094 else
11095 split_quantity_new = quantity;
11096
11098 {
11100 {
11103 }
11104
11105 if (new_item)
11106 {
11107 new_item.SetResultOfSplit(true);
11108 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11110 new_item.
SetQuantity(split_quantity_new,
false,
true);
11111 }
11112 }
11113 }
11114 else
11115 {
11116 if (stack_max != 0)
11117 {
11119 {
11121 }
11122
11124 {
11126
11127 if (new_item)
11128 {
11129 new_item.SetResultOfSplit(true);
11130 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11133 new_item.PlaceOnSurface();
11134 }
11135 }
11136 }
11137 }
11138 }
11139
11141 {
11143 {
11144 if (ScriptInputUserData.CanStoreInputUserData())
11145 {
11146 ScriptInputUserData ctx = new ScriptInputUserData;
11151 dst.WriteToContext(ctx);
11153 }
11154 }
11155 else if (!
GetGame().IsMultiplayer())
11156 {
11158 }
11159 }
11160
11162 {
11164 {
11165 if (ScriptInputUserData.CanStoreInputUserData())
11166 {
11167 ScriptInputUserData ctx = new ScriptInputUserData;
11172 ctx.
Write(destination_entity);
11178 }
11179 }
11180 else if (!
GetGame().IsMultiplayer())
11181 {
11183 }
11184 }
11185
11187 {
11189 }
11190
11192 {
11194 float split_quantity_new;
11196 if (dst.IsValid())
11197 {
11198 int slot_id = dst.GetSlot();
11200
11201 if (quantity > stack_max)
11202 split_quantity_new = stack_max;
11203 else
11204 split_quantity_new = quantity;
11205
11207 {
11209
11210 if (new_item)
11211 {
11212 new_item.SetResultOfSplit(true);
11213 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11215 new_item.
SetQuantity(split_quantity_new,
false,
true);
11216 }
11217
11218 return new_item;
11219 }
11220 }
11221
11222 return null;
11223 }
11224
11226 {
11228 float split_quantity_new;
11230 if (destination_entity)
11231 {
11233 if (quantity > stackable)
11234 split_quantity_new = stackable;
11235 else
11236 split_quantity_new = quantity;
11237
11239 {
11240 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11241 if (new_item)
11242 {
11243 new_item.SetResultOfSplit(true);
11244 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11246 new_item.
SetQuantity(split_quantity_new,
false,
true);
11247 }
11248 }
11249 }
11250 }
11251
11253 {
11255 {
11256 if (ScriptInputUserData.CanStoreInputUserData())
11257 {
11258 ScriptInputUserData ctx = new ScriptInputUserData;
11263 ItemBase destination_entity =
this;
11264 ctx.
Write(destination_entity);
11268 }
11269 }
11270 else if (!
GetGame().IsMultiplayer())
11271 {
11273 }
11274 }
11275
11277 {
11279 float split_quantity_new;
11281 if (player)
11282 {
11284 if (quantity > stackable)
11285 split_quantity_new = stackable;
11286 else
11287 split_quantity_new = quantity;
11288
11290 {
11291 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11292 new_item =
ItemBase.Cast(in_hands);
11293 if (new_item)
11294 {
11295 new_item.SetResultOfSplit(true);
11296 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11298 new_item.SetQuantity(split_quantity_new, false, true);
11299 }
11300 }
11301 }
11302 }
11303
11305 {
11307 float split_quantity_new = Math.Floor(quantity * 0.5);
11308
11310 return;
11311
11313
11314 if (new_item)
11315 {
11316 if (new_item.GetQuantityMax() < split_quantity_new)
11317 {
11318 split_quantity_new = new_item.GetQuantityMax();
11319 }
11320
11321 new_item.SetResultOfSplit(true);
11322 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11323
11325 {
11328 }
11329 else
11330 {
11332 new_item.
SetQuantity(split_quantity_new,
false,
true);
11333 }
11334 }
11335 }
11336
11338 {
11340 float split_quantity_new = Math.Floor(quantity / 2);
11341
11343 return;
11344
11345 InventoryLocation invloc = new InventoryLocation;
11347
11349 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11350
11351 if (new_item)
11352 {
11353 if (new_item.GetQuantityMax() < split_quantity_new)
11354 {
11355 split_quantity_new = new_item.GetQuantityMax();
11356 }
11358 {
11361 }
11362 else if (split_quantity_new > 1)
11363 {
11365 new_item.
SetQuantity(split_quantity_new,
false,
true);
11366 }
11367 }
11368 }
11369
11372 {
11373 SetWeightDirty();
11375
11376 if (parent)
11377 parent.OnAttachmentQuantityChangedEx(this, delta);
11378
11380 {
11382 {
11384 }
11386 {
11387 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11389 }
11390 }
11391
11392 }
11393
11396 {
11397
11398 }
11399
11402 {
11404 }
11405
11407 {
11408 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11409
11411 {
11412 if (newLevel == GameConstants.STATE_RUINED)
11413 {
11415 EntityAI parent = GetHierarchyParent();
11416 if (parent && parent.IsFireplace())
11417 {
11418 CargoBase cargo = GetInventory().GetCargo();
11419 if (cargo)
11420 {
11422 {
11424 }
11425 }
11426 }
11427 }
11428
11430 {
11431
11433 return;
11434 }
11435
11436 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11437 {
11439 }
11440 }
11441 }
11442
11443
11445 {
11446 super.OnRightClick();
11447
11449 {
11451 {
11452 if (ScriptInputUserData.CanStoreInputUserData())
11453 {
11454 EntityAI root = GetHierarchyRoot();
11455 Man playerOwner = GetHierarchyRootPlayer();
11456 InventoryLocation dst = new InventoryLocation;
11457
11458
11459 if (!playerOwner && root && root == this)
11460 {
11462 }
11463 else
11464 {
11465
11466 GetInventory().GetCurrentInventoryLocation(dst);
11468 {
11471 {
11473 }
11474 else
11475 {
11477
11478
11479 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11480 {
11482 }
11483 else
11484 {
11485 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11486 }
11487 }
11488 }
11489 }
11490
11491 ScriptInputUserData ctx = new ScriptInputUserData;
11499 }
11500 }
11501 else if (!
GetGame().IsMultiplayer())
11502 {
11504 }
11505 }
11506 }
11507
11509 {
11510 if (root)
11511 {
11512 vector m4[4];
11513 root.GetTransform(m4);
11514 dst.SetGround(this, m4);
11515 }
11516 else
11517 {
11518 GetInventory().GetCurrentInventoryLocation(dst);
11519 }
11520 }
11521
11522 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11523 {
11524
11525 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11526 return false;
11527
11528 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11529 return false;
11530
11531
11533 return false;
11534
11535
11536 Magazine mag = Magazine.Cast(this);
11537 if (mag)
11538 {
11539 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11540 return false;
11541
11542 if (stack_max_limit)
11543 {
11544 Magazine other_mag = Magazine.Cast(other_item);
11545 if (other_item)
11546 {
11547 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11548 return false;
11549 }
11550
11551 }
11552 }
11553 else
11554 {
11555
11557 return false;
11558
11560 return false;
11561 }
11562
11563 PlayerBase player = null;
11564 if (CastTo(player, GetHierarchyRootPlayer()))
11565 {
11566 if (player.GetInventory().HasAttachment(this))
11567 return false;
11568
11569 if (player.IsItemsToDelete())
11570 return false;
11571 }
11572
11573 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11574 return false;
11575
11576 int slotID;
11578 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11579 return false;
11580
11581 return true;
11582 }
11583
11585 {
11587 }
11588
11590 {
11591 return m_IsResultOfSplit;
11592 }
11593
11595 {
11596 m_IsResultOfSplit = value;
11597 }
11598
11600 {
11602 }
11603
11605 {
11606 float other_item_quantity = other_item.GetQuantity();
11607 float this_free_space;
11608
11610
11612
11613 if (other_item_quantity > this_free_space)
11614 {
11615 return this_free_space;
11616 }
11617 else
11618 {
11619 return other_item_quantity;
11620 }
11621 }
11622
11624 {
11626 }
11627
11629 {
11631 return;
11632
11633 if (!IsMagazine() && other_item)
11634 {
11636 if (quantity_used != 0)
11637 {
11638 float hp1 = GetHealth01("","");
11639 float hp2 = other_item.GetHealth01("","");
11640 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11641 hpResult = hpResult / (
GetQuantity() + quantity_used);
11642
11643 hpResult *= GetMaxHealth();
11644 Math.Round(hpResult);
11645 SetHealth("", "Health", hpResult);
11646
11648 other_item.AddQuantity(-quantity_used);
11649 }
11650 }
11652 }
11653
11655 {
11656 #ifdef SERVER
11657 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11658 GetHierarchyParent().IncreaseLifetimeUp();
11659 #endif
11660 };
11661
11663 {
11664 PlayerBase p = PlayerBase.Cast(player);
11665
11666 array<int> recipesIds = p.m_Recipes;
11667 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11668 if (moduleRecipesManager)
11669 {
11670 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11671 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11672 }
11673
11674 for (int i = 0;i < recipesIds.Count(); i++)
11675 {
11676 int key = recipesIds.Get(i);
11677 string recipeName = moduleRecipesManager.GetRecipeName(key);
11679 }
11680 }
11681
11682
11683 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11684 {
11685 super.GetDebugActions(outputList);
11686
11687
11693
11694
11699
11704
11705
11709
11710
11712 {
11716 }
11717
11720
11721
11725
11727
11728 InventoryLocation loc = new InventoryLocation();
11729 GetInventory().GetCurrentInventoryLocation(loc);
11731 {
11732 if (Gizmo_IsSupported())
11735 }
11736
11738 }
11739
11740
11741
11742
11744 {
11745 super.OnAction(action_id, player, ctx);
11746
11748 {
11749 switch (action_id)
11750 {
11753 return true;
11756 return true;
11757 }
11758 }
11759
11761 {
11762 switch (action_id)
11763 {
11765 Delete();
11766 return true;
11767 }
11768 }
11769
11770 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11771 {
11772 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11773 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11774 PlayerBase p = PlayerBase.Cast(player);
11775 if (
EActions.RECIPES_RANGE_START < 1000)
11776 {
11777 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11778 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11779 }
11780 }
11781 #ifndef SERVER
11782 else if (action_id ==
EActions.WATCH_PLAYER)
11783 {
11784 PluginDeveloper.SetDeveloperItemClientEx(player);
11785 }
11786 #endif
11788 {
11789 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11790 {
11791 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11792 OnDebugButtonPressServer(id + 1);
11793 }
11794
11795 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11796 {
11797 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11799 }
11800
11801 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11802 {
11803 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11805 }
11806
11807 else if (action_id ==
EActions.ADD_QUANTITY)
11808 {
11809 if (IsMagazine())
11810 {
11811 Magazine mag = Magazine.Cast(this);
11812 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11813 }
11814 else
11815 {
11817 }
11818
11819 if (m_EM)
11820 {
11821 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11822 }
11823
11824 }
11825
11826 else if (action_id ==
EActions.REMOVE_QUANTITY)
11827 {
11828 if (IsMagazine())
11829 {
11830 Magazine mag2 = Magazine.Cast(this);
11831 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11832 }
11833 else
11834 {
11836 }
11837 if (m_EM)
11838 {
11839 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11840 }
11841
11842 }
11843
11844 else if (action_id ==
EActions.SET_QUANTITY_0)
11845 {
11847
11848 if (m_EM)
11849 {
11850 m_EM.SetEnergy(0);
11851 }
11852 }
11853
11854 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11855 {
11857
11858 if (m_EM)
11859 {
11860 m_EM.SetEnergy(m_EM.GetEnergyMax());
11861 }
11862 }
11863
11864 else if (action_id ==
EActions.ADD_HEALTH)
11865 {
11866 AddHealth("","",GetMaxHealth("","Health")/5);
11867 }
11868 else if (action_id ==
EActions.REMOVE_HEALTH)
11869 {
11870 AddHealth("","",-GetMaxHealth("","Health")/5);
11871 }
11872 else if (action_id ==
EActions.DESTROY_HEALTH)
11873 {
11874 SetHealth01("","",0);
11875 }
11876 else if (action_id ==
EActions.WATCH_ITEM)
11877 {
11879 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11880 #ifdef DEVELOPER
11881 SetDebugDeveloper_item(this);
11882 #endif
11883 }
11884
11885 else if (action_id ==
EActions.ADD_TEMPERATURE)
11886 {
11887 AddTemperature(20);
11888
11889 }
11890
11891 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11892 {
11893 AddTemperature(-20);
11894
11895 }
11896
11897 else if (action_id ==
EActions.FLIP_FROZEN)
11898 {
11899 SetFrozen(!GetIsFrozen());
11900
11901 }
11902
11903 else if (action_id ==
EActions.ADD_WETNESS)
11904 {
11906
11907 }
11908
11909 else if (action_id ==
EActions.REMOVE_WETNESS)
11910 {
11912
11913 }
11914
11915 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11916 {
11919
11920
11921 }
11922
11923 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11924 {
11927 }
11928
11929 else if (action_id ==
EActions.MAKE_SPECIAL)
11930 {
11931 auto debugParams = DebugSpawnParams.WithPlayer(player);
11932 OnDebugSpawnEx(debugParams);
11933 }
11934
11935 }
11936
11937
11938 return false;
11939 }
11940
11941
11942
11943
11947
11950
11951
11952
11954 {
11955 return false;
11956 }
11957
11958
11960 {
11961 return true;
11962 }
11963
11964
11966 {
11967 return true;
11968 }
11969
11970
11971
11973 {
11974 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11976 }
11977
11980 {
11981 return null;
11982 }
11983
11985 {
11986 return false;
11987 }
11988
11990 {
11991 return false;
11992 }
11993
11997
11998
12000 {
12001 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12002 return module_repairing.CanRepair(this, item_repair_kit);
12003 }
12004
12005
12006 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
12007 {
12008 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
12009 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
12010 }
12011
12012
12014 {
12015
12016
12017
12018
12019
12020
12021
12022
12023 return 1;
12024 }
12025
12026
12027
12029 {
12031 }
12032
12033
12034
12036 {
12038 }
12039
12040
12049 {
12050 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12051
12052 if (player)
12053 {
12054 player.MessageStatus(text);
12055 }
12056 }
12057
12058
12067 {
12068 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12069
12070 if (player)
12071 {
12072 player.MessageAction(text);
12073 }
12074 }
12075
12076
12085 {
12086 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12087
12088 if (player)
12089 {
12090 player.MessageFriendly(text);
12091 }
12092 }
12093
12094
12103 {
12104 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12105
12106 if (player)
12107 {
12108 player.MessageImportant(text);
12109 }
12110 }
12111
12113 {
12114 return true;
12115 }
12116
12117
12118 override bool KindOf(
string tag)
12119 {
12120 bool found = false;
12121 string item_name = this.
GetType();
12124
12125 int array_size = item_tag_array.Count();
12126 for (int i = 0; i < array_size; i++)
12127 {
12128 if (item_tag_array.Get(i) == tag)
12129 {
12130 found = true;
12131 break;
12132 }
12133 }
12134 return found;
12135 }
12136
12137
12139 {
12140
12141 super.OnRPC(sender, rpc_type,ctx);
12142
12143
12144 switch (rpc_type)
12145 {
12146 #ifndef SERVER
12147 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12148 Param2<bool, string> p = new Param2<bool, string>(false, "");
12149
12151 return;
12152
12153 bool play = p.param1;
12154 string soundSet = p.param2;
12155
12156 if (play)
12157 {
12159 {
12161 {
12163 }
12164 }
12165 else
12166 {
12168 }
12169 }
12170 else
12171 {
12173 }
12174
12175 break;
12176 #endif
12177
12178 }
12179
12181 {
12183 }
12184 }
12185
12186
12187
12188
12190 {
12191 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12192 return plugin.GetID(
name);
12193 }
12194
12196 {
12197 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12198 return plugin.GetName(id);
12199 }
12200
12203 {
12204
12205
12206 int varFlags;
12207 if (!ctx.
Read(varFlags))
12208 return;
12209
12210 if (varFlags & ItemVariableFlags.FLOAT)
12211 {
12213 }
12214 }
12215
12217 {
12218
12219 super.SerializeNumericalVars(floats_out);
12220
12221
12222
12224 {
12226 }
12227
12229 {
12231 }
12232
12234 {
12236 }
12237
12239 {
12244 }
12245
12247 {
12249 }
12250 }
12251
12253 {
12254
12255 super.DeSerializeNumericalVars(floats);
12256
12257
12258 int index = 0;
12259 int mask = Math.Round(floats.Get(index));
12260
12261 index++;
12262
12264 {
12266 {
12268 }
12269 else
12270 {
12271 float quantity = floats.Get(index);
12272 SetQuantity(quantity,
true,
false,
false,
false);
12273 }
12274 index++;
12275 }
12276
12278 {
12279 float wet = floats.Get(index);
12281 index++;
12282 }
12283
12285 {
12286 int liquidtype = Math.Round(floats.Get(index));
12288 index++;
12289 }
12290
12292 {
12294 index++;
12296 index++;
12298 index++;
12300 index++;
12301 }
12302
12304 {
12305 int cleanness = Math.Round(floats.Get(index));
12307 index++;
12308 }
12309 }
12310
12312 {
12313 super.WriteVarsToCTX(ctx);
12314
12315
12317 {
12319 }
12320
12322 {
12324 }
12325
12327 {
12329 }
12330
12332 {
12333 int r,g,b,a;
12339 }
12340
12342 {
12344 }
12345 }
12346
12348 {
12349 if (!super.ReadVarsFromCTX(ctx,version))
12350 return false;
12351
12352 int intValue;
12353 float value;
12354
12355 if (version < 140)
12356 {
12357 if (!ctx.
Read(intValue))
12358 return false;
12359
12360 m_VariablesMask = intValue;
12361 }
12362
12364 {
12365 if (!ctx.
Read(value))
12366 return false;
12367
12369 {
12371 }
12372 else
12373 {
12375 }
12376 }
12377
12378 if (version < 140)
12379 {
12381 {
12382 if (!ctx.
Read(value))
12383 return false;
12384 SetTemperatureDirect(value);
12385 }
12386 }
12387
12389 {
12390 if (!ctx.
Read(value))
12391 return false;
12393 }
12394
12396 {
12397 if (!ctx.
Read(intValue))
12398 return false;
12400 }
12401
12403 {
12404 int r,g,b,a;
12406 return false;
12408 return false;
12410 return false;
12412 return false;
12413
12415 }
12416
12418 {
12419 if (!ctx.
Read(intValue))
12420 return false;
12422 }
12423
12424 if (version >= 138 && version < 140)
12425 {
12427 {
12428 if (!ctx.
Read(intValue))
12429 return false;
12430 SetFrozen(intValue);
12431 }
12432 }
12433
12434 return true;
12435 }
12436
12437
12439 {
12442 {
12444 }
12445
12446 if (!super.OnStoreLoad(ctx, version))
12447 {
12449 return false;
12450 }
12451
12452 if (version >= 114)
12453 {
12454 bool hasQuickBarIndexSaved;
12455
12456 if (!ctx.
Read(hasQuickBarIndexSaved))
12457 {
12459 return false;
12460 }
12461
12462 if (hasQuickBarIndexSaved)
12463 {
12464 int itmQBIndex;
12465
12466
12467 if (!ctx.
Read(itmQBIndex))
12468 {
12470 return false;
12471 }
12472
12473 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12474 if (itmQBIndex != -1 && parentPlayer)
12475 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12476 }
12477 }
12478 else
12479 {
12480
12481 PlayerBase player;
12482 int itemQBIndex;
12483 if (version ==
int.
MAX)
12484 {
12485 if (!ctx.
Read(itemQBIndex))
12486 {
12488 return false;
12489 }
12490 }
12491 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12492 {
12493
12494 if (!ctx.
Read(itemQBIndex))
12495 {
12497 return false;
12498 }
12499 if (itemQBIndex != -1 && player)
12500 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12501 }
12502 }
12503
12504 if (version < 140)
12505 {
12506
12507 if (!LoadVariables(ctx, version))
12508 {
12510 return false;
12511 }
12512 }
12513
12514
12516 {
12518 return false;
12519 }
12520 if (version >= 132)
12521 {
12523 if (raib)
12524 {
12526 {
12528 return false;
12529 }
12530 }
12531 }
12532
12534 return true;
12535 }
12536
12537
12538
12540 {
12541 super.OnStoreSave(ctx);
12542
12543 PlayerBase player;
12544 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12545 {
12547
12548 int itemQBIndex = -1;
12549 itemQBIndex = player.FindQuickBarEntityIndex(this);
12550 ctx.
Write(itemQBIndex);
12551 }
12552 else
12553 {
12555 }
12556
12558
12560 if (raib)
12561 {
12563 }
12564 }
12565
12566
12568 {
12569 super.AfterStoreLoad();
12570
12572 {
12574 }
12575
12577 {
12580 }
12581 }
12582
12584 {
12585 super.EEOnAfterLoad();
12586
12588 {
12590 }
12591
12594 }
12595
12597 {
12598 return false;
12599 }
12600
12601
12602
12604 {
12606 {
12607 #ifdef PLATFORM_CONSOLE
12608
12610 {
12612 if (menu)
12613 {
12615 }
12616 }
12617 #endif
12618 }
12619
12621 {
12624 }
12625
12627 {
12628 SetWeightDirty();
12630 }
12632 {
12635 }
12636
12638 {
12641 }
12643 {
12646 }
12647
12648 super.OnVariablesSynchronized();
12649 }
12650
12651
12652
12654 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12655 {
12656 if (!IsServerCheck(allow_client))
12657 return false;
12658
12660 return false;
12661
12664
12665 if (value <= (min + 0.001))
12666 value = min;
12667
12668 if (value == min)
12669 {
12670 if (destroy_config)
12671 {
12672 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12673 if (dstr)
12674 {
12676 this.Delete();
12677 return true;
12678 }
12679 }
12680 else if (destroy_forced)
12681 {
12683 this.Delete();
12684 return true;
12685 }
12686
12688 }
12689
12692
12694 {
12696
12697 if (delta)
12699 }
12700
12702
12703 return false;
12704 }
12705
12706
12708 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12709 {
12711 }
12712
12714 {
12717 }
12718
12720 {
12723 }
12724
12726 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12727 {
12728 float value_clamped = Math.Clamp(value, 0, 1);
12730 SetQuantity(result, destroy_config, destroy_forced);
12731 }
12732
12733
12736 {
12738 }
12739
12741 {
12743 }
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12755 {
12756 int slot = -1;
12757 if (GetInventory())
12758 {
12759 InventoryLocation il = new InventoryLocation;
12760 GetInventory().GetCurrentInventoryLocation(il);
12762 }
12763
12765 }
12766
12768 {
12769 float quantity_max = 0;
12770
12772 {
12773 if (attSlotID != -1)
12774 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12775
12776 if (quantity_max <= 0)
12778 }
12779
12780 if (quantity_max <= 0)
12782
12783 return quantity_max;
12784 }
12785
12787 {
12789 }
12790
12792 {
12794 }
12795
12796
12798 {
12800 }
12801
12803 {
12805 }
12806
12808 {
12810 }
12811
12812
12814 {
12815
12816 float weightEx = GetWeightEx();
12817 float special = GetInventoryAndCargoWeight();
12818 return weightEx - special;
12819 }
12820
12821
12823 {
12825 }
12826
12828 {
12830 {
12831 #ifdef DEVELOPER
12832 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12833 {
12834 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12836 }
12837 #endif
12838
12839 return GetQuantity() * GetConfigWeightModified();
12840 }
12841 else if (HasEnergyManager())
12842 {
12843 #ifdef DEVELOPER
12844 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12845 {
12846 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12847 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12848 }
12849 #endif
12850 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12851 }
12852 else
12853 {
12854 #ifdef DEVELOPER
12855 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12856 {
12857 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12858 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12859 }
12860 #endif
12861 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12862 }
12863 }
12864
12867 {
12868 int item_count = 0;
12870
12871 if (GetInventory().GetCargo() != NULL)
12872 {
12873 item_count = GetInventory().GetCargo().GetItemCount();
12874 }
12875
12876 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12877 {
12878 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12879 if (item)
12880 item_count += item.GetNumberOfItems();
12881 }
12882 return item_count;
12883 }
12884
12887 {
12888 float weight = 0;
12889 float wetness = 1;
12890 if (include_wetness)
12893 {
12894 weight = wetness * m_ConfigWeight;
12895 }
12897 {
12898 weight = 1;
12899 }
12900 return weight;
12901 }
12902
12903
12904
12906 {
12907 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12908 {
12909 GameInventory inv = GetInventory();
12910 array<EntityAI> items = new array<EntityAI>;
12912 for (int i = 0; i < items.Count(); i++)
12913 {
12915 if (item)
12916 {
12918 }
12919 }
12920 }
12921 }
12922
12923
12924
12925
12927 {
12928 float energy = 0;
12929 if (HasEnergyManager())
12930 {
12931 energy = GetCompEM().GetEnergy();
12932 }
12933 return energy;
12934 }
12935
12936
12938 {
12939 super.OnEnergyConsumed();
12940
12942 }
12943
12945 {
12946 super.OnEnergyAdded();
12947
12949 }
12950
12951
12953 {
12954 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12955 {
12957 {
12958 float energy_0to1 = GetCompEM().GetEnergy0To1();
12960 }
12961 }
12962 }
12963
12964
12966 {
12967 return ConfigGetFloat("heatIsolation");
12968 }
12969
12971 {
12973 }
12974
12976 {
12977 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12978 if (
GetGame().ConfigIsExisting(paramPath))
12980
12981 return 0.0;
12982 }
12983
12985 {
12986 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12987 if (
GetGame().ConfigIsExisting(paramPath))
12989
12990 return 0.0;
12991 }
12992
12993 override void SetWet(
float value,
bool allow_client =
false)
12994 {
12995 if (!IsServerCheck(allow_client))
12996 return;
12997
13000
13002
13003 m_VarWet = Math.Clamp(value, min, max);
13004
13006 {
13009 }
13010 }
13011
13012 override void AddWet(
float value)
13013 {
13015 }
13016
13018 {
13020 }
13021
13023 {
13025 }
13026
13028 {
13030 }
13031
13033 {
13035 }
13036
13038 {
13040 }
13041
13042 override void OnWetChanged(
float newVal,
float oldVal)
13043 {
13046 if (newLevel != oldLevel)
13047 {
13049 }
13050 }
13051
13053 {
13054 SetWeightDirty();
13055 }
13056
13058 {
13059 return GetWetLevelInternal(
m_VarWet);
13060 }
13061
13062
13063
13065 {
13067 }
13068
13070 {
13072 }
13073
13075 {
13077 }
13078
13080 {
13082 }
13083
13084
13085
13087 {
13088 if (ConfigIsExisting("itemModelLength"))
13089 {
13090 return ConfigGetFloat("itemModelLength");
13091 }
13092 return 0;
13093 }
13094
13096 {
13097 if (ConfigIsExisting("itemAttachOffset"))
13098 {
13099 return ConfigGetFloat("itemAttachOffset");
13100 }
13101 return 0;
13102 }
13103
13104 override void SetCleanness(
int value,
bool allow_client =
false)
13105 {
13106 if (!IsServerCheck(allow_client))
13107 return;
13108
13110
13112
13115 }
13116
13118 {
13120 }
13121
13123 {
13124 return true;
13125 }
13126
13127
13128
13129
13131 {
13133 }
13134
13136 {
13138 }
13139
13140
13141
13142
13143 override void SetColor(
int r,
int g,
int b,
int a)
13144 {
13150 }
13152 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13153 {
13158 }
13159
13161 {
13163 }
13164
13167 {
13168 int r,g,b,a;
13170 r = r/255;
13171 g = g/255;
13172 b = b/255;
13173 a = a/255;
13174 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13175 }
13176
13177
13178
13179 override void SetLiquidType(
int value,
bool allow_client =
false)
13180 {
13181 if (!IsServerCheck(allow_client))
13182 return;
13183
13188 }
13189
13191 {
13192 return ConfigGetInt("varLiquidTypeInit");
13193 }
13194
13196 {
13198 }
13199
13201 {
13203 SetFrozen(false);
13204 }
13205
13208 {
13209 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13210 }
13211
13212
13215 {
13216 PlayerBase nplayer;
13217 if (PlayerBase.CastTo(nplayer, player))
13218 {
13220
13221 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13222 }
13223 }
13224
13225
13228 {
13229 PlayerBase nplayer;
13230 if (PlayerBase.CastTo(nplayer,player))
13231 {
13232
13233 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13234
13235 }
13236
13237
13238 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13239
13240
13241 if (HasEnergyManager())
13242 {
13243 GetCompEM().UpdatePlugState();
13244 }
13245 }
13246
13247
13249 {
13250 super.OnPlacementStarted(player);
13251
13253 }
13254
13255 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13256 {
13258 {
13259 m_AdminLog.OnPlacementComplete(player,
this);
13260 }
13261
13262 super.OnPlacementComplete(player, position, orientation);
13263 }
13264
13265
13266
13267
13268
13270 {
13272 {
13273 return true;
13274 }
13275 else
13276 {
13277 return false;
13278 }
13279 }
13280
13281
13283 {
13285 {
13287 }
13288 }
13289
13290
13292 {
13294 }
13295
13297 {
13299 }
13300
13301 override void InsertAgent(
int agent,
float count = 1)
13302 {
13303 if (count < 1)
13304 return;
13305
13307 }
13308
13311 {
13313 }
13314
13315
13317 {
13319 }
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13363 {
13365 return false;
13366 return true;
13367 }
13368
13370 {
13371
13373 }
13374
13375
13378 {
13379 super.CheckForRoofLimited(timeTresholdMS);
13380
13382 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13383 {
13384 m_PreviousRoofTestTime = time;
13385 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13386 }
13387 }
13388
13389
13391 {
13393 {
13394 return 0;
13395 }
13396
13397 if (GetInventory().GetAttachmentSlotsCount() != 0)
13398 {
13399 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13400 if (filter)
13401 return filter.GetProtectionLevel(type, false, system);
13402 else
13403 return 0;
13404 }
13405
13406 string subclassPath, entryName;
13407
13408 switch (type)
13409 {
13411 entryName = "biological";
13412 break;
13414 entryName = "chemical";
13415 break;
13416 default:
13417 entryName = "biological";
13418 break;
13419 }
13420
13421 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13422
13424 }
13425
13426
13427
13430 {
13431 if (!IsMagazine())
13433
13435 }
13436
13437
13438
13439
13440
13445 {
13446 return true;
13447 }
13448
13450 {
13452 }
13453
13454
13455
13456
13457
13459 {
13460 if (parent)
13461 {
13462 if (parent.IsInherited(DayZInfected))
13463 return true;
13464
13465 if (!parent.IsRuined())
13466 return true;
13467 }
13468
13469 return true;
13470 }
13471
13473 {
13474 if (!super.CanPutAsAttachment(parent))
13475 {
13476 return false;
13477 }
13478
13479 if (!IsRuined() && !parent.IsRuined())
13480 {
13481 return true;
13482 }
13483
13484 return false;
13485 }
13486
13488 {
13489
13490
13491
13492
13493 return super.CanReceiveItemIntoCargo(item);
13494 }
13495
13497 {
13498
13499
13500
13501
13502 GameInventory attachmentInv = attachment.GetInventory();
13504 {
13505 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13506 return false;
13507 }
13508
13509 InventoryLocation loc = new InventoryLocation();
13510 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13511 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13512 return false;
13513
13514 return super.CanReceiveAttachment(attachment, slotId);
13515 }
13516
13518 {
13519 if (!super.CanReleaseAttachment(attachment))
13520 return false;
13521
13522 return GetInventory().AreChildrenAccessible();
13523 }
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13546 {
13547 int id = muzzle_owner.GetMuzzleID();
13548 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13549
13550 if (WPOF_array)
13551 {
13552 for (int i = 0; i < WPOF_array.Count(); i++)
13553 {
13554 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13555
13556 if (WPOF)
13557 {
13558 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13559 }
13560 }
13561 }
13562 }
13563
13564
13566 {
13567 int id = muzzle_owner.GetMuzzleID();
13569
13570 if (WPOBE_array)
13571 {
13572 for (int i = 0; i < WPOBE_array.Count(); i++)
13573 {
13574 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13575
13576 if (WPOBE)
13577 {
13578 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13579 }
13580 }
13581 }
13582 }
13583
13584
13586 {
13587 int id = muzzle_owner.GetMuzzleID();
13588 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13589
13590 if (WPOOH_array)
13591 {
13592 for (int i = 0; i < WPOOH_array.Count(); i++)
13593 {
13594 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13595
13596 if (WPOOH)
13597 {
13598 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13599 }
13600 }
13601 }
13602 }
13603
13604
13606 {
13607 int id = muzzle_owner.GetMuzzleID();
13608 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13609
13610 if (WPOOH_array)
13611 {
13612 for (int i = 0; i < WPOOH_array.Count(); i++)
13613 {
13614 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13615
13616 if (WPOOH)
13617 {
13618 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13619 }
13620 }
13621 }
13622 }
13623
13624
13626 {
13627 int id = muzzle_owner.GetMuzzleID();
13628 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13629
13630 if (WPOOH_array)
13631 {
13632 for (int i = 0; i < WPOOH_array.Count(); i++)
13633 {
13634 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13635
13636 if (WPOOH)
13637 {
13638 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13639 }
13640 }
13641 }
13642 }
13643
13644
13645
13647 {
13649 {
13650 return true;
13651 }
13652
13653 return false;
13654 }
13655
13657 {
13659 {
13660 return true;
13661 }
13662
13663 return false;
13664 }
13665
13667 {
13669 {
13670 return true;
13671 }
13672
13673 return false;
13674 }
13675
13677 {
13678 return false;
13679 }
13680
13683 {
13684 return UATimeSpent.DEFAULT_DEPLOY;
13685 }
13686
13687
13688
13689
13691 {
13693 SetSynchDirty();
13694 }
13695
13697 {
13699 }
13700
13701
13703 {
13704 return false;
13705 }
13706
13709 {
13710 string att_type = "None";
13711
13712 if (ConfigIsExisting("soundAttType"))
13713 {
13714 att_type = ConfigGetString("soundAttType");
13715 }
13716
13718 }
13719
13721 {
13723 }
13724
13725
13726
13727
13728
13734
13736 {
13739
13741 }
13742
13743
13745 {
13747 return;
13748
13750
13753
13756
13757 SoundParameters params = new SoundParameters();
13761 }
13762
13763
13765 {
13767 return;
13768
13770 SetSynchDirty();
13771
13774 }
13775
13776
13778 {
13780 return;
13781
13783 SetSynchDirty();
13784
13787 }
13788
13790 {
13792 }
13793
13795 {
13797 }
13798
13801 {
13802 if (!
GetGame().IsDedicatedServer())
13803 {
13804 if (ConfigIsExisting("attachSoundSet"))
13805 {
13806 string cfg_path = "";
13807 string soundset = "";
13808 string type_name =
GetType();
13809
13812 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13813 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13814
13815 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13816 {
13817 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13818 {
13819 if (cfg_slot_array[i] == slot_type)
13820 {
13821 soundset = cfg_soundset_array[i];
13822 break;
13823 }
13824 }
13825 }
13826
13827 if (soundset != "")
13828 {
13829 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13831 }
13832 }
13833 }
13834 }
13835
13837 {
13838
13839 }
13840
13841 void OnApply(PlayerBase player);
13842
13844 {
13845 return 1.0;
13846 };
13847
13849 {
13851 }
13852
13854 {
13856 }
13857
13859
13861 {
13862 SetDynamicPhysicsLifeTime(0.01);
13864 }
13865
13867 {
13868 array<string> zone_names = new array<string>;
13869 GetDamageZones(zone_names);
13870 for (int i = 0; i < zone_names.Count(); i++)
13871 {
13872 SetHealthMax(zone_names.Get(i),"Health");
13873 }
13874 SetHealthMax("","Health");
13875 }
13876
13879 {
13880 float global_health = GetHealth01("","Health");
13881 array<string> zones = new array<string>;
13882 GetDamageZones(zones);
13883
13884 for (int i = 0; i < zones.Count(); i++)
13885 {
13886 SetHealth01(zones.Get(i),"Health",global_health);
13887 }
13888 }
13889
13892 {
13893 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13894 }
13895
13897 {
13898 if (!hasRootAsPlayer)
13899 {
13900 if (refParentIB)
13901 {
13902
13903 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13904 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13905
13906 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13907 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13908
13911 }
13912 else
13913 {
13914
13917 }
13918 }
13919 }
13920
13922 {
13924 {
13925 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13926 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13927 {
13928 float heatPermCoef = 1.0;
13930 while (ent)
13931 {
13932 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13933 ent = ent.GetHierarchyParent();
13934 }
13935
13936 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13937 }
13938 }
13939 }
13940
13942 {
13943
13944 EntityAI parent = GetHierarchyParent();
13945 if (!parent)
13946 {
13947 hasParent = false;
13948 hasRootAsPlayer = false;
13949 }
13950 else
13951 {
13952 hasParent = true;
13953 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13954 refParentIB =
ItemBase.Cast(parent);
13955 }
13956 }
13957
13958 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13959 {
13960
13961 }
13962
13964 {
13965
13966 return false;
13967 }
13968
13970 {
13971
13972
13973 return false;
13974 }
13975
13977 {
13978
13979 return false;
13980 }
13981
13984 {
13985 return !GetIsFrozen() &&
IsOpen();
13986 }
13987
13989 {
13990 bool hasParent = false, hasRootAsPlayer = false;
13992
13993 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13994 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13995
13996 if (wwtu || foodDecay)
13997 {
14001
14002 if (processWetness || processTemperature || processDecay)
14003 {
14005
14006 if (processWetness)
14007 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
14008
14009 if (processTemperature)
14011
14012 if (processDecay)
14013 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
14014 }
14015 }
14016 }
14017
14020 {
14022 }
14023
14025 {
14028
14029 return super.GetTemperatureFreezeThreshold();
14030 }
14031
14033 {
14036
14037 return super.GetTemperatureThawThreshold();
14038 }
14039
14041 {
14044
14045 return super.GetItemOverheatThreshold();
14046 }
14047
14049 {
14051 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14052
14053 return super.GetTemperatureFreezeTime();
14054 }
14055
14057 {
14059 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14060
14061 return super.GetTemperatureThawTime();
14062 }
14063
14068
14070 {
14071 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14072 }
14073
14075 {
14076 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14077 }
14078
14081 {
14083 }
14084
14086 {
14088 }
14089
14091 {
14093 }
14094
14097 {
14098 return null;
14099 }
14100
14103 {
14104 return false;
14105 }
14106
14108 {
14110 {
14113 if (!trg)
14114 {
14116 explosive = this;
14117 }
14118
14119 explosive.PairRemote(trg);
14121
14122 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14123 trg.SetPersistentPairID(persistentID);
14124 explosive.SetPersistentPairID(persistentID);
14125
14126 return true;
14127 }
14128 return false;
14129 }
14130
14133 {
14134 float ret = 1.0;
14137 ret *= GetHealth01();
14138
14139 return ret;
14140 }
14141
14142 #ifdef DEVELOPER
14143 override void SetDebugItem()
14144 {
14145 super.SetDebugItem();
14146 _itemBase = this;
14147 }
14148
14150 {
14151 string text = super.GetDebugText();
14152
14154 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14155
14156 return text;
14157 }
14158 #endif
14159
14161 {
14162 return true;
14163 }
14164
14166
14168
14170 {
14173 }
14174
14175
14183
14199}
14200
14202{
14204 if (entity)
14205 {
14206 bool is_item = entity.IsInherited(
ItemBase);
14207 if (is_item && full_quantity)
14208 {
14211 }
14212 }
14213 else
14214 {
14216 return NULL;
14217 }
14218 return entity;
14219}
14220
14222{
14223 if (item)
14224 {
14225 if (health > 0)
14226 item.SetHealth("", "", health);
14227
14228 if (item.CanHaveTemperature())
14229 {
14231 if (item.CanFreeze())
14232 item.SetFrozen(false);
14233 }
14234
14235 if (item.HasEnergyManager())
14236 {
14237 if (quantity >= 0)
14238 {
14239 item.GetCompEM().SetEnergy0To1(quantity);
14240 }
14241 else
14242 {
14244 }
14245 }
14246 else if (item.IsMagazine())
14247 {
14248 Magazine mag = Magazine.Cast(item);
14249 if (quantity >= 0)
14250 {
14251 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14252 }
14253 else
14254 {
14256 }
14257
14258 }
14259 else
14260 {
14261 if (quantity >= 0)
14262 {
14263 item.SetQuantityNormalized(quantity, false);
14264 }
14265 else
14266 {
14268 }
14269
14270 }
14271 }
14272}
14273
14274#ifdef DEVELOPER
14276#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.