9218{
9220 {
9221 return true;
9222 }
9223};
9224
9225
9226
9228{
9232
9234
9237
9238
9239
9240
9241
9250
9256
9261
9266
9287 protected bool m_IsResultOfSplit
9288
9290
9295
9296
9297
9299
9303
9304
9305
9307
9310
9311
9312
9318
9319
9327
9330
9331
9333
9334
9336
9337
9342
9343
9348
9349
9351
9352
9354 {
9359
9360 if (!
GetGame().IsDedicatedServer())
9361 {
9363 {
9365
9367 {
9369 }
9370 }
9371
9374 }
9375
9376 m_OldLocation = null;
9377
9379 {
9381 }
9382
9383 if (ConfigIsExisting("headSelectionsToHide"))
9384 {
9387 }
9388
9390 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9391 {
9393 }
9394
9396
9397 m_IsResultOfSplit = false;
9398
9400 }
9401
9403 {
9404 super.InitItemVariables();
9405
9411 m_Count = ConfigGetInt(
"count");
9412
9415
9420
9423
9428
9440
9444
9445
9448 if (ConfigIsExisting("canBeSplit"))
9449 {
9452 }
9453
9455 if (ConfigIsExisting("itemBehaviour"))
9457
9458
9461 RegisterNetSyncVariableInt("m_VarLiquidType");
9462 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9463
9464 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9465 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9466 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9467
9468 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9469 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9470 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9471 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9472
9473 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9474 RegisterNetSyncVariableBool("m_IsTakeable");
9475 RegisterNetSyncVariableBool("m_IsHologram");
9476
9479 {
9482 }
9483
9485
9487 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9489
9490 }
9491
9493 {
9495 }
9496
9498 {
9501 {
9506 }
9507 }
9508
9509 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9510 {
9512 {
9515 }
9516
9518 }
9519
9521 {
9527 }
9528
9530
9532 {
9534
9535 if (!action)
9536 {
9537 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9538 return;
9539 }
9540
9542 if (!ai)
9543 {
9545 return;
9546 }
9547
9549 if (!action_array)
9550 {
9551 action_array = new array<ActionBase_Basic>;
9553 }
9554 if (LogManager.IsActionLogEnable())
9555 {
9556 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9557 }
9558
9559 if (action_array.Find(action) != -1)
9560 {
9561 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9562 }
9563 else
9564 {
9565 action_array.Insert(action);
9566 }
9567 }
9568
9570 {
9572 ActionBase action = player.GetActionManager().GetAction(actionName);
9575
9576 if (action_array)
9577 {
9578 action_array.RemoveItem(action);
9579 }
9580 }
9581
9582
9583
9585 {
9586 ActionOverrideData overrideData = new ActionOverrideData();
9590
9592 if (!actionMap)
9593 {
9596 }
9597
9598 actionMap.Insert(this.
Type(), overrideData);
9599
9600 }
9601
9603
9605
9606
9608 {
9611
9614
9615 string config_to_search = "CfgVehicles";
9616 string muzzle_owner_config;
9617
9619 {
9620 if (IsInherited(Weapon))
9621 config_to_search = "CfgWeapons";
9622
9623 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9624
9625 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9626
9628
9629 if (config_OnFire_subclass_count > 0)
9630 {
9631 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9632
9633 for (int i = 0; i < config_OnFire_subclass_count; i++)
9634 {
9635 string particle_class = "";
9637 string config_OnFire_entry = config_OnFire_class + particle_class;
9638 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9639 WPOF_array.Insert(WPOF);
9640 }
9641
9642
9644 }
9645 }
9646
9648 {
9649 config_to_search = "CfgWeapons";
9650 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9651
9652 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9653
9655
9656 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9657 {
9658 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9659
9660 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9661 {
9662 string particle_class2 = "";
9664 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9665 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9666 WPOBE_array.Insert(WPOBE);
9667 }
9668
9669
9671 }
9672 }
9673 }
9674
9675
9677 {
9680
9682 {
9683 string config_to_search = "CfgVehicles";
9684
9685 if (IsInherited(Weapon))
9686 config_to_search = "CfgWeapons";
9687
9688 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9689 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9690
9691 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9692 {
9693
9695
9697 {
9699 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9701 return;
9702 }
9703
9706
9707
9708
9710 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9711
9712 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9713 {
9714 string particle_class = "";
9716 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9718
9719 if (entry_type == CT_CLASS)
9720 {
9721 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9722 WPOOH_array.Insert(WPOF);
9723 }
9724 }
9725
9726
9728 }
9729 }
9730 }
9731
9733 {
9735 }
9736
9738 {
9740 {
9742
9745
9748
9749 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9750 }
9751 }
9752
9754 {
9756 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9757
9759 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9760
9762 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9763
9765 {
9767 }
9768 }
9769
9771 {
9773 }
9774
9776 {
9779 else
9781
9783 {
9786 }
9787 else
9788 {
9791
9794 }
9795
9797 }
9798
9800 {
9802 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9803 }
9804
9806 {
9808 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9810 }
9811
9813 {
9815 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9816 }
9817
9819 {
9822
9823 OverheatingParticle OP = new OverheatingParticle();
9828
9830 }
9831
9833 {
9836
9837 return -1;
9838 }
9839
9841 {
9843 {
9846
9847 for (int i = count; i > 0; --i)
9848 {
9849 int id = i - 1;
9852
9855
9856 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9857 {
9858 if (p)
9859 {
9862 }
9863 }
9864 }
9865 }
9866 }
9867
9869 {
9871 {
9873 {
9874 int id = i - 1;
9876
9877 if (OP)
9878 {
9880
9881 if (p)
9882 {
9884 }
9885
9886 delete OP;
9887 }
9888 }
9889
9892 }
9893 }
9894
9897 {
9898 return 0.0;
9899 }
9900
9901
9903 {
9904 return 250;
9905 }
9906
9908 {
9909 return 0;
9910 }
9911
9914 {
9916 return true;
9917
9918 return false;
9919 }
9920
9923 {
9926
9928 {
9930 }
9931 else
9932 {
9933
9935 }
9936
9938 }
9939
9946 {
9947 return -1;
9948 }
9949
9950
9951
9952
9954 {
9956 {
9958 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9959
9960 if (r_index >= 0)
9961 {
9962 InventoryLocation r_il = new InventoryLocation;
9963 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9964
9965 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9968 {
9969 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9970 }
9972 {
9973 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9974 }
9975
9976 }
9977
9978 player.GetHumanInventory().ClearUserReservedLocation(this);
9979 }
9980
9983 }
9984
9985
9986
9987
9989 {
9990 return ItemBase.m_DebugActionsMask;
9991 }
9992
9994 {
9995 return ItemBase.m_DebugActionsMask & mask;
9996 }
9997
9999 {
10000 ItemBase.m_DebugActionsMask = mask;
10001 }
10002
10004 {
10005 ItemBase.m_DebugActionsMask |= mask;
10006 }
10007
10009 {
10010 ItemBase.m_DebugActionsMask &= ~mask;
10011 }
10012
10014 {
10016 {
10018 }
10019 else
10020 {
10022 }
10023 }
10024
10025
10027 {
10028 if (GetEconomyProfile())
10029 {
10030 float q_max = GetEconomyProfile().GetQuantityMax();
10031 if (q_max > 0)
10032 {
10033 float q_min = GetEconomyProfile().GetQuantityMin();
10034 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10035
10037 {
10038 ComponentEnergyManager comp = GetCompEM();
10040 {
10042 }
10043 }
10045 {
10047
10048 }
10049
10050 }
10051 }
10052 }
10053
10056 {
10057 EntityAI parent = GetHierarchyParent();
10058
10059 if (parent)
10060 {
10061 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10062 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10063 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10064 }
10065 }
10066
10069 {
10070 EntityAI parent = GetHierarchyParent();
10071
10072 if (parent)
10073 {
10074 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10075 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10076 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10077 }
10078 }
10079
10081 {
10082
10083
10084
10085
10087
10089 {
10090 if (ScriptInputUserData.CanStoreInputUserData())
10091 {
10092 ScriptInputUserData ctx = new ScriptInputUserData;
10098 ctx.
Write(use_stack_max);
10101
10103 {
10104 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10105 }
10106 }
10107 }
10108 else if (!
GetGame().IsMultiplayer())
10109 {
10111 }
10112 }
10113
10115 {
10117 }
10118
10120 {
10122 }
10123
10125 {
10127 }
10128
10130 {
10131
10132 return false;
10133 }
10134
10136 {
10137 return false;
10138 }
10139
10143 {
10144 return false;
10145 }
10146
10148 {
10149 return "";
10150 }
10151
10153
10155 {
10156 return false;
10157 }
10158
10160 {
10161 return true;
10162 }
10163
10164
10165
10167 {
10168 return true;
10169 }
10170
10172 {
10173 return true;
10174 }
10175
10177 {
10178 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10180 }
10181
10183 {
10185 }
10186
10188 {
10190 if (!is_being_placed)
10192 SetSynchDirty();
10193 }
10194
10195
10197
10199 {
10201 }
10202
10204 {
10206 }
10207
10209 {
10210 return 1;
10211 }
10212
10214 {
10215 return false;
10216 }
10217
10219 {
10221 SetSynchDirty();
10222 }
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10259 {
10260 super.OnMovedInsideCargo(container);
10261
10262 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10263 }
10264
10265 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10266 {
10267 super.EEItemLocationChanged(oldLoc,newLoc);
10268
10269 PlayerBase new_player = null;
10270 PlayerBase old_player = null;
10271
10272 if (newLoc.GetParent())
10273 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10274
10275 if (oldLoc.GetParent())
10276 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10277
10279 {
10280 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10281
10282 if (r_index >= 0)
10283 {
10284 InventoryLocation r_il = new InventoryLocation;
10285 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10286
10287 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10290 {
10291 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10292 }
10294 {
10295 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10296 }
10297
10298 }
10299 }
10300
10302 {
10303 if (new_player)
10304 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10305
10306 if (new_player == old_player)
10307 {
10308
10309 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10310 {
10312 {
10313 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10314 {
10315 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10316 }
10317 }
10318 else
10319 {
10320 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10321 }
10322 }
10323
10324 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10325 {
10326 int type = oldLoc.GetType();
10328 {
10329 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10330 }
10332 {
10333 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10334 }
10335 }
10336 if (!m_OldLocation)
10337 {
10338 m_OldLocation = new InventoryLocation;
10339 }
10340 m_OldLocation.Copy(oldLoc);
10341 }
10342 else
10343 {
10344 if (m_OldLocation)
10345 {
10346 m_OldLocation.Reset();
10347 }
10348 }
10349
10351 }
10352 else
10353 {
10354 if (new_player)
10355 {
10356 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10357 if (res_index >= 0)
10358 {
10359 InventoryLocation il = new InventoryLocation;
10360 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10362 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10365 {
10366 il.
GetParent().GetOnReleaseLock().Invoke(it);
10367 }
10369 {
10371 }
10372
10373 }
10374 }
10376 {
10377
10379 }
10380
10381 if (m_OldLocation)
10382 {
10383 m_OldLocation.Reset();
10384 }
10385 }
10386 }
10387
10388 override void EOnContact(IEntity other, Contact extra)
10389 {
10391 {
10392 int liquidType = -1;
10394 if (impactSpeed > 0.0)
10395 {
10397 #ifndef SERVER
10399 #else
10401 SetSynchDirty();
10402 #endif
10404 }
10405 }
10406
10407 #ifdef SERVER
10408 if (GetCompEM() && GetCompEM().IsPlugged())
10409 {
10410 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10411 GetCompEM().UnplugThis();
10412 }
10413 #endif
10414 }
10415
10417
10419 {
10421 }
10422
10424 {
10425
10426 }
10427
10429 {
10430 super.OnItemLocationChanged(old_owner, new_owner);
10431
10432 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10433 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10434
10435 if (!relatedPlayer && playerNew)
10436 relatedPlayer = playerNew;
10437
10438 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10439 {
10441 if (actionMgr)
10442 {
10443 ActionBase currentAction = actionMgr.GetRunningAction();
10444 if (currentAction)
10446 }
10447 }
10448
10449 Man ownerPlayerOld = null;
10450 Man ownerPlayerNew = null;
10451
10452 if (old_owner)
10453 {
10454 if (old_owner.
IsMan())
10455 {
10456 ownerPlayerOld = Man.Cast(old_owner);
10457 }
10458 else
10459 {
10460 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10461 }
10462 }
10463 else
10464 {
10466 {
10468
10469 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10470 {
10471 GetCompEM().UnplugThis();
10472 }
10473 }
10474 }
10475
10476 if (new_owner)
10477 {
10478 if (new_owner.
IsMan())
10479 {
10480 ownerPlayerNew = Man.Cast(new_owner);
10481 }
10482 else
10483 {
10484 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10485 }
10486 }
10487
10488 if (ownerPlayerOld != ownerPlayerNew)
10489 {
10490 if (ownerPlayerOld)
10491 {
10492 array<EntityAI> subItemsExit = new array<EntityAI>;
10494 for (int i = 0; i < subItemsExit.Count(); i++)
10495 {
10498 }
10499 }
10500
10501 if (ownerPlayerNew)
10502 {
10503 array<EntityAI> subItemsEnter = new array<EntityAI>;
10505 for (int j = 0; j < subItemsEnter.Count(); j++)
10506 {
10509 }
10510 }
10511 }
10512 else if (ownerPlayerNew != null)
10513 {
10514 PlayerBase nplayer;
10515 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10516 {
10517 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10519 for (int k = 0; k < subItemsUpdate.Count(); k++)
10520 {
10522 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10523 }
10524 }
10525 }
10526
10527 if (old_owner)
10528 old_owner.OnChildItemRemoved(this);
10529 if (new_owner)
10530 new_owner.OnChildItemReceived(this);
10531 }
10532
10533
10535 {
10536 super.EEDelete(parent);
10537 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10538 if (player)
10539 {
10541
10542 if (player.IsAlive())
10543 {
10544 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10545 if (r_index >= 0)
10546 {
10547 InventoryLocation r_il = new InventoryLocation;
10548 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10549
10550 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10553 {
10554 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10555 }
10557 {
10558 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10559 }
10560
10561 }
10562
10563 player.RemoveQuickBarEntityShortcut(this);
10564 }
10565 }
10566 }
10567
10569 {
10570 super.EEKilled(killer);
10571
10574 {
10575 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10576 {
10577 if (IsMagazine())
10578 {
10579 if (Magazine.Cast(this).GetAmmoCount() > 0)
10580 {
10582 }
10583 }
10584 else
10585 {
10587 }
10588 }
10589 }
10590 }
10591
10593 {
10594 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10595
10596 super.OnWasAttached(parent, slot_id);
10597
10600
10602 }
10603
10605 {
10606 super.OnWasDetached(parent, slot_id);
10607
10610 }
10611
10613 {
10614 int idx;
10617
10618 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10619 if (inventory_slots.Count() < 1)
10620 {
10621 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10622 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10623 }
10624 else
10625 {
10626 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10627 }
10628
10629 idx = inventory_slots.Find(slot);
10630 if (idx < 0)
10631 return "";
10632
10633 return attach_types.Get(idx);
10634 }
10635
10637 {
10638 int idx = -1;
10639 string slot;
10640
10643
10644 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10645 if (inventory_slots.Count() < 1)
10646 {
10647 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10648 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10649 }
10650 else
10651 {
10652 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10653 if (detach_types.Count() < 1)
10654 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10655 }
10656
10657 for (int i = 0; i < inventory_slots.Count(); i++)
10658 {
10659 slot = inventory_slots.Get(i);
10660 }
10661
10662 if (slot != "")
10663 {
10664 if (detach_types.Count() == 1)
10665 idx = 0;
10666 else
10667 idx = inventory_slots.Find(slot);
10668 }
10669 if (idx < 0)
10670 return "";
10671
10672 return detach_types.Get(idx);
10673 }
10674
10676 {
10677
10679
10680
10681 float min_time = 1;
10682 float max_time = 3;
10683 float delay = Math.RandomFloat(min_time, max_time);
10684
10685 explode_timer.Run(delay, this, "DoAmmoExplosion");
10686 }
10687
10689 {
10690 Magazine magazine = Magazine.Cast(this);
10691 int pop_sounds_count = 6;
10692 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10693
10694
10695 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10696 string sound_name = pop_sounds[ sound_idx ];
10698
10699
10700 magazine.ServerAddAmmoCount(-1);
10701
10702
10703 float min_temp_to_explode = 100;
10704
10705 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10706 {
10708 }
10709 }
10710
10711
10712 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10713 {
10714 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10715
10716 const int CHANCE_DAMAGE_CARGO = 4;
10717 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10718 const int CHANCE_DAMAGE_NOTHING = 2;
10719
10721 {
10722 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10723 int chances;
10724 int rnd;
10725
10726 if (GetInventory().GetCargo())
10727 {
10728 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10729 rnd = Math.RandomInt(0,chances);
10730
10731 if (rnd < CHANCE_DAMAGE_CARGO)
10732 {
10734 }
10735 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10736 {
10738 }
10739 }
10740 else
10741 {
10742 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10743 rnd = Math.RandomInt(0,chances);
10744
10745 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10746 {
10748 }
10749 }
10750 }
10751 }
10752
10754 {
10755 if (GetInventory().GetCargo())
10756 {
10757 int item_count = GetInventory().GetCargo().GetItemCount();
10758 if (item_count > 0)
10759 {
10760 int random_pick = Math.RandomInt(0, item_count);
10762 if (!item.IsExplosive())
10763 {
10764 item.AddHealth("","",damage);
10765 return true;
10766 }
10767 }
10768 }
10769 return false;
10770 }
10771
10773 {
10774 int attachment_count = GetInventory().AttachmentCount();
10775 if (attachment_count > 0)
10776 {
10777 int random_pick = Math.RandomInt(0, attachment_count);
10778 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10779 if (!attachment.IsExplosive())
10780 {
10781 attachment.AddHealth("","",damage);
10782 return true;
10783 }
10784 }
10785 return false;
10786 }
10787
10789 {
10791 }
10792
10794 {
10796 return GetInventory().CanRemoveEntity();
10797
10798 return false;
10799 }
10800
10802 {
10803
10805 return false;
10806
10807
10809 return false;
10810
10811
10812
10814 if (delta == 0)
10815 return false;
10816
10817
10818 return true;
10819 }
10820
10822 {
10824 {
10825 if (ScriptInputUserData.CanStoreInputUserData())
10826 {
10827 ScriptInputUserData ctx = new ScriptInputUserData;
10832 ctx.
Write(destination_entity);
10834 ctx.
Write(slot_id);
10836 }
10837 }
10838 else if (!
GetGame().IsMultiplayer())
10839 {
10841 }
10842 }
10843
10845 {
10846 float split_quantity_new;
10850 InventoryLocation loc = new InventoryLocation;
10851
10852 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10853 {
10855 split_quantity_new = stack_max;
10856 else
10858
10860 {
10861 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10862 if (new_item)
10863 {
10864 new_item.SetResultOfSplit(true);
10865 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10867 new_item.
SetQuantity(split_quantity_new,
false,
true);
10868 }
10869 }
10870 }
10871 else if (destination_entity && slot_id == -1)
10872 {
10873 if (quantity > stack_max)
10874 split_quantity_new = stack_max;
10875 else
10876 split_quantity_new = quantity;
10877
10879 {
10881 {
10884 }
10885
10886 if (new_item)
10887 {
10888 new_item.SetResultOfSplit(true);
10889 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10891 new_item.
SetQuantity(split_quantity_new,
false,
true);
10892 }
10893 }
10894 }
10895 else
10896 {
10897 if (stack_max != 0)
10898 {
10900 {
10902 }
10903
10904 if (split_quantity_new == 0)
10905 {
10906 if (!
GetGame().IsMultiplayer())
10907 player.PhysicalPredictiveDropItem(this);
10908 else
10909 player.ServerDropEntity(this);
10910 return;
10911 }
10912
10914 {
10916
10917 if (new_item)
10918 {
10919 new_item.SetResultOfSplit(true);
10920 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10923 new_item.PlaceOnSurface();
10924 }
10925 }
10926 }
10927 }
10928 }
10929
10931 {
10932 float split_quantity_new;
10936 InventoryLocation loc = new InventoryLocation;
10937
10938 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10939 {
10941 split_quantity_new = stack_max;
10942 else
10944
10946 {
10947 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10948 if (new_item)
10949 {
10950 new_item.SetResultOfSplit(true);
10951 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10953 new_item.
SetQuantity(split_quantity_new,
false,
true);
10954 }
10955 }
10956 }
10957 else if (destination_entity && slot_id == -1)
10958 {
10959 if (quantity > stack_max)
10960 split_quantity_new = stack_max;
10961 else
10962 split_quantity_new = quantity;
10963
10965 {
10967 {
10970 }
10971
10972 if (new_item)
10973 {
10974 new_item.SetResultOfSplit(true);
10975 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10977 new_item.
SetQuantity(split_quantity_new,
false,
true);
10978 }
10979 }
10980 }
10981 else
10982 {
10983 if (stack_max != 0)
10984 {
10986 {
10988 }
10989
10991 {
10993
10994 if (new_item)
10995 {
10996 new_item.SetResultOfSplit(true);
10997 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11000 new_item.PlaceOnSurface();
11001 }
11002 }
11003 }
11004 }
11005 }
11006
11008 {
11010 {
11011 if (ScriptInputUserData.CanStoreInputUserData())
11012 {
11013 ScriptInputUserData ctx = new ScriptInputUserData;
11018 dst.WriteToContext(ctx);
11020 }
11021 }
11022 else if (!
GetGame().IsMultiplayer())
11023 {
11025 }
11026 }
11027
11029 {
11031 {
11032 if (ScriptInputUserData.CanStoreInputUserData())
11033 {
11034 ScriptInputUserData ctx = new ScriptInputUserData;
11039 ctx.
Write(destination_entity);
11045 }
11046 }
11047 else if (!
GetGame().IsMultiplayer())
11048 {
11050 }
11051 }
11052
11054 {
11056 }
11057
11059 {
11061 float split_quantity_new;
11063 if (dst.IsValid())
11064 {
11065 int slot_id = dst.GetSlot();
11067
11068 if (quantity > stack_max)
11069 split_quantity_new = stack_max;
11070 else
11071 split_quantity_new = quantity;
11072
11074 {
11076
11077 if (new_item)
11078 {
11079 new_item.SetResultOfSplit(true);
11080 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11082 new_item.
SetQuantity(split_quantity_new,
false,
true);
11083 }
11084
11085 return new_item;
11086 }
11087 }
11088
11089 return null;
11090 }
11091
11093 {
11095 float split_quantity_new;
11097 if (destination_entity)
11098 {
11100 if (quantity > stackable)
11101 split_quantity_new = stackable;
11102 else
11103 split_quantity_new = quantity;
11104
11106 {
11107 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11108 if (new_item)
11109 {
11110 new_item.SetResultOfSplit(true);
11111 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11113 new_item.
SetQuantity(split_quantity_new,
false,
true);
11114 }
11115 }
11116 }
11117 }
11118
11120 {
11122 {
11123 if (ScriptInputUserData.CanStoreInputUserData())
11124 {
11125 ScriptInputUserData ctx = new ScriptInputUserData;
11130 ItemBase destination_entity =
this;
11131 ctx.
Write(destination_entity);
11135 }
11136 }
11137 else if (!
GetGame().IsMultiplayer())
11138 {
11140 }
11141 }
11142
11144 {
11146 float split_quantity_new;
11148 if (player)
11149 {
11151 if (quantity > stackable)
11152 split_quantity_new = stackable;
11153 else
11154 split_quantity_new = quantity;
11155
11157 {
11158 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11159 new_item =
ItemBase.Cast(in_hands);
11160 if (new_item)
11161 {
11162 new_item.SetResultOfSplit(true);
11163 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11165 new_item.SetQuantity(split_quantity_new, false, true);
11166 }
11167 }
11168 }
11169 }
11170
11172 {
11174 float split_quantity_new = Math.Floor(quantity * 0.5);
11175
11177 return;
11178
11180
11181 if (new_item)
11182 {
11183 if (new_item.GetQuantityMax() < split_quantity_new)
11184 {
11185 split_quantity_new = new_item.GetQuantityMax();
11186 }
11187
11188 new_item.SetResultOfSplit(true);
11189 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11190
11192 {
11195 }
11196 else
11197 {
11199 new_item.
SetQuantity(split_quantity_new,
false,
true);
11200 }
11201 }
11202 }
11203
11205 {
11207 float split_quantity_new = Math.Floor(quantity / 2);
11208
11210 return;
11211
11212 InventoryLocation invloc = new InventoryLocation;
11214
11216 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11217
11218 if (new_item)
11219 {
11220 if (new_item.GetQuantityMax() < split_quantity_new)
11221 {
11222 split_quantity_new = new_item.GetQuantityMax();
11223 }
11225 {
11228 }
11229 else if (split_quantity_new > 1)
11230 {
11232 new_item.
SetQuantity(split_quantity_new,
false,
true);
11233 }
11234 }
11235 }
11236
11239 {
11240 SetWeightDirty();
11242
11243 if (parent)
11244 parent.OnAttachmentQuantityChangedEx(this, delta);
11245
11247 {
11249 {
11251 }
11253 {
11254 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11256 }
11257 }
11258
11259 }
11260
11263 {
11264
11265 }
11266
11269 {
11271 }
11272
11274 {
11275 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11276
11278 {
11279 if (newLevel == GameConstants.STATE_RUINED)
11280 {
11282 EntityAI parent = GetHierarchyParent();
11283 if (parent && parent.IsFireplace())
11284 {
11285 CargoBase cargo = GetInventory().GetCargo();
11286 if (cargo)
11287 {
11289 {
11291 }
11292 }
11293 }
11294 }
11295
11297 {
11298
11300 return;
11301 }
11302
11303 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11304 {
11306 }
11307 }
11308 }
11309
11310
11312 {
11313 super.OnRightClick();
11314
11316 {
11318 {
11319 if (ScriptInputUserData.CanStoreInputUserData())
11320 {
11321 EntityAI root = GetHierarchyRoot();
11322 Man playerOwner = GetHierarchyRootPlayer();
11323 InventoryLocation dst = new InventoryLocation;
11324
11325
11326 if (!playerOwner && root && root == this)
11327 {
11329 }
11330 else
11331 {
11332
11333 GetInventory().GetCurrentInventoryLocation(dst);
11335 {
11338 {
11340 }
11341 else
11342 {
11344
11345
11346 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11347 {
11349 }
11350 else
11351 {
11352 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11353 }
11354 }
11355 }
11356 }
11357
11358 ScriptInputUserData ctx = new ScriptInputUserData;
11366 }
11367 }
11368 else if (!
GetGame().IsMultiplayer())
11369 {
11371 }
11372 }
11373 }
11374
11376 {
11377 if (root)
11378 {
11379 vector m4[4];
11380 root.GetTransform(m4);
11381 dst.SetGround(this, m4);
11382 }
11383 else
11384 {
11385 GetInventory().GetCurrentInventoryLocation(dst);
11386 }
11387 }
11388
11389 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11390 {
11391
11392 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11393 return false;
11394
11395 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11396 return false;
11397
11398
11400 return false;
11401
11402
11403 Magazine mag = Magazine.Cast(this);
11404 if (mag)
11405 {
11406 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11407 return false;
11408
11409 if (stack_max_limit)
11410 {
11411 Magazine other_mag = Magazine.Cast(other_item);
11412 if (other_item)
11413 {
11414 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11415 return false;
11416 }
11417
11418 }
11419 }
11420 else
11421 {
11422
11424 return false;
11425
11427 return false;
11428 }
11429
11430 PlayerBase player = null;
11431 if (CastTo(player, GetHierarchyRootPlayer()))
11432 {
11433 if (player.GetInventory().HasAttachment(this))
11434 return false;
11435
11436 if (player.IsItemsToDelete())
11437 return false;
11438 }
11439
11440 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11441 return false;
11442
11443 int slotID;
11445 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11446 return false;
11447
11448 return true;
11449 }
11450
11452 {
11454 }
11455
11457 {
11458 return m_IsResultOfSplit;
11459 }
11460
11462 {
11463 m_IsResultOfSplit = value;
11464 }
11465
11467 {
11469 }
11470
11472 {
11473 float other_item_quantity = other_item.GetQuantity();
11474 float this_free_space;
11475
11477
11479
11480 if (other_item_quantity > this_free_space)
11481 {
11482 return this_free_space;
11483 }
11484 else
11485 {
11486 return other_item_quantity;
11487 }
11488 }
11489
11491 {
11493 }
11494
11496 {
11498 return;
11499
11500 if (!IsMagazine() && other_item)
11501 {
11503 if (quantity_used != 0)
11504 {
11505 float hp1 = GetHealth01("","");
11506 float hp2 = other_item.GetHealth01("","");
11507 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11508 hpResult = hpResult / (
GetQuantity() + quantity_used);
11509
11510 hpResult *= GetMaxHealth();
11511 Math.Round(hpResult);
11512 SetHealth("", "Health", hpResult);
11513
11515 other_item.AddQuantity(-quantity_used);
11516 }
11517 }
11519 }
11520
11522 {
11523 #ifdef SERVER
11524 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11525 GetHierarchyParent().IncreaseLifetimeUp();
11526 #endif
11527 };
11528
11530 {
11531 PlayerBase p = PlayerBase.Cast(player);
11532
11533 array<int> recipesIds = p.m_Recipes;
11534 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11535 if (moduleRecipesManager)
11536 {
11537 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11538 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11539 }
11540
11541 for (int i = 0;i < recipesIds.Count(); i++)
11542 {
11543 int key = recipesIds.Get(i);
11544 string recipeName = moduleRecipesManager.GetRecipeName(key);
11546 }
11547 }
11548
11549
11550 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11551 {
11552 super.GetDebugActions(outputList);
11553
11554
11560
11561
11566
11571
11572
11576
11577
11579 {
11583 }
11584
11587
11588
11592
11594
11595 InventoryLocation loc = new InventoryLocation();
11596 GetInventory().GetCurrentInventoryLocation(loc);
11598 {
11599 if (Gizmo_IsSupported())
11602 }
11603
11605 }
11606
11607
11608
11609
11611 {
11612 super.OnAction(action_id, player, ctx);
11613
11615 {
11616 switch (action_id)
11617 {
11620 return true;
11623 return true;
11624 }
11625 }
11626
11628 {
11629 switch (action_id)
11630 {
11632 Delete();
11633 return true;
11634 }
11635 }
11636
11637 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11638 {
11639 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11640 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11641 PlayerBase p = PlayerBase.Cast(player);
11642 if (
EActions.RECIPES_RANGE_START < 1000)
11643 {
11644 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11645 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11646 }
11647 }
11648 #ifndef SERVER
11649 else if (action_id ==
EActions.WATCH_PLAYER)
11650 {
11651 PluginDeveloper.SetDeveloperItemClientEx(player);
11652 }
11653 #endif
11655 {
11656 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11657 {
11658 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11659 OnDebugButtonPressServer(id + 1);
11660 }
11661
11662 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11663 {
11664 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11666 }
11667
11668 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11669 {
11670 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11672 }
11673
11674 else if (action_id ==
EActions.ADD_QUANTITY)
11675 {
11676 if (IsMagazine())
11677 {
11678 Magazine mag = Magazine.Cast(this);
11679 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11680 }
11681 else
11682 {
11684 }
11685
11686 if (m_EM)
11687 {
11688 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11689 }
11690
11691 }
11692
11693 else if (action_id ==
EActions.REMOVE_QUANTITY)
11694 {
11695 if (IsMagazine())
11696 {
11697 Magazine mag2 = Magazine.Cast(this);
11698 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11699 }
11700 else
11701 {
11703 }
11704 if (m_EM)
11705 {
11706 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11707 }
11708
11709 }
11710
11711 else if (action_id ==
EActions.SET_QUANTITY_0)
11712 {
11714
11715 if (m_EM)
11716 {
11717 m_EM.SetEnergy(0);
11718 }
11719 }
11720
11721 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11722 {
11724
11725 if (m_EM)
11726 {
11727 m_EM.SetEnergy(m_EM.GetEnergyMax());
11728 }
11729 }
11730
11731 else if (action_id ==
EActions.ADD_HEALTH)
11732 {
11733 AddHealth("","",GetMaxHealth("","Health")/5);
11734 }
11735 else if (action_id ==
EActions.REMOVE_HEALTH)
11736 {
11737 AddHealth("","",-GetMaxHealth("","Health")/5);
11738 }
11739 else if (action_id ==
EActions.DESTROY_HEALTH)
11740 {
11741 SetHealth01("","",0);
11742 }
11743 else if (action_id ==
EActions.WATCH_ITEM)
11744 {
11746 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11747 #ifdef DEVELOPER
11748 SetDebugDeveloper_item(this);
11749 #endif
11750 }
11751
11752 else if (action_id ==
EActions.ADD_TEMPERATURE)
11753 {
11754 AddTemperature(20);
11755
11756 }
11757
11758 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11759 {
11760 AddTemperature(-20);
11761
11762 }
11763
11764 else if (action_id ==
EActions.FLIP_FROZEN)
11765 {
11766 SetFrozen(!GetIsFrozen());
11767
11768 }
11769
11770 else if (action_id ==
EActions.ADD_WETNESS)
11771 {
11773
11774 }
11775
11776 else if (action_id ==
EActions.REMOVE_WETNESS)
11777 {
11779
11780 }
11781
11782 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11783 {
11786
11787
11788 }
11789
11790 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11791 {
11794 }
11795
11796 else if (action_id ==
EActions.MAKE_SPECIAL)
11797 {
11798 auto debugParams = DebugSpawnParams.WithPlayer(player);
11799 OnDebugSpawnEx(debugParams);
11800 }
11801
11802 }
11803
11804
11805 return false;
11806 }
11807
11808
11809
11810
11814
11817
11818
11819
11821 {
11822 return false;
11823 }
11824
11825
11827 {
11828 return true;
11829 }
11830
11831
11833 {
11834 return true;
11835 }
11836
11837
11838
11840 {
11841 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11843 }
11844
11847 {
11848 return null;
11849 }
11850
11852 {
11853 return false;
11854 }
11855
11857 {
11858 return false;
11859 }
11860
11864
11865
11867 {
11868 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11869 return module_repairing.CanRepair(this, item_repair_kit);
11870 }
11871
11872
11873 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11874 {
11875 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11876 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11877 }
11878
11879
11881 {
11882
11883
11884
11885
11886
11887
11888
11889
11890 return 1;
11891 }
11892
11893
11894
11896 {
11898 }
11899
11900
11901
11903 {
11905 }
11906
11907
11916 {
11917 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11918
11919 if (player)
11920 {
11921 player.MessageStatus(text);
11922 }
11923 }
11924
11925
11934 {
11935 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11936
11937 if (player)
11938 {
11939 player.MessageAction(text);
11940 }
11941 }
11942
11943
11952 {
11953 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11954
11955 if (player)
11956 {
11957 player.MessageFriendly(text);
11958 }
11959 }
11960
11961
11970 {
11971 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11972
11973 if (player)
11974 {
11975 player.MessageImportant(text);
11976 }
11977 }
11978
11980 {
11981 return true;
11982 }
11983
11984
11985 override bool KindOf(
string tag)
11986 {
11987 bool found = false;
11988 string item_name = this.
GetType();
11991
11992 int array_size = item_tag_array.Count();
11993 for (int i = 0; i < array_size; i++)
11994 {
11995 if (item_tag_array.Get(i) == tag)
11996 {
11997 found = true;
11998 break;
11999 }
12000 }
12001 return found;
12002 }
12003
12004
12006 {
12007
12008 super.OnRPC(sender, rpc_type,ctx);
12009
12010
12011 switch (rpc_type)
12012 {
12013 #ifndef SERVER
12014 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12015 Param2<bool, string> p = new Param2<bool, string>(false, "");
12016
12018 return;
12019
12020 bool play = p.param1;
12021 string soundSet = p.param2;
12022
12023 if (play)
12024 {
12026 {
12028 {
12030 }
12031 }
12032 else
12033 {
12035 }
12036 }
12037 else
12038 {
12040 }
12041
12042 break;
12043 #endif
12044
12045 }
12046
12048 {
12050 }
12051 }
12052
12053
12054
12055
12057 {
12058 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12059 return plugin.GetID(
name);
12060 }
12061
12063 {
12064 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12065 return plugin.GetName(id);
12066 }
12067
12070 {
12071
12072
12073 int varFlags;
12074 if (!ctx.
Read(varFlags))
12075 return;
12076
12077 if (varFlags & ItemVariableFlags.FLOAT)
12078 {
12080 }
12081 }
12082
12084 {
12085
12086 super.SerializeNumericalVars(floats_out);
12087
12088
12089
12091 {
12093 }
12094
12096 {
12098 }
12099
12101 {
12103 }
12104
12106 {
12111 }
12112
12114 {
12116 }
12117 }
12118
12120 {
12121
12122 super.DeSerializeNumericalVars(floats);
12123
12124
12125 int index = 0;
12126 int mask = Math.Round(floats.Get(index));
12127
12128 index++;
12129
12131 {
12133 {
12135 }
12136 else
12137 {
12138 float quantity = floats.Get(index);
12139 SetQuantity(quantity,
true,
false,
false,
false);
12140 }
12141 index++;
12142 }
12143
12145 {
12146 float wet = floats.Get(index);
12148 index++;
12149 }
12150
12152 {
12153 int liquidtype = Math.Round(floats.Get(index));
12155 index++;
12156 }
12157
12159 {
12161 index++;
12163 index++;
12165 index++;
12167 index++;
12168 }
12169
12171 {
12172 int cleanness = Math.Round(floats.Get(index));
12174 index++;
12175 }
12176 }
12177
12179 {
12180 super.WriteVarsToCTX(ctx);
12181
12182
12184 {
12186 }
12187
12189 {
12191 }
12192
12194 {
12196 }
12197
12199 {
12200 int r,g,b,a;
12206 }
12207
12209 {
12211 }
12212 }
12213
12215 {
12216 if (!super.ReadVarsFromCTX(ctx,version))
12217 return false;
12218
12219 int intValue;
12220 float value;
12221
12222 if (version < 140)
12223 {
12224 if (!ctx.
Read(intValue))
12225 return false;
12226
12227 m_VariablesMask = intValue;
12228 }
12229
12231 {
12232 if (!ctx.
Read(value))
12233 return false;
12234
12236 {
12238 }
12239 else
12240 {
12242 }
12243 }
12244
12245 if (version < 140)
12246 {
12248 {
12249 if (!ctx.
Read(value))
12250 return false;
12251 SetTemperatureDirect(value);
12252 }
12253 }
12254
12256 {
12257 if (!ctx.
Read(value))
12258 return false;
12260 }
12261
12263 {
12264 if (!ctx.
Read(intValue))
12265 return false;
12267 }
12268
12270 {
12271 int r,g,b,a;
12273 return false;
12275 return false;
12277 return false;
12279 return false;
12280
12282 }
12283
12285 {
12286 if (!ctx.
Read(intValue))
12287 return false;
12289 }
12290
12291 if (version >= 138 && version < 140)
12292 {
12294 {
12295 if (!ctx.
Read(intValue))
12296 return false;
12297 SetFrozen(intValue);
12298 }
12299 }
12300
12301 return true;
12302 }
12303
12304
12306 {
12309 {
12311 }
12312
12313 if (!super.OnStoreLoad(ctx, version))
12314 {
12316 return false;
12317 }
12318
12319 if (version >= 114)
12320 {
12321 bool hasQuickBarIndexSaved;
12322
12323 if (!ctx.
Read(hasQuickBarIndexSaved))
12324 {
12326 return false;
12327 }
12328
12329 if (hasQuickBarIndexSaved)
12330 {
12331 int itmQBIndex;
12332
12333
12334 if (!ctx.
Read(itmQBIndex))
12335 {
12337 return false;
12338 }
12339
12340 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12341 if (itmQBIndex != -1 && parentPlayer)
12342 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12343 }
12344 }
12345 else
12346 {
12347
12348 PlayerBase player;
12349 int itemQBIndex;
12350 if (version ==
int.
MAX)
12351 {
12352 if (!ctx.
Read(itemQBIndex))
12353 {
12355 return false;
12356 }
12357 }
12358 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12359 {
12360
12361 if (!ctx.
Read(itemQBIndex))
12362 {
12364 return false;
12365 }
12366 if (itemQBIndex != -1 && player)
12367 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12368 }
12369 }
12370
12371 if (version < 140)
12372 {
12373
12374 if (!LoadVariables(ctx, version))
12375 {
12377 return false;
12378 }
12379 }
12380
12381
12383 {
12385 return false;
12386 }
12387 if (version >= 132)
12388 {
12390 if (raib)
12391 {
12393 {
12395 return false;
12396 }
12397 }
12398 }
12399
12401 return true;
12402 }
12403
12404
12405
12407 {
12408 super.OnStoreSave(ctx);
12409
12410 PlayerBase player;
12411 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12412 {
12414
12415 int itemQBIndex = -1;
12416 itemQBIndex = player.FindQuickBarEntityIndex(this);
12417 ctx.
Write(itemQBIndex);
12418 }
12419 else
12420 {
12422 }
12423
12425
12427 if (raib)
12428 {
12430 }
12431 }
12432
12433
12435 {
12436 super.AfterStoreLoad();
12437
12439 {
12441 }
12442
12444 {
12447 }
12448 }
12449
12451 {
12452 super.EEOnAfterLoad();
12453
12455 {
12457 }
12458
12461 }
12462
12464 {
12465 return false;
12466 }
12467
12468
12469
12471 {
12473 {
12474 #ifdef PLATFORM_CONSOLE
12475
12477 {
12479 if (menu)
12480 {
12482 }
12483 }
12484 #endif
12485 }
12486
12488 {
12491 }
12492
12494 {
12495 SetWeightDirty();
12497 }
12499 {
12502 }
12503
12505 {
12508 }
12510 {
12513 }
12514
12515 super.OnVariablesSynchronized();
12516 }
12517
12518
12519
12521 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12522 {
12523 if (!IsServerCheck(allow_client))
12524 return false;
12525
12527 return false;
12528
12531
12532 if (value <= (min + 0.001))
12533 value = min;
12534
12535 if (value == min)
12536 {
12537 if (destroy_config)
12538 {
12539 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12540 if (dstr)
12541 {
12543 this.Delete();
12544 return true;
12545 }
12546 }
12547 else if (destroy_forced)
12548 {
12550 this.Delete();
12551 return true;
12552 }
12553
12555 }
12556
12559
12561 {
12563
12564 if (delta)
12566 }
12567
12569
12570 return false;
12571 }
12572
12573
12575 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12576 {
12578 }
12579
12581 {
12584 }
12585
12587 {
12590 }
12591
12593 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12594 {
12595 float value_clamped = Math.Clamp(value, 0, 1);
12597 SetQuantity(result, destroy_config, destroy_forced);
12598 }
12599
12600
12603 {
12605 }
12606
12608 {
12610 }
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12622 {
12623 int slot = -1;
12624 if (GetInventory())
12625 {
12626 InventoryLocation il = new InventoryLocation;
12627 GetInventory().GetCurrentInventoryLocation(il);
12629 }
12630
12632 }
12633
12635 {
12636 float quantity_max = 0;
12637
12639 {
12640 if (attSlotID != -1)
12641 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12642
12643 if (quantity_max <= 0)
12645 }
12646
12647 if (quantity_max <= 0)
12649
12650 return quantity_max;
12651 }
12652
12654 {
12656 }
12657
12659 {
12661 }
12662
12663
12665 {
12667 }
12668
12670 {
12672 }
12673
12675 {
12677 }
12678
12679
12681 {
12682
12683 float weightEx = GetWeightEx();
12684 float special = GetInventoryAndCargoWeight();
12685 return weightEx - special;
12686 }
12687
12688
12690 {
12692 }
12693
12695 {
12697 {
12698 #ifdef DEVELOPER
12699 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12700 {
12701 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12703 }
12704 #endif
12705
12706 return GetQuantity() * GetConfigWeightModified();
12707 }
12708 else if (HasEnergyManager())
12709 {
12710 #ifdef DEVELOPER
12711 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12712 {
12713 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12714 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12715 }
12716 #endif
12717 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12718 }
12719 else
12720 {
12721 #ifdef DEVELOPER
12722 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12723 {
12724 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12725 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12726 }
12727 #endif
12728 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12729 }
12730 }
12731
12734 {
12735 int item_count = 0;
12737
12738 if (GetInventory().GetCargo() != NULL)
12739 {
12740 item_count = GetInventory().GetCargo().GetItemCount();
12741 }
12742
12743 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12744 {
12745 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12746 if (item)
12747 item_count += item.GetNumberOfItems();
12748 }
12749 return item_count;
12750 }
12751
12754 {
12755 float weight = 0;
12756 float wetness = 1;
12757 if (include_wetness)
12760 {
12761 weight = wetness * m_ConfigWeight;
12762 }
12764 {
12765 weight = 1;
12766 }
12767 return weight;
12768 }
12769
12770
12771
12773 {
12774 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12775 {
12776 GameInventory inv = GetInventory();
12777 array<EntityAI> items = new array<EntityAI>;
12779 for (int i = 0; i < items.Count(); i++)
12780 {
12782 if (item)
12783 {
12785 }
12786 }
12787 }
12788 }
12789
12790
12791
12792
12794 {
12795 float energy = 0;
12796 if (HasEnergyManager())
12797 {
12798 energy = GetCompEM().GetEnergy();
12799 }
12800 return energy;
12801 }
12802
12803
12805 {
12806 super.OnEnergyConsumed();
12807
12809 }
12810
12812 {
12813 super.OnEnergyAdded();
12814
12816 }
12817
12818
12820 {
12821 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12822 {
12824 {
12825 float energy_0to1 = GetCompEM().GetEnergy0To1();
12827 }
12828 }
12829 }
12830
12831
12833 {
12834 return ConfigGetFloat("heatIsolation");
12835 }
12836
12838 {
12840 }
12841
12843 {
12844 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12845 if (
GetGame().ConfigIsExisting(paramPath))
12847
12848 return 0.0;
12849 }
12850
12852 {
12853 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12854 if (
GetGame().ConfigIsExisting(paramPath))
12856
12857 return 0.0;
12858 }
12859
12860 override void SetWet(
float value,
bool allow_client =
false)
12861 {
12862 if (!IsServerCheck(allow_client))
12863 return;
12864
12867
12869
12870 m_VarWet = Math.Clamp(value, min, max);
12871
12873 {
12876 }
12877 }
12878
12879 override void AddWet(
float value)
12880 {
12882 }
12883
12885 {
12887 }
12888
12890 {
12892 }
12893
12895 {
12897 }
12898
12900 {
12902 }
12903
12905 {
12907 }
12908
12909 override void OnWetChanged(
float newVal,
float oldVal)
12910 {
12913 if (newLevel != oldLevel)
12914 {
12916 }
12917 }
12918
12920 {
12921 SetWeightDirty();
12922 }
12923
12925 {
12926 return GetWetLevelInternal(
m_VarWet);
12927 }
12928
12929
12930
12932 {
12934 }
12935
12937 {
12939 }
12940
12942 {
12944 }
12945
12947 {
12949 }
12950
12951
12952
12954 {
12955 if (ConfigIsExisting("itemModelLength"))
12956 {
12957 return ConfigGetFloat("itemModelLength");
12958 }
12959 return 0;
12960 }
12961
12963 {
12964 if (ConfigIsExisting("itemAttachOffset"))
12965 {
12966 return ConfigGetFloat("itemAttachOffset");
12967 }
12968 return 0;
12969 }
12970
12971 override void SetCleanness(
int value,
bool allow_client =
false)
12972 {
12973 if (!IsServerCheck(allow_client))
12974 return;
12975
12977
12979
12982 }
12983
12985 {
12987 }
12988
12990 {
12991 return true;
12992 }
12993
12994
12995
12996
12998 {
13000 }
13001
13003 {
13005 }
13006
13007
13008
13009
13010 override void SetColor(
int r,
int g,
int b,
int a)
13011 {
13017 }
13019 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13020 {
13025 }
13026
13028 {
13030 }
13031
13034 {
13035 int r,g,b,a;
13037 r = r/255;
13038 g = g/255;
13039 b = b/255;
13040 a = a/255;
13041 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13042 }
13043
13044
13045
13046 override void SetLiquidType(
int value,
bool allow_client =
false)
13047 {
13048 if (!IsServerCheck(allow_client))
13049 return;
13050
13055 }
13056
13058 {
13059 return ConfigGetInt("varLiquidTypeInit");
13060 }
13061
13063 {
13065 }
13066
13068 {
13070 SetFrozen(false);
13071 }
13072
13075 {
13076 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13077 }
13078
13079
13082 {
13083 PlayerBase nplayer;
13084 if (PlayerBase.CastTo(nplayer, player))
13085 {
13087
13088 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13089 }
13090 }
13091
13092
13095 {
13096 PlayerBase nplayer;
13097 if (PlayerBase.CastTo(nplayer,player))
13098 {
13099
13100 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13101
13102 }
13103
13104
13105 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13106
13107
13108 if (HasEnergyManager())
13109 {
13110 GetCompEM().UpdatePlugState();
13111 }
13112 }
13113
13114
13116 {
13117 super.OnPlacementStarted(player);
13118
13120 }
13121
13122 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13123 {
13125 {
13126 m_AdminLog.OnPlacementComplete(player,
this);
13127 }
13128
13129 super.OnPlacementComplete(player, position, orientation);
13130 }
13131
13132
13133
13134
13135
13137 {
13139 {
13140 return true;
13141 }
13142 else
13143 {
13144 return false;
13145 }
13146 }
13147
13148
13150 {
13152 {
13154 }
13155 }
13156
13157
13159 {
13161 }
13162
13164 {
13166 }
13167
13168 override void InsertAgent(
int agent,
float count = 1)
13169 {
13170 if (count < 1)
13171 return;
13172
13174 }
13175
13178 {
13180 }
13181
13182
13184 {
13186 }
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13230 {
13232 return false;
13233 return true;
13234 }
13235
13237 {
13238
13240 }
13241
13242
13245 {
13246 super.CheckForRoofLimited(timeTresholdMS);
13247
13249 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13250 {
13251 m_PreviousRoofTestTime = time;
13252 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13253 }
13254 }
13255
13256
13258 {
13260 {
13261 return 0;
13262 }
13263
13264 if (GetInventory().GetAttachmentSlotsCount() != 0)
13265 {
13266 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13267 if (filter)
13268 return filter.GetProtectionLevel(type, false, system);
13269 else
13270 return 0;
13271 }
13272
13273 string subclassPath, entryName;
13274
13275 switch (type)
13276 {
13278 entryName = "biological";
13279 break;
13281 entryName = "chemical";
13282 break;
13283 default:
13284 entryName = "biological";
13285 break;
13286 }
13287
13288 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13289
13291 }
13292
13293
13294
13297 {
13298 if (!IsMagazine())
13300
13302 }
13303
13304
13305
13306
13307
13312 {
13313 return true;
13314 }
13315
13317 {
13319 }
13320
13321
13322
13323
13324
13326 {
13327 if (parent)
13328 {
13329 if (parent.IsInherited(DayZInfected))
13330 return true;
13331
13332 if (!parent.IsRuined())
13333 return true;
13334 }
13335
13336 return true;
13337 }
13338
13340 {
13341 if (!super.CanPutAsAttachment(parent))
13342 {
13343 return false;
13344 }
13345
13346 if (!IsRuined() && !parent.IsRuined())
13347 {
13348 return true;
13349 }
13350
13351 return false;
13352 }
13353
13355 {
13356
13357
13358
13359
13360 return super.CanReceiveItemIntoCargo(item);
13361 }
13362
13364 {
13365
13366
13367
13368
13369 GameInventory attachmentInv = attachment.GetInventory();
13371 {
13372 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13373 return false;
13374 }
13375
13376 InventoryLocation loc = new InventoryLocation();
13377 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13378 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13379 return false;
13380
13381 return super.CanReceiveAttachment(attachment, slotId);
13382 }
13383
13385 {
13386 if (!super.CanReleaseAttachment(attachment))
13387 return false;
13388
13389 return GetInventory().AreChildrenAccessible();
13390 }
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13413 {
13414 int id = muzzle_owner.GetMuzzleID();
13415 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13416
13417 if (WPOF_array)
13418 {
13419 for (int i = 0; i < WPOF_array.Count(); i++)
13420 {
13421 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13422
13423 if (WPOF)
13424 {
13425 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13426 }
13427 }
13428 }
13429 }
13430
13431
13433 {
13434 int id = muzzle_owner.GetMuzzleID();
13436
13437 if (WPOBE_array)
13438 {
13439 for (int i = 0; i < WPOBE_array.Count(); i++)
13440 {
13441 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13442
13443 if (WPOBE)
13444 {
13445 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13446 }
13447 }
13448 }
13449 }
13450
13451
13453 {
13454 int id = muzzle_owner.GetMuzzleID();
13455 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13456
13457 if (WPOOH_array)
13458 {
13459 for (int i = 0; i < WPOOH_array.Count(); i++)
13460 {
13461 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13462
13463 if (WPOOH)
13464 {
13465 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13466 }
13467 }
13468 }
13469 }
13470
13471
13473 {
13474 int id = muzzle_owner.GetMuzzleID();
13475 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13476
13477 if (WPOOH_array)
13478 {
13479 for (int i = 0; i < WPOOH_array.Count(); i++)
13480 {
13481 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13482
13483 if (WPOOH)
13484 {
13485 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13486 }
13487 }
13488 }
13489 }
13490
13491
13493 {
13494 int id = muzzle_owner.GetMuzzleID();
13495 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13496
13497 if (WPOOH_array)
13498 {
13499 for (int i = 0; i < WPOOH_array.Count(); i++)
13500 {
13501 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13502
13503 if (WPOOH)
13504 {
13505 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13506 }
13507 }
13508 }
13509 }
13510
13511
13512
13514 {
13516 {
13517 return true;
13518 }
13519
13520 return false;
13521 }
13522
13524 {
13526 {
13527 return true;
13528 }
13529
13530 return false;
13531 }
13532
13534 {
13536 {
13537 return true;
13538 }
13539
13540 return false;
13541 }
13542
13544 {
13545 return false;
13546 }
13547
13550 {
13551 return UATimeSpent.DEFAULT_DEPLOY;
13552 }
13553
13554
13555
13556
13558 {
13560 SetSynchDirty();
13561 }
13562
13564 {
13566 }
13567
13568
13570 {
13571 return false;
13572 }
13573
13576 {
13577 string att_type = "None";
13578
13579 if (ConfigIsExisting("soundAttType"))
13580 {
13581 att_type = ConfigGetString("soundAttType");
13582 }
13583
13585 }
13586
13588 {
13590 }
13591
13592
13593
13594
13595
13601
13603 {
13606
13608 }
13609
13610
13612 {
13614 return;
13615
13617
13620
13623
13624 SoundParameters params = new SoundParameters();
13628 }
13629
13630
13632 {
13634 return;
13635
13637 SetSynchDirty();
13638
13641 }
13642
13643
13645 {
13647 return;
13648
13650 SetSynchDirty();
13651
13654 }
13655
13657 {
13659 }
13660
13662 {
13664 }
13665
13668 {
13669 if (!
GetGame().IsDedicatedServer())
13670 {
13671 if (ConfigIsExisting("attachSoundSet"))
13672 {
13673 string cfg_path = "";
13674 string soundset = "";
13675 string type_name =
GetType();
13676
13679 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13680 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13681
13682 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13683 {
13684 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13685 {
13686 if (cfg_slot_array[i] == slot_type)
13687 {
13688 soundset = cfg_soundset_array[i];
13689 break;
13690 }
13691 }
13692 }
13693
13694 if (soundset != "")
13695 {
13696 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13698 }
13699 }
13700 }
13701 }
13702
13704 {
13705
13706 }
13707
13708 void OnApply(PlayerBase player);
13709
13711 {
13712 return 1.0;
13713 };
13714
13716 {
13718 }
13719
13721 {
13723 }
13724
13726
13728 {
13729 SetDynamicPhysicsLifeTime(0.01);
13731 }
13732
13734 {
13735 array<string> zone_names = new array<string>;
13736 GetDamageZones(zone_names);
13737 for (int i = 0; i < zone_names.Count(); i++)
13738 {
13739 SetHealthMax(zone_names.Get(i),"Health");
13740 }
13741 SetHealthMax("","Health");
13742 }
13743
13746 {
13747 float global_health = GetHealth01("","Health");
13748 array<string> zones = new array<string>;
13749 GetDamageZones(zones);
13750
13751 for (int i = 0; i < zones.Count(); i++)
13752 {
13753 SetHealth01(zones.Get(i),"Health",global_health);
13754 }
13755 }
13756
13759 {
13760 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13761 }
13762
13764 {
13765 if (!hasRootAsPlayer)
13766 {
13767 if (refParentIB)
13768 {
13769
13770 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13771 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13772
13773 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13774 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13775
13778 }
13779 else
13780 {
13781
13784 }
13785 }
13786 }
13787
13789 {
13791 {
13792 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13793 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13794 {
13795 float heatPermCoef = 1.0;
13797 while (ent)
13798 {
13799 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13800 ent = ent.GetHierarchyParent();
13801 }
13802
13803 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13804 }
13805 }
13806 }
13807
13809 {
13810
13811 EntityAI parent = GetHierarchyParent();
13812 if (!parent)
13813 {
13814 hasParent = false;
13815 hasRootAsPlayer = false;
13816 }
13817 else
13818 {
13819 hasParent = true;
13820 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13821 refParentIB =
ItemBase.Cast(parent);
13822 }
13823 }
13824
13825 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13826 {
13827
13828 }
13829
13831 {
13832
13833 return false;
13834 }
13835
13837 {
13838
13839
13840 return false;
13841 }
13842
13844 {
13845
13846 return false;
13847 }
13848
13851 {
13852 return !GetIsFrozen() &&
IsOpen();
13853 }
13854
13856 {
13857 bool hasParent = false, hasRootAsPlayer = false;
13859
13860 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13861 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13862
13863 if (wwtu || foodDecay)
13864 {
13868
13869 if (processWetness || processTemperature || processDecay)
13870 {
13872
13873 if (processWetness)
13874 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13875
13876 if (processTemperature)
13878
13879 if (processDecay)
13880 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13881 }
13882 }
13883 }
13884
13887 {
13889 }
13890
13892 {
13895
13896 return super.GetTemperatureFreezeThreshold();
13897 }
13898
13900 {
13903
13904 return super.GetTemperatureThawThreshold();
13905 }
13906
13908 {
13911
13912 return super.GetItemOverheatThreshold();
13913 }
13914
13916 {
13918 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13919
13920 return super.GetTemperatureFreezeTime();
13921 }
13922
13924 {
13926 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13927
13928 return super.GetTemperatureThawTime();
13929 }
13930
13935
13937 {
13938 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13939 }
13940
13942 {
13943 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13944 }
13945
13948 {
13950 }
13951
13953 {
13955 }
13956
13958 {
13960 }
13961
13964 {
13965 return null;
13966 }
13967
13970 {
13971 return false;
13972 }
13973
13975 {
13977 {
13980 if (!trg)
13981 {
13983 explosive = this;
13984 }
13985
13986 explosive.PairRemote(trg);
13988
13989 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13990 trg.SetPersistentPairID(persistentID);
13991 explosive.SetPersistentPairID(persistentID);
13992
13993 return true;
13994 }
13995 return false;
13996 }
13997
14000 {
14001 float ret = 1.0;
14004 ret *= GetHealth01();
14005
14006 return ret;
14007 }
14008
14009 #ifdef DEVELOPER
14010 override void SetDebugItem()
14011 {
14012 super.SetDebugItem();
14013 _itemBase = this;
14014 }
14015
14017 {
14018 string text = super.GetDebugText();
14019
14021 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14022
14023 return text;
14024 }
14025 #endif
14026
14028 {
14029 return true;
14030 }
14031
14033
14035
14037 {
14040 }
14041
14042
14050
14066}
14067
14069{
14071 if (entity)
14072 {
14073 bool is_item = entity.IsInherited(
ItemBase);
14074 if (is_item && full_quantity)
14075 {
14078 }
14079 }
14080 else
14081 {
14083 return NULL;
14084 }
14085 return entity;
14086}
14087
14089{
14090 if (item)
14091 {
14092 if (health > 0)
14093 item.SetHealth("", "", health);
14094
14095 if (item.CanHaveTemperature())
14096 {
14098 if (item.CanFreeze())
14099 item.SetFrozen(false);
14100 }
14101
14102 if (item.HasEnergyManager())
14103 {
14104 if (quantity >= 0)
14105 {
14106 item.GetCompEM().SetEnergy0To1(quantity);
14107 }
14108 else
14109 {
14111 }
14112 }
14113 else if (item.IsMagazine())
14114 {
14115 Magazine mag = Magazine.Cast(item);
14116 if (quantity >= 0)
14117 {
14118 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14119 }
14120 else
14121 {
14123 }
14124
14125 }
14126 else
14127 {
14128 if (quantity >= 0)
14129 {
14130 item.SetQuantityNormalized(quantity, false);
14131 }
14132 else
14133 {
14135 }
14136
14137 }
14138 }
14139}
14140
14141#ifdef DEVELOPER
14143#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.