9342{
9344 {
9345 return true;
9346 }
9347};
9348
9349
9350
9352{
9356
9358
9361
9362
9363
9364
9365
9374
9380
9385
9390
9411 protected bool m_IsResultOfSplit
9412
9414
9419
9420
9421
9423
9427
9428
9429
9431
9434
9435
9436
9442
9443
9451
9454
9455
9457
9458
9460
9461
9466
9467
9472
9473
9475
9476
9478 {
9483
9484 if (!
GetGame().IsDedicatedServer())
9485 {
9487 {
9489
9491 {
9493 }
9494 }
9495
9498 }
9499
9500 m_OldLocation = null;
9501
9503 {
9505 }
9506
9507 if (ConfigIsExisting("headSelectionsToHide"))
9508 {
9511 }
9512
9514 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9515 {
9517 }
9518
9520
9521 m_IsResultOfSplit = false;
9522
9524 }
9525
9527 {
9528 super.InitItemVariables();
9529
9535 m_Count = ConfigGetInt(
"count");
9536
9539
9544
9547
9552
9564
9568
9569
9572 if (ConfigIsExisting("canBeSplit"))
9573 {
9576 }
9577
9579 if (ConfigIsExisting("itemBehaviour"))
9581
9582
9585 RegisterNetSyncVariableInt("m_VarLiquidType");
9586 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9587
9588 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9589 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9590 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9591
9592 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9593 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9594 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9595 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9596
9597 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9598 RegisterNetSyncVariableBool("m_IsTakeable");
9599 RegisterNetSyncVariableBool("m_IsHologram");
9600
9603 {
9606 }
9607
9609
9611 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9613
9614 }
9615
9617 {
9619 }
9620
9622 {
9625 {
9630 }
9631 }
9632
9633 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9634 {
9636 {
9639 }
9640
9642 }
9643
9645 {
9651 }
9652
9654
9656 {
9658
9659 if (!action)
9660 {
9661 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9662 return;
9663 }
9664
9666 if (!ai)
9667 {
9669 return;
9670 }
9671
9673 if (!action_array)
9674 {
9675 action_array = new array<ActionBase_Basic>;
9677 }
9678 if (LogManager.IsActionLogEnable())
9679 {
9680 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9681 }
9682
9683 if (action_array.Find(action) != -1)
9684 {
9685 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9686 }
9687 else
9688 {
9689 action_array.Insert(action);
9690 }
9691 }
9692
9694 {
9696 ActionBase action = player.GetActionManager().GetAction(actionName);
9699
9700 if (action_array)
9701 {
9702 action_array.RemoveItem(action);
9703 }
9704 }
9705
9706
9707
9709 {
9710 ActionOverrideData overrideData = new ActionOverrideData();
9714
9716 if (!actionMap)
9717 {
9720 }
9721
9722 actionMap.Insert(this.
Type(), overrideData);
9723
9724 }
9725
9727
9729
9730
9732 {
9735
9738
9739 string config_to_search = "CfgVehicles";
9740 string muzzle_owner_config;
9741
9743 {
9744 if (IsInherited(Weapon))
9745 config_to_search = "CfgWeapons";
9746
9747 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9748
9749 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9750
9752
9753 if (config_OnFire_subclass_count > 0)
9754 {
9755 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9756
9757 for (int i = 0; i < config_OnFire_subclass_count; i++)
9758 {
9759 string particle_class = "";
9761 string config_OnFire_entry = config_OnFire_class + particle_class;
9762 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9763 WPOF_array.Insert(WPOF);
9764 }
9765
9766
9768 }
9769 }
9770
9772 {
9773 config_to_search = "CfgWeapons";
9774 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9775
9776 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9777
9779
9780 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9781 {
9782 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9783
9784 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9785 {
9786 string particle_class2 = "";
9788 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9789 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9790 WPOBE_array.Insert(WPOBE);
9791 }
9792
9793
9795 }
9796 }
9797 }
9798
9799
9801 {
9804
9806 {
9807 string config_to_search = "CfgVehicles";
9808
9809 if (IsInherited(Weapon))
9810 config_to_search = "CfgWeapons";
9811
9812 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9813 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9814
9815 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9816 {
9817
9819
9821 {
9823 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9825 return;
9826 }
9827
9830
9831
9832
9834 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9835
9836 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9837 {
9838 string particle_class = "";
9840 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9842
9843 if (entry_type == CT_CLASS)
9844 {
9845 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9846 WPOOH_array.Insert(WPOF);
9847 }
9848 }
9849
9850
9852 }
9853 }
9854 }
9855
9857 {
9859 }
9860
9862 {
9864 {
9866
9869
9872
9873 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9874 }
9875 }
9876
9878 {
9880 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9881
9883 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9884
9886 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9887
9889 {
9891 }
9892 }
9893
9895 {
9897 }
9898
9900 {
9903 else
9905
9907 {
9910 }
9911 else
9912 {
9915
9918 }
9919
9921 }
9922
9924 {
9926 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9927 }
9928
9930 {
9932 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9934 }
9935
9937 {
9939 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9940 }
9941
9943 {
9946
9947 OverheatingParticle OP = new OverheatingParticle();
9952
9954 }
9955
9957 {
9960
9961 return -1;
9962 }
9963
9965 {
9967 {
9970
9971 for (int i = count; i > 0; --i)
9972 {
9973 int id = i - 1;
9976
9979
9980 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9981 {
9982 if (p)
9983 {
9986 }
9987 }
9988 }
9989 }
9990 }
9991
9993 {
9995 {
9997 {
9998 int id = i - 1;
10000
10001 if (OP)
10002 {
10004
10005 if (p)
10006 {
10008 }
10009
10010 delete OP;
10011 }
10012 }
10013
10016 }
10017 }
10018
10021 {
10022 return 0.0;
10023 }
10024
10025
10027 {
10028 return 250;
10029 }
10030
10032 {
10033 return 0;
10034 }
10035
10038 {
10040 return true;
10041
10042 return false;
10043 }
10044
10047 {
10050
10052 {
10054 }
10055 else
10056 {
10057
10059 }
10060
10062 }
10063
10070 {
10071 return -1;
10072 }
10073
10074
10075
10076
10078 {
10080 {
10082 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10083
10084 if (r_index >= 0)
10085 {
10086 InventoryLocation r_il = new InventoryLocation;
10087 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10088
10089 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10092 {
10093 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10094 }
10096 {
10097 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10098 }
10099
10100 }
10101
10102 player.GetHumanInventory().ClearUserReservedLocation(this);
10103 }
10104
10107 }
10108
10109
10110
10111
10113 {
10114 return ItemBase.m_DebugActionsMask;
10115 }
10116
10118 {
10119 return ItemBase.m_DebugActionsMask & mask;
10120 }
10121
10123 {
10124 ItemBase.m_DebugActionsMask = mask;
10125 }
10126
10128 {
10129 ItemBase.m_DebugActionsMask |= mask;
10130 }
10131
10133 {
10134 ItemBase.m_DebugActionsMask &= ~mask;
10135 }
10136
10138 {
10140 {
10142 }
10143 else
10144 {
10146 }
10147 }
10148
10149
10151 {
10152 if (GetEconomyProfile())
10153 {
10154 float q_max = GetEconomyProfile().GetQuantityMax();
10155 if (q_max > 0)
10156 {
10157 float q_min = GetEconomyProfile().GetQuantityMin();
10158 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10159
10161 {
10162 ComponentEnergyManager comp = GetCompEM();
10164 {
10166 }
10167 }
10169 {
10171
10172 }
10173
10174 }
10175 }
10176 }
10177
10180 {
10181 EntityAI parent = GetHierarchyParent();
10182
10183 if (parent)
10184 {
10185 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10186 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10187 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10188 }
10189 }
10190
10193 {
10194 EntityAI parent = GetHierarchyParent();
10195
10196 if (parent)
10197 {
10198 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10199 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10200 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10201 }
10202 }
10203
10205 {
10206
10207
10208
10209
10211
10213 {
10214 if (ScriptInputUserData.CanStoreInputUserData())
10215 {
10216 ScriptInputUserData ctx = new ScriptInputUserData;
10222 ctx.
Write(use_stack_max);
10225
10227 {
10228 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10229 }
10230 }
10231 }
10232 else if (!
GetGame().IsMultiplayer())
10233 {
10235 }
10236 }
10237
10239 {
10241 }
10242
10244 {
10246 }
10247
10249 {
10251 }
10252
10254 {
10255
10256 return false;
10257 }
10258
10260 {
10261 return false;
10262 }
10263
10267 {
10268 return false;
10269 }
10270
10272 {
10273 return "";
10274 }
10275
10277
10279 {
10280 return false;
10281 }
10282
10284 {
10285 return true;
10286 }
10287
10288
10289
10291 {
10292 return true;
10293 }
10294
10296 {
10297 return true;
10298 }
10299
10301 {
10302 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10304 }
10305
10307 {
10309 }
10310
10312 {
10314 if (!is_being_placed)
10316 SetSynchDirty();
10317 }
10318
10319
10321
10323 {
10325 }
10326
10328 {
10330 }
10331
10333 {
10334 return 1;
10335 }
10336
10338 {
10339 return false;
10340 }
10341
10343 {
10345 SetSynchDirty();
10346 }
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10383 {
10384 super.OnMovedInsideCargo(container);
10385
10386 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10387 }
10388
10389 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10390 {
10391 super.EEItemLocationChanged(oldLoc,newLoc);
10392
10393 PlayerBase new_player = null;
10394 PlayerBase old_player = null;
10395
10396 if (newLoc.GetParent())
10397 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10398
10399 if (oldLoc.GetParent())
10400 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10401
10403 {
10404 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10405
10406 if (r_index >= 0)
10407 {
10408 InventoryLocation r_il = new InventoryLocation;
10409 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10410
10411 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10414 {
10415 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10416 }
10418 {
10419 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10420 }
10421
10422 }
10423 }
10424
10426 {
10427 if (new_player)
10428 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10429
10430 if (new_player == old_player)
10431 {
10432
10433 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10434 {
10436 {
10437 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10438 {
10439 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10440 }
10441 }
10442 else
10443 {
10444 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10445 }
10446 }
10447
10448 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10449 {
10450 int type = oldLoc.GetType();
10452 {
10453 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10454 }
10456 {
10457 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10458 }
10459 }
10460 if (!m_OldLocation)
10461 {
10462 m_OldLocation = new InventoryLocation;
10463 }
10464 m_OldLocation.Copy(oldLoc);
10465 }
10466 else
10467 {
10468 if (m_OldLocation)
10469 {
10470 m_OldLocation.Reset();
10471 }
10472 }
10473
10475 }
10476 else
10477 {
10478 if (new_player)
10479 {
10480 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10481 if (res_index >= 0)
10482 {
10483 InventoryLocation il = new InventoryLocation;
10484 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10486 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10489 {
10490 il.
GetParent().GetOnReleaseLock().Invoke(it);
10491 }
10493 {
10495 }
10496
10497 }
10498 }
10500 {
10501
10503 }
10504
10505 if (m_OldLocation)
10506 {
10507 m_OldLocation.Reset();
10508 }
10509 }
10510 }
10511
10512 override void EOnContact(IEntity other, Contact extra)
10513 {
10515 {
10516 int liquidType = -1;
10518 if (impactSpeed > 0.0)
10519 {
10521 #ifndef SERVER
10523 #else
10525 SetSynchDirty();
10526 #endif
10528 }
10529 }
10530
10531 #ifdef SERVER
10532 if (GetCompEM() && GetCompEM().IsPlugged())
10533 {
10534 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10535 GetCompEM().UnplugThis();
10536 }
10537 #endif
10538 }
10539
10541
10543 {
10545 }
10546
10548 {
10549
10550 }
10551
10553 {
10554 super.OnItemLocationChanged(old_owner, new_owner);
10555
10556 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10557 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10558
10559 if (!relatedPlayer && playerNew)
10560 relatedPlayer = playerNew;
10561
10562 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10563 {
10565 if (actionMgr)
10566 {
10567 ActionBase currentAction = actionMgr.GetRunningAction();
10568 if (currentAction)
10570 }
10571 }
10572
10573 Man ownerPlayerOld = null;
10574 Man ownerPlayerNew = null;
10575
10576 if (old_owner)
10577 {
10578 if (old_owner.
IsMan())
10579 {
10580 ownerPlayerOld = Man.Cast(old_owner);
10581 }
10582 else
10583 {
10584 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10585 }
10586 }
10587 else
10588 {
10590 {
10592
10593 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10594 {
10595 GetCompEM().UnplugThis();
10596 }
10597 }
10598 }
10599
10600 if (new_owner)
10601 {
10602 if (new_owner.
IsMan())
10603 {
10604 ownerPlayerNew = Man.Cast(new_owner);
10605 }
10606 else
10607 {
10608 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10609 }
10610 }
10611
10612 if (ownerPlayerOld != ownerPlayerNew)
10613 {
10614 if (ownerPlayerOld)
10615 {
10616 array<EntityAI> subItemsExit = new array<EntityAI>;
10618 for (int i = 0; i < subItemsExit.Count(); i++)
10619 {
10622 }
10623 }
10624
10625 if (ownerPlayerNew)
10626 {
10627 array<EntityAI> subItemsEnter = new array<EntityAI>;
10629 for (int j = 0; j < subItemsEnter.Count(); j++)
10630 {
10633 }
10634 }
10635 }
10636 else if (ownerPlayerNew != null)
10637 {
10638 PlayerBase nplayer;
10639 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10640 {
10641 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10643 for (int k = 0; k < subItemsUpdate.Count(); k++)
10644 {
10646 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10647 }
10648 }
10649 }
10650
10651 if (old_owner)
10652 old_owner.OnChildItemRemoved(this);
10653 if (new_owner)
10654 new_owner.OnChildItemReceived(this);
10655 }
10656
10657
10659 {
10660 super.EEDelete(parent);
10661 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10662 if (player)
10663 {
10665
10666 if (player.IsAlive())
10667 {
10668 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10669 if (r_index >= 0)
10670 {
10671 InventoryLocation r_il = new InventoryLocation;
10672 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10673
10674 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10677 {
10678 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10679 }
10681 {
10682 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10683 }
10684
10685 }
10686
10687 player.RemoveQuickBarEntityShortcut(this);
10688 }
10689 }
10690 }
10691
10693 {
10694 super.EEKilled(killer);
10695
10698 {
10699 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10700 {
10701 if (IsMagazine())
10702 {
10703 if (Magazine.Cast(this).GetAmmoCount() > 0)
10704 {
10706 }
10707 }
10708 else
10709 {
10711 }
10712 }
10713 }
10714 }
10715
10717 {
10718 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10719
10720 super.OnWasAttached(parent, slot_id);
10721
10724
10726 }
10727
10729 {
10730 super.OnWasDetached(parent, slot_id);
10731
10734 }
10735
10737 {
10738 int idx;
10741
10742 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10743 if (inventory_slots.Count() < 1)
10744 {
10745 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10746 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10747 }
10748 else
10749 {
10750 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10751 }
10752
10753 idx = inventory_slots.Find(slot);
10754 if (idx < 0)
10755 return "";
10756
10757 return attach_types.Get(idx);
10758 }
10759
10761 {
10762 int idx = -1;
10763 string slot;
10764
10767
10768 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10769 if (inventory_slots.Count() < 1)
10770 {
10771 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10772 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10773 }
10774 else
10775 {
10776 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10777 if (detach_types.Count() < 1)
10778 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10779 }
10780
10781 for (int i = 0; i < inventory_slots.Count(); i++)
10782 {
10783 slot = inventory_slots.Get(i);
10784 }
10785
10786 if (slot != "")
10787 {
10788 if (detach_types.Count() == 1)
10789 idx = 0;
10790 else
10791 idx = inventory_slots.Find(slot);
10792 }
10793 if (idx < 0)
10794 return "";
10795
10796 return detach_types.Get(idx);
10797 }
10798
10800 {
10801
10803
10804
10805 float min_time = 1;
10806 float max_time = 3;
10807 float delay = Math.RandomFloat(min_time, max_time);
10808
10809 explode_timer.Run(delay, this, "DoAmmoExplosion");
10810 }
10811
10813 {
10814 Magazine magazine = Magazine.Cast(this);
10815 int pop_sounds_count = 6;
10816 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10817
10818
10819 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10820 string sound_name = pop_sounds[ sound_idx ];
10822
10823
10824 magazine.ServerAddAmmoCount(-1);
10825
10826
10827 float min_temp_to_explode = 100;
10828
10829 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10830 {
10832 }
10833 }
10834
10835
10836 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10837 {
10838 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10839
10840 const int CHANCE_DAMAGE_CARGO = 4;
10841 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10842 const int CHANCE_DAMAGE_NOTHING = 2;
10843
10845 {
10846 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10847 int chances;
10848 int rnd;
10849
10850 if (GetInventory().GetCargo())
10851 {
10852 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10853 rnd = Math.RandomInt(0,chances);
10854
10855 if (rnd < CHANCE_DAMAGE_CARGO)
10856 {
10858 }
10859 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10860 {
10862 }
10863 }
10864 else
10865 {
10866 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10867 rnd = Math.RandomInt(0,chances);
10868
10869 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10870 {
10872 }
10873 }
10874 }
10875 }
10876
10878 {
10879 if (GetInventory().GetCargo())
10880 {
10881 int item_count = GetInventory().GetCargo().GetItemCount();
10882 if (item_count > 0)
10883 {
10884 int random_pick = Math.RandomInt(0, item_count);
10886 if (!item.IsExplosive())
10887 {
10888 item.AddHealth("","",damage);
10889 return true;
10890 }
10891 }
10892 }
10893 return false;
10894 }
10895
10897 {
10898 int attachment_count = GetInventory().AttachmentCount();
10899 if (attachment_count > 0)
10900 {
10901 int random_pick = Math.RandomInt(0, attachment_count);
10902 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10903 if (!attachment.IsExplosive())
10904 {
10905 attachment.AddHealth("","",damage);
10906 return true;
10907 }
10908 }
10909 return false;
10910 }
10911
10913 {
10915 }
10916
10918 {
10920 return GetInventory().CanRemoveEntity();
10921
10922 return false;
10923 }
10924
10926 {
10928 return;
10929
10931 {
10932 if (ScriptInputUserData.CanStoreInputUserData())
10933 {
10934 ScriptInputUserData ctx = new ScriptInputUserData;
10939 ctx.
Write(destination_entity);
10941 ctx.
Write(slot_id);
10943 }
10944 }
10945 else if (!
GetGame().IsMultiplayer())
10946 {
10948 }
10949 }
10950
10952 {
10954 return;
10955
10956 float split_quantity_new;
10960 InventoryLocation loc = new InventoryLocation;
10961
10962 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10963 {
10965 split_quantity_new = stack_max;
10966 else
10968
10969 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10970 if (new_item)
10971 {
10972 new_item.SetResultOfSplit(true);
10973 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10975 new_item.SetQuantity(split_quantity_new);
10976 }
10977 }
10978 else if (destination_entity && slot_id == -1)
10979 {
10980 if (quantity > stack_max)
10981 split_quantity_new = stack_max;
10982 else
10983 split_quantity_new = quantity;
10984
10986 {
10989 }
10990
10991 if (new_item)
10992 {
10993 new_item.SetResultOfSplit(true);
10994 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10996 new_item.SetQuantity(split_quantity_new);
10997 }
10998 }
10999 else
11000 {
11001 if (stack_max != 0)
11002 {
11004 {
11006 }
11007
11008 if (split_quantity_new == 0)
11009 {
11010 if (!
GetGame().IsMultiplayer())
11011 player.PhysicalPredictiveDropItem(this);
11012 else
11013 player.ServerDropEntity(this);
11014 return;
11015 }
11016
11018
11019 if (new_item)
11020 {
11021 new_item.SetResultOfSplit(true);
11022 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11024 new_item.SetQuantity(stack_max);
11025 new_item.PlaceOnSurface();
11026 }
11027 }
11028 }
11029 }
11030
11032 {
11034 return;
11035
11036 float split_quantity_new;
11040 InventoryLocation loc = new InventoryLocation;
11041
11042 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
11043 {
11045 split_quantity_new = stack_max;
11046 else
11048
11049 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
11050 if (new_item)
11051 {
11052 new_item.SetResultOfSplit(true);
11053 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11055 new_item.SetQuantity(split_quantity_new);
11056 }
11057 }
11058 else if (destination_entity && slot_id == -1)
11059 {
11060 if (quantity > stack_max)
11061 split_quantity_new = stack_max;
11062 else
11063 split_quantity_new = quantity;
11064
11066 {
11069 }
11070
11071 if (new_item)
11072 {
11073 new_item.SetResultOfSplit(true);
11074 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11076 new_item.SetQuantity(split_quantity_new);
11077 }
11078 }
11079 else
11080 {
11081 if (stack_max != 0)
11082 {
11084 {
11086 }
11087
11089
11090 if (new_item)
11091 {
11092 new_item.SetResultOfSplit(true);
11093 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11095 new_item.SetQuantity(stack_max);
11096 new_item.PlaceOnSurface();
11097 }
11098 }
11099 }
11100 }
11101
11103 {
11105 return;
11106
11108 {
11109 if (ScriptInputUserData.CanStoreInputUserData())
11110 {
11111 ScriptInputUserData ctx = new ScriptInputUserData;
11116 dst.WriteToContext(ctx);
11118 }
11119 }
11120 else if (!
GetGame().IsMultiplayer())
11121 {
11123 }
11124 }
11125
11127 {
11129 return;
11130
11132 {
11133 if (ScriptInputUserData.CanStoreInputUserData())
11134 {
11135 ScriptInputUserData ctx = new ScriptInputUserData;
11140 ctx.
Write(destination_entity);
11146 }
11147 }
11148 else if (!
GetGame().IsMultiplayer())
11149 {
11151 }
11152 }
11153
11155 {
11157 }
11158
11160 {
11162 return this;
11163
11165 float split_quantity_new;
11167 if (dst.IsValid())
11168 {
11169 int slot_id = dst.GetSlot();
11171
11172 if (quantity > stack_max)
11173 split_quantity_new = stack_max;
11174 else
11175 split_quantity_new = quantity;
11176
11178
11179 if (new_item)
11180 {
11181 new_item.SetResultOfSplit(true);
11182 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11185 }
11186
11187 return new_item;
11188 }
11189
11190 return null;
11191 }
11192
11194 {
11196 return;
11197
11199 float split_quantity_new;
11201 if (destination_entity)
11202 {
11204 if (quantity > stackable)
11205 split_quantity_new = stackable;
11206 else
11207 split_quantity_new = quantity;
11208
11209 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11210 if (new_item)
11211 {
11212 new_item.SetResultOfSplit(true);
11213 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11215 new_item.SetQuantity(split_quantity_new);
11216 }
11217 }
11218 }
11219
11221 {
11223 return;
11224
11226 {
11227 if (ScriptInputUserData.CanStoreInputUserData())
11228 {
11229 ScriptInputUserData ctx = new ScriptInputUserData;
11234 ItemBase destination_entity =
this;
11235 ctx.
Write(destination_entity);
11239 }
11240 }
11241 else if (!
GetGame().IsMultiplayer())
11242 {
11244 }
11245 }
11246
11248 {
11250 return;
11251
11253 float split_quantity_new;
11255 if (player)
11256 {
11258 if (quantity > stackable)
11259 split_quantity_new = stackable;
11260 else
11261 split_quantity_new = quantity;
11262
11263 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11264 new_item =
ItemBase.Cast(in_hands);
11265 if (new_item)
11266 {
11267 new_item.SetResultOfSplit(true);
11268 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11270 new_item.SetQuantity(split_quantity_new);
11271 }
11272 }
11273 }
11274
11276 {
11278 return;
11279
11281 float split_quantity_new = Math.Floor(quantity * 0.5);
11282
11284
11285 if (new_item)
11286 {
11287 if (new_item.GetQuantityMax() < split_quantity_new)
11288 {
11289 split_quantity_new = new_item.GetQuantityMax();
11290 }
11291
11292 new_item.SetResultOfSplit(true);
11293 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11294
11296 {
11299 }
11300 else
11301 {
11304 }
11305 }
11306 }
11307
11309 {
11311 return;
11312
11314 float split_quantity_new = Math.Floor(quantity / 2);
11315
11316 InventoryLocation invloc = new InventoryLocation;
11318
11320 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11321
11322 if (new_item)
11323 {
11324 if (new_item.GetQuantityMax() < split_quantity_new)
11325 {
11326 split_quantity_new = new_item.GetQuantityMax();
11327 }
11329 {
11332 }
11333 else
11334 {
11337 }
11338 }
11339 }
11340
11343 {
11344 SetWeightDirty();
11346
11347 if (parent)
11348 parent.OnAttachmentQuantityChangedEx(this, delta);
11349
11351 {
11353 {
11355 }
11357 {
11358 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11360 }
11361 }
11362
11363 }
11364
11367 {
11368
11369 }
11370
11373 {
11375 }
11376
11378 {
11379 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11380
11382 {
11383 if (newLevel == GameConstants.STATE_RUINED)
11384 {
11386 EntityAI parent = GetHierarchyParent();
11387 if (parent && parent.IsFireplace())
11388 {
11389 CargoBase cargo = GetInventory().GetCargo();
11390 if (cargo)
11391 {
11393 {
11395 }
11396 }
11397 }
11398 }
11399
11401 {
11402
11404 return;
11405 }
11406
11407 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11408 {
11410 }
11411 }
11412 }
11413
11414
11416 {
11417 super.OnRightClick();
11418
11420 {
11422 {
11423 if (ScriptInputUserData.CanStoreInputUserData())
11424 {
11425 vector m4[4];
11427
11428 EntityAI root = GetHierarchyRoot();
11429
11430 InventoryLocation dst = new InventoryLocation;
11432 {
11433 if (root)
11434 {
11435 root.GetTransform(m4);
11437 }
11438 else
11439 GetInventory().GetCurrentInventoryLocation(dst);
11440 }
11441 else
11442 {
11444
11445
11446 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11447 {
11448 if (root)
11449 {
11450 root.GetTransform(m4);
11452 }
11453 else
11454 GetInventory().GetCurrentInventoryLocation(dst);
11455 }
11456 else
11457 {
11458 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11459 }
11460 }
11461
11462 ScriptInputUserData ctx = new ScriptInputUserData;
11470 }
11471 }
11472 else if (!
GetGame().IsMultiplayer())
11473 {
11475 }
11476 }
11477 }
11478
11479 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11480 {
11481
11482 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11483 return false;
11484
11485 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11486 return false;
11487
11488
11490 return false;
11491
11492
11493 Magazine mag = Magazine.Cast(this);
11494 if (mag)
11495 {
11496 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11497 return false;
11498
11499 if (stack_max_limit)
11500 {
11501 Magazine other_mag = Magazine.Cast(other_item);
11502 if (other_item)
11503 {
11504 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11505 return false;
11506 }
11507
11508 }
11509 }
11510 else
11511 {
11512
11514 return false;
11515
11517 return false;
11518 }
11519
11520 PlayerBase player = null;
11521 if (CastTo(player, GetHierarchyRootPlayer()))
11522 {
11523 if (player.GetInventory().HasAttachment(this))
11524 return false;
11525
11526 if (player.IsItemsToDelete())
11527 return false;
11528 }
11529
11530 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11531 return false;
11532
11533 int slotID;
11535 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11536 return false;
11537
11538 return true;
11539 }
11540
11542 {
11544 }
11545
11547 {
11548 return m_IsResultOfSplit;
11549 }
11550
11552 {
11553 m_IsResultOfSplit = value;
11554 }
11555
11557 {
11559 }
11560
11562 {
11563 float other_item_quantity = other_item.GetQuantity();
11564 float this_free_space;
11565
11567
11569
11570 if (other_item_quantity > this_free_space)
11571 {
11572 return this_free_space;
11573 }
11574 else
11575 {
11576 return other_item_quantity;
11577 }
11578 }
11579
11581 {
11583 }
11584
11586 {
11588 return;
11589
11590 if (!IsMagazine() && other_item)
11591 {
11593 if (quantity_used != 0)
11594 {
11595 float hp1 = GetHealth01("","");
11596 float hp2 = other_item.GetHealth01("","");
11597 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11598 hpResult = hpResult / (
GetQuantity() + quantity_used);
11599
11600 hpResult *= GetMaxHealth();
11601 Math.Round(hpResult);
11602 SetHealth("", "Health", hpResult);
11603
11605 other_item.AddQuantity(-quantity_used);
11606 }
11607 }
11609 }
11610
11612 {
11613 #ifdef SERVER
11614 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11615 GetHierarchyParent().IncreaseLifetimeUp();
11616 #endif
11617 };
11618
11620 {
11621 PlayerBase p = PlayerBase.Cast(player);
11622
11623 array<int> recipesIds = p.m_Recipes;
11624 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11625 if (moduleRecipesManager)
11626 {
11627 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11628 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11629 }
11630
11631 for (int i = 0;i < recipesIds.Count(); i++)
11632 {
11633 int key = recipesIds.Get(i);
11634 string recipeName = moduleRecipesManager.GetRecipeName(key);
11636 }
11637 }
11638
11639
11640 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11641 {
11642 super.GetDebugActions(outputList);
11643
11644
11649
11650
11654
11658
11659
11662
11663
11665 {
11668 }
11669
11671
11674
11678 }
11679
11680
11681
11682
11684 {
11685 super.OnAction(action_id, player, ctx);
11686 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11687 {
11688 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11689 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11690 PlayerBase p = PlayerBase.Cast(player);
11691 if (
EActions.RECIPES_RANGE_START < 1000)
11692 {
11693 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11694 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11695 }
11696 }
11697 #ifndef SERVER
11698 else if (action_id ==
EActions.WATCH_PLAYER)
11699 {
11700 PluginDeveloper.SetDeveloperItemClientEx(player);
11701 }
11702 #endif
11704 {
11705 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11706 {
11707 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11708 OnDebugButtonPressServer(id + 1);
11709 }
11710
11711 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11712 {
11713 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11715 }
11716
11717 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11718 {
11719 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11721 }
11722
11723 else if (action_id ==
EActions.ADD_QUANTITY)
11724 {
11725 if (IsMagazine())
11726 {
11727 Magazine mag = Magazine.Cast(this);
11728 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11729 }
11730 else
11731 {
11733 }
11734
11735 if (m_EM)
11736 {
11737 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11738 }
11739
11740 }
11741
11742 else if (action_id ==
EActions.REMOVE_QUANTITY)
11743 {
11744 if (IsMagazine())
11745 {
11746 Magazine mag2 = Magazine.Cast(this);
11747 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11748 }
11749 else
11750 {
11752 }
11753 if (m_EM)
11754 {
11755 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11756 }
11757
11758 }
11759
11760 else if (action_id ==
EActions.SET_QUANTITY_0)
11761 {
11763
11764 if (m_EM)
11765 {
11766 m_EM.SetEnergy(0);
11767 }
11768 }
11769
11770 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11771 {
11773
11774 if (m_EM)
11775 {
11776 m_EM.SetEnergy(m_EM.GetEnergyMax());
11777 }
11778 }
11779
11780 else if (action_id ==
EActions.ADD_HEALTH)
11781 {
11782 AddHealth("","",GetMaxHealth("","Health")/5);
11783 }
11784 else if (action_id ==
EActions.REMOVE_HEALTH)
11785 {
11786 AddHealth("","",-GetMaxHealth("","Health")/5);
11787 }
11788 else if (action_id ==
EActions.DESTROY_HEALTH)
11789 {
11790 SetHealth01("","",0);
11791 }
11792 else if (action_id ==
EActions.WATCH_ITEM)
11793 {
11795 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11796 #ifdef DEVELOPER
11797 SetDebugDeveloper_item(this);
11798 #endif
11799 }
11800
11801 else if (action_id ==
EActions.ADD_TEMPERATURE)
11802 {
11803 AddTemperature(20);
11804
11805 }
11806
11807 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11808 {
11809 AddTemperature(-20);
11810
11811 }
11812
11813 else if (action_id ==
EActions.FLIP_FROZEN)
11814 {
11815 SetFrozen(!GetIsFrozen());
11816
11817 }
11818
11819 else if (action_id ==
EActions.ADD_WETNESS)
11820 {
11822
11823 }
11824
11825 else if (action_id ==
EActions.REMOVE_WETNESS)
11826 {
11828
11829 }
11830
11831 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11832 {
11835
11836
11837 }
11838
11839 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11840 {
11843 }
11844
11845 else if (action_id ==
EActions.MAKE_SPECIAL)
11846 {
11847 auto debugParams = DebugSpawnParams.WithPlayer(player);
11848 OnDebugSpawnEx(debugParams);
11849 }
11850
11851 else if (action_id ==
EActions.DELETE)
11852 {
11853 Delete();
11854 }
11855
11856 }
11857
11858
11859 return false;
11860 }
11861
11862
11863
11864
11868
11871
11872
11873
11875 {
11876 return false;
11877 }
11878
11879
11881 {
11882 return true;
11883 }
11884
11885
11887 {
11888 return true;
11889 }
11890
11891
11892
11894 {
11895 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11897 }
11898
11901 {
11902 return null;
11903 }
11904
11906 {
11907 return false;
11908 }
11909
11911 {
11912 return false;
11913 }
11914
11918
11919
11921 {
11922 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11923 return module_repairing.CanRepair(this, item_repair_kit);
11924 }
11925
11926
11927 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11928 {
11929 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11930 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11931 }
11932
11933
11935 {
11936
11937
11938
11939
11940
11941
11942
11943
11944 return 1;
11945 }
11946
11947
11948
11950 {
11952 }
11953
11954
11955
11957 {
11959 }
11960
11961
11970 {
11971 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11972
11973 if (player)
11974 {
11975 player.MessageStatus(text);
11976 }
11977 }
11978
11979
11988 {
11989 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11990
11991 if (player)
11992 {
11993 player.MessageAction(text);
11994 }
11995 }
11996
11997
12006 {
12007 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12008
12009 if (player)
12010 {
12011 player.MessageFriendly(text);
12012 }
12013 }
12014
12015
12024 {
12025 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12026
12027 if (player)
12028 {
12029 player.MessageImportant(text);
12030 }
12031 }
12032
12034 {
12035 return true;
12036 }
12037
12038
12039 override bool KindOf(
string tag)
12040 {
12041 bool found = false;
12042 string item_name = this.
GetType();
12045
12046 int array_size = item_tag_array.Count();
12047 for (int i = 0; i < array_size; i++)
12048 {
12049 if (item_tag_array.Get(i) == tag)
12050 {
12051 found = true;
12052 break;
12053 }
12054 }
12055 return found;
12056 }
12057
12058
12060 {
12061
12062 super.OnRPC(sender, rpc_type,ctx);
12063
12064
12065 switch (rpc_type)
12066 {
12067 #ifndef SERVER
12068 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12069 Param2<bool, string> p = new Param2<bool, string>(false, "");
12070
12072 return;
12073
12074 bool play = p.param1;
12075 string soundSet = p.param2;
12076
12077 if (play)
12078 {
12080 {
12082 {
12084 }
12085 }
12086 else
12087 {
12089 }
12090 }
12091 else
12092 {
12094 }
12095
12096 break;
12097 #endif
12098
12099 }
12100
12102 {
12104 }
12105 }
12106
12107
12108
12109
12111 {
12112 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12113 return plugin.GetID(
name);
12114 }
12115
12117 {
12118 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12119 return plugin.GetName(id);
12120 }
12121
12124 {
12125
12126
12127 int varFlags;
12128 if (!ctx.
Read(varFlags))
12129 return;
12130
12131 if (varFlags & ItemVariableFlags.FLOAT)
12132 {
12134 }
12135 }
12136
12138 {
12139
12140 super.SerializeNumericalVars(floats_out);
12141
12142
12143
12145 {
12147 }
12148
12150 {
12152 }
12153
12155 {
12157 }
12158
12160 {
12165 }
12166
12168 {
12170 }
12171 }
12172
12174 {
12175
12176 super.DeSerializeNumericalVars(floats);
12177
12178
12179 int index = 0;
12180 int mask = Math.Round(floats.Get(index));
12181
12182 index++;
12183
12185 {
12187 {
12189 }
12190 else
12191 {
12192 float quantity = floats.Get(index);
12193 SetQuantity(quantity,
true,
false,
false,
false);
12194 }
12195 index++;
12196 }
12197
12199 {
12200 float wet = floats.Get(index);
12202 index++;
12203 }
12204
12206 {
12207 int liquidtype = Math.Round(floats.Get(index));
12209 index++;
12210 }
12211
12213 {
12215 index++;
12217 index++;
12219 index++;
12221 index++;
12222 }
12223
12225 {
12226 int cleanness = Math.Round(floats.Get(index));
12228 index++;
12229 }
12230 }
12231
12233 {
12234 super.WriteVarsToCTX(ctx);
12235
12236
12238 {
12240 }
12241
12243 {
12245 }
12246
12248 {
12250 }
12251
12253 {
12254 int r,g,b,a;
12260 }
12261
12263 {
12265 }
12266 }
12267
12269 {
12270 if (!super.ReadVarsFromCTX(ctx,version))
12271 return false;
12272
12273 int intValue;
12274 float value;
12275
12276 if (version < 140)
12277 {
12278 if (!ctx.
Read(intValue))
12279 return false;
12280
12281 m_VariablesMask = intValue;
12282 }
12283
12285 {
12286 if (!ctx.
Read(value))
12287 return false;
12288
12290 {
12292 }
12293 else
12294 {
12296 }
12297 }
12298
12299 if (version < 140)
12300 {
12302 {
12303 if (!ctx.
Read(value))
12304 return false;
12305 SetTemperatureDirect(value);
12306 }
12307 }
12308
12310 {
12311 if (!ctx.
Read(value))
12312 return false;
12314 }
12315
12317 {
12318 if (!ctx.
Read(intValue))
12319 return false;
12321 }
12322
12324 {
12325 int r,g,b,a;
12327 return false;
12329 return false;
12331 return false;
12333 return false;
12334
12336 }
12337
12339 {
12340 if (!ctx.
Read(intValue))
12341 return false;
12343 }
12344
12345 if (version >= 138 && version < 140)
12346 {
12348 {
12349 if (!ctx.
Read(intValue))
12350 return false;
12351 SetFrozen(intValue);
12352 }
12353 }
12354
12355 return true;
12356 }
12357
12358
12360 {
12363 {
12365 }
12366
12367 if (!super.OnStoreLoad(ctx, version))
12368 {
12370 return false;
12371 }
12372
12373 if (version >= 114)
12374 {
12375 bool hasQuickBarIndexSaved;
12376
12377 if (!ctx.
Read(hasQuickBarIndexSaved))
12378 {
12380 return false;
12381 }
12382
12383 if (hasQuickBarIndexSaved)
12384 {
12385 int itmQBIndex;
12386
12387
12388 if (!ctx.
Read(itmQBIndex))
12389 {
12391 return false;
12392 }
12393
12394 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12395 if (itmQBIndex != -1 && parentPlayer)
12396 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12397 }
12398 }
12399 else
12400 {
12401
12402 PlayerBase player;
12403 int itemQBIndex;
12404 if (version ==
int.
MAX)
12405 {
12406 if (!ctx.
Read(itemQBIndex))
12407 {
12409 return false;
12410 }
12411 }
12412 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12413 {
12414
12415 if (!ctx.
Read(itemQBIndex))
12416 {
12418 return false;
12419 }
12420 if (itemQBIndex != -1 && player)
12421 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12422 }
12423 }
12424
12425 if (version < 140)
12426 {
12427
12428 if (!LoadVariables(ctx, version))
12429 {
12431 return false;
12432 }
12433 }
12434
12435
12437 {
12439 return false;
12440 }
12441 if (version >= 132)
12442 {
12444 if (raib)
12445 {
12447 {
12449 return false;
12450 }
12451 }
12452 }
12453
12455 return true;
12456 }
12457
12458
12459
12461 {
12462 super.OnStoreSave(ctx);
12463
12464 PlayerBase player;
12465 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12466 {
12468
12469 int itemQBIndex = -1;
12470 itemQBIndex = player.FindQuickBarEntityIndex(this);
12471 ctx.
Write(itemQBIndex);
12472 }
12473 else
12474 {
12476 }
12477
12479
12481 if (raib)
12482 {
12484 }
12485 }
12486
12487
12489 {
12490 super.AfterStoreLoad();
12491
12493 {
12495 }
12496
12498 {
12501 }
12502 }
12503
12505 {
12506 super.EEOnAfterLoad();
12507
12509 {
12511 }
12512
12515 }
12516
12518 {
12519 return false;
12520 }
12521
12522
12523
12525 {
12527 {
12528 #ifdef PLATFORM_CONSOLE
12529
12531 {
12533 if (menu)
12534 {
12536 }
12537 }
12538 #endif
12539 }
12540
12542 {
12545 }
12546
12548 {
12549 SetWeightDirty();
12551 }
12553 {
12556 }
12557
12559 {
12562 }
12564 {
12567 }
12568
12569 super.OnVariablesSynchronized();
12570 }
12571
12572
12573
12575 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12576 {
12577 if (!IsServerCheck(allow_client))
12578 return false;
12579
12581 return false;
12582
12585
12586 if (value <= (min + 0.001))
12587 value = min;
12588
12589 if (value == min)
12590 {
12591 if (destroy_config)
12592 {
12593 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12594 if (dstr)
12595 {
12597 this.Delete();
12598 return true;
12599 }
12600 }
12601 else if (destroy_forced)
12602 {
12604 this.Delete();
12605 return true;
12606 }
12607
12609 }
12610
12613
12615 {
12617
12618 if (delta)
12620 }
12621
12623
12624 return false;
12625 }
12626
12627
12629 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12630 {
12632 }
12633
12635 {
12638 }
12639
12641 {
12644 }
12645
12648 {
12649 float value_clamped = Math.Clamp(value, 0, 1);
12651 SetQuantity(result, destroy_config, destroy_forced);
12652 }
12653
12654
12657 {
12659 }
12660
12662 {
12664 }
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12676 {
12677 int slot = -1;
12678 if (GetInventory())
12679 {
12680 InventoryLocation il = new InventoryLocation;
12681 GetInventory().GetCurrentInventoryLocation(il);
12683 }
12684
12686 }
12687
12689 {
12690 float quantity_max = 0;
12691
12693 {
12694 if (attSlotID != -1)
12695 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12696
12697 if (quantity_max <= 0)
12699 }
12700
12701 if (quantity_max <= 0)
12703
12704 return quantity_max;
12705 }
12706
12708 {
12710 }
12711
12713 {
12715 }
12716
12717
12719 {
12721 }
12722
12724 {
12726 }
12727
12729 {
12731 }
12732
12733
12735 {
12736
12737 float weightEx = GetWeightEx();
12738 float special = GetInventoryAndCargoWeight();
12739 return weightEx - special;
12740 }
12741
12742
12744 {
12746 }
12747
12749 {
12751 {
12752 #ifdef DEVELOPER
12753 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12754 {
12755 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12757 }
12758 #endif
12759
12760 return GetQuantity() * GetConfigWeightModified();
12761 }
12762 else if (HasEnergyManager())
12763 {
12764 #ifdef DEVELOPER
12765 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12766 {
12767 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12768 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12769 }
12770 #endif
12771 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12772 }
12773 else
12774 {
12775 #ifdef DEVELOPER
12776 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12777 {
12778 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12779 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12780 }
12781 #endif
12782 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12783 }
12784 }
12785
12788 {
12789 int item_count = 0;
12791
12792 if (GetInventory().GetCargo() != NULL)
12793 {
12794 item_count = GetInventory().GetCargo().GetItemCount();
12795 }
12796
12797 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12798 {
12799 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12800 if (item)
12801 item_count += item.GetNumberOfItems();
12802 }
12803 return item_count;
12804 }
12805
12808 {
12809 float weight = 0;
12810 float wetness = 1;
12811 if (include_wetness)
12814 {
12815 weight = wetness * m_ConfigWeight;
12816 }
12818 {
12819 weight = 1;
12820 }
12821 return weight;
12822 }
12823
12824
12825
12827 {
12828 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12829 {
12830 GameInventory inv = GetInventory();
12831 array<EntityAI> items = new array<EntityAI>;
12833 for (int i = 0; i < items.Count(); i++)
12834 {
12836 if (item)
12837 {
12839 }
12840 }
12841 }
12842 }
12843
12844
12845
12846
12848 {
12849 float energy = 0;
12850 if (HasEnergyManager())
12851 {
12852 energy = GetCompEM().GetEnergy();
12853 }
12854 return energy;
12855 }
12856
12857
12859 {
12860 super.OnEnergyConsumed();
12861
12863 }
12864
12866 {
12867 super.OnEnergyAdded();
12868
12870 }
12871
12872
12874 {
12875 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12876 {
12878 {
12879 float energy_0to1 = GetCompEM().GetEnergy0To1();
12881 }
12882 }
12883 }
12884
12885
12887 {
12888 return ConfigGetFloat("heatIsolation");
12889 }
12890
12892 {
12894 }
12895
12897 {
12898 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12899 if (
GetGame().ConfigIsExisting(paramPath))
12901
12902 return 0.0;
12903 }
12904
12906 {
12907 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12908 if (
GetGame().ConfigIsExisting(paramPath))
12910
12911 return 0.0;
12912 }
12913
12914 override void SetWet(
float value,
bool allow_client =
false)
12915 {
12916 if (!IsServerCheck(allow_client))
12917 return;
12918
12921
12923
12924 m_VarWet = Math.Clamp(value, min, max);
12925
12927 {
12930 }
12931 }
12932
12933 override void AddWet(
float value)
12934 {
12936 }
12937
12939 {
12941 }
12942
12944 {
12946 }
12947
12949 {
12951 }
12952
12954 {
12956 }
12957
12959 {
12961 }
12962
12963 override void OnWetChanged(
float newVal,
float oldVal)
12964 {
12967 if (newLevel != oldLevel)
12968 {
12970 }
12971 }
12972
12974 {
12975 SetWeightDirty();
12976 }
12977
12979 {
12980 return GetWetLevelInternal(
m_VarWet);
12981 }
12982
12983
12984
12986 {
12988 }
12989
12991 {
12993 }
12994
12996 {
12998 }
12999
13001 {
13003 }
13004
13005
13006
13008 {
13009 if (ConfigIsExisting("itemModelLength"))
13010 {
13011 return ConfigGetFloat("itemModelLength");
13012 }
13013 return 0;
13014 }
13015
13017 {
13018 if (ConfigIsExisting("itemAttachOffset"))
13019 {
13020 return ConfigGetFloat("itemAttachOffset");
13021 }
13022 return 0;
13023 }
13024
13025 override void SetCleanness(
int value,
bool allow_client =
false)
13026 {
13027 if (!IsServerCheck(allow_client))
13028 return;
13029
13031
13033
13036 }
13037
13039 {
13041 }
13042
13044 {
13045 return true;
13046 }
13047
13048
13049
13050
13052 {
13054 }
13055
13057 {
13059 }
13060
13061
13062
13063
13064 override void SetColor(
int r,
int g,
int b,
int a)
13065 {
13071 }
13073 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13074 {
13079 }
13080
13082 {
13084 }
13085
13088 {
13089 int r,g,b,a;
13091 r = r/255;
13092 g = g/255;
13093 b = b/255;
13094 a = a/255;
13095 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13096 }
13097
13098
13099
13100 override void SetLiquidType(
int value,
bool allow_client =
false)
13101 {
13102 if (!IsServerCheck(allow_client))
13103 return;
13104
13109 }
13110
13112 {
13113 return ConfigGetInt("varLiquidTypeInit");
13114 }
13115
13117 {
13119 }
13120
13122 {
13124 SetFrozen(false);
13125 }
13126
13129 {
13130 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13131 }
13132
13133
13136 {
13137 PlayerBase nplayer;
13138 if (PlayerBase.CastTo(nplayer, player))
13139 {
13141
13142 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13143 }
13144 }
13145
13146
13149 {
13150 PlayerBase nplayer;
13151 if (PlayerBase.CastTo(nplayer,player))
13152 {
13153
13154 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13155
13156 }
13157
13158
13159 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13160
13161
13162 if (HasEnergyManager())
13163 {
13164 GetCompEM().UpdatePlugState();
13165 }
13166 }
13167
13168
13170 {
13171 super.OnPlacementStarted(player);
13172
13174 }
13175
13176 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13177 {
13179 {
13180 m_AdminLog.OnPlacementComplete(player,
this);
13181 }
13182
13183 super.OnPlacementComplete(player, position, orientation);
13184 }
13185
13186
13187
13188
13189
13191 {
13193 {
13194 return true;
13195 }
13196 else
13197 {
13198 return false;
13199 }
13200 }
13201
13202
13204 {
13206 {
13208 }
13209 }
13210
13211
13213 {
13215 }
13216
13218 {
13220 }
13221
13222 override void InsertAgent(
int agent,
float count = 1)
13223 {
13224 if (count < 1)
13225 return;
13226
13228 }
13229
13232 {
13234 }
13235
13236
13238 {
13240 }
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13284 {
13286 return false;
13287 return true;
13288 }
13289
13291 {
13292
13294 }
13295
13296
13299 {
13300 super.CheckForRoofLimited(timeTresholdMS);
13301
13303 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13304 {
13305 m_PreviousRoofTestTime = time;
13306 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13307 }
13308 }
13309
13310
13312 {
13314 {
13315 return 0;
13316 }
13317
13318 if (GetInventory().GetAttachmentSlotsCount() != 0)
13319 {
13320 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13321 if (filter)
13322 return filter.GetProtectionLevel(type, false, system);
13323 else
13324 return 0;
13325 }
13326
13327 string subclassPath, entryName;
13328
13329 switch (type)
13330 {
13332 entryName = "biological";
13333 break;
13335 entryName = "chemical";
13336 break;
13337 default:
13338 entryName = "biological";
13339 break;
13340 }
13341
13342 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13343
13345 }
13346
13347
13348
13351 {
13352 if (!IsMagazine())
13354
13356 }
13357
13358
13359
13360
13361
13366 {
13367 return true;
13368 }
13369
13371 {
13373 }
13374
13375
13376
13377
13378
13380 {
13381 if (parent)
13382 {
13383 if (parent.IsInherited(DayZInfected))
13384 return true;
13385
13386 if (!parent.IsRuined())
13387 return true;
13388 }
13389
13390 return true;
13391 }
13392
13394 {
13395 if (!super.CanPutAsAttachment(parent))
13396 {
13397 return false;
13398 }
13399
13400 if (!IsRuined() && !parent.IsRuined())
13401 {
13402 return true;
13403 }
13404
13405 return false;
13406 }
13407
13409 {
13410
13411
13412
13413
13414 return super.CanReceiveItemIntoCargo(item);
13415 }
13416
13418 {
13419
13420
13421
13422
13423 GameInventory attachmentInv = attachment.GetInventory();
13425 {
13426 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13427 return false;
13428 }
13429
13430 InventoryLocation loc = new InventoryLocation();
13431 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13432 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13433 return false;
13434
13435 return super.CanReceiveAttachment(attachment, slotId);
13436 }
13437
13439 {
13440 if (!super.CanReleaseAttachment(attachment))
13441 return false;
13442
13443 return GetInventory().AreChildrenAccessible();
13444 }
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13467 {
13468 int id = muzzle_owner.GetMuzzleID();
13469 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13470
13471 if (WPOF_array)
13472 {
13473 for (int i = 0; i < WPOF_array.Count(); i++)
13474 {
13475 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13476
13477 if (WPOF)
13478 {
13479 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13480 }
13481 }
13482 }
13483 }
13484
13485
13487 {
13488 int id = muzzle_owner.GetMuzzleID();
13490
13491 if (WPOBE_array)
13492 {
13493 for (int i = 0; i < WPOBE_array.Count(); i++)
13494 {
13495 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13496
13497 if (WPOBE)
13498 {
13499 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13500 }
13501 }
13502 }
13503 }
13504
13505
13507 {
13508 int id = muzzle_owner.GetMuzzleID();
13509 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13510
13511 if (WPOOH_array)
13512 {
13513 for (int i = 0; i < WPOOH_array.Count(); i++)
13514 {
13515 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13516
13517 if (WPOOH)
13518 {
13519 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13520 }
13521 }
13522 }
13523 }
13524
13525
13527 {
13528 int id = muzzle_owner.GetMuzzleID();
13529 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13530
13531 if (WPOOH_array)
13532 {
13533 for (int i = 0; i < WPOOH_array.Count(); i++)
13534 {
13535 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13536
13537 if (WPOOH)
13538 {
13539 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13540 }
13541 }
13542 }
13543 }
13544
13545
13547 {
13548 int id = muzzle_owner.GetMuzzleID();
13549 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13550
13551 if (WPOOH_array)
13552 {
13553 for (int i = 0; i < WPOOH_array.Count(); i++)
13554 {
13555 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13556
13557 if (WPOOH)
13558 {
13559 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13560 }
13561 }
13562 }
13563 }
13564
13565
13566
13568 {
13570 {
13571 return true;
13572 }
13573
13574 return false;
13575 }
13576
13578 {
13580 {
13581 return true;
13582 }
13583
13584 return false;
13585 }
13586
13588 {
13590 {
13591 return true;
13592 }
13593
13594 return false;
13595 }
13596
13598 {
13599 return false;
13600 }
13601
13604 {
13605 return UATimeSpent.DEFAULT_DEPLOY;
13606 }
13607
13608
13609
13610
13612 {
13614 SetSynchDirty();
13615 }
13616
13618 {
13620 }
13621
13622
13624 {
13625 return false;
13626 }
13627
13630 {
13631 string att_type = "None";
13632
13633 if (ConfigIsExisting("soundAttType"))
13634 {
13635 att_type = ConfigGetString("soundAttType");
13636 }
13637
13639 }
13640
13642 {
13644 }
13645
13646
13647
13648
13649
13653
13655 {
13658
13660 }
13661
13662
13664 {
13666 return;
13667
13669
13672
13675
13676 SoundParameters params = new SoundParameters();
13680 }
13681
13682
13684 {
13686 return;
13687
13689 SetSynchDirty();
13690
13693 }
13694
13695
13697 {
13699 return;
13700
13702 SetSynchDirty();
13703
13706 }
13707
13709 {
13711 }
13712
13714 {
13716 }
13717
13720 {
13721 if (!
GetGame().IsDedicatedServer())
13722 {
13723 if (ConfigIsExisting("attachSoundSet"))
13724 {
13725 string cfg_path = "";
13726 string soundset = "";
13727 string type_name =
GetType();
13728
13731 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13732 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13733
13734 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13735 {
13736 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13737 {
13738 if (cfg_slot_array[i] == slot_type)
13739 {
13740 soundset = cfg_soundset_array[i];
13741 break;
13742 }
13743 }
13744 }
13745
13746 if (soundset != "")
13747 {
13748 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13750 }
13751 }
13752 }
13753 }
13754
13756 {
13757
13758 }
13759
13760 void OnApply(PlayerBase player);
13761
13763 {
13764 return 1.0;
13765 };
13766
13768 {
13770 }
13771
13773 {
13775 }
13776
13778
13780 {
13781 SetDynamicPhysicsLifeTime(0.01);
13783 }
13784
13786 {
13787 array<string> zone_names = new array<string>;
13788 GetDamageZones(zone_names);
13789 for (int i = 0; i < zone_names.Count(); i++)
13790 {
13791 SetHealthMax(zone_names.Get(i),"Health");
13792 }
13793 SetHealthMax("","Health");
13794 }
13795
13798 {
13799 float global_health = GetHealth01("","Health");
13800 array<string> zones = new array<string>;
13801 GetDamageZones(zones);
13802
13803 for (int i = 0; i < zones.Count(); i++)
13804 {
13805 SetHealth01(zones.Get(i),"Health",global_health);
13806 }
13807 }
13808
13811 {
13812 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13813 }
13814
13816 {
13817 if (!hasRootAsPlayer)
13818 {
13819 if (refParentIB)
13820 {
13821
13822 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13823 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13824
13825 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13826 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13827
13830 }
13831 else
13832 {
13833
13836 }
13837 }
13838 }
13839
13841 {
13843 {
13844 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13845 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13846 {
13847 float heatPermCoef = 1.0;
13849 while (ent)
13850 {
13851 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13852 ent = ent.GetHierarchyParent();
13853 }
13854
13855 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13856 }
13857 }
13858 }
13859
13861 {
13862
13863 EntityAI parent = GetHierarchyParent();
13864 if (!parent)
13865 {
13866 hasParent = false;
13867 hasRootAsPlayer = false;
13868 }
13869 else
13870 {
13871 hasParent = true;
13872 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13873 refParentIB =
ItemBase.Cast(parent);
13874 }
13875 }
13876
13877 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13878 {
13879
13880 }
13881
13883 {
13884
13885 return false;
13886 }
13887
13889 {
13890
13891
13892 return false;
13893 }
13894
13896 {
13897
13898 return false;
13899 }
13900
13903 {
13904 return !GetIsFrozen() &&
IsOpen();
13905 }
13906
13908 {
13909 bool hasParent = false, hasRootAsPlayer = false;
13911
13912 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13913 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13914
13915 if (wwtu || foodDecay)
13916 {
13920
13921 if (processWetness || processTemperature || processDecay)
13922 {
13924
13925 if (processWetness)
13926 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13927
13928 if (processTemperature)
13930
13931 if (processDecay)
13932 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13933 }
13934 }
13935 }
13936
13939 {
13941 }
13942
13944 {
13947
13948 return super.GetTemperatureFreezeThreshold();
13949 }
13950
13952 {
13955
13956 return super.GetTemperatureThawThreshold();
13957 }
13958
13960 {
13963
13964 return super.GetItemOverheatThreshold();
13965 }
13966
13968 {
13970 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13971
13972 return super.GetTemperatureFreezeTime();
13973 }
13974
13976 {
13978 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13979
13980 return super.GetTemperatureThawTime();
13981 }
13982
13987
13989 {
13990 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13991 }
13992
13994 {
13995 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13996 }
13997
14000 {
14002 }
14003
14005 {
14007 }
14008
14010 {
14012 }
14013
14016 {
14017 return null;
14018 }
14019
14022 {
14023 return false;
14024 }
14025
14027 {
14029 {
14032 if (!trg)
14033 {
14035 explosive = this;
14036 }
14037
14038 explosive.PairRemote(trg);
14040
14041 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14042 trg.SetPersistentPairID(persistentID);
14043 explosive.SetPersistentPairID(persistentID);
14044
14045 return true;
14046 }
14047 return false;
14048 }
14049
14052 {
14053 float ret = 1.0;
14056 ret *= GetHealth01();
14057
14058 return ret;
14059 }
14060
14061 #ifdef DEVELOPER
14062 override void SetDebugItem()
14063 {
14064 super.SetDebugItem();
14065 _itemBase = this;
14066 }
14067
14069 {
14070 string text = super.GetDebugText();
14071
14073 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14074
14075 return text;
14076 }
14077 #endif
14078
14080 {
14081 return true;
14082 }
14083
14085
14087
14089 {
14092 }
14093
14094
14102
14118}
14119
14121{
14123 if (entity)
14124 {
14125 bool is_item = entity.IsInherited(
ItemBase);
14126 if (is_item && full_quantity)
14127 {
14130 }
14131 }
14132 else
14133 {
14135 return NULL;
14136 }
14137 return entity;
14138}
14139
14141{
14142 if (item)
14143 {
14144 if (health > 0)
14145 item.SetHealth("", "", health);
14146
14147 if (item.CanHaveTemperature())
14148 {
14150 if (item.CanFreeze())
14151 item.SetFrozen(false);
14152 }
14153
14154 if (item.HasEnergyManager())
14155 {
14156 if (quantity >= 0)
14157 {
14158 item.GetCompEM().SetEnergy0To1(quantity);
14159 }
14160 else
14161 {
14163 }
14164 }
14165 else if (item.IsMagazine())
14166 {
14167 Magazine mag = Magazine.Cast(item);
14168 if (quantity >= 0)
14169 {
14170 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14171 }
14172 else
14173 {
14175 }
14176
14177 }
14178 else
14179 {
14180 if (quantity >= 0)
14181 {
14182 item.SetQuantityNormalized(quantity, false);
14183 }
14184 else
14185 {
14187 }
14188
14189 }
14190 }
14191}
14192
14193#ifdef DEVELOPER
14195#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.