DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
9245{
9247 {
9248 return true;
9249 }
9250};
9251
9252
9253
9255{
9259
9261
9264
9265
9266
9267
9268
9277
9283
9288
9293
9314 protected bool m_IsResultOfSplit
9315
9317
9322
9323
9324
9326
9330
9331
9332
9334
9337
9338
9339
9345
9346
9354
9357
9358
9360
9361
9363
9364
9369
9370
9375
9376
9378
9379
9381 {
9386
9387 if (!
GetGame().IsDedicatedServer())
9388 {
9390 {
9392
9394 {
9396 }
9397 }
9398
9401 }
9402
9403 m_OldLocation = null;
9404
9406 {
9408 }
9409
9410 if (ConfigIsExisting("headSelectionsToHide"))
9411 {
9414 }
9415
9417 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9418 {
9420 }
9421
9423
9424 m_IsResultOfSplit = false;
9425
9427 }
9428
9430 {
9431 super.InitItemVariables();
9432
9438 m_Count = ConfigGetInt(
"count");
9439
9442
9447
9450
9455
9467
9471
9472
9475 if (ConfigIsExisting("canBeSplit"))
9476 {
9479 }
9480
9482 if (ConfigIsExisting("itemBehaviour"))
9484
9485
9488 RegisterNetSyncVariableInt("m_VarLiquidType");
9489 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9490
9491 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9492 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9493 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9494
9495 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9496 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9497 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9498 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9499
9500 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9501 RegisterNetSyncVariableBool("m_IsTakeable");
9502 RegisterNetSyncVariableBool("m_IsHologram");
9503
9506 {
9509 }
9510
9512
9514 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9516
9517 }
9518
9520 {
9522 }
9523
9525 {
9528 {
9533 }
9534 }
9535
9536 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9537 {
9539 {
9542 }
9543
9545 }
9546
9548 {
9554 }
9555
9557
9559 {
9561
9562 if (!action)
9563 {
9564 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9565 return;
9566 }
9567
9569 if (!ai)
9570 {
9572 return;
9573 }
9574
9576 if (!action_array)
9577 {
9578 action_array = new array<ActionBase_Basic>;
9580 }
9581 if (LogManager.IsActionLogEnable())
9582 {
9583 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9584 }
9585
9586 if (action_array.Find(action) != -1)
9587 {
9588 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9589 }
9590 else
9591 {
9592 action_array.Insert(action);
9593 }
9594 }
9595
9597 {
9599 ActionBase action = player.GetActionManager().GetAction(actionName);
9602
9603 if (action_array)
9604 {
9605 action_array.RemoveItem(action);
9606 }
9607 }
9608
9609
9610
9612 {
9613 ActionOverrideData overrideData = new ActionOverrideData();
9617
9619 if (!actionMap)
9620 {
9623 }
9624
9625 actionMap.Insert(this.
Type(), overrideData);
9626
9627 }
9628
9630
9632
9633
9635 {
9638
9641
9642 string config_to_search = "CfgVehicles";
9643 string muzzle_owner_config;
9644
9646 {
9647 if (IsInherited(Weapon))
9648 config_to_search = "CfgWeapons";
9649
9650 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9651
9652 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9653
9655
9656 if (config_OnFire_subclass_count > 0)
9657 {
9658 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9659
9660 for (int i = 0; i < config_OnFire_subclass_count; i++)
9661 {
9662 string particle_class = "";
9664 string config_OnFire_entry = config_OnFire_class + particle_class;
9665 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9666 WPOF_array.Insert(WPOF);
9667 }
9668
9669
9671 }
9672 }
9673
9675 {
9676 config_to_search = "CfgWeapons";
9677 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9678
9679 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9680
9682
9683 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9684 {
9685 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9686
9687 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9688 {
9689 string particle_class2 = "";
9691 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9692 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9693 WPOBE_array.Insert(WPOBE);
9694 }
9695
9696
9698 }
9699 }
9700 }
9701
9702
9704 {
9707
9709 {
9710 string config_to_search = "CfgVehicles";
9711
9712 if (IsInherited(Weapon))
9713 config_to_search = "CfgWeapons";
9714
9715 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9716 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9717
9718 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9719 {
9720
9722
9724 {
9726 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9728 return;
9729 }
9730
9733
9734
9735
9737 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9738
9739 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9740 {
9741 string particle_class = "";
9743 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9745
9746 if (entry_type == CT_CLASS)
9747 {
9748 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9749 WPOOH_array.Insert(WPOF);
9750 }
9751 }
9752
9753
9755 }
9756 }
9757 }
9758
9760 {
9762 }
9763
9765 {
9767 {
9769
9772
9775
9776 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9777 }
9778 }
9779
9781 {
9783 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9784
9786 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9787
9789 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9790
9792 {
9794 }
9795 }
9796
9798 {
9800 }
9801
9803 {
9806 else
9808
9810 {
9813 }
9814 else
9815 {
9818
9821 }
9822
9824 }
9825
9827 {
9829 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9830 }
9831
9833 {
9835 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9837 }
9838
9840 {
9842 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9843 }
9844
9846 {
9849
9850 OverheatingParticle OP = new OverheatingParticle();
9855
9857 }
9858
9860 {
9863
9864 return -1;
9865 }
9866
9868 {
9870 {
9873
9874 for (int i = count; i > 0; --i)
9875 {
9876 int id = i - 1;
9879
9882
9883 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9884 {
9885 if (p)
9886 {
9889 }
9890 }
9891 }
9892 }
9893 }
9894
9896 {
9898 {
9900 {
9901 int id = i - 1;
9903
9904 if (OP)
9905 {
9907
9908 if (p)
9909 {
9911 }
9912
9913 delete OP;
9914 }
9915 }
9916
9919 }
9920 }
9921
9924 {
9925 return 0.0;
9926 }
9927
9928
9930 {
9931 return 250;
9932 }
9933
9935 {
9936 return 0;
9937 }
9938
9941 {
9943 return true;
9944
9945 return false;
9946 }
9947
9950 {
9953
9955 {
9957 }
9958 else
9959 {
9960
9962 }
9963
9965 }
9966
9973 {
9974 return -1;
9975 }
9976
9977
9978
9979
9981 {
9983 {
9985 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9986
9987 if (r_index >= 0)
9988 {
9989 InventoryLocation r_il = new InventoryLocation;
9990 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9991
9992 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9995 {
9996 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9997 }
9999 {
10000 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10001 }
10002
10003 }
10004
10005 player.GetHumanInventory().ClearUserReservedLocation(this);
10006 }
10007
10010 }
10011
10012
10013
10014
10016 {
10017 return ItemBase.m_DebugActionsMask;
10018 }
10019
10021 {
10022 return ItemBase.m_DebugActionsMask & mask;
10023 }
10024
10026 {
10027 ItemBase.m_DebugActionsMask = mask;
10028 }
10029
10031 {
10032 ItemBase.m_DebugActionsMask |= mask;
10033 }
10034
10036 {
10037 ItemBase.m_DebugActionsMask &= ~mask;
10038 }
10039
10041 {
10043 {
10045 }
10046 else
10047 {
10049 }
10050 }
10051
10052
10054 {
10055 if (GetEconomyProfile())
10056 {
10057 float q_max = GetEconomyProfile().GetQuantityMax();
10058 if (q_max > 0)
10059 {
10060 float q_min = GetEconomyProfile().GetQuantityMin();
10061 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10062
10064 {
10065 ComponentEnergyManager comp = GetCompEM();
10067 {
10069 }
10070 }
10072 {
10074
10075 }
10076
10077 }
10078 }
10079 }
10080
10083 {
10084 EntityAI parent = GetHierarchyParent();
10085
10086 if (parent)
10087 {
10088 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10089 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10090 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10091 }
10092 }
10093
10096 {
10097 EntityAI parent = GetHierarchyParent();
10098
10099 if (parent)
10100 {
10101 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10102 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10103 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10104 }
10105 }
10106
10108 {
10109
10110
10111
10112
10114
10116 {
10117 if (ScriptInputUserData.CanStoreInputUserData())
10118 {
10119 ScriptInputUserData ctx = new ScriptInputUserData;
10125 ctx.
Write(use_stack_max);
10128
10130 {
10131 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10132 }
10133 }
10134 }
10135 else if (!
GetGame().IsMultiplayer())
10136 {
10138 }
10139 }
10140
10142 {
10144 }
10145
10147 {
10149 }
10150
10152 {
10154 }
10155
10157 {
10158
10159 return false;
10160 }
10161
10163 {
10164 return false;
10165 }
10166
10170 {
10171 return false;
10172 }
10173
10175 {
10176 return "";
10177 }
10178
10180
10182 {
10183 return false;
10184 }
10185
10187 {
10188 return true;
10189 }
10190
10191
10192
10194 {
10195 return true;
10196 }
10197
10199 {
10200 return true;
10201 }
10202
10204 {
10205 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10207 }
10208
10210 {
10212 }
10213
10215 {
10217 if (!is_being_placed)
10219 SetSynchDirty();
10220 }
10221
10222
10224
10226 {
10228 }
10229
10231 {
10233 }
10234
10236 {
10237 return 1;
10238 }
10239
10241 {
10242 return false;
10243 }
10244
10246 {
10248 SetSynchDirty();
10249 }
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10286 {
10287 super.OnMovedInsideCargo(container);
10288
10289 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10290 }
10291
10292 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10293 {
10294 super.EEItemLocationChanged(oldLoc,newLoc);
10295
10296 PlayerBase new_player = null;
10297 PlayerBase old_player = null;
10298
10299 if (newLoc.GetParent())
10300 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10301
10302 if (oldLoc.GetParent())
10303 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10304
10306 {
10307 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10308
10309 if (r_index >= 0)
10310 {
10311 InventoryLocation r_il = new InventoryLocation;
10312 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10313
10314 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10317 {
10318 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10319 }
10321 {
10322 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10323 }
10324
10325 }
10326 }
10327
10329 {
10330 if (new_player)
10331 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10332
10333 if (new_player == old_player)
10334 {
10335
10336 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10337 {
10339 {
10340 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10341 {
10342 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10343 }
10344 }
10345 else
10346 {
10347 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10348 }
10349 }
10350
10351 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10352 {
10353 int type = oldLoc.GetType();
10355 {
10356 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10357 }
10359 {
10360 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10361 }
10362 }
10363 if (!m_OldLocation)
10364 {
10365 m_OldLocation = new InventoryLocation;
10366 }
10367 m_OldLocation.Copy(oldLoc);
10368 }
10369 else
10370 {
10371 if (m_OldLocation)
10372 {
10373 m_OldLocation.Reset();
10374 }
10375 }
10376
10378 }
10379 else
10380 {
10381 if (new_player)
10382 {
10383 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10384 if (res_index >= 0)
10385 {
10386 InventoryLocation il = new InventoryLocation;
10387 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10389 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10392 {
10393 il.
GetParent().GetOnReleaseLock().Invoke(it);
10394 }
10396 {
10398 }
10399
10400 }
10401 }
10403 {
10404
10406 }
10407
10408 if (m_OldLocation)
10409 {
10410 m_OldLocation.Reset();
10411 }
10412 }
10413 }
10414
10415 override void EOnContact(IEntity other, Contact extra)
10416 {
10418 {
10419 int liquidType = -1;
10421 if (impactSpeed > 0.0)
10422 {
10424 #ifndef SERVER
10426 #else
10428 SetSynchDirty();
10429 #endif
10431 }
10432 }
10433
10434 #ifdef SERVER
10435 if (GetCompEM() && GetCompEM().IsPlugged())
10436 {
10437 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10438 GetCompEM().UnplugThis();
10439 }
10440 #endif
10441 }
10442
10444
10446 {
10448 }
10449
10451 {
10452
10453 }
10454
10456 {
10457 super.OnItemLocationChanged(old_owner, new_owner);
10458
10459 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10460 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10461
10462 if (!relatedPlayer && playerNew)
10463 relatedPlayer = playerNew;
10464
10465 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10466 {
10468 if (actionMgr)
10469 {
10470 ActionBase currentAction = actionMgr.GetRunningAction();
10471 if (currentAction)
10473 }
10474 }
10475
10476 Man ownerPlayerOld = null;
10477 Man ownerPlayerNew = null;
10478
10479 if (old_owner)
10480 {
10481 if (old_owner.
IsMan())
10482 {
10483 ownerPlayerOld = Man.Cast(old_owner);
10484 }
10485 else
10486 {
10487 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10488 }
10489 }
10490 else
10491 {
10493 {
10495
10496 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10497 {
10498 GetCompEM().UnplugThis();
10499 }
10500 }
10501 }
10502
10503 if (new_owner)
10504 {
10505 if (new_owner.
IsMan())
10506 {
10507 ownerPlayerNew = Man.Cast(new_owner);
10508 }
10509 else
10510 {
10511 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10512 }
10513 }
10514
10515 if (ownerPlayerOld != ownerPlayerNew)
10516 {
10517 if (ownerPlayerOld)
10518 {
10519 array<EntityAI> subItemsExit = new array<EntityAI>;
10521 for (int i = 0; i < subItemsExit.Count(); i++)
10522 {
10525 }
10526 }
10527
10528 if (ownerPlayerNew)
10529 {
10530 array<EntityAI> subItemsEnter = new array<EntityAI>;
10532 for (int j = 0; j < subItemsEnter.Count(); j++)
10533 {
10536 }
10537 }
10538 }
10539 else if (ownerPlayerNew != null)
10540 {
10541 PlayerBase nplayer;
10542 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10543 {
10544 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10546 for (int k = 0; k < subItemsUpdate.Count(); k++)
10547 {
10549 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10550 }
10551 }
10552 }
10553
10554 if (old_owner)
10555 old_owner.OnChildItemRemoved(this);
10556 if (new_owner)
10557 new_owner.OnChildItemReceived(this);
10558 }
10559
10560
10562 {
10563 super.EEDelete(parent);
10564 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10565 if (player)
10566 {
10568
10569 if (player.IsAlive())
10570 {
10571 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10572 if (r_index >= 0)
10573 {
10574 InventoryLocation r_il = new InventoryLocation;
10575 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10576
10577 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10580 {
10581 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10582 }
10584 {
10585 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10586 }
10587
10588 }
10589
10590 player.RemoveQuickBarEntityShortcut(this);
10591 }
10592 }
10593 }
10594
10596 {
10597 super.EEKilled(killer);
10598
10601 {
10602 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10603 {
10604 if (IsMagazine())
10605 {
10606 if (Magazine.Cast(this).GetAmmoCount() > 0)
10607 {
10609 }
10610 }
10611 else
10612 {
10614 }
10615 }
10616 }
10617 }
10618
10620 {
10621 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10622
10623 super.OnWasAttached(parent, slot_id);
10624
10627
10629 }
10630
10632 {
10633 super.OnWasDetached(parent, slot_id);
10634
10637 }
10638
10640 {
10641 int idx;
10644
10645 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10646 if (inventory_slots.Count() < 1)
10647 {
10648 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10649 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10650 }
10651 else
10652 {
10653 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10654 }
10655
10656 idx = inventory_slots.Find(slot);
10657 if (idx < 0)
10658 return "";
10659
10660 return attach_types.Get(idx);
10661 }
10662
10664 {
10665 int idx = -1;
10666 string slot;
10667
10670
10671 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10672 if (inventory_slots.Count() < 1)
10673 {
10674 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10675 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10676 }
10677 else
10678 {
10679 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10680 if (detach_types.Count() < 1)
10681 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10682 }
10683
10684 for (int i = 0; i < inventory_slots.Count(); i++)
10685 {
10686 slot = inventory_slots.Get(i);
10687 }
10688
10689 if (slot != "")
10690 {
10691 if (detach_types.Count() == 1)
10692 idx = 0;
10693 else
10694 idx = inventory_slots.Find(slot);
10695 }
10696 if (idx < 0)
10697 return "";
10698
10699 return detach_types.Get(idx);
10700 }
10701
10703 {
10704
10706
10707
10708 float min_time = 1;
10709 float max_time = 3;
10710 float delay = Math.RandomFloat(min_time, max_time);
10711
10712 explode_timer.Run(delay, this, "DoAmmoExplosion");
10713 }
10714
10716 {
10717 Magazine magazine = Magazine.Cast(this);
10718 int pop_sounds_count = 6;
10719 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10720
10721
10722 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10723 string sound_name = pop_sounds[ sound_idx ];
10725
10726
10727 magazine.ServerAddAmmoCount(-1);
10728
10729
10730 float min_temp_to_explode = 100;
10731
10732 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10733 {
10735 }
10736 }
10737
10738
10739 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10740 {
10741 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10742
10743 const int CHANCE_DAMAGE_CARGO = 4;
10744 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10745 const int CHANCE_DAMAGE_NOTHING = 2;
10746
10748 {
10749 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10750 int chances;
10751 int rnd;
10752
10753 if (GetInventory().GetCargo())
10754 {
10755 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10756 rnd = Math.RandomInt(0,chances);
10757
10758 if (rnd < CHANCE_DAMAGE_CARGO)
10759 {
10761 }
10762 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10763 {
10765 }
10766 }
10767 else
10768 {
10769 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10770 rnd = Math.RandomInt(0,chances);
10771
10772 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10773 {
10775 }
10776 }
10777 }
10778 }
10779
10781 {
10782 if (GetInventory().GetCargo())
10783 {
10784 int item_count = GetInventory().GetCargo().GetItemCount();
10785 if (item_count > 0)
10786 {
10787 int random_pick = Math.RandomInt(0, item_count);
10789 if (!item.IsExplosive())
10790 {
10791 item.AddHealth("","",damage);
10792 return true;
10793 }
10794 }
10795 }
10796 return false;
10797 }
10798
10800 {
10801 int attachment_count = GetInventory().AttachmentCount();
10802 if (attachment_count > 0)
10803 {
10804 int random_pick = Math.RandomInt(0, attachment_count);
10805 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10806 if (!attachment.IsExplosive())
10807 {
10808 attachment.AddHealth("","",damage);
10809 return true;
10810 }
10811 }
10812 return false;
10813 }
10814
10816 {
10818 }
10819
10821 {
10823 return GetInventory().CanRemoveEntity();
10824
10825 return false;
10826 }
10827
10829 {
10831 return;
10832
10834 {
10835 if (ScriptInputUserData.CanStoreInputUserData())
10836 {
10837 ScriptInputUserData ctx = new ScriptInputUserData;
10842 ctx.
Write(destination_entity);
10844 ctx.
Write(slot_id);
10846 }
10847 }
10848 else if (!
GetGame().IsMultiplayer())
10849 {
10851 }
10852 }
10853
10855 {
10857 return;
10858
10859 float split_quantity_new;
10863 InventoryLocation loc = new InventoryLocation;
10864
10865 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10866 {
10868 split_quantity_new = stack_max;
10869 else
10871
10872 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10873 if (new_item)
10874 {
10875 new_item.SetResultOfSplit(true);
10876 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10878 new_item.SetQuantity(split_quantity_new);
10879 }
10880 }
10881 else if (destination_entity && slot_id == -1)
10882 {
10883 if (quantity > stack_max)
10884 split_quantity_new = stack_max;
10885 else
10886 split_quantity_new = quantity;
10887
10889 {
10892 }
10893
10894 if (new_item)
10895 {
10896 new_item.SetResultOfSplit(true);
10897 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10899 new_item.SetQuantity(split_quantity_new);
10900 }
10901 }
10902 else
10903 {
10904 if (stack_max != 0)
10905 {
10907 {
10909 }
10910
10911 if (split_quantity_new == 0)
10912 {
10913 if (!
GetGame().IsMultiplayer())
10914 player.PhysicalPredictiveDropItem(this);
10915 else
10916 player.ServerDropEntity(this);
10917 return;
10918 }
10919
10921
10922 if (new_item)
10923 {
10924 new_item.SetResultOfSplit(true);
10925 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10927 new_item.SetQuantity(stack_max);
10928 new_item.PlaceOnSurface();
10929 }
10930 }
10931 }
10932 }
10933
10935 {
10937 return;
10938
10939 float split_quantity_new;
10943 InventoryLocation loc = new InventoryLocation;
10944
10945 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10946 {
10948 split_quantity_new = stack_max;
10949 else
10951
10952 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10953 if (new_item)
10954 {
10955 new_item.SetResultOfSplit(true);
10956 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10958 new_item.SetQuantity(split_quantity_new);
10959 }
10960 }
10961 else if (destination_entity && slot_id == -1)
10962 {
10963 if (quantity > stack_max)
10964 split_quantity_new = stack_max;
10965 else
10966 split_quantity_new = quantity;
10967
10969 {
10972 }
10973
10974 if (new_item)
10975 {
10976 new_item.SetResultOfSplit(true);
10977 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10979 new_item.SetQuantity(split_quantity_new);
10980 }
10981 }
10982 else
10983 {
10984 if (stack_max != 0)
10985 {
10987 {
10989 }
10990
10992
10993 if (new_item)
10994 {
10995 new_item.SetResultOfSplit(true);
10996 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10998 new_item.SetQuantity(stack_max);
10999 new_item.PlaceOnSurface();
11000 }
11001 }
11002 }
11003 }
11004
11006 {
11008 return;
11009
11011 {
11012 if (ScriptInputUserData.CanStoreInputUserData())
11013 {
11014 ScriptInputUserData ctx = new ScriptInputUserData;
11019 dst.WriteToContext(ctx);
11021 }
11022 }
11023 else if (!
GetGame().IsMultiplayer())
11024 {
11026 }
11027 }
11028
11030 {
11032 return;
11033
11035 {
11036 if (ScriptInputUserData.CanStoreInputUserData())
11037 {
11038 ScriptInputUserData ctx = new ScriptInputUserData;
11043 ctx.
Write(destination_entity);
11049 }
11050 }
11051 else if (!
GetGame().IsMultiplayer())
11052 {
11054 }
11055 }
11056
11058 {
11060 }
11061
11063 {
11065 return this;
11066
11068 float split_quantity_new;
11070 if (dst.IsValid())
11071 {
11072 int slot_id = dst.GetSlot();
11074
11075 if (quantity > stack_max)
11076 split_quantity_new = stack_max;
11077 else
11078 split_quantity_new = quantity;
11079
11081
11082 if (new_item)
11083 {
11084 new_item.SetResultOfSplit(true);
11085 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11088 }
11089
11090 return new_item;
11091 }
11092
11093 return null;
11094 }
11095
11097 {
11099 return;
11100
11102 float split_quantity_new;
11104 if (destination_entity)
11105 {
11107 if (quantity > stackable)
11108 split_quantity_new = stackable;
11109 else
11110 split_quantity_new = quantity;
11111
11112 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11113 if (new_item)
11114 {
11115 new_item.SetResultOfSplit(true);
11116 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11118 new_item.SetQuantity(split_quantity_new);
11119 }
11120 }
11121 }
11122
11124 {
11126 return;
11127
11129 {
11130 if (ScriptInputUserData.CanStoreInputUserData())
11131 {
11132 ScriptInputUserData ctx = new ScriptInputUserData;
11137 ItemBase destination_entity =
this;
11138 ctx.
Write(destination_entity);
11142 }
11143 }
11144 else if (!
GetGame().IsMultiplayer())
11145 {
11147 }
11148 }
11149
11151 {
11153 return;
11154
11156 float split_quantity_new;
11158 if (player)
11159 {
11161 if (quantity > stackable)
11162 split_quantity_new = stackable;
11163 else
11164 split_quantity_new = quantity;
11165
11166 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11167 new_item =
ItemBase.Cast(in_hands);
11168 if (new_item)
11169 {
11170 new_item.SetResultOfSplit(true);
11171 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11173 new_item.SetQuantity(split_quantity_new);
11174 }
11175 }
11176 }
11177
11179 {
11181 return;
11182
11184 float split_quantity_new = Math.Floor(quantity * 0.5);
11185
11187
11188 if (new_item)
11189 {
11190 if (new_item.GetQuantityMax() < split_quantity_new)
11191 {
11192 split_quantity_new = new_item.GetQuantityMax();
11193 }
11194
11195 new_item.SetResultOfSplit(true);
11196 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11197
11199 {
11202 }
11203 else
11204 {
11207 }
11208 }
11209 }
11210
11212 {
11214 return;
11215
11217 float split_quantity_new = Math.Floor(quantity / 2);
11218
11219 InventoryLocation invloc = new InventoryLocation;
11221
11223 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11224
11225 if (new_item)
11226 {
11227 if (new_item.GetQuantityMax() < split_quantity_new)
11228 {
11229 split_quantity_new = new_item.GetQuantityMax();
11230 }
11232 {
11235 }
11236 else
11237 {
11240 }
11241 }
11242 }
11243
11246 {
11247 SetWeightDirty();
11249
11250 if (parent)
11251 parent.OnAttachmentQuantityChangedEx(this, delta);
11252
11254 {
11256 {
11258 }
11260 {
11261 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11263 }
11264 }
11265
11266 }
11267
11270 {
11271
11272 }
11273
11276 {
11278 }
11279
11281 {
11282 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11283
11285 {
11286 if (newLevel == GameConstants.STATE_RUINED)
11287 {
11289 EntityAI parent = GetHierarchyParent();
11290 if (parent && parent.IsFireplace())
11291 {
11292 CargoBase cargo = GetInventory().GetCargo();
11293 if (cargo)
11294 {
11296 {
11298 }
11299 }
11300 }
11301 }
11302
11304 {
11305
11307 return;
11308 }
11309
11310 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11311 {
11313 }
11314 }
11315 }
11316
11317
11319 {
11320 super.OnRightClick();
11321
11323 {
11325 {
11326 if (ScriptInputUserData.CanStoreInputUserData())
11327 {
11328 vector m4[4];
11330
11331 EntityAI root = GetHierarchyRoot();
11332
11333 InventoryLocation dst = new InventoryLocation;
11335 {
11336 if (root)
11337 {
11338 root.GetTransform(m4);
11340 }
11341 else
11342 GetInventory().GetCurrentInventoryLocation(dst);
11343 }
11344 else
11345 {
11347
11348
11349 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11350 {
11351 if (root)
11352 {
11353 root.GetTransform(m4);
11355 }
11356 else
11357 GetInventory().GetCurrentInventoryLocation(dst);
11358 }
11359 else
11360 {
11361 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11362 }
11363 }
11364
11365 ScriptInputUserData ctx = new ScriptInputUserData;
11373 }
11374 }
11375 else if (!
GetGame().IsMultiplayer())
11376 {
11378 }
11379 }
11380 }
11381
11382 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11383 {
11384
11385 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11386 return false;
11387
11388 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11389 return false;
11390
11391
11393 return false;
11394
11395
11396 Magazine mag = Magazine.Cast(this);
11397 if (mag)
11398 {
11399 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11400 return false;
11401
11402 if (stack_max_limit)
11403 {
11404 Magazine other_mag = Magazine.Cast(other_item);
11405 if (other_item)
11406 {
11407 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11408 return false;
11409 }
11410
11411 }
11412 }
11413 else
11414 {
11415
11417 return false;
11418
11420 return false;
11421 }
11422
11423 PlayerBase player = null;
11424 if (CastTo(player, GetHierarchyRootPlayer()))
11425 {
11426 if (player.GetInventory().HasAttachment(this))
11427 return false;
11428
11429 if (player.IsItemsToDelete())
11430 return false;
11431 }
11432
11433 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11434 return false;
11435
11436 int slotID;
11438 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11439 return false;
11440
11441 return true;
11442 }
11443
11445 {
11447 }
11448
11450 {
11451 return m_IsResultOfSplit;
11452 }
11453
11455 {
11456 m_IsResultOfSplit = value;
11457 }
11458
11460 {
11462 }
11463
11465 {
11466 float other_item_quantity = other_item.GetQuantity();
11467 float this_free_space;
11468
11470
11472
11473 if (other_item_quantity > this_free_space)
11474 {
11475 return this_free_space;
11476 }
11477 else
11478 {
11479 return other_item_quantity;
11480 }
11481 }
11482
11484 {
11486 }
11487
11489 {
11491 return;
11492
11493 if (!IsMagazine() && other_item)
11494 {
11496 if (quantity_used != 0)
11497 {
11498 float hp1 = GetHealth01("","");
11499 float hp2 = other_item.GetHealth01("","");
11500 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11501 hpResult = hpResult / (
GetQuantity() + quantity_used);
11502
11503 hpResult *= GetMaxHealth();
11504 Math.Round(hpResult);
11505 SetHealth("", "Health", hpResult);
11506
11508 other_item.AddQuantity(-quantity_used);
11509 }
11510 }
11512 }
11513
11515 {
11516 #ifdef SERVER
11517 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11518 GetHierarchyParent().IncreaseLifetimeUp();
11519 #endif
11520 };
11521
11523 {
11524 PlayerBase p = PlayerBase.Cast(player);
11525
11526 array<int> recipesIds = p.m_Recipes;
11527 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11528 if (moduleRecipesManager)
11529 {
11530 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11531 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11532 }
11533
11534 for (int i = 0;i < recipesIds.Count(); i++)
11535 {
11536 int key = recipesIds.Get(i);
11537 string recipeName = moduleRecipesManager.GetRecipeName(key);
11539 }
11540 }
11541
11542
11543 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11544 {
11545 super.GetDebugActions(outputList);
11546
11547
11552
11553
11557
11561
11562
11565
11566
11568 {
11571 }
11572
11574
11577
11581 }
11582
11583
11584
11585
11587 {
11588 super.OnAction(action_id, player, ctx);
11589 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11590 {
11591 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11592 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11593 PlayerBase p = PlayerBase.Cast(player);
11594 if (
EActions.RECIPES_RANGE_START < 1000)
11595 {
11596 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11597 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11598 }
11599 }
11600 #ifndef SERVER
11601 else if (action_id ==
EActions.WATCH_PLAYER)
11602 {
11603 PluginDeveloper.SetDeveloperItemClientEx(player);
11604 }
11605 #endif
11607 {
11608 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11609 {
11610 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11611 OnDebugButtonPressServer(id + 1);
11612 }
11613
11614 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11615 {
11616 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11618 }
11619
11620 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11621 {
11622 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11624 }
11625
11626 else if (action_id ==
EActions.ADD_QUANTITY)
11627 {
11628 if (IsMagazine())
11629 {
11630 Magazine mag = Magazine.Cast(this);
11631 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11632 }
11633 else
11634 {
11636 }
11637
11638 if (m_EM)
11639 {
11640 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11641 }
11642
11643 }
11644
11645 else if (action_id ==
EActions.REMOVE_QUANTITY)
11646 {
11647 if (IsMagazine())
11648 {
11649 Magazine mag2 = Magazine.Cast(this);
11650 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11651 }
11652 else
11653 {
11655 }
11656 if (m_EM)
11657 {
11658 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11659 }
11660
11661 }
11662
11663 else if (action_id ==
EActions.SET_QUANTITY_0)
11664 {
11666
11667 if (m_EM)
11668 {
11669 m_EM.SetEnergy(0);
11670 }
11671 }
11672
11673 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11674 {
11676
11677 if (m_EM)
11678 {
11679 m_EM.SetEnergy(m_EM.GetEnergyMax());
11680 }
11681 }
11682
11683 else if (action_id ==
EActions.ADD_HEALTH)
11684 {
11685 AddHealth("","",GetMaxHealth("","Health")/5);
11686 }
11687 else if (action_id ==
EActions.REMOVE_HEALTH)
11688 {
11689 AddHealth("","",-GetMaxHealth("","Health")/5);
11690 }
11691 else if (action_id ==
EActions.DESTROY_HEALTH)
11692 {
11693 SetHealth01("","",0);
11694 }
11695 else if (action_id ==
EActions.WATCH_ITEM)
11696 {
11698 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11699 #ifdef DEVELOPER
11700 SetDebugDeveloper_item(this);
11701 #endif
11702 }
11703
11704 else if (action_id ==
EActions.ADD_TEMPERATURE)
11705 {
11706 AddTemperature(20);
11707
11708 }
11709
11710 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11711 {
11712 AddTemperature(-20);
11713
11714 }
11715
11716 else if (action_id ==
EActions.FLIP_FROZEN)
11717 {
11718 SetFrozen(!GetIsFrozen());
11719
11720 }
11721
11722 else if (action_id ==
EActions.ADD_WETNESS)
11723 {
11725
11726 }
11727
11728 else if (action_id ==
EActions.REMOVE_WETNESS)
11729 {
11731
11732 }
11733
11734 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11735 {
11738
11739
11740 }
11741
11742 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11743 {
11746 }
11747
11748 else if (action_id ==
EActions.MAKE_SPECIAL)
11749 {
11750 auto debugParams = DebugSpawnParams.WithPlayer(player);
11751 OnDebugSpawnEx(debugParams);
11752 }
11753
11754 else if (action_id ==
EActions.DELETE)
11755 {
11756 Delete();
11757 }
11758
11759 }
11760
11761
11762 return false;
11763 }
11764
11765
11766
11767
11771
11774
11775
11776
11778 {
11779 return false;
11780 }
11781
11782
11784 {
11785 return true;
11786 }
11787
11788
11790 {
11791 return true;
11792 }
11793
11794
11795
11797 {
11798 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11800 }
11801
11804 {
11805 return null;
11806 }
11807
11809 {
11810 return false;
11811 }
11812
11814 {
11815 return false;
11816 }
11817
11821
11822
11824 {
11825 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11826 return module_repairing.CanRepair(this, item_repair_kit);
11827 }
11828
11829
11830 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11831 {
11832 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11833 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11834 }
11835
11836
11838 {
11839
11840
11841
11842
11843
11844
11845
11846
11847 return 1;
11848 }
11849
11850
11851
11853 {
11855 }
11856
11857
11858
11860 {
11862 }
11863
11864
11873 {
11874 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11875
11876 if (player)
11877 {
11878 player.MessageStatus(text);
11879 }
11880 }
11881
11882
11891 {
11892 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11893
11894 if (player)
11895 {
11896 player.MessageAction(text);
11897 }
11898 }
11899
11900
11909 {
11910 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11911
11912 if (player)
11913 {
11914 player.MessageFriendly(text);
11915 }
11916 }
11917
11918
11927 {
11928 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11929
11930 if (player)
11931 {
11932 player.MessageImportant(text);
11933 }
11934 }
11935
11937 {
11938 return true;
11939 }
11940
11941
11942 override bool KindOf(
string tag)
11943 {
11944 bool found = false;
11945 string item_name = this.
GetType();
11948
11949 int array_size = item_tag_array.Count();
11950 for (int i = 0; i < array_size; i++)
11951 {
11952 if (item_tag_array.Get(i) == tag)
11953 {
11954 found = true;
11955 break;
11956 }
11957 }
11958 return found;
11959 }
11960
11961
11963 {
11964
11965 super.OnRPC(sender, rpc_type,ctx);
11966
11967
11968 switch (rpc_type)
11969 {
11970 #ifndef SERVER
11971 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11972 Param2<bool, string> p = new Param2<bool, string>(false, "");
11973
11975 return;
11976
11977 bool play = p.param1;
11978 string soundSet = p.param2;
11979
11980 if (play)
11981 {
11983 {
11985 {
11987 }
11988 }
11989 else
11990 {
11992 }
11993 }
11994 else
11995 {
11997 }
11998
11999 break;
12000 #endif
12001
12002 }
12003
12005 {
12007 }
12008 }
12009
12010
12011
12012
12014 {
12015 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12016 return plugin.GetID(
name);
12017 }
12018
12020 {
12021 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12022 return plugin.GetName(id);
12023 }
12024
12027 {
12028
12029
12030 int varFlags;
12031 if (!ctx.
Read(varFlags))
12032 return;
12033
12034 if (varFlags & ItemVariableFlags.FLOAT)
12035 {
12037 }
12038 }
12039
12041 {
12042
12043 super.SerializeNumericalVars(floats_out);
12044
12045
12046
12048 {
12050 }
12051
12053 {
12055 }
12056
12058 {
12060 }
12061
12063 {
12068 }
12069
12071 {
12073 }
12074 }
12075
12077 {
12078
12079 super.DeSerializeNumericalVars(floats);
12080
12081
12082 int index = 0;
12083 int mask = Math.Round(floats.Get(index));
12084
12085 index++;
12086
12088 {
12090 {
12092 }
12093 else
12094 {
12095 float quantity = floats.Get(index);
12096 SetQuantity(quantity,
true,
false,
false,
false);
12097 }
12098 index++;
12099 }
12100
12102 {
12103 float wet = floats.Get(index);
12105 index++;
12106 }
12107
12109 {
12110 int liquidtype = Math.Round(floats.Get(index));
12112 index++;
12113 }
12114
12116 {
12118 index++;
12120 index++;
12122 index++;
12124 index++;
12125 }
12126
12128 {
12129 int cleanness = Math.Round(floats.Get(index));
12131 index++;
12132 }
12133 }
12134
12136 {
12137 super.WriteVarsToCTX(ctx);
12138
12139
12141 {
12143 }
12144
12146 {
12148 }
12149
12151 {
12153 }
12154
12156 {
12157 int r,g,b,a;
12163 }
12164
12166 {
12168 }
12169 }
12170
12172 {
12173 if (!super.ReadVarsFromCTX(ctx,version))
12174 return false;
12175
12176 int intValue;
12177 float value;
12178
12179 if (version < 140)
12180 {
12181 if (!ctx.
Read(intValue))
12182 return false;
12183
12184 m_VariablesMask = intValue;
12185 }
12186
12188 {
12189 if (!ctx.
Read(value))
12190 return false;
12191
12193 {
12195 }
12196 else
12197 {
12199 }
12200 }
12201
12202 if (version < 140)
12203 {
12205 {
12206 if (!ctx.
Read(value))
12207 return false;
12208 SetTemperatureDirect(value);
12209 }
12210 }
12211
12213 {
12214 if (!ctx.
Read(value))
12215 return false;
12217 }
12218
12220 {
12221 if (!ctx.
Read(intValue))
12222 return false;
12224 }
12225
12227 {
12228 int r,g,b,a;
12230 return false;
12232 return false;
12234 return false;
12236 return false;
12237
12239 }
12240
12242 {
12243 if (!ctx.
Read(intValue))
12244 return false;
12246 }
12247
12248 if (version >= 138 && version < 140)
12249 {
12251 {
12252 if (!ctx.
Read(intValue))
12253 return false;
12254 SetFrozen(intValue);
12255 }
12256 }
12257
12258 return true;
12259 }
12260
12261
12263 {
12266 {
12268 }
12269
12270 if (!super.OnStoreLoad(ctx, version))
12271 {
12273 return false;
12274 }
12275
12276 if (version >= 114)
12277 {
12278 bool hasQuickBarIndexSaved;
12279
12280 if (!ctx.
Read(hasQuickBarIndexSaved))
12281 {
12283 return false;
12284 }
12285
12286 if (hasQuickBarIndexSaved)
12287 {
12288 int itmQBIndex;
12289
12290
12291 if (!ctx.
Read(itmQBIndex))
12292 {
12294 return false;
12295 }
12296
12297 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12298 if (itmQBIndex != -1 && parentPlayer)
12299 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12300 }
12301 }
12302 else
12303 {
12304
12305 PlayerBase player;
12306 int itemQBIndex;
12307 if (version ==
int.
MAX)
12308 {
12309 if (!ctx.
Read(itemQBIndex))
12310 {
12312 return false;
12313 }
12314 }
12315 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12316 {
12317
12318 if (!ctx.
Read(itemQBIndex))
12319 {
12321 return false;
12322 }
12323 if (itemQBIndex != -1 && player)
12324 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12325 }
12326 }
12327
12328 if (version < 140)
12329 {
12330
12331 if (!LoadVariables(ctx, version))
12332 {
12334 return false;
12335 }
12336 }
12337
12338
12340 {
12342 return false;
12343 }
12344 if (version >= 132)
12345 {
12347 if (raib)
12348 {
12350 {
12352 return false;
12353 }
12354 }
12355 }
12356
12358 return true;
12359 }
12360
12361
12362
12364 {
12365 super.OnStoreSave(ctx);
12366
12367 PlayerBase player;
12368 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12369 {
12371
12372 int itemQBIndex = -1;
12373 itemQBIndex = player.FindQuickBarEntityIndex(this);
12374 ctx.
Write(itemQBIndex);
12375 }
12376 else
12377 {
12379 }
12380
12382
12384 if (raib)
12385 {
12387 }
12388 }
12389
12390
12392 {
12393 super.AfterStoreLoad();
12394
12396 {
12398 }
12399
12401 {
12404 }
12405 }
12406
12408 {
12409 super.EEOnAfterLoad();
12410
12412 {
12414 }
12415
12418 }
12419
12421 {
12422 return false;
12423 }
12424
12425
12426
12428 {
12430 {
12431 #ifdef PLATFORM_CONSOLE
12432
12434 {
12436 if (menu)
12437 {
12439 }
12440 }
12441 #endif
12442 }
12443
12445 {
12448 }
12449
12451 {
12452 SetWeightDirty();
12454 }
12456 {
12459 }
12460
12462 {
12465 }
12467 {
12470 }
12471
12472 super.OnVariablesSynchronized();
12473 }
12474
12475
12476
12478 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12479 {
12480 if (!IsServerCheck(allow_client))
12481 return false;
12482
12484 return false;
12485
12488
12489 if (value <= (min + 0.001))
12490 value = min;
12491
12492 if (value == min)
12493 {
12494 if (destroy_config)
12495 {
12496 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12497 if (dstr)
12498 {
12500 this.Delete();
12501 return true;
12502 }
12503 }
12504 else if (destroy_forced)
12505 {
12507 this.Delete();
12508 return true;
12509 }
12510
12512 }
12513
12516
12518 {
12520
12521 if (delta)
12523 }
12524
12526
12527 return false;
12528 }
12529
12530
12532 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12533 {
12535 }
12536
12538 {
12541 }
12542
12544 {
12547 }
12548
12551 {
12552 float value_clamped = Math.Clamp(value, 0, 1);
12554 SetQuantity(result, destroy_config, destroy_forced);
12555 }
12556
12557
12560 {
12562 }
12563
12565 {
12567 }
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12579 {
12580 int slot = -1;
12581 if (GetInventory())
12582 {
12583 InventoryLocation il = new InventoryLocation;
12584 GetInventory().GetCurrentInventoryLocation(il);
12586 }
12587
12589 }
12590
12592 {
12593 float quantity_max = 0;
12594
12596 {
12597 if (attSlotID != -1)
12598 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12599
12600 if (quantity_max <= 0)
12602 }
12603
12604 if (quantity_max <= 0)
12606
12607 return quantity_max;
12608 }
12609
12611 {
12613 }
12614
12616 {
12618 }
12619
12620
12622 {
12624 }
12625
12627 {
12629 }
12630
12632 {
12634 }
12635
12636
12638 {
12639
12640 float weightEx = GetWeightEx();
12641 float special = GetInventoryAndCargoWeight();
12642 return weightEx - special;
12643 }
12644
12645
12647 {
12649 }
12650
12652 {
12654 {
12655 #ifdef DEVELOPER
12656 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12657 {
12658 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12660 }
12661 #endif
12662
12663 return GetQuantity() * GetConfigWeightModified();
12664 }
12665 else if (HasEnergyManager())
12666 {
12667 #ifdef DEVELOPER
12668 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12669 {
12670 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12671 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12672 }
12673 #endif
12674 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12675 }
12676 else
12677 {
12678 #ifdef DEVELOPER
12679 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12680 {
12681 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12682 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12683 }
12684 #endif
12685 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12686 }
12687 }
12688
12691 {
12692 int item_count = 0;
12694
12695 if (GetInventory().GetCargo() != NULL)
12696 {
12697 item_count = GetInventory().GetCargo().GetItemCount();
12698 }
12699
12700 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12701 {
12702 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12703 if (item)
12704 item_count += item.GetNumberOfItems();
12705 }
12706 return item_count;
12707 }
12708
12711 {
12712 float weight = 0;
12713 float wetness = 1;
12714 if (include_wetness)
12717 {
12718 weight = wetness * m_ConfigWeight;
12719 }
12721 {
12722 weight = 1;
12723 }
12724 return weight;
12725 }
12726
12727
12728
12730 {
12731 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12732 {
12733 GameInventory inv = GetInventory();
12734 array<EntityAI> items = new array<EntityAI>;
12736 for (int i = 0; i < items.Count(); i++)
12737 {
12739 if (item)
12740 {
12742 }
12743 }
12744 }
12745 }
12746
12747
12748
12749
12751 {
12752 float energy = 0;
12753 if (HasEnergyManager())
12754 {
12755 energy = GetCompEM().GetEnergy();
12756 }
12757 return energy;
12758 }
12759
12760
12762 {
12763 super.OnEnergyConsumed();
12764
12766 }
12767
12769 {
12770 super.OnEnergyAdded();
12771
12773 }
12774
12775
12777 {
12778 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12779 {
12781 {
12782 float energy_0to1 = GetCompEM().GetEnergy0To1();
12784 }
12785 }
12786 }
12787
12788
12790 {
12791 return ConfigGetFloat("heatIsolation");
12792 }
12793
12795 {
12797 }
12798
12800 {
12801 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12802 if (
GetGame().ConfigIsExisting(paramPath))
12804
12805 return 0.0;
12806 }
12807
12809 {
12810 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12811 if (
GetGame().ConfigIsExisting(paramPath))
12813
12814 return 0.0;
12815 }
12816
12817 override void SetWet(
float value,
bool allow_client =
false)
12818 {
12819 if (!IsServerCheck(allow_client))
12820 return;
12821
12824
12826
12827 m_VarWet = Math.Clamp(value, min, max);
12828
12830 {
12833 }
12834 }
12835
12836 override void AddWet(
float value)
12837 {
12839 }
12840
12842 {
12844 }
12845
12847 {
12849 }
12850
12852 {
12854 }
12855
12857 {
12859 }
12860
12862 {
12864 }
12865
12866 override void OnWetChanged(
float newVal,
float oldVal)
12867 {
12870 if (newLevel != oldLevel)
12871 {
12873 }
12874 }
12875
12877 {
12878 SetWeightDirty();
12879 }
12880
12882 {
12883 return GetWetLevelInternal(
m_VarWet);
12884 }
12885
12886
12887
12889 {
12891 }
12892
12894 {
12896 }
12897
12899 {
12901 }
12902
12904 {
12906 }
12907
12908
12909
12911 {
12912 if (ConfigIsExisting("itemModelLength"))
12913 {
12914 return ConfigGetFloat("itemModelLength");
12915 }
12916 return 0;
12917 }
12918
12920 {
12921 if (ConfigIsExisting("itemAttachOffset"))
12922 {
12923 return ConfigGetFloat("itemAttachOffset");
12924 }
12925 return 0;
12926 }
12927
12928 override void SetCleanness(
int value,
bool allow_client =
false)
12929 {
12930 if (!IsServerCheck(allow_client))
12931 return;
12932
12934
12936
12939 }
12940
12942 {
12944 }
12945
12947 {
12948 return true;
12949 }
12950
12951
12952
12953
12955 {
12957 }
12958
12960 {
12962 }
12963
12964
12965
12966
12967 override void SetColor(
int r,
int g,
int b,
int a)
12968 {
12974 }
12976 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12977 {
12982 }
12983
12985 {
12987 }
12988
12991 {
12992 int r,g,b,a;
12994 r = r/255;
12995 g = g/255;
12996 b = b/255;
12997 a = a/255;
12998 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12999 }
13000
13001
13002
13003 override void SetLiquidType(
int value,
bool allow_client =
false)
13004 {
13005 if (!IsServerCheck(allow_client))
13006 return;
13007
13012 }
13013
13015 {
13016 return ConfigGetInt("varLiquidTypeInit");
13017 }
13018
13020 {
13022 }
13023
13025 {
13027 SetFrozen(false);
13028 }
13029
13032 {
13033 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13034 }
13035
13036
13039 {
13040 PlayerBase nplayer;
13041 if (PlayerBase.CastTo(nplayer, player))
13042 {
13044
13045 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13046 }
13047 }
13048
13049
13052 {
13053 PlayerBase nplayer;
13054 if (PlayerBase.CastTo(nplayer,player))
13055 {
13056
13057 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13058
13059 }
13060
13061
13062 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13063
13064
13065 if (HasEnergyManager())
13066 {
13067 GetCompEM().UpdatePlugState();
13068 }
13069 }
13070
13071
13073 {
13074 super.OnPlacementStarted(player);
13075
13077 }
13078
13079 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13080 {
13082 {
13083 m_AdminLog.OnPlacementComplete(player,
this);
13084 }
13085
13086 super.OnPlacementComplete(player, position, orientation);
13087 }
13088
13089
13090
13091
13092
13094 {
13096 {
13097 return true;
13098 }
13099 else
13100 {
13101 return false;
13102 }
13103 }
13104
13105
13107 {
13109 {
13111 }
13112 }
13113
13114
13116 {
13118 }
13119
13121 {
13123 }
13124
13125 override void InsertAgent(
int agent,
float count = 1)
13126 {
13127 if (count < 1)
13128 return;
13129
13131 }
13132
13135 {
13137 }
13138
13139
13141 {
13143 }
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13187 {
13189 return false;
13190 return true;
13191 }
13192
13194 {
13195
13197 }
13198
13199
13202 {
13203 super.CheckForRoofLimited(timeTresholdMS);
13204
13206 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13207 {
13208 m_PreviousRoofTestTime = time;
13209 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13210 }
13211 }
13212
13213
13215 {
13217 {
13218 return 0;
13219 }
13220
13221 if (GetInventory().GetAttachmentSlotsCount() != 0)
13222 {
13223 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13224 if (filter)
13225 return filter.GetProtectionLevel(type, false, system);
13226 else
13227 return 0;
13228 }
13229
13230 string subclassPath, entryName;
13231
13232 switch (type)
13233 {
13235 entryName = "biological";
13236 break;
13238 entryName = "chemical";
13239 break;
13240 default:
13241 entryName = "biological";
13242 break;
13243 }
13244
13245 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13246
13248 }
13249
13250
13251
13254 {
13255 if (!IsMagazine())
13257
13259 }
13260
13261
13262
13263
13264
13269 {
13270 return true;
13271 }
13272
13274 {
13276 }
13277
13278
13279
13280
13281
13283 {
13284 if (parent)
13285 {
13286 if (parent.IsInherited(DayZInfected))
13287 return true;
13288
13289 if (!parent.IsRuined())
13290 return true;
13291 }
13292
13293 return true;
13294 }
13295
13297 {
13298 if (!super.CanPutAsAttachment(parent))
13299 {
13300 return false;
13301 }
13302
13303 if (!IsRuined() && !parent.IsRuined())
13304 {
13305 return true;
13306 }
13307
13308 return false;
13309 }
13310
13312 {
13313
13314
13315
13316
13317 return super.CanReceiveItemIntoCargo(item);
13318 }
13319
13321 {
13322
13323
13324
13325
13326 GameInventory attachmentInv = attachment.GetInventory();
13328 {
13329 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13330 return false;
13331 }
13332
13333 InventoryLocation loc = new InventoryLocation();
13334 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13335 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13336 return false;
13337
13338 return super.CanReceiveAttachment(attachment, slotId);
13339 }
13340
13342 {
13343 if (!super.CanReleaseAttachment(attachment))
13344 return false;
13345
13346 return GetInventory().AreChildrenAccessible();
13347 }
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13370 {
13371 int id = muzzle_owner.GetMuzzleID();
13372 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13373
13374 if (WPOF_array)
13375 {
13376 for (int i = 0; i < WPOF_array.Count(); i++)
13377 {
13378 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13379
13380 if (WPOF)
13381 {
13382 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13383 }
13384 }
13385 }
13386 }
13387
13388
13390 {
13391 int id = muzzle_owner.GetMuzzleID();
13393
13394 if (WPOBE_array)
13395 {
13396 for (int i = 0; i < WPOBE_array.Count(); i++)
13397 {
13398 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13399
13400 if (WPOBE)
13401 {
13402 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13403 }
13404 }
13405 }
13406 }
13407
13408
13410 {
13411 int id = muzzle_owner.GetMuzzleID();
13412 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13413
13414 if (WPOOH_array)
13415 {
13416 for (int i = 0; i < WPOOH_array.Count(); i++)
13417 {
13418 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13419
13420 if (WPOOH)
13421 {
13422 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13423 }
13424 }
13425 }
13426 }
13427
13428
13430 {
13431 int id = muzzle_owner.GetMuzzleID();
13432 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13433
13434 if (WPOOH_array)
13435 {
13436 for (int i = 0; i < WPOOH_array.Count(); i++)
13437 {
13438 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13439
13440 if (WPOOH)
13441 {
13442 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13443 }
13444 }
13445 }
13446 }
13447
13448
13450 {
13451 int id = muzzle_owner.GetMuzzleID();
13452 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13453
13454 if (WPOOH_array)
13455 {
13456 for (int i = 0; i < WPOOH_array.Count(); i++)
13457 {
13458 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13459
13460 if (WPOOH)
13461 {
13462 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13463 }
13464 }
13465 }
13466 }
13467
13468
13469
13471 {
13473 {
13474 return true;
13475 }
13476
13477 return false;
13478 }
13479
13481 {
13483 {
13484 return true;
13485 }
13486
13487 return false;
13488 }
13489
13491 {
13493 {
13494 return true;
13495 }
13496
13497 return false;
13498 }
13499
13501 {
13502 return false;
13503 }
13504
13507 {
13508 return UATimeSpent.DEFAULT_DEPLOY;
13509 }
13510
13511
13512
13513
13515 {
13517 SetSynchDirty();
13518 }
13519
13521 {
13523 }
13524
13525
13527 {
13528 return false;
13529 }
13530
13533 {
13534 string att_type = "None";
13535
13536 if (ConfigIsExisting("soundAttType"))
13537 {
13538 att_type = ConfigGetString("soundAttType");
13539 }
13540
13542 }
13543
13545 {
13547 }
13548
13549
13550
13551
13552
13556
13558 {
13561
13563 }
13564
13565
13567 {
13569 return;
13570
13572
13575
13578
13579 SoundParameters params = new SoundParameters();
13583 }
13584
13585
13587 {
13589 return;
13590
13592 SetSynchDirty();
13593
13596 }
13597
13598
13600 {
13602 return;
13603
13605 SetSynchDirty();
13606
13609 }
13610
13612 {
13614 }
13615
13617 {
13619 }
13620
13623 {
13624 if (!
GetGame().IsDedicatedServer())
13625 {
13626 if (ConfigIsExisting("attachSoundSet"))
13627 {
13628 string cfg_path = "";
13629 string soundset = "";
13630 string type_name =
GetType();
13631
13634 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13635 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13636
13637 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13638 {
13639 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13640 {
13641 if (cfg_slot_array[i] == slot_type)
13642 {
13643 soundset = cfg_soundset_array[i];
13644 break;
13645 }
13646 }
13647 }
13648
13649 if (soundset != "")
13650 {
13651 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13653 }
13654 }
13655 }
13656 }
13657
13659 {
13660
13661 }
13662
13663 void OnApply(PlayerBase player);
13664
13666 {
13667 return 1.0;
13668 };
13669
13671 {
13673 }
13674
13676 {
13678 }
13679
13681
13683 {
13684 SetDynamicPhysicsLifeTime(0.01);
13686 }
13687
13689 {
13690 array<string> zone_names = new array<string>;
13691 GetDamageZones(zone_names);
13692 for (int i = 0; i < zone_names.Count(); i++)
13693 {
13694 SetHealthMax(zone_names.Get(i),"Health");
13695 }
13696 SetHealthMax("","Health");
13697 }
13698
13701 {
13702 float global_health = GetHealth01("","Health");
13703 array<string> zones = new array<string>;
13704 GetDamageZones(zones);
13705
13706 for (int i = 0; i < zones.Count(); i++)
13707 {
13708 SetHealth01(zones.Get(i),"Health",global_health);
13709 }
13710 }
13711
13714 {
13715 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13716 }
13717
13719 {
13720 if (!hasRootAsPlayer)
13721 {
13722 if (refParentIB)
13723 {
13724
13725 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13726 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13727
13728 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13729 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13730
13733 }
13734 else
13735 {
13736
13739 }
13740 }
13741 }
13742
13744 {
13746 {
13747 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13748 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13749 {
13750 float heatPermCoef = 1.0;
13752 while (ent)
13753 {
13754 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13755 ent = ent.GetHierarchyParent();
13756 }
13757
13758 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13759 }
13760 }
13761 }
13762
13764 {
13765
13766 EntityAI parent = GetHierarchyParent();
13767 if (!parent)
13768 {
13769 hasParent = false;
13770 hasRootAsPlayer = false;
13771 }
13772 else
13773 {
13774 hasParent = true;
13775 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13776 refParentIB =
ItemBase.Cast(parent);
13777 }
13778 }
13779
13780 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13781 {
13782
13783 }
13784
13786 {
13787
13788 return false;
13789 }
13790
13792 {
13793
13794
13795 return false;
13796 }
13797
13799 {
13800
13801 return false;
13802 }
13803
13806 {
13807 return !GetIsFrozen() &&
IsOpen();
13808 }
13809
13811 {
13812 bool hasParent = false, hasRootAsPlayer = false;
13814
13815 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13816 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13817
13818 if (wwtu || foodDecay)
13819 {
13823
13824 if (processWetness || processTemperature || processDecay)
13825 {
13827
13828 if (processWetness)
13829 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13830
13831 if (processTemperature)
13833
13834 if (processDecay)
13835 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13836 }
13837 }
13838 }
13839
13842 {
13844 }
13845
13847 {
13850
13851 return super.GetTemperatureFreezeThreshold();
13852 }
13853
13855 {
13858
13859 return super.GetTemperatureThawThreshold();
13860 }
13861
13863 {
13866
13867 return super.GetItemOverheatThreshold();
13868 }
13869
13871 {
13873 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13874
13875 return super.GetTemperatureFreezeTime();
13876 }
13877
13879 {
13881 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13882
13883 return super.GetTemperatureThawTime();
13884 }
13885
13890
13892 {
13893 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13894 }
13895
13897 {
13898 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13899 }
13900
13903 {
13905 }
13906
13908 {
13910 }
13911
13913 {
13915 }
13916
13919 {
13920 return null;
13921 }
13922
13925 {
13926 return false;
13927 }
13928
13930 {
13932 {
13935 if (!trg)
13936 {
13938 explosive = this;
13939 }
13940
13941 explosive.PairRemote(trg);
13943
13944 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13945 trg.SetPersistentPairID(persistentID);
13946 explosive.SetPersistentPairID(persistentID);
13947
13948 return true;
13949 }
13950 return false;
13951 }
13952
13955 {
13956 float ret = 1.0;
13959 ret *= GetHealth01();
13960
13961 return ret;
13962 }
13963
13964 #ifdef DEVELOPER
13965 override void SetDebugItem()
13966 {
13967 super.SetDebugItem();
13968 _itemBase = this;
13969 }
13970
13972 {
13973 string text = super.GetDebugText();
13974
13976 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13977
13978 return text;
13979 }
13980 #endif
13981
13983 {
13984 return true;
13985 }
13986
13988
13990
13992 {
13995 }
13996
13997
14005
14021}
14022
14024{
14026 if (entity)
14027 {
14028 bool is_item = entity.IsInherited(
ItemBase);
14029 if (is_item && full_quantity)
14030 {
14033 }
14034 }
14035 else
14036 {
14038 return NULL;
14039 }
14040 return entity;
14041}
14042
14044{
14045 if (item)
14046 {
14047 if (health > 0)
14048 item.SetHealth("", "", health);
14049
14050 if (item.CanHaveTemperature())
14051 {
14053 if (item.CanFreeze())
14054 item.SetFrozen(false);
14055 }
14056
14057 if (item.HasEnergyManager())
14058 {
14059 if (quantity >= 0)
14060 {
14061 item.GetCompEM().SetEnergy0To1(quantity);
14062 }
14063 else
14064 {
14066 }
14067 }
14068 else if (item.IsMagazine())
14069 {
14070 Magazine mag = Magazine.Cast(item);
14071 if (quantity >= 0)
14072 {
14073 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14074 }
14075 else
14076 {
14078 }
14079
14080 }
14081 else
14082 {
14083 if (quantity >= 0)
14084 {
14085 item.SetQuantityNormalized(quantity, false);
14086 }
14087 else
14088 {
14090 }
14091
14092 }
14093 }
14094}
14095
14096#ifdef DEVELOPER
14098#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.