9207{
9209 {
9210 return true;
9211 }
9212};
9213
9214
9215
9217{
9221
9223
9226
9227
9228
9229
9230
9239
9245
9250
9255
9276 protected bool m_IsResultOfSplit
9277
9279
9284
9285
9286
9288
9292
9293
9294
9296
9299
9300
9301
9307
9308
9316
9319
9320
9322
9323
9325
9326
9331
9332
9337
9338
9340
9341
9343 {
9348
9349 if (!
GetGame().IsDedicatedServer())
9350 {
9352 {
9354
9356 {
9358 }
9359 }
9360
9363 }
9364
9365 m_OldLocation = null;
9366
9368 {
9370 }
9371
9372 if (ConfigIsExisting("headSelectionsToHide"))
9373 {
9376 }
9377
9379 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9380 {
9382 }
9383
9385
9386 m_IsResultOfSplit = false;
9387
9389 }
9390
9392 {
9393 super.InitItemVariables();
9394
9400 m_Count = ConfigGetInt(
"count");
9401
9404
9409
9412
9417
9429
9433
9434
9437 if (ConfigIsExisting("canBeSplit"))
9438 {
9441 }
9442
9444 if (ConfigIsExisting("itemBehaviour"))
9446
9447
9450 RegisterNetSyncVariableInt("m_VarLiquidType");
9451 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9452
9453 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9454 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9455 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9456
9457 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9458 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9459 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9460 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9461
9462 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9463 RegisterNetSyncVariableBool("m_IsTakeable");
9464 RegisterNetSyncVariableBool("m_IsHologram");
9465
9468 {
9471 }
9472
9474
9476 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9478
9479 }
9480
9482 {
9484 }
9485
9487 {
9490 {
9495 }
9496 }
9497
9498 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9499 {
9501 {
9504 }
9505
9507 }
9508
9510 {
9516 }
9517
9519
9521 {
9523
9524 if (!action)
9525 {
9526 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9527 return;
9528 }
9529
9531 if (!ai)
9532 {
9534 return;
9535 }
9536
9538 if (!action_array)
9539 {
9540 action_array = new array<ActionBase_Basic>;
9542 }
9543 if (LogManager.IsActionLogEnable())
9544 {
9545 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9546 }
9547
9548 if (action_array.Find(action) != -1)
9549 {
9550 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9551 }
9552 else
9553 {
9554 action_array.Insert(action);
9555 }
9556 }
9557
9559 {
9561 ActionBase action = player.GetActionManager().GetAction(actionName);
9564
9565 if (action_array)
9566 {
9567 action_array.RemoveItem(action);
9568 }
9569 }
9570
9571
9572
9574 {
9575 ActionOverrideData overrideData = new ActionOverrideData();
9579
9581 if (!actionMap)
9582 {
9585 }
9586
9587 actionMap.Insert(this.
Type(), overrideData);
9588
9589 }
9590
9592
9594
9595
9597 {
9600
9603
9604 string config_to_search = "CfgVehicles";
9605 string muzzle_owner_config;
9606
9608 {
9609 if (IsInherited(Weapon))
9610 config_to_search = "CfgWeapons";
9611
9612 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9613
9614 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9615
9617
9618 if (config_OnFire_subclass_count > 0)
9619 {
9620 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9621
9622 for (int i = 0; i < config_OnFire_subclass_count; i++)
9623 {
9624 string particle_class = "";
9626 string config_OnFire_entry = config_OnFire_class + particle_class;
9627 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9628 WPOF_array.Insert(WPOF);
9629 }
9630
9631
9633 }
9634 }
9635
9637 {
9638 config_to_search = "CfgWeapons";
9639 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9640
9641 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9642
9644
9645 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9646 {
9647 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9648
9649 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9650 {
9651 string particle_class2 = "";
9653 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9654 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9655 WPOBE_array.Insert(WPOBE);
9656 }
9657
9658
9660 }
9661 }
9662 }
9663
9664
9666 {
9669
9671 {
9672 string config_to_search = "CfgVehicles";
9673
9674 if (IsInherited(Weapon))
9675 config_to_search = "CfgWeapons";
9676
9677 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9678 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9679
9680 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9681 {
9682
9684
9686 {
9688 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9690 return;
9691 }
9692
9695
9696
9697
9699 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9700
9701 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9702 {
9703 string particle_class = "";
9705 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9707
9708 if (entry_type == CT_CLASS)
9709 {
9710 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9711 WPOOH_array.Insert(WPOF);
9712 }
9713 }
9714
9715
9717 }
9718 }
9719 }
9720
9722 {
9724 }
9725
9727 {
9729 {
9731
9734
9737
9738 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9739 }
9740 }
9741
9743 {
9745 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9746
9748 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9749
9751 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9752
9754 {
9756 }
9757 }
9758
9760 {
9762 }
9763
9765 {
9768 else
9770
9772 {
9775 }
9776 else
9777 {
9780
9783 }
9784
9786 }
9787
9789 {
9791 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9792 }
9793
9795 {
9797 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9799 }
9800
9802 {
9804 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9805 }
9806
9808 {
9811
9812 OverheatingParticle OP = new OverheatingParticle();
9817
9819 }
9820
9822 {
9825
9826 return -1;
9827 }
9828
9830 {
9832 {
9835
9836 for (int i = count; i > 0; --i)
9837 {
9838 int id = i - 1;
9841
9844
9845 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9846 {
9847 if (p)
9848 {
9851 }
9852 }
9853 }
9854 }
9855 }
9856
9858 {
9860 {
9862 {
9863 int id = i - 1;
9865
9866 if (OP)
9867 {
9869
9870 if (p)
9871 {
9873 }
9874
9875 delete OP;
9876 }
9877 }
9878
9881 }
9882 }
9883
9886 {
9887 return 0.0;
9888 }
9889
9890
9892 {
9893 return 250;
9894 }
9895
9897 {
9898 return 0;
9899 }
9900
9903 {
9905 return true;
9906
9907 return false;
9908 }
9909
9912 {
9915
9917 {
9919 }
9920 else
9921 {
9922
9924 }
9925
9927 }
9928
9935 {
9936 return -1;
9937 }
9938
9939
9940
9941
9943 {
9945 {
9947 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9948
9949 if (r_index >= 0)
9950 {
9951 InventoryLocation r_il = new InventoryLocation;
9952 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9953
9954 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9957 {
9958 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9959 }
9961 {
9962 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9963 }
9964
9965 }
9966
9967 player.GetHumanInventory().ClearUserReservedLocation(this);
9968 }
9969
9972 }
9973
9974
9975
9976
9978 {
9979 return ItemBase.m_DebugActionsMask;
9980 }
9981
9983 {
9984 return ItemBase.m_DebugActionsMask & mask;
9985 }
9986
9988 {
9989 ItemBase.m_DebugActionsMask = mask;
9990 }
9991
9993 {
9994 ItemBase.m_DebugActionsMask |= mask;
9995 }
9996
9998 {
9999 ItemBase.m_DebugActionsMask &= ~mask;
10000 }
10001
10003 {
10005 {
10007 }
10008 else
10009 {
10011 }
10012 }
10013
10014
10016 {
10017 if (GetEconomyProfile())
10018 {
10019 float q_max = GetEconomyProfile().GetQuantityMax();
10020 if (q_max > 0)
10021 {
10022 float q_min = GetEconomyProfile().GetQuantityMin();
10023 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10024
10026 {
10027 ComponentEnergyManager comp = GetCompEM();
10029 {
10031 }
10032 }
10034 {
10036
10037 }
10038
10039 }
10040 }
10041 }
10042
10045 {
10046 EntityAI parent = GetHierarchyParent();
10047
10048 if (parent)
10049 {
10050 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10051 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10052 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10053 }
10054 }
10055
10058 {
10059 EntityAI parent = GetHierarchyParent();
10060
10061 if (parent)
10062 {
10063 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10064 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10065 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10066 }
10067 }
10068
10070 {
10071
10072
10073
10074
10076
10078 {
10079 if (ScriptInputUserData.CanStoreInputUserData())
10080 {
10081 ScriptInputUserData ctx = new ScriptInputUserData;
10087 ctx.
Write(use_stack_max);
10090
10092 {
10093 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10094 }
10095 }
10096 }
10097 else if (!
GetGame().IsMultiplayer())
10098 {
10100 }
10101 }
10102
10104 {
10106 }
10107
10109 {
10111 }
10112
10114 {
10116 }
10117
10119 {
10120
10121 return false;
10122 }
10123
10125 {
10126 return false;
10127 }
10128
10132 {
10133 return false;
10134 }
10135
10137 {
10138 return "";
10139 }
10140
10142
10144 {
10145 return false;
10146 }
10147
10149 {
10150 return true;
10151 }
10152
10153
10154
10156 {
10157 return true;
10158 }
10159
10161 {
10162 return true;
10163 }
10164
10166 {
10167 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10169 }
10170
10172 {
10174 }
10175
10177 {
10179 if (!is_being_placed)
10181 SetSynchDirty();
10182 }
10183
10184
10186
10188 {
10190 }
10191
10193 {
10195 }
10196
10198 {
10199 return 1;
10200 }
10201
10203 {
10204 return false;
10205 }
10206
10208 {
10210 SetSynchDirty();
10211 }
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10248 {
10249 super.OnMovedInsideCargo(container);
10250
10251 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10252 }
10253
10254 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10255 {
10256 super.EEItemLocationChanged(oldLoc,newLoc);
10257
10258 PlayerBase new_player = null;
10259 PlayerBase old_player = null;
10260
10261 if (newLoc.GetParent())
10262 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10263
10264 if (oldLoc.GetParent())
10265 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10266
10268 {
10269 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10270
10271 if (r_index >= 0)
10272 {
10273 InventoryLocation r_il = new InventoryLocation;
10274 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10275
10276 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10279 {
10280 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10281 }
10283 {
10284 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10285 }
10286
10287 }
10288 }
10289
10291 {
10292 if (new_player)
10293 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10294
10295 if (new_player == old_player)
10296 {
10297
10298 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10299 {
10301 {
10302 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10303 {
10304 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10305 }
10306 }
10307 else
10308 {
10309 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10310 }
10311 }
10312
10313 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10314 {
10315 int type = oldLoc.GetType();
10317 {
10318 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10319 }
10321 {
10322 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10323 }
10324 }
10325 if (!m_OldLocation)
10326 {
10327 m_OldLocation = new InventoryLocation;
10328 }
10329 m_OldLocation.Copy(oldLoc);
10330 }
10331 else
10332 {
10333 if (m_OldLocation)
10334 {
10335 m_OldLocation.Reset();
10336 }
10337 }
10338
10340 }
10341 else
10342 {
10343 if (new_player)
10344 {
10345 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10346 if (res_index >= 0)
10347 {
10348 InventoryLocation il = new InventoryLocation;
10349 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10351 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10354 {
10355 il.
GetParent().GetOnReleaseLock().Invoke(it);
10356 }
10358 {
10360 }
10361
10362 }
10363 }
10365 {
10366
10368 }
10369
10370 if (m_OldLocation)
10371 {
10372 m_OldLocation.Reset();
10373 }
10374 }
10375 }
10376
10377 override void EOnContact(IEntity other, Contact extra)
10378 {
10380 {
10381 int liquidType = -1;
10383 if (impactSpeed > 0.0)
10384 {
10386 #ifndef SERVER
10388 #else
10390 SetSynchDirty();
10391 #endif
10393 }
10394 }
10395
10396 #ifdef SERVER
10397 if (GetCompEM() && GetCompEM().IsPlugged())
10398 {
10399 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10400 GetCompEM().UnplugThis();
10401 }
10402 #endif
10403 }
10404
10406
10408 {
10410 }
10411
10413 {
10414
10415 }
10416
10418 {
10419 super.OnItemLocationChanged(old_owner, new_owner);
10420
10421 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10422 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10423
10424 if (!relatedPlayer && playerNew)
10425 relatedPlayer = playerNew;
10426
10427 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10428 {
10430 if (actionMgr)
10431 {
10432 ActionBase currentAction = actionMgr.GetRunningAction();
10433 if (currentAction)
10435 }
10436 }
10437
10438 Man ownerPlayerOld = null;
10439 Man ownerPlayerNew = null;
10440
10441 if (old_owner)
10442 {
10443 if (old_owner.
IsMan())
10444 {
10445 ownerPlayerOld = Man.Cast(old_owner);
10446 }
10447 else
10448 {
10449 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10450 }
10451 }
10452 else
10453 {
10455 {
10457
10458 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10459 {
10460 GetCompEM().UnplugThis();
10461 }
10462 }
10463 }
10464
10465 if (new_owner)
10466 {
10467 if (new_owner.
IsMan())
10468 {
10469 ownerPlayerNew = Man.Cast(new_owner);
10470 }
10471 else
10472 {
10473 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10474 }
10475 }
10476
10477 if (ownerPlayerOld != ownerPlayerNew)
10478 {
10479 if (ownerPlayerOld)
10480 {
10481 array<EntityAI> subItemsExit = new array<EntityAI>;
10483 for (int i = 0; i < subItemsExit.Count(); i++)
10484 {
10487 }
10488 }
10489
10490 if (ownerPlayerNew)
10491 {
10492 array<EntityAI> subItemsEnter = new array<EntityAI>;
10494 for (int j = 0; j < subItemsEnter.Count(); j++)
10495 {
10498 }
10499 }
10500 }
10501 else if (ownerPlayerNew != null)
10502 {
10503 PlayerBase nplayer;
10504 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10505 {
10506 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10508 for (int k = 0; k < subItemsUpdate.Count(); k++)
10509 {
10511 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10512 }
10513 }
10514 }
10515
10516 if (old_owner)
10517 old_owner.OnChildItemRemoved(this);
10518 if (new_owner)
10519 new_owner.OnChildItemReceived(this);
10520 }
10521
10522
10524 {
10525 super.EEDelete(parent);
10526 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10527 if (player)
10528 {
10530
10531 if (player.IsAlive())
10532 {
10533 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10534 if (r_index >= 0)
10535 {
10536 InventoryLocation r_il = new InventoryLocation;
10537 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10538
10539 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10542 {
10543 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10544 }
10546 {
10547 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10548 }
10549
10550 }
10551
10552 player.RemoveQuickBarEntityShortcut(this);
10553 }
10554 }
10555 }
10556
10558 {
10559 super.EEKilled(killer);
10560
10563 {
10564 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10565 {
10566 if (IsMagazine())
10567 {
10568 if (Magazine.Cast(this).GetAmmoCount() > 0)
10569 {
10571 }
10572 }
10573 else
10574 {
10576 }
10577 }
10578 }
10579 }
10580
10582 {
10583 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10584
10585 super.OnWasAttached(parent, slot_id);
10586
10589
10591 }
10592
10594 {
10595 super.OnWasDetached(parent, slot_id);
10596
10599 }
10600
10602 {
10603 int idx;
10606
10607 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10608 if (inventory_slots.Count() < 1)
10609 {
10610 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10611 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10612 }
10613 else
10614 {
10615 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10616 }
10617
10618 idx = inventory_slots.Find(slot);
10619 if (idx < 0)
10620 return "";
10621
10622 return attach_types.Get(idx);
10623 }
10624
10626 {
10627 int idx = -1;
10628 string slot;
10629
10632
10633 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10634 if (inventory_slots.Count() < 1)
10635 {
10636 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10637 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10638 }
10639 else
10640 {
10641 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10642 if (detach_types.Count() < 1)
10643 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10644 }
10645
10646 for (int i = 0; i < inventory_slots.Count(); i++)
10647 {
10648 slot = inventory_slots.Get(i);
10649 }
10650
10651 if (slot != "")
10652 {
10653 if (detach_types.Count() == 1)
10654 idx = 0;
10655 else
10656 idx = inventory_slots.Find(slot);
10657 }
10658 if (idx < 0)
10659 return "";
10660
10661 return detach_types.Get(idx);
10662 }
10663
10665 {
10666
10668
10669
10670 float min_time = 1;
10671 float max_time = 3;
10672 float delay = Math.RandomFloat(min_time, max_time);
10673
10674 explode_timer.Run(delay, this, "DoAmmoExplosion");
10675 }
10676
10678 {
10679 Magazine magazine = Magazine.Cast(this);
10680 int pop_sounds_count = 6;
10681 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10682
10683
10684 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10685 string sound_name = pop_sounds[ sound_idx ];
10687
10688
10689 magazine.ServerAddAmmoCount(-1);
10690
10691
10692 float min_temp_to_explode = 100;
10693
10694 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10695 {
10697 }
10698 }
10699
10700
10701 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10702 {
10703 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10704
10705 const int CHANCE_DAMAGE_CARGO = 4;
10706 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10707 const int CHANCE_DAMAGE_NOTHING = 2;
10708
10710 {
10711 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10712 int chances;
10713 int rnd;
10714
10715 if (GetInventory().GetCargo())
10716 {
10717 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10718 rnd = Math.RandomInt(0,chances);
10719
10720 if (rnd < CHANCE_DAMAGE_CARGO)
10721 {
10723 }
10724 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10725 {
10727 }
10728 }
10729 else
10730 {
10731 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10732 rnd = Math.RandomInt(0,chances);
10733
10734 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10735 {
10737 }
10738 }
10739 }
10740 }
10741
10743 {
10744 if (GetInventory().GetCargo())
10745 {
10746 int item_count = GetInventory().GetCargo().GetItemCount();
10747 if (item_count > 0)
10748 {
10749 int random_pick = Math.RandomInt(0, item_count);
10751 if (!item.IsExplosive())
10752 {
10753 item.AddHealth("","",damage);
10754 return true;
10755 }
10756 }
10757 }
10758 return false;
10759 }
10760
10762 {
10763 int attachment_count = GetInventory().AttachmentCount();
10764 if (attachment_count > 0)
10765 {
10766 int random_pick = Math.RandomInt(0, attachment_count);
10767 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10768 if (!attachment.IsExplosive())
10769 {
10770 attachment.AddHealth("","",damage);
10771 return true;
10772 }
10773 }
10774 return false;
10775 }
10776
10778 {
10780 }
10781
10783 {
10785 return GetInventory().CanRemoveEntity();
10786
10787 return false;
10788 }
10789
10791 {
10793 return;
10794
10796 {
10797 if (ScriptInputUserData.CanStoreInputUserData())
10798 {
10799 ScriptInputUserData ctx = new ScriptInputUserData;
10804 ctx.
Write(destination_entity);
10806 ctx.
Write(slot_id);
10808 }
10809 }
10810 else if (!
GetGame().IsMultiplayer())
10811 {
10813 }
10814 }
10815
10817 {
10819 return;
10820
10821 float split_quantity_new;
10825 InventoryLocation loc = new InventoryLocation;
10826
10827 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10828 {
10830 split_quantity_new = stack_max;
10831 else
10833
10834 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10835 if (new_item)
10836 {
10837 new_item.SetResultOfSplit(true);
10838 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10840 new_item.SetQuantity(split_quantity_new);
10841 }
10842 }
10843 else if (destination_entity && slot_id == -1)
10844 {
10845 if (quantity > stack_max)
10846 split_quantity_new = stack_max;
10847 else
10848 split_quantity_new = quantity;
10849
10851 {
10854 }
10855
10856 if (new_item)
10857 {
10858 new_item.SetResultOfSplit(true);
10859 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10861 new_item.SetQuantity(split_quantity_new);
10862 }
10863 }
10864 else
10865 {
10866 if (stack_max != 0)
10867 {
10869 {
10871 }
10872
10873 if (split_quantity_new == 0)
10874 {
10875 if (!
GetGame().IsMultiplayer())
10876 player.PhysicalPredictiveDropItem(this);
10877 else
10878 player.ServerDropEntity(this);
10879 return;
10880 }
10881
10883
10884 if (new_item)
10885 {
10886 new_item.SetResultOfSplit(true);
10887 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10889 new_item.SetQuantity(stack_max);
10890 new_item.PlaceOnSurface();
10891 }
10892 }
10893 }
10894 }
10895
10897 {
10899 return;
10900
10901 float split_quantity_new;
10905 InventoryLocation loc = new InventoryLocation;
10906
10907 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10908 {
10910 split_quantity_new = stack_max;
10911 else
10913
10914 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10915 if (new_item)
10916 {
10917 new_item.SetResultOfSplit(true);
10918 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10920 new_item.SetQuantity(split_quantity_new);
10921 }
10922 }
10923 else if (destination_entity && slot_id == -1)
10924 {
10925 if (quantity > stack_max)
10926 split_quantity_new = stack_max;
10927 else
10928 split_quantity_new = quantity;
10929
10931 {
10934 }
10935
10936 if (new_item)
10937 {
10938 new_item.SetResultOfSplit(true);
10939 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10941 new_item.SetQuantity(split_quantity_new);
10942 }
10943 }
10944 else
10945 {
10946 if (stack_max != 0)
10947 {
10949 {
10951 }
10952
10954
10955 if (new_item)
10956 {
10957 new_item.SetResultOfSplit(true);
10958 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10960 new_item.SetQuantity(stack_max);
10961 new_item.PlaceOnSurface();
10962 }
10963 }
10964 }
10965 }
10966
10968 {
10970 return;
10971
10973 {
10974 if (ScriptInputUserData.CanStoreInputUserData())
10975 {
10976 ScriptInputUserData ctx = new ScriptInputUserData;
10981 dst.WriteToContext(ctx);
10983 }
10984 }
10985 else if (!
GetGame().IsMultiplayer())
10986 {
10988 }
10989 }
10990
10992 {
10994 return;
10995
10997 {
10998 if (ScriptInputUserData.CanStoreInputUserData())
10999 {
11000 ScriptInputUserData ctx = new ScriptInputUserData;
11005 ctx.
Write(destination_entity);
11011 }
11012 }
11013 else if (!
GetGame().IsMultiplayer())
11014 {
11016 }
11017 }
11018
11020 {
11022 }
11023
11025 {
11027 return this;
11028
11030 float split_quantity_new;
11032 if (dst.IsValid())
11033 {
11034 int slot_id = dst.GetSlot();
11036
11037 if (quantity > stack_max)
11038 split_quantity_new = stack_max;
11039 else
11040 split_quantity_new = quantity;
11041
11043
11044 if (new_item)
11045 {
11046 new_item.SetResultOfSplit(true);
11047 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11050 }
11051
11052 return new_item;
11053 }
11054
11055 return null;
11056 }
11057
11059 {
11061 return;
11062
11064 float split_quantity_new;
11066 if (destination_entity)
11067 {
11069 if (quantity > stackable)
11070 split_quantity_new = stackable;
11071 else
11072 split_quantity_new = quantity;
11073
11074 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11075 if (new_item)
11076 {
11077 new_item.SetResultOfSplit(true);
11078 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11080 new_item.SetQuantity(split_quantity_new);
11081 }
11082 }
11083 }
11084
11086 {
11088 return;
11089
11091 {
11092 if (ScriptInputUserData.CanStoreInputUserData())
11093 {
11094 ScriptInputUserData ctx = new ScriptInputUserData;
11099 ItemBase destination_entity =
this;
11100 ctx.
Write(destination_entity);
11104 }
11105 }
11106 else if (!
GetGame().IsMultiplayer())
11107 {
11109 }
11110 }
11111
11113 {
11115 return;
11116
11118 float split_quantity_new;
11120 if (player)
11121 {
11123 if (quantity > stackable)
11124 split_quantity_new = stackable;
11125 else
11126 split_quantity_new = quantity;
11127
11128 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11129 new_item =
ItemBase.Cast(in_hands);
11130 if (new_item)
11131 {
11132 new_item.SetResultOfSplit(true);
11133 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11135 new_item.SetQuantity(split_quantity_new);
11136 }
11137 }
11138 }
11139
11141 {
11143 return;
11144
11146 float split_quantity_new = Math.Floor(quantity * 0.5);
11147
11149
11150 if (new_item)
11151 {
11152 if (new_item.GetQuantityMax() < split_quantity_new)
11153 {
11154 split_quantity_new = new_item.GetQuantityMax();
11155 }
11156
11157 new_item.SetResultOfSplit(true);
11158 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11159
11161 {
11164 }
11165 else
11166 {
11169 }
11170 }
11171 }
11172
11174 {
11176 return;
11177
11179 float split_quantity_new = Math.Floor(quantity / 2);
11180
11181 InventoryLocation invloc = new InventoryLocation;
11183
11185 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11186
11187 if (new_item)
11188 {
11189 if (new_item.GetQuantityMax() < split_quantity_new)
11190 {
11191 split_quantity_new = new_item.GetQuantityMax();
11192 }
11194 {
11197 }
11198 else
11199 {
11202 }
11203 }
11204 }
11205
11208 {
11209 SetWeightDirty();
11211
11212 if (parent)
11213 parent.OnAttachmentQuantityChangedEx(this, delta);
11214
11216 {
11218 {
11220 }
11222 {
11223 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11225 }
11226 }
11227
11228 }
11229
11232 {
11233
11234 }
11235
11238 {
11240 }
11241
11243 {
11244 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11245
11247 {
11248 if (newLevel == GameConstants.STATE_RUINED)
11249 {
11251 EntityAI parent = GetHierarchyParent();
11252 if (parent && parent.IsFireplace())
11253 {
11254 CargoBase cargo = GetInventory().GetCargo();
11255 if (cargo)
11256 {
11258 {
11260 }
11261 }
11262 }
11263 }
11264
11266 {
11267
11269 return;
11270 }
11271
11272 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11273 {
11275 }
11276 }
11277 }
11278
11279
11281 {
11282 super.OnRightClick();
11283
11285 {
11287 {
11288 if (ScriptInputUserData.CanStoreInputUserData())
11289 {
11290 vector m4[4];
11292
11293 EntityAI root = GetHierarchyRoot();
11294
11295 InventoryLocation dst = new InventoryLocation;
11297 {
11298 if (root)
11299 {
11300 root.GetTransform(m4);
11302 }
11303 else
11304 GetInventory().GetCurrentInventoryLocation(dst);
11305 }
11306 else
11307 {
11309
11310
11311 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11312 {
11313 if (root)
11314 {
11315 root.GetTransform(m4);
11317 }
11318 else
11319 GetInventory().GetCurrentInventoryLocation(dst);
11320 }
11321 else
11322 {
11323 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11324 }
11325 }
11326
11327 ScriptInputUserData ctx = new ScriptInputUserData;
11335 }
11336 }
11337 else if (!
GetGame().IsMultiplayer())
11338 {
11340 }
11341 }
11342 }
11343
11344 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11345 {
11346
11347 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11348 return false;
11349
11350 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11351 return false;
11352
11353
11355 return false;
11356
11357
11358 Magazine mag = Magazine.Cast(this);
11359 if (mag)
11360 {
11361 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11362 return false;
11363
11364 if (stack_max_limit)
11365 {
11366 Magazine other_mag = Magazine.Cast(other_item);
11367 if (other_item)
11368 {
11369 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11370 return false;
11371 }
11372
11373 }
11374 }
11375 else
11376 {
11377
11379 return false;
11380
11382 return false;
11383 }
11384
11385 PlayerBase player = null;
11386 if (CastTo(player, GetHierarchyRootPlayer()))
11387 {
11388 if (player.GetInventory().HasAttachment(this))
11389 return false;
11390
11391 if (player.IsItemsToDelete())
11392 return false;
11393 }
11394
11395 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11396 return false;
11397
11398 int slotID;
11400 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11401 return false;
11402
11403 return true;
11404 }
11405
11407 {
11409 }
11410
11412 {
11413 return m_IsResultOfSplit;
11414 }
11415
11417 {
11418 m_IsResultOfSplit = value;
11419 }
11420
11422 {
11424 }
11425
11427 {
11428 float other_item_quantity = other_item.GetQuantity();
11429 float this_free_space;
11430
11432
11434
11435 if (other_item_quantity > this_free_space)
11436 {
11437 return this_free_space;
11438 }
11439 else
11440 {
11441 return other_item_quantity;
11442 }
11443 }
11444
11446 {
11448 }
11449
11451 {
11453 return;
11454
11455 if (!IsMagazine() && other_item)
11456 {
11458 if (quantity_used != 0)
11459 {
11460 float hp1 = GetHealth01("","");
11461 float hp2 = other_item.GetHealth01("","");
11462 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11463 hpResult = hpResult / (
GetQuantity() + quantity_used);
11464
11465 hpResult *= GetMaxHealth();
11466 Math.Round(hpResult);
11467 SetHealth("", "Health", hpResult);
11468
11470 other_item.AddQuantity(-quantity_used);
11471 }
11472 }
11474 }
11475
11477 {
11478 #ifdef SERVER
11479 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11480 GetHierarchyParent().IncreaseLifetimeUp();
11481 #endif
11482 };
11483
11485 {
11486 PlayerBase p = PlayerBase.Cast(player);
11487
11488 array<int> recipesIds = p.m_Recipes;
11489 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11490 if (moduleRecipesManager)
11491 {
11492 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11493 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11494 }
11495
11496 for (int i = 0;i < recipesIds.Count(); i++)
11497 {
11498 int key = recipesIds.Get(i);
11499 string recipeName = moduleRecipesManager.GetRecipeName(key);
11501 }
11502 }
11503
11504
11505 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11506 {
11507 super.GetDebugActions(outputList);
11508
11509
11514
11515
11519
11523
11524
11527
11528
11530 {
11533 }
11534
11536
11539
11543 }
11544
11545
11546
11547
11549 {
11550 super.OnAction(action_id, player, ctx);
11551 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11552 {
11553 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11554 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11555 PlayerBase p = PlayerBase.Cast(player);
11556 if (
EActions.RECIPES_RANGE_START < 1000)
11557 {
11558 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11559 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11560 }
11561 }
11562 #ifndef SERVER
11563 else if (action_id ==
EActions.WATCH_PLAYER)
11564 {
11565 PluginDeveloper.SetDeveloperItemClientEx(player);
11566 }
11567 #endif
11569 {
11570 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11571 {
11572 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11573 OnDebugButtonPressServer(id + 1);
11574 }
11575
11576 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11577 {
11578 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11580 }
11581
11582 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11583 {
11584 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11586 }
11587
11588 else if (action_id ==
EActions.ADD_QUANTITY)
11589 {
11590 if (IsMagazine())
11591 {
11592 Magazine mag = Magazine.Cast(this);
11593 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11594 }
11595 else
11596 {
11598 }
11599
11600 if (m_EM)
11601 {
11602 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11603 }
11604
11605 }
11606
11607 else if (action_id ==
EActions.REMOVE_QUANTITY)
11608 {
11609 if (IsMagazine())
11610 {
11611 Magazine mag2 = Magazine.Cast(this);
11612 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11613 }
11614 else
11615 {
11617 }
11618 if (m_EM)
11619 {
11620 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11621 }
11622
11623 }
11624
11625 else if (action_id ==
EActions.SET_QUANTITY_0)
11626 {
11628
11629 if (m_EM)
11630 {
11631 m_EM.SetEnergy(0);
11632 }
11633 }
11634
11635 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11636 {
11638
11639 if (m_EM)
11640 {
11641 m_EM.SetEnergy(m_EM.GetEnergyMax());
11642 }
11643 }
11644
11645 else if (action_id ==
EActions.ADD_HEALTH)
11646 {
11647 AddHealth("","",GetMaxHealth("","Health")/5);
11648 }
11649 else if (action_id ==
EActions.REMOVE_HEALTH)
11650 {
11651 AddHealth("","",-GetMaxHealth("","Health")/5);
11652 }
11653 else if (action_id ==
EActions.DESTROY_HEALTH)
11654 {
11655 SetHealth01("","",0);
11656 }
11657 else if (action_id ==
EActions.WATCH_ITEM)
11658 {
11660 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11661 #ifdef DEVELOPER
11662 SetDebugDeveloper_item(this);
11663 #endif
11664 }
11665
11666 else if (action_id ==
EActions.ADD_TEMPERATURE)
11667 {
11668 AddTemperature(20);
11669
11670 }
11671
11672 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11673 {
11674 AddTemperature(-20);
11675
11676 }
11677
11678 else if (action_id ==
EActions.FLIP_FROZEN)
11679 {
11680 SetFrozen(!GetIsFrozen());
11681
11682 }
11683
11684 else if (action_id ==
EActions.ADD_WETNESS)
11685 {
11687
11688 }
11689
11690 else if (action_id ==
EActions.REMOVE_WETNESS)
11691 {
11693
11694 }
11695
11696 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11697 {
11700
11701
11702 }
11703
11704 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11705 {
11708 }
11709
11710 else if (action_id ==
EActions.MAKE_SPECIAL)
11711 {
11712 auto debugParams = DebugSpawnParams.WithPlayer(player);
11713 OnDebugSpawnEx(debugParams);
11714 }
11715
11716 else if (action_id ==
EActions.DELETE)
11717 {
11718 Delete();
11719 }
11720
11721 }
11722
11723
11724 return false;
11725 }
11726
11727
11728
11729
11733
11736
11737
11738
11740 {
11741 return false;
11742 }
11743
11744
11746 {
11747 return true;
11748 }
11749
11750
11752 {
11753 return true;
11754 }
11755
11756
11757
11759 {
11760 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11762 }
11763
11766 {
11767 return null;
11768 }
11769
11771 {
11772 return false;
11773 }
11774
11776 {
11777 return false;
11778 }
11779
11783
11784
11786 {
11787 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11788 return module_repairing.CanRepair(this, item_repair_kit);
11789 }
11790
11791
11792 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11793 {
11794 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11795 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11796 }
11797
11798
11800 {
11801
11802
11803
11804
11805
11806
11807
11808
11809 return 1;
11810 }
11811
11812
11813
11815 {
11817 }
11818
11819
11820
11822 {
11824 }
11825
11826
11835 {
11836 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11837
11838 if (player)
11839 {
11840 player.MessageStatus(text);
11841 }
11842 }
11843
11844
11853 {
11854 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11855
11856 if (player)
11857 {
11858 player.MessageAction(text);
11859 }
11860 }
11861
11862
11871 {
11872 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11873
11874 if (player)
11875 {
11876 player.MessageFriendly(text);
11877 }
11878 }
11879
11880
11889 {
11890 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11891
11892 if (player)
11893 {
11894 player.MessageImportant(text);
11895 }
11896 }
11897
11899 {
11900 return true;
11901 }
11902
11903
11904 override bool KindOf(
string tag)
11905 {
11906 bool found = false;
11907 string item_name = this.
GetType();
11910
11911 int array_size = item_tag_array.Count();
11912 for (int i = 0; i < array_size; i++)
11913 {
11914 if (item_tag_array.Get(i) == tag)
11915 {
11916 found = true;
11917 break;
11918 }
11919 }
11920 return found;
11921 }
11922
11923
11925 {
11926
11927 super.OnRPC(sender, rpc_type,ctx);
11928
11929
11930 switch (rpc_type)
11931 {
11932 #ifndef SERVER
11933 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11934 Param2<bool, string> p = new Param2<bool, string>(false, "");
11935
11937 return;
11938
11939 bool play = p.param1;
11940 string soundSet = p.param2;
11941
11942 if (play)
11943 {
11945 {
11947 {
11949 }
11950 }
11951 else
11952 {
11954 }
11955 }
11956 else
11957 {
11959 }
11960
11961 break;
11962 #endif
11963
11964 }
11965
11967 {
11969 }
11970 }
11971
11972
11973
11974
11976 {
11977 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11978 return plugin.GetID(
name);
11979 }
11980
11982 {
11983 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11984 return plugin.GetName(id);
11985 }
11986
11989 {
11990
11991
11992 int varFlags;
11993 if (!ctx.
Read(varFlags))
11994 return;
11995
11996 if (varFlags & ItemVariableFlags.FLOAT)
11997 {
11999 }
12000 }
12001
12003 {
12004
12005 super.SerializeNumericalVars(floats_out);
12006
12007
12008
12010 {
12012 }
12013
12015 {
12017 }
12018
12020 {
12022 }
12023
12025 {
12030 }
12031
12033 {
12035 }
12036 }
12037
12039 {
12040
12041 super.DeSerializeNumericalVars(floats);
12042
12043
12044 int index = 0;
12045 int mask = Math.Round(floats.Get(index));
12046
12047 index++;
12048
12050 {
12052 {
12054 }
12055 else
12056 {
12057 float quantity = floats.Get(index);
12058 SetQuantity(quantity,
true,
false,
false,
false);
12059 }
12060 index++;
12061 }
12062
12064 {
12065 float wet = floats.Get(index);
12067 index++;
12068 }
12069
12071 {
12072 int liquidtype = Math.Round(floats.Get(index));
12074 index++;
12075 }
12076
12078 {
12080 index++;
12082 index++;
12084 index++;
12086 index++;
12087 }
12088
12090 {
12091 int cleanness = Math.Round(floats.Get(index));
12093 index++;
12094 }
12095 }
12096
12098 {
12099 super.WriteVarsToCTX(ctx);
12100
12101
12103 {
12105 }
12106
12108 {
12110 }
12111
12113 {
12115 }
12116
12118 {
12119 int r,g,b,a;
12125 }
12126
12128 {
12130 }
12131 }
12132
12134 {
12135 if (!super.ReadVarsFromCTX(ctx,version))
12136 return false;
12137
12138 int intValue;
12139 float value;
12140
12141 if (version < 140)
12142 {
12143 if (!ctx.
Read(intValue))
12144 return false;
12145
12146 m_VariablesMask = intValue;
12147 }
12148
12150 {
12151 if (!ctx.
Read(value))
12152 return false;
12153
12155 {
12157 }
12158 else
12159 {
12161 }
12162 }
12163
12164 if (version < 140)
12165 {
12167 {
12168 if (!ctx.
Read(value))
12169 return false;
12170 SetTemperatureDirect(value);
12171 }
12172 }
12173
12175 {
12176 if (!ctx.
Read(value))
12177 return false;
12179 }
12180
12182 {
12183 if (!ctx.
Read(intValue))
12184 return false;
12186 }
12187
12189 {
12190 int r,g,b,a;
12192 return false;
12194 return false;
12196 return false;
12198 return false;
12199
12201 }
12202
12204 {
12205 if (!ctx.
Read(intValue))
12206 return false;
12208 }
12209
12210 if (version >= 138 && version < 140)
12211 {
12213 {
12214 if (!ctx.
Read(intValue))
12215 return false;
12216 SetFrozen(intValue);
12217 }
12218 }
12219
12220 return true;
12221 }
12222
12223
12225 {
12228 {
12230 }
12231
12232 if (!super.OnStoreLoad(ctx, version))
12233 {
12235 return false;
12236 }
12237
12238 if (version >= 114)
12239 {
12240 bool hasQuickBarIndexSaved;
12241
12242 if (!ctx.
Read(hasQuickBarIndexSaved))
12243 {
12245 return false;
12246 }
12247
12248 if (hasQuickBarIndexSaved)
12249 {
12250 int itmQBIndex;
12251
12252
12253 if (!ctx.
Read(itmQBIndex))
12254 {
12256 return false;
12257 }
12258
12259 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12260 if (itmQBIndex != -1 && parentPlayer)
12261 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12262 }
12263 }
12264 else
12265 {
12266
12267 PlayerBase player;
12268 int itemQBIndex;
12269 if (version ==
int.
MAX)
12270 {
12271 if (!ctx.
Read(itemQBIndex))
12272 {
12274 return false;
12275 }
12276 }
12277 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12278 {
12279
12280 if (!ctx.
Read(itemQBIndex))
12281 {
12283 return false;
12284 }
12285 if (itemQBIndex != -1 && player)
12286 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12287 }
12288 }
12289
12290 if (version < 140)
12291 {
12292
12293 if (!LoadVariables(ctx, version))
12294 {
12296 return false;
12297 }
12298 }
12299
12300
12302 {
12304 return false;
12305 }
12306 if (version >= 132)
12307 {
12309 if (raib)
12310 {
12312 {
12314 return false;
12315 }
12316 }
12317 }
12318
12320 return true;
12321 }
12322
12323
12324
12326 {
12327 super.OnStoreSave(ctx);
12328
12329 PlayerBase player;
12330 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12331 {
12333
12334 int itemQBIndex = -1;
12335 itemQBIndex = player.FindQuickBarEntityIndex(this);
12336 ctx.
Write(itemQBIndex);
12337 }
12338 else
12339 {
12341 }
12342
12344
12346 if (raib)
12347 {
12349 }
12350 }
12351
12352
12354 {
12355 super.AfterStoreLoad();
12356
12358 {
12360 }
12361
12363 {
12366 }
12367 }
12368
12370 {
12371 super.EEOnAfterLoad();
12372
12374 {
12376 }
12377
12380 }
12381
12383 {
12384 return false;
12385 }
12386
12387
12388
12390 {
12392 {
12393 #ifdef PLATFORM_CONSOLE
12394
12396 {
12398 if (menu)
12399 {
12401 }
12402 }
12403 #endif
12404 }
12405
12407 {
12410 }
12411
12413 {
12414 SetWeightDirty();
12416 }
12418 {
12421 }
12422
12424 {
12427 }
12429 {
12432 }
12433
12434 super.OnVariablesSynchronized();
12435 }
12436
12437
12438
12440 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12441 {
12442 if (!IsServerCheck(allow_client))
12443 return false;
12444
12446 return false;
12447
12450
12451 if (value <= (min + 0.001))
12452 value = min;
12453
12454 if (value == min)
12455 {
12456 if (destroy_config)
12457 {
12458 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12459 if (dstr)
12460 {
12462 this.Delete();
12463 return true;
12464 }
12465 }
12466 else if (destroy_forced)
12467 {
12469 this.Delete();
12470 return true;
12471 }
12472
12474 }
12475
12478
12480 {
12482
12483 if (delta)
12485 }
12486
12488
12489 return false;
12490 }
12491
12492
12494 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12495 {
12497 }
12498
12500 {
12503 }
12504
12506 {
12509 }
12510
12513 {
12514 float value_clamped = Math.Clamp(value, 0, 1);
12516 SetQuantity(result, destroy_config, destroy_forced);
12517 }
12518
12519
12522 {
12524 }
12525
12527 {
12529 }
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12541 {
12542 int slot = -1;
12543 if (GetInventory())
12544 {
12545 InventoryLocation il = new InventoryLocation;
12546 GetInventory().GetCurrentInventoryLocation(il);
12548 }
12549
12551 }
12552
12554 {
12555 float quantity_max = 0;
12556
12558 {
12559 if (attSlotID != -1)
12560 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12561
12562 if (quantity_max <= 0)
12564 }
12565
12566 if (quantity_max <= 0)
12568
12569 return quantity_max;
12570 }
12571
12573 {
12575 }
12576
12578 {
12580 }
12581
12582
12584 {
12586 }
12587
12589 {
12591 }
12592
12594 {
12596 }
12597
12598
12600 {
12601
12602 float weightEx = GetWeightEx();
12603 float special = GetInventoryAndCargoWeight();
12604 return weightEx - special;
12605 }
12606
12607
12609 {
12611 }
12612
12614 {
12616 {
12617 #ifdef DEVELOPER
12618 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12619 {
12620 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12622 }
12623 #endif
12624
12625 return GetQuantity() * GetConfigWeightModified();
12626 }
12627 else if (HasEnergyManager())
12628 {
12629 #ifdef DEVELOPER
12630 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12631 {
12632 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12633 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12634 }
12635 #endif
12636 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12637 }
12638 else
12639 {
12640 #ifdef DEVELOPER
12641 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12642 {
12643 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12644 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12645 }
12646 #endif
12647 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12648 }
12649 }
12650
12653 {
12654 int item_count = 0;
12656
12657 if (GetInventory().GetCargo() != NULL)
12658 {
12659 item_count = GetInventory().GetCargo().GetItemCount();
12660 }
12661
12662 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12663 {
12664 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12665 if (item)
12666 item_count += item.GetNumberOfItems();
12667 }
12668 return item_count;
12669 }
12670
12673 {
12674 float weight = 0;
12675 float wetness = 1;
12676 if (include_wetness)
12679 {
12680 weight = wetness * m_ConfigWeight;
12681 }
12683 {
12684 weight = 1;
12685 }
12686 return weight;
12687 }
12688
12689
12690
12692 {
12693 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12694 {
12695 GameInventory inv = GetInventory();
12696 array<EntityAI> items = new array<EntityAI>;
12698 for (int i = 0; i < items.Count(); i++)
12699 {
12701 if (item)
12702 {
12704 }
12705 }
12706 }
12707 }
12708
12709
12710
12711
12713 {
12714 float energy = 0;
12715 if (HasEnergyManager())
12716 {
12717 energy = GetCompEM().GetEnergy();
12718 }
12719 return energy;
12720 }
12721
12722
12724 {
12725 super.OnEnergyConsumed();
12726
12728 }
12729
12731 {
12732 super.OnEnergyAdded();
12733
12735 }
12736
12737
12739 {
12740 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12741 {
12743 {
12744 float energy_0to1 = GetCompEM().GetEnergy0To1();
12746 }
12747 }
12748 }
12749
12750
12752 {
12753 return ConfigGetFloat("heatIsolation");
12754 }
12755
12757 {
12759 }
12760
12762 {
12763 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12764 if (
GetGame().ConfigIsExisting(paramPath))
12766
12767 return 0.0;
12768 }
12769
12771 {
12772 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12773 if (
GetGame().ConfigIsExisting(paramPath))
12775
12776 return 0.0;
12777 }
12778
12779 override void SetWet(
float value,
bool allow_client =
false)
12780 {
12781 if (!IsServerCheck(allow_client))
12782 return;
12783
12786
12788
12789 m_VarWet = Math.Clamp(value, min, max);
12790
12792 {
12795 }
12796 }
12797
12798 override void AddWet(
float value)
12799 {
12801 }
12802
12804 {
12806 }
12807
12809 {
12811 }
12812
12814 {
12816 }
12817
12819 {
12821 }
12822
12824 {
12826 }
12827
12828 override void OnWetChanged(
float newVal,
float oldVal)
12829 {
12832 if (newLevel != oldLevel)
12833 {
12835 }
12836 }
12837
12839 {
12840 SetWeightDirty();
12841 }
12842
12844 {
12845 return GetWetLevelInternal(
m_VarWet);
12846 }
12847
12848
12849
12851 {
12853 }
12854
12856 {
12858 }
12859
12861 {
12863 }
12864
12866 {
12868 }
12869
12870
12871
12873 {
12874 if (ConfigIsExisting("itemModelLength"))
12875 {
12876 return ConfigGetFloat("itemModelLength");
12877 }
12878 return 0;
12879 }
12880
12882 {
12883 if (ConfigIsExisting("itemAttachOffset"))
12884 {
12885 return ConfigGetFloat("itemAttachOffset");
12886 }
12887 return 0;
12888 }
12889
12890 override void SetCleanness(
int value,
bool allow_client =
false)
12891 {
12892 if (!IsServerCheck(allow_client))
12893 return;
12894
12896
12898
12901 }
12902
12904 {
12906 }
12907
12909 {
12910 return true;
12911 }
12912
12913
12914
12915
12917 {
12919 }
12920
12922 {
12924 }
12925
12926
12927
12928
12929 override void SetColor(
int r,
int g,
int b,
int a)
12930 {
12936 }
12938 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12939 {
12944 }
12945
12947 {
12949 }
12950
12953 {
12954 int r,g,b,a;
12956 r = r/255;
12957 g = g/255;
12958 b = b/255;
12959 a = a/255;
12960 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12961 }
12962
12963
12964
12965 override void SetLiquidType(
int value,
bool allow_client =
false)
12966 {
12967 if (!IsServerCheck(allow_client))
12968 return;
12969
12974 }
12975
12977 {
12978 return ConfigGetInt("varLiquidTypeInit");
12979 }
12980
12982 {
12984 }
12985
12987 {
12989 SetFrozen(false);
12990 }
12991
12994 {
12995 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12996 }
12997
12998
13001 {
13002 PlayerBase nplayer;
13003 if (PlayerBase.CastTo(nplayer, player))
13004 {
13006
13007 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13008 }
13009 }
13010
13011
13014 {
13015 PlayerBase nplayer;
13016 if (PlayerBase.CastTo(nplayer,player))
13017 {
13018
13019 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13020
13021 }
13022
13023
13024 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13025
13026
13027 if (HasEnergyManager())
13028 {
13029 GetCompEM().UpdatePlugState();
13030 }
13031 }
13032
13033
13035 {
13036 super.OnPlacementStarted(player);
13037
13039 }
13040
13041 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13042 {
13044 {
13045 m_AdminLog.OnPlacementComplete(player,
this);
13046 }
13047
13048 super.OnPlacementComplete(player, position, orientation);
13049 }
13050
13051
13052
13053
13054
13056 {
13058 {
13059 return true;
13060 }
13061 else
13062 {
13063 return false;
13064 }
13065 }
13066
13067
13069 {
13071 {
13073 }
13074 }
13075
13076
13078 {
13080 }
13081
13083 {
13085 }
13086
13087 override void InsertAgent(
int agent,
float count = 1)
13088 {
13089 if (count < 1)
13090 return;
13091
13093 }
13094
13097 {
13099 }
13100
13101
13103 {
13105 }
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13149 {
13151 return false;
13152 return true;
13153 }
13154
13156 {
13157
13159 }
13160
13161
13164 {
13165 super.CheckForRoofLimited(timeTresholdMS);
13166
13168 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13169 {
13170 m_PreviousRoofTestTime = time;
13171 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13172 }
13173 }
13174
13175
13177 {
13179 {
13180 return 0;
13181 }
13182
13183 if (GetInventory().GetAttachmentSlotsCount() != 0)
13184 {
13185 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13186 if (filter)
13187 return filter.GetProtectionLevel(type, false, system);
13188 else
13189 return 0;
13190 }
13191
13192 string subclassPath, entryName;
13193
13194 switch (type)
13195 {
13197 entryName = "biological";
13198 break;
13200 entryName = "chemical";
13201 break;
13202 default:
13203 entryName = "biological";
13204 break;
13205 }
13206
13207 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13208
13210 }
13211
13212
13213
13216 {
13217 if (!IsMagazine())
13219
13221 }
13222
13223
13224
13225
13226
13231 {
13232 return true;
13233 }
13234
13236 {
13238 }
13239
13240
13241
13242
13243
13245 {
13246 if (parent)
13247 {
13248 if (parent.IsInherited(DayZInfected))
13249 return true;
13250
13251 if (!parent.IsRuined())
13252 return true;
13253 }
13254
13255 return true;
13256 }
13257
13259 {
13260 if (!super.CanPutAsAttachment(parent))
13261 {
13262 return false;
13263 }
13264
13265 if (!IsRuined() && !parent.IsRuined())
13266 {
13267 return true;
13268 }
13269
13270 return false;
13271 }
13272
13274 {
13275
13276
13277
13278
13279 return super.CanReceiveItemIntoCargo(item);
13280 }
13281
13283 {
13284
13285
13286
13287
13288 GameInventory attachmentInv = attachment.GetInventory();
13290 {
13291 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13292 return false;
13293 }
13294
13295 InventoryLocation loc = new InventoryLocation();
13296 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13297 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13298 return false;
13299
13300 return super.CanReceiveAttachment(attachment, slotId);
13301 }
13302
13304 {
13305 if (!super.CanReleaseAttachment(attachment))
13306 return false;
13307
13308 return GetInventory().AreChildrenAccessible();
13309 }
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13332 {
13333 int id = muzzle_owner.GetMuzzleID();
13334 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13335
13336 if (WPOF_array)
13337 {
13338 for (int i = 0; i < WPOF_array.Count(); i++)
13339 {
13340 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13341
13342 if (WPOF)
13343 {
13344 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13345 }
13346 }
13347 }
13348 }
13349
13350
13352 {
13353 int id = muzzle_owner.GetMuzzleID();
13355
13356 if (WPOBE_array)
13357 {
13358 for (int i = 0; i < WPOBE_array.Count(); i++)
13359 {
13360 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13361
13362 if (WPOBE)
13363 {
13364 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13365 }
13366 }
13367 }
13368 }
13369
13370
13372 {
13373 int id = muzzle_owner.GetMuzzleID();
13374 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13375
13376 if (WPOOH_array)
13377 {
13378 for (int i = 0; i < WPOOH_array.Count(); i++)
13379 {
13380 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13381
13382 if (WPOOH)
13383 {
13384 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13385 }
13386 }
13387 }
13388 }
13389
13390
13392 {
13393 int id = muzzle_owner.GetMuzzleID();
13394 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13395
13396 if (WPOOH_array)
13397 {
13398 for (int i = 0; i < WPOOH_array.Count(); i++)
13399 {
13400 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13401
13402 if (WPOOH)
13403 {
13404 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13405 }
13406 }
13407 }
13408 }
13409
13410
13412 {
13413 int id = muzzle_owner.GetMuzzleID();
13414 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13415
13416 if (WPOOH_array)
13417 {
13418 for (int i = 0; i < WPOOH_array.Count(); i++)
13419 {
13420 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13421
13422 if (WPOOH)
13423 {
13424 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13425 }
13426 }
13427 }
13428 }
13429
13430
13431
13433 {
13435 {
13436 return true;
13437 }
13438
13439 return false;
13440 }
13441
13443 {
13445 {
13446 return true;
13447 }
13448
13449 return false;
13450 }
13451
13453 {
13455 {
13456 return true;
13457 }
13458
13459 return false;
13460 }
13461
13463 {
13464 return false;
13465 }
13466
13469 {
13470 return UATimeSpent.DEFAULT_DEPLOY;
13471 }
13472
13473
13474
13475
13477 {
13479 SetSynchDirty();
13480 }
13481
13483 {
13485 }
13486
13487
13489 {
13490 return false;
13491 }
13492
13495 {
13496 string att_type = "None";
13497
13498 if (ConfigIsExisting("soundAttType"))
13499 {
13500 att_type = ConfigGetString("soundAttType");
13501 }
13502
13504 }
13505
13507 {
13509 }
13510
13511
13512
13513
13514
13518
13520 {
13523
13525 }
13526
13527
13529 {
13531 return;
13532
13534
13537
13540
13541 SoundParameters params = new SoundParameters();
13545 }
13546
13547
13549 {
13551 return;
13552
13554 SetSynchDirty();
13555
13558 }
13559
13560
13562 {
13564 return;
13565
13567 SetSynchDirty();
13568
13571 }
13572
13574 {
13576 }
13577
13579 {
13581 }
13582
13585 {
13586 if (!
GetGame().IsDedicatedServer())
13587 {
13588 if (ConfigIsExisting("attachSoundSet"))
13589 {
13590 string cfg_path = "";
13591 string soundset = "";
13592 string type_name =
GetType();
13593
13596 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13597 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13598
13599 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13600 {
13601 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13602 {
13603 if (cfg_slot_array[i] == slot_type)
13604 {
13605 soundset = cfg_soundset_array[i];
13606 break;
13607 }
13608 }
13609 }
13610
13611 if (soundset != "")
13612 {
13613 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13615 }
13616 }
13617 }
13618 }
13619
13621 {
13622
13623 }
13624
13625 void OnApply(PlayerBase player);
13626
13628 {
13629 return 1.0;
13630 };
13631
13633 {
13635 }
13636
13638 {
13640 }
13641
13643
13645 {
13646 SetDynamicPhysicsLifeTime(0.01);
13648 }
13649
13651 {
13652 array<string> zone_names = new array<string>;
13653 GetDamageZones(zone_names);
13654 for (int i = 0; i < zone_names.Count(); i++)
13655 {
13656 SetHealthMax(zone_names.Get(i),"Health");
13657 }
13658 SetHealthMax("","Health");
13659 }
13660
13663 {
13664 float global_health = GetHealth01("","Health");
13665 array<string> zones = new array<string>;
13666 GetDamageZones(zones);
13667
13668 for (int i = 0; i < zones.Count(); i++)
13669 {
13670 SetHealth01(zones.Get(i),"Health",global_health);
13671 }
13672 }
13673
13676 {
13677 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13678 }
13679
13681 {
13682 if (!hasRootAsPlayer)
13683 {
13684 if (refParentIB)
13685 {
13686
13687 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13688 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13689
13690 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13691 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13692
13695 }
13696 else
13697 {
13698
13701 }
13702 }
13703 }
13704
13706 {
13708 {
13709 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13710 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13711 {
13712 float heatPermCoef = 1.0;
13714 while (ent)
13715 {
13716 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13717 ent = ent.GetHierarchyParent();
13718 }
13719
13720 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13721 }
13722 }
13723 }
13724
13726 {
13727
13728 EntityAI parent = GetHierarchyParent();
13729 if (!parent)
13730 {
13731 hasParent = false;
13732 hasRootAsPlayer = false;
13733 }
13734 else
13735 {
13736 hasParent = true;
13737 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13738 refParentIB =
ItemBase.Cast(parent);
13739 }
13740 }
13741
13742 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13743 {
13744
13745 }
13746
13748 {
13749
13750 return false;
13751 }
13752
13754 {
13755
13756
13757 return false;
13758 }
13759
13761 {
13762
13763 return false;
13764 }
13765
13768 {
13769 return !GetIsFrozen() &&
IsOpen();
13770 }
13771
13773 {
13774 bool hasParent = false, hasRootAsPlayer = false;
13776
13777 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13778 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13779
13780 if (wwtu || foodDecay)
13781 {
13785
13786 if (processWetness || processTemperature || processDecay)
13787 {
13789
13790 if (processWetness)
13791 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13792
13793 if (processTemperature)
13795
13796 if (processDecay)
13797 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13798 }
13799 }
13800 }
13801
13804 {
13806 }
13807
13809 {
13812
13813 return super.GetTemperatureFreezeThreshold();
13814 }
13815
13817 {
13820
13821 return super.GetTemperatureThawThreshold();
13822 }
13823
13825 {
13828
13829 return super.GetItemOverheatThreshold();
13830 }
13831
13833 {
13835 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13836
13837 return super.GetTemperatureFreezeTime();
13838 }
13839
13841 {
13843 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13844
13845 return super.GetTemperatureThawTime();
13846 }
13847
13852
13854 {
13855 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13856 }
13857
13859 {
13860 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13861 }
13862
13865 {
13867 }
13868
13870 {
13872 }
13873
13875 {
13877 }
13878
13881 {
13882 return null;
13883 }
13884
13887 {
13888 return false;
13889 }
13890
13892 {
13894 {
13897 if (!trg)
13898 {
13900 explosive = this;
13901 }
13902
13903 explosive.PairRemote(trg);
13905
13906 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13907 trg.SetPersistentPairID(persistentID);
13908 explosive.SetPersistentPairID(persistentID);
13909
13910 return true;
13911 }
13912 return false;
13913 }
13914
13917 {
13918 float ret = 1.0;
13921 ret *= GetHealth01();
13922
13923 return ret;
13924 }
13925
13926 #ifdef DEVELOPER
13927 override void SetDebugItem()
13928 {
13929 super.SetDebugItem();
13930 _itemBase = this;
13931 }
13932
13934 {
13935 string text = super.GetDebugText();
13936
13938 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13939
13940 return text;
13941 }
13942 #endif
13943
13945 {
13946 return true;
13947 }
13948
13950
13952
13954 {
13957 }
13958
13959
13967
13983}
13984
13986{
13988 if (entity)
13989 {
13990 bool is_item = entity.IsInherited(
ItemBase);
13991 if (is_item && full_quantity)
13992 {
13995 }
13996 }
13997 else
13998 {
14000 return NULL;
14001 }
14002 return entity;
14003}
14004
14006{
14007 if (item)
14008 {
14009 if (health > 0)
14010 item.SetHealth("", "", health);
14011
14012 if (item.CanHaveTemperature())
14013 {
14015 if (item.CanFreeze())
14016 item.SetFrozen(false);
14017 }
14018
14019 if (item.HasEnergyManager())
14020 {
14021 if (quantity >= 0)
14022 {
14023 item.GetCompEM().SetEnergy0To1(quantity);
14024 }
14025 else
14026 {
14028 }
14029 }
14030 else if (item.IsMagazine())
14031 {
14032 Magazine mag = Magazine.Cast(item);
14033 if (quantity >= 0)
14034 {
14035 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14036 }
14037 else
14038 {
14040 }
14041
14042 }
14043 else
14044 {
14045 if (quantity >= 0)
14046 {
14047 item.SetQuantityNormalized(quantity, false);
14048 }
14049 else
14050 {
14052 }
14053
14054 }
14055 }
14056}
14057
14058#ifdef DEVELOPER
14060#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.