9194{
9196 {
9197 return true;
9198 }
9199};
9200
9201
9202
9204{
9208
9210
9213
9214
9215
9216
9217
9226
9232
9237
9242
9263 protected bool m_IsResultOfSplit
9264
9266
9271
9272
9273
9275
9279
9280
9281
9283
9286
9287
9288
9294
9295
9303
9306
9307
9309
9310
9312
9313
9318
9319
9324
9325
9327
9328
9330 {
9335
9336 if (!
GetGame().IsDedicatedServer())
9337 {
9339 {
9341
9343 {
9345 }
9346 }
9347
9350 }
9351
9352 m_OldLocation = null;
9353
9355 {
9357 }
9358
9359 if (ConfigIsExisting("headSelectionsToHide"))
9360 {
9363 }
9364
9366 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9367 {
9369 }
9370
9372
9373 m_IsResultOfSplit = false;
9374
9376 }
9377
9379 {
9380 super.InitItemVariables();
9381
9387 m_Count = ConfigGetInt(
"count");
9388
9391
9396
9399
9404
9416
9420
9421
9424 if (ConfigIsExisting("canBeSplit"))
9425 {
9428 }
9429
9431 if (ConfigIsExisting("itemBehaviour"))
9433
9434
9437 RegisterNetSyncVariableInt("m_VarLiquidType");
9438 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9439
9440 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9441 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9442 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9443
9444 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9445 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9446 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9447 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9448
9449 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9450 RegisterNetSyncVariableBool("m_IsTakeable");
9451 RegisterNetSyncVariableBool("m_IsHologram");
9452
9455 {
9458 }
9459
9461
9463 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9465
9466 }
9467
9469 {
9471 }
9472
9474 {
9477 {
9482 }
9483 }
9484
9485 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9486 {
9488 {
9491 }
9492
9494 }
9495
9497 {
9503 }
9504
9506
9508 {
9510
9511 if (!action)
9512 {
9513 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9514 return;
9515 }
9516
9518 if (!ai)
9519 {
9521 return;
9522 }
9523
9525 if (!action_array)
9526 {
9527 action_array = new array<ActionBase_Basic>;
9529 }
9530 if (LogManager.IsActionLogEnable())
9531 {
9532 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9533 }
9534
9535 if (action_array.Find(action) != -1)
9536 {
9537 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9538 }
9539 else
9540 {
9541 action_array.Insert(action);
9542 }
9543 }
9544
9546 {
9548 ActionBase action = player.GetActionManager().GetAction(actionName);
9551
9552 if (action_array)
9553 {
9554 action_array.RemoveItem(action);
9555 }
9556 }
9557
9558
9559
9561 {
9562 ActionOverrideData overrideData = new ActionOverrideData();
9566
9568 if (!actionMap)
9569 {
9572 }
9573
9574 actionMap.Insert(this.
Type(), overrideData);
9575
9576 }
9577
9579
9581
9582
9584 {
9587
9590
9591 string config_to_search = "CfgVehicles";
9592 string muzzle_owner_config;
9593
9595 {
9596 if (IsInherited(Weapon))
9597 config_to_search = "CfgWeapons";
9598
9599 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9600
9601 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9602
9604
9605 if (config_OnFire_subclass_count > 0)
9606 {
9607 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9608
9609 for (int i = 0; i < config_OnFire_subclass_count; i++)
9610 {
9611 string particle_class = "";
9613 string config_OnFire_entry = config_OnFire_class + particle_class;
9614 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9615 WPOF_array.Insert(WPOF);
9616 }
9617
9618
9620 }
9621 }
9622
9624 {
9625 config_to_search = "CfgWeapons";
9626 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9627
9628 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9629
9631
9632 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9633 {
9634 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9635
9636 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9637 {
9638 string particle_class2 = "";
9640 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9641 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9642 WPOBE_array.Insert(WPOBE);
9643 }
9644
9645
9647 }
9648 }
9649 }
9650
9651
9653 {
9656
9658 {
9659 string config_to_search = "CfgVehicles";
9660
9661 if (IsInherited(Weapon))
9662 config_to_search = "CfgWeapons";
9663
9664 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9665 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9666
9667 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9668 {
9669
9671
9673 {
9675 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9677 return;
9678 }
9679
9682
9683
9684
9686 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9687
9688 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9689 {
9690 string particle_class = "";
9692 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9694
9695 if (entry_type == CT_CLASS)
9696 {
9697 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9698 WPOOH_array.Insert(WPOF);
9699 }
9700 }
9701
9702
9704 }
9705 }
9706 }
9707
9709 {
9711 }
9712
9714 {
9716 {
9718
9721
9724
9725 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9726 }
9727 }
9728
9730 {
9732 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9733
9735 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9736
9738 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9739
9741 {
9743 }
9744 }
9745
9747 {
9749 }
9750
9752 {
9755 else
9757
9759 {
9762 }
9763 else
9764 {
9767
9770 }
9771
9773 }
9774
9776 {
9778 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9779 }
9780
9782 {
9784 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9786 }
9787
9789 {
9791 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9792 }
9793
9795 {
9798
9799 OverheatingParticle OP = new OverheatingParticle();
9804
9806 }
9807
9809 {
9812
9813 return -1;
9814 }
9815
9817 {
9819 {
9822
9823 for (int i = count; i > 0; --i)
9824 {
9825 int id = i - 1;
9828
9831
9832 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9833 {
9834 if (p)
9835 {
9838 }
9839 }
9840 }
9841 }
9842 }
9843
9845 {
9847 {
9849 {
9850 int id = i - 1;
9852
9853 if (OP)
9854 {
9856
9857 if (p)
9858 {
9860 }
9861
9862 delete OP;
9863 }
9864 }
9865
9868 }
9869 }
9870
9873 {
9874 return 0.0;
9875 }
9876
9877
9879 {
9880 return 250;
9881 }
9882
9884 {
9885 return 0;
9886 }
9887
9890 {
9892 return true;
9893
9894 return false;
9895 }
9896
9899 {
9902
9904 {
9906 }
9907 else
9908 {
9909
9911 }
9912
9914 }
9915
9922 {
9923 return -1;
9924 }
9925
9926
9927
9928
9930 {
9932 {
9934 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9935
9936 if (r_index >= 0)
9937 {
9938 InventoryLocation r_il = new InventoryLocation;
9939 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9940
9941 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9944 {
9945 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9946 }
9948 {
9949 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9950 }
9951
9952 }
9953
9954 player.GetHumanInventory().ClearUserReservedLocation(this);
9955 }
9956
9959 }
9960
9961
9962
9963
9965 {
9966 return ItemBase.m_DebugActionsMask;
9967 }
9968
9970 {
9971 return ItemBase.m_DebugActionsMask & mask;
9972 }
9973
9975 {
9976 ItemBase.m_DebugActionsMask = mask;
9977 }
9978
9980 {
9981 ItemBase.m_DebugActionsMask |= mask;
9982 }
9983
9985 {
9986 ItemBase.m_DebugActionsMask &= ~mask;
9987 }
9988
9990 {
9992 {
9994 }
9995 else
9996 {
9998 }
9999 }
10000
10001
10003 {
10004 if (GetEconomyProfile())
10005 {
10006 float q_max = GetEconomyProfile().GetQuantityMax();
10007 if (q_max > 0)
10008 {
10009 float q_min = GetEconomyProfile().GetQuantityMin();
10010 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10011
10013 {
10014 ComponentEnergyManager comp = GetCompEM();
10016 {
10018 }
10019 }
10021 {
10023
10024 }
10025
10026 }
10027 }
10028 }
10029
10032 {
10033 EntityAI parent = GetHierarchyParent();
10034
10035 if (parent)
10036 {
10037 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10038 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10039 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10040 }
10041 }
10042
10045 {
10046 EntityAI parent = GetHierarchyParent();
10047
10048 if (parent)
10049 {
10050 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10051 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10052 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10053 }
10054 }
10055
10057 {
10058
10059
10060
10061
10063
10065 {
10066 if (ScriptInputUserData.CanStoreInputUserData())
10067 {
10068 ScriptInputUserData ctx = new ScriptInputUserData;
10074 ctx.
Write(use_stack_max);
10077
10079 {
10080 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10081 }
10082 }
10083 }
10084 else if (!
GetGame().IsMultiplayer())
10085 {
10087 }
10088 }
10089
10091 {
10093 }
10094
10096 {
10098 }
10099
10101 {
10103 }
10104
10106 {
10107
10108 return false;
10109 }
10110
10112 {
10113 return false;
10114 }
10115
10119 {
10120 return false;
10121 }
10122
10124 {
10125 return "";
10126 }
10127
10129
10131 {
10132 return false;
10133 }
10134
10136 {
10137 return true;
10138 }
10139
10140
10141
10143 {
10144 return true;
10145 }
10146
10148 {
10149 return true;
10150 }
10151
10153 {
10154 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10156 }
10157
10159 {
10161 }
10162
10164 {
10166 if (!is_being_placed)
10168 SetSynchDirty();
10169 }
10170
10171
10173
10175 {
10177 }
10178
10180 {
10182 }
10183
10185 {
10186 return 1;
10187 }
10188
10190 {
10191 return false;
10192 }
10193
10195 {
10197 SetSynchDirty();
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
10228
10229
10230
10231
10232
10233
10235 {
10236 super.OnMovedInsideCargo(container);
10237
10238 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10239 }
10240
10241 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10242 {
10243 super.EEItemLocationChanged(oldLoc,newLoc);
10244
10245 PlayerBase new_player = null;
10246 PlayerBase old_player = null;
10247
10248 if (newLoc.GetParent())
10249 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10250
10251 if (oldLoc.GetParent())
10252 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10253
10255 {
10256 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10257
10258 if (r_index >= 0)
10259 {
10260 InventoryLocation r_il = new InventoryLocation;
10261 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10262
10263 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10266 {
10267 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10268 }
10270 {
10271 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10272 }
10273
10274 }
10275 }
10276
10278 {
10279 if (new_player)
10280 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10281
10282 if (new_player == old_player)
10283 {
10284
10285 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10286 {
10288 {
10289 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10290 {
10291 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10292 }
10293 }
10294 else
10295 {
10296 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10297 }
10298 }
10299
10300 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10301 {
10302 int type = oldLoc.GetType();
10304 {
10305 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10306 }
10308 {
10309 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10310 }
10311 }
10312 if (!m_OldLocation)
10313 {
10314 m_OldLocation = new InventoryLocation;
10315 }
10316 m_OldLocation.Copy(oldLoc);
10317 }
10318 else
10319 {
10320 if (m_OldLocation)
10321 {
10322 m_OldLocation.Reset();
10323 }
10324 }
10325
10327 }
10328 else
10329 {
10330 if (new_player)
10331 {
10332 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10333 if (res_index >= 0)
10334 {
10335 InventoryLocation il = new InventoryLocation;
10336 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10338 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10341 {
10342 il.
GetParent().GetOnReleaseLock().Invoke(it);
10343 }
10345 {
10347 }
10348
10349 }
10350 }
10352 {
10353
10355 }
10356
10357 if (m_OldLocation)
10358 {
10359 m_OldLocation.Reset();
10360 }
10361 }
10362 }
10363
10364 override void EOnContact(IEntity other, Contact extra)
10365 {
10367 {
10368 int liquidType = -1;
10370 if (impactSpeed > 0.0)
10371 {
10373 #ifndef SERVER
10375 #else
10377 SetSynchDirty();
10378 #endif
10380 }
10381 }
10382
10383 #ifdef SERVER
10384 if (GetCompEM() && GetCompEM().IsPlugged())
10385 {
10386 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10387 GetCompEM().UnplugThis();
10388 }
10389 #endif
10390 }
10391
10393
10395 {
10397 }
10398
10400 {
10401
10402 }
10403
10405 {
10406 super.OnItemLocationChanged(old_owner, new_owner);
10407
10408 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10409 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10410
10411 if (!relatedPlayer && playerNew)
10412 relatedPlayer = playerNew;
10413
10414 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10415 {
10417 if (actionMgr)
10418 {
10419 ActionBase currentAction = actionMgr.GetRunningAction();
10420 if (currentAction)
10422 }
10423 }
10424
10425 Man ownerPlayerOld = null;
10426 Man ownerPlayerNew = null;
10427
10428 if (old_owner)
10429 {
10430 if (old_owner.
IsMan())
10431 {
10432 ownerPlayerOld = Man.Cast(old_owner);
10433 }
10434 else
10435 {
10436 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10437 }
10438 }
10439 else
10440 {
10442 {
10444
10445 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10446 {
10447 GetCompEM().UnplugThis();
10448 }
10449 }
10450 }
10451
10452 if (new_owner)
10453 {
10454 if (new_owner.
IsMan())
10455 {
10456 ownerPlayerNew = Man.Cast(new_owner);
10457 }
10458 else
10459 {
10460 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10461 }
10462 }
10463
10464 if (ownerPlayerOld != ownerPlayerNew)
10465 {
10466 if (ownerPlayerOld)
10467 {
10468 array<EntityAI> subItemsExit = new array<EntityAI>;
10470 for (int i = 0; i < subItemsExit.Count(); i++)
10471 {
10474 }
10475 }
10476
10477 if (ownerPlayerNew)
10478 {
10479 array<EntityAI> subItemsEnter = new array<EntityAI>;
10481 for (int j = 0; j < subItemsEnter.Count(); j++)
10482 {
10485 }
10486 }
10487 }
10488 else if (ownerPlayerNew != null)
10489 {
10490 PlayerBase nplayer;
10491 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10492 {
10493 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10495 for (int k = 0; k < subItemsUpdate.Count(); k++)
10496 {
10498 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10499 }
10500 }
10501 }
10502
10503 if (old_owner)
10504 old_owner.OnChildItemRemoved(this);
10505 if (new_owner)
10506 new_owner.OnChildItemReceived(this);
10507 }
10508
10509
10511 {
10512 super.EEDelete(parent);
10513 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10514 if (player)
10515 {
10517
10518 if (player.IsAlive())
10519 {
10520 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10521 if (r_index >= 0)
10522 {
10523 InventoryLocation r_il = new InventoryLocation;
10524 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10525
10526 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10529 {
10530 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10531 }
10533 {
10534 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10535 }
10536
10537 }
10538
10539 player.RemoveQuickBarEntityShortcut(this);
10540 }
10541 }
10542 }
10543
10545 {
10546 super.EEKilled(killer);
10547
10550 {
10551 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10552 {
10553 if (IsMagazine())
10554 {
10555 if (Magazine.Cast(this).GetAmmoCount() > 0)
10556 {
10558 }
10559 }
10560 else
10561 {
10563 }
10564 }
10565 }
10566 }
10567
10569 {
10570 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10571
10572 super.OnWasAttached(parent, slot_id);
10573
10576
10578 }
10579
10581 {
10582 super.OnWasDetached(parent, slot_id);
10583
10586 }
10587
10589 {
10590 int idx;
10593
10594 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10595 if (inventory_slots.Count() < 1)
10596 {
10597 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10598 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10599 }
10600 else
10601 {
10602 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10603 }
10604
10605 idx = inventory_slots.Find(slot);
10606 if (idx < 0)
10607 return "";
10608
10609 return attach_types.Get(idx);
10610 }
10611
10613 {
10614 int idx = -1;
10615 string slot;
10616
10619
10620 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10621 if (inventory_slots.Count() < 1)
10622 {
10623 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10624 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10625 }
10626 else
10627 {
10628 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10629 if (detach_types.Count() < 1)
10630 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10631 }
10632
10633 for (int i = 0; i < inventory_slots.Count(); i++)
10634 {
10635 slot = inventory_slots.Get(i);
10636 }
10637
10638 if (slot != "")
10639 {
10640 if (detach_types.Count() == 1)
10641 idx = 0;
10642 else
10643 idx = inventory_slots.Find(slot);
10644 }
10645 if (idx < 0)
10646 return "";
10647
10648 return detach_types.Get(idx);
10649 }
10650
10652 {
10653
10655
10656
10657 float min_time = 1;
10658 float max_time = 3;
10659 float delay = Math.RandomFloat(min_time, max_time);
10660
10661 explode_timer.Run(delay, this, "DoAmmoExplosion");
10662 }
10663
10665 {
10666 Magazine magazine = Magazine.Cast(this);
10667 int pop_sounds_count = 6;
10668 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10669
10670
10671 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10672 string sound_name = pop_sounds[ sound_idx ];
10674
10675
10676 magazine.ServerAddAmmoCount(-1);
10677
10678
10679 float min_temp_to_explode = 100;
10680
10681 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10682 {
10684 }
10685 }
10686
10687
10688 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10689 {
10690 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10691
10692 const int CHANCE_DAMAGE_CARGO = 4;
10693 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10694 const int CHANCE_DAMAGE_NOTHING = 2;
10695
10697 {
10698 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10699 int chances;
10700 int rnd;
10701
10702 if (GetInventory().GetCargo())
10703 {
10704 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10705 rnd = Math.RandomInt(0,chances);
10706
10707 if (rnd < CHANCE_DAMAGE_CARGO)
10708 {
10710 }
10711 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10712 {
10714 }
10715 }
10716 else
10717 {
10718 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10719 rnd = Math.RandomInt(0,chances);
10720
10721 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10722 {
10724 }
10725 }
10726 }
10727 }
10728
10730 {
10731 if (GetInventory().GetCargo())
10732 {
10733 int item_count = GetInventory().GetCargo().GetItemCount();
10734 if (item_count > 0)
10735 {
10736 int random_pick = Math.RandomInt(0, item_count);
10738 if (!item.IsExplosive())
10739 {
10740 item.AddHealth("","",damage);
10741 return true;
10742 }
10743 }
10744 }
10745 return false;
10746 }
10747
10749 {
10750 int attachment_count = GetInventory().AttachmentCount();
10751 if (attachment_count > 0)
10752 {
10753 int random_pick = Math.RandomInt(0, attachment_count);
10754 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10755 if (!attachment.IsExplosive())
10756 {
10757 attachment.AddHealth("","",damage);
10758 return true;
10759 }
10760 }
10761 return false;
10762 }
10763
10765 {
10767 }
10768
10770 {
10772 return GetInventory().CanRemoveEntity();
10773
10774 return false;
10775 }
10776
10778 {
10779
10781 return false;
10782
10783
10785 return false;
10786
10787
10788
10790 if (delta == 0)
10791 return false;
10792
10793
10794 return true;
10795 }
10796
10798 {
10800 {
10801 if (ScriptInputUserData.CanStoreInputUserData())
10802 {
10803 ScriptInputUserData ctx = new ScriptInputUserData;
10808 ctx.
Write(destination_entity);
10810 ctx.
Write(slot_id);
10812 }
10813 }
10814 else if (!
GetGame().IsMultiplayer())
10815 {
10817 }
10818 }
10819
10821 {
10822 float split_quantity_new;
10826 InventoryLocation loc = new InventoryLocation;
10827
10828 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10829 {
10831 split_quantity_new = stack_max;
10832 else
10834
10836 {
10837 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10838 if (new_item)
10839 {
10840 new_item.SetResultOfSplit(true);
10841 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10843 new_item.
SetQuantity(split_quantity_new,
false,
true);
10844 }
10845 }
10846 }
10847 else if (destination_entity && slot_id == -1)
10848 {
10849 if (quantity > stack_max)
10850 split_quantity_new = stack_max;
10851 else
10852 split_quantity_new = quantity;
10853
10855 {
10857 {
10860 }
10861
10862 if (new_item)
10863 {
10864 new_item.SetResultOfSplit(true);
10865 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10867 new_item.
SetQuantity(split_quantity_new,
false,
true);
10868 }
10869 }
10870 }
10871 else
10872 {
10873 if (stack_max != 0)
10874 {
10876 {
10878 }
10879
10880 if (split_quantity_new == 0)
10881 {
10882 if (!
GetGame().IsMultiplayer())
10883 player.PhysicalPredictiveDropItem(this);
10884 else
10885 player.ServerDropEntity(this);
10886 return;
10887 }
10888
10890 {
10892
10893 if (new_item)
10894 {
10895 new_item.SetResultOfSplit(true);
10896 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10899 new_item.PlaceOnSurface();
10900 }
10901 }
10902 }
10903 }
10904 }
10905
10907 {
10908 float split_quantity_new;
10912 InventoryLocation loc = new InventoryLocation;
10913
10914 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10915 {
10917 split_quantity_new = stack_max;
10918 else
10920
10922 {
10923 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10924 if (new_item)
10925 {
10926 new_item.SetResultOfSplit(true);
10927 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10929 new_item.
SetQuantity(split_quantity_new,
false,
true);
10930 }
10931 }
10932 }
10933 else if (destination_entity && slot_id == -1)
10934 {
10935 if (quantity > stack_max)
10936 split_quantity_new = stack_max;
10937 else
10938 split_quantity_new = quantity;
10939
10941 {
10943 {
10946 }
10947
10948 if (new_item)
10949 {
10950 new_item.SetResultOfSplit(true);
10951 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10953 new_item.
SetQuantity(split_quantity_new,
false,
true);
10954 }
10955 }
10956 }
10957 else
10958 {
10959 if (stack_max != 0)
10960 {
10962 {
10964 }
10965
10967 {
10969
10970 if (new_item)
10971 {
10972 new_item.SetResultOfSplit(true);
10973 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10976 new_item.PlaceOnSurface();
10977 }
10978 }
10979 }
10980 }
10981 }
10982
10984 {
10986 {
10987 if (ScriptInputUserData.CanStoreInputUserData())
10988 {
10989 ScriptInputUserData ctx = new ScriptInputUserData;
10994 dst.WriteToContext(ctx);
10996 }
10997 }
10998 else if (!
GetGame().IsMultiplayer())
10999 {
11001 }
11002 }
11003
11005 {
11007 {
11008 if (ScriptInputUserData.CanStoreInputUserData())
11009 {
11010 ScriptInputUserData ctx = new ScriptInputUserData;
11015 ctx.
Write(destination_entity);
11021 }
11022 }
11023 else if (!
GetGame().IsMultiplayer())
11024 {
11026 }
11027 }
11028
11030 {
11032 }
11033
11035 {
11037 float split_quantity_new;
11039 if (dst.IsValid())
11040 {
11041 int slot_id = dst.GetSlot();
11043
11044 if (quantity > stack_max)
11045 split_quantity_new = stack_max;
11046 else
11047 split_quantity_new = quantity;
11048
11050 {
11052
11053 if (new_item)
11054 {
11055 new_item.SetResultOfSplit(true);
11056 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11058 new_item.
SetQuantity(split_quantity_new,
false,
true);
11059 }
11060
11061 return new_item;
11062 }
11063 }
11064
11065 return null;
11066 }
11067
11069 {
11071 float split_quantity_new;
11073 if (destination_entity)
11074 {
11076 if (quantity > stackable)
11077 split_quantity_new = stackable;
11078 else
11079 split_quantity_new = quantity;
11080
11082 {
11083 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11084 if (new_item)
11085 {
11086 new_item.SetResultOfSplit(true);
11087 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11089 new_item.
SetQuantity(split_quantity_new,
false,
true);
11090 }
11091 }
11092 }
11093 }
11094
11096 {
11098 {
11099 if (ScriptInputUserData.CanStoreInputUserData())
11100 {
11101 ScriptInputUserData ctx = new ScriptInputUserData;
11106 ItemBase destination_entity =
this;
11107 ctx.
Write(destination_entity);
11111 }
11112 }
11113 else if (!
GetGame().IsMultiplayer())
11114 {
11116 }
11117 }
11118
11120 {
11122 float split_quantity_new;
11124 if (player)
11125 {
11127 if (quantity > stackable)
11128 split_quantity_new = stackable;
11129 else
11130 split_quantity_new = quantity;
11131
11133 {
11134 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11135 new_item =
ItemBase.Cast(in_hands);
11136 if (new_item)
11137 {
11138 new_item.SetResultOfSplit(true);
11139 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11141 new_item.SetQuantity(split_quantity_new, false, true);
11142 }
11143 }
11144 }
11145 }
11146
11148 {
11150 float split_quantity_new = Math.Floor(quantity * 0.5);
11151
11153 return;
11154
11156
11157 if (new_item)
11158 {
11159 if (new_item.GetQuantityMax() < split_quantity_new)
11160 {
11161 split_quantity_new = new_item.GetQuantityMax();
11162 }
11163
11164 new_item.SetResultOfSplit(true);
11165 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11166
11168 {
11171 }
11172 else
11173 {
11175 new_item.
SetQuantity(split_quantity_new,
false,
true);
11176 }
11177 }
11178 }
11179
11181 {
11183 float split_quantity_new = Math.Floor(quantity / 2);
11184
11186 return;
11187
11188 InventoryLocation invloc = new InventoryLocation;
11190
11192 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11193
11194 if (new_item)
11195 {
11196 if (new_item.GetQuantityMax() < split_quantity_new)
11197 {
11198 split_quantity_new = new_item.GetQuantityMax();
11199 }
11201 {
11204 }
11205 else if (split_quantity_new > 1)
11206 {
11208 new_item.
SetQuantity(split_quantity_new,
false,
true);
11209 }
11210 }
11211 }
11212
11215 {
11216 SetWeightDirty();
11218
11219 if (parent)
11220 parent.OnAttachmentQuantityChangedEx(this, delta);
11221
11223 {
11225 {
11227 }
11229 {
11230 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11232 }
11233 }
11234
11235 }
11236
11239 {
11240
11241 }
11242
11245 {
11247 }
11248
11250 {
11251 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11252
11254 {
11255 if (newLevel == GameConstants.STATE_RUINED)
11256 {
11258 EntityAI parent = GetHierarchyParent();
11259 if (parent && parent.IsFireplace())
11260 {
11261 CargoBase cargo = GetInventory().GetCargo();
11262 if (cargo)
11263 {
11265 {
11267 }
11268 }
11269 }
11270 }
11271
11273 {
11274
11276 return;
11277 }
11278
11279 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11280 {
11282 }
11283 }
11284 }
11285
11286
11288 {
11289 super.OnRightClick();
11290
11292 {
11294 {
11295 if (ScriptInputUserData.CanStoreInputUserData())
11296 {
11297 EntityAI root = GetHierarchyRoot();
11298 Man playerOwner = GetHierarchyRootPlayer();
11299 InventoryLocation dst = new InventoryLocation;
11300
11301
11302 if (!playerOwner && root && root == this)
11303 {
11305 }
11306 else
11307 {
11308
11309 GetInventory().GetCurrentInventoryLocation(dst);
11311 {
11314 {
11316 }
11317 else
11318 {
11320
11321
11322 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11323 {
11325 }
11326 else
11327 {
11328 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11329 }
11330 }
11331 }
11332 }
11333
11334 ScriptInputUserData ctx = new ScriptInputUserData;
11342 }
11343 }
11344 else if (!
GetGame().IsMultiplayer())
11345 {
11347 }
11348 }
11349 }
11350
11352 {
11353 if (root)
11354 {
11355 vector m4[4];
11356 root.GetTransform(m4);
11357 dst.SetGround(this, m4);
11358 }
11359 else
11360 {
11361 GetInventory().GetCurrentInventoryLocation(dst);
11362 }
11363 }
11364
11365 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11366 {
11367
11368 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11369 return false;
11370
11371 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11372 return false;
11373
11374
11376 return false;
11377
11378
11379 Magazine mag = Magazine.Cast(this);
11380 if (mag)
11381 {
11382 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11383 return false;
11384
11385 if (stack_max_limit)
11386 {
11387 Magazine other_mag = Magazine.Cast(other_item);
11388 if (other_item)
11389 {
11390 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11391 return false;
11392 }
11393
11394 }
11395 }
11396 else
11397 {
11398
11400 return false;
11401
11403 return false;
11404 }
11405
11406 PlayerBase player = null;
11407 if (CastTo(player, GetHierarchyRootPlayer()))
11408 {
11409 if (player.GetInventory().HasAttachment(this))
11410 return false;
11411
11412 if (player.IsItemsToDelete())
11413 return false;
11414 }
11415
11416 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11417 return false;
11418
11419 int slotID;
11421 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11422 return false;
11423
11424 return true;
11425 }
11426
11428 {
11430 }
11431
11433 {
11434 return m_IsResultOfSplit;
11435 }
11436
11438 {
11439 m_IsResultOfSplit = value;
11440 }
11441
11443 {
11445 }
11446
11448 {
11449 float other_item_quantity = other_item.GetQuantity();
11450 float this_free_space;
11451
11453
11455
11456 if (other_item_quantity > this_free_space)
11457 {
11458 return this_free_space;
11459 }
11460 else
11461 {
11462 return other_item_quantity;
11463 }
11464 }
11465
11467 {
11469 }
11470
11472 {
11474 return;
11475
11476 if (!IsMagazine() && other_item)
11477 {
11479 if (quantity_used != 0)
11480 {
11481 float hp1 = GetHealth01("","");
11482 float hp2 = other_item.GetHealth01("","");
11483 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11484 hpResult = hpResult / (
GetQuantity() + quantity_used);
11485
11486 hpResult *= GetMaxHealth();
11487 Math.Round(hpResult);
11488 SetHealth("", "Health", hpResult);
11489
11491 other_item.AddQuantity(-quantity_used);
11492 }
11493 }
11495 }
11496
11498 {
11499 #ifdef SERVER
11500 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11501 GetHierarchyParent().IncreaseLifetimeUp();
11502 #endif
11503 };
11504
11506 {
11507 PlayerBase p = PlayerBase.Cast(player);
11508
11509 array<int> recipesIds = p.m_Recipes;
11510 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11511 if (moduleRecipesManager)
11512 {
11513 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11514 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11515 }
11516
11517 for (int i = 0;i < recipesIds.Count(); i++)
11518 {
11519 int key = recipesIds.Get(i);
11520 string recipeName = moduleRecipesManager.GetRecipeName(key);
11522 }
11523 }
11524
11525
11526 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11527 {
11528 super.GetDebugActions(outputList);
11529
11530
11536
11537
11542
11547
11548
11552
11553
11555 {
11559 }
11560
11563
11564
11568
11570
11571 InventoryLocation loc = new InventoryLocation();
11572 GetInventory().GetCurrentInventoryLocation(loc);
11574 {
11575 if (Gizmo_IsSupported())
11578 }
11579
11581 }
11582
11583
11584
11585
11587 {
11588 super.OnAction(action_id, player, ctx);
11589
11591 {
11592 switch (action_id)
11593 {
11596 return true;
11599 return true;
11600 }
11601 }
11602
11604 {
11605 switch (action_id)
11606 {
11608 Delete();
11609 return true;
11610 }
11611 }
11612
11613 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11614 {
11615 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11616 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11617 PlayerBase p = PlayerBase.Cast(player);
11618 if (
EActions.RECIPES_RANGE_START < 1000)
11619 {
11620 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11621 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11622 }
11623 }
11624 #ifndef SERVER
11625 else if (action_id ==
EActions.WATCH_PLAYER)
11626 {
11627 PluginDeveloper.SetDeveloperItemClientEx(player);
11628 }
11629 #endif
11631 {
11632 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11633 {
11634 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11635 OnDebugButtonPressServer(id + 1);
11636 }
11637
11638 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11639 {
11640 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11642 }
11643
11644 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11645 {
11646 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11648 }
11649
11650 else if (action_id ==
EActions.ADD_QUANTITY)
11651 {
11652 if (IsMagazine())
11653 {
11654 Magazine mag = Magazine.Cast(this);
11655 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11656 }
11657 else
11658 {
11660 }
11661
11662 if (m_EM)
11663 {
11664 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11665 }
11666
11667 }
11668
11669 else if (action_id ==
EActions.REMOVE_QUANTITY)
11670 {
11671 if (IsMagazine())
11672 {
11673 Magazine mag2 = Magazine.Cast(this);
11674 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11675 }
11676 else
11677 {
11679 }
11680 if (m_EM)
11681 {
11682 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11683 }
11684
11685 }
11686
11687 else if (action_id ==
EActions.SET_QUANTITY_0)
11688 {
11690
11691 if (m_EM)
11692 {
11693 m_EM.SetEnergy(0);
11694 }
11695 }
11696
11697 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11698 {
11700
11701 if (m_EM)
11702 {
11703 m_EM.SetEnergy(m_EM.GetEnergyMax());
11704 }
11705 }
11706
11707 else if (action_id ==
EActions.ADD_HEALTH)
11708 {
11709 AddHealth("","",GetMaxHealth("","Health")/5);
11710 }
11711 else if (action_id ==
EActions.REMOVE_HEALTH)
11712 {
11713 AddHealth("","",-GetMaxHealth("","Health")/5);
11714 }
11715 else if (action_id ==
EActions.DESTROY_HEALTH)
11716 {
11717 SetHealth01("","",0);
11718 }
11719 else if (action_id ==
EActions.WATCH_ITEM)
11720 {
11722 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11723 #ifdef DEVELOPER
11724 SetDebugDeveloper_item(this);
11725 #endif
11726 }
11727
11728 else if (action_id ==
EActions.ADD_TEMPERATURE)
11729 {
11730 AddTemperature(20);
11731
11732 }
11733
11734 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11735 {
11736 AddTemperature(-20);
11737
11738 }
11739
11740 else if (action_id ==
EActions.FLIP_FROZEN)
11741 {
11742 SetFrozen(!GetIsFrozen());
11743
11744 }
11745
11746 else if (action_id ==
EActions.ADD_WETNESS)
11747 {
11749
11750 }
11751
11752 else if (action_id ==
EActions.REMOVE_WETNESS)
11753 {
11755
11756 }
11757
11758 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11759 {
11762
11763
11764 }
11765
11766 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11767 {
11770 }
11771
11772 else if (action_id ==
EActions.MAKE_SPECIAL)
11773 {
11774 auto debugParams = DebugSpawnParams.WithPlayer(player);
11775 OnDebugSpawnEx(debugParams);
11776 }
11777
11778 }
11779
11780
11781 return false;
11782 }
11783
11784
11785
11786
11790
11793
11794
11795
11797 {
11798 return false;
11799 }
11800
11801
11803 {
11804 return true;
11805 }
11806
11807
11809 {
11810 return true;
11811 }
11812
11813
11814
11816 {
11817 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11819 }
11820
11823 {
11824 return null;
11825 }
11826
11828 {
11829 return false;
11830 }
11831
11833 {
11834 return false;
11835 }
11836
11840
11841
11843 {
11844 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11845 return module_repairing.CanRepair(this, item_repair_kit);
11846 }
11847
11848
11849 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11850 {
11851 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11852 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11853 }
11854
11855
11857 {
11858
11859
11860
11861
11862
11863
11864
11865
11866 return 1;
11867 }
11868
11869
11870
11872 {
11874 }
11875
11876
11877
11879 {
11881 }
11882
11883
11892 {
11893 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11894
11895 if (player)
11896 {
11897 player.MessageStatus(text);
11898 }
11899 }
11900
11901
11910 {
11911 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11912
11913 if (player)
11914 {
11915 player.MessageAction(text);
11916 }
11917 }
11918
11919
11928 {
11929 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11930
11931 if (player)
11932 {
11933 player.MessageFriendly(text);
11934 }
11935 }
11936
11937
11946 {
11947 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11948
11949 if (player)
11950 {
11951 player.MessageImportant(text);
11952 }
11953 }
11954
11956 {
11957 return true;
11958 }
11959
11960
11961 override bool KindOf(
string tag)
11962 {
11963 bool found = false;
11964 string item_name = this.
GetType();
11967
11968 int array_size = item_tag_array.Count();
11969 for (int i = 0; i < array_size; i++)
11970 {
11971 if (item_tag_array.Get(i) == tag)
11972 {
11973 found = true;
11974 break;
11975 }
11976 }
11977 return found;
11978 }
11979
11980
11982 {
11983
11984 super.OnRPC(sender, rpc_type,ctx);
11985
11986
11987 switch (rpc_type)
11988 {
11989 #ifndef SERVER
11990 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11991 Param2<bool, string> p = new Param2<bool, string>(false, "");
11992
11994 return;
11995
11996 bool play = p.param1;
11997 string soundSet = p.param2;
11998
11999 if (play)
12000 {
12002 {
12004 {
12006 }
12007 }
12008 else
12009 {
12011 }
12012 }
12013 else
12014 {
12016 }
12017
12018 break;
12019 #endif
12020
12021 }
12022
12024 {
12026 }
12027 }
12028
12029
12030
12031
12033 {
12034 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12035 return plugin.GetID(
name);
12036 }
12037
12039 {
12040 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12041 return plugin.GetName(id);
12042 }
12043
12046 {
12047
12048
12049 int varFlags;
12050 if (!ctx.
Read(varFlags))
12051 return;
12052
12053 if (varFlags & ItemVariableFlags.FLOAT)
12054 {
12056 }
12057 }
12058
12060 {
12061
12062 super.SerializeNumericalVars(floats_out);
12063
12064
12065
12067 {
12069 }
12070
12072 {
12074 }
12075
12077 {
12079 }
12080
12082 {
12087 }
12088
12090 {
12092 }
12093 }
12094
12096 {
12097
12098 super.DeSerializeNumericalVars(floats);
12099
12100
12101 int index = 0;
12102 int mask = Math.Round(floats.Get(index));
12103
12104 index++;
12105
12107 {
12109 {
12111 }
12112 else
12113 {
12114 float quantity = floats.Get(index);
12115 SetQuantity(quantity,
true,
false,
false,
false);
12116 }
12117 index++;
12118 }
12119
12121 {
12122 float wet = floats.Get(index);
12124 index++;
12125 }
12126
12128 {
12129 int liquidtype = Math.Round(floats.Get(index));
12131 index++;
12132 }
12133
12135 {
12137 index++;
12139 index++;
12141 index++;
12143 index++;
12144 }
12145
12147 {
12148 int cleanness = Math.Round(floats.Get(index));
12150 index++;
12151 }
12152 }
12153
12155 {
12156 super.WriteVarsToCTX(ctx);
12157
12158
12160 {
12162 }
12163
12165 {
12167 }
12168
12170 {
12172 }
12173
12175 {
12176 int r,g,b,a;
12182 }
12183
12185 {
12187 }
12188 }
12189
12191 {
12192 if (!super.ReadVarsFromCTX(ctx,version))
12193 return false;
12194
12195 int intValue;
12196 float value;
12197
12198 if (version < 140)
12199 {
12200 if (!ctx.
Read(intValue))
12201 return false;
12202
12203 m_VariablesMask = intValue;
12204 }
12205
12207 {
12208 if (!ctx.
Read(value))
12209 return false;
12210
12212 {
12214 }
12215 else
12216 {
12218 }
12219 }
12220
12221 if (version < 140)
12222 {
12224 {
12225 if (!ctx.
Read(value))
12226 return false;
12227 SetTemperatureDirect(value);
12228 }
12229 }
12230
12232 {
12233 if (!ctx.
Read(value))
12234 return false;
12236 }
12237
12239 {
12240 if (!ctx.
Read(intValue))
12241 return false;
12243 }
12244
12246 {
12247 int r,g,b,a;
12249 return false;
12251 return false;
12253 return false;
12255 return false;
12256
12258 }
12259
12261 {
12262 if (!ctx.
Read(intValue))
12263 return false;
12265 }
12266
12267 if (version >= 138 && version < 140)
12268 {
12270 {
12271 if (!ctx.
Read(intValue))
12272 return false;
12273 SetFrozen(intValue);
12274 }
12275 }
12276
12277 return true;
12278 }
12279
12280
12282 {
12285 {
12287 }
12288
12289 if (!super.OnStoreLoad(ctx, version))
12290 {
12292 return false;
12293 }
12294
12295 if (version >= 114)
12296 {
12297 bool hasQuickBarIndexSaved;
12298
12299 if (!ctx.
Read(hasQuickBarIndexSaved))
12300 {
12302 return false;
12303 }
12304
12305 if (hasQuickBarIndexSaved)
12306 {
12307 int itmQBIndex;
12308
12309
12310 if (!ctx.
Read(itmQBIndex))
12311 {
12313 return false;
12314 }
12315
12316 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12317 if (itmQBIndex != -1 && parentPlayer)
12318 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12319 }
12320 }
12321 else
12322 {
12323
12324 PlayerBase player;
12325 int itemQBIndex;
12326 if (version ==
int.
MAX)
12327 {
12328 if (!ctx.
Read(itemQBIndex))
12329 {
12331 return false;
12332 }
12333 }
12334 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12335 {
12336
12337 if (!ctx.
Read(itemQBIndex))
12338 {
12340 return false;
12341 }
12342 if (itemQBIndex != -1 && player)
12343 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12344 }
12345 }
12346
12347 if (version < 140)
12348 {
12349
12350 if (!LoadVariables(ctx, version))
12351 {
12353 return false;
12354 }
12355 }
12356
12357
12359 {
12361 return false;
12362 }
12363 if (version >= 132)
12364 {
12366 if (raib)
12367 {
12369 {
12371 return false;
12372 }
12373 }
12374 }
12375
12377 return true;
12378 }
12379
12380
12381
12383 {
12384 super.OnStoreSave(ctx);
12385
12386 PlayerBase player;
12387 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12388 {
12390
12391 int itemQBIndex = -1;
12392 itemQBIndex = player.FindQuickBarEntityIndex(this);
12393 ctx.
Write(itemQBIndex);
12394 }
12395 else
12396 {
12398 }
12399
12401
12403 if (raib)
12404 {
12406 }
12407 }
12408
12409
12411 {
12412 super.AfterStoreLoad();
12413
12415 {
12417 }
12418
12420 {
12423 }
12424 }
12425
12427 {
12428 super.EEOnAfterLoad();
12429
12431 {
12433 }
12434
12437 }
12438
12440 {
12441 return false;
12442 }
12443
12444
12445
12447 {
12449 {
12450 #ifdef PLATFORM_CONSOLE
12451
12453 {
12455 if (menu)
12456 {
12458 }
12459 }
12460 #endif
12461 }
12462
12464 {
12467 }
12468
12470 {
12471 SetWeightDirty();
12473 }
12475 {
12478 }
12479
12481 {
12484 }
12486 {
12489 }
12490
12491 super.OnVariablesSynchronized();
12492 }
12493
12494
12495
12497 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12498 {
12499 if (!IsServerCheck(allow_client))
12500 return false;
12501
12503 return false;
12504
12507
12508 if (value <= (min + 0.001))
12509 value = min;
12510
12511 if (value == min)
12512 {
12513 if (destroy_config)
12514 {
12515 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12516 if (dstr)
12517 {
12519 this.Delete();
12520 return true;
12521 }
12522 }
12523 else if (destroy_forced)
12524 {
12526 this.Delete();
12527 return true;
12528 }
12529
12531 }
12532
12535
12537 {
12539
12540 if (delta)
12542 }
12543
12545
12546 return false;
12547 }
12548
12549
12551 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12552 {
12554 }
12555
12557 {
12560 }
12561
12563 {
12566 }
12567
12569 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12570 {
12571 float value_clamped = Math.Clamp(value, 0, 1);
12573 SetQuantity(result, destroy_config, destroy_forced);
12574 }
12575
12576
12579 {
12581 }
12582
12584 {
12586 }
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12598 {
12599 int slot = -1;
12600 if (GetInventory())
12601 {
12602 InventoryLocation il = new InventoryLocation;
12603 GetInventory().GetCurrentInventoryLocation(il);
12605 }
12606
12608 }
12609
12611 {
12612 float quantity_max = 0;
12613
12615 {
12616 if (attSlotID != -1)
12617 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12618
12619 if (quantity_max <= 0)
12621 }
12622
12623 if (quantity_max <= 0)
12625
12626 return quantity_max;
12627 }
12628
12630 {
12632 }
12633
12635 {
12637 }
12638
12639
12641 {
12643 }
12644
12646 {
12648 }
12649
12651 {
12653 }
12654
12655
12657 {
12658
12659 float weightEx = GetWeightEx();
12660 float special = GetInventoryAndCargoWeight();
12661 return weightEx - special;
12662 }
12663
12664
12666 {
12668 }
12669
12671 {
12673 {
12674 #ifdef DEVELOPER
12675 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12676 {
12677 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12679 }
12680 #endif
12681
12682 return GetQuantity() * GetConfigWeightModified();
12683 }
12684 else if (HasEnergyManager())
12685 {
12686 #ifdef DEVELOPER
12687 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12688 {
12689 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12690 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12691 }
12692 #endif
12693 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12694 }
12695 else
12696 {
12697 #ifdef DEVELOPER
12698 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12699 {
12700 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12701 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12702 }
12703 #endif
12704 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12705 }
12706 }
12707
12710 {
12711 int item_count = 0;
12713
12714 if (GetInventory().GetCargo() != NULL)
12715 {
12716 item_count = GetInventory().GetCargo().GetItemCount();
12717 }
12718
12719 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12720 {
12721 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12722 if (item)
12723 item_count += item.GetNumberOfItems();
12724 }
12725 return item_count;
12726 }
12727
12730 {
12731 float weight = 0;
12732 float wetness = 1;
12733 if (include_wetness)
12736 {
12737 weight = wetness * m_ConfigWeight;
12738 }
12740 {
12741 weight = 1;
12742 }
12743 return weight;
12744 }
12745
12746
12747
12749 {
12750 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12751 {
12752 GameInventory inv = GetInventory();
12753 array<EntityAI> items = new array<EntityAI>;
12755 for (int i = 0; i < items.Count(); i++)
12756 {
12758 if (item)
12759 {
12761 }
12762 }
12763 }
12764 }
12765
12766
12767
12768
12770 {
12771 float energy = 0;
12772 if (HasEnergyManager())
12773 {
12774 energy = GetCompEM().GetEnergy();
12775 }
12776 return energy;
12777 }
12778
12779
12781 {
12782 super.OnEnergyConsumed();
12783
12785 }
12786
12788 {
12789 super.OnEnergyAdded();
12790
12792 }
12793
12794
12796 {
12797 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12798 {
12800 {
12801 float energy_0to1 = GetCompEM().GetEnergy0To1();
12803 }
12804 }
12805 }
12806
12807
12809 {
12810 return ConfigGetFloat("heatIsolation");
12811 }
12812
12814 {
12816 }
12817
12819 {
12820 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12821 if (
GetGame().ConfigIsExisting(paramPath))
12823
12824 return 0.0;
12825 }
12826
12828 {
12829 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12830 if (
GetGame().ConfigIsExisting(paramPath))
12832
12833 return 0.0;
12834 }
12835
12836 override void SetWet(
float value,
bool allow_client =
false)
12837 {
12838 if (!IsServerCheck(allow_client))
12839 return;
12840
12843
12845
12846 m_VarWet = Math.Clamp(value, min, max);
12847
12849 {
12852 }
12853 }
12854
12855 override void AddWet(
float value)
12856 {
12858 }
12859
12861 {
12863 }
12864
12866 {
12868 }
12869
12871 {
12873 }
12874
12876 {
12878 }
12879
12881 {
12883 }
12884
12885 override void OnWetChanged(
float newVal,
float oldVal)
12886 {
12889 if (newLevel != oldLevel)
12890 {
12892 }
12893 }
12894
12896 {
12897 SetWeightDirty();
12898 }
12899
12901 {
12902 return GetWetLevelInternal(
m_VarWet);
12903 }
12904
12905
12906
12908 {
12910 }
12911
12913 {
12915 }
12916
12918 {
12920 }
12921
12923 {
12925 }
12926
12927
12928
12930 {
12931 if (ConfigIsExisting("itemModelLength"))
12932 {
12933 return ConfigGetFloat("itemModelLength");
12934 }
12935 return 0;
12936 }
12937
12939 {
12940 if (ConfigIsExisting("itemAttachOffset"))
12941 {
12942 return ConfigGetFloat("itemAttachOffset");
12943 }
12944 return 0;
12945 }
12946
12947 override void SetCleanness(
int value,
bool allow_client =
false)
12948 {
12949 if (!IsServerCheck(allow_client))
12950 return;
12951
12953
12955
12958 }
12959
12961 {
12963 }
12964
12966 {
12967 return true;
12968 }
12969
12970
12971
12972
12974 {
12976 }
12977
12979 {
12981 }
12982
12983
12984
12985
12986 override void SetColor(
int r,
int g,
int b,
int a)
12987 {
12993 }
12995 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12996 {
13001 }
13002
13004 {
13006 }
13007
13010 {
13011 int r,g,b,a;
13013 r = r/255;
13014 g = g/255;
13015 b = b/255;
13016 a = a/255;
13017 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13018 }
13019
13020
13021
13022 override void SetLiquidType(
int value,
bool allow_client =
false)
13023 {
13024 if (!IsServerCheck(allow_client))
13025 return;
13026
13031 }
13032
13034 {
13035 return ConfigGetInt("varLiquidTypeInit");
13036 }
13037
13039 {
13041 }
13042
13044 {
13046 SetFrozen(false);
13047 }
13048
13051 {
13052 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13053 }
13054
13055
13058 {
13059 PlayerBase nplayer;
13060 if (PlayerBase.CastTo(nplayer, player))
13061 {
13063
13064 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13065 }
13066 }
13067
13068
13071 {
13072 PlayerBase nplayer;
13073 if (PlayerBase.CastTo(nplayer,player))
13074 {
13075
13076 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13077
13078 }
13079
13080
13081 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13082
13083
13084 if (HasEnergyManager())
13085 {
13086 GetCompEM().UpdatePlugState();
13087 }
13088 }
13089
13090
13092 {
13093 super.OnPlacementStarted(player);
13094
13096 }
13097
13098 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13099 {
13101 {
13102 m_AdminLog.OnPlacementComplete(player,
this);
13103 }
13104
13105 super.OnPlacementComplete(player, position, orientation);
13106 }
13107
13108
13109
13110
13111
13113 {
13115 {
13116 return true;
13117 }
13118 else
13119 {
13120 return false;
13121 }
13122 }
13123
13124
13126 {
13128 {
13130 }
13131 }
13132
13133
13135 {
13137 }
13138
13140 {
13142 }
13143
13144 override void InsertAgent(
int agent,
float count = 1)
13145 {
13146 if (count < 1)
13147 return;
13148
13150 }
13151
13154 {
13156 }
13157
13158
13160 {
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
13199
13200
13201
13202
13203
13204
13206 {
13208 return false;
13209 return true;
13210 }
13211
13213 {
13214
13216 }
13217
13218
13221 {
13222 super.CheckForRoofLimited(timeTresholdMS);
13223
13225 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13226 {
13227 m_PreviousRoofTestTime = time;
13228 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13229 }
13230 }
13231
13232
13234 {
13236 {
13237 return 0;
13238 }
13239
13240 if (GetInventory().GetAttachmentSlotsCount() != 0)
13241 {
13242 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13243 if (filter)
13244 return filter.GetProtectionLevel(type, false, system);
13245 else
13246 return 0;
13247 }
13248
13249 string subclassPath, entryName;
13250
13251 switch (type)
13252 {
13254 entryName = "biological";
13255 break;
13257 entryName = "chemical";
13258 break;
13259 default:
13260 entryName = "biological";
13261 break;
13262 }
13263
13264 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13265
13267 }
13268
13269
13270
13273 {
13274 if (!IsMagazine())
13276
13278 }
13279
13280
13281
13282
13283
13288 {
13289 return true;
13290 }
13291
13293 {
13295 }
13296
13297
13298
13299
13300
13302 {
13303 if (parent)
13304 {
13305 if (parent.IsInherited(DayZInfected))
13306 return true;
13307
13308 if (!parent.IsRuined())
13309 return true;
13310 }
13311
13312 return true;
13313 }
13314
13316 {
13317 if (!super.CanPutAsAttachment(parent))
13318 {
13319 return false;
13320 }
13321
13322 if (!IsRuined() && !parent.IsRuined())
13323 {
13324 return true;
13325 }
13326
13327 return false;
13328 }
13329
13331 {
13332
13333
13334
13335
13336 return super.CanReceiveItemIntoCargo(item);
13337 }
13338
13340 {
13341
13342
13343
13344
13345 GameInventory attachmentInv = attachment.GetInventory();
13347 {
13348 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13349 return false;
13350 }
13351
13352 InventoryLocation loc = new InventoryLocation();
13353 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13354 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13355 return false;
13356
13357 return super.CanReceiveAttachment(attachment, slotId);
13358 }
13359
13361 {
13362 if (!super.CanReleaseAttachment(attachment))
13363 return false;
13364
13365 return GetInventory().AreChildrenAccessible();
13366 }
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13389 {
13390 int id = muzzle_owner.GetMuzzleID();
13391 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13392
13393 if (WPOF_array)
13394 {
13395 for (int i = 0; i < WPOF_array.Count(); i++)
13396 {
13397 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13398
13399 if (WPOF)
13400 {
13401 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13402 }
13403 }
13404 }
13405 }
13406
13407
13409 {
13410 int id = muzzle_owner.GetMuzzleID();
13412
13413 if (WPOBE_array)
13414 {
13415 for (int i = 0; i < WPOBE_array.Count(); i++)
13416 {
13417 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13418
13419 if (WPOBE)
13420 {
13421 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13422 }
13423 }
13424 }
13425 }
13426
13427
13429 {
13430 int id = muzzle_owner.GetMuzzleID();
13431 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13432
13433 if (WPOOH_array)
13434 {
13435 for (int i = 0; i < WPOOH_array.Count(); i++)
13436 {
13437 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13438
13439 if (WPOOH)
13440 {
13441 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13442 }
13443 }
13444 }
13445 }
13446
13447
13449 {
13450 int id = muzzle_owner.GetMuzzleID();
13451 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13452
13453 if (WPOOH_array)
13454 {
13455 for (int i = 0; i < WPOOH_array.Count(); i++)
13456 {
13457 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13458
13459 if (WPOOH)
13460 {
13461 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13462 }
13463 }
13464 }
13465 }
13466
13467
13469 {
13470 int id = muzzle_owner.GetMuzzleID();
13471 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13472
13473 if (WPOOH_array)
13474 {
13475 for (int i = 0; i < WPOOH_array.Count(); i++)
13476 {
13477 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13478
13479 if (WPOOH)
13480 {
13481 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13482 }
13483 }
13484 }
13485 }
13486
13487
13488
13490 {
13492 {
13493 return true;
13494 }
13495
13496 return false;
13497 }
13498
13500 {
13502 {
13503 return true;
13504 }
13505
13506 return false;
13507 }
13508
13510 {
13512 {
13513 return true;
13514 }
13515
13516 return false;
13517 }
13518
13520 {
13521 return false;
13522 }
13523
13526 {
13527 return UATimeSpent.DEFAULT_DEPLOY;
13528 }
13529
13530
13531
13532
13534 {
13536 SetSynchDirty();
13537 }
13538
13540 {
13542 }
13543
13544
13546 {
13547 return false;
13548 }
13549
13552 {
13553 string att_type = "None";
13554
13555 if (ConfigIsExisting("soundAttType"))
13556 {
13557 att_type = ConfigGetString("soundAttType");
13558 }
13559
13561 }
13562
13564 {
13566 }
13567
13568
13569
13570
13571
13577
13579 {
13582
13584 }
13585
13586
13588 {
13590 return;
13591
13593
13596
13599
13600 SoundParameters params = new SoundParameters();
13604 }
13605
13606
13608 {
13610 return;
13611
13613 SetSynchDirty();
13614
13617 }
13618
13619
13621 {
13623 return;
13624
13626 SetSynchDirty();
13627
13630 }
13631
13633 {
13635 }
13636
13638 {
13640 }
13641
13644 {
13645 if (!
GetGame().IsDedicatedServer())
13646 {
13647 if (ConfigIsExisting("attachSoundSet"))
13648 {
13649 string cfg_path = "";
13650 string soundset = "";
13651 string type_name =
GetType();
13652
13655 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13656 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13657
13658 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13659 {
13660 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13661 {
13662 if (cfg_slot_array[i] == slot_type)
13663 {
13664 soundset = cfg_soundset_array[i];
13665 break;
13666 }
13667 }
13668 }
13669
13670 if (soundset != "")
13671 {
13672 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13674 }
13675 }
13676 }
13677 }
13678
13680 {
13681
13682 }
13683
13684 void OnApply(PlayerBase player);
13685
13687 {
13688 return 1.0;
13689 };
13690
13692 {
13694 }
13695
13697 {
13699 }
13700
13702
13704 {
13705 SetDynamicPhysicsLifeTime(0.01);
13707 }
13708
13710 {
13711 array<string> zone_names = new array<string>;
13712 GetDamageZones(zone_names);
13713 for (int i = 0; i < zone_names.Count(); i++)
13714 {
13715 SetHealthMax(zone_names.Get(i),"Health");
13716 }
13717 SetHealthMax("","Health");
13718 }
13719
13722 {
13723 float global_health = GetHealth01("","Health");
13724 array<string> zones = new array<string>;
13725 GetDamageZones(zones);
13726
13727 for (int i = 0; i < zones.Count(); i++)
13728 {
13729 SetHealth01(zones.Get(i),"Health",global_health);
13730 }
13731 }
13732
13735 {
13736 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13737 }
13738
13740 {
13741 if (!hasRootAsPlayer)
13742 {
13743 if (refParentIB)
13744 {
13745
13746 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13747 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13748
13749 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13750 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13751
13754 }
13755 else
13756 {
13757
13760 }
13761 }
13762 }
13763
13765 {
13767 {
13768 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13769 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13770 {
13771 float heatPermCoef = 1.0;
13773 while (ent)
13774 {
13775 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13776 ent = ent.GetHierarchyParent();
13777 }
13778
13779 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13780 }
13781 }
13782 }
13783
13785 {
13786
13787 EntityAI parent = GetHierarchyParent();
13788 if (!parent)
13789 {
13790 hasParent = false;
13791 hasRootAsPlayer = false;
13792 }
13793 else
13794 {
13795 hasParent = true;
13796 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13797 refParentIB =
ItemBase.Cast(parent);
13798 }
13799 }
13800
13801 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13802 {
13803
13804 }
13805
13807 {
13808
13809 return false;
13810 }
13811
13813 {
13814
13815
13816 return false;
13817 }
13818
13820 {
13821
13822 return false;
13823 }
13824
13827 {
13828 return !GetIsFrozen() &&
IsOpen();
13829 }
13830
13832 {
13833 bool hasParent = false, hasRootAsPlayer = false;
13835
13836 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13837 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13838
13839 if (wwtu || foodDecay)
13840 {
13844
13845 if (processWetness || processTemperature || processDecay)
13846 {
13848
13849 if (processWetness)
13850 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13851
13852 if (processTemperature)
13854
13855 if (processDecay)
13856 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13857 }
13858 }
13859 }
13860
13863 {
13865 }
13866
13868 {
13871
13872 return super.GetTemperatureFreezeThreshold();
13873 }
13874
13876 {
13879
13880 return super.GetTemperatureThawThreshold();
13881 }
13882
13884 {
13887
13888 return super.GetItemOverheatThreshold();
13889 }
13890
13892 {
13894 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13895
13896 return super.GetTemperatureFreezeTime();
13897 }
13898
13900 {
13902 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13903
13904 return super.GetTemperatureThawTime();
13905 }
13906
13911
13913 {
13914 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13915 }
13916
13918 {
13919 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13920 }
13921
13924 {
13926 }
13927
13929 {
13931 }
13932
13934 {
13936 }
13937
13940 {
13941 return null;
13942 }
13943
13946 {
13947 return false;
13948 }
13949
13951 {
13953 {
13956 if (!trg)
13957 {
13959 explosive = this;
13960 }
13961
13962 explosive.PairRemote(trg);
13964
13965 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13966 trg.SetPersistentPairID(persistentID);
13967 explosive.SetPersistentPairID(persistentID);
13968
13969 return true;
13970 }
13971 return false;
13972 }
13973
13976 {
13977 float ret = 1.0;
13980 ret *= GetHealth01();
13981
13982 return ret;
13983 }
13984
13985 #ifdef DEVELOPER
13986 override void SetDebugItem()
13987 {
13988 super.SetDebugItem();
13989 _itemBase = this;
13990 }
13991
13993 {
13994 string text = super.GetDebugText();
13995
13997 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13998
13999 return text;
14000 }
14001 #endif
14002
14004 {
14005 return true;
14006 }
14007
14009
14011
14013 {
14016 }
14017
14018
14026
14042}
14043
14045{
14047 if (entity)
14048 {
14049 bool is_item = entity.IsInherited(
ItemBase);
14050 if (is_item && full_quantity)
14051 {
14054 }
14055 }
14056 else
14057 {
14059 return NULL;
14060 }
14061 return entity;
14062}
14063
14065{
14066 if (item)
14067 {
14068 if (health > 0)
14069 item.SetHealth("", "", health);
14070
14071 if (item.CanHaveTemperature())
14072 {
14074 if (item.CanFreeze())
14075 item.SetFrozen(false);
14076 }
14077
14078 if (item.HasEnergyManager())
14079 {
14080 if (quantity >= 0)
14081 {
14082 item.GetCompEM().SetEnergy0To1(quantity);
14083 }
14084 else
14085 {
14087 }
14088 }
14089 else if (item.IsMagazine())
14090 {
14091 Magazine mag = Magazine.Cast(item);
14092 if (quantity >= 0)
14093 {
14094 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14095 }
14096 else
14097 {
14099 }
14100
14101 }
14102 else
14103 {
14104 if (quantity >= 0)
14105 {
14106 item.SetQuantityNormalized(quantity, false);
14107 }
14108 else
14109 {
14111 }
14112
14113 }
14114 }
14115}
14116
14117#ifdef DEVELOPER
14119#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.