9118{
9120 {
9121 return true;
9122 }
9123};
9124
9125
9126
9128{
9132
9134
9137
9138
9139
9140
9141
9150
9156
9161
9166
9187 protected bool m_IsResultOfSplit
9188
9190
9195
9196
9197
9199
9203
9204
9205
9207
9210
9211
9212
9218
9219
9227
9230
9231
9233
9234
9236
9237
9242
9243
9248
9249
9251
9252
9254 {
9259
9260 if (!
GetGame().IsDedicatedServer())
9261 {
9263 {
9265
9267 {
9269 }
9270 }
9271
9274 }
9275
9276 m_OldLocation = null;
9277
9279 {
9281 }
9282
9283 if (ConfigIsExisting("headSelectionsToHide"))
9284 {
9287 }
9288
9290 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9291 {
9293 }
9294
9296
9297 m_IsResultOfSplit = false;
9298
9300 }
9301
9303 {
9304 super.InitItemVariables();
9305
9311 m_Count = ConfigGetInt(
"count");
9312
9315
9320
9323
9328
9340
9344
9345
9348 if (ConfigIsExisting("canBeSplit"))
9349 {
9352 }
9353
9355 if (ConfigIsExisting("itemBehaviour"))
9357
9358
9361 RegisterNetSyncVariableInt("m_VarLiquidType");
9362 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9363
9364 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9365 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9366 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9367
9368 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9369 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9370 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9371 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9372
9373 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9374 RegisterNetSyncVariableBool("m_IsTakeable");
9375 RegisterNetSyncVariableBool("m_IsHologram");
9376
9379 {
9382 }
9383
9385
9387 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9389
9390 }
9391
9393 {
9395 }
9396
9398 {
9401 {
9406 }
9407 }
9408
9409 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9410 {
9412 {
9415 }
9416
9418 }
9419
9421 {
9427 }
9428
9430
9432 {
9434
9435 if (!action)
9436 {
9437 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9438 return;
9439 }
9440
9442 if (!ai)
9443 {
9445 return;
9446 }
9447
9449 if (!action_array)
9450 {
9451 action_array = new array<ActionBase_Basic>;
9453 }
9454 if (LogManager.IsActionLogEnable())
9455 {
9456 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9457 }
9458
9459 if (action_array.Find(action) != -1)
9460 {
9461 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9462 }
9463 else
9464 {
9465 action_array.Insert(action);
9466 }
9467 }
9468
9470 {
9472 ActionBase action = player.GetActionManager().GetAction(actionName);
9475
9476 if (action_array)
9477 {
9478 action_array.RemoveItem(action);
9479 }
9480 }
9481
9482
9483
9485 {
9486 ActionOverrideData overrideData = new ActionOverrideData();
9490
9492 if (!actionMap)
9493 {
9496 }
9497
9498 actionMap.Insert(this.
Type(), overrideData);
9499
9500 }
9501
9503
9505
9506
9508 {
9511
9514
9515 string config_to_search = "CfgVehicles";
9516 string muzzle_owner_config;
9517
9519 {
9520 if (IsInherited(Weapon))
9521 config_to_search = "CfgWeapons";
9522
9523 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9524
9525 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9526
9528
9529 if (config_OnFire_subclass_count > 0)
9530 {
9531 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9532
9533 for (int i = 0; i < config_OnFire_subclass_count; i++)
9534 {
9535 string particle_class = "";
9537 string config_OnFire_entry = config_OnFire_class + particle_class;
9538 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9539 WPOF_array.Insert(WPOF);
9540 }
9541
9542
9544 }
9545 }
9546
9548 {
9549 config_to_search = "CfgWeapons";
9550 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9551
9552 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9553
9555
9556 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9557 {
9558 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9559
9560 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9561 {
9562 string particle_class2 = "";
9564 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9565 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9566 WPOBE_array.Insert(WPOBE);
9567 }
9568
9569
9571 }
9572 }
9573 }
9574
9575
9577 {
9580
9582 {
9583 string config_to_search = "CfgVehicles";
9584
9585 if (IsInherited(Weapon))
9586 config_to_search = "CfgWeapons";
9587
9588 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9589 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9590
9591 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9592 {
9593
9595
9597 {
9599 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9601 return;
9602 }
9603
9606
9607
9608
9610 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9611
9612 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9613 {
9614 string particle_class = "";
9616 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9618
9619 if (entry_type == CT_CLASS)
9620 {
9621 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9622 WPOOH_array.Insert(WPOF);
9623 }
9624 }
9625
9626
9628 }
9629 }
9630 }
9631
9633 {
9635 }
9636
9638 {
9640 {
9642
9645
9648
9649 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9650 }
9651 }
9652
9654 {
9656 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9657
9659 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9660
9662 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9663
9665 {
9667 }
9668 }
9669
9671 {
9673 }
9674
9676 {
9679 else
9681
9683 {
9686 }
9687 else
9688 {
9691
9694 }
9695
9697 }
9698
9700 {
9702 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9703 }
9704
9706 {
9708 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9710 }
9711
9713 {
9715 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9716 }
9717
9719 {
9722
9723 OverheatingParticle OP = new OverheatingParticle();
9728
9730 }
9731
9733 {
9736
9737 return -1;
9738 }
9739
9741 {
9743 {
9746
9747 for (int i = count; i > 0; --i)
9748 {
9749 int id = i - 1;
9752
9755
9756 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9757 {
9758 if (p)
9759 {
9762 }
9763 }
9764 }
9765 }
9766 }
9767
9769 {
9771 {
9773 {
9774 int id = i - 1;
9776
9777 if (OP)
9778 {
9780
9781 if (p)
9782 {
9784 }
9785
9786 delete OP;
9787 }
9788 }
9789
9792 }
9793 }
9794
9797 {
9798 return 0.0;
9799 }
9800
9801
9803 {
9804 return 250;
9805 }
9806
9808 {
9809 return 0;
9810 }
9811
9814 {
9816 return true;
9817
9818 return false;
9819 }
9820
9823 {
9826
9828 {
9830 }
9831 else
9832 {
9833
9835 }
9836
9838 }
9839
9846 {
9847 return -1;
9848 }
9849
9850
9851
9852
9854 {
9856 {
9858 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9859
9860 if (r_index >= 0)
9861 {
9862 InventoryLocation r_il = new InventoryLocation;
9863 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9864
9865 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9868 {
9869 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9870 }
9872 {
9873 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9874 }
9875
9876 }
9877
9878 player.GetHumanInventory().ClearUserReservedLocation(this);
9879 }
9880
9883 }
9884
9885
9886
9887
9889 {
9890 return ItemBase.m_DebugActionsMask;
9891 }
9892
9894 {
9895 return ItemBase.m_DebugActionsMask & mask;
9896 }
9897
9899 {
9900 ItemBase.m_DebugActionsMask = mask;
9901 }
9902
9904 {
9905 ItemBase.m_DebugActionsMask |= mask;
9906 }
9907
9909 {
9910 ItemBase.m_DebugActionsMask &= ~mask;
9911 }
9912
9914 {
9916 {
9918 }
9919 else
9920 {
9922 }
9923 }
9924
9925
9927 {
9928 if (GetEconomyProfile())
9929 {
9930 float q_max = GetEconomyProfile().GetQuantityMax();
9931 if (q_max > 0)
9932 {
9933 float q_min = GetEconomyProfile().GetQuantityMin();
9934 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9935
9937 {
9938 ComponentEnergyManager comp = GetCompEM();
9940 {
9942 }
9943 }
9945 {
9947
9948 }
9949
9950 }
9951 }
9952 }
9953
9956 {
9957 EntityAI parent = GetHierarchyParent();
9958
9959 if (parent)
9960 {
9961 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9962 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9963 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9964 }
9965 }
9966
9969 {
9970 EntityAI parent = GetHierarchyParent();
9971
9972 if (parent)
9973 {
9974 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9975 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9976 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9977 }
9978 }
9979
9981 {
9982
9983
9984
9985
9987
9989 {
9990 if (ScriptInputUserData.CanStoreInputUserData())
9991 {
9992 ScriptInputUserData ctx = new ScriptInputUserData;
9998 ctx.
Write(use_stack_max);
10001
10003 {
10004 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10005 }
10006 }
10007 }
10008 else if (!
GetGame().IsMultiplayer())
10009 {
10011 }
10012 }
10013
10015 {
10017 }
10018
10020 {
10022 }
10023
10025 {
10027 }
10028
10030 {
10031
10032 return false;
10033 }
10034
10036 {
10037 return false;
10038 }
10039
10043 {
10044 return false;
10045 }
10046
10048 {
10049 return "";
10050 }
10051
10053
10055 {
10056 return false;
10057 }
10058
10060 {
10061 return true;
10062 }
10063
10064
10065
10067 {
10068 return true;
10069 }
10070
10072 {
10073 return true;
10074 }
10075
10077 {
10078 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10080 }
10081
10083 {
10085 }
10086
10088 {
10090 if (!is_being_placed)
10092 SetSynchDirty();
10093 }
10094
10095
10097
10099 {
10101 }
10102
10104 {
10106 }
10107
10109 {
10110 return 1;
10111 }
10112
10114 {
10115 return false;
10116 }
10117
10119 {
10121 SetSynchDirty();
10122 }
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10159 {
10160 super.OnMovedInsideCargo(container);
10161
10162 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10163 }
10164
10165 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10166 {
10167 super.EEItemLocationChanged(oldLoc,newLoc);
10168
10169 PlayerBase new_player = null;
10170 PlayerBase old_player = null;
10171
10172 if (newLoc.GetParent())
10173 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10174
10175 if (oldLoc.GetParent())
10176 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10177
10179 {
10180 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10181
10182 if (r_index >= 0)
10183 {
10184 InventoryLocation r_il = new InventoryLocation;
10185 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10186
10187 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10190 {
10191 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10192 }
10194 {
10195 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10196 }
10197
10198 }
10199 }
10200
10202 {
10203 if (new_player)
10204 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10205
10206 if (new_player == old_player)
10207 {
10208
10209 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10210 {
10212 {
10213 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10214 {
10215 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10216 }
10217 }
10218 else
10219 {
10220 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10221 }
10222 }
10223
10224 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10225 {
10226 int type = oldLoc.GetType();
10228 {
10229 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10230 }
10232 {
10233 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10234 }
10235 }
10236 if (!m_OldLocation)
10237 {
10238 m_OldLocation = new InventoryLocation;
10239 }
10240 m_OldLocation.Copy(oldLoc);
10241 }
10242 else
10243 {
10244 if (m_OldLocation)
10245 {
10246 m_OldLocation.Reset();
10247 }
10248 }
10249
10251 }
10252 else
10253 {
10254 if (new_player)
10255 {
10256 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10257 if (res_index >= 0)
10258 {
10259 InventoryLocation il = new InventoryLocation;
10260 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10262 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10265 {
10266 il.
GetParent().GetOnReleaseLock().Invoke(it);
10267 }
10269 {
10271 }
10272
10273 }
10274 }
10276 {
10277
10279 }
10280
10281 if (m_OldLocation)
10282 {
10283 m_OldLocation.Reset();
10284 }
10285 }
10286 }
10287
10288 override void EOnContact(IEntity other, Contact extra)
10289 {
10291 {
10292 int liquidType = -1;
10294 if (impactSpeed > 0.0)
10295 {
10297 #ifndef SERVER
10299 #else
10301 SetSynchDirty();
10302 #endif
10304 }
10305 }
10306
10307 #ifdef SERVER
10308 if (GetCompEM() && GetCompEM().IsPlugged())
10309 {
10310 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10311 GetCompEM().UnplugThis();
10312 }
10313 #endif
10314 }
10315
10317
10319 {
10321 }
10322
10324 {
10325
10326 }
10327
10329 {
10330 super.OnItemLocationChanged(old_owner, new_owner);
10331
10332 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10333 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10334
10335 if (!relatedPlayer && playerNew)
10336 relatedPlayer = playerNew;
10337
10338 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10339 {
10341 if (actionMgr)
10342 {
10343 ActionBase currentAction = actionMgr.GetRunningAction();
10344 if (currentAction)
10346 }
10347 }
10348
10349 Man ownerPlayerOld = null;
10350 Man ownerPlayerNew = null;
10351
10352 if (old_owner)
10353 {
10354 if (old_owner.
IsMan())
10355 {
10356 ownerPlayerOld = Man.Cast(old_owner);
10357 }
10358 else
10359 {
10360 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10361 }
10362 }
10363 else
10364 {
10366 {
10368
10369 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10370 {
10371 GetCompEM().UnplugThis();
10372 }
10373 }
10374 }
10375
10376 if (new_owner)
10377 {
10378 if (new_owner.
IsMan())
10379 {
10380 ownerPlayerNew = Man.Cast(new_owner);
10381 }
10382 else
10383 {
10384 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10385 }
10386 }
10387
10388 if (ownerPlayerOld != ownerPlayerNew)
10389 {
10390 if (ownerPlayerOld)
10391 {
10392 array<EntityAI> subItemsExit = new array<EntityAI>;
10394 for (int i = 0; i < subItemsExit.Count(); i++)
10395 {
10398 }
10399 }
10400
10401 if (ownerPlayerNew)
10402 {
10403 array<EntityAI> subItemsEnter = new array<EntityAI>;
10405 for (int j = 0; j < subItemsEnter.Count(); j++)
10406 {
10409 }
10410 }
10411 }
10412 else if (ownerPlayerNew != null)
10413 {
10414 PlayerBase nplayer;
10415 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10416 {
10417 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10419 for (int k = 0; k < subItemsUpdate.Count(); k++)
10420 {
10422 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10423 }
10424 }
10425 }
10426
10427 if (old_owner)
10428 old_owner.OnChildItemRemoved(this);
10429 if (new_owner)
10430 new_owner.OnChildItemReceived(this);
10431 }
10432
10433
10435 {
10436 super.EEDelete(parent);
10437 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10438 if (player)
10439 {
10441
10442 if (player.IsAlive())
10443 {
10444 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10445 if (r_index >= 0)
10446 {
10447 InventoryLocation r_il = new InventoryLocation;
10448 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10449
10450 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10453 {
10454 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10455 }
10457 {
10458 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10459 }
10460
10461 }
10462
10463 player.RemoveQuickBarEntityShortcut(this);
10464 }
10465 }
10466 }
10467
10469 {
10470 super.EEKilled(killer);
10471
10474 {
10475 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10476 {
10477 if (IsMagazine())
10478 {
10479 if (Magazine.Cast(this).GetAmmoCount() > 0)
10480 {
10482 }
10483 }
10484 else
10485 {
10487 }
10488 }
10489 }
10490 }
10491
10493 {
10494 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10495
10496 super.OnWasAttached(parent, slot_id);
10497
10500
10502 }
10503
10505 {
10506 super.OnWasDetached(parent, slot_id);
10507
10510 }
10511
10513 {
10514 int idx;
10517
10518 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10519 if (inventory_slots.Count() < 1)
10520 {
10521 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10522 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10523 }
10524 else
10525 {
10526 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10527 }
10528
10529 idx = inventory_slots.Find(slot);
10530 if (idx < 0)
10531 return "";
10532
10533 return attach_types.Get(idx);
10534 }
10535
10537 {
10538 int idx = -1;
10539 string slot;
10540
10543
10544 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10545 if (inventory_slots.Count() < 1)
10546 {
10547 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10548 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10549 }
10550 else
10551 {
10552 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10553 if (detach_types.Count() < 1)
10554 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10555 }
10556
10557 for (int i = 0; i < inventory_slots.Count(); i++)
10558 {
10559 slot = inventory_slots.Get(i);
10560 }
10561
10562 if (slot != "")
10563 {
10564 if (detach_types.Count() == 1)
10565 idx = 0;
10566 else
10567 idx = inventory_slots.Find(slot);
10568 }
10569 if (idx < 0)
10570 return "";
10571
10572 return detach_types.Get(idx);
10573 }
10574
10576 {
10577
10579
10580
10581 float min_time = 1;
10582 float max_time = 3;
10583 float delay = Math.RandomFloat(min_time, max_time);
10584
10585 explode_timer.Run(delay, this, "DoAmmoExplosion");
10586 }
10587
10589 {
10590 Magazine magazine = Magazine.Cast(this);
10591 int pop_sounds_count = 6;
10592 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10593
10594
10595 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10596 string sound_name = pop_sounds[ sound_idx ];
10598
10599
10600 magazine.ServerAddAmmoCount(-1);
10601
10602
10603 float min_temp_to_explode = 100;
10604
10605 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10606 {
10608 }
10609 }
10610
10611
10612 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10613 {
10614 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10615
10616 const int CHANCE_DAMAGE_CARGO = 4;
10617 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10618 const int CHANCE_DAMAGE_NOTHING = 2;
10619
10621 {
10622 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10623 int chances;
10624 int rnd;
10625
10626 if (GetInventory().GetCargo())
10627 {
10628 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10629 rnd = Math.RandomInt(0,chances);
10630
10631 if (rnd < CHANCE_DAMAGE_CARGO)
10632 {
10634 }
10635 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10636 {
10638 }
10639 }
10640 else
10641 {
10642 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10643 rnd = Math.RandomInt(0,chances);
10644
10645 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10646 {
10648 }
10649 }
10650 }
10651 }
10652
10654 {
10655 if (GetInventory().GetCargo())
10656 {
10657 int item_count = GetInventory().GetCargo().GetItemCount();
10658 if (item_count > 0)
10659 {
10660 int random_pick = Math.RandomInt(0, item_count);
10662 if (!item.IsExplosive())
10663 {
10664 item.AddHealth("","",damage);
10665 return true;
10666 }
10667 }
10668 }
10669 return false;
10670 }
10671
10673 {
10674 int attachment_count = GetInventory().AttachmentCount();
10675 if (attachment_count > 0)
10676 {
10677 int random_pick = Math.RandomInt(0, attachment_count);
10678 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10679 if (!attachment.IsExplosive())
10680 {
10681 attachment.AddHealth("","",damage);
10682 return true;
10683 }
10684 }
10685 return false;
10686 }
10687
10689 {
10691 }
10692
10694 {
10696 return GetInventory().CanRemoveEntity();
10697
10698 return false;
10699 }
10700
10702 {
10704 return;
10705
10707 {
10708 if (ScriptInputUserData.CanStoreInputUserData())
10709 {
10710 ScriptInputUserData ctx = new ScriptInputUserData;
10715 ctx.
Write(destination_entity);
10717 ctx.
Write(slot_id);
10719 }
10720 }
10721 else if (!
GetGame().IsMultiplayer())
10722 {
10724 }
10725 }
10726
10728 {
10730 return;
10731
10732 float split_quantity_new;
10736 InventoryLocation loc = new InventoryLocation;
10737
10738 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10739 {
10741 split_quantity_new = stack_max;
10742 else
10744
10745 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10746 if (new_item)
10747 {
10748 new_item.SetResultOfSplit(true);
10749 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10751 new_item.SetQuantity(split_quantity_new);
10752 }
10753 }
10754 else if (destination_entity && slot_id == -1)
10755 {
10756 if (quantity > stack_max)
10757 split_quantity_new = stack_max;
10758 else
10759 split_quantity_new = quantity;
10760
10762 {
10765 }
10766
10767 if (new_item)
10768 {
10769 new_item.SetResultOfSplit(true);
10770 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10772 new_item.SetQuantity(split_quantity_new);
10773 }
10774 }
10775 else
10776 {
10777 if (stack_max != 0)
10778 {
10780 {
10782 }
10783
10784 if (split_quantity_new == 0)
10785 {
10786 if (!
GetGame().IsMultiplayer())
10787 player.PhysicalPredictiveDropItem(this);
10788 else
10789 player.ServerDropEntity(this);
10790 return;
10791 }
10792
10794
10795 if (new_item)
10796 {
10797 new_item.SetResultOfSplit(true);
10798 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10800 new_item.SetQuantity(stack_max);
10801 new_item.PlaceOnSurface();
10802 }
10803 }
10804 }
10805 }
10806
10808 {
10810 return;
10811
10812 float split_quantity_new;
10816 InventoryLocation loc = new InventoryLocation;
10817
10818 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10819 {
10821 split_quantity_new = stack_max;
10822 else
10824
10825 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10826 if (new_item)
10827 {
10828 new_item.SetResultOfSplit(true);
10829 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10831 new_item.SetQuantity(split_quantity_new);
10832 }
10833 }
10834 else if (destination_entity && slot_id == -1)
10835 {
10836 if (quantity > stack_max)
10837 split_quantity_new = stack_max;
10838 else
10839 split_quantity_new = quantity;
10840
10842 {
10845 }
10846
10847 if (new_item)
10848 {
10849 new_item.SetResultOfSplit(true);
10850 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10852 new_item.SetQuantity(split_quantity_new);
10853 }
10854 }
10855 else
10856 {
10857 if (stack_max != 0)
10858 {
10860 {
10862 }
10863
10865
10866 if (new_item)
10867 {
10868 new_item.SetResultOfSplit(true);
10869 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10871 new_item.SetQuantity(stack_max);
10872 new_item.PlaceOnSurface();
10873 }
10874 }
10875 }
10876 }
10877
10879 {
10881 return;
10882
10884 {
10885 if (ScriptInputUserData.CanStoreInputUserData())
10886 {
10887 ScriptInputUserData ctx = new ScriptInputUserData;
10892 dst.WriteToContext(ctx);
10894 }
10895 }
10896 else if (!
GetGame().IsMultiplayer())
10897 {
10899 }
10900 }
10901
10903 {
10905 return;
10906
10908 {
10909 if (ScriptInputUserData.CanStoreInputUserData())
10910 {
10911 ScriptInputUserData ctx = new ScriptInputUserData;
10916 ctx.
Write(destination_entity);
10922 }
10923 }
10924 else if (!
GetGame().IsMultiplayer())
10925 {
10927 }
10928 }
10929
10931 {
10933 }
10934
10936 {
10938 return this;
10939
10941 float split_quantity_new;
10943 if (dst.IsValid())
10944 {
10945 int slot_id = dst.GetSlot();
10947
10948 if (quantity > stack_max)
10949 split_quantity_new = stack_max;
10950 else
10951 split_quantity_new = quantity;
10952
10954
10955 if (new_item)
10956 {
10957 new_item.SetResultOfSplit(true);
10958 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10961 }
10962
10963 return new_item;
10964 }
10965
10966 return null;
10967 }
10968
10970 {
10972 return;
10973
10975 float split_quantity_new;
10977 if (destination_entity)
10978 {
10980 if (quantity > stackable)
10981 split_quantity_new = stackable;
10982 else
10983 split_quantity_new = quantity;
10984
10985 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10986 if (new_item)
10987 {
10988 new_item.SetResultOfSplit(true);
10989 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10991 new_item.SetQuantity(split_quantity_new);
10992 }
10993 }
10994 }
10995
10997 {
10999 return;
11000
11002 {
11003 if (ScriptInputUserData.CanStoreInputUserData())
11004 {
11005 ScriptInputUserData ctx = new ScriptInputUserData;
11010 ItemBase destination_entity =
this;
11011 ctx.
Write(destination_entity);
11015 }
11016 }
11017 else if (!
GetGame().IsMultiplayer())
11018 {
11020 }
11021 }
11022
11024 {
11026 return;
11027
11029 float split_quantity_new;
11031 if (player)
11032 {
11034 if (quantity > stackable)
11035 split_quantity_new = stackable;
11036 else
11037 split_quantity_new = quantity;
11038
11039 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11040 new_item =
ItemBase.Cast(in_hands);
11041 if (new_item)
11042 {
11043 new_item.SetResultOfSplit(true);
11044 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11046 new_item.SetQuantity(split_quantity_new);
11047 }
11048 }
11049 }
11050
11052 {
11054 return;
11055
11057 float split_quantity_new = Math.Floor(quantity * 0.5);
11058
11060
11061 if (new_item)
11062 {
11063 if (new_item.GetQuantityMax() < split_quantity_new)
11064 {
11065 split_quantity_new = new_item.GetQuantityMax();
11066 }
11067
11068 new_item.SetResultOfSplit(true);
11069 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11070
11072 {
11075 }
11076 else
11077 {
11080 }
11081 }
11082 }
11083
11085 {
11087 return;
11088
11090 float split_quantity_new = Math.Floor(quantity / 2);
11091
11092 InventoryLocation invloc = new InventoryLocation;
11094
11096 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11097
11098 if (new_item)
11099 {
11100 if (new_item.GetQuantityMax() < split_quantity_new)
11101 {
11102 split_quantity_new = new_item.GetQuantityMax();
11103 }
11105 {
11108 }
11109 else
11110 {
11113 }
11114 }
11115 }
11116
11119 {
11120 SetWeightDirty();
11122
11123 if (parent)
11124 parent.OnAttachmentQuantityChangedEx(this, delta);
11125
11127 {
11129 {
11131 }
11133 {
11134 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11136 }
11137 }
11138
11139 }
11140
11143 {
11144
11145 }
11146
11149 {
11151 }
11152
11154 {
11155 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11156
11158 {
11159 if (newLevel == GameConstants.STATE_RUINED)
11160 {
11162 EntityAI parent = GetHierarchyParent();
11163 if (parent && parent.IsFireplace())
11164 {
11165 CargoBase cargo = GetInventory().GetCargo();
11166 if (cargo)
11167 {
11169 {
11171 }
11172 }
11173 }
11174 }
11175
11177 {
11178
11180 return;
11181 }
11182
11183 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11184 {
11186 }
11187 }
11188 }
11189
11190
11192 {
11193 super.OnRightClick();
11194
11196 {
11198 {
11199 if (ScriptInputUserData.CanStoreInputUserData())
11200 {
11201 vector m4[4];
11203
11204 EntityAI root = GetHierarchyRoot();
11205
11206 InventoryLocation dst = new InventoryLocation;
11208 {
11209 if (root)
11210 {
11211 root.GetTransform(m4);
11213 }
11214 else
11215 GetInventory().GetCurrentInventoryLocation(dst);
11216 }
11217 else
11218 {
11220
11221
11222 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11223 {
11224 if (root)
11225 {
11226 root.GetTransform(m4);
11228 }
11229 else
11230 GetInventory().GetCurrentInventoryLocation(dst);
11231 }
11232 else
11233 {
11234 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11235 }
11236 }
11237
11238 ScriptInputUserData ctx = new ScriptInputUserData;
11246 }
11247 }
11248 else if (!
GetGame().IsMultiplayer())
11249 {
11251 }
11252 }
11253 }
11254
11255 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11256 {
11257
11258 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11259 return false;
11260
11261 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11262 return false;
11263
11264
11266 return false;
11267
11268
11269 Magazine mag = Magazine.Cast(this);
11270 if (mag)
11271 {
11272 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11273 return false;
11274
11275 if (stack_max_limit)
11276 {
11277 Magazine other_mag = Magazine.Cast(other_item);
11278 if (other_item)
11279 {
11280 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11281 return false;
11282 }
11283
11284 }
11285 }
11286 else
11287 {
11288
11290 return false;
11291
11293 return false;
11294 }
11295
11296 PlayerBase player = null;
11297 if (CastTo(player, GetHierarchyRootPlayer()))
11298 {
11299 if (player.GetInventory().HasAttachment(this))
11300 return false;
11301
11302 if (player.IsItemsToDelete())
11303 return false;
11304 }
11305
11306 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11307 return false;
11308
11309 int slotID;
11311 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11312 return false;
11313
11314 return true;
11315 }
11316
11318 {
11320 }
11321
11323 {
11324 return m_IsResultOfSplit;
11325 }
11326
11328 {
11329 m_IsResultOfSplit = value;
11330 }
11331
11333 {
11335 }
11336
11338 {
11339 float other_item_quantity = other_item.GetQuantity();
11340 float this_free_space;
11341
11343
11345
11346 if (other_item_quantity > this_free_space)
11347 {
11348 return this_free_space;
11349 }
11350 else
11351 {
11352 return other_item_quantity;
11353 }
11354 }
11355
11357 {
11359 }
11360
11362 {
11364 return;
11365
11366 if (!IsMagazine() && other_item)
11367 {
11369 if (quantity_used != 0)
11370 {
11371 float hp1 = GetHealth01("","");
11372 float hp2 = other_item.GetHealth01("","");
11373 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11374 hpResult = hpResult / (
GetQuantity() + quantity_used);
11375
11376 hpResult *= GetMaxHealth();
11377 Math.Round(hpResult);
11378 SetHealth("", "Health", hpResult);
11379
11381 other_item.AddQuantity(-quantity_used);
11382 }
11383 }
11385 }
11386
11388 {
11389 #ifdef SERVER
11390 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11391 GetHierarchyParent().IncreaseLifetimeUp();
11392 #endif
11393 };
11394
11396 {
11397 PlayerBase p = PlayerBase.Cast(player);
11398
11399 array<int> recipesIds = p.m_Recipes;
11400 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11401 if (moduleRecipesManager)
11402 {
11403 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11404 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11405 }
11406
11407 for (int i = 0;i < recipesIds.Count(); i++)
11408 {
11409 int key = recipesIds.Get(i);
11410 string recipeName = moduleRecipesManager.GetRecipeName(key);
11412 }
11413 }
11414
11415
11416 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11417 {
11418 super.GetDebugActions(outputList);
11419
11420
11425
11426
11430
11434
11435
11438
11439
11441 {
11444 }
11445
11447
11450
11454 }
11455
11456
11457
11458
11460 {
11461 super.OnAction(action_id, player, ctx);
11462 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11463 {
11464 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11465 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11466 PlayerBase p = PlayerBase.Cast(player);
11467 if (
EActions.RECIPES_RANGE_START < 1000)
11468 {
11469 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11470 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11471 }
11472 }
11473 #ifndef SERVER
11474 else if (action_id ==
EActions.WATCH_PLAYER)
11475 {
11476 PluginDeveloper.SetDeveloperItemClientEx(player);
11477 }
11478 #endif
11480 {
11481 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11482 {
11483 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11484 OnDebugButtonPressServer(id + 1);
11485 }
11486
11487 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11488 {
11489 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11491 }
11492
11493 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11494 {
11495 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11497 }
11498
11499 else if (action_id ==
EActions.ADD_QUANTITY)
11500 {
11501 if (IsMagazine())
11502 {
11503 Magazine mag = Magazine.Cast(this);
11504 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11505 }
11506 else
11507 {
11509 }
11510
11511 if (m_EM)
11512 {
11513 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11514 }
11515
11516 }
11517
11518 else if (action_id ==
EActions.REMOVE_QUANTITY)
11519 {
11520 if (IsMagazine())
11521 {
11522 Magazine mag2 = Magazine.Cast(this);
11523 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11524 }
11525 else
11526 {
11528 }
11529 if (m_EM)
11530 {
11531 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11532 }
11533
11534 }
11535
11536 else if (action_id ==
EActions.SET_QUANTITY_0)
11537 {
11539
11540 if (m_EM)
11541 {
11542 m_EM.SetEnergy(0);
11543 }
11544 }
11545
11546 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11547 {
11549
11550 if (m_EM)
11551 {
11552 m_EM.SetEnergy(m_EM.GetEnergyMax());
11553 }
11554 }
11555
11556 else if (action_id ==
EActions.ADD_HEALTH)
11557 {
11558 AddHealth("","",GetMaxHealth("","Health")/5);
11559 }
11560 else if (action_id ==
EActions.REMOVE_HEALTH)
11561 {
11562 AddHealth("","",-GetMaxHealth("","Health")/5);
11563 }
11564 else if (action_id ==
EActions.DESTROY_HEALTH)
11565 {
11566 SetHealth01("","",0);
11567 }
11568 else if (action_id ==
EActions.WATCH_ITEM)
11569 {
11571 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11572 #ifdef DEVELOPER
11573 SetDebugDeveloper_item(this);
11574 #endif
11575 }
11576
11577 else if (action_id ==
EActions.ADD_TEMPERATURE)
11578 {
11579 AddTemperature(20);
11580
11581 }
11582
11583 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11584 {
11585 AddTemperature(-20);
11586
11587 }
11588
11589 else if (action_id ==
EActions.FLIP_FROZEN)
11590 {
11591 SetFrozen(!GetIsFrozen());
11592
11593 }
11594
11595 else if (action_id ==
EActions.ADD_WETNESS)
11596 {
11598
11599 }
11600
11601 else if (action_id ==
EActions.REMOVE_WETNESS)
11602 {
11604
11605 }
11606
11607 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11608 {
11611
11612
11613 }
11614
11615 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11616 {
11619 }
11620
11621 else if (action_id ==
EActions.MAKE_SPECIAL)
11622 {
11623 auto debugParams = DebugSpawnParams.WithPlayer(player);
11624 OnDebugSpawnEx(debugParams);
11625 }
11626
11627 else if (action_id ==
EActions.DELETE)
11628 {
11629 Delete();
11630 }
11631
11632 }
11633
11634
11635 return false;
11636 }
11637
11638
11639
11640
11644
11647
11648
11649
11651 {
11652 return false;
11653 }
11654
11655
11657 {
11658 return true;
11659 }
11660
11661
11663 {
11664 return true;
11665 }
11666
11667
11668
11670 {
11671 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11673 }
11674
11677 {
11678 return null;
11679 }
11680
11682 {
11683 return false;
11684 }
11685
11687 {
11688 return false;
11689 }
11690
11694
11695
11697 {
11698 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11699 return module_repairing.CanRepair(this, item_repair_kit);
11700 }
11701
11702
11703 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11704 {
11705 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11706 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11707 }
11708
11709
11711 {
11712
11713
11714
11715
11716
11717
11718
11719
11720 return 1;
11721 }
11722
11723
11724
11726 {
11728 }
11729
11730
11731
11733 {
11735 }
11736
11737
11746 {
11747 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11748
11749 if (player)
11750 {
11751 player.MessageStatus(text);
11752 }
11753 }
11754
11755
11764 {
11765 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11766
11767 if (player)
11768 {
11769 player.MessageAction(text);
11770 }
11771 }
11772
11773
11782 {
11783 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11784
11785 if (player)
11786 {
11787 player.MessageFriendly(text);
11788 }
11789 }
11790
11791
11800 {
11801 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11802
11803 if (player)
11804 {
11805 player.MessageImportant(text);
11806 }
11807 }
11808
11810 {
11811 return true;
11812 }
11813
11814
11815 override bool KindOf(
string tag)
11816 {
11817 bool found = false;
11818 string item_name = this.
GetType();
11821
11822 int array_size = item_tag_array.Count();
11823 for (int i = 0; i < array_size; i++)
11824 {
11825 if (item_tag_array.Get(i) == tag)
11826 {
11827 found = true;
11828 break;
11829 }
11830 }
11831 return found;
11832 }
11833
11834
11836 {
11837
11838 super.OnRPC(sender, rpc_type,ctx);
11839
11840
11841 switch (rpc_type)
11842 {
11843 #ifndef SERVER
11844 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11845 Param2<bool, string> p = new Param2<bool, string>(false, "");
11846
11848 return;
11849
11850 bool play = p.param1;
11851 string soundSet = p.param2;
11852
11853 if (play)
11854 {
11856 {
11858 {
11860 }
11861 }
11862 else
11863 {
11865 }
11866 }
11867 else
11868 {
11870 }
11871
11872 break;
11873 #endif
11874
11875 }
11876
11878 {
11880 }
11881 }
11882
11883
11884
11885
11887 {
11888 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11889 return plugin.GetID(
name);
11890 }
11891
11893 {
11894 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11895 return plugin.GetName(id);
11896 }
11897
11900 {
11901
11902
11903 int varFlags;
11904 if (!ctx.
Read(varFlags))
11905 return;
11906
11907 if (varFlags & ItemVariableFlags.FLOAT)
11908 {
11910 }
11911 }
11912
11914 {
11915
11916 super.SerializeNumericalVars(floats_out);
11917
11918
11919
11921 {
11923 }
11924
11926 {
11928 }
11929
11931 {
11933 }
11934
11936 {
11941 }
11942
11944 {
11946 }
11947 }
11948
11950 {
11951
11952 super.DeSerializeNumericalVars(floats);
11953
11954
11955 int index = 0;
11956 int mask = Math.Round(floats.Get(index));
11957
11958 index++;
11959
11961 {
11963 {
11965 }
11966 else
11967 {
11968 float quantity = floats.Get(index);
11969 SetQuantity(quantity,
true,
false,
false,
false);
11970 }
11971 index++;
11972 }
11973
11975 {
11976 float wet = floats.Get(index);
11978 index++;
11979 }
11980
11982 {
11983 int liquidtype = Math.Round(floats.Get(index));
11985 index++;
11986 }
11987
11989 {
11991 index++;
11993 index++;
11995 index++;
11997 index++;
11998 }
11999
12001 {
12002 int cleanness = Math.Round(floats.Get(index));
12004 index++;
12005 }
12006 }
12007
12009 {
12010 super.WriteVarsToCTX(ctx);
12011
12012
12014 {
12016 }
12017
12019 {
12021 }
12022
12024 {
12026 }
12027
12029 {
12030 int r,g,b,a;
12036 }
12037
12039 {
12041 }
12042 }
12043
12045 {
12046 if (!super.ReadVarsFromCTX(ctx,version))
12047 return false;
12048
12049 int intValue;
12050 float value;
12051
12052 if (version < 140)
12053 {
12054 if (!ctx.
Read(intValue))
12055 return false;
12056
12057 m_VariablesMask = intValue;
12058 }
12059
12061 {
12062 if (!ctx.
Read(value))
12063 return false;
12064
12066 {
12068 }
12069 else
12070 {
12072 }
12073 }
12074
12075 if (version < 140)
12076 {
12078 {
12079 if (!ctx.
Read(value))
12080 return false;
12081 SetTemperatureDirect(value);
12082 }
12083 }
12084
12086 {
12087 if (!ctx.
Read(value))
12088 return false;
12090 }
12091
12093 {
12094 if (!ctx.
Read(intValue))
12095 return false;
12097 }
12098
12100 {
12101 int r,g,b,a;
12103 return false;
12105 return false;
12107 return false;
12109 return false;
12110
12112 }
12113
12115 {
12116 if (!ctx.
Read(intValue))
12117 return false;
12119 }
12120
12121 if (version >= 138 && version < 140)
12122 {
12124 {
12125 if (!ctx.
Read(intValue))
12126 return false;
12127 SetFrozen(intValue);
12128 }
12129 }
12130
12131 return true;
12132 }
12133
12134
12136 {
12139 {
12141 }
12142
12143 if (!super.OnStoreLoad(ctx, version))
12144 {
12146 return false;
12147 }
12148
12149 if (version >= 114)
12150 {
12151 bool hasQuickBarIndexSaved;
12152
12153 if (!ctx.
Read(hasQuickBarIndexSaved))
12154 {
12156 return false;
12157 }
12158
12159 if (hasQuickBarIndexSaved)
12160 {
12161 int itmQBIndex;
12162
12163
12164 if (!ctx.
Read(itmQBIndex))
12165 {
12167 return false;
12168 }
12169
12170 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12171 if (itmQBIndex != -1 && parentPlayer)
12172 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12173 }
12174 }
12175 else
12176 {
12177
12178 PlayerBase player;
12179 int itemQBIndex;
12180 if (version ==
int.
MAX)
12181 {
12182 if (!ctx.
Read(itemQBIndex))
12183 {
12185 return false;
12186 }
12187 }
12188 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12189 {
12190
12191 if (!ctx.
Read(itemQBIndex))
12192 {
12194 return false;
12195 }
12196 if (itemQBIndex != -1 && player)
12197 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12198 }
12199 }
12200
12201 if (version < 140)
12202 {
12203
12204 if (!LoadVariables(ctx, version))
12205 {
12207 return false;
12208 }
12209 }
12210
12211
12213 {
12215 return false;
12216 }
12217 if (version >= 132)
12218 {
12220 if (raib)
12221 {
12223 {
12225 return false;
12226 }
12227 }
12228 }
12229
12231 return true;
12232 }
12233
12234
12235
12237 {
12238 super.OnStoreSave(ctx);
12239
12240 PlayerBase player;
12241 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12242 {
12244
12245 int itemQBIndex = -1;
12246 itemQBIndex = player.FindQuickBarEntityIndex(this);
12247 ctx.
Write(itemQBIndex);
12248 }
12249 else
12250 {
12252 }
12253
12255
12257 if (raib)
12258 {
12260 }
12261 }
12262
12263
12265 {
12266 super.AfterStoreLoad();
12267
12269 {
12271 }
12272
12274 {
12277 }
12278 }
12279
12281 {
12282 super.EEOnAfterLoad();
12283
12285 {
12287 }
12288
12291 }
12292
12294 {
12295 return false;
12296 }
12297
12298
12299
12301 {
12303 {
12304 #ifdef PLATFORM_CONSOLE
12305
12307 {
12309 if (menu)
12310 {
12312 }
12313 }
12314 #endif
12315 }
12316
12318 {
12321 }
12322
12324 {
12325 SetWeightDirty();
12327 }
12329 {
12332 }
12333
12335 {
12338 }
12340 {
12343 }
12344
12345 super.OnVariablesSynchronized();
12346 }
12347
12348
12349
12351 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12352 {
12353 if (!IsServerCheck(allow_client))
12354 return false;
12355
12357 return false;
12358
12361
12362 if (value <= (min + 0.001))
12363 value = min;
12364
12365 if (value == min)
12366 {
12367 if (destroy_config)
12368 {
12369 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12370 if (dstr)
12371 {
12373 this.Delete();
12374 return true;
12375 }
12376 }
12377 else if (destroy_forced)
12378 {
12380 this.Delete();
12381 return true;
12382 }
12383
12385 }
12386
12389
12391 {
12393
12394 if (delta)
12396 }
12397
12399
12400 return false;
12401 }
12402
12403
12405 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12406 {
12408 }
12409
12411 {
12414 }
12415
12417 {
12420 }
12421
12424 {
12425 float value_clamped = Math.Clamp(value, 0, 1);
12427 SetQuantity(result, destroy_config, destroy_forced);
12428 }
12429
12430
12433 {
12435 }
12436
12438 {
12440 }
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12452 {
12453 int slot = -1;
12454 if (GetInventory())
12455 {
12456 InventoryLocation il = new InventoryLocation;
12457 GetInventory().GetCurrentInventoryLocation(il);
12459 }
12460
12462 }
12463
12465 {
12466 float quantity_max = 0;
12467
12469 {
12470 if (attSlotID != -1)
12471 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12472
12473 if (quantity_max <= 0)
12475 }
12476
12477 if (quantity_max <= 0)
12479
12480 return quantity_max;
12481 }
12482
12484 {
12486 }
12487
12489 {
12491 }
12492
12493
12495 {
12497 }
12498
12500 {
12502 }
12503
12505 {
12507 }
12508
12509
12511 {
12512
12513 float weightEx = GetWeightEx();
12514 float special = GetInventoryAndCargoWeight();
12515 return weightEx - special;
12516 }
12517
12518
12520 {
12522 }
12523
12525 {
12527 {
12528 #ifdef DEVELOPER
12529 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12530 {
12531 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12533 }
12534 #endif
12535
12536 return GetQuantity() * GetConfigWeightModified();
12537 }
12538 else if (HasEnergyManager())
12539 {
12540 #ifdef DEVELOPER
12541 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12542 {
12543 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12544 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12545 }
12546 #endif
12547 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12548 }
12549 else
12550 {
12551 #ifdef DEVELOPER
12552 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12553 {
12554 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12555 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12556 }
12557 #endif
12558 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12559 }
12560 }
12561
12564 {
12565 int item_count = 0;
12567
12568 if (GetInventory().GetCargo() != NULL)
12569 {
12570 item_count = GetInventory().GetCargo().GetItemCount();
12571 }
12572
12573 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12574 {
12575 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12576 if (item)
12577 item_count += item.GetNumberOfItems();
12578 }
12579 return item_count;
12580 }
12581
12584 {
12585 float weight = 0;
12586 float wetness = 1;
12587 if (include_wetness)
12590 {
12591 weight = wetness * m_ConfigWeight;
12592 }
12594 {
12595 weight = 1;
12596 }
12597 return weight;
12598 }
12599
12600
12601
12603 {
12604 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12605 {
12606 GameInventory inv = GetInventory();
12607 array<EntityAI> items = new array<EntityAI>;
12609 for (int i = 0; i < items.Count(); i++)
12610 {
12612 if (item)
12613 {
12615 }
12616 }
12617 }
12618 }
12619
12620
12621
12622
12624 {
12625 float energy = 0;
12626 if (HasEnergyManager())
12627 {
12628 energy = GetCompEM().GetEnergy();
12629 }
12630 return energy;
12631 }
12632
12633
12635 {
12636 super.OnEnergyConsumed();
12637
12639 }
12640
12642 {
12643 super.OnEnergyAdded();
12644
12646 }
12647
12648
12650 {
12651 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12652 {
12654 {
12655 float energy_0to1 = GetCompEM().GetEnergy0To1();
12657 }
12658 }
12659 }
12660
12661
12663 {
12664 return ConfigGetFloat("heatIsolation");
12665 }
12666
12668 {
12670 }
12671
12673 {
12674 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12675 if (
GetGame().ConfigIsExisting(paramPath))
12677
12678 return 0.0;
12679 }
12680
12682 {
12683 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12684 if (
GetGame().ConfigIsExisting(paramPath))
12686
12687 return 0.0;
12688 }
12689
12690 override void SetWet(
float value,
bool allow_client =
false)
12691 {
12692 if (!IsServerCheck(allow_client))
12693 return;
12694
12697
12699
12700 m_VarWet = Math.Clamp(value, min, max);
12701
12703 {
12706 }
12707 }
12708
12709 override void AddWet(
float value)
12710 {
12712 }
12713
12715 {
12717 }
12718
12720 {
12722 }
12723
12725 {
12727 }
12728
12730 {
12732 }
12733
12735 {
12737 }
12738
12739 override void OnWetChanged(
float newVal,
float oldVal)
12740 {
12743 if (newLevel != oldLevel)
12744 {
12746 }
12747 }
12748
12750 {
12751 SetWeightDirty();
12752 }
12753
12755 {
12756 return GetWetLevelInternal(
m_VarWet);
12757 }
12758
12759
12760
12762 {
12764 }
12765
12767 {
12769 }
12770
12772 {
12774 }
12775
12777 {
12779 }
12780
12781
12782
12784 {
12785 if (ConfigIsExisting("itemModelLength"))
12786 {
12787 return ConfigGetFloat("itemModelLength");
12788 }
12789 return 0;
12790 }
12791
12793 {
12794 if (ConfigIsExisting("itemAttachOffset"))
12795 {
12796 return ConfigGetFloat("itemAttachOffset");
12797 }
12798 return 0;
12799 }
12800
12801 override void SetCleanness(
int value,
bool allow_client =
false)
12802 {
12803 if (!IsServerCheck(allow_client))
12804 return;
12805
12807
12809
12812 }
12813
12815 {
12817 }
12818
12820 {
12821 return true;
12822 }
12823
12824
12825
12826
12828 {
12830 }
12831
12833 {
12835 }
12836
12837
12838
12839
12840 override void SetColor(
int r,
int g,
int b,
int a)
12841 {
12847 }
12849 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12850 {
12855 }
12856
12858 {
12860 }
12861
12864 {
12865 int r,g,b,a;
12867 r = r/255;
12868 g = g/255;
12869 b = b/255;
12870 a = a/255;
12871 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12872 }
12873
12874
12875
12876 override void SetLiquidType(
int value,
bool allow_client =
false)
12877 {
12878 if (!IsServerCheck(allow_client))
12879 return;
12880
12885 }
12886
12888 {
12889 return ConfigGetInt("varLiquidTypeInit");
12890 }
12891
12893 {
12895 }
12896
12898 {
12900 SetFrozen(false);
12901 }
12902
12905 {
12906 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12907 }
12908
12909
12912 {
12913 PlayerBase nplayer;
12914 if (PlayerBase.CastTo(nplayer, player))
12915 {
12917
12918 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12919 }
12920 }
12921
12922
12925 {
12926 PlayerBase nplayer;
12927 if (PlayerBase.CastTo(nplayer,player))
12928 {
12929
12930 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12931
12932 }
12933
12934
12935 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12936
12937
12938 if (HasEnergyManager())
12939 {
12940 GetCompEM().UpdatePlugState();
12941 }
12942 }
12943
12944
12946 {
12947 super.OnPlacementStarted(player);
12948
12950 }
12951
12952 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12953 {
12955 {
12956 m_AdminLog.OnPlacementComplete(player,
this);
12957 }
12958
12959 super.OnPlacementComplete(player, position, orientation);
12960 }
12961
12962
12963
12964
12965
12967 {
12969 {
12970 return true;
12971 }
12972 else
12973 {
12974 return false;
12975 }
12976 }
12977
12978
12980 {
12982 {
12984 }
12985 }
12986
12987
12989 {
12991 }
12992
12994 {
12996 }
12997
12998 override void InsertAgent(
int agent,
float count = 1)
12999 {
13000 if (count < 1)
13001 return;
13002
13004 }
13005
13008 {
13010 }
13011
13012
13014 {
13016 }
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13060 {
13062 return false;
13063 return true;
13064 }
13065
13067 {
13068
13070 }
13071
13072
13075 {
13076 super.CheckForRoofLimited(timeTresholdMS);
13077
13079 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13080 {
13081 m_PreviousRoofTestTime = time;
13082 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13083 }
13084 }
13085
13086
13088 {
13090 {
13091 return 0;
13092 }
13093
13094 if (GetInventory().GetAttachmentSlotsCount() != 0)
13095 {
13096 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13097 if (filter)
13098 return filter.GetProtectionLevel(type, false, system);
13099 else
13100 return 0;
13101 }
13102
13103 string subclassPath, entryName;
13104
13105 switch (type)
13106 {
13108 entryName = "biological";
13109 break;
13111 entryName = "chemical";
13112 break;
13113 default:
13114 entryName = "biological";
13115 break;
13116 }
13117
13118 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13119
13121 }
13122
13123
13124
13127 {
13128 if (!IsMagazine())
13130
13132 }
13133
13134
13135
13136
13137
13142 {
13143 return true;
13144 }
13145
13147 {
13149 }
13150
13151
13152
13153
13154
13156 {
13157 if (parent)
13158 {
13159 if (parent.IsInherited(DayZInfected))
13160 return true;
13161
13162 if (!parent.IsRuined())
13163 return true;
13164 }
13165
13166 return true;
13167 }
13168
13170 {
13171 if (!super.CanPutAsAttachment(parent))
13172 {
13173 return false;
13174 }
13175
13176 if (!IsRuined() && !parent.IsRuined())
13177 {
13178 return true;
13179 }
13180
13181 return false;
13182 }
13183
13185 {
13186
13187
13188
13189
13190 return super.CanReceiveItemIntoCargo(item);
13191 }
13192
13194 {
13195
13196
13197
13198
13199 GameInventory attachmentInv = attachment.GetInventory();
13201 {
13202 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13203 return false;
13204 }
13205
13206 InventoryLocation loc = new InventoryLocation();
13207 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13208 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13209 return false;
13210
13211 return super.CanReceiveAttachment(attachment, slotId);
13212 }
13213
13215 {
13216 if (!super.CanReleaseAttachment(attachment))
13217 return false;
13218
13219 return GetInventory().AreChildrenAccessible();
13220 }
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13243 {
13244 int id = muzzle_owner.GetMuzzleID();
13245 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13246
13247 if (WPOF_array)
13248 {
13249 for (int i = 0; i < WPOF_array.Count(); i++)
13250 {
13251 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13252
13253 if (WPOF)
13254 {
13255 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13256 }
13257 }
13258 }
13259 }
13260
13261
13263 {
13264 int id = muzzle_owner.GetMuzzleID();
13266
13267 if (WPOBE_array)
13268 {
13269 for (int i = 0; i < WPOBE_array.Count(); i++)
13270 {
13271 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13272
13273 if (WPOBE)
13274 {
13275 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13276 }
13277 }
13278 }
13279 }
13280
13281
13283 {
13284 int id = muzzle_owner.GetMuzzleID();
13285 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13286
13287 if (WPOOH_array)
13288 {
13289 for (int i = 0; i < WPOOH_array.Count(); i++)
13290 {
13291 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13292
13293 if (WPOOH)
13294 {
13295 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13296 }
13297 }
13298 }
13299 }
13300
13301
13303 {
13304 int id = muzzle_owner.GetMuzzleID();
13305 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13306
13307 if (WPOOH_array)
13308 {
13309 for (int i = 0; i < WPOOH_array.Count(); i++)
13310 {
13311 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13312
13313 if (WPOOH)
13314 {
13315 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13316 }
13317 }
13318 }
13319 }
13320
13321
13323 {
13324 int id = muzzle_owner.GetMuzzleID();
13325 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13326
13327 if (WPOOH_array)
13328 {
13329 for (int i = 0; i < WPOOH_array.Count(); i++)
13330 {
13331 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13332
13333 if (WPOOH)
13334 {
13335 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13336 }
13337 }
13338 }
13339 }
13340
13341
13342
13344 {
13346 {
13347 return true;
13348 }
13349
13350 return false;
13351 }
13352
13354 {
13356 {
13357 return true;
13358 }
13359
13360 return false;
13361 }
13362
13364 {
13366 {
13367 return true;
13368 }
13369
13370 return false;
13371 }
13372
13374 {
13375 return false;
13376 }
13377
13380 {
13381 return UATimeSpent.DEFAULT_DEPLOY;
13382 }
13383
13384
13385
13386
13388 {
13390 SetSynchDirty();
13391 }
13392
13394 {
13396 }
13397
13398
13400 {
13401 return false;
13402 }
13403
13406 {
13407 string att_type = "None";
13408
13409 if (ConfigIsExisting("soundAttType"))
13410 {
13411 att_type = ConfigGetString("soundAttType");
13412 }
13413
13415 }
13416
13418 {
13420 }
13421
13422
13423
13424
13425
13429
13431 {
13434
13436 }
13437
13438
13440 {
13442 return;
13443
13445
13448
13451
13452 SoundParameters params = new SoundParameters();
13456 }
13457
13458
13460 {
13462 return;
13463
13465 SetSynchDirty();
13466
13469 }
13470
13471
13473 {
13475 return;
13476
13478 SetSynchDirty();
13479
13482 }
13483
13485 {
13487 }
13488
13490 {
13492 }
13493
13496 {
13497 if (!
GetGame().IsDedicatedServer())
13498 {
13499 if (ConfigIsExisting("attachSoundSet"))
13500 {
13501 string cfg_path = "";
13502 string soundset = "";
13503 string type_name =
GetType();
13504
13507 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13508 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13509
13510 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13511 {
13512 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13513 {
13514 if (cfg_slot_array[i] == slot_type)
13515 {
13516 soundset = cfg_soundset_array[i];
13517 break;
13518 }
13519 }
13520 }
13521
13522 if (soundset != "")
13523 {
13524 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13526 }
13527 }
13528 }
13529 }
13530
13532 {
13533
13534 }
13535
13536 void OnApply(PlayerBase player);
13537
13539 {
13540 return 1.0;
13541 };
13542
13544 {
13546 }
13547
13549 {
13551 }
13552
13554
13556 {
13557 SetDynamicPhysicsLifeTime(0.01);
13559 }
13560
13562 {
13563 array<string> zone_names = new array<string>;
13564 GetDamageZones(zone_names);
13565 for (int i = 0; i < zone_names.Count(); i++)
13566 {
13567 SetHealthMax(zone_names.Get(i),"Health");
13568 }
13569 SetHealthMax("","Health");
13570 }
13571
13574 {
13575 float global_health = GetHealth01("","Health");
13576 array<string> zones = new array<string>;
13577 GetDamageZones(zones);
13578
13579 for (int i = 0; i < zones.Count(); i++)
13580 {
13581 SetHealth01(zones.Get(i),"Health",global_health);
13582 }
13583 }
13584
13587 {
13588 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13589 }
13590
13592 {
13593 if (!hasRootAsPlayer)
13594 {
13595 if (refParentIB)
13596 {
13597
13598 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13599 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13600
13601 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13602 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13603
13606 }
13607 else
13608 {
13609
13612 }
13613 }
13614 }
13615
13617 {
13619 {
13620 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13621 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13622 {
13623 float heatPermCoef = 1.0;
13625 while (ent)
13626 {
13627 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13628 ent = ent.GetHierarchyParent();
13629 }
13630
13631 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13632 }
13633 }
13634 }
13635
13637 {
13638
13639 EntityAI parent = GetHierarchyParent();
13640 if (!parent)
13641 {
13642 hasParent = false;
13643 hasRootAsPlayer = false;
13644 }
13645 else
13646 {
13647 hasParent = true;
13648 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13649 refParentIB =
ItemBase.Cast(parent);
13650 }
13651 }
13652
13653 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13654 {
13655
13656 }
13657
13659 {
13660
13661 return false;
13662 }
13663
13665 {
13666
13667
13668 return false;
13669 }
13670
13672 {
13673
13674 return false;
13675 }
13676
13679 {
13680 return !GetIsFrozen() &&
IsOpen();
13681 }
13682
13684 {
13685 bool hasParent = false, hasRootAsPlayer = false;
13687
13688 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13689 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13690
13691 if (wwtu || foodDecay)
13692 {
13696
13697 if (processWetness || processTemperature || processDecay)
13698 {
13700
13701 if (processWetness)
13702 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13703
13704 if (processTemperature)
13706
13707 if (processDecay)
13708 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13709 }
13710 }
13711 }
13712
13715 {
13717 }
13718
13720 {
13723
13724 return super.GetTemperatureFreezeThreshold();
13725 }
13726
13728 {
13731
13732 return super.GetTemperatureThawThreshold();
13733 }
13734
13736 {
13739
13740 return super.GetItemOverheatThreshold();
13741 }
13742
13744 {
13746 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13747
13748 return super.GetTemperatureFreezeTime();
13749 }
13750
13752 {
13754 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13755
13756 return super.GetTemperatureThawTime();
13757 }
13758
13763
13765 {
13766 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13767 }
13768
13770 {
13771 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13772 }
13773
13776 {
13778 }
13779
13781 {
13783 }
13784
13786 {
13788 }
13789
13792 {
13793 return null;
13794 }
13795
13798 {
13799 return false;
13800 }
13801
13803 {
13805 {
13808 if (!trg)
13809 {
13811 explosive = this;
13812 }
13813
13814 explosive.PairRemote(trg);
13816
13817 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13818 trg.SetPersistentPairID(persistentID);
13819 explosive.SetPersistentPairID(persistentID);
13820
13821 return true;
13822 }
13823 return false;
13824 }
13825
13828 {
13829 float ret = 1.0;
13832 ret *= GetHealth01();
13833
13834 return ret;
13835 }
13836
13837 #ifdef DEVELOPER
13838 override void SetDebugItem()
13839 {
13840 super.SetDebugItem();
13841 _itemBase = this;
13842 }
13843
13845 {
13846 string text = super.GetDebugText();
13847
13849 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13850
13851 return text;
13852 }
13853 #endif
13854
13856 {
13857 return true;
13858 }
13859
13861
13863
13865 {
13868 }
13869
13870
13878
13894}
13895
13897{
13899 if (entity)
13900 {
13901 bool is_item = entity.IsInherited(
ItemBase);
13902 if (is_item && full_quantity)
13903 {
13906 }
13907 }
13908 else
13909 {
13911 return NULL;
13912 }
13913 return entity;
13914}
13915
13917{
13918 if (item)
13919 {
13920 if (health > 0)
13921 item.SetHealth("", "", health);
13922
13923 if (item.CanHaveTemperature())
13924 {
13926 if (item.CanFreeze())
13927 item.SetFrozen(false);
13928 }
13929
13930 if (item.HasEnergyManager())
13931 {
13932 if (quantity >= 0)
13933 {
13934 item.GetCompEM().SetEnergy0To1(quantity);
13935 }
13936 else
13937 {
13939 }
13940 }
13941 else if (item.IsMagazine())
13942 {
13943 Magazine mag = Magazine.Cast(item);
13944 if (quantity >= 0)
13945 {
13946 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13947 }
13948 else
13949 {
13951 }
13952
13953 }
13954 else
13955 {
13956 if (quantity >= 0)
13957 {
13958 item.SetQuantityNormalized(quantity, false);
13959 }
13960 else
13961 {
13963 }
13964
13965 }
13966 }
13967}
13968
13969#ifdef DEVELOPER
13971#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.