9317{
9319 {
9320 return true;
9321 }
9322};
9323
9324
9325
9327{
9331
9333
9336
9337
9338
9339
9340
9349
9355
9360
9365
9386 protected bool m_IsResultOfSplit
9387
9389
9394
9395
9396
9398
9402
9403
9404
9406
9409
9410
9411
9417
9418
9426
9429
9430
9432
9433
9435
9436
9441
9442
9447
9448
9450
9451
9453 {
9458
9459 if (!
GetGame().IsDedicatedServer())
9460 {
9462 {
9464
9466 {
9468 }
9469 }
9470
9473 }
9474
9475 m_OldLocation = null;
9476
9478 {
9480 }
9481
9482 if (ConfigIsExisting("headSelectionsToHide"))
9483 {
9486 }
9487
9489 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9490 {
9492 }
9493
9495
9496 m_IsResultOfSplit = false;
9497
9499 }
9500
9502 {
9503 super.InitItemVariables();
9504
9510 m_Count = ConfigGetInt(
"count");
9511
9514
9519
9522
9527
9539
9543
9544
9547 if (ConfigIsExisting("canBeSplit"))
9548 {
9551 }
9552
9554 if (ConfigIsExisting("itemBehaviour"))
9556
9557
9560 RegisterNetSyncVariableInt("m_VarLiquidType");
9561 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9562
9563 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9564 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9565 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9566
9567 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9568 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9569 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9570 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9571
9572 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9573 RegisterNetSyncVariableBool("m_IsTakeable");
9574 RegisterNetSyncVariableBool("m_IsHologram");
9575
9578 {
9581 }
9582
9584
9586 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9588
9589 }
9590
9592 {
9594 }
9595
9597 {
9600 {
9605 }
9606 }
9607
9608 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9609 {
9611 {
9614 }
9615
9617 }
9618
9620 {
9626 }
9627
9629
9631 {
9633
9634 if (!action)
9635 {
9636 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9637 return;
9638 }
9639
9641 if (!ai)
9642 {
9644 return;
9645 }
9646
9648 if (!action_array)
9649 {
9650 action_array = new array<ActionBase_Basic>;
9652 }
9653 if (LogManager.IsActionLogEnable())
9654 {
9655 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9656 }
9657
9658 if (action_array.Find(action) != -1)
9659 {
9660 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9661 }
9662 else
9663 {
9664 action_array.Insert(action);
9665 }
9666 }
9667
9669 {
9671 ActionBase action = player.GetActionManager().GetAction(actionName);
9674
9675 if (action_array)
9676 {
9677 action_array.RemoveItem(action);
9678 }
9679 }
9680
9681
9682
9684 {
9685 ActionOverrideData overrideData = new ActionOverrideData();
9689
9691 if (!actionMap)
9692 {
9695 }
9696
9697 actionMap.Insert(this.
Type(), overrideData);
9698
9699 }
9700
9702
9704
9705
9707 {
9710
9713
9714 string config_to_search = "CfgVehicles";
9715 string muzzle_owner_config;
9716
9718 {
9719 if (IsInherited(Weapon))
9720 config_to_search = "CfgWeapons";
9721
9722 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9723
9724 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9725
9727
9728 if (config_OnFire_subclass_count > 0)
9729 {
9730 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9731
9732 for (int i = 0; i < config_OnFire_subclass_count; i++)
9733 {
9734 string particle_class = "";
9736 string config_OnFire_entry = config_OnFire_class + particle_class;
9737 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9738 WPOF_array.Insert(WPOF);
9739 }
9740
9741
9743 }
9744 }
9745
9747 {
9748 config_to_search = "CfgWeapons";
9749 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9750
9751 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9752
9754
9755 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9756 {
9757 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9758
9759 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9760 {
9761 string particle_class2 = "";
9763 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9764 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9765 WPOBE_array.Insert(WPOBE);
9766 }
9767
9768
9770 }
9771 }
9772 }
9773
9774
9776 {
9779
9781 {
9782 string config_to_search = "CfgVehicles";
9783
9784 if (IsInherited(Weapon))
9785 config_to_search = "CfgWeapons";
9786
9787 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9788 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9789
9790 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9791 {
9792
9794
9796 {
9798 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9800 return;
9801 }
9802
9805
9806
9807
9809 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9810
9811 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9812 {
9813 string particle_class = "";
9815 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9817
9818 if (entry_type == CT_CLASS)
9819 {
9820 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9821 WPOOH_array.Insert(WPOF);
9822 }
9823 }
9824
9825
9827 }
9828 }
9829 }
9830
9832 {
9834 }
9835
9837 {
9839 {
9841
9844
9847
9848 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9849 }
9850 }
9851
9853 {
9855 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9856
9858 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9859
9861 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9862
9864 {
9866 }
9867 }
9868
9870 {
9872 }
9873
9875 {
9878 else
9880
9882 {
9885 }
9886 else
9887 {
9890
9893 }
9894
9896 }
9897
9899 {
9901 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9902 }
9903
9905 {
9907 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9909 }
9910
9912 {
9914 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9915 }
9916
9918 {
9921
9922 OverheatingParticle OP = new OverheatingParticle();
9927
9929 }
9930
9932 {
9935
9936 return -1;
9937 }
9938
9940 {
9942 {
9945
9946 for (int i = count; i > 0; --i)
9947 {
9948 int id = i - 1;
9951
9954
9955 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9956 {
9957 if (p)
9958 {
9961 }
9962 }
9963 }
9964 }
9965 }
9966
9968 {
9970 {
9972 {
9973 int id = i - 1;
9975
9976 if (OP)
9977 {
9979
9980 if (p)
9981 {
9983 }
9984
9985 delete OP;
9986 }
9987 }
9988
9991 }
9992 }
9993
9996 {
9997 return 0.0;
9998 }
9999
10000
10002 {
10003 return 250;
10004 }
10005
10007 {
10008 return 0;
10009 }
10010
10013 {
10015 return true;
10016
10017 return false;
10018 }
10019
10022 {
10025
10027 {
10029 }
10030 else
10031 {
10032
10034 }
10035
10037 }
10038
10045 {
10046 return -1;
10047 }
10048
10049
10050
10051
10053 {
10055 {
10057 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10058
10059 if (r_index >= 0)
10060 {
10061 InventoryLocation r_il = new InventoryLocation;
10062 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10063
10064 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10067 {
10068 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10069 }
10071 {
10072 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10073 }
10074
10075 }
10076
10077 player.GetHumanInventory().ClearUserReservedLocation(this);
10078 }
10079
10082 }
10083
10084
10085
10086
10088 {
10089 return ItemBase.m_DebugActionsMask;
10090 }
10091
10093 {
10094 return ItemBase.m_DebugActionsMask & mask;
10095 }
10096
10098 {
10099 ItemBase.m_DebugActionsMask = mask;
10100 }
10101
10103 {
10104 ItemBase.m_DebugActionsMask |= mask;
10105 }
10106
10108 {
10109 ItemBase.m_DebugActionsMask &= ~mask;
10110 }
10111
10113 {
10115 {
10117 }
10118 else
10119 {
10121 }
10122 }
10123
10124
10126 {
10127 if (GetEconomyProfile())
10128 {
10129 float q_max = GetEconomyProfile().GetQuantityMax();
10130 if (q_max > 0)
10131 {
10132 float q_min = GetEconomyProfile().GetQuantityMin();
10133 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10134
10136 {
10137 ComponentEnergyManager comp = GetCompEM();
10139 {
10141 }
10142 }
10144 {
10146
10147 }
10148
10149 }
10150 }
10151 }
10152
10155 {
10156 EntityAI parent = GetHierarchyParent();
10157
10158 if (parent)
10159 {
10160 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10161 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10162 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10163 }
10164 }
10165
10168 {
10169 EntityAI parent = GetHierarchyParent();
10170
10171 if (parent)
10172 {
10173 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10174 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10175 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10176 }
10177 }
10178
10180 {
10181
10182
10183
10184
10186
10188 {
10189 if (ScriptInputUserData.CanStoreInputUserData())
10190 {
10191 ScriptInputUserData ctx = new ScriptInputUserData;
10197 ctx.
Write(use_stack_max);
10200
10202 {
10203 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10204 }
10205 }
10206 }
10207 else if (!
GetGame().IsMultiplayer())
10208 {
10210 }
10211 }
10212
10214 {
10216 }
10217
10219 {
10221 }
10222
10224 {
10226 }
10227
10229 {
10230
10231 return false;
10232 }
10233
10235 {
10236 return false;
10237 }
10238
10242 {
10243 return false;
10244 }
10245
10247 {
10248 return "";
10249 }
10250
10252
10254 {
10255 return false;
10256 }
10257
10259 {
10260 return true;
10261 }
10262
10263
10264
10266 {
10267 return true;
10268 }
10269
10271 {
10272 return true;
10273 }
10274
10276 {
10277 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10279 }
10280
10282 {
10284 }
10285
10287 {
10289 if (!is_being_placed)
10291 SetSynchDirty();
10292 }
10293
10294
10296
10298 {
10300 }
10301
10303 {
10305 }
10306
10308 {
10309 return 1;
10310 }
10311
10313 {
10314 return false;
10315 }
10316
10318 {
10320 SetSynchDirty();
10321 }
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10358 {
10359 super.OnMovedInsideCargo(container);
10360
10361 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10362 }
10363
10364 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10365 {
10366 super.EEItemLocationChanged(oldLoc,newLoc);
10367
10368 PlayerBase new_player = null;
10369 PlayerBase old_player = null;
10370
10371 if (newLoc.GetParent())
10372 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10373
10374 if (oldLoc.GetParent())
10375 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10376
10378 {
10379 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10380
10381 if (r_index >= 0)
10382 {
10383 InventoryLocation r_il = new InventoryLocation;
10384 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10385
10386 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10389 {
10390 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10391 }
10393 {
10394 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10395 }
10396
10397 }
10398 }
10399
10401 {
10402 if (new_player)
10403 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10404
10405 if (new_player == old_player)
10406 {
10407
10408 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10409 {
10411 {
10412 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10413 {
10414 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10415 }
10416 }
10417 else
10418 {
10419 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10420 }
10421 }
10422
10423 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10424 {
10425 int type = oldLoc.GetType();
10427 {
10428 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10429 }
10431 {
10432 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10433 }
10434 }
10435 if (!m_OldLocation)
10436 {
10437 m_OldLocation = new InventoryLocation;
10438 }
10439 m_OldLocation.Copy(oldLoc);
10440 }
10441 else
10442 {
10443 if (m_OldLocation)
10444 {
10445 m_OldLocation.Reset();
10446 }
10447 }
10448
10450 }
10451 else
10452 {
10453 if (new_player)
10454 {
10455 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10456 if (res_index >= 0)
10457 {
10458 InventoryLocation il = new InventoryLocation;
10459 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10461 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10464 {
10465 il.
GetParent().GetOnReleaseLock().Invoke(it);
10466 }
10468 {
10470 }
10471
10472 }
10473 }
10475 {
10476
10478 }
10479
10480 if (m_OldLocation)
10481 {
10482 m_OldLocation.Reset();
10483 }
10484 }
10485 }
10486
10487 override void EOnContact(IEntity other, Contact extra)
10488 {
10490 {
10491 int liquidType = -1;
10493 if (impactSpeed > 0.0)
10494 {
10496 #ifndef SERVER
10498 #else
10500 SetSynchDirty();
10501 #endif
10503 }
10504 }
10505
10506 #ifdef SERVER
10507 if (GetCompEM() && GetCompEM().IsPlugged())
10508 {
10509 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10510 GetCompEM().UnplugThis();
10511 }
10512 #endif
10513 }
10514
10516
10518 {
10520 }
10521
10523 {
10524
10525 }
10526
10528 {
10529 super.OnItemLocationChanged(old_owner, new_owner);
10530
10531 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10532 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10533
10534 if (!relatedPlayer && playerNew)
10535 relatedPlayer = playerNew;
10536
10537 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10538 {
10540 if (actionMgr)
10541 {
10542 ActionBase currentAction = actionMgr.GetRunningAction();
10543 if (currentAction)
10545 }
10546 }
10547
10548 Man ownerPlayerOld = null;
10549 Man ownerPlayerNew = null;
10550
10551 if (old_owner)
10552 {
10553 if (old_owner.
IsMan())
10554 {
10555 ownerPlayerOld = Man.Cast(old_owner);
10556 }
10557 else
10558 {
10559 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10560 }
10561 }
10562 else
10563 {
10565 {
10567
10568 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10569 {
10570 GetCompEM().UnplugThis();
10571 }
10572 }
10573 }
10574
10575 if (new_owner)
10576 {
10577 if (new_owner.
IsMan())
10578 {
10579 ownerPlayerNew = Man.Cast(new_owner);
10580 }
10581 else
10582 {
10583 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10584 }
10585 }
10586
10587 if (ownerPlayerOld != ownerPlayerNew)
10588 {
10589 if (ownerPlayerOld)
10590 {
10591 array<EntityAI> subItemsExit = new array<EntityAI>;
10593 for (int i = 0; i < subItemsExit.Count(); i++)
10594 {
10597 }
10598 }
10599
10600 if (ownerPlayerNew)
10601 {
10602 array<EntityAI> subItemsEnter = new array<EntityAI>;
10604 for (int j = 0; j < subItemsEnter.Count(); j++)
10605 {
10608 }
10609 }
10610 }
10611 else if (ownerPlayerNew != null)
10612 {
10613 PlayerBase nplayer;
10614 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10615 {
10616 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10618 for (int k = 0; k < subItemsUpdate.Count(); k++)
10619 {
10621 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10622 }
10623 }
10624 }
10625
10626 if (old_owner)
10627 old_owner.OnChildItemRemoved(this);
10628 if (new_owner)
10629 new_owner.OnChildItemReceived(this);
10630 }
10631
10632
10634 {
10635 super.EEDelete(parent);
10636 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10637 if (player)
10638 {
10640
10641 if (player.IsAlive())
10642 {
10643 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10644 if (r_index >= 0)
10645 {
10646 InventoryLocation r_il = new InventoryLocation;
10647 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10648
10649 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10652 {
10653 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10654 }
10656 {
10657 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10658 }
10659
10660 }
10661
10662 player.RemoveQuickBarEntityShortcut(this);
10663 }
10664 }
10665 }
10666
10668 {
10669 super.EEKilled(killer);
10670
10673 {
10674 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10675 {
10676 if (IsMagazine())
10677 {
10678 if (Magazine.Cast(this).GetAmmoCount() > 0)
10679 {
10681 }
10682 }
10683 else
10684 {
10686 }
10687 }
10688 }
10689 }
10690
10692 {
10693 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10694
10695 super.OnWasAttached(parent, slot_id);
10696
10699
10701 }
10702
10704 {
10705 super.OnWasDetached(parent, slot_id);
10706
10709 }
10710
10712 {
10713 int idx;
10716
10717 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10718 if (inventory_slots.Count() < 1)
10719 {
10720 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10721 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10722 }
10723 else
10724 {
10725 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10726 }
10727
10728 idx = inventory_slots.Find(slot);
10729 if (idx < 0)
10730 return "";
10731
10732 return attach_types.Get(idx);
10733 }
10734
10736 {
10737 int idx = -1;
10738 string slot;
10739
10742
10743 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10744 if (inventory_slots.Count() < 1)
10745 {
10746 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10747 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10748 }
10749 else
10750 {
10751 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10752 if (detach_types.Count() < 1)
10753 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10754 }
10755
10756 for (int i = 0; i < inventory_slots.Count(); i++)
10757 {
10758 slot = inventory_slots.Get(i);
10759 }
10760
10761 if (slot != "")
10762 {
10763 if (detach_types.Count() == 1)
10764 idx = 0;
10765 else
10766 idx = inventory_slots.Find(slot);
10767 }
10768 if (idx < 0)
10769 return "";
10770
10771 return detach_types.Get(idx);
10772 }
10773
10775 {
10776
10778
10779
10780 float min_time = 1;
10781 float max_time = 3;
10782 float delay = Math.RandomFloat(min_time, max_time);
10783
10784 explode_timer.Run(delay, this, "DoAmmoExplosion");
10785 }
10786
10788 {
10789 Magazine magazine = Magazine.Cast(this);
10790 int pop_sounds_count = 6;
10791 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10792
10793
10794 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10795 string sound_name = pop_sounds[ sound_idx ];
10797
10798
10799 magazine.ServerAddAmmoCount(-1);
10800
10801
10802 float min_temp_to_explode = 100;
10803
10804 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10805 {
10807 }
10808 }
10809
10810
10811 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10812 {
10813 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10814
10815 const int CHANCE_DAMAGE_CARGO = 4;
10816 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10817 const int CHANCE_DAMAGE_NOTHING = 2;
10818
10820 {
10821 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10822 int chances;
10823 int rnd;
10824
10825 if (GetInventory().GetCargo())
10826 {
10827 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10828 rnd = Math.RandomInt(0,chances);
10829
10830 if (rnd < CHANCE_DAMAGE_CARGO)
10831 {
10833 }
10834 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10835 {
10837 }
10838 }
10839 else
10840 {
10841 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10842 rnd = Math.RandomInt(0,chances);
10843
10844 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10845 {
10847 }
10848 }
10849 }
10850 }
10851
10853 {
10854 if (GetInventory().GetCargo())
10855 {
10856 int item_count = GetInventory().GetCargo().GetItemCount();
10857 if (item_count > 0)
10858 {
10859 int random_pick = Math.RandomInt(0, item_count);
10861 if (!item.IsExplosive())
10862 {
10863 item.AddHealth("","",damage);
10864 return true;
10865 }
10866 }
10867 }
10868 return false;
10869 }
10870
10872 {
10873 int attachment_count = GetInventory().AttachmentCount();
10874 if (attachment_count > 0)
10875 {
10876 int random_pick = Math.RandomInt(0, attachment_count);
10877 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10878 if (!attachment.IsExplosive())
10879 {
10880 attachment.AddHealth("","",damage);
10881 return true;
10882 }
10883 }
10884 return false;
10885 }
10886
10888 {
10890 }
10891
10893 {
10895 return GetInventory().CanRemoveEntity();
10896
10897 return false;
10898 }
10899
10901 {
10903 return;
10904
10906 {
10907 if (ScriptInputUserData.CanStoreInputUserData())
10908 {
10909 ScriptInputUserData ctx = new ScriptInputUserData;
10914 ctx.
Write(destination_entity);
10916 ctx.
Write(slot_id);
10918 }
10919 }
10920 else if (!
GetGame().IsMultiplayer())
10921 {
10923 }
10924 }
10925
10927 {
10929 return;
10930
10931 float split_quantity_new;
10935 InventoryLocation loc = new InventoryLocation;
10936
10937 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10938 {
10940 split_quantity_new = stack_max;
10941 else
10943
10944 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10945 if (new_item)
10946 {
10947 new_item.SetResultOfSplit(true);
10948 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10950 new_item.SetQuantity(split_quantity_new);
10951 }
10952 }
10953 else if (destination_entity && slot_id == -1)
10954 {
10955 if (quantity > stack_max)
10956 split_quantity_new = stack_max;
10957 else
10958 split_quantity_new = quantity;
10959
10961 {
10964 }
10965
10966 if (new_item)
10967 {
10968 new_item.SetResultOfSplit(true);
10969 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10971 new_item.SetQuantity(split_quantity_new);
10972 }
10973 }
10974 else
10975 {
10976 if (stack_max != 0)
10977 {
10979 {
10981 }
10982
10983 if (split_quantity_new == 0)
10984 {
10985 if (!
GetGame().IsMultiplayer())
10986 player.PhysicalPredictiveDropItem(this);
10987 else
10988 player.ServerDropEntity(this);
10989 return;
10990 }
10991
10993
10994 if (new_item)
10995 {
10996 new_item.SetResultOfSplit(true);
10997 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10999 new_item.SetQuantity(stack_max);
11000 new_item.PlaceOnSurface();
11001 }
11002 }
11003 }
11004 }
11005
11007 {
11009 return;
11010
11011 float split_quantity_new;
11015 InventoryLocation loc = new InventoryLocation;
11016
11017 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11018 {
11020 split_quantity_new = stack_max;
11021 else
11023
11024 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11025 if (new_item)
11026 {
11027 new_item.SetResultOfSplit(true);
11028 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11030 new_item.SetQuantity(split_quantity_new);
11031 }
11032 }
11033 else if (destination_entity && slot_id == -1)
11034 {
11035 if (quantity > stack_max)
11036 split_quantity_new = stack_max;
11037 else
11038 split_quantity_new = quantity;
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);
11052 }
11053 }
11054 else
11055 {
11056 if (stack_max != 0)
11057 {
11059 {
11061 }
11062
11064
11065 if (new_item)
11066 {
11067 new_item.SetResultOfSplit(true);
11068 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11070 new_item.SetQuantity(stack_max);
11071 new_item.PlaceOnSurface();
11072 }
11073 }
11074 }
11075 }
11076
11078 {
11080 return;
11081
11083 {
11084 if (ScriptInputUserData.CanStoreInputUserData())
11085 {
11086 ScriptInputUserData ctx = new ScriptInputUserData;
11091 dst.WriteToContext(ctx);
11093 }
11094 }
11095 else if (!
GetGame().IsMultiplayer())
11096 {
11098 }
11099 }
11100
11102 {
11104 return;
11105
11107 {
11108 if (ScriptInputUserData.CanStoreInputUserData())
11109 {
11110 ScriptInputUserData ctx = new ScriptInputUserData;
11115 ctx.
Write(destination_entity);
11121 }
11122 }
11123 else if (!
GetGame().IsMultiplayer())
11124 {
11126 }
11127 }
11128
11130 {
11132 }
11133
11135 {
11137 return this;
11138
11140 float split_quantity_new;
11142 if (dst.IsValid())
11143 {
11144 int slot_id = dst.GetSlot();
11146
11147 if (quantity > stack_max)
11148 split_quantity_new = stack_max;
11149 else
11150 split_quantity_new = quantity;
11151
11153
11154 if (new_item)
11155 {
11156 new_item.SetResultOfSplit(true);
11157 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11160 }
11161
11162 return new_item;
11163 }
11164
11165 return null;
11166 }
11167
11169 {
11171 return;
11172
11174 float split_quantity_new;
11176 if (destination_entity)
11177 {
11179 if (quantity > stackable)
11180 split_quantity_new = stackable;
11181 else
11182 split_quantity_new = quantity;
11183
11184 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11185 if (new_item)
11186 {
11187 new_item.SetResultOfSplit(true);
11188 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11190 new_item.SetQuantity(split_quantity_new);
11191 }
11192 }
11193 }
11194
11196 {
11198 return;
11199
11201 {
11202 if (ScriptInputUserData.CanStoreInputUserData())
11203 {
11204 ScriptInputUserData ctx = new ScriptInputUserData;
11209 ItemBase destination_entity =
this;
11210 ctx.
Write(destination_entity);
11214 }
11215 }
11216 else if (!
GetGame().IsMultiplayer())
11217 {
11219 }
11220 }
11221
11223 {
11225 return;
11226
11228 float split_quantity_new;
11230 if (player)
11231 {
11233 if (quantity > stackable)
11234 split_quantity_new = stackable;
11235 else
11236 split_quantity_new = quantity;
11237
11238 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11239 new_item =
ItemBase.Cast(in_hands);
11240 if (new_item)
11241 {
11242 new_item.SetResultOfSplit(true);
11243 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11245 new_item.SetQuantity(split_quantity_new);
11246 }
11247 }
11248 }
11249
11251 {
11253 return;
11254
11256 float split_quantity_new = Math.Floor(quantity * 0.5);
11257
11259
11260 if (new_item)
11261 {
11262 if (new_item.GetQuantityMax() < split_quantity_new)
11263 {
11264 split_quantity_new = new_item.GetQuantityMax();
11265 }
11266
11267 new_item.SetResultOfSplit(true);
11268 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11269
11271 {
11274 }
11275 else
11276 {
11279 }
11280 }
11281 }
11282
11284 {
11286 return;
11287
11289 float split_quantity_new = Math.Floor(quantity / 2);
11290
11291 InventoryLocation invloc = new InventoryLocation;
11293
11295 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11296
11297 if (new_item)
11298 {
11299 if (new_item.GetQuantityMax() < split_quantity_new)
11300 {
11301 split_quantity_new = new_item.GetQuantityMax();
11302 }
11304 {
11307 }
11308 else
11309 {
11312 }
11313 }
11314 }
11315
11318 {
11319 SetWeightDirty();
11321
11322 if (parent)
11323 parent.OnAttachmentQuantityChangedEx(this, delta);
11324
11326 {
11328 {
11330 }
11332 {
11333 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11335 }
11336 }
11337
11338 }
11339
11342 {
11343
11344 }
11345
11348 {
11350 }
11351
11353 {
11354 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11355
11357 {
11358 if (newLevel == GameConstants.STATE_RUINED)
11359 {
11361 EntityAI parent = GetHierarchyParent();
11362 if (parent && parent.IsFireplace())
11363 {
11364 CargoBase cargo = GetInventory().GetCargo();
11365 if (cargo)
11366 {
11368 {
11370 }
11371 }
11372 }
11373 }
11374
11376 {
11377
11379 return;
11380 }
11381
11382 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11383 {
11385 }
11386 }
11387 }
11388
11389
11391 {
11392 super.OnRightClick();
11393
11395 {
11397 {
11398 if (ScriptInputUserData.CanStoreInputUserData())
11399 {
11400 vector m4[4];
11402
11403 EntityAI root = GetHierarchyRoot();
11404
11405 InventoryLocation dst = new InventoryLocation;
11407 {
11408 if (root)
11409 {
11410 root.GetTransform(m4);
11412 }
11413 else
11414 GetInventory().GetCurrentInventoryLocation(dst);
11415 }
11416 else
11417 {
11419
11420
11421 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11422 {
11423 if (root)
11424 {
11425 root.GetTransform(m4);
11427 }
11428 else
11429 GetInventory().GetCurrentInventoryLocation(dst);
11430 }
11431 else
11432 {
11433 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11434 }
11435 }
11436
11437 ScriptInputUserData ctx = new ScriptInputUserData;
11445 }
11446 }
11447 else if (!
GetGame().IsMultiplayer())
11448 {
11450 }
11451 }
11452 }
11453
11454 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11455 {
11456
11457 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11458 return false;
11459
11460 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11461 return false;
11462
11463
11465 return false;
11466
11467
11468 Magazine mag = Magazine.Cast(this);
11469 if (mag)
11470 {
11471 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11472 return false;
11473
11474 if (stack_max_limit)
11475 {
11476 Magazine other_mag = Magazine.Cast(other_item);
11477 if (other_item)
11478 {
11479 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11480 return false;
11481 }
11482
11483 }
11484 }
11485 else
11486 {
11487
11489 return false;
11490
11492 return false;
11493 }
11494
11495 PlayerBase player = null;
11496 if (CastTo(player, GetHierarchyRootPlayer()))
11497 {
11498 if (player.GetInventory().HasAttachment(this))
11499 return false;
11500
11501 if (player.IsItemsToDelete())
11502 return false;
11503 }
11504
11505 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11506 return false;
11507
11508 int slotID;
11510 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11511 return false;
11512
11513 return true;
11514 }
11515
11517 {
11519 }
11520
11522 {
11523 return m_IsResultOfSplit;
11524 }
11525
11527 {
11528 m_IsResultOfSplit = value;
11529 }
11530
11532 {
11534 }
11535
11537 {
11538 float other_item_quantity = other_item.GetQuantity();
11539 float this_free_space;
11540
11542
11544
11545 if (other_item_quantity > this_free_space)
11546 {
11547 return this_free_space;
11548 }
11549 else
11550 {
11551 return other_item_quantity;
11552 }
11553 }
11554
11556 {
11558 }
11559
11561 {
11563 return;
11564
11565 if (!IsMagazine() && other_item)
11566 {
11568 if (quantity_used != 0)
11569 {
11570 float hp1 = GetHealth01("","");
11571 float hp2 = other_item.GetHealth01("","");
11572 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11573 hpResult = hpResult / (
GetQuantity() + quantity_used);
11574
11575 hpResult *= GetMaxHealth();
11576 Math.Round(hpResult);
11577 SetHealth("", "Health", hpResult);
11578
11580 other_item.AddQuantity(-quantity_used);
11581 }
11582 }
11584 }
11585
11587 {
11588 #ifdef SERVER
11589 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11590 GetHierarchyParent().IncreaseLifetimeUp();
11591 #endif
11592 };
11593
11595 {
11596 PlayerBase p = PlayerBase.Cast(player);
11597
11598 array<int> recipesIds = p.m_Recipes;
11599 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11600 if (moduleRecipesManager)
11601 {
11602 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11603 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11604 }
11605
11606 for (int i = 0;i < recipesIds.Count(); i++)
11607 {
11608 int key = recipesIds.Get(i);
11609 string recipeName = moduleRecipesManager.GetRecipeName(key);
11611 }
11612 }
11613
11614
11615 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11616 {
11617 super.GetDebugActions(outputList);
11618
11619
11624
11625
11629
11633
11634
11637
11638
11640 {
11643 }
11644
11646
11649
11653 }
11654
11655
11656
11657
11659 {
11660 super.OnAction(action_id, player, ctx);
11661 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11662 {
11663 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11664 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11665 PlayerBase p = PlayerBase.Cast(player);
11666 if (
EActions.RECIPES_RANGE_START < 1000)
11667 {
11668 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11669 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11670 }
11671 }
11672 #ifndef SERVER
11673 else if (action_id ==
EActions.WATCH_PLAYER)
11674 {
11675 PluginDeveloper.SetDeveloperItemClientEx(player);
11676 }
11677 #endif
11679 {
11680 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11681 {
11682 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11683 OnDebugButtonPressServer(id + 1);
11684 }
11685
11686 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11687 {
11688 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11690 }
11691
11692 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11693 {
11694 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11696 }
11697
11698 else if (action_id ==
EActions.ADD_QUANTITY)
11699 {
11700 if (IsMagazine())
11701 {
11702 Magazine mag = Magazine.Cast(this);
11703 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11704 }
11705 else
11706 {
11708 }
11709
11710 if (m_EM)
11711 {
11712 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11713 }
11714
11715 }
11716
11717 else if (action_id ==
EActions.REMOVE_QUANTITY)
11718 {
11719 if (IsMagazine())
11720 {
11721 Magazine mag2 = Magazine.Cast(this);
11722 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11723 }
11724 else
11725 {
11727 }
11728 if (m_EM)
11729 {
11730 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11731 }
11732
11733 }
11734
11735 else if (action_id ==
EActions.SET_QUANTITY_0)
11736 {
11738
11739 if (m_EM)
11740 {
11741 m_EM.SetEnergy(0);
11742 }
11743 }
11744
11745 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11746 {
11748
11749 if (m_EM)
11750 {
11751 m_EM.SetEnergy(m_EM.GetEnergyMax());
11752 }
11753 }
11754
11755 else if (action_id ==
EActions.ADD_HEALTH)
11756 {
11757 AddHealth("","",GetMaxHealth("","Health")/5);
11758 }
11759 else if (action_id ==
EActions.REMOVE_HEALTH)
11760 {
11761 AddHealth("","",-GetMaxHealth("","Health")/5);
11762 }
11763 else if (action_id ==
EActions.DESTROY_HEALTH)
11764 {
11765 SetHealth01("","",0);
11766 }
11767 else if (action_id ==
EActions.WATCH_ITEM)
11768 {
11770 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11771 #ifdef DEVELOPER
11772 SetDebugDeveloper_item(this);
11773 #endif
11774 }
11775
11776 else if (action_id ==
EActions.ADD_TEMPERATURE)
11777 {
11778 AddTemperature(20);
11779
11780 }
11781
11782 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11783 {
11784 AddTemperature(-20);
11785
11786 }
11787
11788 else if (action_id ==
EActions.FLIP_FROZEN)
11789 {
11790 SetFrozen(!GetIsFrozen());
11791
11792 }
11793
11794 else if (action_id ==
EActions.ADD_WETNESS)
11795 {
11797
11798 }
11799
11800 else if (action_id ==
EActions.REMOVE_WETNESS)
11801 {
11803
11804 }
11805
11806 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11807 {
11810
11811
11812 }
11813
11814 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11815 {
11818 }
11819
11820 else if (action_id ==
EActions.MAKE_SPECIAL)
11821 {
11822 auto debugParams = DebugSpawnParams.WithPlayer(player);
11823 OnDebugSpawnEx(debugParams);
11824 }
11825
11826 else if (action_id ==
EActions.DELETE)
11827 {
11828 Delete();
11829 }
11830
11831 }
11832
11833
11834 return false;
11835 }
11836
11837
11838
11839
11843
11846
11847
11848
11850 {
11851 return false;
11852 }
11853
11854
11856 {
11857 return true;
11858 }
11859
11860
11862 {
11863 return true;
11864 }
11865
11866
11867
11869 {
11870 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11872 }
11873
11876 {
11877 return null;
11878 }
11879
11881 {
11882 return false;
11883 }
11884
11886 {
11887 return false;
11888 }
11889
11893
11894
11896 {
11897 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11898 return module_repairing.CanRepair(this, item_repair_kit);
11899 }
11900
11901
11902 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11903 {
11904 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11905 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11906 }
11907
11908
11910 {
11911
11912
11913
11914
11915
11916
11917
11918
11919 return 1;
11920 }
11921
11922
11923
11925 {
11927 }
11928
11929
11930
11932 {
11934 }
11935
11936
11945 {
11946 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11947
11948 if (player)
11949 {
11950 player.MessageStatus(text);
11951 }
11952 }
11953
11954
11963 {
11964 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11965
11966 if (player)
11967 {
11968 player.MessageAction(text);
11969 }
11970 }
11971
11972
11981 {
11982 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11983
11984 if (player)
11985 {
11986 player.MessageFriendly(text);
11987 }
11988 }
11989
11990
11999 {
12000 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12001
12002 if (player)
12003 {
12004 player.MessageImportant(text);
12005 }
12006 }
12007
12009 {
12010 return true;
12011 }
12012
12013
12014 override bool KindOf(
string tag)
12015 {
12016 bool found = false;
12017 string item_name = this.
GetType();
12020
12021 int array_size = item_tag_array.Count();
12022 for (int i = 0; i < array_size; i++)
12023 {
12024 if (item_tag_array.Get(i) == tag)
12025 {
12026 found = true;
12027 break;
12028 }
12029 }
12030 return found;
12031 }
12032
12033
12035 {
12036
12037 super.OnRPC(sender, rpc_type,ctx);
12038
12039
12040 switch (rpc_type)
12041 {
12042 #ifndef SERVER
12043 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12044 Param2<bool, string> p = new Param2<bool, string>(false, "");
12045
12047 return;
12048
12049 bool play = p.param1;
12050 string soundSet = p.param2;
12051
12052 if (play)
12053 {
12055 {
12057 {
12059 }
12060 }
12061 else
12062 {
12064 }
12065 }
12066 else
12067 {
12069 }
12070
12071 break;
12072 #endif
12073
12074 }
12075
12077 {
12079 }
12080 }
12081
12082
12083
12084
12086 {
12087 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12088 return plugin.GetID(
name);
12089 }
12090
12092 {
12093 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12094 return plugin.GetName(id);
12095 }
12096
12099 {
12100
12101
12102 int varFlags;
12103 if (!ctx.
Read(varFlags))
12104 return;
12105
12106 if (varFlags & ItemVariableFlags.FLOAT)
12107 {
12109 }
12110 }
12111
12113 {
12114
12115 super.SerializeNumericalVars(floats_out);
12116
12117
12118
12120 {
12122 }
12123
12125 {
12127 }
12128
12130 {
12132 }
12133
12135 {
12140 }
12141
12143 {
12145 }
12146 }
12147
12149 {
12150
12151 super.DeSerializeNumericalVars(floats);
12152
12153
12154 int index = 0;
12155 int mask = Math.Round(floats.Get(index));
12156
12157 index++;
12158
12160 {
12162 {
12164 }
12165 else
12166 {
12167 float quantity = floats.Get(index);
12168 SetQuantity(quantity,
true,
false,
false,
false);
12169 }
12170 index++;
12171 }
12172
12174 {
12175 float wet = floats.Get(index);
12177 index++;
12178 }
12179
12181 {
12182 int liquidtype = Math.Round(floats.Get(index));
12184 index++;
12185 }
12186
12188 {
12190 index++;
12192 index++;
12194 index++;
12196 index++;
12197 }
12198
12200 {
12201 int cleanness = Math.Round(floats.Get(index));
12203 index++;
12204 }
12205 }
12206
12208 {
12209 super.WriteVarsToCTX(ctx);
12210
12211
12213 {
12215 }
12216
12218 {
12220 }
12221
12223 {
12225 }
12226
12228 {
12229 int r,g,b,a;
12235 }
12236
12238 {
12240 }
12241 }
12242
12244 {
12245 if (!super.ReadVarsFromCTX(ctx,version))
12246 return false;
12247
12248 int intValue;
12249 float value;
12250
12251 if (version < 140)
12252 {
12253 if (!ctx.
Read(intValue))
12254 return false;
12255
12256 m_VariablesMask = intValue;
12257 }
12258
12260 {
12261 if (!ctx.
Read(value))
12262 return false;
12263
12265 {
12267 }
12268 else
12269 {
12271 }
12272 }
12273
12274 if (version < 140)
12275 {
12277 {
12278 if (!ctx.
Read(value))
12279 return false;
12280 SetTemperatureDirect(value);
12281 }
12282 }
12283
12285 {
12286 if (!ctx.
Read(value))
12287 return false;
12289 }
12290
12292 {
12293 if (!ctx.
Read(intValue))
12294 return false;
12296 }
12297
12299 {
12300 int r,g,b,a;
12302 return false;
12304 return false;
12306 return false;
12308 return false;
12309
12311 }
12312
12314 {
12315 if (!ctx.
Read(intValue))
12316 return false;
12318 }
12319
12320 if (version >= 138 && version < 140)
12321 {
12323 {
12324 if (!ctx.
Read(intValue))
12325 return false;
12326 SetFrozen(intValue);
12327 }
12328 }
12329
12330 return true;
12331 }
12332
12333
12335 {
12338 {
12340 }
12341
12342 if (!super.OnStoreLoad(ctx, version))
12343 {
12345 return false;
12346 }
12347
12348 if (version >= 114)
12349 {
12350 bool hasQuickBarIndexSaved;
12351
12352 if (!ctx.
Read(hasQuickBarIndexSaved))
12353 {
12355 return false;
12356 }
12357
12358 if (hasQuickBarIndexSaved)
12359 {
12360 int itmQBIndex;
12361
12362
12363 if (!ctx.
Read(itmQBIndex))
12364 {
12366 return false;
12367 }
12368
12369 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12370 if (itmQBIndex != -1 && parentPlayer)
12371 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12372 }
12373 }
12374 else
12375 {
12376
12377 PlayerBase player;
12378 int itemQBIndex;
12379 if (version ==
int.
MAX)
12380 {
12381 if (!ctx.
Read(itemQBIndex))
12382 {
12384 return false;
12385 }
12386 }
12387 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12388 {
12389
12390 if (!ctx.
Read(itemQBIndex))
12391 {
12393 return false;
12394 }
12395 if (itemQBIndex != -1 && player)
12396 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12397 }
12398 }
12399
12400 if (version < 140)
12401 {
12402
12403 if (!LoadVariables(ctx, version))
12404 {
12406 return false;
12407 }
12408 }
12409
12410
12412 {
12414 return false;
12415 }
12416 if (version >= 132)
12417 {
12419 if (raib)
12420 {
12422 {
12424 return false;
12425 }
12426 }
12427 }
12428
12430 return true;
12431 }
12432
12433
12434
12436 {
12437 super.OnStoreSave(ctx);
12438
12439 PlayerBase player;
12440 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12441 {
12443
12444 int itemQBIndex = -1;
12445 itemQBIndex = player.FindQuickBarEntityIndex(this);
12446 ctx.
Write(itemQBIndex);
12447 }
12448 else
12449 {
12451 }
12452
12454
12456 if (raib)
12457 {
12459 }
12460 }
12461
12462
12464 {
12465 super.AfterStoreLoad();
12466
12468 {
12470 }
12471
12473 {
12476 }
12477 }
12478
12480 {
12481 super.EEOnAfterLoad();
12482
12484 {
12486 }
12487
12490 }
12491
12493 {
12494 return false;
12495 }
12496
12497
12498
12500 {
12502 {
12503 #ifdef PLATFORM_CONSOLE
12504
12506 {
12508 if (menu)
12509 {
12511 }
12512 }
12513 #endif
12514 }
12515
12517 {
12520 }
12521
12523 {
12524 SetWeightDirty();
12526 }
12528 {
12531 }
12532
12534 {
12537 }
12539 {
12542 }
12543
12544 super.OnVariablesSynchronized();
12545 }
12546
12547
12548
12550 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12551 {
12552 if (!IsServerCheck(allow_client))
12553 return false;
12554
12556 return false;
12557
12560
12561 if (value <= (min + 0.001))
12562 value = min;
12563
12564 if (value == min)
12565 {
12566 if (destroy_config)
12567 {
12568 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12569 if (dstr)
12570 {
12572 this.Delete();
12573 return true;
12574 }
12575 }
12576 else if (destroy_forced)
12577 {
12579 this.Delete();
12580 return true;
12581 }
12582
12584 }
12585
12588
12590 {
12592
12593 if (delta)
12595 }
12596
12598
12599 return false;
12600 }
12601
12602
12604 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12605 {
12607 }
12608
12610 {
12613 }
12614
12616 {
12619 }
12620
12623 {
12624 float value_clamped = Math.Clamp(value, 0, 1);
12626 SetQuantity(result, destroy_config, destroy_forced);
12627 }
12628
12629
12632 {
12634 }
12635
12637 {
12639 }
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12651 {
12652 int slot = -1;
12653 if (GetInventory())
12654 {
12655 InventoryLocation il = new InventoryLocation;
12656 GetInventory().GetCurrentInventoryLocation(il);
12658 }
12659
12661 }
12662
12664 {
12665 float quantity_max = 0;
12666
12668 {
12669 if (attSlotID != -1)
12670 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12671
12672 if (quantity_max <= 0)
12674 }
12675
12676 if (quantity_max <= 0)
12678
12679 return quantity_max;
12680 }
12681
12683 {
12685 }
12686
12688 {
12690 }
12691
12692
12694 {
12696 }
12697
12699 {
12701 }
12702
12704 {
12706 }
12707
12708
12710 {
12711
12712 float weightEx = GetWeightEx();
12713 float special = GetInventoryAndCargoWeight();
12714 return weightEx - special;
12715 }
12716
12717
12719 {
12721 }
12722
12724 {
12726 {
12727 #ifdef DEVELOPER
12728 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12729 {
12730 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12732 }
12733 #endif
12734
12735 return GetQuantity() * GetConfigWeightModified();
12736 }
12737 else if (HasEnergyManager())
12738 {
12739 #ifdef DEVELOPER
12740 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12741 {
12742 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12743 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12744 }
12745 #endif
12746 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12747 }
12748 else
12749 {
12750 #ifdef DEVELOPER
12751 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12752 {
12753 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12754 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12755 }
12756 #endif
12757 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12758 }
12759 }
12760
12763 {
12764 int item_count = 0;
12766
12767 if (GetInventory().GetCargo() != NULL)
12768 {
12769 item_count = GetInventory().GetCargo().GetItemCount();
12770 }
12771
12772 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12773 {
12774 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12775 if (item)
12776 item_count += item.GetNumberOfItems();
12777 }
12778 return item_count;
12779 }
12780
12783 {
12784 float weight = 0;
12785 float wetness = 1;
12786 if (include_wetness)
12789 {
12790 weight = wetness * m_ConfigWeight;
12791 }
12793 {
12794 weight = 1;
12795 }
12796 return weight;
12797 }
12798
12799
12800
12802 {
12803 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12804 {
12805 GameInventory inv = GetInventory();
12806 array<EntityAI> items = new array<EntityAI>;
12808 for (int i = 0; i < items.Count(); i++)
12809 {
12811 if (item)
12812 {
12814 }
12815 }
12816 }
12817 }
12818
12819
12820
12821
12823 {
12824 float energy = 0;
12825 if (HasEnergyManager())
12826 {
12827 energy = GetCompEM().GetEnergy();
12828 }
12829 return energy;
12830 }
12831
12832
12834 {
12835 super.OnEnergyConsumed();
12836
12838 }
12839
12841 {
12842 super.OnEnergyAdded();
12843
12845 }
12846
12847
12849 {
12850 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12851 {
12853 {
12854 float energy_0to1 = GetCompEM().GetEnergy0To1();
12856 }
12857 }
12858 }
12859
12860
12862 {
12863 return ConfigGetFloat("heatIsolation");
12864 }
12865
12867 {
12869 }
12870
12872 {
12873 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12874 if (
GetGame().ConfigIsExisting(paramPath))
12876
12877 return 0.0;
12878 }
12879
12881 {
12882 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12883 if (
GetGame().ConfigIsExisting(paramPath))
12885
12886 return 0.0;
12887 }
12888
12889 override void SetWet(
float value,
bool allow_client =
false)
12890 {
12891 if (!IsServerCheck(allow_client))
12892 return;
12893
12896
12898
12899 m_VarWet = Math.Clamp(value, min, max);
12900
12902 {
12905 }
12906 }
12907
12908 override void AddWet(
float value)
12909 {
12911 }
12912
12914 {
12916 }
12917
12919 {
12921 }
12922
12924 {
12926 }
12927
12929 {
12931 }
12932
12934 {
12936 }
12937
12938 override void OnWetChanged(
float newVal,
float oldVal)
12939 {
12942 if (newLevel != oldLevel)
12943 {
12945 }
12946 }
12947
12949 {
12950 SetWeightDirty();
12951 }
12952
12954 {
12955 return GetWetLevelInternal(
m_VarWet);
12956 }
12957
12958
12959
12961 {
12963 }
12964
12966 {
12968 }
12969
12971 {
12973 }
12974
12976 {
12978 }
12979
12980
12981
12983 {
12984 if (ConfigIsExisting("itemModelLength"))
12985 {
12986 return ConfigGetFloat("itemModelLength");
12987 }
12988 return 0;
12989 }
12990
12992 {
12993 if (ConfigIsExisting("itemAttachOffset"))
12994 {
12995 return ConfigGetFloat("itemAttachOffset");
12996 }
12997 return 0;
12998 }
12999
13000 override void SetCleanness(
int value,
bool allow_client =
false)
13001 {
13002 if (!IsServerCheck(allow_client))
13003 return;
13004
13006
13008
13011 }
13012
13014 {
13016 }
13017
13019 {
13020 return true;
13021 }
13022
13023
13024
13025
13027 {
13029 }
13030
13032 {
13034 }
13035
13036
13037
13038
13039 override void SetColor(
int r,
int g,
int b,
int a)
13040 {
13046 }
13048 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13049 {
13054 }
13055
13057 {
13059 }
13060
13063 {
13064 int r,g,b,a;
13066 r = r/255;
13067 g = g/255;
13068 b = b/255;
13069 a = a/255;
13070 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13071 }
13072
13073
13074
13075 override void SetLiquidType(
int value,
bool allow_client =
false)
13076 {
13077 if (!IsServerCheck(allow_client))
13078 return;
13079
13084 }
13085
13087 {
13088 return ConfigGetInt("varLiquidTypeInit");
13089 }
13090
13092 {
13094 }
13095
13097 {
13099 SetFrozen(false);
13100 }
13101
13104 {
13105 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13106 }
13107
13108
13111 {
13112 PlayerBase nplayer;
13113 if (PlayerBase.CastTo(nplayer, player))
13114 {
13116
13117 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13118 }
13119 }
13120
13121
13124 {
13125 PlayerBase nplayer;
13126 if (PlayerBase.CastTo(nplayer,player))
13127 {
13128
13129 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13130
13131 }
13132
13133
13134 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13135
13136
13137 if (HasEnergyManager())
13138 {
13139 GetCompEM().UpdatePlugState();
13140 }
13141 }
13142
13143
13145 {
13146 super.OnPlacementStarted(player);
13147
13149 }
13150
13151 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13152 {
13154 {
13155 m_AdminLog.OnPlacementComplete(player,
this);
13156 }
13157
13158 super.OnPlacementComplete(player, position, orientation);
13159 }
13160
13161
13162
13163
13164
13166 {
13168 {
13169 return true;
13170 }
13171 else
13172 {
13173 return false;
13174 }
13175 }
13176
13177
13179 {
13181 {
13183 }
13184 }
13185
13186
13188 {
13190 }
13191
13193 {
13195 }
13196
13197 override void InsertAgent(
int agent,
float count = 1)
13198 {
13199 if (count < 1)
13200 return;
13201
13203 }
13204
13207 {
13209 }
13210
13211
13213 {
13215 }
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13259 {
13261 return false;
13262 return true;
13263 }
13264
13266 {
13267
13269 }
13270
13271
13274 {
13275 super.CheckForRoofLimited(timeTresholdMS);
13276
13278 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13279 {
13280 m_PreviousRoofTestTime = time;
13281 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13282 }
13283 }
13284
13285
13287 {
13289 {
13290 return 0;
13291 }
13292
13293 if (GetInventory().GetAttachmentSlotsCount() != 0)
13294 {
13295 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13296 if (filter)
13297 return filter.GetProtectionLevel(type, false, system);
13298 else
13299 return 0;
13300 }
13301
13302 string subclassPath, entryName;
13303
13304 switch (type)
13305 {
13307 entryName = "biological";
13308 break;
13310 entryName = "chemical";
13311 break;
13312 default:
13313 entryName = "biological";
13314 break;
13315 }
13316
13317 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13318
13320 }
13321
13322
13323
13326 {
13327 if (!IsMagazine())
13329
13331 }
13332
13333
13334
13335
13336
13341 {
13342 return true;
13343 }
13344
13346 {
13348 }
13349
13350
13351
13352
13353
13355 {
13356 if (parent)
13357 {
13358 if (parent.IsInherited(DayZInfected))
13359 return true;
13360
13361 if (!parent.IsRuined())
13362 return true;
13363 }
13364
13365 return true;
13366 }
13367
13369 {
13370 if (!super.CanPutAsAttachment(parent))
13371 {
13372 return false;
13373 }
13374
13375 if (!IsRuined() && !parent.IsRuined())
13376 {
13377 return true;
13378 }
13379
13380 return false;
13381 }
13382
13384 {
13385
13386
13387
13388
13389 return super.CanReceiveItemIntoCargo(item);
13390 }
13391
13393 {
13394
13395
13396
13397
13398 GameInventory attachmentInv = attachment.GetInventory();
13400 {
13401 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13402 return false;
13403 }
13404
13405 InventoryLocation loc = new InventoryLocation();
13406 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13407 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13408 return false;
13409
13410 return super.CanReceiveAttachment(attachment, slotId);
13411 }
13412
13414 {
13415 if (!super.CanReleaseAttachment(attachment))
13416 return false;
13417
13418 return GetInventory().AreChildrenAccessible();
13419 }
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13442 {
13443 int id = muzzle_owner.GetMuzzleID();
13444 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13445
13446 if (WPOF_array)
13447 {
13448 for (int i = 0; i < WPOF_array.Count(); i++)
13449 {
13450 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13451
13452 if (WPOF)
13453 {
13454 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13455 }
13456 }
13457 }
13458 }
13459
13460
13462 {
13463 int id = muzzle_owner.GetMuzzleID();
13465
13466 if (WPOBE_array)
13467 {
13468 for (int i = 0; i < WPOBE_array.Count(); i++)
13469 {
13470 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13471
13472 if (WPOBE)
13473 {
13474 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13475 }
13476 }
13477 }
13478 }
13479
13480
13482 {
13483 int id = muzzle_owner.GetMuzzleID();
13484 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13485
13486 if (WPOOH_array)
13487 {
13488 for (int i = 0; i < WPOOH_array.Count(); i++)
13489 {
13490 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13491
13492 if (WPOOH)
13493 {
13494 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13495 }
13496 }
13497 }
13498 }
13499
13500
13502 {
13503 int id = muzzle_owner.GetMuzzleID();
13504 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13505
13506 if (WPOOH_array)
13507 {
13508 for (int i = 0; i < WPOOH_array.Count(); i++)
13509 {
13510 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13511
13512 if (WPOOH)
13513 {
13514 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13515 }
13516 }
13517 }
13518 }
13519
13520
13522 {
13523 int id = muzzle_owner.GetMuzzleID();
13524 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13525
13526 if (WPOOH_array)
13527 {
13528 for (int i = 0; i < WPOOH_array.Count(); i++)
13529 {
13530 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13531
13532 if (WPOOH)
13533 {
13534 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13535 }
13536 }
13537 }
13538 }
13539
13540
13541
13543 {
13545 {
13546 return true;
13547 }
13548
13549 return false;
13550 }
13551
13553 {
13555 {
13556 return true;
13557 }
13558
13559 return false;
13560 }
13561
13563 {
13565 {
13566 return true;
13567 }
13568
13569 return false;
13570 }
13571
13573 {
13574 return false;
13575 }
13576
13579 {
13580 return UATimeSpent.DEFAULT_DEPLOY;
13581 }
13582
13583
13584
13585
13587 {
13589 SetSynchDirty();
13590 }
13591
13593 {
13595 }
13596
13597
13599 {
13600 return false;
13601 }
13602
13605 {
13606 string att_type = "None";
13607
13608 if (ConfigIsExisting("soundAttType"))
13609 {
13610 att_type = ConfigGetString("soundAttType");
13611 }
13612
13614 }
13615
13617 {
13619 }
13620
13621
13622
13623
13624
13628
13630 {
13633
13635 }
13636
13637
13639 {
13641 return;
13642
13644
13647
13650
13651 SoundParameters params = new SoundParameters();
13655 }
13656
13657
13659 {
13661 return;
13662
13664 SetSynchDirty();
13665
13668 }
13669
13670
13672 {
13674 return;
13675
13677 SetSynchDirty();
13678
13681 }
13682
13684 {
13686 }
13687
13689 {
13691 }
13692
13695 {
13696 if (!
GetGame().IsDedicatedServer())
13697 {
13698 if (ConfigIsExisting("attachSoundSet"))
13699 {
13700 string cfg_path = "";
13701 string soundset = "";
13702 string type_name =
GetType();
13703
13706 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13707 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13708
13709 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13710 {
13711 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13712 {
13713 if (cfg_slot_array[i] == slot_type)
13714 {
13715 soundset = cfg_soundset_array[i];
13716 break;
13717 }
13718 }
13719 }
13720
13721 if (soundset != "")
13722 {
13723 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13725 }
13726 }
13727 }
13728 }
13729
13731 {
13732
13733 }
13734
13735 void OnApply(PlayerBase player);
13736
13738 {
13739 return 1.0;
13740 };
13741
13743 {
13745 }
13746
13748 {
13750 }
13751
13753
13755 {
13756 SetDynamicPhysicsLifeTime(0.01);
13758 }
13759
13761 {
13762 array<string> zone_names = new array<string>;
13763 GetDamageZones(zone_names);
13764 for (int i = 0; i < zone_names.Count(); i++)
13765 {
13766 SetHealthMax(zone_names.Get(i),"Health");
13767 }
13768 SetHealthMax("","Health");
13769 }
13770
13773 {
13774 float global_health = GetHealth01("","Health");
13775 array<string> zones = new array<string>;
13776 GetDamageZones(zones);
13777
13778 for (int i = 0; i < zones.Count(); i++)
13779 {
13780 SetHealth01(zones.Get(i),"Health",global_health);
13781 }
13782 }
13783
13786 {
13787 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13788 }
13789
13791 {
13792 if (!hasRootAsPlayer)
13793 {
13794 if (refParentIB)
13795 {
13796
13797 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13798 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13799
13800 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13801 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13802
13805 }
13806 else
13807 {
13808
13811 }
13812 }
13813 }
13814
13816 {
13818 {
13819 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13820 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13821 {
13822 float heatPermCoef = 1.0;
13824 while (ent)
13825 {
13826 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13827 ent = ent.GetHierarchyParent();
13828 }
13829
13830 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13831 }
13832 }
13833 }
13834
13836 {
13837
13838 EntityAI parent = GetHierarchyParent();
13839 if (!parent)
13840 {
13841 hasParent = false;
13842 hasRootAsPlayer = false;
13843 }
13844 else
13845 {
13846 hasParent = true;
13847 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13848 refParentIB =
ItemBase.Cast(parent);
13849 }
13850 }
13851
13852 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13853 {
13854
13855 }
13856
13858 {
13859
13860 return false;
13861 }
13862
13864 {
13865
13866
13867 return false;
13868 }
13869
13871 {
13872
13873 return false;
13874 }
13875
13878 {
13879 return !GetIsFrozen() &&
IsOpen();
13880 }
13881
13883 {
13884 bool hasParent = false, hasRootAsPlayer = false;
13886
13887 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13888 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13889
13890 if (wwtu || foodDecay)
13891 {
13895
13896 if (processWetness || processTemperature || processDecay)
13897 {
13899
13900 if (processWetness)
13901 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13902
13903 if (processTemperature)
13905
13906 if (processDecay)
13907 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13908 }
13909 }
13910 }
13911
13914 {
13916 }
13917
13919 {
13922
13923 return super.GetTemperatureFreezeThreshold();
13924 }
13925
13927 {
13930
13931 return super.GetTemperatureThawThreshold();
13932 }
13933
13935 {
13938
13939 return super.GetItemOverheatThreshold();
13940 }
13941
13943 {
13945 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13946
13947 return super.GetTemperatureFreezeTime();
13948 }
13949
13951 {
13953 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13954
13955 return super.GetTemperatureThawTime();
13956 }
13957
13962
13964 {
13965 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13966 }
13967
13969 {
13970 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13971 }
13972
13975 {
13977 }
13978
13980 {
13982 }
13983
13985 {
13987 }
13988
13991 {
13992 return null;
13993 }
13994
13997 {
13998 return false;
13999 }
14000
14002 {
14004 {
14007 if (!trg)
14008 {
14010 explosive = this;
14011 }
14012
14013 explosive.PairRemote(trg);
14015
14016 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14017 trg.SetPersistentPairID(persistentID);
14018 explosive.SetPersistentPairID(persistentID);
14019
14020 return true;
14021 }
14022 return false;
14023 }
14024
14027 {
14028 float ret = 1.0;
14031 ret *= GetHealth01();
14032
14033 return ret;
14034 }
14035
14036 #ifdef DEVELOPER
14037 override void SetDebugItem()
14038 {
14039 super.SetDebugItem();
14040 _itemBase = this;
14041 }
14042
14044 {
14045 string text = super.GetDebugText();
14046
14048 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14049
14050 return text;
14051 }
14052 #endif
14053
14055 {
14056 return true;
14057 }
14058
14060
14062
14064 {
14067 }
14068
14069
14077
14093}
14094
14096{
14098 if (entity)
14099 {
14100 bool is_item = entity.IsInherited(
ItemBase);
14101 if (is_item && full_quantity)
14102 {
14105 }
14106 }
14107 else
14108 {
14110 return NULL;
14111 }
14112 return entity;
14113}
14114
14116{
14117 if (item)
14118 {
14119 if (health > 0)
14120 item.SetHealth("", "", health);
14121
14122 if (item.CanHaveTemperature())
14123 {
14125 if (item.CanFreeze())
14126 item.SetFrozen(false);
14127 }
14128
14129 if (item.HasEnergyManager())
14130 {
14131 if (quantity >= 0)
14132 {
14133 item.GetCompEM().SetEnergy0To1(quantity);
14134 }
14135 else
14136 {
14138 }
14139 }
14140 else if (item.IsMagazine())
14141 {
14142 Magazine mag = Magazine.Cast(item);
14143 if (quantity >= 0)
14144 {
14145 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14146 }
14147 else
14148 {
14150 }
14151
14152 }
14153 else
14154 {
14155 if (quantity >= 0)
14156 {
14157 item.SetQuantityNormalized(quantity, false);
14158 }
14159 else
14160 {
14162 }
14163
14164 }
14165 }
14166}
14167
14168#ifdef DEVELOPER
14170#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.