9202{
9204 {
9205 return true;
9206 }
9207};
9208
9209
9210
9212{
9216
9218
9221
9222
9223
9224
9225
9234
9240
9245
9250
9271 protected bool m_IsResultOfSplit
9272
9274
9279
9280
9281
9283
9287
9288
9289
9291
9294
9295
9296
9302
9303
9311
9314
9315
9317
9318
9320
9321
9326
9327
9332
9333
9335
9336
9338 {
9343
9344 if (!
GetGame().IsDedicatedServer())
9345 {
9347 {
9349
9351 {
9353 }
9354 }
9355
9358 }
9359
9360 m_OldLocation = null;
9361
9363 {
9365 }
9366
9367 if (ConfigIsExisting("headSelectionsToHide"))
9368 {
9371 }
9372
9374 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9375 {
9377 }
9378
9380
9381 m_IsResultOfSplit = false;
9382
9384 }
9385
9387 {
9388 super.InitItemVariables();
9389
9395 m_Count = ConfigGetInt(
"count");
9396
9399
9404
9407
9412
9424
9428
9429
9432 if (ConfigIsExisting("canBeSplit"))
9433 {
9436 }
9437
9439 if (ConfigIsExisting("itemBehaviour"))
9441
9442
9445 RegisterNetSyncVariableInt("m_VarLiquidType");
9446 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9447
9448 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9449 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9450 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9451
9452 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9453 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9454 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9455 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9456
9457 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9458 RegisterNetSyncVariableBool("m_IsTakeable");
9459 RegisterNetSyncVariableBool("m_IsHologram");
9460
9463 {
9466 }
9467
9469
9471 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9473
9474 }
9475
9477 {
9479 }
9480
9482 {
9485 {
9490 }
9491 }
9492
9493 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9494 {
9496 {
9499 }
9500
9502 }
9503
9505 {
9511 }
9512
9514
9516 {
9518
9519 if (!action)
9520 {
9521 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9522 return;
9523 }
9524
9526 if (!ai)
9527 {
9529 return;
9530 }
9531
9533 if (!action_array)
9534 {
9535 action_array = new array<ActionBase_Basic>;
9537 }
9538 if (LogManager.IsActionLogEnable())
9539 {
9540 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9541 }
9542
9543 if (action_array.Find(action) != -1)
9544 {
9545 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9546 }
9547 else
9548 {
9549 action_array.Insert(action);
9550 }
9551 }
9552
9554 {
9556 ActionBase action = player.GetActionManager().GetAction(actionName);
9559
9560 if (action_array)
9561 {
9562 action_array.RemoveItem(action);
9563 }
9564 }
9565
9566
9567
9569 {
9570 ActionOverrideData overrideData = new ActionOverrideData();
9574
9576 if (!actionMap)
9577 {
9580 }
9581
9582 actionMap.Insert(this.
Type(), overrideData);
9583
9584 }
9585
9587
9589
9590
9592 {
9595
9598
9599 string config_to_search = "CfgVehicles";
9600 string muzzle_owner_config;
9601
9603 {
9604 if (IsInherited(Weapon))
9605 config_to_search = "CfgWeapons";
9606
9607 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9608
9609 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9610
9612
9613 if (config_OnFire_subclass_count > 0)
9614 {
9615 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9616
9617 for (int i = 0; i < config_OnFire_subclass_count; i++)
9618 {
9619 string particle_class = "";
9621 string config_OnFire_entry = config_OnFire_class + particle_class;
9622 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9623 WPOF_array.Insert(WPOF);
9624 }
9625
9626
9628 }
9629 }
9630
9632 {
9633 config_to_search = "CfgWeapons";
9634 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9635
9636 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9637
9639
9640 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9641 {
9642 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9643
9644 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9645 {
9646 string particle_class2 = "";
9648 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9649 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9650 WPOBE_array.Insert(WPOBE);
9651 }
9652
9653
9655 }
9656 }
9657 }
9658
9659
9661 {
9664
9666 {
9667 string config_to_search = "CfgVehicles";
9668
9669 if (IsInherited(Weapon))
9670 config_to_search = "CfgWeapons";
9671
9672 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9673 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9674
9675 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9676 {
9677
9679
9681 {
9683 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9685 return;
9686 }
9687
9690
9691
9692
9694 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9695
9696 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9697 {
9698 string particle_class = "";
9700 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9702
9703 if (entry_type == CT_CLASS)
9704 {
9705 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9706 WPOOH_array.Insert(WPOF);
9707 }
9708 }
9709
9710
9712 }
9713 }
9714 }
9715
9717 {
9719 }
9720
9722 {
9724 {
9726
9729
9732
9733 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9734 }
9735 }
9736
9738 {
9740 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9741
9743 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9744
9746 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9747
9749 {
9751 }
9752 }
9753
9755 {
9757 }
9758
9760 {
9763 else
9765
9767 {
9770 }
9771 else
9772 {
9775
9778 }
9779
9781 }
9782
9784 {
9786 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9787 }
9788
9790 {
9792 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9794 }
9795
9797 {
9799 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9800 }
9801
9803 {
9806
9807 OverheatingParticle OP = new OverheatingParticle();
9812
9814 }
9815
9817 {
9820
9821 return -1;
9822 }
9823
9825 {
9827 {
9830
9831 for (int i = count; i > 0; --i)
9832 {
9833 int id = i - 1;
9836
9839
9840 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9841 {
9842 if (p)
9843 {
9846 }
9847 }
9848 }
9849 }
9850 }
9851
9853 {
9855 {
9857 {
9858 int id = i - 1;
9860
9861 if (OP)
9862 {
9864
9865 if (p)
9866 {
9868 }
9869
9870 delete OP;
9871 }
9872 }
9873
9876 }
9877 }
9878
9881 {
9882 return 0.0;
9883 }
9884
9885
9887 {
9888 return 250;
9889 }
9890
9892 {
9893 return 0;
9894 }
9895
9898 {
9900 return true;
9901
9902 return false;
9903 }
9904
9907 {
9910
9912 {
9914 }
9915 else
9916 {
9917
9919 }
9920
9922 }
9923
9930 {
9931 return -1;
9932 }
9933
9934
9935
9936
9938 {
9940 {
9942 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9943
9944 if (r_index >= 0)
9945 {
9946 InventoryLocation r_il = new InventoryLocation;
9947 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9948
9949 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9952 {
9953 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9954 }
9956 {
9957 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9958 }
9959
9960 }
9961
9962 player.GetHumanInventory().ClearUserReservedLocation(this);
9963 }
9964
9967 }
9968
9969
9970
9971
9973 {
9974 return ItemBase.m_DebugActionsMask;
9975 }
9976
9978 {
9979 return ItemBase.m_DebugActionsMask & mask;
9980 }
9981
9983 {
9984 ItemBase.m_DebugActionsMask = mask;
9985 }
9986
9988 {
9989 ItemBase.m_DebugActionsMask |= mask;
9990 }
9991
9993 {
9994 ItemBase.m_DebugActionsMask &= ~mask;
9995 }
9996
9998 {
10000 {
10002 }
10003 else
10004 {
10006 }
10007 }
10008
10009
10011 {
10012 if (GetEconomyProfile())
10013 {
10014 float q_max = GetEconomyProfile().GetQuantityMax();
10015 if (q_max > 0)
10016 {
10017 float q_min = GetEconomyProfile().GetQuantityMin();
10018 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10019
10021 {
10022 ComponentEnergyManager comp = GetCompEM();
10024 {
10026 }
10027 }
10029 {
10031
10032 }
10033
10034 }
10035 }
10036 }
10037
10040 {
10041 EntityAI parent = GetHierarchyParent();
10042
10043 if (parent)
10044 {
10045 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10046 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10047 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10048 }
10049 }
10050
10053 {
10054 EntityAI parent = GetHierarchyParent();
10055
10056 if (parent)
10057 {
10058 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10059 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10060 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10061 }
10062 }
10063
10065 {
10066
10067
10068
10069
10071
10073 {
10074 if (ScriptInputUserData.CanStoreInputUserData())
10075 {
10076 ScriptInputUserData ctx = new ScriptInputUserData;
10082 ctx.
Write(use_stack_max);
10085
10087 {
10088 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10089 }
10090 }
10091 }
10092 else if (!
GetGame().IsMultiplayer())
10093 {
10095 }
10096 }
10097
10099 {
10101 }
10102
10104 {
10106 }
10107
10109 {
10111 }
10112
10114 {
10115
10116 return false;
10117 }
10118
10120 {
10121 return false;
10122 }
10123
10127 {
10128 return false;
10129 }
10130
10132 {
10133 return "";
10134 }
10135
10137
10139 {
10140 return false;
10141 }
10142
10144 {
10145 return true;
10146 }
10147
10148
10149
10151 {
10152 return true;
10153 }
10154
10156 {
10157 return true;
10158 }
10159
10161 {
10162 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10164 }
10165
10167 {
10169 }
10170
10172 {
10174 if (!is_being_placed)
10176 SetSynchDirty();
10177 }
10178
10179
10181
10183 {
10185 }
10186
10188 {
10190 }
10191
10193 {
10194 return 1;
10195 }
10196
10198 {
10199 return false;
10200 }
10201
10203 {
10205 SetSynchDirty();
10206 }
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10243 {
10244 super.OnMovedInsideCargo(container);
10245
10246 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10247 }
10248
10249 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10250 {
10251 super.EEItemLocationChanged(oldLoc,newLoc);
10252
10253 PlayerBase new_player = null;
10254 PlayerBase old_player = null;
10255
10256 if (newLoc.GetParent())
10257 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10258
10259 if (oldLoc.GetParent())
10260 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10261
10263 {
10264 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10265
10266 if (r_index >= 0)
10267 {
10268 InventoryLocation r_il = new InventoryLocation;
10269 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10270
10271 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10274 {
10275 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10276 }
10278 {
10279 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10280 }
10281
10282 }
10283 }
10284
10286 {
10287 if (new_player)
10288 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10289
10290 if (new_player == old_player)
10291 {
10292
10293 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10294 {
10296 {
10297 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10298 {
10299 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10300 }
10301 }
10302 else
10303 {
10304 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10305 }
10306 }
10307
10308 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10309 {
10310 int type = oldLoc.GetType();
10312 {
10313 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10314 }
10316 {
10317 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10318 }
10319 }
10320 if (!m_OldLocation)
10321 {
10322 m_OldLocation = new InventoryLocation;
10323 }
10324 m_OldLocation.Copy(oldLoc);
10325 }
10326 else
10327 {
10328 if (m_OldLocation)
10329 {
10330 m_OldLocation.Reset();
10331 }
10332 }
10333
10335 }
10336 else
10337 {
10338 if (new_player)
10339 {
10340 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10341 if (res_index >= 0)
10342 {
10343 InventoryLocation il = new InventoryLocation;
10344 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10346 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10349 {
10350 il.
GetParent().GetOnReleaseLock().Invoke(it);
10351 }
10353 {
10355 }
10356
10357 }
10358 }
10360 {
10361
10363 }
10364
10365 if (m_OldLocation)
10366 {
10367 m_OldLocation.Reset();
10368 }
10369 }
10370 }
10371
10372 override void EOnContact(IEntity other, Contact extra)
10373 {
10375 {
10376 int liquidType = -1;
10378 if (impactSpeed > 0.0)
10379 {
10381 #ifndef SERVER
10383 #else
10385 SetSynchDirty();
10386 #endif
10388 }
10389 }
10390
10391 #ifdef SERVER
10392 if (GetCompEM() && GetCompEM().IsPlugged())
10393 {
10394 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10395 GetCompEM().UnplugThis();
10396 }
10397 #endif
10398 }
10399
10401
10403 {
10405 }
10406
10408 {
10409
10410 }
10411
10413 {
10414 super.OnItemLocationChanged(old_owner, new_owner);
10415
10416 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10417 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10418
10419 if (!relatedPlayer && playerNew)
10420 relatedPlayer = playerNew;
10421
10422 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10423 {
10425 if (actionMgr)
10426 {
10427 ActionBase currentAction = actionMgr.GetRunningAction();
10428 if (currentAction)
10430 }
10431 }
10432
10433 Man ownerPlayerOld = null;
10434 Man ownerPlayerNew = null;
10435
10436 if (old_owner)
10437 {
10438 if (old_owner.
IsMan())
10439 {
10440 ownerPlayerOld = Man.Cast(old_owner);
10441 }
10442 else
10443 {
10444 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10445 }
10446 }
10447 else
10448 {
10450 {
10452
10453 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10454 {
10455 GetCompEM().UnplugThis();
10456 }
10457 }
10458 }
10459
10460 if (new_owner)
10461 {
10462 if (new_owner.
IsMan())
10463 {
10464 ownerPlayerNew = Man.Cast(new_owner);
10465 }
10466 else
10467 {
10468 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10469 }
10470 }
10471
10472 if (ownerPlayerOld != ownerPlayerNew)
10473 {
10474 if (ownerPlayerOld)
10475 {
10476 array<EntityAI> subItemsExit = new array<EntityAI>;
10478 for (int i = 0; i < subItemsExit.Count(); i++)
10479 {
10482 }
10483 }
10484
10485 if (ownerPlayerNew)
10486 {
10487 array<EntityAI> subItemsEnter = new array<EntityAI>;
10489 for (int j = 0; j < subItemsEnter.Count(); j++)
10490 {
10493 }
10494 }
10495 }
10496 else if (ownerPlayerNew != null)
10497 {
10498 PlayerBase nplayer;
10499 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10500 {
10501 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10503 for (int k = 0; k < subItemsUpdate.Count(); k++)
10504 {
10506 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10507 }
10508 }
10509 }
10510
10511 if (old_owner)
10512 old_owner.OnChildItemRemoved(this);
10513 if (new_owner)
10514 new_owner.OnChildItemReceived(this);
10515 }
10516
10517
10519 {
10520 super.EEDelete(parent);
10521 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10522 if (player)
10523 {
10525
10526 if (player.IsAlive())
10527 {
10528 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10529 if (r_index >= 0)
10530 {
10531 InventoryLocation r_il = new InventoryLocation;
10532 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10533
10534 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10537 {
10538 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10539 }
10541 {
10542 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10543 }
10544
10545 }
10546
10547 player.RemoveQuickBarEntityShortcut(this);
10548 }
10549 }
10550 }
10551
10553 {
10554 super.EEKilled(killer);
10555
10558 {
10559 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10560 {
10561 if (IsMagazine())
10562 {
10563 if (Magazine.Cast(this).GetAmmoCount() > 0)
10564 {
10566 }
10567 }
10568 else
10569 {
10571 }
10572 }
10573 }
10574 }
10575
10577 {
10578 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10579
10580 super.OnWasAttached(parent, slot_id);
10581
10584
10586 }
10587
10589 {
10590 super.OnWasDetached(parent, slot_id);
10591
10594 }
10595
10597 {
10598 int idx;
10601
10602 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10603 if (inventory_slots.Count() < 1)
10604 {
10605 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10606 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10607 }
10608 else
10609 {
10610 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10611 }
10612
10613 idx = inventory_slots.Find(slot);
10614 if (idx < 0)
10615 return "";
10616
10617 return attach_types.Get(idx);
10618 }
10619
10621 {
10622 int idx = -1;
10623 string slot;
10624
10627
10628 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10629 if (inventory_slots.Count() < 1)
10630 {
10631 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10632 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10633 }
10634 else
10635 {
10636 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10637 if (detach_types.Count() < 1)
10638 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10639 }
10640
10641 for (int i = 0; i < inventory_slots.Count(); i++)
10642 {
10643 slot = inventory_slots.Get(i);
10644 }
10645
10646 if (slot != "")
10647 {
10648 if (detach_types.Count() == 1)
10649 idx = 0;
10650 else
10651 idx = inventory_slots.Find(slot);
10652 }
10653 if (idx < 0)
10654 return "";
10655
10656 return detach_types.Get(idx);
10657 }
10658
10660 {
10661
10663
10664
10665 float min_time = 1;
10666 float max_time = 3;
10667 float delay = Math.RandomFloat(min_time, max_time);
10668
10669 explode_timer.Run(delay, this, "DoAmmoExplosion");
10670 }
10671
10673 {
10674 Magazine magazine = Magazine.Cast(this);
10675 int pop_sounds_count = 6;
10676 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10677
10678
10679 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10680 string sound_name = pop_sounds[ sound_idx ];
10682
10683
10684 magazine.ServerAddAmmoCount(-1);
10685
10686
10687 float min_temp_to_explode = 100;
10688
10689 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10690 {
10692 }
10693 }
10694
10695
10696 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10697 {
10698 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10699
10700 const int CHANCE_DAMAGE_CARGO = 4;
10701 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10702 const int CHANCE_DAMAGE_NOTHING = 2;
10703
10705 {
10706 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10707 int chances;
10708 int rnd;
10709
10710 if (GetInventory().GetCargo())
10711 {
10712 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10713 rnd = Math.RandomInt(0,chances);
10714
10715 if (rnd < CHANCE_DAMAGE_CARGO)
10716 {
10718 }
10719 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10720 {
10722 }
10723 }
10724 else
10725 {
10726 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10727 rnd = Math.RandomInt(0,chances);
10728
10729 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10730 {
10732 }
10733 }
10734 }
10735 }
10736
10738 {
10739 if (GetInventory().GetCargo())
10740 {
10741 int item_count = GetInventory().GetCargo().GetItemCount();
10742 if (item_count > 0)
10743 {
10744 int random_pick = Math.RandomInt(0, item_count);
10746 if (!item.IsExplosive())
10747 {
10748 item.AddHealth("","",damage);
10749 return true;
10750 }
10751 }
10752 }
10753 return false;
10754 }
10755
10757 {
10758 int attachment_count = GetInventory().AttachmentCount();
10759 if (attachment_count > 0)
10760 {
10761 int random_pick = Math.RandomInt(0, attachment_count);
10762 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10763 if (!attachment.IsExplosive())
10764 {
10765 attachment.AddHealth("","",damage);
10766 return true;
10767 }
10768 }
10769 return false;
10770 }
10771
10773 {
10775 }
10776
10778 {
10780 return GetInventory().CanRemoveEntity();
10781
10782 return false;
10783 }
10784
10786 {
10788 return;
10789
10791 {
10792 if (ScriptInputUserData.CanStoreInputUserData())
10793 {
10794 ScriptInputUserData ctx = new ScriptInputUserData;
10799 ctx.
Write(destination_entity);
10801 ctx.
Write(slot_id);
10803 }
10804 }
10805 else if (!
GetGame().IsMultiplayer())
10806 {
10808 }
10809 }
10810
10812 {
10814 return;
10815
10816 float split_quantity_new;
10820 InventoryLocation loc = new InventoryLocation;
10821
10822 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10823 {
10825 split_quantity_new = stack_max;
10826 else
10828
10829 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10830 if (new_item)
10831 {
10832 new_item.SetResultOfSplit(true);
10833 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10835 new_item.SetQuantity(split_quantity_new);
10836 }
10837 }
10838 else if (destination_entity && slot_id == -1)
10839 {
10840 if (quantity > stack_max)
10841 split_quantity_new = stack_max;
10842 else
10843 split_quantity_new = quantity;
10844
10846 {
10849 }
10850
10851 if (new_item)
10852 {
10853 new_item.SetResultOfSplit(true);
10854 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10856 new_item.SetQuantity(split_quantity_new);
10857 }
10858 }
10859 else
10860 {
10861 if (stack_max != 0)
10862 {
10864 {
10866 }
10867
10868 if (split_quantity_new == 0)
10869 {
10870 if (!
GetGame().IsMultiplayer())
10871 player.PhysicalPredictiveDropItem(this);
10872 else
10873 player.ServerDropEntity(this);
10874 return;
10875 }
10876
10878
10879 if (new_item)
10880 {
10881 new_item.SetResultOfSplit(true);
10882 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10884 new_item.SetQuantity(stack_max);
10885 new_item.PlaceOnSurface();
10886 }
10887 }
10888 }
10889 }
10890
10892 {
10894 return;
10895
10896 float split_quantity_new;
10900 InventoryLocation loc = new InventoryLocation;
10901
10902 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10903 {
10905 split_quantity_new = stack_max;
10906 else
10908
10909 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10910 if (new_item)
10911 {
10912 new_item.SetResultOfSplit(true);
10913 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10915 new_item.SetQuantity(split_quantity_new);
10916 }
10917 }
10918 else if (destination_entity && slot_id == -1)
10919 {
10920 if (quantity > stack_max)
10921 split_quantity_new = stack_max;
10922 else
10923 split_quantity_new = quantity;
10924
10926 {
10929 }
10930
10931 if (new_item)
10932 {
10933 new_item.SetResultOfSplit(true);
10934 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10936 new_item.SetQuantity(split_quantity_new);
10937 }
10938 }
10939 else
10940 {
10941 if (stack_max != 0)
10942 {
10944 {
10946 }
10947
10949
10950 if (new_item)
10951 {
10952 new_item.SetResultOfSplit(true);
10953 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10955 new_item.SetQuantity(stack_max);
10956 new_item.PlaceOnSurface();
10957 }
10958 }
10959 }
10960 }
10961
10963 {
10965 return;
10966
10968 {
10969 if (ScriptInputUserData.CanStoreInputUserData())
10970 {
10971 ScriptInputUserData ctx = new ScriptInputUserData;
10976 dst.WriteToContext(ctx);
10978 }
10979 }
10980 else if (!
GetGame().IsMultiplayer())
10981 {
10983 }
10984 }
10985
10987 {
10989 return;
10990
10992 {
10993 if (ScriptInputUserData.CanStoreInputUserData())
10994 {
10995 ScriptInputUserData ctx = new ScriptInputUserData;
11000 ctx.
Write(destination_entity);
11006 }
11007 }
11008 else if (!
GetGame().IsMultiplayer())
11009 {
11011 }
11012 }
11013
11015 {
11017 }
11018
11020 {
11022 return this;
11023
11025 float split_quantity_new;
11027 if (dst.IsValid())
11028 {
11029 int slot_id = dst.GetSlot();
11031
11032 if (quantity > stack_max)
11033 split_quantity_new = stack_max;
11034 else
11035 split_quantity_new = quantity;
11036
11038
11039 if (new_item)
11040 {
11041 new_item.SetResultOfSplit(true);
11042 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11045 }
11046
11047 return new_item;
11048 }
11049
11050 return null;
11051 }
11052
11054 {
11056 return;
11057
11059 float split_quantity_new;
11061 if (destination_entity)
11062 {
11064 if (quantity > stackable)
11065 split_quantity_new = stackable;
11066 else
11067 split_quantity_new = quantity;
11068
11069 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11070 if (new_item)
11071 {
11072 new_item.SetResultOfSplit(true);
11073 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11075 new_item.SetQuantity(split_quantity_new);
11076 }
11077 }
11078 }
11079
11081 {
11083 return;
11084
11086 {
11087 if (ScriptInputUserData.CanStoreInputUserData())
11088 {
11089 ScriptInputUserData ctx = new ScriptInputUserData;
11094 ItemBase destination_entity =
this;
11095 ctx.
Write(destination_entity);
11099 }
11100 }
11101 else if (!
GetGame().IsMultiplayer())
11102 {
11104 }
11105 }
11106
11108 {
11110 return;
11111
11113 float split_quantity_new;
11115 if (player)
11116 {
11118 if (quantity > stackable)
11119 split_quantity_new = stackable;
11120 else
11121 split_quantity_new = quantity;
11122
11123 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11124 new_item =
ItemBase.Cast(in_hands);
11125 if (new_item)
11126 {
11127 new_item.SetResultOfSplit(true);
11128 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11130 new_item.SetQuantity(split_quantity_new);
11131 }
11132 }
11133 }
11134
11136 {
11138 return;
11139
11141 float split_quantity_new = Math.Floor(quantity * 0.5);
11142
11144
11145 if (new_item)
11146 {
11147 if (new_item.GetQuantityMax() < split_quantity_new)
11148 {
11149 split_quantity_new = new_item.GetQuantityMax();
11150 }
11151
11152 new_item.SetResultOfSplit(true);
11153 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11154
11156 {
11159 }
11160 else
11161 {
11164 }
11165 }
11166 }
11167
11169 {
11171 return;
11172
11174 float split_quantity_new = Math.Floor(quantity / 2);
11175
11176 InventoryLocation invloc = new InventoryLocation;
11178
11180 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11181
11182 if (new_item)
11183 {
11184 if (new_item.GetQuantityMax() < split_quantity_new)
11185 {
11186 split_quantity_new = new_item.GetQuantityMax();
11187 }
11189 {
11192 }
11193 else
11194 {
11197 }
11198 }
11199 }
11200
11203 {
11204 SetWeightDirty();
11206
11207 if (parent)
11208 parent.OnAttachmentQuantityChangedEx(this, delta);
11209
11211 {
11213 {
11215 }
11217 {
11218 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11220 }
11221 }
11222
11223 }
11224
11227 {
11228
11229 }
11230
11233 {
11235 }
11236
11238 {
11239 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11240
11242 {
11243 if (newLevel == GameConstants.STATE_RUINED)
11244 {
11246 EntityAI parent = GetHierarchyParent();
11247 if (parent && parent.IsFireplace())
11248 {
11249 CargoBase cargo = GetInventory().GetCargo();
11250 if (cargo)
11251 {
11253 {
11255 }
11256 }
11257 }
11258 }
11259
11261 {
11262
11264 return;
11265 }
11266
11267 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11268 {
11270 }
11271 }
11272 }
11273
11274
11276 {
11277 super.OnRightClick();
11278
11280 {
11282 {
11283 if (ScriptInputUserData.CanStoreInputUserData())
11284 {
11285 vector m4[4];
11287
11288 EntityAI root = GetHierarchyRoot();
11289
11290 InventoryLocation dst = new InventoryLocation;
11292 {
11293 if (root)
11294 {
11295 root.GetTransform(m4);
11297 }
11298 else
11299 GetInventory().GetCurrentInventoryLocation(dst);
11300 }
11301 else
11302 {
11304
11305
11306 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11307 {
11308 if (root)
11309 {
11310 root.GetTransform(m4);
11312 }
11313 else
11314 GetInventory().GetCurrentInventoryLocation(dst);
11315 }
11316 else
11317 {
11318 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11319 }
11320 }
11321
11322 ScriptInputUserData ctx = new ScriptInputUserData;
11330 }
11331 }
11332 else if (!
GetGame().IsMultiplayer())
11333 {
11335 }
11336 }
11337 }
11338
11339 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11340 {
11341
11342 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11343 return false;
11344
11345 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11346 return false;
11347
11348
11350 return false;
11351
11352
11353 Magazine mag = Magazine.Cast(this);
11354 if (mag)
11355 {
11356 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11357 return false;
11358
11359 if (stack_max_limit)
11360 {
11361 Magazine other_mag = Magazine.Cast(other_item);
11362 if (other_item)
11363 {
11364 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11365 return false;
11366 }
11367
11368 }
11369 }
11370 else
11371 {
11372
11374 return false;
11375
11377 return false;
11378 }
11379
11380 PlayerBase player = null;
11381 if (CastTo(player, GetHierarchyRootPlayer()))
11382 {
11383 if (player.GetInventory().HasAttachment(this))
11384 return false;
11385
11386 if (player.IsItemsToDelete())
11387 return false;
11388 }
11389
11390 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11391 return false;
11392
11393 int slotID;
11395 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11396 return false;
11397
11398 return true;
11399 }
11400
11402 {
11404 }
11405
11407 {
11408 return m_IsResultOfSplit;
11409 }
11410
11412 {
11413 m_IsResultOfSplit = value;
11414 }
11415
11417 {
11419 }
11420
11422 {
11423 float other_item_quantity = other_item.GetQuantity();
11424 float this_free_space;
11425
11427
11429
11430 if (other_item_quantity > this_free_space)
11431 {
11432 return this_free_space;
11433 }
11434 else
11435 {
11436 return other_item_quantity;
11437 }
11438 }
11439
11441 {
11443 }
11444
11446 {
11448 return;
11449
11450 if (!IsMagazine() && other_item)
11451 {
11453 if (quantity_used != 0)
11454 {
11455 float hp1 = GetHealth01("","");
11456 float hp2 = other_item.GetHealth01("","");
11457 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11458 hpResult = hpResult / (
GetQuantity() + quantity_used);
11459
11460 hpResult *= GetMaxHealth();
11461 Math.Round(hpResult);
11462 SetHealth("", "Health", hpResult);
11463
11465 other_item.AddQuantity(-quantity_used);
11466 }
11467 }
11469 }
11470
11472 {
11473 #ifdef SERVER
11474 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11475 GetHierarchyParent().IncreaseLifetimeUp();
11476 #endif
11477 };
11478
11480 {
11481 PlayerBase p = PlayerBase.Cast(player);
11482
11483 array<int> recipesIds = p.m_Recipes;
11484 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11485 if (moduleRecipesManager)
11486 {
11487 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11488 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11489 }
11490
11491 for (int i = 0;i < recipesIds.Count(); i++)
11492 {
11493 int key = recipesIds.Get(i);
11494 string recipeName = moduleRecipesManager.GetRecipeName(key);
11496 }
11497 }
11498
11499
11500 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11501 {
11502 super.GetDebugActions(outputList);
11503
11504
11509
11510
11514
11518
11519
11522
11523
11525 {
11528 }
11529
11531
11534
11538 }
11539
11540
11541
11542
11544 {
11545 super.OnAction(action_id, player, ctx);
11546 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11547 {
11548 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11549 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11550 PlayerBase p = PlayerBase.Cast(player);
11551 if (
EActions.RECIPES_RANGE_START < 1000)
11552 {
11553 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11554 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11555 }
11556 }
11557 #ifndef SERVER
11558 else if (action_id ==
EActions.WATCH_PLAYER)
11559 {
11560 PluginDeveloper.SetDeveloperItemClientEx(player);
11561 }
11562 #endif
11564 {
11565 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11566 {
11567 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11568 OnDebugButtonPressServer(id + 1);
11569 }
11570
11571 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11572 {
11573 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11575 }
11576
11577 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11578 {
11579 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11581 }
11582
11583 else if (action_id ==
EActions.ADD_QUANTITY)
11584 {
11585 if (IsMagazine())
11586 {
11587 Magazine mag = Magazine.Cast(this);
11588 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11589 }
11590 else
11591 {
11593 }
11594
11595 if (m_EM)
11596 {
11597 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11598 }
11599
11600 }
11601
11602 else if (action_id ==
EActions.REMOVE_QUANTITY)
11603 {
11604 if (IsMagazine())
11605 {
11606 Magazine mag2 = Magazine.Cast(this);
11607 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11608 }
11609 else
11610 {
11612 }
11613 if (m_EM)
11614 {
11615 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11616 }
11617
11618 }
11619
11620 else if (action_id ==
EActions.SET_QUANTITY_0)
11621 {
11623
11624 if (m_EM)
11625 {
11626 m_EM.SetEnergy(0);
11627 }
11628 }
11629
11630 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11631 {
11633
11634 if (m_EM)
11635 {
11636 m_EM.SetEnergy(m_EM.GetEnergyMax());
11637 }
11638 }
11639
11640 else if (action_id ==
EActions.ADD_HEALTH)
11641 {
11642 AddHealth("","",GetMaxHealth("","Health")/5);
11643 }
11644 else if (action_id ==
EActions.REMOVE_HEALTH)
11645 {
11646 AddHealth("","",-GetMaxHealth("","Health")/5);
11647 }
11648 else if (action_id ==
EActions.DESTROY_HEALTH)
11649 {
11650 SetHealth01("","",0);
11651 }
11652 else if (action_id ==
EActions.WATCH_ITEM)
11653 {
11655 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11656 #ifdef DEVELOPER
11657 SetDebugDeveloper_item(this);
11658 #endif
11659 }
11660
11661 else if (action_id ==
EActions.ADD_TEMPERATURE)
11662 {
11663 AddTemperature(20);
11664
11665 }
11666
11667 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11668 {
11669 AddTemperature(-20);
11670
11671 }
11672
11673 else if (action_id ==
EActions.FLIP_FROZEN)
11674 {
11675 SetFrozen(!GetIsFrozen());
11676
11677 }
11678
11679 else if (action_id ==
EActions.ADD_WETNESS)
11680 {
11682
11683 }
11684
11685 else if (action_id ==
EActions.REMOVE_WETNESS)
11686 {
11688
11689 }
11690
11691 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11692 {
11695
11696
11697 }
11698
11699 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11700 {
11703 }
11704
11705 else if (action_id ==
EActions.MAKE_SPECIAL)
11706 {
11707 auto debugParams = DebugSpawnParams.WithPlayer(player);
11708 OnDebugSpawnEx(debugParams);
11709 }
11710
11711 else if (action_id ==
EActions.DELETE)
11712 {
11713 Delete();
11714 }
11715
11716 }
11717
11718
11719 return false;
11720 }
11721
11722
11723
11724
11728
11731
11732
11733
11735 {
11736 return false;
11737 }
11738
11739
11741 {
11742 return true;
11743 }
11744
11745
11747 {
11748 return true;
11749 }
11750
11751
11752
11754 {
11755 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11757 }
11758
11761 {
11762 return null;
11763 }
11764
11766 {
11767 return false;
11768 }
11769
11771 {
11772 return false;
11773 }
11774
11778
11779
11781 {
11782 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11783 return module_repairing.CanRepair(this, item_repair_kit);
11784 }
11785
11786
11787 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11788 {
11789 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11790 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11791 }
11792
11793
11795 {
11796
11797
11798
11799
11800
11801
11802
11803
11804 return 1;
11805 }
11806
11807
11808
11810 {
11812 }
11813
11814
11815
11817 {
11819 }
11820
11821
11830 {
11831 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11832
11833 if (player)
11834 {
11835 player.MessageStatus(text);
11836 }
11837 }
11838
11839
11848 {
11849 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11850
11851 if (player)
11852 {
11853 player.MessageAction(text);
11854 }
11855 }
11856
11857
11866 {
11867 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11868
11869 if (player)
11870 {
11871 player.MessageFriendly(text);
11872 }
11873 }
11874
11875
11884 {
11885 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11886
11887 if (player)
11888 {
11889 player.MessageImportant(text);
11890 }
11891 }
11892
11894 {
11895 return true;
11896 }
11897
11898
11899 override bool KindOf(
string tag)
11900 {
11901 bool found = false;
11902 string item_name = this.
GetType();
11905
11906 int array_size = item_tag_array.Count();
11907 for (int i = 0; i < array_size; i++)
11908 {
11909 if (item_tag_array.Get(i) == tag)
11910 {
11911 found = true;
11912 break;
11913 }
11914 }
11915 return found;
11916 }
11917
11918
11920 {
11921
11922 super.OnRPC(sender, rpc_type,ctx);
11923
11924
11925 switch (rpc_type)
11926 {
11927 #ifndef SERVER
11928 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11929 Param2<bool, string> p = new Param2<bool, string>(false, "");
11930
11932 return;
11933
11934 bool play = p.param1;
11935 string soundSet = p.param2;
11936
11937 if (play)
11938 {
11940 {
11942 {
11944 }
11945 }
11946 else
11947 {
11949 }
11950 }
11951 else
11952 {
11954 }
11955
11956 break;
11957 #endif
11958
11959 }
11960
11962 {
11964 }
11965 }
11966
11967
11968
11969
11971 {
11972 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11973 return plugin.GetID(
name);
11974 }
11975
11977 {
11978 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11979 return plugin.GetName(id);
11980 }
11981
11984 {
11985
11986
11987 int varFlags;
11988 if (!ctx.
Read(varFlags))
11989 return;
11990
11991 if (varFlags & ItemVariableFlags.FLOAT)
11992 {
11994 }
11995 }
11996
11998 {
11999
12000 super.SerializeNumericalVars(floats_out);
12001
12002
12003
12005 {
12007 }
12008
12010 {
12012 }
12013
12015 {
12017 }
12018
12020 {
12025 }
12026
12028 {
12030 }
12031 }
12032
12034 {
12035
12036 super.DeSerializeNumericalVars(floats);
12037
12038
12039 int index = 0;
12040 int mask = Math.Round(floats.Get(index));
12041
12042 index++;
12043
12045 {
12047 {
12049 }
12050 else
12051 {
12052 float quantity = floats.Get(index);
12053 SetQuantity(quantity,
true,
false,
false,
false);
12054 }
12055 index++;
12056 }
12057
12059 {
12060 float wet = floats.Get(index);
12062 index++;
12063 }
12064
12066 {
12067 int liquidtype = Math.Round(floats.Get(index));
12069 index++;
12070 }
12071
12073 {
12075 index++;
12077 index++;
12079 index++;
12081 index++;
12082 }
12083
12085 {
12086 int cleanness = Math.Round(floats.Get(index));
12088 index++;
12089 }
12090 }
12091
12093 {
12094 super.WriteVarsToCTX(ctx);
12095
12096
12098 {
12100 }
12101
12103 {
12105 }
12106
12108 {
12110 }
12111
12113 {
12114 int r,g,b,a;
12120 }
12121
12123 {
12125 }
12126 }
12127
12129 {
12130 if (!super.ReadVarsFromCTX(ctx,version))
12131 return false;
12132
12133 int intValue;
12134 float value;
12135
12136 if (version < 140)
12137 {
12138 if (!ctx.
Read(intValue))
12139 return false;
12140
12141 m_VariablesMask = intValue;
12142 }
12143
12145 {
12146 if (!ctx.
Read(value))
12147 return false;
12148
12150 {
12152 }
12153 else
12154 {
12156 }
12157 }
12158
12159 if (version < 140)
12160 {
12162 {
12163 if (!ctx.
Read(value))
12164 return false;
12165 SetTemperatureDirect(value);
12166 }
12167 }
12168
12170 {
12171 if (!ctx.
Read(value))
12172 return false;
12174 }
12175
12177 {
12178 if (!ctx.
Read(intValue))
12179 return false;
12181 }
12182
12184 {
12185 int r,g,b,a;
12187 return false;
12189 return false;
12191 return false;
12193 return false;
12194
12196 }
12197
12199 {
12200 if (!ctx.
Read(intValue))
12201 return false;
12203 }
12204
12205 if (version >= 138 && version < 140)
12206 {
12208 {
12209 if (!ctx.
Read(intValue))
12210 return false;
12211 SetFrozen(intValue);
12212 }
12213 }
12214
12215 return true;
12216 }
12217
12218
12220 {
12223 {
12225 }
12226
12227 if (!super.OnStoreLoad(ctx, version))
12228 {
12230 return false;
12231 }
12232
12233 if (version >= 114)
12234 {
12235 bool hasQuickBarIndexSaved;
12236
12237 if (!ctx.
Read(hasQuickBarIndexSaved))
12238 {
12240 return false;
12241 }
12242
12243 if (hasQuickBarIndexSaved)
12244 {
12245 int itmQBIndex;
12246
12247
12248 if (!ctx.
Read(itmQBIndex))
12249 {
12251 return false;
12252 }
12253
12254 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12255 if (itmQBIndex != -1 && parentPlayer)
12256 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12257 }
12258 }
12259 else
12260 {
12261
12262 PlayerBase player;
12263 int itemQBIndex;
12264 if (version ==
int.
MAX)
12265 {
12266 if (!ctx.
Read(itemQBIndex))
12267 {
12269 return false;
12270 }
12271 }
12272 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12273 {
12274
12275 if (!ctx.
Read(itemQBIndex))
12276 {
12278 return false;
12279 }
12280 if (itemQBIndex != -1 && player)
12281 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12282 }
12283 }
12284
12285 if (version < 140)
12286 {
12287
12288 if (!LoadVariables(ctx, version))
12289 {
12291 return false;
12292 }
12293 }
12294
12295
12297 {
12299 return false;
12300 }
12301 if (version >= 132)
12302 {
12304 if (raib)
12305 {
12307 {
12309 return false;
12310 }
12311 }
12312 }
12313
12315 return true;
12316 }
12317
12318
12319
12321 {
12322 super.OnStoreSave(ctx);
12323
12324 PlayerBase player;
12325 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12326 {
12328
12329 int itemQBIndex = -1;
12330 itemQBIndex = player.FindQuickBarEntityIndex(this);
12331 ctx.
Write(itemQBIndex);
12332 }
12333 else
12334 {
12336 }
12337
12339
12341 if (raib)
12342 {
12344 }
12345 }
12346
12347
12349 {
12350 super.AfterStoreLoad();
12351
12353 {
12355 }
12356
12358 {
12361 }
12362 }
12363
12365 {
12366 super.EEOnAfterLoad();
12367
12369 {
12371 }
12372
12375 }
12376
12378 {
12379 return false;
12380 }
12381
12382
12383
12385 {
12387 {
12388 #ifdef PLATFORM_CONSOLE
12389
12391 {
12393 if (menu)
12394 {
12396 }
12397 }
12398 #endif
12399 }
12400
12402 {
12405 }
12406
12408 {
12409 SetWeightDirty();
12411 }
12413 {
12416 }
12417
12419 {
12422 }
12424 {
12427 }
12428
12429 super.OnVariablesSynchronized();
12430 }
12431
12432
12433
12435 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12436 {
12437 if (!IsServerCheck(allow_client))
12438 return false;
12439
12441 return false;
12442
12445
12446 if (value <= (min + 0.001))
12447 value = min;
12448
12449 if (value == min)
12450 {
12451 if (destroy_config)
12452 {
12453 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12454 if (dstr)
12455 {
12457 this.Delete();
12458 return true;
12459 }
12460 }
12461 else if (destroy_forced)
12462 {
12464 this.Delete();
12465 return true;
12466 }
12467
12469 }
12470
12473
12475 {
12477
12478 if (delta)
12480 }
12481
12483
12484 return false;
12485 }
12486
12487
12489 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12490 {
12492 }
12493
12495 {
12498 }
12499
12501 {
12504 }
12505
12508 {
12509 float value_clamped = Math.Clamp(value, 0, 1);
12511 SetQuantity(result, destroy_config, destroy_forced);
12512 }
12513
12514
12517 {
12519 }
12520
12522 {
12524 }
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12536 {
12537 int slot = -1;
12538 if (GetInventory())
12539 {
12540 InventoryLocation il = new InventoryLocation;
12541 GetInventory().GetCurrentInventoryLocation(il);
12543 }
12544
12546 }
12547
12549 {
12550 float quantity_max = 0;
12551
12553 {
12554 if (attSlotID != -1)
12555 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12556
12557 if (quantity_max <= 0)
12559 }
12560
12561 if (quantity_max <= 0)
12563
12564 return quantity_max;
12565 }
12566
12568 {
12570 }
12571
12573 {
12575 }
12576
12577
12579 {
12581 }
12582
12584 {
12586 }
12587
12589 {
12591 }
12592
12593
12595 {
12596
12597 float weightEx = GetWeightEx();
12598 float special = GetInventoryAndCargoWeight();
12599 return weightEx - special;
12600 }
12601
12602
12604 {
12606 }
12607
12609 {
12611 {
12612 #ifdef DEVELOPER
12613 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12614 {
12615 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12617 }
12618 #endif
12619
12620 return GetQuantity() * GetConfigWeightModified();
12621 }
12622 else if (HasEnergyManager())
12623 {
12624 #ifdef DEVELOPER
12625 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12626 {
12627 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12628 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12629 }
12630 #endif
12631 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12632 }
12633 else
12634 {
12635 #ifdef DEVELOPER
12636 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12637 {
12638 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12639 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12640 }
12641 #endif
12642 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12643 }
12644 }
12645
12648 {
12649 int item_count = 0;
12651
12652 if (GetInventory().GetCargo() != NULL)
12653 {
12654 item_count = GetInventory().GetCargo().GetItemCount();
12655 }
12656
12657 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12658 {
12659 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12660 if (item)
12661 item_count += item.GetNumberOfItems();
12662 }
12663 return item_count;
12664 }
12665
12668 {
12669 float weight = 0;
12670 float wetness = 1;
12671 if (include_wetness)
12674 {
12675 weight = wetness * m_ConfigWeight;
12676 }
12678 {
12679 weight = 1;
12680 }
12681 return weight;
12682 }
12683
12684
12685
12687 {
12688 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12689 {
12690 GameInventory inv = GetInventory();
12691 array<EntityAI> items = new array<EntityAI>;
12693 for (int i = 0; i < items.Count(); i++)
12694 {
12696 if (item)
12697 {
12699 }
12700 }
12701 }
12702 }
12703
12704
12705
12706
12708 {
12709 float energy = 0;
12710 if (HasEnergyManager())
12711 {
12712 energy = GetCompEM().GetEnergy();
12713 }
12714 return energy;
12715 }
12716
12717
12719 {
12720 super.OnEnergyConsumed();
12721
12723 }
12724
12726 {
12727 super.OnEnergyAdded();
12728
12730 }
12731
12732
12734 {
12735 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12736 {
12738 {
12739 float energy_0to1 = GetCompEM().GetEnergy0To1();
12741 }
12742 }
12743 }
12744
12745
12747 {
12748 return ConfigGetFloat("heatIsolation");
12749 }
12750
12752 {
12754 }
12755
12757 {
12758 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12759 if (
GetGame().ConfigIsExisting(paramPath))
12761
12762 return 0.0;
12763 }
12764
12766 {
12767 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12768 if (
GetGame().ConfigIsExisting(paramPath))
12770
12771 return 0.0;
12772 }
12773
12774 override void SetWet(
float value,
bool allow_client =
false)
12775 {
12776 if (!IsServerCheck(allow_client))
12777 return;
12778
12781
12783
12784 m_VarWet = Math.Clamp(value, min, max);
12785
12787 {
12790 }
12791 }
12792
12793 override void AddWet(
float value)
12794 {
12796 }
12797
12799 {
12801 }
12802
12804 {
12806 }
12807
12809 {
12811 }
12812
12814 {
12816 }
12817
12819 {
12821 }
12822
12823 override void OnWetChanged(
float newVal,
float oldVal)
12824 {
12827 if (newLevel != oldLevel)
12828 {
12830 }
12831 }
12832
12834 {
12835 SetWeightDirty();
12836 }
12837
12839 {
12840 return GetWetLevelInternal(
m_VarWet);
12841 }
12842
12843
12844
12846 {
12848 }
12849
12851 {
12853 }
12854
12856 {
12858 }
12859
12861 {
12863 }
12864
12865
12866
12868 {
12869 if (ConfigIsExisting("itemModelLength"))
12870 {
12871 return ConfigGetFloat("itemModelLength");
12872 }
12873 return 0;
12874 }
12875
12877 {
12878 if (ConfigIsExisting("itemAttachOffset"))
12879 {
12880 return ConfigGetFloat("itemAttachOffset");
12881 }
12882 return 0;
12883 }
12884
12885 override void SetCleanness(
int value,
bool allow_client =
false)
12886 {
12887 if (!IsServerCheck(allow_client))
12888 return;
12889
12891
12893
12896 }
12897
12899 {
12901 }
12902
12904 {
12905 return true;
12906 }
12907
12908
12909
12910
12912 {
12914 }
12915
12917 {
12919 }
12920
12921
12922
12923
12924 override void SetColor(
int r,
int g,
int b,
int a)
12925 {
12931 }
12933 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12934 {
12939 }
12940
12942 {
12944 }
12945
12948 {
12949 int r,g,b,a;
12951 r = r/255;
12952 g = g/255;
12953 b = b/255;
12954 a = a/255;
12955 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12956 }
12957
12958
12959
12960 override void SetLiquidType(
int value,
bool allow_client =
false)
12961 {
12962 if (!IsServerCheck(allow_client))
12963 return;
12964
12969 }
12970
12972 {
12973 return ConfigGetInt("varLiquidTypeInit");
12974 }
12975
12977 {
12979 }
12980
12982 {
12984 SetFrozen(false);
12985 }
12986
12989 {
12990 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12991 }
12992
12993
12996 {
12997 PlayerBase nplayer;
12998 if (PlayerBase.CastTo(nplayer, player))
12999 {
13001
13002 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13003 }
13004 }
13005
13006
13009 {
13010 PlayerBase nplayer;
13011 if (PlayerBase.CastTo(nplayer,player))
13012 {
13013
13014 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13015
13016 }
13017
13018
13019 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13020
13021
13022 if (HasEnergyManager())
13023 {
13024 GetCompEM().UpdatePlugState();
13025 }
13026 }
13027
13028
13030 {
13031 super.OnPlacementStarted(player);
13032
13034 }
13035
13036 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13037 {
13039 {
13040 m_AdminLog.OnPlacementComplete(player,
this);
13041 }
13042
13043 super.OnPlacementComplete(player, position, orientation);
13044 }
13045
13046
13047
13048
13049
13051 {
13053 {
13054 return true;
13055 }
13056 else
13057 {
13058 return false;
13059 }
13060 }
13061
13062
13064 {
13066 {
13068 }
13069 }
13070
13071
13073 {
13075 }
13076
13078 {
13080 }
13081
13082 override void InsertAgent(
int agent,
float count = 1)
13083 {
13084 if (count < 1)
13085 return;
13086
13088 }
13089
13092 {
13094 }
13095
13096
13098 {
13100 }
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13144 {
13146 return false;
13147 return true;
13148 }
13149
13151 {
13152
13154 }
13155
13156
13159 {
13160 super.CheckForRoofLimited(timeTresholdMS);
13161
13163 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13164 {
13165 m_PreviousRoofTestTime = time;
13166 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13167 }
13168 }
13169
13170
13172 {
13174 {
13175 return 0;
13176 }
13177
13178 if (GetInventory().GetAttachmentSlotsCount() != 0)
13179 {
13180 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13181 if (filter)
13182 return filter.GetProtectionLevel(type, false, system);
13183 else
13184 return 0;
13185 }
13186
13187 string subclassPath, entryName;
13188
13189 switch (type)
13190 {
13192 entryName = "biological";
13193 break;
13195 entryName = "chemical";
13196 break;
13197 default:
13198 entryName = "biological";
13199 break;
13200 }
13201
13202 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13203
13205 }
13206
13207
13208
13211 {
13212 if (!IsMagazine())
13214
13216 }
13217
13218
13219
13220
13221
13226 {
13227 return true;
13228 }
13229
13231 {
13233 }
13234
13235
13236
13237
13238
13240 {
13241 if (parent)
13242 {
13243 if (parent.IsInherited(DayZInfected))
13244 return true;
13245
13246 if (!parent.IsRuined())
13247 return true;
13248 }
13249
13250 return true;
13251 }
13252
13254 {
13255 if (!super.CanPutAsAttachment(parent))
13256 {
13257 return false;
13258 }
13259
13260 if (!IsRuined() && !parent.IsRuined())
13261 {
13262 return true;
13263 }
13264
13265 return false;
13266 }
13267
13269 {
13270
13271
13272
13273
13274 return super.CanReceiveItemIntoCargo(item);
13275 }
13276
13278 {
13279
13280
13281
13282
13283 GameInventory attachmentInv = attachment.GetInventory();
13285 {
13286 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13287 return false;
13288 }
13289
13290 InventoryLocation loc = new InventoryLocation();
13291 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13292 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13293 return false;
13294
13295 return super.CanReceiveAttachment(attachment, slotId);
13296 }
13297
13299 {
13300 if (!super.CanReleaseAttachment(attachment))
13301 return false;
13302
13303 return GetInventory().AreChildrenAccessible();
13304 }
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13327 {
13328 int id = muzzle_owner.GetMuzzleID();
13329 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13330
13331 if (WPOF_array)
13332 {
13333 for (int i = 0; i < WPOF_array.Count(); i++)
13334 {
13335 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13336
13337 if (WPOF)
13338 {
13339 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13340 }
13341 }
13342 }
13343 }
13344
13345
13347 {
13348 int id = muzzle_owner.GetMuzzleID();
13350
13351 if (WPOBE_array)
13352 {
13353 for (int i = 0; i < WPOBE_array.Count(); i++)
13354 {
13355 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13356
13357 if (WPOBE)
13358 {
13359 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13360 }
13361 }
13362 }
13363 }
13364
13365
13367 {
13368 int id = muzzle_owner.GetMuzzleID();
13369 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13370
13371 if (WPOOH_array)
13372 {
13373 for (int i = 0; i < WPOOH_array.Count(); i++)
13374 {
13375 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13376
13377 if (WPOOH)
13378 {
13379 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13380 }
13381 }
13382 }
13383 }
13384
13385
13387 {
13388 int id = muzzle_owner.GetMuzzleID();
13389 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13390
13391 if (WPOOH_array)
13392 {
13393 for (int i = 0; i < WPOOH_array.Count(); i++)
13394 {
13395 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13396
13397 if (WPOOH)
13398 {
13399 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13400 }
13401 }
13402 }
13403 }
13404
13405
13407 {
13408 int id = muzzle_owner.GetMuzzleID();
13409 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13410
13411 if (WPOOH_array)
13412 {
13413 for (int i = 0; i < WPOOH_array.Count(); i++)
13414 {
13415 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13416
13417 if (WPOOH)
13418 {
13419 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13420 }
13421 }
13422 }
13423 }
13424
13425
13426
13428 {
13430 {
13431 return true;
13432 }
13433
13434 return false;
13435 }
13436
13438 {
13440 {
13441 return true;
13442 }
13443
13444 return false;
13445 }
13446
13448 {
13450 {
13451 return true;
13452 }
13453
13454 return false;
13455 }
13456
13458 {
13459 return false;
13460 }
13461
13464 {
13465 return UATimeSpent.DEFAULT_DEPLOY;
13466 }
13467
13468
13469
13470
13472 {
13474 SetSynchDirty();
13475 }
13476
13478 {
13480 }
13481
13482
13484 {
13485 return false;
13486 }
13487
13490 {
13491 string att_type = "None";
13492
13493 if (ConfigIsExisting("soundAttType"))
13494 {
13495 att_type = ConfigGetString("soundAttType");
13496 }
13497
13499 }
13500
13502 {
13504 }
13505
13506
13507
13508
13509
13513
13515 {
13518
13520 }
13521
13522
13524 {
13526 return;
13527
13529
13532
13535
13536 SoundParameters params = new SoundParameters();
13540 }
13541
13542
13544 {
13546 return;
13547
13549 SetSynchDirty();
13550
13553 }
13554
13555
13557 {
13559 return;
13560
13562 SetSynchDirty();
13563
13566 }
13567
13569 {
13571 }
13572
13574 {
13576 }
13577
13580 {
13581 if (!
GetGame().IsDedicatedServer())
13582 {
13583 if (ConfigIsExisting("attachSoundSet"))
13584 {
13585 string cfg_path = "";
13586 string soundset = "";
13587 string type_name =
GetType();
13588
13591 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13592 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13593
13594 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13595 {
13596 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13597 {
13598 if (cfg_slot_array[i] == slot_type)
13599 {
13600 soundset = cfg_soundset_array[i];
13601 break;
13602 }
13603 }
13604 }
13605
13606 if (soundset != "")
13607 {
13608 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13610 }
13611 }
13612 }
13613 }
13614
13616 {
13617
13618 }
13619
13620 void OnApply(PlayerBase player);
13621
13623 {
13624 return 1.0;
13625 };
13626
13628 {
13630 }
13631
13633 {
13635 }
13636
13638
13640 {
13641 SetDynamicPhysicsLifeTime(0.01);
13643 }
13644
13646 {
13647 array<string> zone_names = new array<string>;
13648 GetDamageZones(zone_names);
13649 for (int i = 0; i < zone_names.Count(); i++)
13650 {
13651 SetHealthMax(zone_names.Get(i),"Health");
13652 }
13653 SetHealthMax("","Health");
13654 }
13655
13658 {
13659 float global_health = GetHealth01("","Health");
13660 array<string> zones = new array<string>;
13661 GetDamageZones(zones);
13662
13663 for (int i = 0; i < zones.Count(); i++)
13664 {
13665 SetHealth01(zones.Get(i),"Health",global_health);
13666 }
13667 }
13668
13671 {
13672 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13673 }
13674
13676 {
13677 if (!hasRootAsPlayer)
13678 {
13679 if (refParentIB)
13680 {
13681
13682 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13683 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13684
13685 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13686 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13687
13690 }
13691 else
13692 {
13693
13696 }
13697 }
13698 }
13699
13701 {
13703 {
13704 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13705 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13706 {
13707 float heatPermCoef = 1.0;
13709 while (ent)
13710 {
13711 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13712 ent = ent.GetHierarchyParent();
13713 }
13714
13715 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13716 }
13717 }
13718 }
13719
13721 {
13722
13723 EntityAI parent = GetHierarchyParent();
13724 if (!parent)
13725 {
13726 hasParent = false;
13727 hasRootAsPlayer = false;
13728 }
13729 else
13730 {
13731 hasParent = true;
13732 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13733 refParentIB =
ItemBase.Cast(parent);
13734 }
13735 }
13736
13737 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13738 {
13739
13740 }
13741
13743 {
13744
13745 return false;
13746 }
13747
13749 {
13750
13751
13752 return false;
13753 }
13754
13756 {
13757
13758 return false;
13759 }
13760
13763 {
13764 return !GetIsFrozen() &&
IsOpen();
13765 }
13766
13768 {
13769 bool hasParent = false, hasRootAsPlayer = false;
13771
13772 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13773 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13774
13775 if (wwtu || foodDecay)
13776 {
13780
13781 if (processWetness || processTemperature || processDecay)
13782 {
13784
13785 if (processWetness)
13786 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13787
13788 if (processTemperature)
13790
13791 if (processDecay)
13792 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13793 }
13794 }
13795 }
13796
13799 {
13801 }
13802
13804 {
13807
13808 return super.GetTemperatureFreezeThreshold();
13809 }
13810
13812 {
13815
13816 return super.GetTemperatureThawThreshold();
13817 }
13818
13820 {
13823
13824 return super.GetItemOverheatThreshold();
13825 }
13826
13828 {
13830 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13831
13832 return super.GetTemperatureFreezeTime();
13833 }
13834
13836 {
13838 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13839
13840 return super.GetTemperatureThawTime();
13841 }
13842
13847
13849 {
13850 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13851 }
13852
13854 {
13855 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13856 }
13857
13860 {
13862 }
13863
13865 {
13867 }
13868
13870 {
13872 }
13873
13876 {
13877 return null;
13878 }
13879
13882 {
13883 return false;
13884 }
13885
13887 {
13889 {
13892 if (!trg)
13893 {
13895 explosive = this;
13896 }
13897
13898 explosive.PairRemote(trg);
13900
13901 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13902 trg.SetPersistentPairID(persistentID);
13903 explosive.SetPersistentPairID(persistentID);
13904
13905 return true;
13906 }
13907 return false;
13908 }
13909
13912 {
13913 float ret = 1.0;
13916 ret *= GetHealth01();
13917
13918 return ret;
13919 }
13920
13921 #ifdef DEVELOPER
13922 override void SetDebugItem()
13923 {
13924 super.SetDebugItem();
13925 _itemBase = this;
13926 }
13927
13929 {
13930 string text = super.GetDebugText();
13931
13933 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13934
13935 return text;
13936 }
13937 #endif
13938
13940 {
13941 return true;
13942 }
13943
13945
13947
13949 {
13952 }
13953
13954
13962
13978}
13979
13981{
13983 if (entity)
13984 {
13985 bool is_item = entity.IsInherited(
ItemBase);
13986 if (is_item && full_quantity)
13987 {
13990 }
13991 }
13992 else
13993 {
13995 return NULL;
13996 }
13997 return entity;
13998}
13999
14001{
14002 if (item)
14003 {
14004 if (health > 0)
14005 item.SetHealth("", "", health);
14006
14007 if (item.CanHaveTemperature())
14008 {
14010 if (item.CanFreeze())
14011 item.SetFrozen(false);
14012 }
14013
14014 if (item.HasEnergyManager())
14015 {
14016 if (quantity >= 0)
14017 {
14018 item.GetCompEM().SetEnergy0To1(quantity);
14019 }
14020 else
14021 {
14023 }
14024 }
14025 else if (item.IsMagazine())
14026 {
14027 Magazine mag = Magazine.Cast(item);
14028 if (quantity >= 0)
14029 {
14030 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14031 }
14032 else
14033 {
14035 }
14036
14037 }
14038 else
14039 {
14040 if (quantity >= 0)
14041 {
14042 item.SetQuantityNormalized(quantity, false);
14043 }
14044 else
14045 {
14047 }
14048
14049 }
14050 }
14051}
14052
14053#ifdef DEVELOPER
14055#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.