9212{
9214 {
9215 return true;
9216 }
9217};
9218
9219
9220
9222{
9226
9228
9231
9232
9233
9234
9235
9244
9250
9255
9260
9281 protected bool m_IsResultOfSplit
9282
9284
9289
9290
9291
9293
9297
9298
9299
9301
9304
9305
9306
9312
9313
9321
9324
9325
9327
9328
9330
9331
9336
9337
9342
9343
9345
9346
9348 {
9353
9354 if (!
GetGame().IsDedicatedServer())
9355 {
9357 {
9359
9361 {
9363 }
9364 }
9365
9368 }
9369
9370 m_OldLocation = null;
9371
9373 {
9375 }
9376
9377 if (ConfigIsExisting("headSelectionsToHide"))
9378 {
9381 }
9382
9384 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9385 {
9387 }
9388
9390
9391 m_IsResultOfSplit = false;
9392
9394 }
9395
9397 {
9398 super.InitItemVariables();
9399
9405 m_Count = ConfigGetInt(
"count");
9406
9409
9414
9417
9422
9434
9438
9439
9442 if (ConfigIsExisting("canBeSplit"))
9443 {
9446 }
9447
9449 if (ConfigIsExisting("itemBehaviour"))
9451
9452
9455 RegisterNetSyncVariableInt("m_VarLiquidType");
9456 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9457
9458 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9459 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9460 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9461
9462 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9463 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9464 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9465 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9466
9467 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9468 RegisterNetSyncVariableBool("m_IsTakeable");
9469 RegisterNetSyncVariableBool("m_IsHologram");
9470
9473 {
9476 }
9477
9479
9481 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9483
9484 }
9485
9487 {
9489 }
9490
9492 {
9495 {
9500 }
9501 }
9502
9503 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9504 {
9506 {
9509 }
9510
9512 }
9513
9515 {
9521 }
9522
9524
9526 {
9528
9529 if (!action)
9530 {
9531 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9532 return;
9533 }
9534
9536 if (!ai)
9537 {
9539 return;
9540 }
9541
9543 if (!action_array)
9544 {
9545 action_array = new array<ActionBase_Basic>;
9547 }
9548 if (LogManager.IsActionLogEnable())
9549 {
9550 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9551 }
9552
9553 if (action_array.Find(action) != -1)
9554 {
9555 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9556 }
9557 else
9558 {
9559 action_array.Insert(action);
9560 }
9561 }
9562
9564 {
9566 ActionBase action = player.GetActionManager().GetAction(actionName);
9569
9570 if (action_array)
9571 {
9572 action_array.RemoveItem(action);
9573 }
9574 }
9575
9576
9577
9579 {
9580 ActionOverrideData overrideData = new ActionOverrideData();
9584
9586 if (!actionMap)
9587 {
9590 }
9591
9592 actionMap.Insert(this.
Type(), overrideData);
9593
9594 }
9595
9597
9599
9600
9602 {
9605
9608
9609 string config_to_search = "CfgVehicles";
9610 string muzzle_owner_config;
9611
9613 {
9614 if (IsInherited(Weapon))
9615 config_to_search = "CfgWeapons";
9616
9617 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9618
9619 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9620
9622
9623 if (config_OnFire_subclass_count > 0)
9624 {
9625 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9626
9627 for (int i = 0; i < config_OnFire_subclass_count; i++)
9628 {
9629 string particle_class = "";
9631 string config_OnFire_entry = config_OnFire_class + particle_class;
9632 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9633 WPOF_array.Insert(WPOF);
9634 }
9635
9636
9638 }
9639 }
9640
9642 {
9643 config_to_search = "CfgWeapons";
9644 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9645
9646 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9647
9649
9650 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9651 {
9652 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9653
9654 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9655 {
9656 string particle_class2 = "";
9658 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9659 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9660 WPOBE_array.Insert(WPOBE);
9661 }
9662
9663
9665 }
9666 }
9667 }
9668
9669
9671 {
9674
9676 {
9677 string config_to_search = "CfgVehicles";
9678
9679 if (IsInherited(Weapon))
9680 config_to_search = "CfgWeapons";
9681
9682 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9683 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9684
9685 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9686 {
9687
9689
9691 {
9693 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9695 return;
9696 }
9697
9700
9701
9702
9704 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9705
9706 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9707 {
9708 string particle_class = "";
9710 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9712
9713 if (entry_type == CT_CLASS)
9714 {
9715 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9716 WPOOH_array.Insert(WPOF);
9717 }
9718 }
9719
9720
9722 }
9723 }
9724 }
9725
9727 {
9729 }
9730
9732 {
9734 {
9736
9739
9742
9743 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9744 }
9745 }
9746
9748 {
9750 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9751
9753 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9754
9756 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9757
9759 {
9761 }
9762 }
9763
9765 {
9767 }
9768
9770 {
9773 else
9775
9777 {
9780 }
9781 else
9782 {
9785
9788 }
9789
9791 }
9792
9794 {
9796 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9797 }
9798
9800 {
9802 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9804 }
9805
9807 {
9809 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9810 }
9811
9813 {
9816
9817 OverheatingParticle OP = new OverheatingParticle();
9822
9824 }
9825
9827 {
9830
9831 return -1;
9832 }
9833
9835 {
9837 {
9840
9841 for (int i = count; i > 0; --i)
9842 {
9843 int id = i - 1;
9846
9849
9850 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9851 {
9852 if (p)
9853 {
9856 }
9857 }
9858 }
9859 }
9860 }
9861
9863 {
9865 {
9867 {
9868 int id = i - 1;
9870
9871 if (OP)
9872 {
9874
9875 if (p)
9876 {
9878 }
9879
9880 delete OP;
9881 }
9882 }
9883
9886 }
9887 }
9888
9891 {
9892 return 0.0;
9893 }
9894
9895
9897 {
9898 return 250;
9899 }
9900
9902 {
9903 return 0;
9904 }
9905
9908 {
9910 return true;
9911
9912 return false;
9913 }
9914
9917 {
9920
9922 {
9924 }
9925 else
9926 {
9927
9929 }
9930
9932 }
9933
9940 {
9941 return -1;
9942 }
9943
9944
9945
9946
9948 {
9950 {
9952 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9953
9954 if (r_index >= 0)
9955 {
9956 InventoryLocation r_il = new InventoryLocation;
9957 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9958
9959 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9962 {
9963 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9964 }
9966 {
9967 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9968 }
9969
9970 }
9971
9972 player.GetHumanInventory().ClearUserReservedLocation(this);
9973 }
9974
9977 }
9978
9979
9980
9981
9983 {
9984 return ItemBase.m_DebugActionsMask;
9985 }
9986
9988 {
9989 return ItemBase.m_DebugActionsMask & mask;
9990 }
9991
9993 {
9994 ItemBase.m_DebugActionsMask = mask;
9995 }
9996
9998 {
9999 ItemBase.m_DebugActionsMask |= mask;
10000 }
10001
10003 {
10004 ItemBase.m_DebugActionsMask &= ~mask;
10005 }
10006
10008 {
10010 {
10012 }
10013 else
10014 {
10016 }
10017 }
10018
10019
10021 {
10022 if (GetEconomyProfile())
10023 {
10024 float q_max = GetEconomyProfile().GetQuantityMax();
10025 if (q_max > 0)
10026 {
10027 float q_min = GetEconomyProfile().GetQuantityMin();
10028 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10029
10031 {
10032 ComponentEnergyManager comp = GetCompEM();
10034 {
10036 }
10037 }
10039 {
10041
10042 }
10043
10044 }
10045 }
10046 }
10047
10050 {
10051 EntityAI parent = GetHierarchyParent();
10052
10053 if (parent)
10054 {
10055 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10056 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10057 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10058 }
10059 }
10060
10063 {
10064 EntityAI parent = GetHierarchyParent();
10065
10066 if (parent)
10067 {
10068 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10069 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10070 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10071 }
10072 }
10073
10075 {
10076
10077
10078
10079
10081
10083 {
10084 if (ScriptInputUserData.CanStoreInputUserData())
10085 {
10086 ScriptInputUserData ctx = new ScriptInputUserData;
10092 ctx.
Write(use_stack_max);
10095
10097 {
10098 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10099 }
10100 }
10101 }
10102 else if (!
GetGame().IsMultiplayer())
10103 {
10105 }
10106 }
10107
10109 {
10111 }
10112
10114 {
10116 }
10117
10119 {
10121 }
10122
10124 {
10125
10126 return false;
10127 }
10128
10130 {
10131 return false;
10132 }
10133
10137 {
10138 return false;
10139 }
10140
10142 {
10143 return "";
10144 }
10145
10147
10149 {
10150 return false;
10151 }
10152
10154 {
10155 return true;
10156 }
10157
10158
10159
10161 {
10162 return true;
10163 }
10164
10166 {
10167 return true;
10168 }
10169
10171 {
10172 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10174 }
10175
10177 {
10179 }
10180
10182 {
10184 if (!is_being_placed)
10186 SetSynchDirty();
10187 }
10188
10189
10191
10193 {
10195 }
10196
10198 {
10200 }
10201
10203 {
10204 return 1;
10205 }
10206
10208 {
10209 return false;
10210 }
10211
10213 {
10215 SetSynchDirty();
10216 }
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10253 {
10254 super.OnMovedInsideCargo(container);
10255
10256 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10257 }
10258
10259 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10260 {
10261 super.EEItemLocationChanged(oldLoc,newLoc);
10262
10263 PlayerBase new_player = null;
10264 PlayerBase old_player = null;
10265
10266 if (newLoc.GetParent())
10267 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10268
10269 if (oldLoc.GetParent())
10270 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10271
10273 {
10274 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10275
10276 if (r_index >= 0)
10277 {
10278 InventoryLocation r_il = new InventoryLocation;
10279 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10280
10281 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10284 {
10285 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10286 }
10288 {
10289 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10290 }
10291
10292 }
10293 }
10294
10296 {
10297 if (new_player)
10298 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10299
10300 if (new_player == old_player)
10301 {
10302
10303 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10304 {
10306 {
10307 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10308 {
10309 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10310 }
10311 }
10312 else
10313 {
10314 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10315 }
10316 }
10317
10318 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10319 {
10320 int type = oldLoc.GetType();
10322 {
10323 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10324 }
10326 {
10327 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10328 }
10329 }
10330 if (!m_OldLocation)
10331 {
10332 m_OldLocation = new InventoryLocation;
10333 }
10334 m_OldLocation.Copy(oldLoc);
10335 }
10336 else
10337 {
10338 if (m_OldLocation)
10339 {
10340 m_OldLocation.Reset();
10341 }
10342 }
10343
10345 }
10346 else
10347 {
10348 if (new_player)
10349 {
10350 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10351 if (res_index >= 0)
10352 {
10353 InventoryLocation il = new InventoryLocation;
10354 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10356 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10359 {
10360 il.
GetParent().GetOnReleaseLock().Invoke(it);
10361 }
10363 {
10365 }
10366
10367 }
10368 }
10370 {
10371
10373 }
10374
10375 if (m_OldLocation)
10376 {
10377 m_OldLocation.Reset();
10378 }
10379 }
10380 }
10381
10382 override void EOnContact(IEntity other, Contact extra)
10383 {
10385 {
10386 int liquidType = -1;
10388 if (impactSpeed > 0.0)
10389 {
10391 #ifndef SERVER
10393 #else
10395 SetSynchDirty();
10396 #endif
10398 }
10399 }
10400
10401 #ifdef SERVER
10402 if (GetCompEM() && GetCompEM().IsPlugged())
10403 {
10404 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10405 GetCompEM().UnplugThis();
10406 }
10407 #endif
10408 }
10409
10411
10413 {
10415 }
10416
10418 {
10419
10420 }
10421
10423 {
10424 super.OnItemLocationChanged(old_owner, new_owner);
10425
10426 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10427 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10428
10429 if (!relatedPlayer && playerNew)
10430 relatedPlayer = playerNew;
10431
10432 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10433 {
10435 if (actionMgr)
10436 {
10437 ActionBase currentAction = actionMgr.GetRunningAction();
10438 if (currentAction)
10440 }
10441 }
10442
10443 Man ownerPlayerOld = null;
10444 Man ownerPlayerNew = null;
10445
10446 if (old_owner)
10447 {
10448 if (old_owner.
IsMan())
10449 {
10450 ownerPlayerOld = Man.Cast(old_owner);
10451 }
10452 else
10453 {
10454 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10455 }
10456 }
10457 else
10458 {
10460 {
10462
10463 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10464 {
10465 GetCompEM().UnplugThis();
10466 }
10467 }
10468 }
10469
10470 if (new_owner)
10471 {
10472 if (new_owner.
IsMan())
10473 {
10474 ownerPlayerNew = Man.Cast(new_owner);
10475 }
10476 else
10477 {
10478 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10479 }
10480 }
10481
10482 if (ownerPlayerOld != ownerPlayerNew)
10483 {
10484 if (ownerPlayerOld)
10485 {
10486 array<EntityAI> subItemsExit = new array<EntityAI>;
10488 for (int i = 0; i < subItemsExit.Count(); i++)
10489 {
10492 }
10493 }
10494
10495 if (ownerPlayerNew)
10496 {
10497 array<EntityAI> subItemsEnter = new array<EntityAI>;
10499 for (int j = 0; j < subItemsEnter.Count(); j++)
10500 {
10503 }
10504 }
10505 }
10506 else if (ownerPlayerNew != null)
10507 {
10508 PlayerBase nplayer;
10509 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10510 {
10511 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10513 for (int k = 0; k < subItemsUpdate.Count(); k++)
10514 {
10516 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10517 }
10518 }
10519 }
10520
10521 if (old_owner)
10522 old_owner.OnChildItemRemoved(this);
10523 if (new_owner)
10524 new_owner.OnChildItemReceived(this);
10525 }
10526
10527
10529 {
10530 super.EEDelete(parent);
10531 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10532 if (player)
10533 {
10535
10536 if (player.IsAlive())
10537 {
10538 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10539 if (r_index >= 0)
10540 {
10541 InventoryLocation r_il = new InventoryLocation;
10542 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10543
10544 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10547 {
10548 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10549 }
10551 {
10552 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10553 }
10554
10555 }
10556
10557 player.RemoveQuickBarEntityShortcut(this);
10558 }
10559 }
10560 }
10561
10563 {
10564 super.EEKilled(killer);
10565
10568 {
10569 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10570 {
10571 if (IsMagazine())
10572 {
10573 if (Magazine.Cast(this).GetAmmoCount() > 0)
10574 {
10576 }
10577 }
10578 else
10579 {
10581 }
10582 }
10583 }
10584 }
10585
10587 {
10588 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10589
10590 super.OnWasAttached(parent, slot_id);
10591
10594
10596 }
10597
10599 {
10600 super.OnWasDetached(parent, slot_id);
10601
10604 }
10605
10607 {
10608 int idx;
10611
10612 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10613 if (inventory_slots.Count() < 1)
10614 {
10615 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10616 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10617 }
10618 else
10619 {
10620 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10621 }
10622
10623 idx = inventory_slots.Find(slot);
10624 if (idx < 0)
10625 return "";
10626
10627 return attach_types.Get(idx);
10628 }
10629
10631 {
10632 int idx = -1;
10633 string slot;
10634
10637
10638 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10639 if (inventory_slots.Count() < 1)
10640 {
10641 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10642 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10643 }
10644 else
10645 {
10646 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10647 if (detach_types.Count() < 1)
10648 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10649 }
10650
10651 for (int i = 0; i < inventory_slots.Count(); i++)
10652 {
10653 slot = inventory_slots.Get(i);
10654 }
10655
10656 if (slot != "")
10657 {
10658 if (detach_types.Count() == 1)
10659 idx = 0;
10660 else
10661 idx = inventory_slots.Find(slot);
10662 }
10663 if (idx < 0)
10664 return "";
10665
10666 return detach_types.Get(idx);
10667 }
10668
10670 {
10671
10673
10674
10675 float min_time = 1;
10676 float max_time = 3;
10677 float delay = Math.RandomFloat(min_time, max_time);
10678
10679 explode_timer.Run(delay, this, "DoAmmoExplosion");
10680 }
10681
10683 {
10684 Magazine magazine = Magazine.Cast(this);
10685 int pop_sounds_count = 6;
10686 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10687
10688
10689 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10690 string sound_name = pop_sounds[ sound_idx ];
10692
10693
10694 magazine.ServerAddAmmoCount(-1);
10695
10696
10697 float min_temp_to_explode = 100;
10698
10699 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10700 {
10702 }
10703 }
10704
10705
10706 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10707 {
10708 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10709
10710 const int CHANCE_DAMAGE_CARGO = 4;
10711 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10712 const int CHANCE_DAMAGE_NOTHING = 2;
10713
10715 {
10716 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10717 int chances;
10718 int rnd;
10719
10720 if (GetInventory().GetCargo())
10721 {
10722 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10723 rnd = Math.RandomInt(0,chances);
10724
10725 if (rnd < CHANCE_DAMAGE_CARGO)
10726 {
10728 }
10729 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10730 {
10732 }
10733 }
10734 else
10735 {
10736 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10737 rnd = Math.RandomInt(0,chances);
10738
10739 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10740 {
10742 }
10743 }
10744 }
10745 }
10746
10748 {
10749 if (GetInventory().GetCargo())
10750 {
10751 int item_count = GetInventory().GetCargo().GetItemCount();
10752 if (item_count > 0)
10753 {
10754 int random_pick = Math.RandomInt(0, item_count);
10756 if (!item.IsExplosive())
10757 {
10758 item.AddHealth("","",damage);
10759 return true;
10760 }
10761 }
10762 }
10763 return false;
10764 }
10765
10767 {
10768 int attachment_count = GetInventory().AttachmentCount();
10769 if (attachment_count > 0)
10770 {
10771 int random_pick = Math.RandomInt(0, attachment_count);
10772 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10773 if (!attachment.IsExplosive())
10774 {
10775 attachment.AddHealth("","",damage);
10776 return true;
10777 }
10778 }
10779 return false;
10780 }
10781
10783 {
10785 }
10786
10788 {
10790 return GetInventory().CanRemoveEntity();
10791
10792 return false;
10793 }
10794
10796 {
10798 return;
10799
10801 {
10802 if (ScriptInputUserData.CanStoreInputUserData())
10803 {
10804 ScriptInputUserData ctx = new ScriptInputUserData;
10809 ctx.
Write(destination_entity);
10811 ctx.
Write(slot_id);
10813 }
10814 }
10815 else if (!
GetGame().IsMultiplayer())
10816 {
10818 }
10819 }
10820
10822 {
10824 return;
10825
10826 float split_quantity_new;
10830 InventoryLocation loc = new InventoryLocation;
10831
10832 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10833 {
10835 split_quantity_new = stack_max;
10836 else
10838
10839 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10840 if (new_item)
10841 {
10842 new_item.SetResultOfSplit(true);
10843 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10845 new_item.SetQuantity(split_quantity_new);
10846 }
10847 }
10848 else if (destination_entity && slot_id == -1)
10849 {
10850 if (quantity > stack_max)
10851 split_quantity_new = stack_max;
10852 else
10853 split_quantity_new = quantity;
10854
10856 {
10859 }
10860
10861 if (new_item)
10862 {
10863 new_item.SetResultOfSplit(true);
10864 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10866 new_item.SetQuantity(split_quantity_new);
10867 }
10868 }
10869 else
10870 {
10871 if (stack_max != 0)
10872 {
10874 {
10876 }
10877
10878 if (split_quantity_new == 0)
10879 {
10880 if (!
GetGame().IsMultiplayer())
10881 player.PhysicalPredictiveDropItem(this);
10882 else
10883 player.ServerDropEntity(this);
10884 return;
10885 }
10886
10888
10889 if (new_item)
10890 {
10891 new_item.SetResultOfSplit(true);
10892 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10894 new_item.SetQuantity(stack_max);
10895 new_item.PlaceOnSurface();
10896 }
10897 }
10898 }
10899 }
10900
10902 {
10904 return;
10905
10906 float split_quantity_new;
10910 InventoryLocation loc = new InventoryLocation;
10911
10912 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10913 {
10915 split_quantity_new = stack_max;
10916 else
10918
10919 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10920 if (new_item)
10921 {
10922 new_item.SetResultOfSplit(true);
10923 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10925 new_item.SetQuantity(split_quantity_new);
10926 }
10927 }
10928 else if (destination_entity && slot_id == -1)
10929 {
10930 if (quantity > stack_max)
10931 split_quantity_new = stack_max;
10932 else
10933 split_quantity_new = quantity;
10934
10936 {
10939 }
10940
10941 if (new_item)
10942 {
10943 new_item.SetResultOfSplit(true);
10944 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10946 new_item.SetQuantity(split_quantity_new);
10947 }
10948 }
10949 else
10950 {
10951 if (stack_max != 0)
10952 {
10954 {
10956 }
10957
10959
10960 if (new_item)
10961 {
10962 new_item.SetResultOfSplit(true);
10963 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10965 new_item.SetQuantity(stack_max);
10966 new_item.PlaceOnSurface();
10967 }
10968 }
10969 }
10970 }
10971
10973 {
10975 return;
10976
10978 {
10979 if (ScriptInputUserData.CanStoreInputUserData())
10980 {
10981 ScriptInputUserData ctx = new ScriptInputUserData;
10986 dst.WriteToContext(ctx);
10988 }
10989 }
10990 else if (!
GetGame().IsMultiplayer())
10991 {
10993 }
10994 }
10995
10997 {
10999 return;
11000
11002 {
11003 if (ScriptInputUserData.CanStoreInputUserData())
11004 {
11005 ScriptInputUserData ctx = new ScriptInputUserData;
11010 ctx.
Write(destination_entity);
11016 }
11017 }
11018 else if (!
GetGame().IsMultiplayer())
11019 {
11021 }
11022 }
11023
11025 {
11027 }
11028
11030 {
11032 return this;
11033
11035 float split_quantity_new;
11037 if (dst.IsValid())
11038 {
11039 int slot_id = dst.GetSlot();
11041
11042 if (quantity > stack_max)
11043 split_quantity_new = stack_max;
11044 else
11045 split_quantity_new = quantity;
11046
11048
11049 if (new_item)
11050 {
11051 new_item.SetResultOfSplit(true);
11052 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11055 }
11056
11057 return new_item;
11058 }
11059
11060 return null;
11061 }
11062
11064 {
11066 return;
11067
11069 float split_quantity_new;
11071 if (destination_entity)
11072 {
11074 if (quantity > stackable)
11075 split_quantity_new = stackable;
11076 else
11077 split_quantity_new = quantity;
11078
11079 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11080 if (new_item)
11081 {
11082 new_item.SetResultOfSplit(true);
11083 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11085 new_item.SetQuantity(split_quantity_new);
11086 }
11087 }
11088 }
11089
11091 {
11093 return;
11094
11096 {
11097 if (ScriptInputUserData.CanStoreInputUserData())
11098 {
11099 ScriptInputUserData ctx = new ScriptInputUserData;
11104 ItemBase destination_entity =
this;
11105 ctx.
Write(destination_entity);
11109 }
11110 }
11111 else if (!
GetGame().IsMultiplayer())
11112 {
11114 }
11115 }
11116
11118 {
11120 return;
11121
11123 float split_quantity_new;
11125 if (player)
11126 {
11128 if (quantity > stackable)
11129 split_quantity_new = stackable;
11130 else
11131 split_quantity_new = quantity;
11132
11133 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11134 new_item =
ItemBase.Cast(in_hands);
11135 if (new_item)
11136 {
11137 new_item.SetResultOfSplit(true);
11138 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11140 new_item.SetQuantity(split_quantity_new);
11141 }
11142 }
11143 }
11144
11146 {
11148 return;
11149
11151 float split_quantity_new = Math.Floor(quantity * 0.5);
11152
11154
11155 if (new_item)
11156 {
11157 if (new_item.GetQuantityMax() < split_quantity_new)
11158 {
11159 split_quantity_new = new_item.GetQuantityMax();
11160 }
11161
11162 new_item.SetResultOfSplit(true);
11163 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11164
11166 {
11169 }
11170 else
11171 {
11174 }
11175 }
11176 }
11177
11179 {
11181 return;
11182
11184 float split_quantity_new = Math.Floor(quantity / 2);
11185
11186 InventoryLocation invloc = new InventoryLocation;
11188
11190 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11191
11192 if (new_item)
11193 {
11194 if (new_item.GetQuantityMax() < split_quantity_new)
11195 {
11196 split_quantity_new = new_item.GetQuantityMax();
11197 }
11199 {
11202 }
11203 else
11204 {
11207 }
11208 }
11209 }
11210
11213 {
11214 SetWeightDirty();
11216
11217 if (parent)
11218 parent.OnAttachmentQuantityChangedEx(this, delta);
11219
11221 {
11223 {
11225 }
11227 {
11228 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11230 }
11231 }
11232
11233 }
11234
11237 {
11238
11239 }
11240
11243 {
11245 }
11246
11248 {
11249 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11250
11252 {
11253 if (newLevel == GameConstants.STATE_RUINED)
11254 {
11256 EntityAI parent = GetHierarchyParent();
11257 if (parent && parent.IsFireplace())
11258 {
11259 CargoBase cargo = GetInventory().GetCargo();
11260 if (cargo)
11261 {
11263 {
11265 }
11266 }
11267 }
11268 }
11269
11271 {
11272
11274 return;
11275 }
11276
11277 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11278 {
11280 }
11281 }
11282 }
11283
11284
11286 {
11287 super.OnRightClick();
11288
11290 {
11292 {
11293 if (ScriptInputUserData.CanStoreInputUserData())
11294 {
11295 vector m4[4];
11297
11298 EntityAI root = GetHierarchyRoot();
11299
11300 InventoryLocation dst = new InventoryLocation;
11302 {
11303 if (root)
11304 {
11305 root.GetTransform(m4);
11307 }
11308 else
11309 GetInventory().GetCurrentInventoryLocation(dst);
11310 }
11311 else
11312 {
11314
11315
11316 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11317 {
11318 if (root)
11319 {
11320 root.GetTransform(m4);
11322 }
11323 else
11324 GetInventory().GetCurrentInventoryLocation(dst);
11325 }
11326 else
11327 {
11328 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11329 }
11330 }
11331
11332 ScriptInputUserData ctx = new ScriptInputUserData;
11340 }
11341 }
11342 else if (!
GetGame().IsMultiplayer())
11343 {
11345 }
11346 }
11347 }
11348
11349 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11350 {
11351
11352 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11353 return false;
11354
11355 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11356 return false;
11357
11358
11360 return false;
11361
11362
11363 Magazine mag = Magazine.Cast(this);
11364 if (mag)
11365 {
11366 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11367 return false;
11368
11369 if (stack_max_limit)
11370 {
11371 Magazine other_mag = Magazine.Cast(other_item);
11372 if (other_item)
11373 {
11374 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11375 return false;
11376 }
11377
11378 }
11379 }
11380 else
11381 {
11382
11384 return false;
11385
11387 return false;
11388 }
11389
11390 PlayerBase player = null;
11391 if (CastTo(player, GetHierarchyRootPlayer()))
11392 {
11393 if (player.GetInventory().HasAttachment(this))
11394 return false;
11395
11396 if (player.IsItemsToDelete())
11397 return false;
11398 }
11399
11400 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11401 return false;
11402
11403 int slotID;
11405 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11406 return false;
11407
11408 return true;
11409 }
11410
11412 {
11414 }
11415
11417 {
11418 return m_IsResultOfSplit;
11419 }
11420
11422 {
11423 m_IsResultOfSplit = value;
11424 }
11425
11427 {
11429 }
11430
11432 {
11433 float other_item_quantity = other_item.GetQuantity();
11434 float this_free_space;
11435
11437
11439
11440 if (other_item_quantity > this_free_space)
11441 {
11442 return this_free_space;
11443 }
11444 else
11445 {
11446 return other_item_quantity;
11447 }
11448 }
11449
11451 {
11453 }
11454
11456 {
11458 return;
11459
11460 if (!IsMagazine() && other_item)
11461 {
11463 if (quantity_used != 0)
11464 {
11465 float hp1 = GetHealth01("","");
11466 float hp2 = other_item.GetHealth01("","");
11467 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11468 hpResult = hpResult / (
GetQuantity() + quantity_used);
11469
11470 hpResult *= GetMaxHealth();
11471 Math.Round(hpResult);
11472 SetHealth("", "Health", hpResult);
11473
11475 other_item.AddQuantity(-quantity_used);
11476 }
11477 }
11479 }
11480
11482 {
11483 #ifdef SERVER
11484 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11485 GetHierarchyParent().IncreaseLifetimeUp();
11486 #endif
11487 };
11488
11490 {
11491 PlayerBase p = PlayerBase.Cast(player);
11492
11493 array<int> recipesIds = p.m_Recipes;
11494 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11495 if (moduleRecipesManager)
11496 {
11497 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11498 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11499 }
11500
11501 for (int i = 0;i < recipesIds.Count(); i++)
11502 {
11503 int key = recipesIds.Get(i);
11504 string recipeName = moduleRecipesManager.GetRecipeName(key);
11506 }
11507 }
11508
11509
11510 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11511 {
11512 super.GetDebugActions(outputList);
11513
11514
11519
11520
11524
11528
11529
11532
11533
11535 {
11538 }
11539
11541
11544
11548 }
11549
11550
11551
11552
11554 {
11555 super.OnAction(action_id, player, ctx);
11556 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11557 {
11558 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11559 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11560 PlayerBase p = PlayerBase.Cast(player);
11561 if (
EActions.RECIPES_RANGE_START < 1000)
11562 {
11563 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11564 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11565 }
11566 }
11567 #ifndef SERVER
11568 else if (action_id ==
EActions.WATCH_PLAYER)
11569 {
11570 PluginDeveloper.SetDeveloperItemClientEx(player);
11571 }
11572 #endif
11574 {
11575 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11576 {
11577 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11578 OnDebugButtonPressServer(id + 1);
11579 }
11580
11581 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11582 {
11583 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11585 }
11586
11587 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11588 {
11589 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11591 }
11592
11593 else if (action_id ==
EActions.ADD_QUANTITY)
11594 {
11595 if (IsMagazine())
11596 {
11597 Magazine mag = Magazine.Cast(this);
11598 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11599 }
11600 else
11601 {
11603 }
11604
11605 if (m_EM)
11606 {
11607 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11608 }
11609
11610 }
11611
11612 else if (action_id ==
EActions.REMOVE_QUANTITY)
11613 {
11614 if (IsMagazine())
11615 {
11616 Magazine mag2 = Magazine.Cast(this);
11617 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11618 }
11619 else
11620 {
11622 }
11623 if (m_EM)
11624 {
11625 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11626 }
11627
11628 }
11629
11630 else if (action_id ==
EActions.SET_QUANTITY_0)
11631 {
11633
11634 if (m_EM)
11635 {
11636 m_EM.SetEnergy(0);
11637 }
11638 }
11639
11640 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11641 {
11643
11644 if (m_EM)
11645 {
11646 m_EM.SetEnergy(m_EM.GetEnergyMax());
11647 }
11648 }
11649
11650 else if (action_id ==
EActions.ADD_HEALTH)
11651 {
11652 AddHealth("","",GetMaxHealth("","Health")/5);
11653 }
11654 else if (action_id ==
EActions.REMOVE_HEALTH)
11655 {
11656 AddHealth("","",-GetMaxHealth("","Health")/5);
11657 }
11658 else if (action_id ==
EActions.DESTROY_HEALTH)
11659 {
11660 SetHealth01("","",0);
11661 }
11662 else if (action_id ==
EActions.WATCH_ITEM)
11663 {
11665 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11666 #ifdef DEVELOPER
11667 SetDebugDeveloper_item(this);
11668 #endif
11669 }
11670
11671 else if (action_id ==
EActions.ADD_TEMPERATURE)
11672 {
11673 AddTemperature(20);
11674
11675 }
11676
11677 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11678 {
11679 AddTemperature(-20);
11680
11681 }
11682
11683 else if (action_id ==
EActions.FLIP_FROZEN)
11684 {
11685 SetFrozen(!GetIsFrozen());
11686
11687 }
11688
11689 else if (action_id ==
EActions.ADD_WETNESS)
11690 {
11692
11693 }
11694
11695 else if (action_id ==
EActions.REMOVE_WETNESS)
11696 {
11698
11699 }
11700
11701 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11702 {
11705
11706
11707 }
11708
11709 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11710 {
11713 }
11714
11715 else if (action_id ==
EActions.MAKE_SPECIAL)
11716 {
11717 auto debugParams = DebugSpawnParams.WithPlayer(player);
11718 OnDebugSpawnEx(debugParams);
11719 }
11720
11721 else if (action_id ==
EActions.DELETE)
11722 {
11723 Delete();
11724 }
11725
11726 }
11727
11728
11729 return false;
11730 }
11731
11732
11733
11734
11738
11741
11742
11743
11745 {
11746 return false;
11747 }
11748
11749
11751 {
11752 return true;
11753 }
11754
11755
11757 {
11758 return true;
11759 }
11760
11761
11762
11764 {
11765 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11767 }
11768
11771 {
11772 return null;
11773 }
11774
11776 {
11777 return false;
11778 }
11779
11781 {
11782 return false;
11783 }
11784
11788
11789
11791 {
11792 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11793 return module_repairing.CanRepair(this, item_repair_kit);
11794 }
11795
11796
11797 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11798 {
11799 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11800 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11801 }
11802
11803
11805 {
11806
11807
11808
11809
11810
11811
11812
11813
11814 return 1;
11815 }
11816
11817
11818
11820 {
11822 }
11823
11824
11825
11827 {
11829 }
11830
11831
11840 {
11841 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11842
11843 if (player)
11844 {
11845 player.MessageStatus(text);
11846 }
11847 }
11848
11849
11858 {
11859 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11860
11861 if (player)
11862 {
11863 player.MessageAction(text);
11864 }
11865 }
11866
11867
11876 {
11877 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11878
11879 if (player)
11880 {
11881 player.MessageFriendly(text);
11882 }
11883 }
11884
11885
11894 {
11895 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11896
11897 if (player)
11898 {
11899 player.MessageImportant(text);
11900 }
11901 }
11902
11904 {
11905 return true;
11906 }
11907
11908
11909 override bool KindOf(
string tag)
11910 {
11911 bool found = false;
11912 string item_name = this.
GetType();
11915
11916 int array_size = item_tag_array.Count();
11917 for (int i = 0; i < array_size; i++)
11918 {
11919 if (item_tag_array.Get(i) == tag)
11920 {
11921 found = true;
11922 break;
11923 }
11924 }
11925 return found;
11926 }
11927
11928
11930 {
11931
11932 super.OnRPC(sender, rpc_type,ctx);
11933
11934
11935 switch (rpc_type)
11936 {
11937 #ifndef SERVER
11938 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11939 Param2<bool, string> p = new Param2<bool, string>(false, "");
11940
11942 return;
11943
11944 bool play = p.param1;
11945 string soundSet = p.param2;
11946
11947 if (play)
11948 {
11950 {
11952 {
11954 }
11955 }
11956 else
11957 {
11959 }
11960 }
11961 else
11962 {
11964 }
11965
11966 break;
11967 #endif
11968
11969 }
11970
11972 {
11974 }
11975 }
11976
11977
11978
11979
11981 {
11982 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11983 return plugin.GetID(
name);
11984 }
11985
11987 {
11988 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11989 return plugin.GetName(id);
11990 }
11991
11994 {
11995
11996
11997 int varFlags;
11998 if (!ctx.
Read(varFlags))
11999 return;
12000
12001 if (varFlags & ItemVariableFlags.FLOAT)
12002 {
12004 }
12005 }
12006
12008 {
12009
12010 super.SerializeNumericalVars(floats_out);
12011
12012
12013
12015 {
12017 }
12018
12020 {
12022 }
12023
12025 {
12027 }
12028
12030 {
12035 }
12036
12038 {
12040 }
12041 }
12042
12044 {
12045
12046 super.DeSerializeNumericalVars(floats);
12047
12048
12049 int index = 0;
12050 int mask = Math.Round(floats.Get(index));
12051
12052 index++;
12053
12055 {
12057 {
12059 }
12060 else
12061 {
12062 float quantity = floats.Get(index);
12063 SetQuantity(quantity,
true,
false,
false,
false);
12064 }
12065 index++;
12066 }
12067
12069 {
12070 float wet = floats.Get(index);
12072 index++;
12073 }
12074
12076 {
12077 int liquidtype = Math.Round(floats.Get(index));
12079 index++;
12080 }
12081
12083 {
12085 index++;
12087 index++;
12089 index++;
12091 index++;
12092 }
12093
12095 {
12096 int cleanness = Math.Round(floats.Get(index));
12098 index++;
12099 }
12100 }
12101
12103 {
12104 super.WriteVarsToCTX(ctx);
12105
12106
12108 {
12110 }
12111
12113 {
12115 }
12116
12118 {
12120 }
12121
12123 {
12124 int r,g,b,a;
12130 }
12131
12133 {
12135 }
12136 }
12137
12139 {
12140 if (!super.ReadVarsFromCTX(ctx,version))
12141 return false;
12142
12143 int intValue;
12144 float value;
12145
12146 if (version < 140)
12147 {
12148 if (!ctx.
Read(intValue))
12149 return false;
12150
12151 m_VariablesMask = intValue;
12152 }
12153
12155 {
12156 if (!ctx.
Read(value))
12157 return false;
12158
12160 {
12162 }
12163 else
12164 {
12166 }
12167 }
12168
12169 if (version < 140)
12170 {
12172 {
12173 if (!ctx.
Read(value))
12174 return false;
12175 SetTemperatureDirect(value);
12176 }
12177 }
12178
12180 {
12181 if (!ctx.
Read(value))
12182 return false;
12184 }
12185
12187 {
12188 if (!ctx.
Read(intValue))
12189 return false;
12191 }
12192
12194 {
12195 int r,g,b,a;
12197 return false;
12199 return false;
12201 return false;
12203 return false;
12204
12206 }
12207
12209 {
12210 if (!ctx.
Read(intValue))
12211 return false;
12213 }
12214
12215 if (version >= 138 && version < 140)
12216 {
12218 {
12219 if (!ctx.
Read(intValue))
12220 return false;
12221 SetFrozen(intValue);
12222 }
12223 }
12224
12225 return true;
12226 }
12227
12228
12230 {
12233 {
12235 }
12236
12237 if (!super.OnStoreLoad(ctx, version))
12238 {
12240 return false;
12241 }
12242
12243 if (version >= 114)
12244 {
12245 bool hasQuickBarIndexSaved;
12246
12247 if (!ctx.
Read(hasQuickBarIndexSaved))
12248 {
12250 return false;
12251 }
12252
12253 if (hasQuickBarIndexSaved)
12254 {
12255 int itmQBIndex;
12256
12257
12258 if (!ctx.
Read(itmQBIndex))
12259 {
12261 return false;
12262 }
12263
12264 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12265 if (itmQBIndex != -1 && parentPlayer)
12266 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12267 }
12268 }
12269 else
12270 {
12271
12272 PlayerBase player;
12273 int itemQBIndex;
12274 if (version ==
int.
MAX)
12275 {
12276 if (!ctx.
Read(itemQBIndex))
12277 {
12279 return false;
12280 }
12281 }
12282 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12283 {
12284
12285 if (!ctx.
Read(itemQBIndex))
12286 {
12288 return false;
12289 }
12290 if (itemQBIndex != -1 && player)
12291 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12292 }
12293 }
12294
12295 if (version < 140)
12296 {
12297
12298 if (!LoadVariables(ctx, version))
12299 {
12301 return false;
12302 }
12303 }
12304
12305
12307 {
12309 return false;
12310 }
12311 if (version >= 132)
12312 {
12314 if (raib)
12315 {
12317 {
12319 return false;
12320 }
12321 }
12322 }
12323
12325 return true;
12326 }
12327
12328
12329
12331 {
12332 super.OnStoreSave(ctx);
12333
12334 PlayerBase player;
12335 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12336 {
12338
12339 int itemQBIndex = -1;
12340 itemQBIndex = player.FindQuickBarEntityIndex(this);
12341 ctx.
Write(itemQBIndex);
12342 }
12343 else
12344 {
12346 }
12347
12349
12351 if (raib)
12352 {
12354 }
12355 }
12356
12357
12359 {
12360 super.AfterStoreLoad();
12361
12363 {
12365 }
12366
12368 {
12371 }
12372 }
12373
12375 {
12376 super.EEOnAfterLoad();
12377
12379 {
12381 }
12382
12385 }
12386
12388 {
12389 return false;
12390 }
12391
12392
12393
12395 {
12397 {
12398 #ifdef PLATFORM_CONSOLE
12399
12401 {
12403 if (menu)
12404 {
12406 }
12407 }
12408 #endif
12409 }
12410
12412 {
12415 }
12416
12418 {
12419 SetWeightDirty();
12421 }
12423 {
12426 }
12427
12429 {
12432 }
12434 {
12437 }
12438
12439 super.OnVariablesSynchronized();
12440 }
12441
12442
12443
12445 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12446 {
12447 if (!IsServerCheck(allow_client))
12448 return false;
12449
12451 return false;
12452
12455
12456 if (value <= (min + 0.001))
12457 value = min;
12458
12459 if (value == min)
12460 {
12461 if (destroy_config)
12462 {
12463 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12464 if (dstr)
12465 {
12467 this.Delete();
12468 return true;
12469 }
12470 }
12471 else if (destroy_forced)
12472 {
12474 this.Delete();
12475 return true;
12476 }
12477
12479 }
12480
12483
12485 {
12487
12488 if (delta)
12490 }
12491
12493
12494 return false;
12495 }
12496
12497
12499 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12500 {
12502 }
12503
12505 {
12508 }
12509
12511 {
12514 }
12515
12518 {
12519 float value_clamped = Math.Clamp(value, 0, 1);
12521 SetQuantity(result, destroy_config, destroy_forced);
12522 }
12523
12524
12527 {
12529 }
12530
12532 {
12534 }
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12546 {
12547 int slot = -1;
12548 if (GetInventory())
12549 {
12550 InventoryLocation il = new InventoryLocation;
12551 GetInventory().GetCurrentInventoryLocation(il);
12553 }
12554
12556 }
12557
12559 {
12560 float quantity_max = 0;
12561
12563 {
12564 if (attSlotID != -1)
12565 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12566
12567 if (quantity_max <= 0)
12569 }
12570
12571 if (quantity_max <= 0)
12573
12574 return quantity_max;
12575 }
12576
12578 {
12580 }
12581
12583 {
12585 }
12586
12587
12589 {
12591 }
12592
12594 {
12596 }
12597
12599 {
12601 }
12602
12603
12605 {
12606
12607 float weightEx = GetWeightEx();
12608 float special = GetInventoryAndCargoWeight();
12609 return weightEx - special;
12610 }
12611
12612
12614 {
12616 }
12617
12619 {
12621 {
12622 #ifdef DEVELOPER
12623 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12624 {
12625 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12627 }
12628 #endif
12629
12630 return GetQuantity() * GetConfigWeightModified();
12631 }
12632 else if (HasEnergyManager())
12633 {
12634 #ifdef DEVELOPER
12635 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12636 {
12637 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12638 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12639 }
12640 #endif
12641 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12642 }
12643 else
12644 {
12645 #ifdef DEVELOPER
12646 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12647 {
12648 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12649 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12650 }
12651 #endif
12652 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12653 }
12654 }
12655
12658 {
12659 int item_count = 0;
12661
12662 if (GetInventory().GetCargo() != NULL)
12663 {
12664 item_count = GetInventory().GetCargo().GetItemCount();
12665 }
12666
12667 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12668 {
12669 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12670 if (item)
12671 item_count += item.GetNumberOfItems();
12672 }
12673 return item_count;
12674 }
12675
12678 {
12679 float weight = 0;
12680 float wetness = 1;
12681 if (include_wetness)
12684 {
12685 weight = wetness * m_ConfigWeight;
12686 }
12688 {
12689 weight = 1;
12690 }
12691 return weight;
12692 }
12693
12694
12695
12697 {
12698 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12699 {
12700 GameInventory inv = GetInventory();
12701 array<EntityAI> items = new array<EntityAI>;
12703 for (int i = 0; i < items.Count(); i++)
12704 {
12706 if (item)
12707 {
12709 }
12710 }
12711 }
12712 }
12713
12714
12715
12716
12718 {
12719 float energy = 0;
12720 if (HasEnergyManager())
12721 {
12722 energy = GetCompEM().GetEnergy();
12723 }
12724 return energy;
12725 }
12726
12727
12729 {
12730 super.OnEnergyConsumed();
12731
12733 }
12734
12736 {
12737 super.OnEnergyAdded();
12738
12740 }
12741
12742
12744 {
12745 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12746 {
12748 {
12749 float energy_0to1 = GetCompEM().GetEnergy0To1();
12751 }
12752 }
12753 }
12754
12755
12757 {
12758 return ConfigGetFloat("heatIsolation");
12759 }
12760
12762 {
12764 }
12765
12767 {
12768 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12769 if (
GetGame().ConfigIsExisting(paramPath))
12771
12772 return 0.0;
12773 }
12774
12776 {
12777 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12778 if (
GetGame().ConfigIsExisting(paramPath))
12780
12781 return 0.0;
12782 }
12783
12784 override void SetWet(
float value,
bool allow_client =
false)
12785 {
12786 if (!IsServerCheck(allow_client))
12787 return;
12788
12791
12793
12794 m_VarWet = Math.Clamp(value, min, max);
12795
12797 {
12800 }
12801 }
12802
12803 override void AddWet(
float value)
12804 {
12806 }
12807
12809 {
12811 }
12812
12814 {
12816 }
12817
12819 {
12821 }
12822
12824 {
12826 }
12827
12829 {
12831 }
12832
12833 override void OnWetChanged(
float newVal,
float oldVal)
12834 {
12837 if (newLevel != oldLevel)
12838 {
12840 }
12841 }
12842
12844 {
12845 SetWeightDirty();
12846 }
12847
12849 {
12850 return GetWetLevelInternal(
m_VarWet);
12851 }
12852
12853
12854
12856 {
12858 }
12859
12861 {
12863 }
12864
12866 {
12868 }
12869
12871 {
12873 }
12874
12875
12876
12878 {
12879 if (ConfigIsExisting("itemModelLength"))
12880 {
12881 return ConfigGetFloat("itemModelLength");
12882 }
12883 return 0;
12884 }
12885
12887 {
12888 if (ConfigIsExisting("itemAttachOffset"))
12889 {
12890 return ConfigGetFloat("itemAttachOffset");
12891 }
12892 return 0;
12893 }
12894
12895 override void SetCleanness(
int value,
bool allow_client =
false)
12896 {
12897 if (!IsServerCheck(allow_client))
12898 return;
12899
12901
12903
12906 }
12907
12909 {
12911 }
12912
12914 {
12915 return true;
12916 }
12917
12918
12919
12920
12922 {
12924 }
12925
12927 {
12929 }
12930
12931
12932
12933
12934 override void SetColor(
int r,
int g,
int b,
int a)
12935 {
12941 }
12943 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12944 {
12949 }
12950
12952 {
12954 }
12955
12958 {
12959 int r,g,b,a;
12961 r = r/255;
12962 g = g/255;
12963 b = b/255;
12964 a = a/255;
12965 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12966 }
12967
12968
12969
12970 override void SetLiquidType(
int value,
bool allow_client =
false)
12971 {
12972 if (!IsServerCheck(allow_client))
12973 return;
12974
12979 }
12980
12982 {
12983 return ConfigGetInt("varLiquidTypeInit");
12984 }
12985
12987 {
12989 }
12990
12992 {
12994 SetFrozen(false);
12995 }
12996
12999 {
13000 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13001 }
13002
13003
13006 {
13007 PlayerBase nplayer;
13008 if (PlayerBase.CastTo(nplayer, player))
13009 {
13011
13012 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13013 }
13014 }
13015
13016
13019 {
13020 PlayerBase nplayer;
13021 if (PlayerBase.CastTo(nplayer,player))
13022 {
13023
13024 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13025
13026 }
13027
13028
13029 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13030
13031
13032 if (HasEnergyManager())
13033 {
13034 GetCompEM().UpdatePlugState();
13035 }
13036 }
13037
13038
13040 {
13041 super.OnPlacementStarted(player);
13042
13044 }
13045
13046 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13047 {
13049 {
13050 m_AdminLog.OnPlacementComplete(player,
this);
13051 }
13052
13053 super.OnPlacementComplete(player, position, orientation);
13054 }
13055
13056
13057
13058
13059
13061 {
13063 {
13064 return true;
13065 }
13066 else
13067 {
13068 return false;
13069 }
13070 }
13071
13072
13074 {
13076 {
13078 }
13079 }
13080
13081
13083 {
13085 }
13086
13088 {
13090 }
13091
13092 override void InsertAgent(
int agent,
float count = 1)
13093 {
13094 if (count < 1)
13095 return;
13096
13098 }
13099
13102 {
13104 }
13105
13106
13108 {
13110 }
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13154 {
13156 return false;
13157 return true;
13158 }
13159
13161 {
13162
13164 }
13165
13166
13169 {
13170 super.CheckForRoofLimited(timeTresholdMS);
13171
13173 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13174 {
13175 m_PreviousRoofTestTime = time;
13176 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13177 }
13178 }
13179
13180
13182 {
13184 {
13185 return 0;
13186 }
13187
13188 if (GetInventory().GetAttachmentSlotsCount() != 0)
13189 {
13190 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13191 if (filter)
13192 return filter.GetProtectionLevel(type, false, system);
13193 else
13194 return 0;
13195 }
13196
13197 string subclassPath, entryName;
13198
13199 switch (type)
13200 {
13202 entryName = "biological";
13203 break;
13205 entryName = "chemical";
13206 break;
13207 default:
13208 entryName = "biological";
13209 break;
13210 }
13211
13212 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13213
13215 }
13216
13217
13218
13221 {
13222 if (!IsMagazine())
13224
13226 }
13227
13228
13229
13230
13231
13236 {
13237 return true;
13238 }
13239
13241 {
13243 }
13244
13245
13246
13247
13248
13250 {
13251 if (parent)
13252 {
13253 if (parent.IsInherited(DayZInfected))
13254 return true;
13255
13256 if (!parent.IsRuined())
13257 return true;
13258 }
13259
13260 return true;
13261 }
13262
13264 {
13265 if (!super.CanPutAsAttachment(parent))
13266 {
13267 return false;
13268 }
13269
13270 if (!IsRuined() && !parent.IsRuined())
13271 {
13272 return true;
13273 }
13274
13275 return false;
13276 }
13277
13279 {
13280
13281
13282
13283
13284 return super.CanReceiveItemIntoCargo(item);
13285 }
13286
13288 {
13289
13290
13291
13292
13293 GameInventory attachmentInv = attachment.GetInventory();
13295 {
13296 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13297 return false;
13298 }
13299
13300 InventoryLocation loc = new InventoryLocation();
13301 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13302 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13303 return false;
13304
13305 return super.CanReceiveAttachment(attachment, slotId);
13306 }
13307
13309 {
13310 if (!super.CanReleaseAttachment(attachment))
13311 return false;
13312
13313 return GetInventory().AreChildrenAccessible();
13314 }
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13337 {
13338 int id = muzzle_owner.GetMuzzleID();
13339 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13340
13341 if (WPOF_array)
13342 {
13343 for (int i = 0; i < WPOF_array.Count(); i++)
13344 {
13345 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13346
13347 if (WPOF)
13348 {
13349 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13350 }
13351 }
13352 }
13353 }
13354
13355
13357 {
13358 int id = muzzle_owner.GetMuzzleID();
13360
13361 if (WPOBE_array)
13362 {
13363 for (int i = 0; i < WPOBE_array.Count(); i++)
13364 {
13365 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13366
13367 if (WPOBE)
13368 {
13369 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13370 }
13371 }
13372 }
13373 }
13374
13375
13377 {
13378 int id = muzzle_owner.GetMuzzleID();
13379 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13380
13381 if (WPOOH_array)
13382 {
13383 for (int i = 0; i < WPOOH_array.Count(); i++)
13384 {
13385 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13386
13387 if (WPOOH)
13388 {
13389 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13390 }
13391 }
13392 }
13393 }
13394
13395
13397 {
13398 int id = muzzle_owner.GetMuzzleID();
13399 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13400
13401 if (WPOOH_array)
13402 {
13403 for (int i = 0; i < WPOOH_array.Count(); i++)
13404 {
13405 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13406
13407 if (WPOOH)
13408 {
13409 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13410 }
13411 }
13412 }
13413 }
13414
13415
13417 {
13418 int id = muzzle_owner.GetMuzzleID();
13419 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13420
13421 if (WPOOH_array)
13422 {
13423 for (int i = 0; i < WPOOH_array.Count(); i++)
13424 {
13425 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13426
13427 if (WPOOH)
13428 {
13429 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13430 }
13431 }
13432 }
13433 }
13434
13435
13436
13438 {
13440 {
13441 return true;
13442 }
13443
13444 return false;
13445 }
13446
13448 {
13450 {
13451 return true;
13452 }
13453
13454 return false;
13455 }
13456
13458 {
13460 {
13461 return true;
13462 }
13463
13464 return false;
13465 }
13466
13468 {
13469 return false;
13470 }
13471
13474 {
13475 return UATimeSpent.DEFAULT_DEPLOY;
13476 }
13477
13478
13479
13480
13482 {
13484 SetSynchDirty();
13485 }
13486
13488 {
13490 }
13491
13492
13494 {
13495 return false;
13496 }
13497
13500 {
13501 string att_type = "None";
13502
13503 if (ConfigIsExisting("soundAttType"))
13504 {
13505 att_type = ConfigGetString("soundAttType");
13506 }
13507
13509 }
13510
13512 {
13514 }
13515
13516
13517
13518
13519
13523
13525 {
13528
13530 }
13531
13532
13534 {
13536 return;
13537
13539
13542
13545
13546 SoundParameters params = new SoundParameters();
13550 }
13551
13552
13554 {
13556 return;
13557
13559 SetSynchDirty();
13560
13563 }
13564
13565
13567 {
13569 return;
13570
13572 SetSynchDirty();
13573
13576 }
13577
13579 {
13581 }
13582
13584 {
13586 }
13587
13590 {
13591 if (!
GetGame().IsDedicatedServer())
13592 {
13593 if (ConfigIsExisting("attachSoundSet"))
13594 {
13595 string cfg_path = "";
13596 string soundset = "";
13597 string type_name =
GetType();
13598
13601 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13602 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13603
13604 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13605 {
13606 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13607 {
13608 if (cfg_slot_array[i] == slot_type)
13609 {
13610 soundset = cfg_soundset_array[i];
13611 break;
13612 }
13613 }
13614 }
13615
13616 if (soundset != "")
13617 {
13618 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13620 }
13621 }
13622 }
13623 }
13624
13626 {
13627
13628 }
13629
13630 void OnApply(PlayerBase player);
13631
13633 {
13634 return 1.0;
13635 };
13636
13638 {
13640 }
13641
13643 {
13645 }
13646
13648
13650 {
13651 SetDynamicPhysicsLifeTime(0.01);
13653 }
13654
13656 {
13657 array<string> zone_names = new array<string>;
13658 GetDamageZones(zone_names);
13659 for (int i = 0; i < zone_names.Count(); i++)
13660 {
13661 SetHealthMax(zone_names.Get(i),"Health");
13662 }
13663 SetHealthMax("","Health");
13664 }
13665
13668 {
13669 float global_health = GetHealth01("","Health");
13670 array<string> zones = new array<string>;
13671 GetDamageZones(zones);
13672
13673 for (int i = 0; i < zones.Count(); i++)
13674 {
13675 SetHealth01(zones.Get(i),"Health",global_health);
13676 }
13677 }
13678
13681 {
13682 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13683 }
13684
13686 {
13687 if (!hasRootAsPlayer)
13688 {
13689 if (refParentIB)
13690 {
13691
13692 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13693 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13694
13695 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13696 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13697
13700 }
13701 else
13702 {
13703
13706 }
13707 }
13708 }
13709
13711 {
13713 {
13714 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13715 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13716 {
13717 float heatPermCoef = 1.0;
13719 while (ent)
13720 {
13721 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13722 ent = ent.GetHierarchyParent();
13723 }
13724
13725 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13726 }
13727 }
13728 }
13729
13731 {
13732
13733 EntityAI parent = GetHierarchyParent();
13734 if (!parent)
13735 {
13736 hasParent = false;
13737 hasRootAsPlayer = false;
13738 }
13739 else
13740 {
13741 hasParent = true;
13742 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13743 refParentIB =
ItemBase.Cast(parent);
13744 }
13745 }
13746
13747 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13748 {
13749
13750 }
13751
13753 {
13754
13755 return false;
13756 }
13757
13759 {
13760
13761
13762 return false;
13763 }
13764
13766 {
13767
13768 return false;
13769 }
13770
13773 {
13774 return !GetIsFrozen() &&
IsOpen();
13775 }
13776
13778 {
13779 bool hasParent = false, hasRootAsPlayer = false;
13781
13782 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13783 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13784
13785 if (wwtu || foodDecay)
13786 {
13790
13791 if (processWetness || processTemperature || processDecay)
13792 {
13794
13795 if (processWetness)
13796 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13797
13798 if (processTemperature)
13800
13801 if (processDecay)
13802 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13803 }
13804 }
13805 }
13806
13809 {
13811 }
13812
13814 {
13817
13818 return super.GetTemperatureFreezeThreshold();
13819 }
13820
13822 {
13825
13826 return super.GetTemperatureThawThreshold();
13827 }
13828
13830 {
13833
13834 return super.GetItemOverheatThreshold();
13835 }
13836
13838 {
13840 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13841
13842 return super.GetTemperatureFreezeTime();
13843 }
13844
13846 {
13848 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13849
13850 return super.GetTemperatureThawTime();
13851 }
13852
13857
13859 {
13860 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13861 }
13862
13864 {
13865 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13866 }
13867
13870 {
13872 }
13873
13875 {
13877 }
13878
13880 {
13882 }
13883
13886 {
13887 return null;
13888 }
13889
13892 {
13893 return false;
13894 }
13895
13897 {
13899 {
13902 if (!trg)
13903 {
13905 explosive = this;
13906 }
13907
13908 explosive.PairRemote(trg);
13910
13911 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13912 trg.SetPersistentPairID(persistentID);
13913 explosive.SetPersistentPairID(persistentID);
13914
13915 return true;
13916 }
13917 return false;
13918 }
13919
13922 {
13923 float ret = 1.0;
13926 ret *= GetHealth01();
13927
13928 return ret;
13929 }
13930
13931 #ifdef DEVELOPER
13932 override void SetDebugItem()
13933 {
13934 super.SetDebugItem();
13935 _itemBase = this;
13936 }
13937
13939 {
13940 string text = super.GetDebugText();
13941
13943 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13944
13945 return text;
13946 }
13947 #endif
13948
13950 {
13951 return true;
13952 }
13953
13955
13957
13959 {
13962 }
13963
13964
13972
13988}
13989
13991{
13993 if (entity)
13994 {
13995 bool is_item = entity.IsInherited(
ItemBase);
13996 if (is_item && full_quantity)
13997 {
14000 }
14001 }
14002 else
14003 {
14005 return NULL;
14006 }
14007 return entity;
14008}
14009
14011{
14012 if (item)
14013 {
14014 if (health > 0)
14015 item.SetHealth("", "", health);
14016
14017 if (item.CanHaveTemperature())
14018 {
14020 if (item.CanFreeze())
14021 item.SetFrozen(false);
14022 }
14023
14024 if (item.HasEnergyManager())
14025 {
14026 if (quantity >= 0)
14027 {
14028 item.GetCompEM().SetEnergy0To1(quantity);
14029 }
14030 else
14031 {
14033 }
14034 }
14035 else if (item.IsMagazine())
14036 {
14037 Magazine mag = Magazine.Cast(item);
14038 if (quantity >= 0)
14039 {
14040 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14041 }
14042 else
14043 {
14045 }
14046
14047 }
14048 else
14049 {
14050 if (quantity >= 0)
14051 {
14052 item.SetQuantityNormalized(quantity, false);
14053 }
14054 else
14055 {
14057 }
14058
14059 }
14060 }
14061}
14062
14063#ifdef DEVELOPER
14065#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.