9148{
9150 {
9151 return true;
9152 }
9153};
9154
9155
9156
9158{
9162
9164
9167
9168
9169
9170
9171
9180
9186
9191
9196
9217 protected bool m_IsResultOfSplit
9218
9220
9225
9226
9227
9229
9233
9234
9235
9237
9240
9241
9242
9248
9249
9257
9260
9261
9263
9264
9266
9267
9272
9273
9278
9279
9281
9282
9284 {
9289
9290 if (!
GetGame().IsDedicatedServer())
9291 {
9293 {
9295
9297 {
9299 }
9300 }
9301
9304 }
9305
9306 m_OldLocation = null;
9307
9309 {
9311 }
9312
9313 if (ConfigIsExisting("headSelectionsToHide"))
9314 {
9317 }
9318
9320 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9321 {
9323 }
9324
9326
9327 m_IsResultOfSplit = false;
9328
9330 }
9331
9333 {
9334 super.InitItemVariables();
9335
9341 m_Count = ConfigGetInt(
"count");
9342
9345
9350
9353
9358
9370
9374
9375
9378 if (ConfigIsExisting("canBeSplit"))
9379 {
9382 }
9383
9385 if (ConfigIsExisting("itemBehaviour"))
9387
9388
9391 RegisterNetSyncVariableInt("m_VarLiquidType");
9392 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9393
9394 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9395 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9396 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9397
9398 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9399 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9400 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9401 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9402
9403 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9404 RegisterNetSyncVariableBool("m_IsTakeable");
9405 RegisterNetSyncVariableBool("m_IsHologram");
9406
9409 {
9412 }
9413
9415
9417 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9419
9420 }
9421
9423 {
9425 }
9426
9428 {
9431 {
9436 }
9437 }
9438
9439 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9440 {
9442 {
9445 }
9446
9448 }
9449
9451 {
9457 }
9458
9460
9462 {
9464
9465 if (!action)
9466 {
9467 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9468 return;
9469 }
9470
9472 if (!ai)
9473 {
9475 return;
9476 }
9477
9479 if (!action_array)
9480 {
9481 action_array = new array<ActionBase_Basic>;
9483 }
9484 if (LogManager.IsActionLogEnable())
9485 {
9486 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9487 }
9488
9489 if (action_array.Find(action) != -1)
9490 {
9491 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9492 }
9493 else
9494 {
9495 action_array.Insert(action);
9496 }
9497 }
9498
9500 {
9502 ActionBase action = player.GetActionManager().GetAction(actionName);
9505
9506 if (action_array)
9507 {
9508 action_array.RemoveItem(action);
9509 }
9510 }
9511
9512
9513
9515 {
9516 ActionOverrideData overrideData = new ActionOverrideData();
9520
9522 if (!actionMap)
9523 {
9526 }
9527
9528 actionMap.Insert(this.
Type(), overrideData);
9529
9530 }
9531
9533
9535
9536
9538 {
9541
9544
9545 string config_to_search = "CfgVehicles";
9546 string muzzle_owner_config;
9547
9549 {
9550 if (IsInherited(Weapon))
9551 config_to_search = "CfgWeapons";
9552
9553 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9554
9555 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9556
9558
9559 if (config_OnFire_subclass_count > 0)
9560 {
9561 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9562
9563 for (int i = 0; i < config_OnFire_subclass_count; i++)
9564 {
9565 string particle_class = "";
9567 string config_OnFire_entry = config_OnFire_class + particle_class;
9568 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9569 WPOF_array.Insert(WPOF);
9570 }
9571
9572
9574 }
9575 }
9576
9578 {
9579 config_to_search = "CfgWeapons";
9580 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9581
9582 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9583
9585
9586 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9587 {
9588 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9589
9590 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9591 {
9592 string particle_class2 = "";
9594 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9595 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9596 WPOBE_array.Insert(WPOBE);
9597 }
9598
9599
9601 }
9602 }
9603 }
9604
9605
9607 {
9610
9612 {
9613 string config_to_search = "CfgVehicles";
9614
9615 if (IsInherited(Weapon))
9616 config_to_search = "CfgWeapons";
9617
9618 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9619 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9620
9621 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9622 {
9623
9625
9627 {
9629 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9631 return;
9632 }
9633
9636
9637
9638
9640 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9641
9642 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9643 {
9644 string particle_class = "";
9646 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9648
9649 if (entry_type == CT_CLASS)
9650 {
9651 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9652 WPOOH_array.Insert(WPOF);
9653 }
9654 }
9655
9656
9658 }
9659 }
9660 }
9661
9663 {
9665 }
9666
9668 {
9670 {
9672
9675
9678
9679 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9680 }
9681 }
9682
9684 {
9686 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9687
9689 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9690
9692 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9693
9695 {
9697 }
9698 }
9699
9701 {
9703 }
9704
9706 {
9709 else
9711
9713 {
9716 }
9717 else
9718 {
9721
9724 }
9725
9727 }
9728
9730 {
9732 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9733 }
9734
9736 {
9738 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9740 }
9741
9743 {
9745 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9746 }
9747
9749 {
9752
9753 OverheatingParticle OP = new OverheatingParticle();
9758
9760 }
9761
9763 {
9766
9767 return -1;
9768 }
9769
9771 {
9773 {
9776
9777 for (int i = count; i > 0; --i)
9778 {
9779 int id = i - 1;
9782
9785
9786 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9787 {
9788 if (p)
9789 {
9792 }
9793 }
9794 }
9795 }
9796 }
9797
9799 {
9801 {
9803 {
9804 int id = i - 1;
9806
9807 if (OP)
9808 {
9810
9811 if (p)
9812 {
9814 }
9815
9816 delete OP;
9817 }
9818 }
9819
9822 }
9823 }
9824
9827 {
9828 return 0.0;
9829 }
9830
9831
9833 {
9834 return 250;
9835 }
9836
9838 {
9839 return 0;
9840 }
9841
9844 {
9846 return true;
9847
9848 return false;
9849 }
9850
9853 {
9856
9858 {
9860 }
9861 else
9862 {
9863
9865 }
9866
9868 }
9869
9876 {
9877 return -1;
9878 }
9879
9880
9881
9882
9884 {
9886 {
9888 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9889
9890 if (r_index >= 0)
9891 {
9892 InventoryLocation r_il = new InventoryLocation;
9893 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9894
9895 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9898 {
9899 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9900 }
9902 {
9903 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9904 }
9905
9906 }
9907
9908 player.GetHumanInventory().ClearUserReservedLocation(this);
9909 }
9910
9913 }
9914
9915
9916
9917
9919 {
9920 return ItemBase.m_DebugActionsMask;
9921 }
9922
9924 {
9925 return ItemBase.m_DebugActionsMask & mask;
9926 }
9927
9929 {
9930 ItemBase.m_DebugActionsMask = mask;
9931 }
9932
9934 {
9935 ItemBase.m_DebugActionsMask |= mask;
9936 }
9937
9939 {
9940 ItemBase.m_DebugActionsMask &= ~mask;
9941 }
9942
9944 {
9946 {
9948 }
9949 else
9950 {
9952 }
9953 }
9954
9955
9957 {
9958 if (GetEconomyProfile())
9959 {
9960 float q_max = GetEconomyProfile().GetQuantityMax();
9961 if (q_max > 0)
9962 {
9963 float q_min = GetEconomyProfile().GetQuantityMin();
9964 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9965
9967 {
9968 ComponentEnergyManager comp = GetCompEM();
9970 {
9972 }
9973 }
9975 {
9977
9978 }
9979
9980 }
9981 }
9982 }
9983
9986 {
9987 EntityAI parent = GetHierarchyParent();
9988
9989 if (parent)
9990 {
9991 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9992 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9993 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9994 }
9995 }
9996
9999 {
10000 EntityAI parent = GetHierarchyParent();
10001
10002 if (parent)
10003 {
10004 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10005 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10006 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10007 }
10008 }
10009
10011 {
10012
10013
10014
10015
10017
10019 {
10020 if (ScriptInputUserData.CanStoreInputUserData())
10021 {
10022 ScriptInputUserData ctx = new ScriptInputUserData;
10028 ctx.
Write(use_stack_max);
10031
10033 {
10034 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10035 }
10036 }
10037 }
10038 else if (!
GetGame().IsMultiplayer())
10039 {
10041 }
10042 }
10043
10045 {
10047 }
10048
10050 {
10052 }
10053
10055 {
10057 }
10058
10060 {
10061
10062 return false;
10063 }
10064
10066 {
10067 return false;
10068 }
10069
10073 {
10074 return false;
10075 }
10076
10078 {
10079 return "";
10080 }
10081
10083
10085 {
10086 return false;
10087 }
10088
10090 {
10091 return true;
10092 }
10093
10094
10095
10097 {
10098 return true;
10099 }
10100
10102 {
10103 return true;
10104 }
10105
10107 {
10108 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10110 }
10111
10113 {
10115 }
10116
10118 {
10120 if (!is_being_placed)
10122 SetSynchDirty();
10123 }
10124
10125
10127
10129 {
10131 }
10132
10134 {
10136 }
10137
10139 {
10140 return 1;
10141 }
10142
10144 {
10145 return false;
10146 }
10147
10149 {
10151 SetSynchDirty();
10152 }
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10189 {
10190 super.OnMovedInsideCargo(container);
10191
10192 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10193 }
10194
10195 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10196 {
10197 super.EEItemLocationChanged(oldLoc,newLoc);
10198
10199 PlayerBase new_player = null;
10200 PlayerBase old_player = null;
10201
10202 if (newLoc.GetParent())
10203 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10204
10205 if (oldLoc.GetParent())
10206 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10207
10209 {
10210 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10211
10212 if (r_index >= 0)
10213 {
10214 InventoryLocation r_il = new InventoryLocation;
10215 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10216
10217 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10220 {
10221 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10222 }
10224 {
10225 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10226 }
10227
10228 }
10229 }
10230
10232 {
10233 if (new_player)
10234 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10235
10236 if (new_player == old_player)
10237 {
10238
10239 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10240 {
10242 {
10243 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10244 {
10245 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10246 }
10247 }
10248 else
10249 {
10250 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10251 }
10252 }
10253
10254 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10255 {
10256 int type = oldLoc.GetType();
10258 {
10259 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10260 }
10262 {
10263 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10264 }
10265 }
10266 if (!m_OldLocation)
10267 {
10268 m_OldLocation = new InventoryLocation;
10269 }
10270 m_OldLocation.Copy(oldLoc);
10271 }
10272 else
10273 {
10274 if (m_OldLocation)
10275 {
10276 m_OldLocation.Reset();
10277 }
10278 }
10279
10281 }
10282 else
10283 {
10284 if (new_player)
10285 {
10286 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10287 if (res_index >= 0)
10288 {
10289 InventoryLocation il = new InventoryLocation;
10290 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10292 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10295 {
10296 il.
GetParent().GetOnReleaseLock().Invoke(it);
10297 }
10299 {
10301 }
10302
10303 }
10304 }
10306 {
10307
10309 }
10310
10311 if (m_OldLocation)
10312 {
10313 m_OldLocation.Reset();
10314 }
10315 }
10316 }
10317
10318 override void EOnContact(IEntity other, Contact extra)
10319 {
10321 {
10322 int liquidType = -1;
10324 if (impactSpeed > 0.0)
10325 {
10327 #ifndef SERVER
10329 #else
10331 SetSynchDirty();
10332 #endif
10334 }
10335 }
10336
10337 #ifdef SERVER
10338 if (GetCompEM() && GetCompEM().IsPlugged())
10339 {
10340 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10341 GetCompEM().UnplugThis();
10342 }
10343 #endif
10344 }
10345
10347
10349 {
10351 }
10352
10354 {
10355
10356 }
10357
10359 {
10360 super.OnItemLocationChanged(old_owner, new_owner);
10361
10362 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10363 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10364
10365 if (!relatedPlayer && playerNew)
10366 relatedPlayer = playerNew;
10367
10368 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10369 {
10371 if (actionMgr)
10372 {
10373 ActionBase currentAction = actionMgr.GetRunningAction();
10374 if (currentAction)
10376 }
10377 }
10378
10379 Man ownerPlayerOld = null;
10380 Man ownerPlayerNew = null;
10381
10382 if (old_owner)
10383 {
10384 if (old_owner.
IsMan())
10385 {
10386 ownerPlayerOld = Man.Cast(old_owner);
10387 }
10388 else
10389 {
10390 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10391 }
10392 }
10393 else
10394 {
10396 {
10398
10399 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10400 {
10401 GetCompEM().UnplugThis();
10402 }
10403 }
10404 }
10405
10406 if (new_owner)
10407 {
10408 if (new_owner.
IsMan())
10409 {
10410 ownerPlayerNew = Man.Cast(new_owner);
10411 }
10412 else
10413 {
10414 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10415 }
10416 }
10417
10418 if (ownerPlayerOld != ownerPlayerNew)
10419 {
10420 if (ownerPlayerOld)
10421 {
10422 array<EntityAI> subItemsExit = new array<EntityAI>;
10424 for (int i = 0; i < subItemsExit.Count(); i++)
10425 {
10428 }
10429 }
10430
10431 if (ownerPlayerNew)
10432 {
10433 array<EntityAI> subItemsEnter = new array<EntityAI>;
10435 for (int j = 0; j < subItemsEnter.Count(); j++)
10436 {
10439 }
10440 }
10441 }
10442 else if (ownerPlayerNew != null)
10443 {
10444 PlayerBase nplayer;
10445 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10446 {
10447 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10449 for (int k = 0; k < subItemsUpdate.Count(); k++)
10450 {
10452 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10453 }
10454 }
10455 }
10456
10457 if (old_owner)
10458 old_owner.OnChildItemRemoved(this);
10459 if (new_owner)
10460 new_owner.OnChildItemReceived(this);
10461 }
10462
10463
10465 {
10466 super.EEDelete(parent);
10467 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10468 if (player)
10469 {
10471
10472 if (player.IsAlive())
10473 {
10474 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10475 if (r_index >= 0)
10476 {
10477 InventoryLocation r_il = new InventoryLocation;
10478 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10479
10480 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10483 {
10484 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10485 }
10487 {
10488 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10489 }
10490
10491 }
10492
10493 player.RemoveQuickBarEntityShortcut(this);
10494 }
10495 }
10496 }
10497
10499 {
10500 super.EEKilled(killer);
10501
10504 {
10505 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10506 {
10507 if (IsMagazine())
10508 {
10509 if (Magazine.Cast(this).GetAmmoCount() > 0)
10510 {
10512 }
10513 }
10514 else
10515 {
10517 }
10518 }
10519 }
10520 }
10521
10523 {
10524 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10525
10526 super.OnWasAttached(parent, slot_id);
10527
10530
10532 }
10533
10535 {
10536 super.OnWasDetached(parent, slot_id);
10537
10540 }
10541
10543 {
10544 int idx;
10547
10548 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10549 if (inventory_slots.Count() < 1)
10550 {
10551 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10552 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10553 }
10554 else
10555 {
10556 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10557 }
10558
10559 idx = inventory_slots.Find(slot);
10560 if (idx < 0)
10561 return "";
10562
10563 return attach_types.Get(idx);
10564 }
10565
10567 {
10568 int idx = -1;
10569 string slot;
10570
10573
10574 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10575 if (inventory_slots.Count() < 1)
10576 {
10577 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10578 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10579 }
10580 else
10581 {
10582 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10583 if (detach_types.Count() < 1)
10584 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10585 }
10586
10587 for (int i = 0; i < inventory_slots.Count(); i++)
10588 {
10589 slot = inventory_slots.Get(i);
10590 }
10591
10592 if (slot != "")
10593 {
10594 if (detach_types.Count() == 1)
10595 idx = 0;
10596 else
10597 idx = inventory_slots.Find(slot);
10598 }
10599 if (idx < 0)
10600 return "";
10601
10602 return detach_types.Get(idx);
10603 }
10604
10606 {
10607
10609
10610
10611 float min_time = 1;
10612 float max_time = 3;
10613 float delay = Math.RandomFloat(min_time, max_time);
10614
10615 explode_timer.Run(delay, this, "DoAmmoExplosion");
10616 }
10617
10619 {
10620 Magazine magazine = Magazine.Cast(this);
10621 int pop_sounds_count = 6;
10622 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10623
10624
10625 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10626 string sound_name = pop_sounds[ sound_idx ];
10628
10629
10630 magazine.ServerAddAmmoCount(-1);
10631
10632
10633 float min_temp_to_explode = 100;
10634
10635 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10636 {
10638 }
10639 }
10640
10641
10642 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10643 {
10644 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10645
10646 const int CHANCE_DAMAGE_CARGO = 4;
10647 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10648 const int CHANCE_DAMAGE_NOTHING = 2;
10649
10651 {
10652 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10653 int chances;
10654 int rnd;
10655
10656 if (GetInventory().GetCargo())
10657 {
10658 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10659 rnd = Math.RandomInt(0,chances);
10660
10661 if (rnd < CHANCE_DAMAGE_CARGO)
10662 {
10664 }
10665 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10666 {
10668 }
10669 }
10670 else
10671 {
10672 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10673 rnd = Math.RandomInt(0,chances);
10674
10675 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10676 {
10678 }
10679 }
10680 }
10681 }
10682
10684 {
10685 if (GetInventory().GetCargo())
10686 {
10687 int item_count = GetInventory().GetCargo().GetItemCount();
10688 if (item_count > 0)
10689 {
10690 int random_pick = Math.RandomInt(0, item_count);
10692 if (!item.IsExplosive())
10693 {
10694 item.AddHealth("","",damage);
10695 return true;
10696 }
10697 }
10698 }
10699 return false;
10700 }
10701
10703 {
10704 int attachment_count = GetInventory().AttachmentCount();
10705 if (attachment_count > 0)
10706 {
10707 int random_pick = Math.RandomInt(0, attachment_count);
10708 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10709 if (!attachment.IsExplosive())
10710 {
10711 attachment.AddHealth("","",damage);
10712 return true;
10713 }
10714 }
10715 return false;
10716 }
10717
10719 {
10721 }
10722
10724 {
10726 return GetInventory().CanRemoveEntity();
10727
10728 return false;
10729 }
10730
10732 {
10734 return;
10735
10737 {
10738 if (ScriptInputUserData.CanStoreInputUserData())
10739 {
10740 ScriptInputUserData ctx = new ScriptInputUserData;
10745 ctx.
Write(destination_entity);
10747 ctx.
Write(slot_id);
10749 }
10750 }
10751 else if (!
GetGame().IsMultiplayer())
10752 {
10754 }
10755 }
10756
10758 {
10760 return;
10761
10762 float split_quantity_new;
10766 InventoryLocation loc = new InventoryLocation;
10767
10768 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10769 {
10771 split_quantity_new = stack_max;
10772 else
10774
10775 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10776 if (new_item)
10777 {
10778 new_item.SetResultOfSplit(true);
10779 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10781 new_item.SetQuantity(split_quantity_new);
10782 }
10783 }
10784 else if (destination_entity && slot_id == -1)
10785 {
10786 if (quantity > stack_max)
10787 split_quantity_new = stack_max;
10788 else
10789 split_quantity_new = quantity;
10790
10792 {
10795 }
10796
10797 if (new_item)
10798 {
10799 new_item.SetResultOfSplit(true);
10800 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10802 new_item.SetQuantity(split_quantity_new);
10803 }
10804 }
10805 else
10806 {
10807 if (stack_max != 0)
10808 {
10810 {
10812 }
10813
10814 if (split_quantity_new == 0)
10815 {
10816 if (!
GetGame().IsMultiplayer())
10817 player.PhysicalPredictiveDropItem(this);
10818 else
10819 player.ServerDropEntity(this);
10820 return;
10821 }
10822
10824
10825 if (new_item)
10826 {
10827 new_item.SetResultOfSplit(true);
10828 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10830 new_item.SetQuantity(stack_max);
10831 new_item.PlaceOnSurface();
10832 }
10833 }
10834 }
10835 }
10836
10838 {
10840 return;
10841
10842 float split_quantity_new;
10846 InventoryLocation loc = new InventoryLocation;
10847
10848 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10849 {
10851 split_quantity_new = stack_max;
10852 else
10854
10855 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10856 if (new_item)
10857 {
10858 new_item.SetResultOfSplit(true);
10859 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10861 new_item.SetQuantity(split_quantity_new);
10862 }
10863 }
10864 else if (destination_entity && slot_id == -1)
10865 {
10866 if (quantity > stack_max)
10867 split_quantity_new = stack_max;
10868 else
10869 split_quantity_new = quantity;
10870
10872 {
10875 }
10876
10877 if (new_item)
10878 {
10879 new_item.SetResultOfSplit(true);
10880 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10882 new_item.SetQuantity(split_quantity_new);
10883 }
10884 }
10885 else
10886 {
10887 if (stack_max != 0)
10888 {
10890 {
10892 }
10893
10895
10896 if (new_item)
10897 {
10898 new_item.SetResultOfSplit(true);
10899 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10901 new_item.SetQuantity(stack_max);
10902 new_item.PlaceOnSurface();
10903 }
10904 }
10905 }
10906 }
10907
10909 {
10911 return;
10912
10914 {
10915 if (ScriptInputUserData.CanStoreInputUserData())
10916 {
10917 ScriptInputUserData ctx = new ScriptInputUserData;
10922 dst.WriteToContext(ctx);
10924 }
10925 }
10926 else if (!
GetGame().IsMultiplayer())
10927 {
10929 }
10930 }
10931
10933 {
10935 return;
10936
10938 {
10939 if (ScriptInputUserData.CanStoreInputUserData())
10940 {
10941 ScriptInputUserData ctx = new ScriptInputUserData;
10946 ctx.
Write(destination_entity);
10952 }
10953 }
10954 else if (!
GetGame().IsMultiplayer())
10955 {
10957 }
10958 }
10959
10961 {
10963 }
10964
10966 {
10968 return this;
10969
10971 float split_quantity_new;
10973 if (dst.IsValid())
10974 {
10975 int slot_id = dst.GetSlot();
10977
10978 if (quantity > stack_max)
10979 split_quantity_new = stack_max;
10980 else
10981 split_quantity_new = quantity;
10982
10984
10985 if (new_item)
10986 {
10987 new_item.SetResultOfSplit(true);
10988 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10991 }
10992
10993 return new_item;
10994 }
10995
10996 return null;
10997 }
10998
11000 {
11002 return;
11003
11005 float split_quantity_new;
11007 if (destination_entity)
11008 {
11010 if (quantity > stackable)
11011 split_quantity_new = stackable;
11012 else
11013 split_quantity_new = quantity;
11014
11015 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11016 if (new_item)
11017 {
11018 new_item.SetResultOfSplit(true);
11019 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11021 new_item.SetQuantity(split_quantity_new);
11022 }
11023 }
11024 }
11025
11027 {
11029 return;
11030
11032 {
11033 if (ScriptInputUserData.CanStoreInputUserData())
11034 {
11035 ScriptInputUserData ctx = new ScriptInputUserData;
11040 ItemBase destination_entity =
this;
11041 ctx.
Write(destination_entity);
11045 }
11046 }
11047 else if (!
GetGame().IsMultiplayer())
11048 {
11050 }
11051 }
11052
11054 {
11056 return;
11057
11059 float split_quantity_new;
11061 if (player)
11062 {
11064 if (quantity > stackable)
11065 split_quantity_new = stackable;
11066 else
11067 split_quantity_new = quantity;
11068
11069 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11070 new_item =
ItemBase.Cast(in_hands);
11071 if (new_item)
11072 {
11073 new_item.SetResultOfSplit(true);
11074 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11076 new_item.SetQuantity(split_quantity_new);
11077 }
11078 }
11079 }
11080
11082 {
11084 return;
11085
11087 float split_quantity_new = Math.Floor(quantity * 0.5);
11088
11090
11091 if (new_item)
11092 {
11093 if (new_item.GetQuantityMax() < split_quantity_new)
11094 {
11095 split_quantity_new = new_item.GetQuantityMax();
11096 }
11097
11098 new_item.SetResultOfSplit(true);
11099 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11100
11102 {
11105 }
11106 else
11107 {
11110 }
11111 }
11112 }
11113
11115 {
11117 return;
11118
11120 float split_quantity_new = Math.Floor(quantity / 2);
11121
11122 InventoryLocation invloc = new InventoryLocation;
11124
11126 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11127
11128 if (new_item)
11129 {
11130 if (new_item.GetQuantityMax() < split_quantity_new)
11131 {
11132 split_quantity_new = new_item.GetQuantityMax();
11133 }
11135 {
11138 }
11139 else
11140 {
11143 }
11144 }
11145 }
11146
11149 {
11150 SetWeightDirty();
11152
11153 if (parent)
11154 parent.OnAttachmentQuantityChangedEx(this, delta);
11155
11157 {
11159 {
11161 }
11163 {
11164 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11166 }
11167 }
11168
11169 }
11170
11173 {
11174
11175 }
11176
11179 {
11181 }
11182
11184 {
11185 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11186
11188 {
11189 if (newLevel == GameConstants.STATE_RUINED)
11190 {
11192 EntityAI parent = GetHierarchyParent();
11193 if (parent && parent.IsFireplace())
11194 {
11195 CargoBase cargo = GetInventory().GetCargo();
11196 if (cargo)
11197 {
11199 {
11201 }
11202 }
11203 }
11204 }
11205
11207 {
11208
11210 return;
11211 }
11212
11213 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11214 {
11216 }
11217 }
11218 }
11219
11220
11222 {
11223 super.OnRightClick();
11224
11226 {
11228 {
11229 if (ScriptInputUserData.CanStoreInputUserData())
11230 {
11231 vector m4[4];
11233
11234 EntityAI root = GetHierarchyRoot();
11235
11236 InventoryLocation dst = new InventoryLocation;
11238 {
11239 if (root)
11240 {
11241 root.GetTransform(m4);
11243 }
11244 else
11245 GetInventory().GetCurrentInventoryLocation(dst);
11246 }
11247 else
11248 {
11250
11251
11252 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11253 {
11254 if (root)
11255 {
11256 root.GetTransform(m4);
11258 }
11259 else
11260 GetInventory().GetCurrentInventoryLocation(dst);
11261 }
11262 else
11263 {
11264 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11265 }
11266 }
11267
11268 ScriptInputUserData ctx = new ScriptInputUserData;
11276 }
11277 }
11278 else if (!
GetGame().IsMultiplayer())
11279 {
11281 }
11282 }
11283 }
11284
11285 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11286 {
11287
11288 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11289 return false;
11290
11291 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11292 return false;
11293
11294
11296 return false;
11297
11298
11299 Magazine mag = Magazine.Cast(this);
11300 if (mag)
11301 {
11302 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11303 return false;
11304
11305 if (stack_max_limit)
11306 {
11307 Magazine other_mag = Magazine.Cast(other_item);
11308 if (other_item)
11309 {
11310 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11311 return false;
11312 }
11313
11314 }
11315 }
11316 else
11317 {
11318
11320 return false;
11321
11323 return false;
11324 }
11325
11326 PlayerBase player = null;
11327 if (CastTo(player, GetHierarchyRootPlayer()))
11328 {
11329 if (player.GetInventory().HasAttachment(this))
11330 return false;
11331
11332 if (player.IsItemsToDelete())
11333 return false;
11334 }
11335
11336 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11337 return false;
11338
11339 int slotID;
11341 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11342 return false;
11343
11344 return true;
11345 }
11346
11348 {
11350 }
11351
11353 {
11354 return m_IsResultOfSplit;
11355 }
11356
11358 {
11359 m_IsResultOfSplit = value;
11360 }
11361
11363 {
11365 }
11366
11368 {
11369 float other_item_quantity = other_item.GetQuantity();
11370 float this_free_space;
11371
11373
11375
11376 if (other_item_quantity > this_free_space)
11377 {
11378 return this_free_space;
11379 }
11380 else
11381 {
11382 return other_item_quantity;
11383 }
11384 }
11385
11387 {
11389 }
11390
11392 {
11394 return;
11395
11396 if (!IsMagazine() && other_item)
11397 {
11399 if (quantity_used != 0)
11400 {
11401 float hp1 = GetHealth01("","");
11402 float hp2 = other_item.GetHealth01("","");
11403 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11404 hpResult = hpResult / (
GetQuantity() + quantity_used);
11405
11406 hpResult *= GetMaxHealth();
11407 Math.Round(hpResult);
11408 SetHealth("", "Health", hpResult);
11409
11411 other_item.AddQuantity(-quantity_used);
11412 }
11413 }
11415 }
11416
11418 {
11419 #ifdef SERVER
11420 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11421 GetHierarchyParent().IncreaseLifetimeUp();
11422 #endif
11423 };
11424
11426 {
11427 PlayerBase p = PlayerBase.Cast(player);
11428
11429 array<int> recipesIds = p.m_Recipes;
11430 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11431 if (moduleRecipesManager)
11432 {
11433 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11434 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11435 }
11436
11437 for (int i = 0;i < recipesIds.Count(); i++)
11438 {
11439 int key = recipesIds.Get(i);
11440 string recipeName = moduleRecipesManager.GetRecipeName(key);
11442 }
11443 }
11444
11445
11446 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11447 {
11448 super.GetDebugActions(outputList);
11449
11450
11455
11456
11460
11464
11465
11468
11469
11471 {
11474 }
11475
11477
11480
11484 }
11485
11486
11487
11488
11490 {
11491 super.OnAction(action_id, player, ctx);
11492 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11493 {
11494 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11495 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11496 PlayerBase p = PlayerBase.Cast(player);
11497 if (
EActions.RECIPES_RANGE_START < 1000)
11498 {
11499 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11500 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11501 }
11502 }
11503 #ifndef SERVER
11504 else if (action_id ==
EActions.WATCH_PLAYER)
11505 {
11506 PluginDeveloper.SetDeveloperItemClientEx(player);
11507 }
11508 #endif
11510 {
11511 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11512 {
11513 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11514 OnDebugButtonPressServer(id + 1);
11515 }
11516
11517 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11518 {
11519 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11521 }
11522
11523 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11524 {
11525 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11527 }
11528
11529 else if (action_id ==
EActions.ADD_QUANTITY)
11530 {
11531 if (IsMagazine())
11532 {
11533 Magazine mag = Magazine.Cast(this);
11534 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11535 }
11536 else
11537 {
11539 }
11540
11541 if (m_EM)
11542 {
11543 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11544 }
11545
11546 }
11547
11548 else if (action_id ==
EActions.REMOVE_QUANTITY)
11549 {
11550 if (IsMagazine())
11551 {
11552 Magazine mag2 = Magazine.Cast(this);
11553 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11554 }
11555 else
11556 {
11558 }
11559 if (m_EM)
11560 {
11561 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11562 }
11563
11564 }
11565
11566 else if (action_id ==
EActions.SET_QUANTITY_0)
11567 {
11569
11570 if (m_EM)
11571 {
11572 m_EM.SetEnergy(0);
11573 }
11574 }
11575
11576 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11577 {
11579
11580 if (m_EM)
11581 {
11582 m_EM.SetEnergy(m_EM.GetEnergyMax());
11583 }
11584 }
11585
11586 else if (action_id ==
EActions.ADD_HEALTH)
11587 {
11588 AddHealth("","",GetMaxHealth("","Health")/5);
11589 }
11590 else if (action_id ==
EActions.REMOVE_HEALTH)
11591 {
11592 AddHealth("","",-GetMaxHealth("","Health")/5);
11593 }
11594 else if (action_id ==
EActions.DESTROY_HEALTH)
11595 {
11596 SetHealth01("","",0);
11597 }
11598 else if (action_id ==
EActions.WATCH_ITEM)
11599 {
11601 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11602 #ifdef DEVELOPER
11603 SetDebugDeveloper_item(this);
11604 #endif
11605 }
11606
11607 else if (action_id ==
EActions.ADD_TEMPERATURE)
11608 {
11609 AddTemperature(20);
11610
11611 }
11612
11613 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11614 {
11615 AddTemperature(-20);
11616
11617 }
11618
11619 else if (action_id ==
EActions.FLIP_FROZEN)
11620 {
11621 SetFrozen(!GetIsFrozen());
11622
11623 }
11624
11625 else if (action_id ==
EActions.ADD_WETNESS)
11626 {
11628
11629 }
11630
11631 else if (action_id ==
EActions.REMOVE_WETNESS)
11632 {
11634
11635 }
11636
11637 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11638 {
11641
11642
11643 }
11644
11645 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11646 {
11649 }
11650
11651 else if (action_id ==
EActions.MAKE_SPECIAL)
11652 {
11653 auto debugParams = DebugSpawnParams.WithPlayer(player);
11654 OnDebugSpawnEx(debugParams);
11655 }
11656
11657 else if (action_id ==
EActions.DELETE)
11658 {
11659 Delete();
11660 }
11661
11662 }
11663
11664
11665 return false;
11666 }
11667
11668
11669
11670
11674
11677
11678
11679
11681 {
11682 return false;
11683 }
11684
11685
11687 {
11688 return true;
11689 }
11690
11691
11693 {
11694 return true;
11695 }
11696
11697
11698
11700 {
11701 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11703 }
11704
11707 {
11708 return null;
11709 }
11710
11712 {
11713 return false;
11714 }
11715
11717 {
11718 return false;
11719 }
11720
11724
11725
11727 {
11728 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11729 return module_repairing.CanRepair(this, item_repair_kit);
11730 }
11731
11732
11733 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11734 {
11735 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11736 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11737 }
11738
11739
11741 {
11742
11743
11744
11745
11746
11747
11748
11749
11750 return 1;
11751 }
11752
11753
11754
11756 {
11758 }
11759
11760
11761
11763 {
11765 }
11766
11767
11776 {
11777 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11778
11779 if (player)
11780 {
11781 player.MessageStatus(text);
11782 }
11783 }
11784
11785
11794 {
11795 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11796
11797 if (player)
11798 {
11799 player.MessageAction(text);
11800 }
11801 }
11802
11803
11812 {
11813 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11814
11815 if (player)
11816 {
11817 player.MessageFriendly(text);
11818 }
11819 }
11820
11821
11830 {
11831 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11832
11833 if (player)
11834 {
11835 player.MessageImportant(text);
11836 }
11837 }
11838
11840 {
11841 return true;
11842 }
11843
11844
11845 override bool KindOf(
string tag)
11846 {
11847 bool found = false;
11848 string item_name = this.
GetType();
11851
11852 int array_size = item_tag_array.Count();
11853 for (int i = 0; i < array_size; i++)
11854 {
11855 if (item_tag_array.Get(i) == tag)
11856 {
11857 found = true;
11858 break;
11859 }
11860 }
11861 return found;
11862 }
11863
11864
11866 {
11867
11868 super.OnRPC(sender, rpc_type,ctx);
11869
11870
11871 switch (rpc_type)
11872 {
11873 #ifndef SERVER
11874 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11875 Param2<bool, string> p = new Param2<bool, string>(false, "");
11876
11878 return;
11879
11880 bool play = p.param1;
11881 string soundSet = p.param2;
11882
11883 if (play)
11884 {
11886 {
11888 {
11890 }
11891 }
11892 else
11893 {
11895 }
11896 }
11897 else
11898 {
11900 }
11901
11902 break;
11903 #endif
11904
11905 }
11906
11908 {
11910 }
11911 }
11912
11913
11914
11915
11917 {
11918 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11919 return plugin.GetID(
name);
11920 }
11921
11923 {
11924 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11925 return plugin.GetName(id);
11926 }
11927
11930 {
11931
11932
11933 int varFlags;
11934 if (!ctx.
Read(varFlags))
11935 return;
11936
11937 if (varFlags & ItemVariableFlags.FLOAT)
11938 {
11940 }
11941 }
11942
11944 {
11945
11946 super.SerializeNumericalVars(floats_out);
11947
11948
11949
11951 {
11953 }
11954
11956 {
11958 }
11959
11961 {
11963 }
11964
11966 {
11971 }
11972
11974 {
11976 }
11977 }
11978
11980 {
11981
11982 super.DeSerializeNumericalVars(floats);
11983
11984
11985 int index = 0;
11986 int mask = Math.Round(floats.Get(index));
11987
11988 index++;
11989
11991 {
11993 {
11995 }
11996 else
11997 {
11998 float quantity = floats.Get(index);
11999 SetQuantity(quantity,
true,
false,
false,
false);
12000 }
12001 index++;
12002 }
12003
12005 {
12006 float wet = floats.Get(index);
12008 index++;
12009 }
12010
12012 {
12013 int liquidtype = Math.Round(floats.Get(index));
12015 index++;
12016 }
12017
12019 {
12021 index++;
12023 index++;
12025 index++;
12027 index++;
12028 }
12029
12031 {
12032 int cleanness = Math.Round(floats.Get(index));
12034 index++;
12035 }
12036 }
12037
12039 {
12040 super.WriteVarsToCTX(ctx);
12041
12042
12044 {
12046 }
12047
12049 {
12051 }
12052
12054 {
12056 }
12057
12059 {
12060 int r,g,b,a;
12066 }
12067
12069 {
12071 }
12072 }
12073
12075 {
12076 if (!super.ReadVarsFromCTX(ctx,version))
12077 return false;
12078
12079 int intValue;
12080 float value;
12081
12082 if (version < 140)
12083 {
12084 if (!ctx.
Read(intValue))
12085 return false;
12086
12087 m_VariablesMask = intValue;
12088 }
12089
12091 {
12092 if (!ctx.
Read(value))
12093 return false;
12094
12096 {
12098 }
12099 else
12100 {
12102 }
12103 }
12104
12105 if (version < 140)
12106 {
12108 {
12109 if (!ctx.
Read(value))
12110 return false;
12111 SetTemperatureDirect(value);
12112 }
12113 }
12114
12116 {
12117 if (!ctx.
Read(value))
12118 return false;
12120 }
12121
12123 {
12124 if (!ctx.
Read(intValue))
12125 return false;
12127 }
12128
12130 {
12131 int r,g,b,a;
12133 return false;
12135 return false;
12137 return false;
12139 return false;
12140
12142 }
12143
12145 {
12146 if (!ctx.
Read(intValue))
12147 return false;
12149 }
12150
12151 if (version >= 138 && version < 140)
12152 {
12154 {
12155 if (!ctx.
Read(intValue))
12156 return false;
12157 SetFrozen(intValue);
12158 }
12159 }
12160
12161 return true;
12162 }
12163
12164
12166 {
12169 {
12171 }
12172
12173 if (!super.OnStoreLoad(ctx, version))
12174 {
12176 return false;
12177 }
12178
12179 if (version >= 114)
12180 {
12181 bool hasQuickBarIndexSaved;
12182
12183 if (!ctx.
Read(hasQuickBarIndexSaved))
12184 {
12186 return false;
12187 }
12188
12189 if (hasQuickBarIndexSaved)
12190 {
12191 int itmQBIndex;
12192
12193
12194 if (!ctx.
Read(itmQBIndex))
12195 {
12197 return false;
12198 }
12199
12200 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12201 if (itmQBIndex != -1 && parentPlayer)
12202 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12203 }
12204 }
12205 else
12206 {
12207
12208 PlayerBase player;
12209 int itemQBIndex;
12210 if (version ==
int.
MAX)
12211 {
12212 if (!ctx.
Read(itemQBIndex))
12213 {
12215 return false;
12216 }
12217 }
12218 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12219 {
12220
12221 if (!ctx.
Read(itemQBIndex))
12222 {
12224 return false;
12225 }
12226 if (itemQBIndex != -1 && player)
12227 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12228 }
12229 }
12230
12231 if (version < 140)
12232 {
12233
12234 if (!LoadVariables(ctx, version))
12235 {
12237 return false;
12238 }
12239 }
12240
12241
12243 {
12245 return false;
12246 }
12247 if (version >= 132)
12248 {
12250 if (raib)
12251 {
12253 {
12255 return false;
12256 }
12257 }
12258 }
12259
12261 return true;
12262 }
12263
12264
12265
12267 {
12268 super.OnStoreSave(ctx);
12269
12270 PlayerBase player;
12271 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12272 {
12274
12275 int itemQBIndex = -1;
12276 itemQBIndex = player.FindQuickBarEntityIndex(this);
12277 ctx.
Write(itemQBIndex);
12278 }
12279 else
12280 {
12282 }
12283
12285
12287 if (raib)
12288 {
12290 }
12291 }
12292
12293
12295 {
12296 super.AfterStoreLoad();
12297
12299 {
12301 }
12302
12304 {
12307 }
12308 }
12309
12311 {
12312 super.EEOnAfterLoad();
12313
12315 {
12317 }
12318
12321 }
12322
12324 {
12325 return false;
12326 }
12327
12328
12329
12331 {
12333 {
12334 #ifdef PLATFORM_CONSOLE
12335
12337 {
12339 if (menu)
12340 {
12342 }
12343 }
12344 #endif
12345 }
12346
12348 {
12351 }
12352
12354 {
12355 SetWeightDirty();
12357 }
12359 {
12362 }
12363
12365 {
12368 }
12370 {
12373 }
12374
12375 super.OnVariablesSynchronized();
12376 }
12377
12378
12379
12381 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12382 {
12383 if (!IsServerCheck(allow_client))
12384 return false;
12385
12387 return false;
12388
12391
12392 if (value <= (min + 0.001))
12393 value = min;
12394
12395 if (value == min)
12396 {
12397 if (destroy_config)
12398 {
12399 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12400 if (dstr)
12401 {
12403 this.Delete();
12404 return true;
12405 }
12406 }
12407 else if (destroy_forced)
12408 {
12410 this.Delete();
12411 return true;
12412 }
12413
12415 }
12416
12419
12421 {
12423
12424 if (delta)
12426 }
12427
12429
12430 return false;
12431 }
12432
12433
12435 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12436 {
12438 }
12439
12441 {
12444 }
12445
12447 {
12450 }
12451
12454 {
12455 float value_clamped = Math.Clamp(value, 0, 1);
12457 SetQuantity(result, destroy_config, destroy_forced);
12458 }
12459
12460
12463 {
12465 }
12466
12468 {
12470 }
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12482 {
12483 int slot = -1;
12484 if (GetInventory())
12485 {
12486 InventoryLocation il = new InventoryLocation;
12487 GetInventory().GetCurrentInventoryLocation(il);
12489 }
12490
12492 }
12493
12495 {
12496 float quantity_max = 0;
12497
12499 {
12500 if (attSlotID != -1)
12501 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12502
12503 if (quantity_max <= 0)
12505 }
12506
12507 if (quantity_max <= 0)
12509
12510 return quantity_max;
12511 }
12512
12514 {
12516 }
12517
12519 {
12521 }
12522
12523
12525 {
12527 }
12528
12530 {
12532 }
12533
12535 {
12537 }
12538
12539
12541 {
12542
12543 float weightEx = GetWeightEx();
12544 float special = GetInventoryAndCargoWeight();
12545 return weightEx - special;
12546 }
12547
12548
12550 {
12552 }
12553
12555 {
12557 {
12558 #ifdef DEVELOPER
12559 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12560 {
12561 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12563 }
12564 #endif
12565
12566 return GetQuantity() * GetConfigWeightModified();
12567 }
12568 else if (HasEnergyManager())
12569 {
12570 #ifdef DEVELOPER
12571 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12572 {
12573 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12574 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12575 }
12576 #endif
12577 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12578 }
12579 else
12580 {
12581 #ifdef DEVELOPER
12582 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12583 {
12584 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12585 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12586 }
12587 #endif
12588 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12589 }
12590 }
12591
12594 {
12595 int item_count = 0;
12597
12598 if (GetInventory().GetCargo() != NULL)
12599 {
12600 item_count = GetInventory().GetCargo().GetItemCount();
12601 }
12602
12603 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12604 {
12605 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12606 if (item)
12607 item_count += item.GetNumberOfItems();
12608 }
12609 return item_count;
12610 }
12611
12614 {
12615 float weight = 0;
12616 float wetness = 1;
12617 if (include_wetness)
12620 {
12621 weight = wetness * m_ConfigWeight;
12622 }
12624 {
12625 weight = 1;
12626 }
12627 return weight;
12628 }
12629
12630
12631
12633 {
12634 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12635 {
12636 GameInventory inv = GetInventory();
12637 array<EntityAI> items = new array<EntityAI>;
12639 for (int i = 0; i < items.Count(); i++)
12640 {
12642 if (item)
12643 {
12645 }
12646 }
12647 }
12648 }
12649
12650
12651
12652
12654 {
12655 float energy = 0;
12656 if (HasEnergyManager())
12657 {
12658 energy = GetCompEM().GetEnergy();
12659 }
12660 return energy;
12661 }
12662
12663
12665 {
12666 super.OnEnergyConsumed();
12667
12669 }
12670
12672 {
12673 super.OnEnergyAdded();
12674
12676 }
12677
12678
12680 {
12681 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12682 {
12684 {
12685 float energy_0to1 = GetCompEM().GetEnergy0To1();
12687 }
12688 }
12689 }
12690
12691
12693 {
12694 return ConfigGetFloat("heatIsolation");
12695 }
12696
12698 {
12700 }
12701
12703 {
12704 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12705 if (
GetGame().ConfigIsExisting(paramPath))
12707
12708 return 0.0;
12709 }
12710
12712 {
12713 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12714 if (
GetGame().ConfigIsExisting(paramPath))
12716
12717 return 0.0;
12718 }
12719
12720 override void SetWet(
float value,
bool allow_client =
false)
12721 {
12722 if (!IsServerCheck(allow_client))
12723 return;
12724
12727
12729
12730 m_VarWet = Math.Clamp(value, min, max);
12731
12733 {
12736 }
12737 }
12738
12739 override void AddWet(
float value)
12740 {
12742 }
12743
12745 {
12747 }
12748
12750 {
12752 }
12753
12755 {
12757 }
12758
12760 {
12762 }
12763
12765 {
12767 }
12768
12769 override void OnWetChanged(
float newVal,
float oldVal)
12770 {
12773 if (newLevel != oldLevel)
12774 {
12776 }
12777 }
12778
12780 {
12781 SetWeightDirty();
12782 }
12783
12785 {
12786 return GetWetLevelInternal(
m_VarWet);
12787 }
12788
12789
12790
12792 {
12794 }
12795
12797 {
12799 }
12800
12802 {
12804 }
12805
12807 {
12809 }
12810
12811
12812
12814 {
12815 if (ConfigIsExisting("itemModelLength"))
12816 {
12817 return ConfigGetFloat("itemModelLength");
12818 }
12819 return 0;
12820 }
12821
12823 {
12824 if (ConfigIsExisting("itemAttachOffset"))
12825 {
12826 return ConfigGetFloat("itemAttachOffset");
12827 }
12828 return 0;
12829 }
12830
12831 override void SetCleanness(
int value,
bool allow_client =
false)
12832 {
12833 if (!IsServerCheck(allow_client))
12834 return;
12835
12837
12839
12842 }
12843
12845 {
12847 }
12848
12850 {
12851 return true;
12852 }
12853
12854
12855
12856
12858 {
12860 }
12861
12863 {
12865 }
12866
12867
12868
12869
12870 override void SetColor(
int r,
int g,
int b,
int a)
12871 {
12877 }
12879 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12880 {
12885 }
12886
12888 {
12890 }
12891
12894 {
12895 int r,g,b,a;
12897 r = r/255;
12898 g = g/255;
12899 b = b/255;
12900 a = a/255;
12901 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12902 }
12903
12904
12905
12906 override void SetLiquidType(
int value,
bool allow_client =
false)
12907 {
12908 if (!IsServerCheck(allow_client))
12909 return;
12910
12915 }
12916
12918 {
12919 return ConfigGetInt("varLiquidTypeInit");
12920 }
12921
12923 {
12925 }
12926
12928 {
12930 SetFrozen(false);
12931 }
12932
12935 {
12936 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12937 }
12938
12939
12942 {
12943 PlayerBase nplayer;
12944 if (PlayerBase.CastTo(nplayer, player))
12945 {
12947
12948 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12949 }
12950 }
12951
12952
12955 {
12956 PlayerBase nplayer;
12957 if (PlayerBase.CastTo(nplayer,player))
12958 {
12959
12960 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12961
12962 }
12963
12964
12965 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12966
12967
12968 if (HasEnergyManager())
12969 {
12970 GetCompEM().UpdatePlugState();
12971 }
12972 }
12973
12974
12976 {
12977 super.OnPlacementStarted(player);
12978
12980 }
12981
12982 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12983 {
12985 {
12986 m_AdminLog.OnPlacementComplete(player,
this);
12987 }
12988
12989 super.OnPlacementComplete(player, position, orientation);
12990 }
12991
12992
12993
12994
12995
12997 {
12999 {
13000 return true;
13001 }
13002 else
13003 {
13004 return false;
13005 }
13006 }
13007
13008
13010 {
13012 {
13014 }
13015 }
13016
13017
13019 {
13021 }
13022
13024 {
13026 }
13027
13028 override void InsertAgent(
int agent,
float count = 1)
13029 {
13030 if (count < 1)
13031 return;
13032
13034 }
13035
13038 {
13040 }
13041
13042
13044 {
13046 }
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13090 {
13092 return false;
13093 return true;
13094 }
13095
13097 {
13098
13100 }
13101
13102
13105 {
13106 super.CheckForRoofLimited(timeTresholdMS);
13107
13109 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13110 {
13111 m_PreviousRoofTestTime = time;
13112 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13113 }
13114 }
13115
13116
13118 {
13120 {
13121 return 0;
13122 }
13123
13124 if (GetInventory().GetAttachmentSlotsCount() != 0)
13125 {
13126 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13127 if (filter)
13128 return filter.GetProtectionLevel(type, false, system);
13129 else
13130 return 0;
13131 }
13132
13133 string subclassPath, entryName;
13134
13135 switch (type)
13136 {
13138 entryName = "biological";
13139 break;
13141 entryName = "chemical";
13142 break;
13143 default:
13144 entryName = "biological";
13145 break;
13146 }
13147
13148 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13149
13151 }
13152
13153
13154
13157 {
13158 if (!IsMagazine())
13160
13162 }
13163
13164
13165
13166
13167
13172 {
13173 return true;
13174 }
13175
13177 {
13179 }
13180
13181
13182
13183
13184
13186 {
13187 if (parent)
13188 {
13189 if (parent.IsInherited(DayZInfected))
13190 return true;
13191
13192 if (!parent.IsRuined())
13193 return true;
13194 }
13195
13196 return true;
13197 }
13198
13200 {
13201 if (!super.CanPutAsAttachment(parent))
13202 {
13203 return false;
13204 }
13205
13206 if (!IsRuined() && !parent.IsRuined())
13207 {
13208 return true;
13209 }
13210
13211 return false;
13212 }
13213
13215 {
13216
13217
13218
13219
13220 return super.CanReceiveItemIntoCargo(item);
13221 }
13222
13224 {
13225
13226
13227
13228
13229 GameInventory attachmentInv = attachment.GetInventory();
13231 {
13232 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13233 return false;
13234 }
13235
13236 InventoryLocation loc = new InventoryLocation();
13237 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13238 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13239 return false;
13240
13241 return super.CanReceiveAttachment(attachment, slotId);
13242 }
13243
13245 {
13246 if (!super.CanReleaseAttachment(attachment))
13247 return false;
13248
13249 return GetInventory().AreChildrenAccessible();
13250 }
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13273 {
13274 int id = muzzle_owner.GetMuzzleID();
13275 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13276
13277 if (WPOF_array)
13278 {
13279 for (int i = 0; i < WPOF_array.Count(); i++)
13280 {
13281 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13282
13283 if (WPOF)
13284 {
13285 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13286 }
13287 }
13288 }
13289 }
13290
13291
13293 {
13294 int id = muzzle_owner.GetMuzzleID();
13296
13297 if (WPOBE_array)
13298 {
13299 for (int i = 0; i < WPOBE_array.Count(); i++)
13300 {
13301 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13302
13303 if (WPOBE)
13304 {
13305 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13306 }
13307 }
13308 }
13309 }
13310
13311
13313 {
13314 int id = muzzle_owner.GetMuzzleID();
13315 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13316
13317 if (WPOOH_array)
13318 {
13319 for (int i = 0; i < WPOOH_array.Count(); i++)
13320 {
13321 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13322
13323 if (WPOOH)
13324 {
13325 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13326 }
13327 }
13328 }
13329 }
13330
13331
13333 {
13334 int id = muzzle_owner.GetMuzzleID();
13335 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13336
13337 if (WPOOH_array)
13338 {
13339 for (int i = 0; i < WPOOH_array.Count(); i++)
13340 {
13341 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13342
13343 if (WPOOH)
13344 {
13345 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13346 }
13347 }
13348 }
13349 }
13350
13351
13353 {
13354 int id = muzzle_owner.GetMuzzleID();
13355 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13356
13357 if (WPOOH_array)
13358 {
13359 for (int i = 0; i < WPOOH_array.Count(); i++)
13360 {
13361 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13362
13363 if (WPOOH)
13364 {
13365 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13366 }
13367 }
13368 }
13369 }
13370
13371
13372
13374 {
13376 {
13377 return true;
13378 }
13379
13380 return false;
13381 }
13382
13384 {
13386 {
13387 return true;
13388 }
13389
13390 return false;
13391 }
13392
13394 {
13396 {
13397 return true;
13398 }
13399
13400 return false;
13401 }
13402
13404 {
13405 return false;
13406 }
13407
13410 {
13411 return UATimeSpent.DEFAULT_DEPLOY;
13412 }
13413
13414
13415
13416
13418 {
13420 SetSynchDirty();
13421 }
13422
13424 {
13426 }
13427
13428
13430 {
13431 return false;
13432 }
13433
13436 {
13437 string att_type = "None";
13438
13439 if (ConfigIsExisting("soundAttType"))
13440 {
13441 att_type = ConfigGetString("soundAttType");
13442 }
13443
13445 }
13446
13448 {
13450 }
13451
13452
13453
13454
13455
13459
13461 {
13464
13466 }
13467
13468
13470 {
13472 return;
13473
13475
13478
13481
13482 SoundParameters params = new SoundParameters();
13486 }
13487
13488
13490 {
13492 return;
13493
13495 SetSynchDirty();
13496
13499 }
13500
13501
13503 {
13505 return;
13506
13508 SetSynchDirty();
13509
13512 }
13513
13515 {
13517 }
13518
13520 {
13522 }
13523
13526 {
13527 if (!
GetGame().IsDedicatedServer())
13528 {
13529 if (ConfigIsExisting("attachSoundSet"))
13530 {
13531 string cfg_path = "";
13532 string soundset = "";
13533 string type_name =
GetType();
13534
13537 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13538 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13539
13540 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13541 {
13542 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13543 {
13544 if (cfg_slot_array[i] == slot_type)
13545 {
13546 soundset = cfg_soundset_array[i];
13547 break;
13548 }
13549 }
13550 }
13551
13552 if (soundset != "")
13553 {
13554 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13556 }
13557 }
13558 }
13559 }
13560
13562 {
13563
13564 }
13565
13566 void OnApply(PlayerBase player);
13567
13569 {
13570 return 1.0;
13571 };
13572
13574 {
13576 }
13577
13579 {
13581 }
13582
13584
13586 {
13587 SetDynamicPhysicsLifeTime(0.01);
13589 }
13590
13592 {
13593 array<string> zone_names = new array<string>;
13594 GetDamageZones(zone_names);
13595 for (int i = 0; i < zone_names.Count(); i++)
13596 {
13597 SetHealthMax(zone_names.Get(i),"Health");
13598 }
13599 SetHealthMax("","Health");
13600 }
13601
13604 {
13605 float global_health = GetHealth01("","Health");
13606 array<string> zones = new array<string>;
13607 GetDamageZones(zones);
13608
13609 for (int i = 0; i < zones.Count(); i++)
13610 {
13611 SetHealth01(zones.Get(i),"Health",global_health);
13612 }
13613 }
13614
13617 {
13618 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13619 }
13620
13622 {
13623 if (!hasRootAsPlayer)
13624 {
13625 if (refParentIB)
13626 {
13627
13628 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13629 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13630
13631 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13632 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13633
13636 }
13637 else
13638 {
13639
13642 }
13643 }
13644 }
13645
13647 {
13649 {
13650 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13651 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13652 {
13653 float heatPermCoef = 1.0;
13655 while (ent)
13656 {
13657 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13658 ent = ent.GetHierarchyParent();
13659 }
13660
13661 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13662 }
13663 }
13664 }
13665
13667 {
13668
13669 EntityAI parent = GetHierarchyParent();
13670 if (!parent)
13671 {
13672 hasParent = false;
13673 hasRootAsPlayer = false;
13674 }
13675 else
13676 {
13677 hasParent = true;
13678 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13679 refParentIB =
ItemBase.Cast(parent);
13680 }
13681 }
13682
13683 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13684 {
13685
13686 }
13687
13689 {
13690
13691 return false;
13692 }
13693
13695 {
13696
13697
13698 return false;
13699 }
13700
13702 {
13703
13704 return false;
13705 }
13706
13709 {
13710 return !GetIsFrozen() &&
IsOpen();
13711 }
13712
13714 {
13715 bool hasParent = false, hasRootAsPlayer = false;
13717
13718 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13719 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13720
13721 if (wwtu || foodDecay)
13722 {
13726
13727 if (processWetness || processTemperature || processDecay)
13728 {
13730
13731 if (processWetness)
13732 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13733
13734 if (processTemperature)
13736
13737 if (processDecay)
13738 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13739 }
13740 }
13741 }
13742
13745 {
13747 }
13748
13750 {
13753
13754 return super.GetTemperatureFreezeThreshold();
13755 }
13756
13758 {
13761
13762 return super.GetTemperatureThawThreshold();
13763 }
13764
13766 {
13769
13770 return super.GetItemOverheatThreshold();
13771 }
13772
13774 {
13776 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13777
13778 return super.GetTemperatureFreezeTime();
13779 }
13780
13782 {
13784 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13785
13786 return super.GetTemperatureThawTime();
13787 }
13788
13793
13795 {
13796 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13797 }
13798
13800 {
13801 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13802 }
13803
13806 {
13808 }
13809
13811 {
13813 }
13814
13816 {
13818 }
13819
13822 {
13823 return null;
13824 }
13825
13828 {
13829 return false;
13830 }
13831
13833 {
13835 {
13838 if (!trg)
13839 {
13841 explosive = this;
13842 }
13843
13844 explosive.PairRemote(trg);
13846
13847 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13848 trg.SetPersistentPairID(persistentID);
13849 explosive.SetPersistentPairID(persistentID);
13850
13851 return true;
13852 }
13853 return false;
13854 }
13855
13858 {
13859 float ret = 1.0;
13862 ret *= GetHealth01();
13863
13864 return ret;
13865 }
13866
13867 #ifdef DEVELOPER
13868 override void SetDebugItem()
13869 {
13870 super.SetDebugItem();
13871 _itemBase = this;
13872 }
13873
13875 {
13876 string text = super.GetDebugText();
13877
13879 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13880
13881 return text;
13882 }
13883 #endif
13884
13886 {
13887 return true;
13888 }
13889
13891
13893
13895 {
13898 }
13899
13900
13908
13924}
13925
13927{
13929 if (entity)
13930 {
13931 bool is_item = entity.IsInherited(
ItemBase);
13932 if (is_item && full_quantity)
13933 {
13936 }
13937 }
13938 else
13939 {
13941 return NULL;
13942 }
13943 return entity;
13944}
13945
13947{
13948 if (item)
13949 {
13950 if (health > 0)
13951 item.SetHealth("", "", health);
13952
13953 if (item.CanHaveTemperature())
13954 {
13956 if (item.CanFreeze())
13957 item.SetFrozen(false);
13958 }
13959
13960 if (item.HasEnergyManager())
13961 {
13962 if (quantity >= 0)
13963 {
13964 item.GetCompEM().SetEnergy0To1(quantity);
13965 }
13966 else
13967 {
13969 }
13970 }
13971 else if (item.IsMagazine())
13972 {
13973 Magazine mag = Magazine.Cast(item);
13974 if (quantity >= 0)
13975 {
13976 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13977 }
13978 else
13979 {
13981 }
13982
13983 }
13984 else
13985 {
13986 if (quantity >= 0)
13987 {
13988 item.SetQuantityNormalized(quantity, false);
13989 }
13990 else
13991 {
13993 }
13994
13995 }
13996 }
13997}
13998
13999#ifdef DEVELOPER
14001#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.