9334{
9336 {
9337 return true;
9338 }
9339};
9340
9341
9342
9344{
9348
9350
9353
9354
9355
9356
9357
9366
9372
9377
9382
9403 protected bool m_IsResultOfSplit
9404
9406
9411
9412
9413
9415
9419
9420
9421
9423
9426
9427
9428
9434
9435
9443
9446
9447
9449
9450
9452
9453
9458
9459
9464
9465
9467
9468
9470 {
9475
9476 if (!
GetGame().IsDedicatedServer())
9477 {
9479 {
9481
9483 {
9485 }
9486 }
9487
9490 }
9491
9492 m_OldLocation = null;
9493
9495 {
9497 }
9498
9499 if (ConfigIsExisting("headSelectionsToHide"))
9500 {
9503 }
9504
9506 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9507 {
9509 }
9510
9512
9513 m_IsResultOfSplit = false;
9514
9516 }
9517
9519 {
9520 super.InitItemVariables();
9521
9527 m_Count = ConfigGetInt(
"count");
9528
9531
9536
9539
9544
9556
9560
9561
9564 if (ConfigIsExisting("canBeSplit"))
9565 {
9568 }
9569
9571 if (ConfigIsExisting("itemBehaviour"))
9573
9574
9577 RegisterNetSyncVariableInt("m_VarLiquidType");
9578 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9579
9580 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9581 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9582 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9583
9584 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9585 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9586 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9587 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9588
9589 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9590 RegisterNetSyncVariableBool("m_IsTakeable");
9591 RegisterNetSyncVariableBool("m_IsHologram");
9592
9595 {
9598 }
9599
9601
9603 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9605
9606 }
9607
9609 {
9611 }
9612
9614 {
9617 {
9622 }
9623 }
9624
9625 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9626 {
9628 {
9631 }
9632
9634 }
9635
9637 {
9643 }
9644
9646
9648 {
9650
9651 if (!action)
9652 {
9653 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9654 return;
9655 }
9656
9658 if (!ai)
9659 {
9661 return;
9662 }
9663
9665 if (!action_array)
9666 {
9667 action_array = new array<ActionBase_Basic>;
9669 }
9670 if (LogManager.IsActionLogEnable())
9671 {
9672 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9673 }
9674
9675 if (action_array.Find(action) != -1)
9676 {
9677 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9678 }
9679 else
9680 {
9681 action_array.Insert(action);
9682 }
9683 }
9684
9686 {
9688 ActionBase action = player.GetActionManager().GetAction(actionName);
9691
9692 if (action_array)
9693 {
9694 action_array.RemoveItem(action);
9695 }
9696 }
9697
9698
9699
9701 {
9702 ActionOverrideData overrideData = new ActionOverrideData();
9706
9708 if (!actionMap)
9709 {
9712 }
9713
9714 actionMap.Insert(this.
Type(), overrideData);
9715
9716 }
9717
9719
9721
9722
9724 {
9727
9730
9731 string config_to_search = "CfgVehicles";
9732 string muzzle_owner_config;
9733
9735 {
9736 if (IsInherited(Weapon))
9737 config_to_search = "CfgWeapons";
9738
9739 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9740
9741 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9742
9744
9745 if (config_OnFire_subclass_count > 0)
9746 {
9747 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9748
9749 for (int i = 0; i < config_OnFire_subclass_count; i++)
9750 {
9751 string particle_class = "";
9753 string config_OnFire_entry = config_OnFire_class + particle_class;
9754 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9755 WPOF_array.Insert(WPOF);
9756 }
9757
9758
9760 }
9761 }
9762
9764 {
9765 config_to_search = "CfgWeapons";
9766 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9767
9768 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9769
9771
9772 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9773 {
9774 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9775
9776 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9777 {
9778 string particle_class2 = "";
9780 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9781 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9782 WPOBE_array.Insert(WPOBE);
9783 }
9784
9785
9787 }
9788 }
9789 }
9790
9791
9793 {
9796
9798 {
9799 string config_to_search = "CfgVehicles";
9800
9801 if (IsInherited(Weapon))
9802 config_to_search = "CfgWeapons";
9803
9804 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9805 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9806
9807 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9808 {
9809
9811
9813 {
9815 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9817 return;
9818 }
9819
9822
9823
9824
9826 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9827
9828 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9829 {
9830 string particle_class = "";
9832 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9834
9835 if (entry_type == CT_CLASS)
9836 {
9837 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9838 WPOOH_array.Insert(WPOF);
9839 }
9840 }
9841
9842
9844 }
9845 }
9846 }
9847
9849 {
9851 }
9852
9854 {
9856 {
9858
9861
9864
9865 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9866 }
9867 }
9868
9870 {
9872 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9873
9875 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9876
9878 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9879
9881 {
9883 }
9884 }
9885
9887 {
9889 }
9890
9892 {
9895 else
9897
9899 {
9902 }
9903 else
9904 {
9907
9910 }
9911
9913 }
9914
9916 {
9918 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9919 }
9920
9922 {
9924 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9926 }
9927
9929 {
9931 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9932 }
9933
9935 {
9938
9939 OverheatingParticle OP = new OverheatingParticle();
9944
9946 }
9947
9949 {
9952
9953 return -1;
9954 }
9955
9957 {
9959 {
9962
9963 for (int i = count; i > 0; --i)
9964 {
9965 int id = i - 1;
9968
9971
9972 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9973 {
9974 if (p)
9975 {
9978 }
9979 }
9980 }
9981 }
9982 }
9983
9985 {
9987 {
9989 {
9990 int id = i - 1;
9992
9993 if (OP)
9994 {
9996
9997 if (p)
9998 {
10000 }
10001
10002 delete OP;
10003 }
10004 }
10005
10008 }
10009 }
10010
10013 {
10014 return 0.0;
10015 }
10016
10017
10019 {
10020 return 250;
10021 }
10022
10024 {
10025 return 0;
10026 }
10027
10030 {
10032 return true;
10033
10034 return false;
10035 }
10036
10039 {
10042
10044 {
10046 }
10047 else
10048 {
10049
10051 }
10052
10054 }
10055
10062 {
10063 return -1;
10064 }
10065
10066
10067
10068
10070 {
10072 {
10074 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10075
10076 if (r_index >= 0)
10077 {
10078 InventoryLocation r_il = new InventoryLocation;
10079 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10080
10081 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10084 {
10085 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10086 }
10088 {
10089 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10090 }
10091
10092 }
10093
10094 player.GetHumanInventory().ClearUserReservedLocation(this);
10095 }
10096
10099 }
10100
10101
10102
10103
10105 {
10106 return ItemBase.m_DebugActionsMask;
10107 }
10108
10110 {
10111 return ItemBase.m_DebugActionsMask & mask;
10112 }
10113
10115 {
10116 ItemBase.m_DebugActionsMask = mask;
10117 }
10118
10120 {
10121 ItemBase.m_DebugActionsMask |= mask;
10122 }
10123
10125 {
10126 ItemBase.m_DebugActionsMask &= ~mask;
10127 }
10128
10130 {
10132 {
10134 }
10135 else
10136 {
10138 }
10139 }
10140
10141
10143 {
10144 if (GetEconomyProfile())
10145 {
10146 float q_max = GetEconomyProfile().GetQuantityMax();
10147 if (q_max > 0)
10148 {
10149 float q_min = GetEconomyProfile().GetQuantityMin();
10150 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10151
10153 {
10154 ComponentEnergyManager comp = GetCompEM();
10156 {
10158 }
10159 }
10161 {
10163
10164 }
10165
10166 }
10167 }
10168 }
10169
10172 {
10173 EntityAI parent = GetHierarchyParent();
10174
10175 if (parent)
10176 {
10177 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10178 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10179 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10180 }
10181 }
10182
10185 {
10186 EntityAI parent = GetHierarchyParent();
10187
10188 if (parent)
10189 {
10190 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10191 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10192 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10193 }
10194 }
10195
10197 {
10198
10199
10200
10201
10203
10205 {
10206 if (ScriptInputUserData.CanStoreInputUserData())
10207 {
10208 ScriptInputUserData ctx = new ScriptInputUserData;
10214 ctx.
Write(use_stack_max);
10217
10219 {
10220 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10221 }
10222 }
10223 }
10224 else if (!
GetGame().IsMultiplayer())
10225 {
10227 }
10228 }
10229
10231 {
10233 }
10234
10236 {
10238 }
10239
10241 {
10243 }
10244
10246 {
10247
10248 return false;
10249 }
10250
10252 {
10253 return false;
10254 }
10255
10259 {
10260 return false;
10261 }
10262
10264 {
10265 return "";
10266 }
10267
10269
10271 {
10272 return false;
10273 }
10274
10276 {
10277 return true;
10278 }
10279
10280
10281
10283 {
10284 return true;
10285 }
10286
10288 {
10289 return true;
10290 }
10291
10293 {
10294 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10296 }
10297
10299 {
10301 }
10302
10304 {
10306 if (!is_being_placed)
10308 SetSynchDirty();
10309 }
10310
10311
10313
10315 {
10317 }
10318
10320 {
10322 }
10323
10325 {
10326 return 1;
10327 }
10328
10330 {
10331 return false;
10332 }
10333
10335 {
10337 SetSynchDirty();
10338 }
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10375 {
10376 super.OnMovedInsideCargo(container);
10377
10378 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10379 }
10380
10381 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10382 {
10383 super.EEItemLocationChanged(oldLoc,newLoc);
10384
10385 PlayerBase new_player = null;
10386 PlayerBase old_player = null;
10387
10388 if (newLoc.GetParent())
10389 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10390
10391 if (oldLoc.GetParent())
10392 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10393
10395 {
10396 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10397
10398 if (r_index >= 0)
10399 {
10400 InventoryLocation r_il = new InventoryLocation;
10401 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10402
10403 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10406 {
10407 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10408 }
10410 {
10411 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10412 }
10413
10414 }
10415 }
10416
10418 {
10419 if (new_player)
10420 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10421
10422 if (new_player == old_player)
10423 {
10424
10425 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10426 {
10428 {
10429 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10430 {
10431 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10432 }
10433 }
10434 else
10435 {
10436 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10437 }
10438 }
10439
10440 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10441 {
10442 int type = oldLoc.GetType();
10444 {
10445 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10446 }
10448 {
10449 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10450 }
10451 }
10452 if (!m_OldLocation)
10453 {
10454 m_OldLocation = new InventoryLocation;
10455 }
10456 m_OldLocation.Copy(oldLoc);
10457 }
10458 else
10459 {
10460 if (m_OldLocation)
10461 {
10462 m_OldLocation.Reset();
10463 }
10464 }
10465
10467 }
10468 else
10469 {
10470 if (new_player)
10471 {
10472 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10473 if (res_index >= 0)
10474 {
10475 InventoryLocation il = new InventoryLocation;
10476 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10478 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10481 {
10482 il.
GetParent().GetOnReleaseLock().Invoke(it);
10483 }
10485 {
10487 }
10488
10489 }
10490 }
10492 {
10493
10495 }
10496
10497 if (m_OldLocation)
10498 {
10499 m_OldLocation.Reset();
10500 }
10501 }
10502 }
10503
10504 override void EOnContact(IEntity other, Contact extra)
10505 {
10507 {
10508 int liquidType = -1;
10510 if (impactSpeed > 0.0)
10511 {
10513 #ifndef SERVER
10515 #else
10517 SetSynchDirty();
10518 #endif
10520 }
10521 }
10522
10523 #ifdef SERVER
10524 if (GetCompEM() && GetCompEM().IsPlugged())
10525 {
10526 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10527 GetCompEM().UnplugThis();
10528 }
10529 #endif
10530 }
10531
10533
10535 {
10537 }
10538
10540 {
10541
10542 }
10543
10545 {
10546 super.OnItemLocationChanged(old_owner, new_owner);
10547
10548 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10549 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10550
10551 if (!relatedPlayer && playerNew)
10552 relatedPlayer = playerNew;
10553
10554 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10555 {
10557 if (actionMgr)
10558 {
10559 ActionBase currentAction = actionMgr.GetRunningAction();
10560 if (currentAction)
10562 }
10563 }
10564
10565 Man ownerPlayerOld = null;
10566 Man ownerPlayerNew = null;
10567
10568 if (old_owner)
10569 {
10570 if (old_owner.
IsMan())
10571 {
10572 ownerPlayerOld = Man.Cast(old_owner);
10573 }
10574 else
10575 {
10576 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10577 }
10578 }
10579 else
10580 {
10582 {
10584
10585 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10586 {
10587 GetCompEM().UnplugThis();
10588 }
10589 }
10590 }
10591
10592 if (new_owner)
10593 {
10594 if (new_owner.
IsMan())
10595 {
10596 ownerPlayerNew = Man.Cast(new_owner);
10597 }
10598 else
10599 {
10600 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10601 }
10602 }
10603
10604 if (ownerPlayerOld != ownerPlayerNew)
10605 {
10606 if (ownerPlayerOld)
10607 {
10608 array<EntityAI> subItemsExit = new array<EntityAI>;
10610 for (int i = 0; i < subItemsExit.Count(); i++)
10611 {
10614 }
10615 }
10616
10617 if (ownerPlayerNew)
10618 {
10619 array<EntityAI> subItemsEnter = new array<EntityAI>;
10621 for (int j = 0; j < subItemsEnter.Count(); j++)
10622 {
10625 }
10626 }
10627 }
10628 else if (ownerPlayerNew != null)
10629 {
10630 PlayerBase nplayer;
10631 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10632 {
10633 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10635 for (int k = 0; k < subItemsUpdate.Count(); k++)
10636 {
10638 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10639 }
10640 }
10641 }
10642
10643 if (old_owner)
10644 old_owner.OnChildItemRemoved(this);
10645 if (new_owner)
10646 new_owner.OnChildItemReceived(this);
10647 }
10648
10649
10651 {
10652 super.EEDelete(parent);
10653 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10654 if (player)
10655 {
10657
10658 if (player.IsAlive())
10659 {
10660 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10661 if (r_index >= 0)
10662 {
10663 InventoryLocation r_il = new InventoryLocation;
10664 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10665
10666 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10669 {
10670 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10671 }
10673 {
10674 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10675 }
10676
10677 }
10678
10679 player.RemoveQuickBarEntityShortcut(this);
10680 }
10681 }
10682 }
10683
10685 {
10686 super.EEKilled(killer);
10687
10690 {
10691 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10692 {
10693 if (IsMagazine())
10694 {
10695 if (Magazine.Cast(this).GetAmmoCount() > 0)
10696 {
10698 }
10699 }
10700 else
10701 {
10703 }
10704 }
10705 }
10706 }
10707
10709 {
10710 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10711
10712 super.OnWasAttached(parent, slot_id);
10713
10716
10718 }
10719
10721 {
10722 super.OnWasDetached(parent, slot_id);
10723
10726 }
10727
10729 {
10730 int idx;
10733
10734 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10735 if (inventory_slots.Count() < 1)
10736 {
10737 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10738 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10739 }
10740 else
10741 {
10742 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10743 }
10744
10745 idx = inventory_slots.Find(slot);
10746 if (idx < 0)
10747 return "";
10748
10749 return attach_types.Get(idx);
10750 }
10751
10753 {
10754 int idx = -1;
10755 string slot;
10756
10759
10760 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10761 if (inventory_slots.Count() < 1)
10762 {
10763 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10764 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10765 }
10766 else
10767 {
10768 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10769 if (detach_types.Count() < 1)
10770 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10771 }
10772
10773 for (int i = 0; i < inventory_slots.Count(); i++)
10774 {
10775 slot = inventory_slots.Get(i);
10776 }
10777
10778 if (slot != "")
10779 {
10780 if (detach_types.Count() == 1)
10781 idx = 0;
10782 else
10783 idx = inventory_slots.Find(slot);
10784 }
10785 if (idx < 0)
10786 return "";
10787
10788 return detach_types.Get(idx);
10789 }
10790
10792 {
10793
10795
10796
10797 float min_time = 1;
10798 float max_time = 3;
10799 float delay = Math.RandomFloat(min_time, max_time);
10800
10801 explode_timer.Run(delay, this, "DoAmmoExplosion");
10802 }
10803
10805 {
10806 Magazine magazine = Magazine.Cast(this);
10807 int pop_sounds_count = 6;
10808 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10809
10810
10811 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10812 string sound_name = pop_sounds[ sound_idx ];
10814
10815
10816 magazine.ServerAddAmmoCount(-1);
10817
10818
10819 float min_temp_to_explode = 100;
10820
10821 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10822 {
10824 }
10825 }
10826
10827
10828 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10829 {
10830 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10831
10832 const int CHANCE_DAMAGE_CARGO = 4;
10833 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10834 const int CHANCE_DAMAGE_NOTHING = 2;
10835
10837 {
10838 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10839 int chances;
10840 int rnd;
10841
10842 if (GetInventory().GetCargo())
10843 {
10844 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10845 rnd = Math.RandomInt(0,chances);
10846
10847 if (rnd < CHANCE_DAMAGE_CARGO)
10848 {
10850 }
10851 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10852 {
10854 }
10855 }
10856 else
10857 {
10858 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10859 rnd = Math.RandomInt(0,chances);
10860
10861 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10862 {
10864 }
10865 }
10866 }
10867 }
10868
10870 {
10871 if (GetInventory().GetCargo())
10872 {
10873 int item_count = GetInventory().GetCargo().GetItemCount();
10874 if (item_count > 0)
10875 {
10876 int random_pick = Math.RandomInt(0, item_count);
10878 if (!item.IsExplosive())
10879 {
10880 item.AddHealth("","",damage);
10881 return true;
10882 }
10883 }
10884 }
10885 return false;
10886 }
10887
10889 {
10890 int attachment_count = GetInventory().AttachmentCount();
10891 if (attachment_count > 0)
10892 {
10893 int random_pick = Math.RandomInt(0, attachment_count);
10894 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10895 if (!attachment.IsExplosive())
10896 {
10897 attachment.AddHealth("","",damage);
10898 return true;
10899 }
10900 }
10901 return false;
10902 }
10903
10905 {
10907 }
10908
10910 {
10912 return GetInventory().CanRemoveEntity();
10913
10914 return false;
10915 }
10916
10918 {
10919
10921 return false;
10922
10923
10925 return false;
10926
10927
10928
10930 if (delta == 0)
10931 return false;
10932
10933
10934 return true;
10935 }
10936
10938 {
10940 {
10941 if (ScriptInputUserData.CanStoreInputUserData())
10942 {
10943 ScriptInputUserData ctx = new ScriptInputUserData;
10948 ctx.
Write(destination_entity);
10950 ctx.
Write(slot_id);
10952 }
10953 }
10954 else if (!
GetGame().IsMultiplayer())
10955 {
10957 }
10958 }
10959
10961 {
10962 float split_quantity_new;
10966 InventoryLocation loc = new InventoryLocation;
10967
10968 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10969 {
10971 split_quantity_new = stack_max;
10972 else
10974
10976 {
10977 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10978 if (new_item)
10979 {
10980 new_item.SetResultOfSplit(true);
10981 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10983 new_item.
SetQuantity(split_quantity_new,
false,
true);
10984 }
10985 }
10986 }
10987 else if (destination_entity && slot_id == -1)
10988 {
10989 if (quantity > stack_max)
10990 split_quantity_new = stack_max;
10991 else
10992 split_quantity_new = quantity;
10993
10995 {
10997 {
11000 }
11001
11002 if (new_item)
11003 {
11004 new_item.SetResultOfSplit(true);
11005 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11007 new_item.
SetQuantity(split_quantity_new,
false,
true);
11008 }
11009 }
11010 }
11011 else
11012 {
11013 if (stack_max != 0)
11014 {
11016 {
11018 }
11019
11020 if (split_quantity_new == 0)
11021 {
11022 if (!
GetGame().IsMultiplayer())
11023 player.PhysicalPredictiveDropItem(this);
11024 else
11025 player.ServerDropEntity(this);
11026 return;
11027 }
11028
11030 {
11032
11033 if (new_item)
11034 {
11035 new_item.SetResultOfSplit(true);
11036 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11039 new_item.PlaceOnSurface();
11040 }
11041 }
11042 }
11043 }
11044 }
11045
11047 {
11048 float split_quantity_new;
11052 InventoryLocation loc = new InventoryLocation;
11053
11054 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11055 {
11057 split_quantity_new = stack_max;
11058 else
11060
11062 {
11063 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11064 if (new_item)
11065 {
11066 new_item.SetResultOfSplit(true);
11067 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11069 new_item.
SetQuantity(split_quantity_new,
false,
true);
11070 }
11071 }
11072 }
11073 else if (destination_entity && slot_id == -1)
11074 {
11075 if (quantity > stack_max)
11076 split_quantity_new = stack_max;
11077 else
11078 split_quantity_new = quantity;
11079
11081 {
11083 {
11086 }
11087
11088 if (new_item)
11089 {
11090 new_item.SetResultOfSplit(true);
11091 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11093 new_item.
SetQuantity(split_quantity_new,
false,
true);
11094 }
11095 }
11096 }
11097 else
11098 {
11099 if (stack_max != 0)
11100 {
11102 {
11104 }
11105
11107 {
11109
11110 if (new_item)
11111 {
11112 new_item.SetResultOfSplit(true);
11113 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11116 new_item.PlaceOnSurface();
11117 }
11118 }
11119 }
11120 }
11121 }
11122
11124 {
11126 {
11127 if (ScriptInputUserData.CanStoreInputUserData())
11128 {
11129 ScriptInputUserData ctx = new ScriptInputUserData;
11134 dst.WriteToContext(ctx);
11136 }
11137 }
11138 else if (!
GetGame().IsMultiplayer())
11139 {
11141 }
11142 }
11143
11145 {
11147 {
11148 if (ScriptInputUserData.CanStoreInputUserData())
11149 {
11150 ScriptInputUserData ctx = new ScriptInputUserData;
11155 ctx.
Write(destination_entity);
11161 }
11162 }
11163 else if (!
GetGame().IsMultiplayer())
11164 {
11166 }
11167 }
11168
11170 {
11172 }
11173
11175 {
11177 float split_quantity_new;
11179 if (dst.IsValid())
11180 {
11181 int slot_id = dst.GetSlot();
11183
11184 if (quantity > stack_max)
11185 split_quantity_new = stack_max;
11186 else
11187 split_quantity_new = quantity;
11188
11190 {
11192
11193 if (new_item)
11194 {
11195 new_item.SetResultOfSplit(true);
11196 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11198 new_item.
SetQuantity(split_quantity_new,
false,
true);
11199 }
11200
11201 return new_item;
11202 }
11203 }
11204
11205 return null;
11206 }
11207
11209 {
11211 float split_quantity_new;
11213 if (destination_entity)
11214 {
11216 if (quantity > stackable)
11217 split_quantity_new = stackable;
11218 else
11219 split_quantity_new = quantity;
11220
11222 {
11223 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11224 if (new_item)
11225 {
11226 new_item.SetResultOfSplit(true);
11227 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11229 new_item.
SetQuantity(split_quantity_new,
false,
true);
11230 }
11231 }
11232 }
11233 }
11234
11236 {
11238 {
11239 if (ScriptInputUserData.CanStoreInputUserData())
11240 {
11241 ScriptInputUserData ctx = new ScriptInputUserData;
11246 ItemBase destination_entity =
this;
11247 ctx.
Write(destination_entity);
11251 }
11252 }
11253 else if (!
GetGame().IsMultiplayer())
11254 {
11256 }
11257 }
11258
11260 {
11262 float split_quantity_new;
11264 if (player)
11265 {
11267 if (quantity > stackable)
11268 split_quantity_new = stackable;
11269 else
11270 split_quantity_new = quantity;
11271
11273 {
11274 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11275 new_item =
ItemBase.Cast(in_hands);
11276 if (new_item)
11277 {
11278 new_item.SetResultOfSplit(true);
11279 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11281 new_item.SetQuantity(split_quantity_new, false, true);
11282 }
11283 }
11284 }
11285 }
11286
11288 {
11290 float split_quantity_new = Math.Floor(quantity * 0.5);
11291
11293 return;
11294
11296
11297 if (new_item)
11298 {
11299 if (new_item.GetQuantityMax() < split_quantity_new)
11300 {
11301 split_quantity_new = new_item.GetQuantityMax();
11302 }
11303
11304 new_item.SetResultOfSplit(true);
11305 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11306
11308 {
11311 }
11312 else
11313 {
11315 new_item.
SetQuantity(split_quantity_new,
false,
true);
11316 }
11317 }
11318 }
11319
11321 {
11323 float split_quantity_new = Math.Floor(quantity / 2);
11324
11326 return;
11327
11328 InventoryLocation invloc = new InventoryLocation;
11330
11332 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11333
11334 if (new_item)
11335 {
11336 if (new_item.GetQuantityMax() < split_quantity_new)
11337 {
11338 split_quantity_new = new_item.GetQuantityMax();
11339 }
11341 {
11344 }
11345 else if (split_quantity_new > 1)
11346 {
11348 new_item.
SetQuantity(split_quantity_new,
false,
true);
11349 }
11350 }
11351 }
11352
11355 {
11356 SetWeightDirty();
11358
11359 if (parent)
11360 parent.OnAttachmentQuantityChangedEx(this, delta);
11361
11363 {
11365 {
11367 }
11369 {
11370 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11372 }
11373 }
11374
11375 }
11376
11379 {
11380
11381 }
11382
11385 {
11387 }
11388
11390 {
11391 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11392
11394 {
11395 if (newLevel == GameConstants.STATE_RUINED)
11396 {
11398 EntityAI parent = GetHierarchyParent();
11399 if (parent && parent.IsFireplace())
11400 {
11401 CargoBase cargo = GetInventory().GetCargo();
11402 if (cargo)
11403 {
11405 {
11407 }
11408 }
11409 }
11410 }
11411
11413 {
11414
11416 return;
11417 }
11418
11419 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11420 {
11422 }
11423 }
11424 }
11425
11426
11428 {
11429 super.OnRightClick();
11430
11432 {
11434 {
11435 if (ScriptInputUserData.CanStoreInputUserData())
11436 {
11437 EntityAI root = GetHierarchyRoot();
11438 Man playerOwner = GetHierarchyRootPlayer();
11439 InventoryLocation dst = new InventoryLocation;
11440
11441
11442 if (!playerOwner && root && root == this)
11443 {
11445 }
11446 else
11447 {
11448
11449 GetInventory().GetCurrentInventoryLocation(dst);
11451 {
11454 {
11456 }
11457 else
11458 {
11460
11461
11462 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11463 {
11465 }
11466 else
11467 {
11468 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11469 }
11470 }
11471 }
11472 }
11473
11474 ScriptInputUserData ctx = new ScriptInputUserData;
11482 }
11483 }
11484 else if (!
GetGame().IsMultiplayer())
11485 {
11487 }
11488 }
11489 }
11490
11492 {
11493 if (root)
11494 {
11495 vector m4[4];
11496 root.GetTransform(m4);
11497 dst.SetGround(this, m4);
11498 }
11499 else
11500 {
11501 GetInventory().GetCurrentInventoryLocation(dst);
11502 }
11503 }
11504
11505 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11506 {
11507
11508 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11509 return false;
11510
11511 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11512 return false;
11513
11514
11516 return false;
11517
11518
11519 Magazine mag = Magazine.Cast(this);
11520 if (mag)
11521 {
11522 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11523 return false;
11524
11525 if (stack_max_limit)
11526 {
11527 Magazine other_mag = Magazine.Cast(other_item);
11528 if (other_item)
11529 {
11530 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11531 return false;
11532 }
11533
11534 }
11535 }
11536 else
11537 {
11538
11540 return false;
11541
11543 return false;
11544 }
11545
11546 PlayerBase player = null;
11547 if (CastTo(player, GetHierarchyRootPlayer()))
11548 {
11549 if (player.GetInventory().HasAttachment(this))
11550 return false;
11551
11552 if (player.IsItemsToDelete())
11553 return false;
11554 }
11555
11556 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11557 return false;
11558
11559 int slotID;
11561 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11562 return false;
11563
11564 return true;
11565 }
11566
11568 {
11570 }
11571
11573 {
11574 return m_IsResultOfSplit;
11575 }
11576
11578 {
11579 m_IsResultOfSplit = value;
11580 }
11581
11583 {
11585 }
11586
11588 {
11589 float other_item_quantity = other_item.GetQuantity();
11590 float this_free_space;
11591
11593
11595
11596 if (other_item_quantity > this_free_space)
11597 {
11598 return this_free_space;
11599 }
11600 else
11601 {
11602 return other_item_quantity;
11603 }
11604 }
11605
11607 {
11609 }
11610
11612 {
11614 return;
11615
11616 if (!IsMagazine() && other_item)
11617 {
11619 if (quantity_used != 0)
11620 {
11621 float hp1 = GetHealth01("","");
11622 float hp2 = other_item.GetHealth01("","");
11623 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11624 hpResult = hpResult / (
GetQuantity() + quantity_used);
11625
11626 hpResult *= GetMaxHealth();
11627 Math.Round(hpResult);
11628 SetHealth("", "Health", hpResult);
11629
11631 other_item.AddQuantity(-quantity_used);
11632 }
11633 }
11635 }
11636
11638 {
11639 #ifdef SERVER
11640 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11641 GetHierarchyParent().IncreaseLifetimeUp();
11642 #endif
11643 };
11644
11646 {
11647 PlayerBase p = PlayerBase.Cast(player);
11648
11649 array<int> recipesIds = p.m_Recipes;
11650 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11651 if (moduleRecipesManager)
11652 {
11653 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11654 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11655 }
11656
11657 for (int i = 0;i < recipesIds.Count(); i++)
11658 {
11659 int key = recipesIds.Get(i);
11660 string recipeName = moduleRecipesManager.GetRecipeName(key);
11662 }
11663 }
11664
11665
11666 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11667 {
11668 super.GetDebugActions(outputList);
11669
11670
11676
11677
11682
11687
11688
11692
11693
11695 {
11699 }
11700
11703
11704
11708
11710
11711 InventoryLocation loc = new InventoryLocation();
11712 GetInventory().GetCurrentInventoryLocation(loc);
11714 {
11715 if (Gizmo_IsSupported())
11718 }
11719
11721 }
11722
11723
11724
11725
11727 {
11728 super.OnAction(action_id, player, ctx);
11729
11731 {
11732 switch (action_id)
11733 {
11736 return true;
11739 return true;
11740 }
11741 }
11742
11744 {
11745 switch (action_id)
11746 {
11748 Delete();
11749 return true;
11750 }
11751 }
11752
11753 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11754 {
11755 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11756 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11757 PlayerBase p = PlayerBase.Cast(player);
11758 if (
EActions.RECIPES_RANGE_START < 1000)
11759 {
11760 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11761 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11762 }
11763 }
11764 #ifndef SERVER
11765 else if (action_id ==
EActions.WATCH_PLAYER)
11766 {
11767 PluginDeveloper.SetDeveloperItemClientEx(player);
11768 }
11769 #endif
11771 {
11772 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11773 {
11774 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11775 OnDebugButtonPressServer(id + 1);
11776 }
11777
11778 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11779 {
11780 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11782 }
11783
11784 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11785 {
11786 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11788 }
11789
11790 else if (action_id ==
EActions.ADD_QUANTITY)
11791 {
11792 if (IsMagazine())
11793 {
11794 Magazine mag = Magazine.Cast(this);
11795 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11796 }
11797 else
11798 {
11800 }
11801
11802 if (m_EM)
11803 {
11804 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11805 }
11806
11807 }
11808
11809 else if (action_id ==
EActions.REMOVE_QUANTITY)
11810 {
11811 if (IsMagazine())
11812 {
11813 Magazine mag2 = Magazine.Cast(this);
11814 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11815 }
11816 else
11817 {
11819 }
11820 if (m_EM)
11821 {
11822 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11823 }
11824
11825 }
11826
11827 else if (action_id ==
EActions.SET_QUANTITY_0)
11828 {
11830
11831 if (m_EM)
11832 {
11833 m_EM.SetEnergy(0);
11834 }
11835 }
11836
11837 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11838 {
11840
11841 if (m_EM)
11842 {
11843 m_EM.SetEnergy(m_EM.GetEnergyMax());
11844 }
11845 }
11846
11847 else if (action_id ==
EActions.ADD_HEALTH)
11848 {
11849 AddHealth("","",GetMaxHealth("","Health")/5);
11850 }
11851 else if (action_id ==
EActions.REMOVE_HEALTH)
11852 {
11853 AddHealth("","",-GetMaxHealth("","Health")/5);
11854 }
11855 else if (action_id ==
EActions.DESTROY_HEALTH)
11856 {
11857 SetHealth01("","",0);
11858 }
11859 else if (action_id ==
EActions.WATCH_ITEM)
11860 {
11862 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11863 #ifdef DEVELOPER
11864 SetDebugDeveloper_item(this);
11865 #endif
11866 }
11867
11868 else if (action_id ==
EActions.ADD_TEMPERATURE)
11869 {
11870 AddTemperature(20);
11871
11872 }
11873
11874 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11875 {
11876 AddTemperature(-20);
11877
11878 }
11879
11880 else if (action_id ==
EActions.FLIP_FROZEN)
11881 {
11882 SetFrozen(!GetIsFrozen());
11883
11884 }
11885
11886 else if (action_id ==
EActions.ADD_WETNESS)
11887 {
11889
11890 }
11891
11892 else if (action_id ==
EActions.REMOVE_WETNESS)
11893 {
11895
11896 }
11897
11898 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11899 {
11902
11903
11904 }
11905
11906 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11907 {
11910 }
11911
11912 else if (action_id ==
EActions.MAKE_SPECIAL)
11913 {
11914 auto debugParams = DebugSpawnParams.WithPlayer(player);
11915 OnDebugSpawnEx(debugParams);
11916 }
11917
11918 }
11919
11920
11921 return false;
11922 }
11923
11924
11925
11926
11930
11933
11934
11935
11937 {
11938 return false;
11939 }
11940
11941
11943 {
11944 return true;
11945 }
11946
11947
11949 {
11950 return true;
11951 }
11952
11953
11954
11956 {
11957 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11959 }
11960
11963 {
11964 return null;
11965 }
11966
11968 {
11969 return false;
11970 }
11971
11973 {
11974 return false;
11975 }
11976
11980
11981
11983 {
11984 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11985 return module_repairing.CanRepair(this, item_repair_kit);
11986 }
11987
11988
11989 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11990 {
11991 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11992 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11993 }
11994
11995
11997 {
11998
11999
12000
12001
12002
12003
12004
12005
12006 return 1;
12007 }
12008
12009
12010
12012 {
12014 }
12015
12016
12017
12019 {
12021 }
12022
12023
12032 {
12033 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12034
12035 if (player)
12036 {
12037 player.MessageStatus(text);
12038 }
12039 }
12040
12041
12050 {
12051 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12052
12053 if (player)
12054 {
12055 player.MessageAction(text);
12056 }
12057 }
12058
12059
12068 {
12069 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12070
12071 if (player)
12072 {
12073 player.MessageFriendly(text);
12074 }
12075 }
12076
12077
12086 {
12087 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12088
12089 if (player)
12090 {
12091 player.MessageImportant(text);
12092 }
12093 }
12094
12096 {
12097 return true;
12098 }
12099
12100
12101 override bool KindOf(
string tag)
12102 {
12103 bool found = false;
12104 string item_name = this.
GetType();
12107
12108 int array_size = item_tag_array.Count();
12109 for (int i = 0; i < array_size; i++)
12110 {
12111 if (item_tag_array.Get(i) == tag)
12112 {
12113 found = true;
12114 break;
12115 }
12116 }
12117 return found;
12118 }
12119
12120
12122 {
12123
12124 super.OnRPC(sender, rpc_type,ctx);
12125
12126
12127 switch (rpc_type)
12128 {
12129 #ifndef SERVER
12130 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12131 Param2<bool, string> p = new Param2<bool, string>(false, "");
12132
12134 return;
12135
12136 bool play = p.param1;
12137 string soundSet = p.param2;
12138
12139 if (play)
12140 {
12142 {
12144 {
12146 }
12147 }
12148 else
12149 {
12151 }
12152 }
12153 else
12154 {
12156 }
12157
12158 break;
12159 #endif
12160
12161 }
12162
12164 {
12166 }
12167 }
12168
12169
12170
12171
12173 {
12174 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12175 return plugin.GetID(
name);
12176 }
12177
12179 {
12180 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12181 return plugin.GetName(id);
12182 }
12183
12186 {
12187
12188
12189 int varFlags;
12190 if (!ctx.
Read(varFlags))
12191 return;
12192
12193 if (varFlags & ItemVariableFlags.FLOAT)
12194 {
12196 }
12197 }
12198
12200 {
12201
12202 super.SerializeNumericalVars(floats_out);
12203
12204
12205
12207 {
12209 }
12210
12212 {
12214 }
12215
12217 {
12219 }
12220
12222 {
12227 }
12228
12230 {
12232 }
12233 }
12234
12236 {
12237
12238 super.DeSerializeNumericalVars(floats);
12239
12240
12241 int index = 0;
12242 int mask = Math.Round(floats.Get(index));
12243
12244 index++;
12245
12247 {
12249 {
12251 }
12252 else
12253 {
12254 float quantity = floats.Get(index);
12255 SetQuantity(quantity,
true,
false,
false,
false);
12256 }
12257 index++;
12258 }
12259
12261 {
12262 float wet = floats.Get(index);
12264 index++;
12265 }
12266
12268 {
12269 int liquidtype = Math.Round(floats.Get(index));
12271 index++;
12272 }
12273
12275 {
12277 index++;
12279 index++;
12281 index++;
12283 index++;
12284 }
12285
12287 {
12288 int cleanness = Math.Round(floats.Get(index));
12290 index++;
12291 }
12292 }
12293
12295 {
12296 super.WriteVarsToCTX(ctx);
12297
12298
12300 {
12302 }
12303
12305 {
12307 }
12308
12310 {
12312 }
12313
12315 {
12316 int r,g,b,a;
12322 }
12323
12325 {
12327 }
12328 }
12329
12331 {
12332 if (!super.ReadVarsFromCTX(ctx,version))
12333 return false;
12334
12335 int intValue;
12336 float value;
12337
12338 if (version < 140)
12339 {
12340 if (!ctx.
Read(intValue))
12341 return false;
12342
12343 m_VariablesMask = intValue;
12344 }
12345
12347 {
12348 if (!ctx.
Read(value))
12349 return false;
12350
12352 {
12354 }
12355 else
12356 {
12358 }
12359 }
12360
12361 if (version < 140)
12362 {
12364 {
12365 if (!ctx.
Read(value))
12366 return false;
12367 SetTemperatureDirect(value);
12368 }
12369 }
12370
12372 {
12373 if (!ctx.
Read(value))
12374 return false;
12376 }
12377
12379 {
12380 if (!ctx.
Read(intValue))
12381 return false;
12383 }
12384
12386 {
12387 int r,g,b,a;
12389 return false;
12391 return false;
12393 return false;
12395 return false;
12396
12398 }
12399
12401 {
12402 if (!ctx.
Read(intValue))
12403 return false;
12405 }
12406
12407 if (version >= 138 && version < 140)
12408 {
12410 {
12411 if (!ctx.
Read(intValue))
12412 return false;
12413 SetFrozen(intValue);
12414 }
12415 }
12416
12417 return true;
12418 }
12419
12420
12422 {
12425 {
12427 }
12428
12429 if (!super.OnStoreLoad(ctx, version))
12430 {
12432 return false;
12433 }
12434
12435 if (version >= 114)
12436 {
12437 bool hasQuickBarIndexSaved;
12438
12439 if (!ctx.
Read(hasQuickBarIndexSaved))
12440 {
12442 return false;
12443 }
12444
12445 if (hasQuickBarIndexSaved)
12446 {
12447 int itmQBIndex;
12448
12449
12450 if (!ctx.
Read(itmQBIndex))
12451 {
12453 return false;
12454 }
12455
12456 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12457 if (itmQBIndex != -1 && parentPlayer)
12458 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12459 }
12460 }
12461 else
12462 {
12463
12464 PlayerBase player;
12465 int itemQBIndex;
12466 if (version ==
int.
MAX)
12467 {
12468 if (!ctx.
Read(itemQBIndex))
12469 {
12471 return false;
12472 }
12473 }
12474 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12475 {
12476
12477 if (!ctx.
Read(itemQBIndex))
12478 {
12480 return false;
12481 }
12482 if (itemQBIndex != -1 && player)
12483 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12484 }
12485 }
12486
12487 if (version < 140)
12488 {
12489
12490 if (!LoadVariables(ctx, version))
12491 {
12493 return false;
12494 }
12495 }
12496
12497
12499 {
12501 return false;
12502 }
12503 if (version >= 132)
12504 {
12506 if (raib)
12507 {
12509 {
12511 return false;
12512 }
12513 }
12514 }
12515
12517 return true;
12518 }
12519
12520
12521
12523 {
12524 super.OnStoreSave(ctx);
12525
12526 PlayerBase player;
12527 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12528 {
12530
12531 int itemQBIndex = -1;
12532 itemQBIndex = player.FindQuickBarEntityIndex(this);
12533 ctx.
Write(itemQBIndex);
12534 }
12535 else
12536 {
12538 }
12539
12541
12543 if (raib)
12544 {
12546 }
12547 }
12548
12549
12551 {
12552 super.AfterStoreLoad();
12553
12555 {
12557 }
12558
12560 {
12563 }
12564 }
12565
12567 {
12568 super.EEOnAfterLoad();
12569
12571 {
12573 }
12574
12577 }
12578
12580 {
12581 return false;
12582 }
12583
12584
12585
12587 {
12589 {
12590 #ifdef PLATFORM_CONSOLE
12591
12593 {
12595 if (menu)
12596 {
12598 }
12599 }
12600 #endif
12601 }
12602
12604 {
12607 }
12608
12610 {
12611 SetWeightDirty();
12613 }
12615 {
12618 }
12619
12621 {
12624 }
12626 {
12629 }
12630
12631 super.OnVariablesSynchronized();
12632 }
12633
12634
12635
12637 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12638 {
12639 if (!IsServerCheck(allow_client))
12640 return false;
12641
12643 return false;
12644
12647
12648 if (value <= (min + 0.001))
12649 value = min;
12650
12651 if (value == min)
12652 {
12653 if (destroy_config)
12654 {
12655 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12656 if (dstr)
12657 {
12659 this.Delete();
12660 return true;
12661 }
12662 }
12663 else if (destroy_forced)
12664 {
12666 this.Delete();
12667 return true;
12668 }
12669
12671 }
12672
12675
12677 {
12679
12680 if (delta)
12682 }
12683
12685
12686 return false;
12687 }
12688
12689
12691 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12692 {
12694 }
12695
12697 {
12700 }
12701
12703 {
12706 }
12707
12709 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12710 {
12711 float value_clamped = Math.Clamp(value, 0, 1);
12713 SetQuantity(result, destroy_config, destroy_forced);
12714 }
12715
12716
12719 {
12721 }
12722
12724 {
12726 }
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12738 {
12739 int slot = -1;
12740 if (GetInventory())
12741 {
12742 InventoryLocation il = new InventoryLocation;
12743 GetInventory().GetCurrentInventoryLocation(il);
12745 }
12746
12748 }
12749
12751 {
12752 float quantity_max = 0;
12753
12755 {
12756 if (attSlotID != -1)
12757 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12758
12759 if (quantity_max <= 0)
12761 }
12762
12763 if (quantity_max <= 0)
12765
12766 return quantity_max;
12767 }
12768
12770 {
12772 }
12773
12775 {
12777 }
12778
12779
12781 {
12783 }
12784
12786 {
12788 }
12789
12791 {
12793 }
12794
12795
12797 {
12798
12799 float weightEx = GetWeightEx();
12800 float special = GetInventoryAndCargoWeight();
12801 return weightEx - special;
12802 }
12803
12804
12806 {
12808 }
12809
12811 {
12813 {
12814 #ifdef DEVELOPER
12815 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12816 {
12817 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12819 }
12820 #endif
12821
12822 return GetQuantity() * GetConfigWeightModified();
12823 }
12824 else if (HasEnergyManager())
12825 {
12826 #ifdef DEVELOPER
12827 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12828 {
12829 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12830 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12831 }
12832 #endif
12833 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12834 }
12835 else
12836 {
12837 #ifdef DEVELOPER
12838 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12839 {
12840 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12841 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12842 }
12843 #endif
12844 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12845 }
12846 }
12847
12850 {
12851 int item_count = 0;
12853
12854 if (GetInventory().GetCargo() != NULL)
12855 {
12856 item_count = GetInventory().GetCargo().GetItemCount();
12857 }
12858
12859 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12860 {
12861 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12862 if (item)
12863 item_count += item.GetNumberOfItems();
12864 }
12865 return item_count;
12866 }
12867
12870 {
12871 float weight = 0;
12872 float wetness = 1;
12873 if (include_wetness)
12876 {
12877 weight = wetness * m_ConfigWeight;
12878 }
12880 {
12881 weight = 1;
12882 }
12883 return weight;
12884 }
12885
12886
12887
12889 {
12890 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12891 {
12892 GameInventory inv = GetInventory();
12893 array<EntityAI> items = new array<EntityAI>;
12895 for (int i = 0; i < items.Count(); i++)
12896 {
12898 if (item)
12899 {
12901 }
12902 }
12903 }
12904 }
12905
12906
12907
12908
12910 {
12911 float energy = 0;
12912 if (HasEnergyManager())
12913 {
12914 energy = GetCompEM().GetEnergy();
12915 }
12916 return energy;
12917 }
12918
12919
12921 {
12922 super.OnEnergyConsumed();
12923
12925 }
12926
12928 {
12929 super.OnEnergyAdded();
12930
12932 }
12933
12934
12936 {
12937 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12938 {
12940 {
12941 float energy_0to1 = GetCompEM().GetEnergy0To1();
12943 }
12944 }
12945 }
12946
12947
12949 {
12950 return ConfigGetFloat("heatIsolation");
12951 }
12952
12954 {
12956 }
12957
12959 {
12960 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12961 if (
GetGame().ConfigIsExisting(paramPath))
12963
12964 return 0.0;
12965 }
12966
12968 {
12969 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12970 if (
GetGame().ConfigIsExisting(paramPath))
12972
12973 return 0.0;
12974 }
12975
12976 override void SetWet(
float value,
bool allow_client =
false)
12977 {
12978 if (!IsServerCheck(allow_client))
12979 return;
12980
12983
12985
12986 m_VarWet = Math.Clamp(value, min, max);
12987
12989 {
12992 }
12993 }
12994
12995 override void AddWet(
float value)
12996 {
12998 }
12999
13001 {
13003 }
13004
13006 {
13008 }
13009
13011 {
13013 }
13014
13016 {
13018 }
13019
13021 {
13023 }
13024
13025 override void OnWetChanged(
float newVal,
float oldVal)
13026 {
13029 if (newLevel != oldLevel)
13030 {
13032 }
13033 }
13034
13036 {
13037 SetWeightDirty();
13038 }
13039
13041 {
13042 return GetWetLevelInternal(
m_VarWet);
13043 }
13044
13045
13046
13048 {
13050 }
13051
13053 {
13055 }
13056
13058 {
13060 }
13061
13063 {
13065 }
13066
13067
13068
13070 {
13071 if (ConfigIsExisting("itemModelLength"))
13072 {
13073 return ConfigGetFloat("itemModelLength");
13074 }
13075 return 0;
13076 }
13077
13079 {
13080 if (ConfigIsExisting("itemAttachOffset"))
13081 {
13082 return ConfigGetFloat("itemAttachOffset");
13083 }
13084 return 0;
13085 }
13086
13087 override void SetCleanness(
int value,
bool allow_client =
false)
13088 {
13089 if (!IsServerCheck(allow_client))
13090 return;
13091
13093
13095
13098 }
13099
13101 {
13103 }
13104
13106 {
13107 return true;
13108 }
13109
13110
13111
13112
13114 {
13116 }
13117
13119 {
13121 }
13122
13123
13124
13125
13126 override void SetColor(
int r,
int g,
int b,
int a)
13127 {
13133 }
13135 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13136 {
13141 }
13142
13144 {
13146 }
13147
13150 {
13151 int r,g,b,a;
13153 r = r/255;
13154 g = g/255;
13155 b = b/255;
13156 a = a/255;
13157 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13158 }
13159
13160
13161
13162 override void SetLiquidType(
int value,
bool allow_client =
false)
13163 {
13164 if (!IsServerCheck(allow_client))
13165 return;
13166
13171 }
13172
13174 {
13175 return ConfigGetInt("varLiquidTypeInit");
13176 }
13177
13179 {
13181 }
13182
13184 {
13186 SetFrozen(false);
13187 }
13188
13191 {
13192 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13193 }
13194
13195
13198 {
13199 PlayerBase nplayer;
13200 if (PlayerBase.CastTo(nplayer, player))
13201 {
13203
13204 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13205 }
13206 }
13207
13208
13211 {
13212 PlayerBase nplayer;
13213 if (PlayerBase.CastTo(nplayer,player))
13214 {
13215
13216 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13217
13218 }
13219
13220
13221 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13222
13223
13224 if (HasEnergyManager())
13225 {
13226 GetCompEM().UpdatePlugState();
13227 }
13228 }
13229
13230
13232 {
13233 super.OnPlacementStarted(player);
13234
13236 }
13237
13238 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13239 {
13241 {
13242 m_AdminLog.OnPlacementComplete(player,
this);
13243 }
13244
13245 super.OnPlacementComplete(player, position, orientation);
13246 }
13247
13248
13249
13250
13251
13253 {
13255 {
13256 return true;
13257 }
13258 else
13259 {
13260 return false;
13261 }
13262 }
13263
13264
13266 {
13268 {
13270 }
13271 }
13272
13273
13275 {
13277 }
13278
13280 {
13282 }
13283
13284 override void InsertAgent(
int agent,
float count = 1)
13285 {
13286 if (count < 1)
13287 return;
13288
13290 }
13291
13294 {
13296 }
13297
13298
13300 {
13302 }
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13346 {
13348 return false;
13349 return true;
13350 }
13351
13353 {
13354
13356 }
13357
13358
13361 {
13362 super.CheckForRoofLimited(timeTresholdMS);
13363
13365 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13366 {
13367 m_PreviousRoofTestTime = time;
13368 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13369 }
13370 }
13371
13372
13374 {
13376 {
13377 return 0;
13378 }
13379
13380 if (GetInventory().GetAttachmentSlotsCount() != 0)
13381 {
13382 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13383 if (filter)
13384 return filter.GetProtectionLevel(type, false, system);
13385 else
13386 return 0;
13387 }
13388
13389 string subclassPath, entryName;
13390
13391 switch (type)
13392 {
13394 entryName = "biological";
13395 break;
13397 entryName = "chemical";
13398 break;
13399 default:
13400 entryName = "biological";
13401 break;
13402 }
13403
13404 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13405
13407 }
13408
13409
13410
13413 {
13414 if (!IsMagazine())
13416
13418 }
13419
13420
13421
13422
13423
13428 {
13429 return true;
13430 }
13431
13433 {
13435 }
13436
13437
13438
13439
13440
13442 {
13443 if (parent)
13444 {
13445 if (parent.IsInherited(DayZInfected))
13446 return true;
13447
13448 if (!parent.IsRuined())
13449 return true;
13450 }
13451
13452 return true;
13453 }
13454
13456 {
13457 if (!super.CanPutAsAttachment(parent))
13458 {
13459 return false;
13460 }
13461
13462 if (!IsRuined() && !parent.IsRuined())
13463 {
13464 return true;
13465 }
13466
13467 return false;
13468 }
13469
13471 {
13472
13473
13474
13475
13476 return super.CanReceiveItemIntoCargo(item);
13477 }
13478
13480 {
13481
13482
13483
13484
13485 GameInventory attachmentInv = attachment.GetInventory();
13487 {
13488 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13489 return false;
13490 }
13491
13492 InventoryLocation loc = new InventoryLocation();
13493 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13494 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13495 return false;
13496
13497 return super.CanReceiveAttachment(attachment, slotId);
13498 }
13499
13501 {
13502 if (!super.CanReleaseAttachment(attachment))
13503 return false;
13504
13505 return GetInventory().AreChildrenAccessible();
13506 }
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13529 {
13530 int id = muzzle_owner.GetMuzzleID();
13531 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13532
13533 if (WPOF_array)
13534 {
13535 for (int i = 0; i < WPOF_array.Count(); i++)
13536 {
13537 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13538
13539 if (WPOF)
13540 {
13541 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13542 }
13543 }
13544 }
13545 }
13546
13547
13549 {
13550 int id = muzzle_owner.GetMuzzleID();
13552
13553 if (WPOBE_array)
13554 {
13555 for (int i = 0; i < WPOBE_array.Count(); i++)
13556 {
13557 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13558
13559 if (WPOBE)
13560 {
13561 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13562 }
13563 }
13564 }
13565 }
13566
13567
13569 {
13570 int id = muzzle_owner.GetMuzzleID();
13571 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13572
13573 if (WPOOH_array)
13574 {
13575 for (int i = 0; i < WPOOH_array.Count(); i++)
13576 {
13577 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13578
13579 if (WPOOH)
13580 {
13581 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13582 }
13583 }
13584 }
13585 }
13586
13587
13589 {
13590 int id = muzzle_owner.GetMuzzleID();
13591 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13592
13593 if (WPOOH_array)
13594 {
13595 for (int i = 0; i < WPOOH_array.Count(); i++)
13596 {
13597 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13598
13599 if (WPOOH)
13600 {
13601 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13602 }
13603 }
13604 }
13605 }
13606
13607
13609 {
13610 int id = muzzle_owner.GetMuzzleID();
13611 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13612
13613 if (WPOOH_array)
13614 {
13615 for (int i = 0; i < WPOOH_array.Count(); i++)
13616 {
13617 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13618
13619 if (WPOOH)
13620 {
13621 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13622 }
13623 }
13624 }
13625 }
13626
13627
13628
13630 {
13632 {
13633 return true;
13634 }
13635
13636 return false;
13637 }
13638
13640 {
13642 {
13643 return true;
13644 }
13645
13646 return false;
13647 }
13648
13650 {
13652 {
13653 return true;
13654 }
13655
13656 return false;
13657 }
13658
13660 {
13661 return false;
13662 }
13663
13666 {
13667 return UATimeSpent.DEFAULT_DEPLOY;
13668 }
13669
13670
13671
13672
13674 {
13676 SetSynchDirty();
13677 }
13678
13680 {
13682 }
13683
13684
13686 {
13687 return false;
13688 }
13689
13692 {
13693 string att_type = "None";
13694
13695 if (ConfigIsExisting("soundAttType"))
13696 {
13697 att_type = ConfigGetString("soundAttType");
13698 }
13699
13701 }
13702
13704 {
13706 }
13707
13708
13709
13710
13711
13717
13719 {
13722
13724 }
13725
13726
13728 {
13730 return;
13731
13733
13736
13739
13740 SoundParameters params = new SoundParameters();
13744 }
13745
13746
13748 {
13750 return;
13751
13753 SetSynchDirty();
13754
13757 }
13758
13759
13761 {
13763 return;
13764
13766 SetSynchDirty();
13767
13770 }
13771
13773 {
13775 }
13776
13778 {
13780 }
13781
13784 {
13785 if (!
GetGame().IsDedicatedServer())
13786 {
13787 if (ConfigIsExisting("attachSoundSet"))
13788 {
13789 string cfg_path = "";
13790 string soundset = "";
13791 string type_name =
GetType();
13792
13795 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13796 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13797
13798 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13799 {
13800 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13801 {
13802 if (cfg_slot_array[i] == slot_type)
13803 {
13804 soundset = cfg_soundset_array[i];
13805 break;
13806 }
13807 }
13808 }
13809
13810 if (soundset != "")
13811 {
13812 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13814 }
13815 }
13816 }
13817 }
13818
13820 {
13821
13822 }
13823
13824 void OnApply(PlayerBase player);
13825
13827 {
13828 return 1.0;
13829 };
13830
13832 {
13834 }
13835
13837 {
13839 }
13840
13842
13844 {
13845 SetDynamicPhysicsLifeTime(0.01);
13847 }
13848
13850 {
13851 array<string> zone_names = new array<string>;
13852 GetDamageZones(zone_names);
13853 for (int i = 0; i < zone_names.Count(); i++)
13854 {
13855 SetHealthMax(zone_names.Get(i),"Health");
13856 }
13857 SetHealthMax("","Health");
13858 }
13859
13862 {
13863 float global_health = GetHealth01("","Health");
13864 array<string> zones = new array<string>;
13865 GetDamageZones(zones);
13866
13867 for (int i = 0; i < zones.Count(); i++)
13868 {
13869 SetHealth01(zones.Get(i),"Health",global_health);
13870 }
13871 }
13872
13875 {
13876 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13877 }
13878
13880 {
13881 if (!hasRootAsPlayer)
13882 {
13883 if (refParentIB)
13884 {
13885
13886 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13887 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13888
13889 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13890 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13891
13894 }
13895 else
13896 {
13897
13900 }
13901 }
13902 }
13903
13905 {
13907 {
13908 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13909 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13910 {
13911 float heatPermCoef = 1.0;
13913 while (ent)
13914 {
13915 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13916 ent = ent.GetHierarchyParent();
13917 }
13918
13919 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13920 }
13921 }
13922 }
13923
13925 {
13926
13927 EntityAI parent = GetHierarchyParent();
13928 if (!parent)
13929 {
13930 hasParent = false;
13931 hasRootAsPlayer = false;
13932 }
13933 else
13934 {
13935 hasParent = true;
13936 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13937 refParentIB =
ItemBase.Cast(parent);
13938 }
13939 }
13940
13941 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13942 {
13943
13944 }
13945
13947 {
13948
13949 return false;
13950 }
13951
13953 {
13954
13955
13956 return false;
13957 }
13958
13960 {
13961
13962 return false;
13963 }
13964
13967 {
13968 return !GetIsFrozen() &&
IsOpen();
13969 }
13970
13972 {
13973 bool hasParent = false, hasRootAsPlayer = false;
13975
13976 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13977 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13978
13979 if (wwtu || foodDecay)
13980 {
13984
13985 if (processWetness || processTemperature || processDecay)
13986 {
13988
13989 if (processWetness)
13990 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13991
13992 if (processTemperature)
13994
13995 if (processDecay)
13996 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13997 }
13998 }
13999 }
14000
14003 {
14005 }
14006
14008 {
14011
14012 return super.GetTemperatureFreezeThreshold();
14013 }
14014
14016 {
14019
14020 return super.GetTemperatureThawThreshold();
14021 }
14022
14024 {
14027
14028 return super.GetItemOverheatThreshold();
14029 }
14030
14032 {
14034 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
14035
14036 return super.GetTemperatureFreezeTime();
14037 }
14038
14040 {
14042 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14043
14044 return super.GetTemperatureThawTime();
14045 }
14046
14051
14053 {
14054 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14055 }
14056
14058 {
14059 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14060 }
14061
14064 {
14066 }
14067
14069 {
14071 }
14072
14074 {
14076 }
14077
14080 {
14081 return null;
14082 }
14083
14086 {
14087 return false;
14088 }
14089
14091 {
14093 {
14096 if (!trg)
14097 {
14099 explosive = this;
14100 }
14101
14102 explosive.PairRemote(trg);
14104
14105 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14106 trg.SetPersistentPairID(persistentID);
14107 explosive.SetPersistentPairID(persistentID);
14108
14109 return true;
14110 }
14111 return false;
14112 }
14113
14116 {
14117 float ret = 1.0;
14120 ret *= GetHealth01();
14121
14122 return ret;
14123 }
14124
14125 #ifdef DEVELOPER
14126 override void SetDebugItem()
14127 {
14128 super.SetDebugItem();
14129 _itemBase = this;
14130 }
14131
14133 {
14134 string text = super.GetDebugText();
14135
14137 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14138
14139 return text;
14140 }
14141 #endif
14142
14144 {
14145 return true;
14146 }
14147
14149
14151
14153 {
14156 }
14157
14158
14166
14182}
14183
14185{
14187 if (entity)
14188 {
14189 bool is_item = entity.IsInherited(
ItemBase);
14190 if (is_item && full_quantity)
14191 {
14194 }
14195 }
14196 else
14197 {
14199 return NULL;
14200 }
14201 return entity;
14202}
14203
14205{
14206 if (item)
14207 {
14208 if (health > 0)
14209 item.SetHealth("", "", health);
14210
14211 if (item.CanHaveTemperature())
14212 {
14214 if (item.CanFreeze())
14215 item.SetFrozen(false);
14216 }
14217
14218 if (item.HasEnergyManager())
14219 {
14220 if (quantity >= 0)
14221 {
14222 item.GetCompEM().SetEnergy0To1(quantity);
14223 }
14224 else
14225 {
14227 }
14228 }
14229 else if (item.IsMagazine())
14230 {
14231 Magazine mag = Magazine.Cast(item);
14232 if (quantity >= 0)
14233 {
14234 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14235 }
14236 else
14237 {
14239 }
14240
14241 }
14242 else
14243 {
14244 if (quantity >= 0)
14245 {
14246 item.SetQuantityNormalized(quantity, false);
14247 }
14248 else
14249 {
14251 }
14252
14253 }
14254 }
14255}
14256
14257#ifdef DEVELOPER
14259#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.