9292{
9294 {
9295 return true;
9296 }
9297};
9298
9299
9300
9302{
9306
9308
9311
9312
9313
9314
9315
9324
9330
9335
9340
9361 protected bool m_IsResultOfSplit
9362
9364
9369
9370
9371
9373
9377
9378
9379
9381
9384
9385
9386
9392
9393
9401
9404
9405
9407
9408
9410
9411
9416
9417
9422
9423
9425
9426
9428 {
9433
9434 if (!
GetGame().IsDedicatedServer())
9435 {
9437 {
9439
9441 {
9443 }
9444 }
9445
9448 }
9449
9450 m_OldLocation = null;
9451
9453 {
9455 }
9456
9457 if (ConfigIsExisting("headSelectionsToHide"))
9458 {
9461 }
9462
9464 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9465 {
9467 }
9468
9470
9471 m_IsResultOfSplit = false;
9472
9474 }
9475
9477 {
9478 super.InitItemVariables();
9479
9485 m_Count = ConfigGetInt(
"count");
9486
9489
9494
9497
9502
9514
9518
9519
9522 if (ConfigIsExisting("canBeSplit"))
9523 {
9526 }
9527
9529 if (ConfigIsExisting("itemBehaviour"))
9531
9532
9535 RegisterNetSyncVariableInt("m_VarLiquidType");
9536 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9537
9538 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9539 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9540 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9541
9542 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9543 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9544 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9545 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9546
9547 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9548 RegisterNetSyncVariableBool("m_IsTakeable");
9549 RegisterNetSyncVariableBool("m_IsHologram");
9550
9553 {
9556 }
9557
9559
9561 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9563
9564 }
9565
9567 {
9569 }
9570
9572 {
9575 {
9580 }
9581 }
9582
9583 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9584 {
9586 {
9589 }
9590
9592 }
9593
9595 {
9601 }
9602
9604
9606 {
9608
9609 if (!action)
9610 {
9611 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9612 return;
9613 }
9614
9616 if (!ai)
9617 {
9619 return;
9620 }
9621
9623 if (!action_array)
9624 {
9625 action_array = new array<ActionBase_Basic>;
9627 }
9628 if (LogManager.IsActionLogEnable())
9629 {
9630 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9631 }
9632
9633 if (action_array.Find(action) != -1)
9634 {
9635 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9636 }
9637 else
9638 {
9639 action_array.Insert(action);
9640 }
9641 }
9642
9644 {
9646 ActionBase action = player.GetActionManager().GetAction(actionName);
9649
9650 if (action_array)
9651 {
9652 action_array.RemoveItem(action);
9653 }
9654 }
9655
9656
9657
9659 {
9660 ActionOverrideData overrideData = new ActionOverrideData();
9664
9666 if (!actionMap)
9667 {
9670 }
9671
9672 actionMap.Insert(this.
Type(), overrideData);
9673
9674 }
9675
9677
9679
9680
9682 {
9685
9688
9689 string config_to_search = "CfgVehicles";
9690 string muzzle_owner_config;
9691
9693 {
9694 if (IsInherited(Weapon))
9695 config_to_search = "CfgWeapons";
9696
9697 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9698
9699 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9700
9702
9703 if (config_OnFire_subclass_count > 0)
9704 {
9705 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9706
9707 for (int i = 0; i < config_OnFire_subclass_count; i++)
9708 {
9709 string particle_class = "";
9711 string config_OnFire_entry = config_OnFire_class + particle_class;
9712 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9713 WPOF_array.Insert(WPOF);
9714 }
9715
9716
9718 }
9719 }
9720
9722 {
9723 config_to_search = "CfgWeapons";
9724 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9725
9726 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9727
9729
9730 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9731 {
9732 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9733
9734 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9735 {
9736 string particle_class2 = "";
9738 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9739 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9740 WPOBE_array.Insert(WPOBE);
9741 }
9742
9743
9745 }
9746 }
9747 }
9748
9749
9751 {
9754
9756 {
9757 string config_to_search = "CfgVehicles";
9758
9759 if (IsInherited(Weapon))
9760 config_to_search = "CfgWeapons";
9761
9762 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9763 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9764
9765 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9766 {
9767
9769
9771 {
9773 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9775 return;
9776 }
9777
9780
9781
9782
9784 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9785
9786 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9787 {
9788 string particle_class = "";
9790 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9792
9793 if (entry_type == CT_CLASS)
9794 {
9795 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9796 WPOOH_array.Insert(WPOF);
9797 }
9798 }
9799
9800
9802 }
9803 }
9804 }
9805
9807 {
9809 }
9810
9812 {
9814 {
9816
9819
9822
9823 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9824 }
9825 }
9826
9828 {
9830 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9831
9833 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9834
9836 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9837
9839 {
9841 }
9842 }
9843
9845 {
9847 }
9848
9850 {
9853 else
9855
9857 {
9860 }
9861 else
9862 {
9865
9868 }
9869
9871 }
9872
9874 {
9876 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9877 }
9878
9880 {
9882 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9884 }
9885
9887 {
9889 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9890 }
9891
9893 {
9896
9897 OverheatingParticle OP = new OverheatingParticle();
9902
9904 }
9905
9907 {
9910
9911 return -1;
9912 }
9913
9915 {
9917 {
9920
9921 for (int i = count; i > 0; --i)
9922 {
9923 int id = i - 1;
9926
9929
9930 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9931 {
9932 if (p)
9933 {
9936 }
9937 }
9938 }
9939 }
9940 }
9941
9943 {
9945 {
9947 {
9948 int id = i - 1;
9950
9951 if (OP)
9952 {
9954
9955 if (p)
9956 {
9958 }
9959
9960 delete OP;
9961 }
9962 }
9963
9966 }
9967 }
9968
9971 {
9972 return 0.0;
9973 }
9974
9975
9977 {
9978 return 250;
9979 }
9980
9982 {
9983 return 0;
9984 }
9985
9988 {
9990 return true;
9991
9992 return false;
9993 }
9994
9997 {
10000
10002 {
10004 }
10005 else
10006 {
10007
10009 }
10010
10012 }
10013
10020 {
10021 return -1;
10022 }
10023
10024
10025
10026
10028 {
10030 {
10032 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10033
10034 if (r_index >= 0)
10035 {
10036 InventoryLocation r_il = new InventoryLocation;
10037 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10038
10039 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10042 {
10043 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10044 }
10046 {
10047 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10048 }
10049
10050 }
10051
10052 player.GetHumanInventory().ClearUserReservedLocation(this);
10053 }
10054
10057 }
10058
10059
10060
10061
10063 {
10064 return ItemBase.m_DebugActionsMask;
10065 }
10066
10068 {
10069 return ItemBase.m_DebugActionsMask & mask;
10070 }
10071
10073 {
10074 ItemBase.m_DebugActionsMask = mask;
10075 }
10076
10078 {
10079 ItemBase.m_DebugActionsMask |= mask;
10080 }
10081
10083 {
10084 ItemBase.m_DebugActionsMask &= ~mask;
10085 }
10086
10088 {
10090 {
10092 }
10093 else
10094 {
10096 }
10097 }
10098
10099
10101 {
10102 if (GetEconomyProfile())
10103 {
10104 float q_max = GetEconomyProfile().GetQuantityMax();
10105 if (q_max > 0)
10106 {
10107 float q_min = GetEconomyProfile().GetQuantityMin();
10108 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10109
10111 {
10112 ComponentEnergyManager comp = GetCompEM();
10114 {
10116 }
10117 }
10119 {
10121
10122 }
10123
10124 }
10125 }
10126 }
10127
10130 {
10131 EntityAI parent = GetHierarchyParent();
10132
10133 if (parent)
10134 {
10135 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10136 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10137 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10138 }
10139 }
10140
10143 {
10144 EntityAI parent = GetHierarchyParent();
10145
10146 if (parent)
10147 {
10148 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10149 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10150 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10151 }
10152 }
10153
10155 {
10156
10157
10158
10159
10161
10163 {
10164 if (ScriptInputUserData.CanStoreInputUserData())
10165 {
10166 ScriptInputUserData ctx = new ScriptInputUserData;
10172 ctx.
Write(use_stack_max);
10175
10177 {
10178 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10179 }
10180 }
10181 }
10182 else if (!
GetGame().IsMultiplayer())
10183 {
10185 }
10186 }
10187
10189 {
10191 }
10192
10194 {
10196 }
10197
10199 {
10201 }
10202
10204 {
10205
10206 return false;
10207 }
10208
10210 {
10211 return false;
10212 }
10213
10217 {
10218 return false;
10219 }
10220
10222 {
10223 return "";
10224 }
10225
10227
10229 {
10230 return false;
10231 }
10232
10234 {
10235 return true;
10236 }
10237
10238
10239
10241 {
10242 return true;
10243 }
10244
10246 {
10247 return true;
10248 }
10249
10251 {
10252 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10254 }
10255
10257 {
10259 }
10260
10262 {
10264 if (!is_being_placed)
10266 SetSynchDirty();
10267 }
10268
10269
10271
10273 {
10275 }
10276
10278 {
10280 }
10281
10283 {
10284 return 1;
10285 }
10286
10288 {
10289 return false;
10290 }
10291
10293 {
10295 SetSynchDirty();
10296 }
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10333 {
10334 super.OnMovedInsideCargo(container);
10335
10336 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10337 }
10338
10339 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10340 {
10341 super.EEItemLocationChanged(oldLoc,newLoc);
10342
10343 PlayerBase new_player = null;
10344 PlayerBase old_player = null;
10345
10346 if (newLoc.GetParent())
10347 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10348
10349 if (oldLoc.GetParent())
10350 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10351
10353 {
10354 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10355
10356 if (r_index >= 0)
10357 {
10358 InventoryLocation r_il = new InventoryLocation;
10359 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10360
10361 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10364 {
10365 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10366 }
10368 {
10369 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10370 }
10371
10372 }
10373 }
10374
10376 {
10377 if (new_player)
10378 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10379
10380 if (new_player == old_player)
10381 {
10382
10383 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10384 {
10386 {
10387 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10388 {
10389 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10390 }
10391 }
10392 else
10393 {
10394 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10395 }
10396 }
10397
10398 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10399 {
10400 int type = oldLoc.GetType();
10402 {
10403 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10404 }
10406 {
10407 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10408 }
10409 }
10410 if (!m_OldLocation)
10411 {
10412 m_OldLocation = new InventoryLocation;
10413 }
10414 m_OldLocation.Copy(oldLoc);
10415 }
10416 else
10417 {
10418 if (m_OldLocation)
10419 {
10420 m_OldLocation.Reset();
10421 }
10422 }
10423
10425 }
10426 else
10427 {
10428 if (new_player)
10429 {
10430 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10431 if (res_index >= 0)
10432 {
10433 InventoryLocation il = new InventoryLocation;
10434 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10436 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10439 {
10440 il.
GetParent().GetOnReleaseLock().Invoke(it);
10441 }
10443 {
10445 }
10446
10447 }
10448 }
10450 {
10451
10453 }
10454
10455 if (m_OldLocation)
10456 {
10457 m_OldLocation.Reset();
10458 }
10459 }
10460 }
10461
10462 override void EOnContact(IEntity other, Contact extra)
10463 {
10465 {
10466 int liquidType = -1;
10468 if (impactSpeed > 0.0)
10469 {
10471 #ifndef SERVER
10473 #else
10475 SetSynchDirty();
10476 #endif
10478 }
10479 }
10480
10481 #ifdef SERVER
10482 if (GetCompEM() && GetCompEM().IsPlugged())
10483 {
10484 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10485 GetCompEM().UnplugThis();
10486 }
10487 #endif
10488 }
10489
10491
10493 {
10495 }
10496
10498 {
10499
10500 }
10501
10503 {
10504 super.OnItemLocationChanged(old_owner, new_owner);
10505
10506 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10507 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10508
10509 if (!relatedPlayer && playerNew)
10510 relatedPlayer = playerNew;
10511
10512 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10513 {
10515 if (actionMgr)
10516 {
10517 ActionBase currentAction = actionMgr.GetRunningAction();
10518 if (currentAction)
10520 }
10521 }
10522
10523 Man ownerPlayerOld = null;
10524 Man ownerPlayerNew = null;
10525
10526 if (old_owner)
10527 {
10528 if (old_owner.
IsMan())
10529 {
10530 ownerPlayerOld = Man.Cast(old_owner);
10531 }
10532 else
10533 {
10534 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10535 }
10536 }
10537 else
10538 {
10540 {
10542
10543 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10544 {
10545 GetCompEM().UnplugThis();
10546 }
10547 }
10548 }
10549
10550 if (new_owner)
10551 {
10552 if (new_owner.
IsMan())
10553 {
10554 ownerPlayerNew = Man.Cast(new_owner);
10555 }
10556 else
10557 {
10558 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10559 }
10560 }
10561
10562 if (ownerPlayerOld != ownerPlayerNew)
10563 {
10564 if (ownerPlayerOld)
10565 {
10566 array<EntityAI> subItemsExit = new array<EntityAI>;
10568 for (int i = 0; i < subItemsExit.Count(); i++)
10569 {
10572 }
10573 }
10574
10575 if (ownerPlayerNew)
10576 {
10577 array<EntityAI> subItemsEnter = new array<EntityAI>;
10579 for (int j = 0; j < subItemsEnter.Count(); j++)
10580 {
10583 }
10584 }
10585 }
10586 else if (ownerPlayerNew != null)
10587 {
10588 PlayerBase nplayer;
10589 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10590 {
10591 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10593 for (int k = 0; k < subItemsUpdate.Count(); k++)
10594 {
10596 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10597 }
10598 }
10599 }
10600
10601 if (old_owner)
10602 old_owner.OnChildItemRemoved(this);
10603 if (new_owner)
10604 new_owner.OnChildItemReceived(this);
10605 }
10606
10607
10609 {
10610 super.EEDelete(parent);
10611 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10612 if (player)
10613 {
10615
10616 if (player.IsAlive())
10617 {
10618 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10619 if (r_index >= 0)
10620 {
10621 InventoryLocation r_il = new InventoryLocation;
10622 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10623
10624 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10627 {
10628 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10629 }
10631 {
10632 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10633 }
10634
10635 }
10636
10637 player.RemoveQuickBarEntityShortcut(this);
10638 }
10639 }
10640 }
10641
10643 {
10644 super.EEKilled(killer);
10645
10648 {
10649 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10650 {
10651 if (IsMagazine())
10652 {
10653 if (Magazine.Cast(this).GetAmmoCount() > 0)
10654 {
10656 }
10657 }
10658 else
10659 {
10661 }
10662 }
10663 }
10664 }
10665
10667 {
10668 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10669
10670 super.OnWasAttached(parent, slot_id);
10671
10674
10676 }
10677
10679 {
10680 super.OnWasDetached(parent, slot_id);
10681
10684 }
10685
10687 {
10688 int idx;
10691
10692 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10693 if (inventory_slots.Count() < 1)
10694 {
10695 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10696 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10697 }
10698 else
10699 {
10700 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10701 }
10702
10703 idx = inventory_slots.Find(slot);
10704 if (idx < 0)
10705 return "";
10706
10707 return attach_types.Get(idx);
10708 }
10709
10711 {
10712 int idx = -1;
10713 string slot;
10714
10717
10718 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10719 if (inventory_slots.Count() < 1)
10720 {
10721 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10722 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10723 }
10724 else
10725 {
10726 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10727 if (detach_types.Count() < 1)
10728 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10729 }
10730
10731 for (int i = 0; i < inventory_slots.Count(); i++)
10732 {
10733 slot = inventory_slots.Get(i);
10734 }
10735
10736 if (slot != "")
10737 {
10738 if (detach_types.Count() == 1)
10739 idx = 0;
10740 else
10741 idx = inventory_slots.Find(slot);
10742 }
10743 if (idx < 0)
10744 return "";
10745
10746 return detach_types.Get(idx);
10747 }
10748
10750 {
10751
10753
10754
10755 float min_time = 1;
10756 float max_time = 3;
10757 float delay = Math.RandomFloat(min_time, max_time);
10758
10759 explode_timer.Run(delay, this, "DoAmmoExplosion");
10760 }
10761
10763 {
10764 Magazine magazine = Magazine.Cast(this);
10765 int pop_sounds_count = 6;
10766 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10767
10768
10769 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10770 string sound_name = pop_sounds[ sound_idx ];
10772
10773
10774 magazine.ServerAddAmmoCount(-1);
10775
10776
10777 float min_temp_to_explode = 100;
10778
10779 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10780 {
10782 }
10783 }
10784
10785
10786 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10787 {
10788 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10789
10790 const int CHANCE_DAMAGE_CARGO = 4;
10791 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10792 const int CHANCE_DAMAGE_NOTHING = 2;
10793
10795 {
10796 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10797 int chances;
10798 int rnd;
10799
10800 if (GetInventory().GetCargo())
10801 {
10802 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10803 rnd = Math.RandomInt(0,chances);
10804
10805 if (rnd < CHANCE_DAMAGE_CARGO)
10806 {
10808 }
10809 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10810 {
10812 }
10813 }
10814 else
10815 {
10816 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10817 rnd = Math.RandomInt(0,chances);
10818
10819 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10820 {
10822 }
10823 }
10824 }
10825 }
10826
10828 {
10829 if (GetInventory().GetCargo())
10830 {
10831 int item_count = GetInventory().GetCargo().GetItemCount();
10832 if (item_count > 0)
10833 {
10834 int random_pick = Math.RandomInt(0, item_count);
10836 if (!item.IsExplosive())
10837 {
10838 item.AddHealth("","",damage);
10839 return true;
10840 }
10841 }
10842 }
10843 return false;
10844 }
10845
10847 {
10848 int attachment_count = GetInventory().AttachmentCount();
10849 if (attachment_count > 0)
10850 {
10851 int random_pick = Math.RandomInt(0, attachment_count);
10852 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10853 if (!attachment.IsExplosive())
10854 {
10855 attachment.AddHealth("","",damage);
10856 return true;
10857 }
10858 }
10859 return false;
10860 }
10861
10863 {
10865 }
10866
10868 {
10870 return GetInventory().CanRemoveEntity();
10871
10872 return false;
10873 }
10874
10876 {
10877
10879 return false;
10880
10881
10883 return false;
10884
10885
10886
10888 if (delta == 0)
10889 return false;
10890
10891
10892 return true;
10893 }
10894
10896 {
10898 {
10899 if (ScriptInputUserData.CanStoreInputUserData())
10900 {
10901 ScriptInputUserData ctx = new ScriptInputUserData;
10906 ctx.
Write(destination_entity);
10908 ctx.
Write(slot_id);
10910 }
10911 }
10912 else if (!
GetGame().IsMultiplayer())
10913 {
10915 }
10916 }
10917
10919 {
10920 float split_quantity_new;
10924 InventoryLocation loc = new InventoryLocation;
10925
10926 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10927 {
10929 split_quantity_new = stack_max;
10930 else
10932
10934 {
10935 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10936 if (new_item)
10937 {
10938 new_item.SetResultOfSplit(true);
10939 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10941 new_item.
SetQuantity(split_quantity_new,
false,
true);
10942 }
10943 }
10944 }
10945 else if (destination_entity && slot_id == -1)
10946 {
10947 if (quantity > stack_max)
10948 split_quantity_new = stack_max;
10949 else
10950 split_quantity_new = quantity;
10951
10953 {
10955 {
10958 }
10959
10960 if (new_item)
10961 {
10962 new_item.SetResultOfSplit(true);
10963 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10965 new_item.
SetQuantity(split_quantity_new,
false,
true);
10966 }
10967 }
10968 }
10969 else
10970 {
10971 if (stack_max != 0)
10972 {
10974 {
10976 }
10977
10978 if (split_quantity_new == 0)
10979 {
10980 if (!
GetGame().IsMultiplayer())
10981 player.PhysicalPredictiveDropItem(this);
10982 else
10983 player.ServerDropEntity(this);
10984 return;
10985 }
10986
10988 {
10990
10991 if (new_item)
10992 {
10993 new_item.SetResultOfSplit(true);
10994 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10997 new_item.PlaceOnSurface();
10998 }
10999 }
11000 }
11001 }
11002 }
11003
11005 {
11006 float split_quantity_new;
11010 InventoryLocation loc = new InventoryLocation;
11011
11012 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11013 {
11015 split_quantity_new = stack_max;
11016 else
11018
11020 {
11021 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11022 if (new_item)
11023 {
11024 new_item.SetResultOfSplit(true);
11025 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11027 new_item.
SetQuantity(split_quantity_new,
false,
true);
11028 }
11029 }
11030 }
11031 else if (destination_entity && slot_id == -1)
11032 {
11033 if (quantity > stack_max)
11034 split_quantity_new = stack_max;
11035 else
11036 split_quantity_new = quantity;
11037
11039 {
11041 {
11044 }
11045
11046 if (new_item)
11047 {
11048 new_item.SetResultOfSplit(true);
11049 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11051 new_item.
SetQuantity(split_quantity_new,
false,
true);
11052 }
11053 }
11054 }
11055 else
11056 {
11057 if (stack_max != 0)
11058 {
11060 {
11062 }
11063
11065 {
11067
11068 if (new_item)
11069 {
11070 new_item.SetResultOfSplit(true);
11071 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11074 new_item.PlaceOnSurface();
11075 }
11076 }
11077 }
11078 }
11079 }
11080
11082 {
11084 {
11085 if (ScriptInputUserData.CanStoreInputUserData())
11086 {
11087 ScriptInputUserData ctx = new ScriptInputUserData;
11092 dst.WriteToContext(ctx);
11094 }
11095 }
11096 else if (!
GetGame().IsMultiplayer())
11097 {
11099 }
11100 }
11101
11103 {
11105 {
11106 if (ScriptInputUserData.CanStoreInputUserData())
11107 {
11108 ScriptInputUserData ctx = new ScriptInputUserData;
11113 ctx.
Write(destination_entity);
11119 }
11120 }
11121 else if (!
GetGame().IsMultiplayer())
11122 {
11124 }
11125 }
11126
11128 {
11130 }
11131
11133 {
11135 float split_quantity_new;
11137 if (dst.IsValid())
11138 {
11139 int slot_id = dst.GetSlot();
11141
11142 if (quantity > stack_max)
11143 split_quantity_new = stack_max;
11144 else
11145 split_quantity_new = quantity;
11146
11148 {
11150
11151 if (new_item)
11152 {
11153 new_item.SetResultOfSplit(true);
11154 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11156 new_item.
SetQuantity(split_quantity_new,
false,
true);
11157 }
11158
11159 return new_item;
11160 }
11161 }
11162
11163 return null;
11164 }
11165
11167 {
11169 float split_quantity_new;
11171 if (destination_entity)
11172 {
11174 if (quantity > stackable)
11175 split_quantity_new = stackable;
11176 else
11177 split_quantity_new = quantity;
11178
11180 {
11181 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11182 if (new_item)
11183 {
11184 new_item.SetResultOfSplit(true);
11185 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11187 new_item.
SetQuantity(split_quantity_new,
false,
true);
11188 }
11189 }
11190 }
11191 }
11192
11194 {
11196 {
11197 if (ScriptInputUserData.CanStoreInputUserData())
11198 {
11199 ScriptInputUserData ctx = new ScriptInputUserData;
11204 ItemBase destination_entity =
this;
11205 ctx.
Write(destination_entity);
11209 }
11210 }
11211 else if (!
GetGame().IsMultiplayer())
11212 {
11214 }
11215 }
11216
11218 {
11220 float split_quantity_new;
11222 if (player)
11223 {
11225 if (quantity > stackable)
11226 split_quantity_new = stackable;
11227 else
11228 split_quantity_new = quantity;
11229
11231 {
11232 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11233 new_item =
ItemBase.Cast(in_hands);
11234 if (new_item)
11235 {
11236 new_item.SetResultOfSplit(true);
11237 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11239 new_item.SetQuantity(split_quantity_new, false, true);
11240 }
11241 }
11242 }
11243 }
11244
11246 {
11248 float split_quantity_new = Math.Floor(quantity * 0.5);
11249
11251 return;
11252
11254
11255 if (new_item)
11256 {
11257 if (new_item.GetQuantityMax() < split_quantity_new)
11258 {
11259 split_quantity_new = new_item.GetQuantityMax();
11260 }
11261
11262 new_item.SetResultOfSplit(true);
11263 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11264
11266 {
11269 }
11270 else
11271 {
11273 new_item.
SetQuantity(split_quantity_new,
false,
true);
11274 }
11275 }
11276 }
11277
11279 {
11281 float split_quantity_new = Math.Floor(quantity / 2);
11282
11284 return;
11285
11286 InventoryLocation invloc = new InventoryLocation;
11288
11290 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11291
11292 if (new_item)
11293 {
11294 if (new_item.GetQuantityMax() < split_quantity_new)
11295 {
11296 split_quantity_new = new_item.GetQuantityMax();
11297 }
11299 {
11302 }
11303 else if (split_quantity_new > 1)
11304 {
11306 new_item.
SetQuantity(split_quantity_new,
false,
true);
11307 }
11308 }
11309 }
11310
11313 {
11314 SetWeightDirty();
11316
11317 if (parent)
11318 parent.OnAttachmentQuantityChangedEx(this, delta);
11319
11321 {
11323 {
11325 }
11327 {
11328 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11330 }
11331 }
11332
11333 }
11334
11337 {
11338
11339 }
11340
11343 {
11345 }
11346
11348 {
11349 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11350
11352 {
11353 if (newLevel == GameConstants.STATE_RUINED)
11354 {
11356 EntityAI parent = GetHierarchyParent();
11357 if (parent && parent.IsFireplace())
11358 {
11359 CargoBase cargo = GetInventory().GetCargo();
11360 if (cargo)
11361 {
11363 {
11365 }
11366 }
11367 }
11368 }
11369
11371 {
11372
11374 return;
11375 }
11376
11377 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11378 {
11380 }
11381 }
11382 }
11383
11384
11386 {
11387 super.OnRightClick();
11388
11390 {
11392 {
11393 if (ScriptInputUserData.CanStoreInputUserData())
11394 {
11395 EntityAI root = GetHierarchyRoot();
11396 Man playerOwner = GetHierarchyRootPlayer();
11397 InventoryLocation dst = new InventoryLocation;
11398
11399
11400 if (!playerOwner && root && root == this)
11401 {
11403 }
11404 else
11405 {
11406
11407 GetInventory().GetCurrentInventoryLocation(dst);
11409 {
11412 {
11414 }
11415 else
11416 {
11418
11419
11420 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11421 {
11423 }
11424 else
11425 {
11426 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11427 }
11428 }
11429 }
11430 }
11431
11432 ScriptInputUserData ctx = new ScriptInputUserData;
11440 }
11441 }
11442 else if (!
GetGame().IsMultiplayer())
11443 {
11445 }
11446 }
11447 }
11448
11450 {
11451 if (root)
11452 {
11453 vector m4[4];
11454 root.GetTransform(m4);
11455 dst.SetGround(this, m4);
11456 }
11457 else
11458 {
11459 GetInventory().GetCurrentInventoryLocation(dst);
11460 }
11461 }
11462
11463 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11464 {
11465
11466 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11467 return false;
11468
11469 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11470 return false;
11471
11472
11474 return false;
11475
11476
11477 Magazine mag = Magazine.Cast(this);
11478 if (mag)
11479 {
11480 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11481 return false;
11482
11483 if (stack_max_limit)
11484 {
11485 Magazine other_mag = Magazine.Cast(other_item);
11486 if (other_item)
11487 {
11488 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11489 return false;
11490 }
11491
11492 }
11493 }
11494 else
11495 {
11496
11498 return false;
11499
11501 return false;
11502 }
11503
11504 PlayerBase player = null;
11505 if (CastTo(player, GetHierarchyRootPlayer()))
11506 {
11507 if (player.GetInventory().HasAttachment(this))
11508 return false;
11509
11510 if (player.IsItemsToDelete())
11511 return false;
11512 }
11513
11514 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11515 return false;
11516
11517 int slotID;
11519 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11520 return false;
11521
11522 return true;
11523 }
11524
11526 {
11528 }
11529
11531 {
11532 return m_IsResultOfSplit;
11533 }
11534
11536 {
11537 m_IsResultOfSplit = value;
11538 }
11539
11541 {
11543 }
11544
11546 {
11547 float other_item_quantity = other_item.GetQuantity();
11548 float this_free_space;
11549
11551
11553
11554 if (other_item_quantity > this_free_space)
11555 {
11556 return this_free_space;
11557 }
11558 else
11559 {
11560 return other_item_quantity;
11561 }
11562 }
11563
11565 {
11567 }
11568
11570 {
11572 return;
11573
11574 if (!IsMagazine() && other_item)
11575 {
11577 if (quantity_used != 0)
11578 {
11579 float hp1 = GetHealth01("","");
11580 float hp2 = other_item.GetHealth01("","");
11581 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11582 hpResult = hpResult / (
GetQuantity() + quantity_used);
11583
11584 hpResult *= GetMaxHealth();
11585 Math.Round(hpResult);
11586 SetHealth("", "Health", hpResult);
11587
11589 other_item.AddQuantity(-quantity_used);
11590 }
11591 }
11593 }
11594
11596 {
11597 #ifdef SERVER
11598 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11599 GetHierarchyParent().IncreaseLifetimeUp();
11600 #endif
11601 };
11602
11604 {
11605 PlayerBase p = PlayerBase.Cast(player);
11606
11607 array<int> recipesIds = p.m_Recipes;
11608 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11609 if (moduleRecipesManager)
11610 {
11611 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11612 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11613 }
11614
11615 for (int i = 0;i < recipesIds.Count(); i++)
11616 {
11617 int key = recipesIds.Get(i);
11618 string recipeName = moduleRecipesManager.GetRecipeName(key);
11620 }
11621 }
11622
11623
11624 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11625 {
11626 super.GetDebugActions(outputList);
11627
11628
11634
11635
11640
11645
11646
11650
11651
11653 {
11657 }
11658
11661
11662
11666
11668
11669 InventoryLocation loc = new InventoryLocation();
11670 GetInventory().GetCurrentInventoryLocation(loc);
11672 {
11673 if (Gizmo_IsSupported())
11676 }
11677
11679 }
11680
11681
11682
11683
11685 {
11686 super.OnAction(action_id, player, ctx);
11687
11689 {
11690 switch (action_id)
11691 {
11694 return true;
11697 return true;
11698 }
11699 }
11700
11702 {
11703 switch (action_id)
11704 {
11706 Delete();
11707 return true;
11708 }
11709 }
11710
11711 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11712 {
11713 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11714 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11715 PlayerBase p = PlayerBase.Cast(player);
11716 if (
EActions.RECIPES_RANGE_START < 1000)
11717 {
11718 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11719 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11720 }
11721 }
11722 #ifndef SERVER
11723 else if (action_id ==
EActions.WATCH_PLAYER)
11724 {
11725 PluginDeveloper.SetDeveloperItemClientEx(player);
11726 }
11727 #endif
11729 {
11730 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11731 {
11732 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11733 OnDebugButtonPressServer(id + 1);
11734 }
11735
11736 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11737 {
11738 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11740 }
11741
11742 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11743 {
11744 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11746 }
11747
11748 else if (action_id ==
EActions.ADD_QUANTITY)
11749 {
11750 if (IsMagazine())
11751 {
11752 Magazine mag = Magazine.Cast(this);
11753 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11754 }
11755 else
11756 {
11758 }
11759
11760 if (m_EM)
11761 {
11762 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11763 }
11764
11765 }
11766
11767 else if (action_id ==
EActions.REMOVE_QUANTITY)
11768 {
11769 if (IsMagazine())
11770 {
11771 Magazine mag2 = Magazine.Cast(this);
11772 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11773 }
11774 else
11775 {
11777 }
11778 if (m_EM)
11779 {
11780 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11781 }
11782
11783 }
11784
11785 else if (action_id ==
EActions.SET_QUANTITY_0)
11786 {
11788
11789 if (m_EM)
11790 {
11791 m_EM.SetEnergy(0);
11792 }
11793 }
11794
11795 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11796 {
11798
11799 if (m_EM)
11800 {
11801 m_EM.SetEnergy(m_EM.GetEnergyMax());
11802 }
11803 }
11804
11805 else if (action_id ==
EActions.ADD_HEALTH)
11806 {
11807 AddHealth("","",GetMaxHealth("","Health")/5);
11808 }
11809 else if (action_id ==
EActions.REMOVE_HEALTH)
11810 {
11811 AddHealth("","",-GetMaxHealth("","Health")/5);
11812 }
11813 else if (action_id ==
EActions.DESTROY_HEALTH)
11814 {
11815 SetHealth01("","",0);
11816 }
11817 else if (action_id ==
EActions.WATCH_ITEM)
11818 {
11820 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11821 #ifdef DEVELOPER
11822 SetDebugDeveloper_item(this);
11823 #endif
11824 }
11825
11826 else if (action_id ==
EActions.ADD_TEMPERATURE)
11827 {
11828 AddTemperature(20);
11829
11830 }
11831
11832 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11833 {
11834 AddTemperature(-20);
11835
11836 }
11837
11838 else if (action_id ==
EActions.FLIP_FROZEN)
11839 {
11840 SetFrozen(!GetIsFrozen());
11841
11842 }
11843
11844 else if (action_id ==
EActions.ADD_WETNESS)
11845 {
11847
11848 }
11849
11850 else if (action_id ==
EActions.REMOVE_WETNESS)
11851 {
11853
11854 }
11855
11856 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11857 {
11860
11861
11862 }
11863
11864 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11865 {
11868 }
11869
11870 else if (action_id ==
EActions.MAKE_SPECIAL)
11871 {
11872 auto debugParams = DebugSpawnParams.WithPlayer(player);
11873 OnDebugSpawnEx(debugParams);
11874 }
11875
11876 }
11877
11878
11879 return false;
11880 }
11881
11882
11883
11884
11888
11891
11892
11893
11895 {
11896 return false;
11897 }
11898
11899
11901 {
11902 return true;
11903 }
11904
11905
11907 {
11908 return true;
11909 }
11910
11911
11912
11914 {
11915 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11917 }
11918
11921 {
11922 return null;
11923 }
11924
11926 {
11927 return false;
11928 }
11929
11931 {
11932 return false;
11933 }
11934
11938
11939
11941 {
11942 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11943 return module_repairing.CanRepair(this, item_repair_kit);
11944 }
11945
11946
11947 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11948 {
11949 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11950 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11951 }
11952
11953
11955 {
11956
11957
11958
11959
11960
11961
11962
11963
11964 return 1;
11965 }
11966
11967
11968
11970 {
11972 }
11973
11974
11975
11977 {
11979 }
11980
11981
11990 {
11991 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11992
11993 if (player)
11994 {
11995 player.MessageStatus(text);
11996 }
11997 }
11998
11999
12008 {
12009 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12010
12011 if (player)
12012 {
12013 player.MessageAction(text);
12014 }
12015 }
12016
12017
12026 {
12027 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12028
12029 if (player)
12030 {
12031 player.MessageFriendly(text);
12032 }
12033 }
12034
12035
12044 {
12045 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12046
12047 if (player)
12048 {
12049 player.MessageImportant(text);
12050 }
12051 }
12052
12054 {
12055 return true;
12056 }
12057
12058
12059 override bool KindOf(
string tag)
12060 {
12061 bool found = false;
12062 string item_name = this.
GetType();
12065
12066 int array_size = item_tag_array.Count();
12067 for (int i = 0; i < array_size; i++)
12068 {
12069 if (item_tag_array.Get(i) == tag)
12070 {
12071 found = true;
12072 break;
12073 }
12074 }
12075 return found;
12076 }
12077
12078
12080 {
12081
12082 super.OnRPC(sender, rpc_type,ctx);
12083
12084
12085 switch (rpc_type)
12086 {
12087 #ifndef SERVER
12088 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12089 Param2<bool, string> p = new Param2<bool, string>(false, "");
12090
12092 return;
12093
12094 bool play = p.param1;
12095 string soundSet = p.param2;
12096
12097 if (play)
12098 {
12100 {
12102 {
12104 }
12105 }
12106 else
12107 {
12109 }
12110 }
12111 else
12112 {
12114 }
12115
12116 break;
12117 #endif
12118
12119 }
12120
12122 {
12124 }
12125 }
12126
12127
12128
12129
12131 {
12132 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12133 return plugin.GetID(
name);
12134 }
12135
12137 {
12138 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12139 return plugin.GetName(id);
12140 }
12141
12144 {
12145
12146
12147 int varFlags;
12148 if (!ctx.
Read(varFlags))
12149 return;
12150
12151 if (varFlags & ItemVariableFlags.FLOAT)
12152 {
12154 }
12155 }
12156
12158 {
12159
12160 super.SerializeNumericalVars(floats_out);
12161
12162
12163
12165 {
12167 }
12168
12170 {
12172 }
12173
12175 {
12177 }
12178
12180 {
12185 }
12186
12188 {
12190 }
12191 }
12192
12194 {
12195
12196 super.DeSerializeNumericalVars(floats);
12197
12198
12199 int index = 0;
12200 int mask = Math.Round(floats.Get(index));
12201
12202 index++;
12203
12205 {
12207 {
12209 }
12210 else
12211 {
12212 float quantity = floats.Get(index);
12213 SetQuantity(quantity,
true,
false,
false,
false);
12214 }
12215 index++;
12216 }
12217
12219 {
12220 float wet = floats.Get(index);
12222 index++;
12223 }
12224
12226 {
12227 int liquidtype = Math.Round(floats.Get(index));
12229 index++;
12230 }
12231
12233 {
12235 index++;
12237 index++;
12239 index++;
12241 index++;
12242 }
12243
12245 {
12246 int cleanness = Math.Round(floats.Get(index));
12248 index++;
12249 }
12250 }
12251
12253 {
12254 super.WriteVarsToCTX(ctx);
12255
12256
12258 {
12260 }
12261
12263 {
12265 }
12266
12268 {
12270 }
12271
12273 {
12274 int r,g,b,a;
12280 }
12281
12283 {
12285 }
12286 }
12287
12289 {
12290 if (!super.ReadVarsFromCTX(ctx,version))
12291 return false;
12292
12293 int intValue;
12294 float value;
12295
12296 if (version < 140)
12297 {
12298 if (!ctx.
Read(intValue))
12299 return false;
12300
12301 m_VariablesMask = intValue;
12302 }
12303
12305 {
12306 if (!ctx.
Read(value))
12307 return false;
12308
12310 {
12312 }
12313 else
12314 {
12316 }
12317 }
12318
12319 if (version < 140)
12320 {
12322 {
12323 if (!ctx.
Read(value))
12324 return false;
12325 SetTemperatureDirect(value);
12326 }
12327 }
12328
12330 {
12331 if (!ctx.
Read(value))
12332 return false;
12334 }
12335
12337 {
12338 if (!ctx.
Read(intValue))
12339 return false;
12341 }
12342
12344 {
12345 int r,g,b,a;
12347 return false;
12349 return false;
12351 return false;
12353 return false;
12354
12356 }
12357
12359 {
12360 if (!ctx.
Read(intValue))
12361 return false;
12363 }
12364
12365 if (version >= 138 && version < 140)
12366 {
12368 {
12369 if (!ctx.
Read(intValue))
12370 return false;
12371 SetFrozen(intValue);
12372 }
12373 }
12374
12375 return true;
12376 }
12377
12378
12380 {
12383 {
12385 }
12386
12387 if (!super.OnStoreLoad(ctx, version))
12388 {
12390 return false;
12391 }
12392
12393 if (version >= 114)
12394 {
12395 bool hasQuickBarIndexSaved;
12396
12397 if (!ctx.
Read(hasQuickBarIndexSaved))
12398 {
12400 return false;
12401 }
12402
12403 if (hasQuickBarIndexSaved)
12404 {
12405 int itmQBIndex;
12406
12407
12408 if (!ctx.
Read(itmQBIndex))
12409 {
12411 return false;
12412 }
12413
12414 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12415 if (itmQBIndex != -1 && parentPlayer)
12416 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12417 }
12418 }
12419 else
12420 {
12421
12422 PlayerBase player;
12423 int itemQBIndex;
12424 if (version ==
int.
MAX)
12425 {
12426 if (!ctx.
Read(itemQBIndex))
12427 {
12429 return false;
12430 }
12431 }
12432 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12433 {
12434
12435 if (!ctx.
Read(itemQBIndex))
12436 {
12438 return false;
12439 }
12440 if (itemQBIndex != -1 && player)
12441 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12442 }
12443 }
12444
12445 if (version < 140)
12446 {
12447
12448 if (!LoadVariables(ctx, version))
12449 {
12451 return false;
12452 }
12453 }
12454
12455
12457 {
12459 return false;
12460 }
12461 if (version >= 132)
12462 {
12464 if (raib)
12465 {
12467 {
12469 return false;
12470 }
12471 }
12472 }
12473
12475 return true;
12476 }
12477
12478
12479
12481 {
12482 super.OnStoreSave(ctx);
12483
12484 PlayerBase player;
12485 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12486 {
12488
12489 int itemQBIndex = -1;
12490 itemQBIndex = player.FindQuickBarEntityIndex(this);
12491 ctx.
Write(itemQBIndex);
12492 }
12493 else
12494 {
12496 }
12497
12499
12501 if (raib)
12502 {
12504 }
12505 }
12506
12507
12509 {
12510 super.AfterStoreLoad();
12511
12513 {
12515 }
12516
12518 {
12521 }
12522 }
12523
12525 {
12526 super.EEOnAfterLoad();
12527
12529 {
12531 }
12532
12535 }
12536
12538 {
12539 return false;
12540 }
12541
12542
12543
12545 {
12547 {
12548 #ifdef PLATFORM_CONSOLE
12549
12551 {
12553 if (menu)
12554 {
12556 }
12557 }
12558 #endif
12559 }
12560
12562 {
12565 }
12566
12568 {
12569 SetWeightDirty();
12571 }
12573 {
12576 }
12577
12579 {
12582 }
12584 {
12587 }
12588
12589 super.OnVariablesSynchronized();
12590 }
12591
12592
12593
12595 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12596 {
12597 if (!IsServerCheck(allow_client))
12598 return false;
12599
12601 return false;
12602
12605
12606 if (value <= (min + 0.001))
12607 value = min;
12608
12609 if (value == min)
12610 {
12611 if (destroy_config)
12612 {
12613 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12614 if (dstr)
12615 {
12617 this.Delete();
12618 return true;
12619 }
12620 }
12621 else if (destroy_forced)
12622 {
12624 this.Delete();
12625 return true;
12626 }
12627
12629 }
12630
12633
12635 {
12637
12638 if (delta)
12640 }
12641
12643
12644 return false;
12645 }
12646
12647
12649 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12650 {
12652 }
12653
12655 {
12658 }
12659
12661 {
12664 }
12665
12667 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12668 {
12669 float value_clamped = Math.Clamp(value, 0, 1);
12671 SetQuantity(result, destroy_config, destroy_forced);
12672 }
12673
12674
12677 {
12679 }
12680
12682 {
12684 }
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12696 {
12697 int slot = -1;
12698 if (GetInventory())
12699 {
12700 InventoryLocation il = new InventoryLocation;
12701 GetInventory().GetCurrentInventoryLocation(il);
12703 }
12704
12706 }
12707
12709 {
12710 float quantity_max = 0;
12711
12713 {
12714 if (attSlotID != -1)
12715 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12716
12717 if (quantity_max <= 0)
12719 }
12720
12721 if (quantity_max <= 0)
12723
12724 return quantity_max;
12725 }
12726
12728 {
12730 }
12731
12733 {
12735 }
12736
12737
12739 {
12741 }
12742
12744 {
12746 }
12747
12749 {
12751 }
12752
12753
12755 {
12756
12757 float weightEx = GetWeightEx();
12758 float special = GetInventoryAndCargoWeight();
12759 return weightEx - special;
12760 }
12761
12762
12764 {
12766 }
12767
12769 {
12771 {
12772 #ifdef DEVELOPER
12773 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12774 {
12775 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12777 }
12778 #endif
12779
12780 return GetQuantity() * GetConfigWeightModified();
12781 }
12782 else if (HasEnergyManager())
12783 {
12784 #ifdef DEVELOPER
12785 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12786 {
12787 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12788 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12789 }
12790 #endif
12791 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12792 }
12793 else
12794 {
12795 #ifdef DEVELOPER
12796 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12797 {
12798 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12799 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12800 }
12801 #endif
12802 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12803 }
12804 }
12805
12808 {
12809 int item_count = 0;
12811
12812 if (GetInventory().GetCargo() != NULL)
12813 {
12814 item_count = GetInventory().GetCargo().GetItemCount();
12815 }
12816
12817 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12818 {
12819 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12820 if (item)
12821 item_count += item.GetNumberOfItems();
12822 }
12823 return item_count;
12824 }
12825
12828 {
12829 float weight = 0;
12830 float wetness = 1;
12831 if (include_wetness)
12834 {
12835 weight = wetness * m_ConfigWeight;
12836 }
12838 {
12839 weight = 1;
12840 }
12841 return weight;
12842 }
12843
12844
12845
12847 {
12848 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12849 {
12850 GameInventory inv = GetInventory();
12851 array<EntityAI> items = new array<EntityAI>;
12853 for (int i = 0; i < items.Count(); i++)
12854 {
12856 if (item)
12857 {
12859 }
12860 }
12861 }
12862 }
12863
12864
12865
12866
12868 {
12869 float energy = 0;
12870 if (HasEnergyManager())
12871 {
12872 energy = GetCompEM().GetEnergy();
12873 }
12874 return energy;
12875 }
12876
12877
12879 {
12880 super.OnEnergyConsumed();
12881
12883 }
12884
12886 {
12887 super.OnEnergyAdded();
12888
12890 }
12891
12892
12894 {
12895 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12896 {
12898 {
12899 float energy_0to1 = GetCompEM().GetEnergy0To1();
12901 }
12902 }
12903 }
12904
12905
12907 {
12908 return ConfigGetFloat("heatIsolation");
12909 }
12910
12912 {
12914 }
12915
12917 {
12918 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12919 if (
GetGame().ConfigIsExisting(paramPath))
12921
12922 return 0.0;
12923 }
12924
12926 {
12927 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12928 if (
GetGame().ConfigIsExisting(paramPath))
12930
12931 return 0.0;
12932 }
12933
12934 override void SetWet(
float value,
bool allow_client =
false)
12935 {
12936 if (!IsServerCheck(allow_client))
12937 return;
12938
12941
12943
12944 m_VarWet = Math.Clamp(value, min, max);
12945
12947 {
12950 }
12951 }
12952
12953 override void AddWet(
float value)
12954 {
12956 }
12957
12959 {
12961 }
12962
12964 {
12966 }
12967
12969 {
12971 }
12972
12974 {
12976 }
12977
12979 {
12981 }
12982
12983 override void OnWetChanged(
float newVal,
float oldVal)
12984 {
12987 if (newLevel != oldLevel)
12988 {
12990 }
12991 }
12992
12994 {
12995 SetWeightDirty();
12996 }
12997
12999 {
13000 return GetWetLevelInternal(
m_VarWet);
13001 }
13002
13003
13004
13006 {
13008 }
13009
13011 {
13013 }
13014
13016 {
13018 }
13019
13021 {
13023 }
13024
13025
13026
13028 {
13029 if (ConfigIsExisting("itemModelLength"))
13030 {
13031 return ConfigGetFloat("itemModelLength");
13032 }
13033 return 0;
13034 }
13035
13037 {
13038 if (ConfigIsExisting("itemAttachOffset"))
13039 {
13040 return ConfigGetFloat("itemAttachOffset");
13041 }
13042 return 0;
13043 }
13044
13045 override void SetCleanness(
int value,
bool allow_client =
false)
13046 {
13047 if (!IsServerCheck(allow_client))
13048 return;
13049
13051
13053
13056 }
13057
13059 {
13061 }
13062
13064 {
13065 return true;
13066 }
13067
13068
13069
13070
13072 {
13074 }
13075
13077 {
13079 }
13080
13081
13082
13083
13084 override void SetColor(
int r,
int g,
int b,
int a)
13085 {
13091 }
13093 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13094 {
13099 }
13100
13102 {
13104 }
13105
13108 {
13109 int r,g,b,a;
13111 r = r/255;
13112 g = g/255;
13113 b = b/255;
13114 a = a/255;
13115 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13116 }
13117
13118
13119
13120 override void SetLiquidType(
int value,
bool allow_client =
false)
13121 {
13122 if (!IsServerCheck(allow_client))
13123 return;
13124
13129 }
13130
13132 {
13133 return ConfigGetInt("varLiquidTypeInit");
13134 }
13135
13137 {
13139 }
13140
13142 {
13144 SetFrozen(false);
13145 }
13146
13149 {
13150 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13151 }
13152
13153
13156 {
13157 PlayerBase nplayer;
13158 if (PlayerBase.CastTo(nplayer, player))
13159 {
13161
13162 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13163 }
13164 }
13165
13166
13169 {
13170 PlayerBase nplayer;
13171 if (PlayerBase.CastTo(nplayer,player))
13172 {
13173
13174 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13175
13176 }
13177
13178
13179 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13180
13181
13182 if (HasEnergyManager())
13183 {
13184 GetCompEM().UpdatePlugState();
13185 }
13186 }
13187
13188
13190 {
13191 super.OnPlacementStarted(player);
13192
13194 }
13195
13196 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13197 {
13199 {
13200 m_AdminLog.OnPlacementComplete(player,
this);
13201 }
13202
13203 super.OnPlacementComplete(player, position, orientation);
13204 }
13205
13206
13207
13208
13209
13211 {
13213 {
13214 return true;
13215 }
13216 else
13217 {
13218 return false;
13219 }
13220 }
13221
13222
13224 {
13226 {
13228 }
13229 }
13230
13231
13233 {
13235 }
13236
13238 {
13240 }
13241
13242 override void InsertAgent(
int agent,
float count = 1)
13243 {
13244 if (count < 1)
13245 return;
13246
13248 }
13249
13252 {
13254 }
13255
13256
13258 {
13260 }
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13304 {
13306 return false;
13307 return true;
13308 }
13309
13311 {
13312
13314 }
13315
13316
13319 {
13320 super.CheckForRoofLimited(timeTresholdMS);
13321
13323 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13324 {
13325 m_PreviousRoofTestTime = time;
13326 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13327 }
13328 }
13329
13330
13332 {
13334 {
13335 return 0;
13336 }
13337
13338 if (GetInventory().GetAttachmentSlotsCount() != 0)
13339 {
13340 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13341 if (filter)
13342 return filter.GetProtectionLevel(type, false, system);
13343 else
13344 return 0;
13345 }
13346
13347 string subclassPath, entryName;
13348
13349 switch (type)
13350 {
13352 entryName = "biological";
13353 break;
13355 entryName = "chemical";
13356 break;
13357 default:
13358 entryName = "biological";
13359 break;
13360 }
13361
13362 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13363
13365 }
13366
13367
13368
13371 {
13372 if (!IsMagazine())
13374
13376 }
13377
13378
13379
13380
13381
13386 {
13387 return true;
13388 }
13389
13391 {
13393 }
13394
13395
13396
13397
13398
13400 {
13401 if (parent)
13402 {
13403 if (parent.IsInherited(DayZInfected))
13404 return true;
13405
13406 if (!parent.IsRuined())
13407 return true;
13408 }
13409
13410 return true;
13411 }
13412
13414 {
13415 if (!super.CanPutAsAttachment(parent))
13416 {
13417 return false;
13418 }
13419
13420 if (!IsRuined() && !parent.IsRuined())
13421 {
13422 return true;
13423 }
13424
13425 return false;
13426 }
13427
13429 {
13430
13431
13432
13433
13434 return super.CanReceiveItemIntoCargo(item);
13435 }
13436
13438 {
13439
13440
13441
13442
13443 GameInventory attachmentInv = attachment.GetInventory();
13445 {
13446 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13447 return false;
13448 }
13449
13450 InventoryLocation loc = new InventoryLocation();
13451 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13452 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13453 return false;
13454
13455 return super.CanReceiveAttachment(attachment, slotId);
13456 }
13457
13459 {
13460 if (!super.CanReleaseAttachment(attachment))
13461 return false;
13462
13463 return GetInventory().AreChildrenAccessible();
13464 }
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13487 {
13488 int id = muzzle_owner.GetMuzzleID();
13489 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13490
13491 if (WPOF_array)
13492 {
13493 for (int i = 0; i < WPOF_array.Count(); i++)
13494 {
13495 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13496
13497 if (WPOF)
13498 {
13499 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13500 }
13501 }
13502 }
13503 }
13504
13505
13507 {
13508 int id = muzzle_owner.GetMuzzleID();
13510
13511 if (WPOBE_array)
13512 {
13513 for (int i = 0; i < WPOBE_array.Count(); i++)
13514 {
13515 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13516
13517 if (WPOBE)
13518 {
13519 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13520 }
13521 }
13522 }
13523 }
13524
13525
13527 {
13528 int id = muzzle_owner.GetMuzzleID();
13529 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13530
13531 if (WPOOH_array)
13532 {
13533 for (int i = 0; i < WPOOH_array.Count(); i++)
13534 {
13535 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13536
13537 if (WPOOH)
13538 {
13539 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13540 }
13541 }
13542 }
13543 }
13544
13545
13547 {
13548 int id = muzzle_owner.GetMuzzleID();
13549 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13550
13551 if (WPOOH_array)
13552 {
13553 for (int i = 0; i < WPOOH_array.Count(); i++)
13554 {
13555 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13556
13557 if (WPOOH)
13558 {
13559 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13560 }
13561 }
13562 }
13563 }
13564
13565
13567 {
13568 int id = muzzle_owner.GetMuzzleID();
13569 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13570
13571 if (WPOOH_array)
13572 {
13573 for (int i = 0; i < WPOOH_array.Count(); i++)
13574 {
13575 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13576
13577 if (WPOOH)
13578 {
13579 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13580 }
13581 }
13582 }
13583 }
13584
13585
13586
13588 {
13590 {
13591 return true;
13592 }
13593
13594 return false;
13595 }
13596
13598 {
13600 {
13601 return true;
13602 }
13603
13604 return false;
13605 }
13606
13608 {
13610 {
13611 return true;
13612 }
13613
13614 return false;
13615 }
13616
13618 {
13619 return false;
13620 }
13621
13624 {
13625 return UATimeSpent.DEFAULT_DEPLOY;
13626 }
13627
13628
13629
13630
13632 {
13634 SetSynchDirty();
13635 }
13636
13638 {
13640 }
13641
13642
13644 {
13645 return false;
13646 }
13647
13650 {
13651 string att_type = "None";
13652
13653 if (ConfigIsExisting("soundAttType"))
13654 {
13655 att_type = ConfigGetString("soundAttType");
13656 }
13657
13659 }
13660
13662 {
13664 }
13665
13666
13667
13668
13669
13675
13677 {
13680
13682 }
13683
13684
13686 {
13688 return;
13689
13691
13694
13697
13698 SoundParameters params = new SoundParameters();
13702 }
13703
13704
13706 {
13708 return;
13709
13711 SetSynchDirty();
13712
13715 }
13716
13717
13719 {
13721 return;
13722
13724 SetSynchDirty();
13725
13728 }
13729
13731 {
13733 }
13734
13736 {
13738 }
13739
13742 {
13743 if (!
GetGame().IsDedicatedServer())
13744 {
13745 if (ConfigIsExisting("attachSoundSet"))
13746 {
13747 string cfg_path = "";
13748 string soundset = "";
13749 string type_name =
GetType();
13750
13753 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13754 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13755
13756 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13757 {
13758 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13759 {
13760 if (cfg_slot_array[i] == slot_type)
13761 {
13762 soundset = cfg_soundset_array[i];
13763 break;
13764 }
13765 }
13766 }
13767
13768 if (soundset != "")
13769 {
13770 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13772 }
13773 }
13774 }
13775 }
13776
13778 {
13779
13780 }
13781
13782 void OnApply(PlayerBase player);
13783
13785 {
13786 return 1.0;
13787 };
13788
13790 {
13792 }
13793
13795 {
13797 }
13798
13800
13802 {
13803 SetDynamicPhysicsLifeTime(0.01);
13805 }
13806
13808 {
13809 array<string> zone_names = new array<string>;
13810 GetDamageZones(zone_names);
13811 for (int i = 0; i < zone_names.Count(); i++)
13812 {
13813 SetHealthMax(zone_names.Get(i),"Health");
13814 }
13815 SetHealthMax("","Health");
13816 }
13817
13820 {
13821 float global_health = GetHealth01("","Health");
13822 array<string> zones = new array<string>;
13823 GetDamageZones(zones);
13824
13825 for (int i = 0; i < zones.Count(); i++)
13826 {
13827 SetHealth01(zones.Get(i),"Health",global_health);
13828 }
13829 }
13830
13833 {
13834 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13835 }
13836
13838 {
13839 if (!hasRootAsPlayer)
13840 {
13841 if (refParentIB)
13842 {
13843
13844 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13845 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13846
13847 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13848 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13849
13852 }
13853 else
13854 {
13855
13858 }
13859 }
13860 }
13861
13863 {
13865 {
13866 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13867 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13868 {
13869 float heatPermCoef = 1.0;
13871 while (ent)
13872 {
13873 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13874 ent = ent.GetHierarchyParent();
13875 }
13876
13877 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13878 }
13879 }
13880 }
13881
13883 {
13884
13885 EntityAI parent = GetHierarchyParent();
13886 if (!parent)
13887 {
13888 hasParent = false;
13889 hasRootAsPlayer = false;
13890 }
13891 else
13892 {
13893 hasParent = true;
13894 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13895 refParentIB =
ItemBase.Cast(parent);
13896 }
13897 }
13898
13899 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13900 {
13901
13902 }
13903
13905 {
13906
13907 return false;
13908 }
13909
13911 {
13912
13913
13914 return false;
13915 }
13916
13918 {
13919
13920 return false;
13921 }
13922
13925 {
13926 return !GetIsFrozen() &&
IsOpen();
13927 }
13928
13930 {
13931 bool hasParent = false, hasRootAsPlayer = false;
13933
13934 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13935 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13936
13937 if (wwtu || foodDecay)
13938 {
13942
13943 if (processWetness || processTemperature || processDecay)
13944 {
13946
13947 if (processWetness)
13948 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13949
13950 if (processTemperature)
13952
13953 if (processDecay)
13954 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13955 }
13956 }
13957 }
13958
13961 {
13963 }
13964
13966 {
13969
13970 return super.GetTemperatureFreezeThreshold();
13971 }
13972
13974 {
13977
13978 return super.GetTemperatureThawThreshold();
13979 }
13980
13982 {
13985
13986 return super.GetItemOverheatThreshold();
13987 }
13988
13990 {
13992 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13993
13994 return super.GetTemperatureFreezeTime();
13995 }
13996
13998 {
14000 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
14001
14002 return super.GetTemperatureThawTime();
14003 }
14004
14009
14011 {
14012 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
14013 }
14014
14016 {
14017 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
14018 }
14019
14022 {
14024 }
14025
14027 {
14029 }
14030
14032 {
14034 }
14035
14038 {
14039 return null;
14040 }
14041
14044 {
14045 return false;
14046 }
14047
14049 {
14051 {
14054 if (!trg)
14055 {
14057 explosive = this;
14058 }
14059
14060 explosive.PairRemote(trg);
14062
14063 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14064 trg.SetPersistentPairID(persistentID);
14065 explosive.SetPersistentPairID(persistentID);
14066
14067 return true;
14068 }
14069 return false;
14070 }
14071
14074 {
14075 float ret = 1.0;
14078 ret *= GetHealth01();
14079
14080 return ret;
14081 }
14082
14083 #ifdef DEVELOPER
14084 override void SetDebugItem()
14085 {
14086 super.SetDebugItem();
14087 _itemBase = this;
14088 }
14089
14091 {
14092 string text = super.GetDebugText();
14093
14095 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14096
14097 return text;
14098 }
14099 #endif
14100
14102 {
14103 return true;
14104 }
14105
14107
14109
14111 {
14114 }
14115
14116
14124
14140}
14141
14143{
14145 if (entity)
14146 {
14147 bool is_item = entity.IsInherited(
ItemBase);
14148 if (is_item && full_quantity)
14149 {
14152 }
14153 }
14154 else
14155 {
14157 return NULL;
14158 }
14159 return entity;
14160}
14161
14163{
14164 if (item)
14165 {
14166 if (health > 0)
14167 item.SetHealth("", "", health);
14168
14169 if (item.CanHaveTemperature())
14170 {
14172 if (item.CanFreeze())
14173 item.SetFrozen(false);
14174 }
14175
14176 if (item.HasEnergyManager())
14177 {
14178 if (quantity >= 0)
14179 {
14180 item.GetCompEM().SetEnergy0To1(quantity);
14181 }
14182 else
14183 {
14185 }
14186 }
14187 else if (item.IsMagazine())
14188 {
14189 Magazine mag = Magazine.Cast(item);
14190 if (quantity >= 0)
14191 {
14192 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14193 }
14194 else
14195 {
14197 }
14198
14199 }
14200 else
14201 {
14202 if (quantity >= 0)
14203 {
14204 item.SetQuantityNormalized(quantity, false);
14205 }
14206 else
14207 {
14209 }
14210
14211 }
14212 }
14213}
14214
14215#ifdef DEVELOPER
14217#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.