9188{
9190 {
9191 return true;
9192 }
9193};
9194
9195
9196
9198{
9202
9204
9207
9208
9209
9210
9211
9220
9226
9231
9236
9257 protected bool m_IsResultOfSplit
9258
9260
9265
9266
9267
9269
9273
9274
9275
9277
9280
9281
9282
9288
9289
9297
9300
9301
9303
9304
9306
9307
9312
9313
9318
9319
9321
9322
9324 {
9329
9330 if (!
GetGame().IsDedicatedServer())
9331 {
9333 {
9335
9337 {
9339 }
9340 }
9341
9344 }
9345
9346 m_OldLocation = null;
9347
9349 {
9351 }
9352
9353 if (ConfigIsExisting("headSelectionsToHide"))
9354 {
9357 }
9358
9360 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9361 {
9363 }
9364
9366
9367 m_IsResultOfSplit = false;
9368
9370 }
9371
9373 {
9374 super.InitItemVariables();
9375
9381 m_Count = ConfigGetInt(
"count");
9382
9385
9390
9393
9398
9410
9414
9415
9418 if (ConfigIsExisting("canBeSplit"))
9419 {
9422 }
9423
9425 if (ConfigIsExisting("itemBehaviour"))
9427
9428
9431 RegisterNetSyncVariableInt("m_VarLiquidType");
9432 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9433
9434 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9435 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9436 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9437
9438 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9439 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9440 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9441 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9442
9443 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9444 RegisterNetSyncVariableBool("m_IsTakeable");
9445 RegisterNetSyncVariableBool("m_IsHologram");
9446
9449 {
9452 }
9453
9455
9457 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9459
9460 }
9461
9463 {
9465 }
9466
9468 {
9471 {
9476 }
9477 }
9478
9479 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9480 {
9482 {
9485 }
9486
9488 }
9489
9491 {
9497 }
9498
9500
9502 {
9504
9505 if (!action)
9506 {
9507 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9508 return;
9509 }
9510
9512 if (!ai)
9513 {
9515 return;
9516 }
9517
9519 if (!action_array)
9520 {
9521 action_array = new array<ActionBase_Basic>;
9523 }
9524 if (LogManager.IsActionLogEnable())
9525 {
9526 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9527 }
9528
9529 if (action_array.Find(action) != -1)
9530 {
9531 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9532 }
9533 else
9534 {
9535 action_array.Insert(action);
9536 }
9537 }
9538
9540 {
9542 ActionBase action = player.GetActionManager().GetAction(actionName);
9545
9546 if (action_array)
9547 {
9548 action_array.RemoveItem(action);
9549 }
9550 }
9551
9552
9553
9555 {
9556 ActionOverrideData overrideData = new ActionOverrideData();
9560
9562 if (!actionMap)
9563 {
9566 }
9567
9568 actionMap.Insert(this.
Type(), overrideData);
9569
9570 }
9571
9573
9575
9576
9578 {
9581
9584
9585 string config_to_search = "CfgVehicles";
9586 string muzzle_owner_config;
9587
9589 {
9590 if (IsInherited(Weapon))
9591 config_to_search = "CfgWeapons";
9592
9593 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9594
9595 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9596
9598
9599 if (config_OnFire_subclass_count > 0)
9600 {
9601 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9602
9603 for (int i = 0; i < config_OnFire_subclass_count; i++)
9604 {
9605 string particle_class = "";
9607 string config_OnFire_entry = config_OnFire_class + particle_class;
9608 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9609 WPOF_array.Insert(WPOF);
9610 }
9611
9612
9614 }
9615 }
9616
9618 {
9619 config_to_search = "CfgWeapons";
9620 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9621
9622 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9623
9625
9626 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9627 {
9628 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9629
9630 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9631 {
9632 string particle_class2 = "";
9634 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9635 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9636 WPOBE_array.Insert(WPOBE);
9637 }
9638
9639
9641 }
9642 }
9643 }
9644
9645
9647 {
9650
9652 {
9653 string config_to_search = "CfgVehicles";
9654
9655 if (IsInherited(Weapon))
9656 config_to_search = "CfgWeapons";
9657
9658 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9659 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9660
9661 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9662 {
9663
9665
9667 {
9669 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9671 return;
9672 }
9673
9676
9677
9678
9680 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9681
9682 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9683 {
9684 string particle_class = "";
9686 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9688
9689 if (entry_type == CT_CLASS)
9690 {
9691 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9692 WPOOH_array.Insert(WPOF);
9693 }
9694 }
9695
9696
9698 }
9699 }
9700 }
9701
9703 {
9705 }
9706
9708 {
9710 {
9712
9715
9718
9719 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9720 }
9721 }
9722
9724 {
9726 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9727
9729 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9730
9732 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9733
9735 {
9737 }
9738 }
9739
9741 {
9743 }
9744
9746 {
9749 else
9751
9753 {
9756 }
9757 else
9758 {
9761
9764 }
9765
9767 }
9768
9770 {
9772 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9773 }
9774
9776 {
9778 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9780 }
9781
9783 {
9785 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9786 }
9787
9789 {
9792
9793 OverheatingParticle OP = new OverheatingParticle();
9798
9800 }
9801
9803 {
9806
9807 return -1;
9808 }
9809
9811 {
9813 {
9816
9817 for (int i = count; i > 0; --i)
9818 {
9819 int id = i - 1;
9822
9825
9826 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9827 {
9828 if (p)
9829 {
9832 }
9833 }
9834 }
9835 }
9836 }
9837
9839 {
9841 {
9843 {
9844 int id = i - 1;
9846
9847 if (OP)
9848 {
9850
9851 if (p)
9852 {
9854 }
9855
9856 delete OP;
9857 }
9858 }
9859
9862 }
9863 }
9864
9867 {
9868 return 0.0;
9869 }
9870
9871
9873 {
9874 return 250;
9875 }
9876
9878 {
9879 return 0;
9880 }
9881
9884 {
9886 return true;
9887
9888 return false;
9889 }
9890
9893 {
9896
9898 {
9900 }
9901 else
9902 {
9903
9905 }
9906
9908 }
9909
9916 {
9917 return -1;
9918 }
9919
9920
9921
9922
9924 {
9926 {
9928 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9929
9930 if (r_index >= 0)
9931 {
9932 InventoryLocation r_il = new InventoryLocation;
9933 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9934
9935 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9938 {
9939 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9940 }
9942 {
9943 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9944 }
9945
9946 }
9947
9948 player.GetHumanInventory().ClearUserReservedLocation(this);
9949 }
9950
9953 }
9954
9955
9956
9957
9959 {
9960 return ItemBase.m_DebugActionsMask;
9961 }
9962
9964 {
9965 return ItemBase.m_DebugActionsMask & mask;
9966 }
9967
9969 {
9970 ItemBase.m_DebugActionsMask = mask;
9971 }
9972
9974 {
9975 ItemBase.m_DebugActionsMask |= mask;
9976 }
9977
9979 {
9980 ItemBase.m_DebugActionsMask &= ~mask;
9981 }
9982
9984 {
9986 {
9988 }
9989 else
9990 {
9992 }
9993 }
9994
9995
9997 {
9998 if (GetEconomyProfile())
9999 {
10000 float q_max = GetEconomyProfile().GetQuantityMax();
10001 if (q_max > 0)
10002 {
10003 float q_min = GetEconomyProfile().GetQuantityMin();
10004 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10005
10007 {
10008 ComponentEnergyManager comp = GetCompEM();
10010 {
10012 }
10013 }
10015 {
10017
10018 }
10019
10020 }
10021 }
10022 }
10023
10026 {
10027 EntityAI parent = GetHierarchyParent();
10028
10029 if (parent)
10030 {
10031 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10032 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10033 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10034 }
10035 }
10036
10039 {
10040 EntityAI parent = GetHierarchyParent();
10041
10042 if (parent)
10043 {
10044 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10045 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10046 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10047 }
10048 }
10049
10051 {
10052
10053
10054
10055
10057
10059 {
10060 if (ScriptInputUserData.CanStoreInputUserData())
10061 {
10062 ScriptInputUserData ctx = new ScriptInputUserData;
10068 ctx.
Write(use_stack_max);
10071
10073 {
10074 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10075 }
10076 }
10077 }
10078 else if (!
GetGame().IsMultiplayer())
10079 {
10081 }
10082 }
10083
10085 {
10087 }
10088
10090 {
10092 }
10093
10095 {
10097 }
10098
10100 {
10101
10102 return false;
10103 }
10104
10106 {
10107 return false;
10108 }
10109
10113 {
10114 return false;
10115 }
10116
10118 {
10119 return "";
10120 }
10121
10123
10125 {
10126 return false;
10127 }
10128
10130 {
10131 return true;
10132 }
10133
10134
10135
10137 {
10138 return true;
10139 }
10140
10142 {
10143 return true;
10144 }
10145
10147 {
10148 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10150 }
10151
10153 {
10155 }
10156
10158 {
10160 if (!is_being_placed)
10162 SetSynchDirty();
10163 }
10164
10165
10167
10169 {
10171 }
10172
10174 {
10176 }
10177
10179 {
10180 return 1;
10181 }
10182
10184 {
10185 return false;
10186 }
10187
10189 {
10191 SetSynchDirty();
10192 }
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10229 {
10230 super.OnMovedInsideCargo(container);
10231
10232 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10233 }
10234
10235 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10236 {
10237 super.EEItemLocationChanged(oldLoc,newLoc);
10238
10239 PlayerBase new_player = null;
10240 PlayerBase old_player = null;
10241
10242 if (newLoc.GetParent())
10243 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10244
10245 if (oldLoc.GetParent())
10246 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10247
10249 {
10250 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10251
10252 if (r_index >= 0)
10253 {
10254 InventoryLocation r_il = new InventoryLocation;
10255 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10256
10257 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10260 {
10261 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10262 }
10264 {
10265 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10266 }
10267
10268 }
10269 }
10270
10272 {
10273 if (new_player)
10274 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10275
10276 if (new_player == old_player)
10277 {
10278
10279 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10280 {
10282 {
10283 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10284 {
10285 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10286 }
10287 }
10288 else
10289 {
10290 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10291 }
10292 }
10293
10294 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10295 {
10296 int type = oldLoc.GetType();
10298 {
10299 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10300 }
10302 {
10303 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10304 }
10305 }
10306 if (!m_OldLocation)
10307 {
10308 m_OldLocation = new InventoryLocation;
10309 }
10310 m_OldLocation.Copy(oldLoc);
10311 }
10312 else
10313 {
10314 if (m_OldLocation)
10315 {
10316 m_OldLocation.Reset();
10317 }
10318 }
10319
10321 }
10322 else
10323 {
10324 if (new_player)
10325 {
10326 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10327 if (res_index >= 0)
10328 {
10329 InventoryLocation il = new InventoryLocation;
10330 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10332 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10335 {
10336 il.
GetParent().GetOnReleaseLock().Invoke(it);
10337 }
10339 {
10341 }
10342
10343 }
10344 }
10346 {
10347
10349 }
10350
10351 if (m_OldLocation)
10352 {
10353 m_OldLocation.Reset();
10354 }
10355 }
10356 }
10357
10358 override void EOnContact(IEntity other, Contact extra)
10359 {
10361 {
10362 int liquidType = -1;
10364 if (impactSpeed > 0.0)
10365 {
10367 #ifndef SERVER
10369 #else
10371 SetSynchDirty();
10372 #endif
10374 }
10375 }
10376
10377 #ifdef SERVER
10378 if (GetCompEM() && GetCompEM().IsPlugged())
10379 {
10380 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10381 GetCompEM().UnplugThis();
10382 }
10383 #endif
10384 }
10385
10387
10389 {
10391 }
10392
10394 {
10395
10396 }
10397
10399 {
10400 super.OnItemLocationChanged(old_owner, new_owner);
10401
10402 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10403 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10404
10405 if (!relatedPlayer && playerNew)
10406 relatedPlayer = playerNew;
10407
10408 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10409 {
10411 if (actionMgr)
10412 {
10413 ActionBase currentAction = actionMgr.GetRunningAction();
10414 if (currentAction)
10416 }
10417 }
10418
10419 Man ownerPlayerOld = null;
10420 Man ownerPlayerNew = null;
10421
10422 if (old_owner)
10423 {
10424 if (old_owner.
IsMan())
10425 {
10426 ownerPlayerOld = Man.Cast(old_owner);
10427 }
10428 else
10429 {
10430 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10431 }
10432 }
10433 else
10434 {
10436 {
10438
10439 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10440 {
10441 GetCompEM().UnplugThis();
10442 }
10443 }
10444 }
10445
10446 if (new_owner)
10447 {
10448 if (new_owner.
IsMan())
10449 {
10450 ownerPlayerNew = Man.Cast(new_owner);
10451 }
10452 else
10453 {
10454 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10455 }
10456 }
10457
10458 if (ownerPlayerOld != ownerPlayerNew)
10459 {
10460 if (ownerPlayerOld)
10461 {
10462 array<EntityAI> subItemsExit = new array<EntityAI>;
10464 for (int i = 0; i < subItemsExit.Count(); i++)
10465 {
10468 }
10469 }
10470
10471 if (ownerPlayerNew)
10472 {
10473 array<EntityAI> subItemsEnter = new array<EntityAI>;
10475 for (int j = 0; j < subItemsEnter.Count(); j++)
10476 {
10479 }
10480 }
10481 }
10482 else if (ownerPlayerNew != null)
10483 {
10484 PlayerBase nplayer;
10485 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10486 {
10487 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10489 for (int k = 0; k < subItemsUpdate.Count(); k++)
10490 {
10492 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10493 }
10494 }
10495 }
10496
10497 if (old_owner)
10498 old_owner.OnChildItemRemoved(this);
10499 if (new_owner)
10500 new_owner.OnChildItemReceived(this);
10501 }
10502
10503
10505 {
10506 super.EEDelete(parent);
10507 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10508 if (player)
10509 {
10511
10512 if (player.IsAlive())
10513 {
10514 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10515 if (r_index >= 0)
10516 {
10517 InventoryLocation r_il = new InventoryLocation;
10518 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10519
10520 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10523 {
10524 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10525 }
10527 {
10528 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10529 }
10530
10531 }
10532
10533 player.RemoveQuickBarEntityShortcut(this);
10534 }
10535 }
10536 }
10537
10539 {
10540 super.EEKilled(killer);
10541
10544 {
10545 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10546 {
10547 if (IsMagazine())
10548 {
10549 if (Magazine.Cast(this).GetAmmoCount() > 0)
10550 {
10552 }
10553 }
10554 else
10555 {
10557 }
10558 }
10559 }
10560 }
10561
10563 {
10564 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10565
10566 super.OnWasAttached(parent, slot_id);
10567
10570
10572 }
10573
10575 {
10576 super.OnWasDetached(parent, slot_id);
10577
10580 }
10581
10583 {
10584 int idx;
10587
10588 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10589 if (inventory_slots.Count() < 1)
10590 {
10591 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10592 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10593 }
10594 else
10595 {
10596 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10597 }
10598
10599 idx = inventory_slots.Find(slot);
10600 if (idx < 0)
10601 return "";
10602
10603 return attach_types.Get(idx);
10604 }
10605
10607 {
10608 int idx = -1;
10609 string slot;
10610
10613
10614 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10615 if (inventory_slots.Count() < 1)
10616 {
10617 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10618 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10619 }
10620 else
10621 {
10622 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10623 if (detach_types.Count() < 1)
10624 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10625 }
10626
10627 for (int i = 0; i < inventory_slots.Count(); i++)
10628 {
10629 slot = inventory_slots.Get(i);
10630 }
10631
10632 if (slot != "")
10633 {
10634 if (detach_types.Count() == 1)
10635 idx = 0;
10636 else
10637 idx = inventory_slots.Find(slot);
10638 }
10639 if (idx < 0)
10640 return "";
10641
10642 return detach_types.Get(idx);
10643 }
10644
10646 {
10647
10649
10650
10651 float min_time = 1;
10652 float max_time = 3;
10653 float delay = Math.RandomFloat(min_time, max_time);
10654
10655 explode_timer.Run(delay, this, "DoAmmoExplosion");
10656 }
10657
10659 {
10660 Magazine magazine = Magazine.Cast(this);
10661 int pop_sounds_count = 6;
10662 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10663
10664
10665 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10666 string sound_name = pop_sounds[ sound_idx ];
10668
10669
10670 magazine.ServerAddAmmoCount(-1);
10671
10672
10673 float min_temp_to_explode = 100;
10674
10675 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10676 {
10678 }
10679 }
10680
10681
10682 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10683 {
10684 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10685
10686 const int CHANCE_DAMAGE_CARGO = 4;
10687 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10688 const int CHANCE_DAMAGE_NOTHING = 2;
10689
10691 {
10692 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10693 int chances;
10694 int rnd;
10695
10696 if (GetInventory().GetCargo())
10697 {
10698 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10699 rnd = Math.RandomInt(0,chances);
10700
10701 if (rnd < CHANCE_DAMAGE_CARGO)
10702 {
10704 }
10705 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10706 {
10708 }
10709 }
10710 else
10711 {
10712 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10713 rnd = Math.RandomInt(0,chances);
10714
10715 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10716 {
10718 }
10719 }
10720 }
10721 }
10722
10724 {
10725 if (GetInventory().GetCargo())
10726 {
10727 int item_count = GetInventory().GetCargo().GetItemCount();
10728 if (item_count > 0)
10729 {
10730 int random_pick = Math.RandomInt(0, item_count);
10732 if (!item.IsExplosive())
10733 {
10734 item.AddHealth("","",damage);
10735 return true;
10736 }
10737 }
10738 }
10739 return false;
10740 }
10741
10743 {
10744 int attachment_count = GetInventory().AttachmentCount();
10745 if (attachment_count > 0)
10746 {
10747 int random_pick = Math.RandomInt(0, attachment_count);
10748 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10749 if (!attachment.IsExplosive())
10750 {
10751 attachment.AddHealth("","",damage);
10752 return true;
10753 }
10754 }
10755 return false;
10756 }
10757
10759 {
10761 }
10762
10764 {
10766 return GetInventory().CanRemoveEntity();
10767
10768 return false;
10769 }
10770
10772 {
10773
10775 return false;
10776
10777
10779 return false;
10780
10781
10782
10784 if (delta == 0)
10785 return false;
10786
10787
10788 return true;
10789 }
10790
10792 {
10794 {
10795 if (ScriptInputUserData.CanStoreInputUserData())
10796 {
10797 ScriptInputUserData ctx = new ScriptInputUserData;
10802 ctx.
Write(destination_entity);
10804 ctx.
Write(slot_id);
10806 }
10807 }
10808 else if (!
GetGame().IsMultiplayer())
10809 {
10811 }
10812 }
10813
10815 {
10816 float split_quantity_new;
10820 InventoryLocation loc = new InventoryLocation;
10821
10822 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10823 {
10825 split_quantity_new = stack_max;
10826 else
10828
10830 {
10831 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10832 if (new_item)
10833 {
10834 new_item.SetResultOfSplit(true);
10835 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10837 new_item.
SetQuantity(split_quantity_new,
false,
true);
10838 }
10839 }
10840 }
10841 else if (destination_entity && slot_id == -1)
10842 {
10843 if (quantity > stack_max)
10844 split_quantity_new = stack_max;
10845 else
10846 split_quantity_new = quantity;
10847
10849 {
10851 {
10854 }
10855
10856 if (new_item)
10857 {
10858 new_item.SetResultOfSplit(true);
10859 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10861 new_item.
SetQuantity(split_quantity_new,
false,
true);
10862 }
10863 }
10864 }
10865 else
10866 {
10867 if (stack_max != 0)
10868 {
10870 {
10872 }
10873
10874 if (split_quantity_new == 0)
10875 {
10876 if (!
GetGame().IsMultiplayer())
10877 player.PhysicalPredictiveDropItem(this);
10878 else
10879 player.ServerDropEntity(this);
10880 return;
10881 }
10882
10884 {
10886
10887 if (new_item)
10888 {
10889 new_item.SetResultOfSplit(true);
10890 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10893 new_item.PlaceOnSurface();
10894 }
10895 }
10896 }
10897 }
10898 }
10899
10901 {
10902 float split_quantity_new;
10906 InventoryLocation loc = new InventoryLocation;
10907
10908 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10909 {
10911 split_quantity_new = stack_max;
10912 else
10914
10916 {
10917 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10918 if (new_item)
10919 {
10920 new_item.SetResultOfSplit(true);
10921 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10923 new_item.
SetQuantity(split_quantity_new,
false,
true);
10924 }
10925 }
10926 }
10927 else if (destination_entity && slot_id == -1)
10928 {
10929 if (quantity > stack_max)
10930 split_quantity_new = stack_max;
10931 else
10932 split_quantity_new = quantity;
10933
10935 {
10937 {
10940 }
10941
10942 if (new_item)
10943 {
10944 new_item.SetResultOfSplit(true);
10945 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10947 new_item.
SetQuantity(split_quantity_new,
false,
true);
10948 }
10949 }
10950 }
10951 else
10952 {
10953 if (stack_max != 0)
10954 {
10956 {
10958 }
10959
10961 {
10963
10964 if (new_item)
10965 {
10966 new_item.SetResultOfSplit(true);
10967 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10970 new_item.PlaceOnSurface();
10971 }
10972 }
10973 }
10974 }
10975 }
10976
10978 {
10980 {
10981 if (ScriptInputUserData.CanStoreInputUserData())
10982 {
10983 ScriptInputUserData ctx = new ScriptInputUserData;
10988 dst.WriteToContext(ctx);
10990 }
10991 }
10992 else if (!
GetGame().IsMultiplayer())
10993 {
10995 }
10996 }
10997
10999 {
11001 {
11002 if (ScriptInputUserData.CanStoreInputUserData())
11003 {
11004 ScriptInputUserData ctx = new ScriptInputUserData;
11009 ctx.
Write(destination_entity);
11015 }
11016 }
11017 else if (!
GetGame().IsMultiplayer())
11018 {
11020 }
11021 }
11022
11024 {
11026 }
11027
11029 {
11031 float split_quantity_new;
11033 if (dst.IsValid())
11034 {
11035 int slot_id = dst.GetSlot();
11037
11038 if (quantity > stack_max)
11039 split_quantity_new = stack_max;
11040 else
11041 split_quantity_new = quantity;
11042
11044 {
11046
11047 if (new_item)
11048 {
11049 new_item.SetResultOfSplit(true);
11050 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11052 new_item.
SetQuantity(split_quantity_new,
false,
true);
11053 }
11054
11055 return new_item;
11056 }
11057 }
11058
11059 return null;
11060 }
11061
11063 {
11065 float split_quantity_new;
11067 if (destination_entity)
11068 {
11070 if (quantity > stackable)
11071 split_quantity_new = stackable;
11072 else
11073 split_quantity_new = quantity;
11074
11076 {
11077 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11078 if (new_item)
11079 {
11080 new_item.SetResultOfSplit(true);
11081 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11083 new_item.
SetQuantity(split_quantity_new,
false,
true);
11084 }
11085 }
11086 }
11087 }
11088
11090 {
11092 {
11093 if (ScriptInputUserData.CanStoreInputUserData())
11094 {
11095 ScriptInputUserData ctx = new ScriptInputUserData;
11100 ItemBase destination_entity =
this;
11101 ctx.
Write(destination_entity);
11105 }
11106 }
11107 else if (!
GetGame().IsMultiplayer())
11108 {
11110 }
11111 }
11112
11114 {
11116 float split_quantity_new;
11118 if (player)
11119 {
11121 if (quantity > stackable)
11122 split_quantity_new = stackable;
11123 else
11124 split_quantity_new = quantity;
11125
11127 {
11128 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11129 new_item =
ItemBase.Cast(in_hands);
11130 if (new_item)
11131 {
11132 new_item.SetResultOfSplit(true);
11133 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11135 new_item.SetQuantity(split_quantity_new, false, true);
11136 }
11137 }
11138 }
11139 }
11140
11142 {
11144 float split_quantity_new = Math.Floor(quantity * 0.5);
11145
11147 return;
11148
11150
11151 if (new_item)
11152 {
11153 if (new_item.GetQuantityMax() < split_quantity_new)
11154 {
11155 split_quantity_new = new_item.GetQuantityMax();
11156 }
11157
11158 new_item.SetResultOfSplit(true);
11159 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11160
11162 {
11165 }
11166 else
11167 {
11169 new_item.
SetQuantity(split_quantity_new,
false,
true);
11170 }
11171 }
11172 }
11173
11175 {
11177 float split_quantity_new = Math.Floor(quantity / 2);
11178
11180 return;
11181
11182 InventoryLocation invloc = new InventoryLocation;
11184
11186 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11187
11188 if (new_item)
11189 {
11190 if (new_item.GetQuantityMax() < split_quantity_new)
11191 {
11192 split_quantity_new = new_item.GetQuantityMax();
11193 }
11195 {
11198 }
11199 else if (split_quantity_new > 1)
11200 {
11202 new_item.
SetQuantity(split_quantity_new,
false,
true);
11203 }
11204 }
11205 }
11206
11209 {
11210 SetWeightDirty();
11212
11213 if (parent)
11214 parent.OnAttachmentQuantityChangedEx(this, delta);
11215
11217 {
11219 {
11221 }
11223 {
11224 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11226 }
11227 }
11228
11229 }
11230
11233 {
11234
11235 }
11236
11239 {
11241 }
11242
11244 {
11245 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11246
11248 {
11249 if (newLevel == GameConstants.STATE_RUINED)
11250 {
11252 EntityAI parent = GetHierarchyParent();
11253 if (parent && parent.IsFireplace())
11254 {
11255 CargoBase cargo = GetInventory().GetCargo();
11256 if (cargo)
11257 {
11259 {
11261 }
11262 }
11263 }
11264 }
11265
11267 {
11268
11270 return;
11271 }
11272
11273 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11274 {
11276 }
11277 }
11278 }
11279
11280
11282 {
11283 super.OnRightClick();
11284
11286 {
11288 {
11289 if (ScriptInputUserData.CanStoreInputUserData())
11290 {
11291 EntityAI root = GetHierarchyRoot();
11292 Man playerOwner = GetHierarchyRootPlayer();
11293 InventoryLocation dst = new InventoryLocation;
11294
11295
11296 if (!playerOwner && root && root == this)
11297 {
11299 }
11300 else
11301 {
11302
11303 GetInventory().GetCurrentInventoryLocation(dst);
11305 {
11308 {
11310 }
11311 else
11312 {
11314
11315
11316 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11317 {
11319 }
11320 else
11321 {
11322 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11323 }
11324 }
11325 }
11326 }
11327
11328 ScriptInputUserData ctx = new ScriptInputUserData;
11336 }
11337 }
11338 else if (!
GetGame().IsMultiplayer())
11339 {
11341 }
11342 }
11343 }
11344
11346 {
11347 if (root)
11348 {
11349 vector m4[4];
11350 root.GetTransform(m4);
11351 dst.SetGround(this, m4);
11352 }
11353 else
11354 {
11355 GetInventory().GetCurrentInventoryLocation(dst);
11356 }
11357 }
11358
11359 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11360 {
11361
11362 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11363 return false;
11364
11365 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11366 return false;
11367
11368
11370 return false;
11371
11372
11373 Magazine mag = Magazine.Cast(this);
11374 if (mag)
11375 {
11376 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11377 return false;
11378
11379 if (stack_max_limit)
11380 {
11381 Magazine other_mag = Magazine.Cast(other_item);
11382 if (other_item)
11383 {
11384 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11385 return false;
11386 }
11387
11388 }
11389 }
11390 else
11391 {
11392
11394 return false;
11395
11397 return false;
11398 }
11399
11400 PlayerBase player = null;
11401 if (CastTo(player, GetHierarchyRootPlayer()))
11402 {
11403 if (player.GetInventory().HasAttachment(this))
11404 return false;
11405
11406 if (player.IsItemsToDelete())
11407 return false;
11408 }
11409
11410 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11411 return false;
11412
11413 int slotID;
11415 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11416 return false;
11417
11418 return true;
11419 }
11420
11422 {
11424 }
11425
11427 {
11428 return m_IsResultOfSplit;
11429 }
11430
11432 {
11433 m_IsResultOfSplit = value;
11434 }
11435
11437 {
11439 }
11440
11442 {
11443 float other_item_quantity = other_item.GetQuantity();
11444 float this_free_space;
11445
11447
11449
11450 if (other_item_quantity > this_free_space)
11451 {
11452 return this_free_space;
11453 }
11454 else
11455 {
11456 return other_item_quantity;
11457 }
11458 }
11459
11461 {
11463 }
11464
11466 {
11468 return;
11469
11470 if (!IsMagazine() && other_item)
11471 {
11473 if (quantity_used != 0)
11474 {
11475 float hp1 = GetHealth01("","");
11476 float hp2 = other_item.GetHealth01("","");
11477 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11478 hpResult = hpResult / (
GetQuantity() + quantity_used);
11479
11480 hpResult *= GetMaxHealth();
11481 Math.Round(hpResult);
11482 SetHealth("", "Health", hpResult);
11483
11485 other_item.AddQuantity(-quantity_used);
11486 }
11487 }
11489 }
11490
11492 {
11493 #ifdef SERVER
11494 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11495 GetHierarchyParent().IncreaseLifetimeUp();
11496 #endif
11497 };
11498
11500 {
11501 PlayerBase p = PlayerBase.Cast(player);
11502
11503 array<int> recipesIds = p.m_Recipes;
11504 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11505 if (moduleRecipesManager)
11506 {
11507 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11508 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11509 }
11510
11511 for (int i = 0;i < recipesIds.Count(); i++)
11512 {
11513 int key = recipesIds.Get(i);
11514 string recipeName = moduleRecipesManager.GetRecipeName(key);
11516 }
11517 }
11518
11519
11520 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11521 {
11522 super.GetDebugActions(outputList);
11523
11524
11530
11531
11536
11541
11542
11546
11547
11549 {
11553 }
11554
11557
11558
11562
11564
11565 InventoryLocation loc = new InventoryLocation();
11566 GetInventory().GetCurrentInventoryLocation(loc);
11568 {
11569 if (Gizmo_IsSupported())
11572 }
11573
11575 }
11576
11577
11578
11579
11581 {
11582 super.OnAction(action_id, player, ctx);
11583
11585 {
11586 switch (action_id)
11587 {
11590 return true;
11593 return true;
11594 }
11595 }
11596
11598 {
11599 switch (action_id)
11600 {
11602 Delete();
11603 return true;
11604 }
11605 }
11606
11607 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11608 {
11609 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11610 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11611 PlayerBase p = PlayerBase.Cast(player);
11612 if (
EActions.RECIPES_RANGE_START < 1000)
11613 {
11614 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11615 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11616 }
11617 }
11618 #ifndef SERVER
11619 else if (action_id ==
EActions.WATCH_PLAYER)
11620 {
11621 PluginDeveloper.SetDeveloperItemClientEx(player);
11622 }
11623 #endif
11625 {
11626 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11627 {
11628 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11629 OnDebugButtonPressServer(id + 1);
11630 }
11631
11632 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11633 {
11634 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11636 }
11637
11638 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11639 {
11640 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11642 }
11643
11644 else if (action_id ==
EActions.ADD_QUANTITY)
11645 {
11646 if (IsMagazine())
11647 {
11648 Magazine mag = Magazine.Cast(this);
11649 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11650 }
11651 else
11652 {
11654 }
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.REMOVE_QUANTITY)
11664 {
11665 if (IsMagazine())
11666 {
11667 Magazine mag2 = Magazine.Cast(this);
11668 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11669 }
11670 else
11671 {
11673 }
11674 if (m_EM)
11675 {
11676 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11677 }
11678
11679 }
11680
11681 else if (action_id ==
EActions.SET_QUANTITY_0)
11682 {
11684
11685 if (m_EM)
11686 {
11687 m_EM.SetEnergy(0);
11688 }
11689 }
11690
11691 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11692 {
11694
11695 if (m_EM)
11696 {
11697 m_EM.SetEnergy(m_EM.GetEnergyMax());
11698 }
11699 }
11700
11701 else if (action_id ==
EActions.ADD_HEALTH)
11702 {
11703 AddHealth("","",GetMaxHealth("","Health")/5);
11704 }
11705 else if (action_id ==
EActions.REMOVE_HEALTH)
11706 {
11707 AddHealth("","",-GetMaxHealth("","Health")/5);
11708 }
11709 else if (action_id ==
EActions.DESTROY_HEALTH)
11710 {
11711 SetHealth01("","",0);
11712 }
11713 else if (action_id ==
EActions.WATCH_ITEM)
11714 {
11716 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11717 #ifdef DEVELOPER
11718 SetDebugDeveloper_item(this);
11719 #endif
11720 }
11721
11722 else if (action_id ==
EActions.ADD_TEMPERATURE)
11723 {
11724 AddTemperature(20);
11725
11726 }
11727
11728 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11729 {
11730 AddTemperature(-20);
11731
11732 }
11733
11734 else if (action_id ==
EActions.FLIP_FROZEN)
11735 {
11736 SetFrozen(!GetIsFrozen());
11737
11738 }
11739
11740 else if (action_id ==
EActions.ADD_WETNESS)
11741 {
11743
11744 }
11745
11746 else if (action_id ==
EActions.REMOVE_WETNESS)
11747 {
11749
11750 }
11751
11752 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11753 {
11756
11757
11758 }
11759
11760 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11761 {
11764 }
11765
11766 else if (action_id ==
EActions.MAKE_SPECIAL)
11767 {
11768 auto debugParams = DebugSpawnParams.WithPlayer(player);
11769 OnDebugSpawnEx(debugParams);
11770 }
11771
11772 }
11773
11774
11775 return false;
11776 }
11777
11778
11779
11780
11784
11787
11788
11789
11791 {
11792 return false;
11793 }
11794
11795
11797 {
11798 return true;
11799 }
11800
11801
11803 {
11804 return true;
11805 }
11806
11807
11808
11810 {
11811 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11813 }
11814
11817 {
11818 return null;
11819 }
11820
11822 {
11823 return false;
11824 }
11825
11827 {
11828 return false;
11829 }
11830
11834
11835
11837 {
11838 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11839 return module_repairing.CanRepair(this, item_repair_kit);
11840 }
11841
11842
11843 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11844 {
11845 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11846 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11847 }
11848
11849
11851 {
11852
11853
11854
11855
11856
11857
11858
11859
11860 return 1;
11861 }
11862
11863
11864
11866 {
11868 }
11869
11870
11871
11873 {
11875 }
11876
11877
11886 {
11887 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11888
11889 if (player)
11890 {
11891 player.MessageStatus(text);
11892 }
11893 }
11894
11895
11904 {
11905 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11906
11907 if (player)
11908 {
11909 player.MessageAction(text);
11910 }
11911 }
11912
11913
11922 {
11923 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11924
11925 if (player)
11926 {
11927 player.MessageFriendly(text);
11928 }
11929 }
11930
11931
11940 {
11941 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11942
11943 if (player)
11944 {
11945 player.MessageImportant(text);
11946 }
11947 }
11948
11950 {
11951 return true;
11952 }
11953
11954
11955 override bool KindOf(
string tag)
11956 {
11957 bool found = false;
11958 string item_name = this.
GetType();
11961
11962 int array_size = item_tag_array.Count();
11963 for (int i = 0; i < array_size; i++)
11964 {
11965 if (item_tag_array.Get(i) == tag)
11966 {
11967 found = true;
11968 break;
11969 }
11970 }
11971 return found;
11972 }
11973
11974
11976 {
11977
11978 super.OnRPC(sender, rpc_type,ctx);
11979
11980
11981 switch (rpc_type)
11982 {
11983 #ifndef SERVER
11984 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11985 Param2<bool, string> p = new Param2<bool, string>(false, "");
11986
11988 return;
11989
11990 bool play = p.param1;
11991 string soundSet = p.param2;
11992
11993 if (play)
11994 {
11996 {
11998 {
12000 }
12001 }
12002 else
12003 {
12005 }
12006 }
12007 else
12008 {
12010 }
12011
12012 break;
12013 #endif
12014
12015 }
12016
12018 {
12020 }
12021 }
12022
12023
12024
12025
12027 {
12028 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12029 return plugin.GetID(
name);
12030 }
12031
12033 {
12034 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12035 return plugin.GetName(id);
12036 }
12037
12040 {
12041
12042
12043 int varFlags;
12044 if (!ctx.
Read(varFlags))
12045 return;
12046
12047 if (varFlags & ItemVariableFlags.FLOAT)
12048 {
12050 }
12051 }
12052
12054 {
12055
12056 super.SerializeNumericalVars(floats_out);
12057
12058
12059
12061 {
12063 }
12064
12066 {
12068 }
12069
12071 {
12073 }
12074
12076 {
12081 }
12082
12084 {
12086 }
12087 }
12088
12090 {
12091
12092 super.DeSerializeNumericalVars(floats);
12093
12094
12095 int index = 0;
12096 int mask = Math.Round(floats.Get(index));
12097
12098 index++;
12099
12101 {
12103 {
12105 }
12106 else
12107 {
12108 float quantity = floats.Get(index);
12109 SetQuantity(quantity,
true,
false,
false,
false);
12110 }
12111 index++;
12112 }
12113
12115 {
12116 float wet = floats.Get(index);
12118 index++;
12119 }
12120
12122 {
12123 int liquidtype = Math.Round(floats.Get(index));
12125 index++;
12126 }
12127
12129 {
12131 index++;
12133 index++;
12135 index++;
12137 index++;
12138 }
12139
12141 {
12142 int cleanness = Math.Round(floats.Get(index));
12144 index++;
12145 }
12146 }
12147
12149 {
12150 super.WriteVarsToCTX(ctx);
12151
12152
12154 {
12156 }
12157
12159 {
12161 }
12162
12164 {
12166 }
12167
12169 {
12170 int r,g,b,a;
12176 }
12177
12179 {
12181 }
12182 }
12183
12185 {
12186 if (!super.ReadVarsFromCTX(ctx,version))
12187 return false;
12188
12189 int intValue;
12190 float value;
12191
12192 if (version < 140)
12193 {
12194 if (!ctx.
Read(intValue))
12195 return false;
12196
12197 m_VariablesMask = intValue;
12198 }
12199
12201 {
12202 if (!ctx.
Read(value))
12203 return false;
12204
12206 {
12208 }
12209 else
12210 {
12212 }
12213 }
12214
12215 if (version < 140)
12216 {
12218 {
12219 if (!ctx.
Read(value))
12220 return false;
12221 SetTemperatureDirect(value);
12222 }
12223 }
12224
12226 {
12227 if (!ctx.
Read(value))
12228 return false;
12230 }
12231
12233 {
12234 if (!ctx.
Read(intValue))
12235 return false;
12237 }
12238
12240 {
12241 int r,g,b,a;
12243 return false;
12245 return false;
12247 return false;
12249 return false;
12250
12252 }
12253
12255 {
12256 if (!ctx.
Read(intValue))
12257 return false;
12259 }
12260
12261 if (version >= 138 && version < 140)
12262 {
12264 {
12265 if (!ctx.
Read(intValue))
12266 return false;
12267 SetFrozen(intValue);
12268 }
12269 }
12270
12271 return true;
12272 }
12273
12274
12276 {
12279 {
12281 }
12282
12283 if (!super.OnStoreLoad(ctx, version))
12284 {
12286 return false;
12287 }
12288
12289 if (version >= 114)
12290 {
12291 bool hasQuickBarIndexSaved;
12292
12293 if (!ctx.
Read(hasQuickBarIndexSaved))
12294 {
12296 return false;
12297 }
12298
12299 if (hasQuickBarIndexSaved)
12300 {
12301 int itmQBIndex;
12302
12303
12304 if (!ctx.
Read(itmQBIndex))
12305 {
12307 return false;
12308 }
12309
12310 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12311 if (itmQBIndex != -1 && parentPlayer)
12312 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12313 }
12314 }
12315 else
12316 {
12317
12318 PlayerBase player;
12319 int itemQBIndex;
12320 if (version ==
int.
MAX)
12321 {
12322 if (!ctx.
Read(itemQBIndex))
12323 {
12325 return false;
12326 }
12327 }
12328 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12329 {
12330
12331 if (!ctx.
Read(itemQBIndex))
12332 {
12334 return false;
12335 }
12336 if (itemQBIndex != -1 && player)
12337 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12338 }
12339 }
12340
12341 if (version < 140)
12342 {
12343
12344 if (!LoadVariables(ctx, version))
12345 {
12347 return false;
12348 }
12349 }
12350
12351
12353 {
12355 return false;
12356 }
12357 if (version >= 132)
12358 {
12360 if (raib)
12361 {
12363 {
12365 return false;
12366 }
12367 }
12368 }
12369
12371 return true;
12372 }
12373
12374
12375
12377 {
12378 super.OnStoreSave(ctx);
12379
12380 PlayerBase player;
12381 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12382 {
12384
12385 int itemQBIndex = -1;
12386 itemQBIndex = player.FindQuickBarEntityIndex(this);
12387 ctx.
Write(itemQBIndex);
12388 }
12389 else
12390 {
12392 }
12393
12395
12397 if (raib)
12398 {
12400 }
12401 }
12402
12403
12405 {
12406 super.AfterStoreLoad();
12407
12409 {
12411 }
12412
12414 {
12417 }
12418 }
12419
12421 {
12422 super.EEOnAfterLoad();
12423
12425 {
12427 }
12428
12431 }
12432
12434 {
12435 return false;
12436 }
12437
12438
12439
12441 {
12443 {
12444 #ifdef PLATFORM_CONSOLE
12445
12447 {
12449 if (menu)
12450 {
12452 }
12453 }
12454 #endif
12455 }
12456
12458 {
12461 }
12462
12464 {
12465 SetWeightDirty();
12467 }
12469 {
12472 }
12473
12475 {
12478 }
12480 {
12483 }
12484
12485 super.OnVariablesSynchronized();
12486 }
12487
12488
12489
12491 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12492 {
12493 if (!IsServerCheck(allow_client))
12494 return false;
12495
12497 return false;
12498
12501
12502 if (value <= (min + 0.001))
12503 value = min;
12504
12505 if (value == min)
12506 {
12507 if (destroy_config)
12508 {
12509 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12510 if (dstr)
12511 {
12513 this.Delete();
12514 return true;
12515 }
12516 }
12517 else if (destroy_forced)
12518 {
12520 this.Delete();
12521 return true;
12522 }
12523
12525 }
12526
12529
12531 {
12533
12534 if (delta)
12536 }
12537
12539
12540 return false;
12541 }
12542
12543
12545 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12546 {
12548 }
12549
12551 {
12554 }
12555
12557 {
12560 }
12561
12563 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12564 {
12565 float value_clamped = Math.Clamp(value, 0, 1);
12567 SetQuantity(result, destroy_config, destroy_forced);
12568 }
12569
12570
12573 {
12575 }
12576
12578 {
12580 }
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12592 {
12593 int slot = -1;
12594 if (GetInventory())
12595 {
12596 InventoryLocation il = new InventoryLocation;
12597 GetInventory().GetCurrentInventoryLocation(il);
12599 }
12600
12602 }
12603
12605 {
12606 float quantity_max = 0;
12607
12609 {
12610 if (attSlotID != -1)
12611 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12612
12613 if (quantity_max <= 0)
12615 }
12616
12617 if (quantity_max <= 0)
12619
12620 return quantity_max;
12621 }
12622
12624 {
12626 }
12627
12629 {
12631 }
12632
12633
12635 {
12637 }
12638
12640 {
12642 }
12643
12645 {
12647 }
12648
12649
12651 {
12652
12653 float weightEx = GetWeightEx();
12654 float special = GetInventoryAndCargoWeight();
12655 return weightEx - special;
12656 }
12657
12658
12660 {
12662 }
12663
12665 {
12667 {
12668 #ifdef DEVELOPER
12669 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12670 {
12671 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12673 }
12674 #endif
12675
12676 return GetQuantity() * GetConfigWeightModified();
12677 }
12678 else if (HasEnergyManager())
12679 {
12680 #ifdef DEVELOPER
12681 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12682 {
12683 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12684 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12685 }
12686 #endif
12687 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12688 }
12689 else
12690 {
12691 #ifdef DEVELOPER
12692 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12693 {
12694 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12695 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12696 }
12697 #endif
12698 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12699 }
12700 }
12701
12704 {
12705 int item_count = 0;
12707
12708 if (GetInventory().GetCargo() != NULL)
12709 {
12710 item_count = GetInventory().GetCargo().GetItemCount();
12711 }
12712
12713 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12714 {
12715 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12716 if (item)
12717 item_count += item.GetNumberOfItems();
12718 }
12719 return item_count;
12720 }
12721
12724 {
12725 float weight = 0;
12726 float wetness = 1;
12727 if (include_wetness)
12730 {
12731 weight = wetness * m_ConfigWeight;
12732 }
12734 {
12735 weight = 1;
12736 }
12737 return weight;
12738 }
12739
12740
12741
12743 {
12744 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12745 {
12746 GameInventory inv = GetInventory();
12747 array<EntityAI> items = new array<EntityAI>;
12749 for (int i = 0; i < items.Count(); i++)
12750 {
12752 if (item)
12753 {
12755 }
12756 }
12757 }
12758 }
12759
12760
12761
12762
12764 {
12765 float energy = 0;
12766 if (HasEnergyManager())
12767 {
12768 energy = GetCompEM().GetEnergy();
12769 }
12770 return energy;
12771 }
12772
12773
12775 {
12776 super.OnEnergyConsumed();
12777
12779 }
12780
12782 {
12783 super.OnEnergyAdded();
12784
12786 }
12787
12788
12790 {
12791 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12792 {
12794 {
12795 float energy_0to1 = GetCompEM().GetEnergy0To1();
12797 }
12798 }
12799 }
12800
12801
12803 {
12804 return ConfigGetFloat("heatIsolation");
12805 }
12806
12808 {
12810 }
12811
12813 {
12814 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12815 if (
GetGame().ConfigIsExisting(paramPath))
12817
12818 return 0.0;
12819 }
12820
12822 {
12823 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12824 if (
GetGame().ConfigIsExisting(paramPath))
12826
12827 return 0.0;
12828 }
12829
12830 override void SetWet(
float value,
bool allow_client =
false)
12831 {
12832 if (!IsServerCheck(allow_client))
12833 return;
12834
12837
12839
12840 m_VarWet = Math.Clamp(value, min, max);
12841
12843 {
12846 }
12847 }
12848
12849 override void AddWet(
float value)
12850 {
12852 }
12853
12855 {
12857 }
12858
12860 {
12862 }
12863
12865 {
12867 }
12868
12870 {
12872 }
12873
12875 {
12877 }
12878
12879 override void OnWetChanged(
float newVal,
float oldVal)
12880 {
12883 if (newLevel != oldLevel)
12884 {
12886 }
12887 }
12888
12890 {
12891 SetWeightDirty();
12892 }
12893
12895 {
12896 return GetWetLevelInternal(
m_VarWet);
12897 }
12898
12899
12900
12902 {
12904 }
12905
12907 {
12909 }
12910
12912 {
12914 }
12915
12917 {
12919 }
12920
12921
12922
12924 {
12925 if (ConfigIsExisting("itemModelLength"))
12926 {
12927 return ConfigGetFloat("itemModelLength");
12928 }
12929 return 0;
12930 }
12931
12933 {
12934 if (ConfigIsExisting("itemAttachOffset"))
12935 {
12936 return ConfigGetFloat("itemAttachOffset");
12937 }
12938 return 0;
12939 }
12940
12941 override void SetCleanness(
int value,
bool allow_client =
false)
12942 {
12943 if (!IsServerCheck(allow_client))
12944 return;
12945
12947
12949
12952 }
12953
12955 {
12957 }
12958
12960 {
12961 return true;
12962 }
12963
12964
12965
12966
12968 {
12970 }
12971
12973 {
12975 }
12976
12977
12978
12979
12980 override void SetColor(
int r,
int g,
int b,
int a)
12981 {
12987 }
12989 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12990 {
12995 }
12996
12998 {
13000 }
13001
13004 {
13005 int r,g,b,a;
13007 r = r/255;
13008 g = g/255;
13009 b = b/255;
13010 a = a/255;
13011 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13012 }
13013
13014
13015
13016 override void SetLiquidType(
int value,
bool allow_client =
false)
13017 {
13018 if (!IsServerCheck(allow_client))
13019 return;
13020
13025 }
13026
13028 {
13029 return ConfigGetInt("varLiquidTypeInit");
13030 }
13031
13033 {
13035 }
13036
13038 {
13040 SetFrozen(false);
13041 }
13042
13045 {
13046 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13047 }
13048
13049
13052 {
13053 PlayerBase nplayer;
13054 if (PlayerBase.CastTo(nplayer, player))
13055 {
13057
13058 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13059 }
13060 }
13061
13062
13065 {
13066 PlayerBase nplayer;
13067 if (PlayerBase.CastTo(nplayer,player))
13068 {
13069
13070 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13071
13072 }
13073
13074
13075 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13076
13077
13078 if (HasEnergyManager())
13079 {
13080 GetCompEM().UpdatePlugState();
13081 }
13082 }
13083
13084
13086 {
13087 super.OnPlacementStarted(player);
13088
13090 }
13091
13092 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13093 {
13095 {
13096 m_AdminLog.OnPlacementComplete(player,
this);
13097 }
13098
13099 super.OnPlacementComplete(player, position, orientation);
13100 }
13101
13102
13103
13104
13105
13107 {
13109 {
13110 return true;
13111 }
13112 else
13113 {
13114 return false;
13115 }
13116 }
13117
13118
13120 {
13122 {
13124 }
13125 }
13126
13127
13129 {
13131 }
13132
13134 {
13136 }
13137
13138 override void InsertAgent(
int agent,
float count = 1)
13139 {
13140 if (count < 1)
13141 return;
13142
13144 }
13145
13148 {
13150 }
13151
13152
13154 {
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
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13200 {
13202 return false;
13203 return true;
13204 }
13205
13207 {
13208
13210 }
13211
13212
13215 {
13216 super.CheckForRoofLimited(timeTresholdMS);
13217
13219 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13220 {
13221 m_PreviousRoofTestTime = time;
13222 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13223 }
13224 }
13225
13226
13228 {
13230 {
13231 return 0;
13232 }
13233
13234 if (GetInventory().GetAttachmentSlotsCount() != 0)
13235 {
13236 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13237 if (filter)
13238 return filter.GetProtectionLevel(type, false, system);
13239 else
13240 return 0;
13241 }
13242
13243 string subclassPath, entryName;
13244
13245 switch (type)
13246 {
13248 entryName = "biological";
13249 break;
13251 entryName = "chemical";
13252 break;
13253 default:
13254 entryName = "biological";
13255 break;
13256 }
13257
13258 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13259
13261 }
13262
13263
13264
13267 {
13268 if (!IsMagazine())
13270
13272 }
13273
13274
13275
13276
13277
13282 {
13283 return true;
13284 }
13285
13287 {
13289 }
13290
13291
13292
13293
13294
13296 {
13297 if (parent)
13298 {
13299 if (parent.IsInherited(DayZInfected))
13300 return true;
13301
13302 if (!parent.IsRuined())
13303 return true;
13304 }
13305
13306 return true;
13307 }
13308
13310 {
13311 if (!super.CanPutAsAttachment(parent))
13312 {
13313 return false;
13314 }
13315
13316 if (!IsRuined() && !parent.IsRuined())
13317 {
13318 return true;
13319 }
13320
13321 return false;
13322 }
13323
13325 {
13326
13327
13328
13329
13330 return super.CanReceiveItemIntoCargo(item);
13331 }
13332
13334 {
13335
13336
13337
13338
13339 GameInventory attachmentInv = attachment.GetInventory();
13341 {
13342 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13343 return false;
13344 }
13345
13346 InventoryLocation loc = new InventoryLocation();
13347 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13348 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13349 return false;
13350
13351 return super.CanReceiveAttachment(attachment, slotId);
13352 }
13353
13355 {
13356 if (!super.CanReleaseAttachment(attachment))
13357 return false;
13358
13359 return GetInventory().AreChildrenAccessible();
13360 }
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13383 {
13384 int id = muzzle_owner.GetMuzzleID();
13385 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13386
13387 if (WPOF_array)
13388 {
13389 for (int i = 0; i < WPOF_array.Count(); i++)
13390 {
13391 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13392
13393 if (WPOF)
13394 {
13395 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13396 }
13397 }
13398 }
13399 }
13400
13401
13403 {
13404 int id = muzzle_owner.GetMuzzleID();
13406
13407 if (WPOBE_array)
13408 {
13409 for (int i = 0; i < WPOBE_array.Count(); i++)
13410 {
13411 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13412
13413 if (WPOBE)
13414 {
13415 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13416 }
13417 }
13418 }
13419 }
13420
13421
13423 {
13424 int id = muzzle_owner.GetMuzzleID();
13425 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13426
13427 if (WPOOH_array)
13428 {
13429 for (int i = 0; i < WPOOH_array.Count(); i++)
13430 {
13431 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13432
13433 if (WPOOH)
13434 {
13435 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13436 }
13437 }
13438 }
13439 }
13440
13441
13443 {
13444 int id = muzzle_owner.GetMuzzleID();
13445 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13446
13447 if (WPOOH_array)
13448 {
13449 for (int i = 0; i < WPOOH_array.Count(); i++)
13450 {
13451 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13452
13453 if (WPOOH)
13454 {
13455 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13456 }
13457 }
13458 }
13459 }
13460
13461
13463 {
13464 int id = muzzle_owner.GetMuzzleID();
13465 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13466
13467 if (WPOOH_array)
13468 {
13469 for (int i = 0; i < WPOOH_array.Count(); i++)
13470 {
13471 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13472
13473 if (WPOOH)
13474 {
13475 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13476 }
13477 }
13478 }
13479 }
13480
13481
13482
13484 {
13486 {
13487 return true;
13488 }
13489
13490 return false;
13491 }
13492
13494 {
13496 {
13497 return true;
13498 }
13499
13500 return false;
13501 }
13502
13504 {
13506 {
13507 return true;
13508 }
13509
13510 return false;
13511 }
13512
13514 {
13515 return false;
13516 }
13517
13520 {
13521 return UATimeSpent.DEFAULT_DEPLOY;
13522 }
13523
13524
13525
13526
13528 {
13530 SetSynchDirty();
13531 }
13532
13534 {
13536 }
13537
13538
13540 {
13541 return false;
13542 }
13543
13546 {
13547 string att_type = "None";
13548
13549 if (ConfigIsExisting("soundAttType"))
13550 {
13551 att_type = ConfigGetString("soundAttType");
13552 }
13553
13555 }
13556
13558 {
13560 }
13561
13562
13563
13564
13565
13571
13573 {
13576
13578 }
13579
13580
13582 {
13584 return;
13585
13587
13590
13593
13594 SoundParameters params = new SoundParameters();
13598 }
13599
13600
13602 {
13604 return;
13605
13607 SetSynchDirty();
13608
13611 }
13612
13613
13615 {
13617 return;
13618
13620 SetSynchDirty();
13621
13624 }
13625
13627 {
13629 }
13630
13632 {
13634 }
13635
13638 {
13639 if (!
GetGame().IsDedicatedServer())
13640 {
13641 if (ConfigIsExisting("attachSoundSet"))
13642 {
13643 string cfg_path = "";
13644 string soundset = "";
13645 string type_name =
GetType();
13646
13649 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13650 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13651
13652 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13653 {
13654 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13655 {
13656 if (cfg_slot_array[i] == slot_type)
13657 {
13658 soundset = cfg_soundset_array[i];
13659 break;
13660 }
13661 }
13662 }
13663
13664 if (soundset != "")
13665 {
13666 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13668 }
13669 }
13670 }
13671 }
13672
13674 {
13675
13676 }
13677
13678 void OnApply(PlayerBase player);
13679
13681 {
13682 return 1.0;
13683 };
13684
13686 {
13688 }
13689
13691 {
13693 }
13694
13696
13698 {
13699 SetDynamicPhysicsLifeTime(0.01);
13701 }
13702
13704 {
13705 array<string> zone_names = new array<string>;
13706 GetDamageZones(zone_names);
13707 for (int i = 0; i < zone_names.Count(); i++)
13708 {
13709 SetHealthMax(zone_names.Get(i),"Health");
13710 }
13711 SetHealthMax("","Health");
13712 }
13713
13716 {
13717 float global_health = GetHealth01("","Health");
13718 array<string> zones = new array<string>;
13719 GetDamageZones(zones);
13720
13721 for (int i = 0; i < zones.Count(); i++)
13722 {
13723 SetHealth01(zones.Get(i),"Health",global_health);
13724 }
13725 }
13726
13729 {
13730 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13731 }
13732
13734 {
13735 if (!hasRootAsPlayer)
13736 {
13737 if (refParentIB)
13738 {
13739
13740 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13741 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13742
13743 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13744 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13745
13748 }
13749 else
13750 {
13751
13754 }
13755 }
13756 }
13757
13759 {
13761 {
13762 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13763 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13764 {
13765 float heatPermCoef = 1.0;
13767 while (ent)
13768 {
13769 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13770 ent = ent.GetHierarchyParent();
13771 }
13772
13773 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13774 }
13775 }
13776 }
13777
13779 {
13780
13781 EntityAI parent = GetHierarchyParent();
13782 if (!parent)
13783 {
13784 hasParent = false;
13785 hasRootAsPlayer = false;
13786 }
13787 else
13788 {
13789 hasParent = true;
13790 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13791 refParentIB =
ItemBase.Cast(parent);
13792 }
13793 }
13794
13795 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13796 {
13797
13798 }
13799
13801 {
13802
13803 return false;
13804 }
13805
13807 {
13808
13809
13810 return false;
13811 }
13812
13814 {
13815
13816 return false;
13817 }
13818
13821 {
13822 return !GetIsFrozen() &&
IsOpen();
13823 }
13824
13826 {
13827 bool hasParent = false, hasRootAsPlayer = false;
13829
13830 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13831 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13832
13833 if (wwtu || foodDecay)
13834 {
13838
13839 if (processWetness || processTemperature || processDecay)
13840 {
13842
13843 if (processWetness)
13844 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13845
13846 if (processTemperature)
13848
13849 if (processDecay)
13850 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13851 }
13852 }
13853 }
13854
13857 {
13859 }
13860
13862 {
13865
13866 return super.GetTemperatureFreezeThreshold();
13867 }
13868
13870 {
13873
13874 return super.GetTemperatureThawThreshold();
13875 }
13876
13878 {
13881
13882 return super.GetItemOverheatThreshold();
13883 }
13884
13886 {
13888 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13889
13890 return super.GetTemperatureFreezeTime();
13891 }
13892
13894 {
13896 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13897
13898 return super.GetTemperatureThawTime();
13899 }
13900
13905
13907 {
13908 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13909 }
13910
13912 {
13913 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13914 }
13915
13918 {
13920 }
13921
13923 {
13925 }
13926
13928 {
13930 }
13931
13934 {
13935 return null;
13936 }
13937
13940 {
13941 return false;
13942 }
13943
13945 {
13947 {
13950 if (!trg)
13951 {
13953 explosive = this;
13954 }
13955
13956 explosive.PairRemote(trg);
13958
13959 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13960 trg.SetPersistentPairID(persistentID);
13961 explosive.SetPersistentPairID(persistentID);
13962
13963 return true;
13964 }
13965 return false;
13966 }
13967
13970 {
13971 float ret = 1.0;
13974 ret *= GetHealth01();
13975
13976 return ret;
13977 }
13978
13979 #ifdef DEVELOPER
13980 override void SetDebugItem()
13981 {
13982 super.SetDebugItem();
13983 _itemBase = this;
13984 }
13985
13987 {
13988 string text = super.GetDebugText();
13989
13991 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13992
13993 return text;
13994 }
13995 #endif
13996
13998 {
13999 return true;
14000 }
14001
14003
14005
14007 {
14010 }
14011
14012
14020
14036}
14037
14039{
14041 if (entity)
14042 {
14043 bool is_item = entity.IsInherited(
ItemBase);
14044 if (is_item && full_quantity)
14045 {
14048 }
14049 }
14050 else
14051 {
14053 return NULL;
14054 }
14055 return entity;
14056}
14057
14059{
14060 if (item)
14061 {
14062 if (health > 0)
14063 item.SetHealth("", "", health);
14064
14065 if (item.CanHaveTemperature())
14066 {
14068 if (item.CanFreeze())
14069 item.SetFrozen(false);
14070 }
14071
14072 if (item.HasEnergyManager())
14073 {
14074 if (quantity >= 0)
14075 {
14076 item.GetCompEM().SetEnergy0To1(quantity);
14077 }
14078 else
14079 {
14081 }
14082 }
14083 else if (item.IsMagazine())
14084 {
14085 Magazine mag = Magazine.Cast(item);
14086 if (quantity >= 0)
14087 {
14088 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14089 }
14090 else
14091 {
14093 }
14094
14095 }
14096 else
14097 {
14098 if (quantity >= 0)
14099 {
14100 item.SetQuantityNormalized(quantity, false);
14101 }
14102 else
14103 {
14105 }
14106
14107 }
14108 }
14109}
14110
14111#ifdef DEVELOPER
14113#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.