9076{
9078 {
9079 return true;
9080 }
9081};
9082
9083
9084
9086{
9090
9092
9095
9096
9097
9098
9099
9108
9114
9119
9124
9145 protected bool m_IsResultOfSplit
9146
9148
9153
9154
9155
9157
9161
9162
9163
9165
9168
9169
9170
9176
9177
9185
9188
9189
9191
9192
9194
9195
9200
9201
9206
9207
9209
9210
9212 {
9217
9218 if (!
GetGame().IsDedicatedServer())
9219 {
9221 {
9223
9225 {
9227 }
9228 }
9229
9232 }
9233
9234 m_OldLocation = null;
9235
9237 {
9239 }
9240
9241 if (ConfigIsExisting("headSelectionsToHide"))
9242 {
9245 }
9246
9248 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9249 {
9251 }
9252
9254
9255 m_IsResultOfSplit = false;
9256
9258 }
9259
9261 {
9262 super.InitItemVariables();
9263
9269 m_Count = ConfigGetInt(
"count");
9270
9273
9278
9281
9286
9298
9302
9303
9306 if (ConfigIsExisting("canBeSplit"))
9307 {
9310 }
9311
9313 if (ConfigIsExisting("itemBehaviour"))
9315
9316
9319 RegisterNetSyncVariableInt("m_VarLiquidType");
9320 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9321
9322 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9323 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9324 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9325
9326 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9327 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9328 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9329 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9330
9331 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9332 RegisterNetSyncVariableBool("m_IsTakeable");
9333 RegisterNetSyncVariableBool("m_IsHologram");
9334
9337 {
9340 }
9341
9343
9345 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9347
9348 }
9349
9351 {
9353 }
9354
9356 {
9359 {
9364 }
9365 }
9366
9367 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9368 {
9370 {
9373 }
9374
9376 }
9377
9379 {
9385 }
9386
9388
9390 {
9392
9393 if (!action)
9394 {
9395 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9396 return;
9397 }
9398
9400 if (!ai)
9401 {
9403 return;
9404 }
9405
9407 if (!action_array)
9408 {
9409 action_array = new array<ActionBase_Basic>;
9411 }
9412 if (LogManager.IsActionLogEnable())
9413 {
9414 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9415 }
9416
9417 if (action_array.Find(action) != -1)
9418 {
9419 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9420 }
9421 else
9422 {
9423 action_array.Insert(action);
9424 }
9425 }
9426
9428 {
9430 ActionBase action = player.GetActionManager().GetAction(actionName);
9433
9434 if (action_array)
9435 {
9436 action_array.RemoveItem(action);
9437 }
9438 }
9439
9440
9441
9443 {
9444 ActionOverrideData overrideData = new ActionOverrideData();
9448
9450 if (!actionMap)
9451 {
9454 }
9455
9456 actionMap.Insert(this.
Type(), overrideData);
9457
9458 }
9459
9461
9463
9464
9466 {
9469
9472
9473 string config_to_search = "CfgVehicles";
9474 string muzzle_owner_config;
9475
9477 {
9478 if (IsInherited(Weapon))
9479 config_to_search = "CfgWeapons";
9480
9481 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9482
9483 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9484
9486
9487 if (config_OnFire_subclass_count > 0)
9488 {
9489 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9490
9491 for (int i = 0; i < config_OnFire_subclass_count; i++)
9492 {
9493 string particle_class = "";
9495 string config_OnFire_entry = config_OnFire_class + particle_class;
9496 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9497 WPOF_array.Insert(WPOF);
9498 }
9499
9500
9502 }
9503 }
9504
9506 {
9507 config_to_search = "CfgWeapons";
9508 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9509
9510 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9511
9513
9514 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9515 {
9516 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9517
9518 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9519 {
9520 string particle_class2 = "";
9522 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9523 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9524 WPOBE_array.Insert(WPOBE);
9525 }
9526
9527
9529 }
9530 }
9531 }
9532
9533
9535 {
9538
9540 {
9541 string config_to_search = "CfgVehicles";
9542
9543 if (IsInherited(Weapon))
9544 config_to_search = "CfgWeapons";
9545
9546 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9547 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9548
9549 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9550 {
9551
9553
9555 {
9557 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9559 return;
9560 }
9561
9564
9565
9566
9568 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9569
9570 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9571 {
9572 string particle_class = "";
9574 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9576
9577 if (entry_type == CT_CLASS)
9578 {
9579 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9580 WPOOH_array.Insert(WPOF);
9581 }
9582 }
9583
9584
9586 }
9587 }
9588 }
9589
9591 {
9593 }
9594
9596 {
9598 {
9600
9603
9606
9607 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9608 }
9609 }
9610
9612 {
9614 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9615
9617 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9618
9620 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9621
9623 {
9625 }
9626 }
9627
9629 {
9631 }
9632
9634 {
9637 else
9639
9641 {
9644 }
9645 else
9646 {
9649
9652 }
9653
9655 }
9656
9658 {
9660 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9661 }
9662
9664 {
9666 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9668 }
9669
9671 {
9673 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9674 }
9675
9677 {
9680
9681 OverheatingParticle OP = new OverheatingParticle();
9686
9688 }
9689
9691 {
9694
9695 return -1;
9696 }
9697
9699 {
9701 {
9704
9705 for (int i = count; i > 0; --i)
9706 {
9707 int id = i - 1;
9710
9713
9714 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9715 {
9716 if (p)
9717 {
9720 }
9721 }
9722 }
9723 }
9724 }
9725
9727 {
9729 {
9731 {
9732 int id = i - 1;
9734
9735 if (OP)
9736 {
9738
9739 if (p)
9740 {
9742 }
9743
9744 delete OP;
9745 }
9746 }
9747
9750 }
9751 }
9752
9755 {
9756 return 0.0;
9757 }
9758
9759
9761 {
9762 return 250;
9763 }
9764
9766 {
9767 return 0;
9768 }
9769
9772 {
9774 return true;
9775
9776 return false;
9777 }
9778
9781 {
9784
9786 {
9788 }
9789 else
9790 {
9791
9793 }
9794
9796 }
9797
9804 {
9805 return -1;
9806 }
9807
9808
9809
9810
9812 {
9814 {
9816 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9817
9818 if (r_index >= 0)
9819 {
9820 InventoryLocation r_il = new InventoryLocation;
9821 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9822
9823 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9826 {
9827 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9828 }
9830 {
9831 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9832 }
9833
9834 }
9835
9836 player.GetHumanInventory().ClearUserReservedLocation(this);
9837 }
9838
9841 }
9842
9843
9844
9845
9847 {
9848 return ItemBase.m_DebugActionsMask;
9849 }
9850
9852 {
9853 return ItemBase.m_DebugActionsMask & mask;
9854 }
9855
9857 {
9858 ItemBase.m_DebugActionsMask = mask;
9859 }
9860
9862 {
9863 ItemBase.m_DebugActionsMask |= mask;
9864 }
9865
9867 {
9868 ItemBase.m_DebugActionsMask &= ~mask;
9869 }
9870
9872 {
9874 {
9876 }
9877 else
9878 {
9880 }
9881 }
9882
9883
9885 {
9886 if (GetEconomyProfile())
9887 {
9888 float q_max = GetEconomyProfile().GetQuantityMax();
9889 if (q_max > 0)
9890 {
9891 float q_min = GetEconomyProfile().GetQuantityMin();
9892 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9893
9895 {
9896 ComponentEnergyManager comp = GetCompEM();
9898 {
9900 }
9901 }
9903 {
9905
9906 }
9907
9908 }
9909 }
9910 }
9911
9914 {
9915 EntityAI parent = GetHierarchyParent();
9916
9917 if (parent)
9918 {
9919 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9920 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9921 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9922 }
9923 }
9924
9927 {
9928 EntityAI parent = GetHierarchyParent();
9929
9930 if (parent)
9931 {
9932 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9933 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9934 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9935 }
9936 }
9937
9939 {
9940
9941
9942
9943
9945
9947 {
9948 if (ScriptInputUserData.CanStoreInputUserData())
9949 {
9950 ScriptInputUserData ctx = new ScriptInputUserData;
9956 ctx.
Write(use_stack_max);
9959
9961 {
9962 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9963 }
9964 }
9965 }
9966 else if (!
GetGame().IsMultiplayer())
9967 {
9969 }
9970 }
9971
9973 {
9975 }
9976
9978 {
9980 }
9981
9983 {
9985 }
9986
9988 {
9989
9990 return false;
9991 }
9992
9994 {
9995 return false;
9996 }
9997
10001 {
10002 return false;
10003 }
10004
10006 {
10007 return "";
10008 }
10009
10011
10013 {
10014 return false;
10015 }
10016
10018 {
10019 return true;
10020 }
10021
10022
10023
10025 {
10026 return true;
10027 }
10028
10030 {
10031 return true;
10032 }
10033
10035 {
10036 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10038 }
10039
10041 {
10043 }
10044
10046 {
10048 if (!is_being_placed)
10050 SetSynchDirty();
10051 }
10052
10053
10055
10057 {
10059 }
10060
10062 {
10064 }
10065
10067 {
10068 return 1;
10069 }
10070
10072 {
10073 return false;
10074 }
10075
10077 {
10079 SetSynchDirty();
10080 }
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10117 {
10118 super.OnMovedInsideCargo(container);
10119
10120 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10121 }
10122
10123 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10124 {
10125 super.EEItemLocationChanged(oldLoc,newLoc);
10126
10127 PlayerBase new_player = null;
10128 PlayerBase old_player = null;
10129
10130 if (newLoc.GetParent())
10131 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10132
10133 if (oldLoc.GetParent())
10134 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10135
10137 {
10138 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10139
10140 if (r_index >= 0)
10141 {
10142 InventoryLocation r_il = new InventoryLocation;
10143 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10144
10145 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10148 {
10149 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10150 }
10152 {
10153 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10154 }
10155
10156 }
10157 }
10158
10160 {
10161 if (new_player)
10162 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10163
10164 if (new_player == old_player)
10165 {
10166
10167 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10168 {
10170 {
10171 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10172 {
10173 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10174 }
10175 }
10176 else
10177 {
10178 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10179 }
10180 }
10181
10182 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10183 {
10184 int type = oldLoc.GetType();
10186 {
10187 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10188 }
10190 {
10191 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10192 }
10193 }
10194 if (!m_OldLocation)
10195 {
10196 m_OldLocation = new InventoryLocation;
10197 }
10198 m_OldLocation.Copy(oldLoc);
10199 }
10200 else
10201 {
10202 if (m_OldLocation)
10203 {
10204 m_OldLocation.Reset();
10205 }
10206 }
10207
10209 }
10210 else
10211 {
10212 if (new_player)
10213 {
10214 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10215 if (res_index >= 0)
10216 {
10217 InventoryLocation il = new InventoryLocation;
10218 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10220 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10223 {
10224 il.
GetParent().GetOnReleaseLock().Invoke(it);
10225 }
10227 {
10229 }
10230
10231 }
10232 }
10234 {
10235
10237 }
10238
10239 if (m_OldLocation)
10240 {
10241 m_OldLocation.Reset();
10242 }
10243 }
10244 }
10245
10246 override void EOnContact(IEntity other, Contact extra)
10247 {
10249 {
10250 int liquidType = -1;
10252 if (impactSpeed > 0.0)
10253 {
10255 #ifndef SERVER
10257 #else
10259 SetSynchDirty();
10260 #endif
10262 }
10263 }
10264
10265 #ifdef SERVER
10266 if (GetCompEM() && GetCompEM().IsPlugged())
10267 {
10268 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10269 GetCompEM().UnplugThis();
10270 }
10271 #endif
10272 }
10273
10275
10277 {
10279 }
10280
10282 {
10283
10284 }
10285
10287 {
10288 super.OnItemLocationChanged(old_owner, new_owner);
10289
10290 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10291 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10292
10293 if (!relatedPlayer && playerNew)
10294 relatedPlayer = playerNew;
10295
10296 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10297 {
10299 if (actionMgr)
10300 {
10301 ActionBase currentAction = actionMgr.GetRunningAction();
10302 if (currentAction)
10304 }
10305 }
10306
10307 Man ownerPlayerOld = null;
10308 Man ownerPlayerNew = null;
10309
10310 if (old_owner)
10311 {
10312 if (old_owner.
IsMan())
10313 {
10314 ownerPlayerOld = Man.Cast(old_owner);
10315 }
10316 else
10317 {
10318 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10319 }
10320 }
10321 else
10322 {
10324 {
10326
10327 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10328 {
10329 GetCompEM().UnplugThis();
10330 }
10331 }
10332 }
10333
10334 if (new_owner)
10335 {
10336 if (new_owner.
IsMan())
10337 {
10338 ownerPlayerNew = Man.Cast(new_owner);
10339 }
10340 else
10341 {
10342 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10343 }
10344 }
10345
10346 if (ownerPlayerOld != ownerPlayerNew)
10347 {
10348 if (ownerPlayerOld)
10349 {
10350 array<EntityAI> subItemsExit = new array<EntityAI>;
10352 for (int i = 0; i < subItemsExit.Count(); i++)
10353 {
10356 }
10357 }
10358
10359 if (ownerPlayerNew)
10360 {
10361 array<EntityAI> subItemsEnter = new array<EntityAI>;
10363 for (int j = 0; j < subItemsEnter.Count(); j++)
10364 {
10367 }
10368 }
10369 }
10370 else if (ownerPlayerNew != null)
10371 {
10372 PlayerBase nplayer;
10373 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10374 {
10375 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10377 for (int k = 0; k < subItemsUpdate.Count(); k++)
10378 {
10380 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10381 }
10382 }
10383 }
10384
10385 if (old_owner)
10386 old_owner.OnChildItemRemoved(this);
10387 if (new_owner)
10388 new_owner.OnChildItemReceived(this);
10389 }
10390
10391
10393 {
10394 super.EEDelete(parent);
10395 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10396 if (player)
10397 {
10399
10400 if (player.IsAlive())
10401 {
10402 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10403 if (r_index >= 0)
10404 {
10405 InventoryLocation r_il = new InventoryLocation;
10406 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10407
10408 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10411 {
10412 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10413 }
10415 {
10416 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10417 }
10418
10419 }
10420
10421 player.RemoveQuickBarEntityShortcut(this);
10422 }
10423 }
10424 }
10425
10427 {
10428 super.EEKilled(killer);
10429
10432 {
10433 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10434 {
10435 if (IsMagazine())
10436 {
10437 if (Magazine.Cast(this).GetAmmoCount() > 0)
10438 {
10440 }
10441 }
10442 else
10443 {
10445 }
10446 }
10447 }
10448 }
10449
10451 {
10452 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10453
10454 super.OnWasAttached(parent, slot_id);
10455
10458
10460 }
10461
10463 {
10464 super.OnWasDetached(parent, slot_id);
10465
10468 }
10469
10471 {
10472 int idx;
10475
10476 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10477 if (inventory_slots.Count() < 1)
10478 {
10479 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10480 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10481 }
10482 else
10483 {
10484 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10485 }
10486
10487 idx = inventory_slots.Find(slot);
10488 if (idx < 0)
10489 return "";
10490
10491 return attach_types.Get(idx);
10492 }
10493
10495 {
10496 int idx = -1;
10497 string slot;
10498
10501
10502 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10503 if (inventory_slots.Count() < 1)
10504 {
10505 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10506 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10507 }
10508 else
10509 {
10510 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10511 if (detach_types.Count() < 1)
10512 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10513 }
10514
10515 for (int i = 0; i < inventory_slots.Count(); i++)
10516 {
10517 slot = inventory_slots.Get(i);
10518 }
10519
10520 if (slot != "")
10521 {
10522 if (detach_types.Count() == 1)
10523 idx = 0;
10524 else
10525 idx = inventory_slots.Find(slot);
10526 }
10527 if (idx < 0)
10528 return "";
10529
10530 return detach_types.Get(idx);
10531 }
10532
10534 {
10535
10537
10538
10539 float min_time = 1;
10540 float max_time = 3;
10541 float delay = Math.RandomFloat(min_time, max_time);
10542
10543 explode_timer.Run(delay, this, "DoAmmoExplosion");
10544 }
10545
10547 {
10548 Magazine magazine = Magazine.Cast(this);
10549 int pop_sounds_count = 6;
10550 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10551
10552
10553 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10554 string sound_name = pop_sounds[ sound_idx ];
10556
10557
10558 magazine.ServerAddAmmoCount(-1);
10559
10560
10561 float min_temp_to_explode = 100;
10562
10563 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10564 {
10566 }
10567 }
10568
10569
10570 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10571 {
10572 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10573
10574 const int CHANCE_DAMAGE_CARGO = 4;
10575 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10576 const int CHANCE_DAMAGE_NOTHING = 2;
10577
10579 {
10580 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10581 int chances;
10582 int rnd;
10583
10584 if (GetInventory().GetCargo())
10585 {
10586 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10587 rnd = Math.RandomInt(0,chances);
10588
10589 if (rnd < CHANCE_DAMAGE_CARGO)
10590 {
10592 }
10593 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10594 {
10596 }
10597 }
10598 else
10599 {
10600 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10601 rnd = Math.RandomInt(0,chances);
10602
10603 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10604 {
10606 }
10607 }
10608 }
10609 }
10610
10612 {
10613 if (GetInventory().GetCargo())
10614 {
10615 int item_count = GetInventory().GetCargo().GetItemCount();
10616 if (item_count > 0)
10617 {
10618 int random_pick = Math.RandomInt(0, item_count);
10620 if (!item.IsExplosive())
10621 {
10622 item.AddHealth("","",damage);
10623 return true;
10624 }
10625 }
10626 }
10627 return false;
10628 }
10629
10631 {
10632 int attachment_count = GetInventory().AttachmentCount();
10633 if (attachment_count > 0)
10634 {
10635 int random_pick = Math.RandomInt(0, attachment_count);
10636 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10637 if (!attachment.IsExplosive())
10638 {
10639 attachment.AddHealth("","",damage);
10640 return true;
10641 }
10642 }
10643 return false;
10644 }
10645
10647 {
10649 }
10650
10652 {
10654 return GetInventory().CanRemoveEntity();
10655
10656 return false;
10657 }
10658
10660 {
10662 return;
10663
10665 {
10666 if (ScriptInputUserData.CanStoreInputUserData())
10667 {
10668 ScriptInputUserData ctx = new ScriptInputUserData;
10673 ctx.
Write(destination_entity);
10675 ctx.
Write(slot_id);
10677 }
10678 }
10679 else if (!
GetGame().IsMultiplayer())
10680 {
10682 }
10683 }
10684
10686 {
10688 return;
10689
10690 float split_quantity_new;
10694 InventoryLocation loc = new InventoryLocation;
10695
10696 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10697 {
10699 split_quantity_new = stack_max;
10700 else
10702
10703 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10704 if (new_item)
10705 {
10706 new_item.SetResultOfSplit(true);
10707 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10709 new_item.SetQuantity(split_quantity_new);
10710 }
10711 }
10712 else if (destination_entity && slot_id == -1)
10713 {
10714 if (quantity > stack_max)
10715 split_quantity_new = stack_max;
10716 else
10717 split_quantity_new = quantity;
10718
10720 {
10723 }
10724
10725 if (new_item)
10726 {
10727 new_item.SetResultOfSplit(true);
10728 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10730 new_item.SetQuantity(split_quantity_new);
10731 }
10732 }
10733 else
10734 {
10735 if (stack_max != 0)
10736 {
10738 {
10740 }
10741
10742 if (split_quantity_new == 0)
10743 {
10744 if (!
GetGame().IsMultiplayer())
10745 player.PhysicalPredictiveDropItem(this);
10746 else
10747 player.ServerDropEntity(this);
10748 return;
10749 }
10750
10752
10753 if (new_item)
10754 {
10755 new_item.SetResultOfSplit(true);
10756 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10758 new_item.SetQuantity(stack_max);
10759 new_item.PlaceOnSurface();
10760 }
10761 }
10762 }
10763 }
10764
10766 {
10768 return;
10769
10770 float split_quantity_new;
10774 InventoryLocation loc = new InventoryLocation;
10775
10776 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10777 {
10779 split_quantity_new = stack_max;
10780 else
10782
10783 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10784 if (new_item)
10785 {
10786 new_item.SetResultOfSplit(true);
10787 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10789 new_item.SetQuantity(split_quantity_new);
10790 }
10791 }
10792 else if (destination_entity && slot_id == -1)
10793 {
10794 if (quantity > stack_max)
10795 split_quantity_new = stack_max;
10796 else
10797 split_quantity_new = quantity;
10798
10800 {
10803 }
10804
10805 if (new_item)
10806 {
10807 new_item.SetResultOfSplit(true);
10808 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10810 new_item.SetQuantity(split_quantity_new);
10811 }
10812 }
10813 else
10814 {
10815 if (stack_max != 0)
10816 {
10818 {
10820 }
10821
10823
10824 if (new_item)
10825 {
10826 new_item.SetResultOfSplit(true);
10827 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10829 new_item.SetQuantity(stack_max);
10830 new_item.PlaceOnSurface();
10831 }
10832 }
10833 }
10834 }
10835
10837 {
10839 return;
10840
10842 {
10843 if (ScriptInputUserData.CanStoreInputUserData())
10844 {
10845 ScriptInputUserData ctx = new ScriptInputUserData;
10850 dst.WriteToContext(ctx);
10852 }
10853 }
10854 else if (!
GetGame().IsMultiplayer())
10855 {
10857 }
10858 }
10859
10861 {
10863 return;
10864
10866 {
10867 if (ScriptInputUserData.CanStoreInputUserData())
10868 {
10869 ScriptInputUserData ctx = new ScriptInputUserData;
10874 ctx.
Write(destination_entity);
10880 }
10881 }
10882 else if (!
GetGame().IsMultiplayer())
10883 {
10885 }
10886 }
10887
10889 {
10891 }
10892
10894 {
10896 return this;
10897
10899 float split_quantity_new;
10901 if (dst.IsValid())
10902 {
10903 int slot_id = dst.GetSlot();
10905
10906 if (quantity > stack_max)
10907 split_quantity_new = stack_max;
10908 else
10909 split_quantity_new = quantity;
10910
10912
10913 if (new_item)
10914 {
10915 new_item.SetResultOfSplit(true);
10916 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10919 }
10920
10921 return new_item;
10922 }
10923
10924 return null;
10925 }
10926
10928 {
10930 return;
10931
10933 float split_quantity_new;
10935 if (destination_entity)
10936 {
10938 if (quantity > stackable)
10939 split_quantity_new = stackable;
10940 else
10941 split_quantity_new = quantity;
10942
10943 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10944 if (new_item)
10945 {
10946 new_item.SetResultOfSplit(true);
10947 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10949 new_item.SetQuantity(split_quantity_new);
10950 }
10951 }
10952 }
10953
10955 {
10957 return;
10958
10960 {
10961 if (ScriptInputUserData.CanStoreInputUserData())
10962 {
10963 ScriptInputUserData ctx = new ScriptInputUserData;
10968 ItemBase destination_entity =
this;
10969 ctx.
Write(destination_entity);
10973 }
10974 }
10975 else if (!
GetGame().IsMultiplayer())
10976 {
10978 }
10979 }
10980
10982 {
10984 return;
10985
10987 float split_quantity_new;
10989 if (player)
10990 {
10992 if (quantity > stackable)
10993 split_quantity_new = stackable;
10994 else
10995 split_quantity_new = quantity;
10996
10997 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10998 new_item =
ItemBase.Cast(in_hands);
10999 if (new_item)
11000 {
11001 new_item.SetResultOfSplit(true);
11002 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11004 new_item.SetQuantity(split_quantity_new);
11005 }
11006 }
11007 }
11008
11010 {
11012 return;
11013
11015 float split_quantity_new = Math.Floor(quantity * 0.5);
11016
11018
11019 if (new_item)
11020 {
11021 if (new_item.GetQuantityMax() < split_quantity_new)
11022 {
11023 split_quantity_new = new_item.GetQuantityMax();
11024 }
11025
11026 new_item.SetResultOfSplit(true);
11027 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11028
11030 {
11033 }
11034 else
11035 {
11038 }
11039 }
11040 }
11041
11043 {
11045 return;
11046
11048 float split_quantity_new = Math.Floor(quantity / 2);
11049
11050 InventoryLocation invloc = new InventoryLocation;
11052
11054 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11055
11056 if (new_item)
11057 {
11058 if (new_item.GetQuantityMax() < split_quantity_new)
11059 {
11060 split_quantity_new = new_item.GetQuantityMax();
11061 }
11063 {
11066 }
11067 else
11068 {
11071 }
11072 }
11073 }
11074
11077 {
11078 SetWeightDirty();
11080
11081 if (parent)
11082 parent.OnAttachmentQuantityChangedEx(this, delta);
11083
11085 {
11087 {
11089 }
11091 {
11092 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11094 }
11095 }
11096
11097 }
11098
11101 {
11102
11103 }
11104
11107 {
11109 }
11110
11112 {
11113 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11114
11116 {
11117 if (newLevel == GameConstants.STATE_RUINED)
11118 {
11120 EntityAI parent = GetHierarchyParent();
11121 if (parent && parent.IsFireplace())
11122 {
11123 CargoBase cargo = GetInventory().GetCargo();
11124 if (cargo)
11125 {
11127 {
11129 }
11130 }
11131 }
11132 }
11133
11135 {
11136
11138 return;
11139 }
11140
11141 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11142 {
11144 }
11145 }
11146 }
11147
11148
11150 {
11151 super.OnRightClick();
11152
11154 {
11156 {
11157 if (ScriptInputUserData.CanStoreInputUserData())
11158 {
11159 vector m4[4];
11161
11162 EntityAI root = GetHierarchyRoot();
11163
11164 InventoryLocation dst = new InventoryLocation;
11166 {
11167 if (root)
11168 {
11169 root.GetTransform(m4);
11171 }
11172 else
11173 GetInventory().GetCurrentInventoryLocation(dst);
11174 }
11175 else
11176 {
11178
11179
11180 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11181 {
11182 if (root)
11183 {
11184 root.GetTransform(m4);
11186 }
11187 else
11188 GetInventory().GetCurrentInventoryLocation(dst);
11189 }
11190 else
11191 {
11192 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11193 }
11194 }
11195
11196 ScriptInputUserData ctx = new ScriptInputUserData;
11204 }
11205 }
11206 else if (!
GetGame().IsMultiplayer())
11207 {
11209 }
11210 }
11211 }
11212
11213 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11214 {
11215
11216 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11217 return false;
11218
11219 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11220 return false;
11221
11222
11224 return false;
11225
11226
11227 Magazine mag = Magazine.Cast(this);
11228 if (mag)
11229 {
11230 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11231 return false;
11232
11233 if (stack_max_limit)
11234 {
11235 Magazine other_mag = Magazine.Cast(other_item);
11236 if (other_item)
11237 {
11238 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11239 return false;
11240 }
11241
11242 }
11243 }
11244 else
11245 {
11246
11248 return false;
11249
11251 return false;
11252 }
11253
11254 PlayerBase player = null;
11255 if (CastTo(player, GetHierarchyRootPlayer()))
11256 {
11257 if (player.GetInventory().HasAttachment(this))
11258 return false;
11259
11260 if (player.IsItemsToDelete())
11261 return false;
11262 }
11263
11264 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11265 return false;
11266
11267 int slotID;
11269 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11270 return false;
11271
11272 return true;
11273 }
11274
11276 {
11278 }
11279
11281 {
11282 return m_IsResultOfSplit;
11283 }
11284
11286 {
11287 m_IsResultOfSplit = value;
11288 }
11289
11291 {
11293 }
11294
11296 {
11297 float other_item_quantity = other_item.GetQuantity();
11298 float this_free_space;
11299
11301
11303
11304 if (other_item_quantity > this_free_space)
11305 {
11306 return this_free_space;
11307 }
11308 else
11309 {
11310 return other_item_quantity;
11311 }
11312 }
11313
11315 {
11317 }
11318
11320 {
11322 return;
11323
11324 if (!IsMagazine() && other_item)
11325 {
11327 if (quantity_used != 0)
11328 {
11329 float hp1 = GetHealth01("","");
11330 float hp2 = other_item.GetHealth01("","");
11331 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11332 hpResult = hpResult / (
GetQuantity() + quantity_used);
11333
11334 hpResult *= GetMaxHealth();
11335 Math.Round(hpResult);
11336 SetHealth("", "Health", hpResult);
11337
11339 other_item.AddQuantity(-quantity_used);
11340 }
11341 }
11343 }
11344
11346 {
11347 #ifdef SERVER
11348 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11349 GetHierarchyParent().IncreaseLifetimeUp();
11350 #endif
11351 };
11352
11354 {
11355 PlayerBase p = PlayerBase.Cast(player);
11356
11357 array<int> recipesIds = p.m_Recipes;
11358 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11359 if (moduleRecipesManager)
11360 {
11361 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11362 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11363 }
11364
11365 for (int i = 0;i < recipesIds.Count(); i++)
11366 {
11367 int key = recipesIds.Get(i);
11368 string recipeName = moduleRecipesManager.GetRecipeName(key);
11370 }
11371 }
11372
11373
11374 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11375 {
11376 super.GetDebugActions(outputList);
11377
11378
11383
11384
11388
11392
11393
11396
11397
11399 {
11402 }
11403
11405
11408
11412 }
11413
11414
11415
11416
11418 {
11419 super.OnAction(action_id, player, ctx);
11420 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11421 {
11422 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11423 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11424 PlayerBase p = PlayerBase.Cast(player);
11425 if (
EActions.RECIPES_RANGE_START < 1000)
11426 {
11427 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11428 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11429 }
11430 }
11431 #ifndef SERVER
11432 else if (action_id ==
EActions.WATCH_PLAYER)
11433 {
11434 PluginDeveloper.SetDeveloperItemClientEx(player);
11435 }
11436 #endif
11438 {
11439 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11440 {
11441 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11442 OnDebugButtonPressServer(id + 1);
11443 }
11444
11445 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11446 {
11447 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11449 }
11450
11451 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11452 {
11453 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11455 }
11456
11457 else if (action_id ==
EActions.ADD_QUANTITY)
11458 {
11459 if (IsMagazine())
11460 {
11461 Magazine mag = Magazine.Cast(this);
11462 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11463 }
11464 else
11465 {
11467 }
11468
11469 if (m_EM)
11470 {
11471 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11472 }
11473
11474 }
11475
11476 else if (action_id ==
EActions.REMOVE_QUANTITY)
11477 {
11478 if (IsMagazine())
11479 {
11480 Magazine mag2 = Magazine.Cast(this);
11481 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11482 }
11483 else
11484 {
11486 }
11487 if (m_EM)
11488 {
11489 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11490 }
11491
11492 }
11493
11494 else if (action_id ==
EActions.SET_QUANTITY_0)
11495 {
11497
11498 if (m_EM)
11499 {
11500 m_EM.SetEnergy(0);
11501 }
11502 }
11503
11504 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11505 {
11507
11508 if (m_EM)
11509 {
11510 m_EM.SetEnergy(m_EM.GetEnergyMax());
11511 }
11512 }
11513
11514 else if (action_id ==
EActions.ADD_HEALTH)
11515 {
11516 AddHealth("","",GetMaxHealth("","Health")/5);
11517 }
11518 else if (action_id ==
EActions.REMOVE_HEALTH)
11519 {
11520 AddHealth("","",-GetMaxHealth("","Health")/5);
11521 }
11522 else if (action_id ==
EActions.DESTROY_HEALTH)
11523 {
11524 SetHealth01("","",0);
11525 }
11526 else if (action_id ==
EActions.WATCH_ITEM)
11527 {
11529 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11530 #ifdef DEVELOPER
11531 SetDebugDeveloper_item(this);
11532 #endif
11533 }
11534
11535 else if (action_id ==
EActions.ADD_TEMPERATURE)
11536 {
11537 AddTemperature(20);
11538
11539 }
11540
11541 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11542 {
11543 AddTemperature(-20);
11544
11545 }
11546
11547 else if (action_id ==
EActions.FLIP_FROZEN)
11548 {
11549 SetFrozen(!GetIsFrozen());
11550
11551 }
11552
11553 else if (action_id ==
EActions.ADD_WETNESS)
11554 {
11556
11557 }
11558
11559 else if (action_id ==
EActions.REMOVE_WETNESS)
11560 {
11562
11563 }
11564
11565 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11566 {
11569
11570
11571 }
11572
11573 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11574 {
11577 }
11578
11579 else if (action_id ==
EActions.MAKE_SPECIAL)
11580 {
11581 auto debugParams = DebugSpawnParams.WithPlayer(player);
11582 OnDebugSpawnEx(debugParams);
11583 }
11584
11585 else if (action_id ==
EActions.DELETE)
11586 {
11587 Delete();
11588 }
11589
11590 }
11591
11592
11593 return false;
11594 }
11595
11596
11597
11598
11602
11605
11606
11607
11609 {
11610 return false;
11611 }
11612
11613
11615 {
11616 return true;
11617 }
11618
11619
11621 {
11622 return true;
11623 }
11624
11625
11626
11628 {
11629 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11631 }
11632
11635 {
11636 return null;
11637 }
11638
11640 {
11641 return false;
11642 }
11643
11645 {
11646 return false;
11647 }
11648
11652
11653
11655 {
11656 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11657 return module_repairing.CanRepair(this, item_repair_kit);
11658 }
11659
11660
11661 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11662 {
11663 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11664 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11665 }
11666
11667
11669 {
11670
11671
11672
11673
11674
11675
11676
11677
11678 return 1;
11679 }
11680
11681
11682
11684 {
11686 }
11687
11688
11689
11691 {
11693 }
11694
11695
11704 {
11705 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11706
11707 if (player)
11708 {
11709 player.MessageStatus(text);
11710 }
11711 }
11712
11713
11722 {
11723 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11724
11725 if (player)
11726 {
11727 player.MessageAction(text);
11728 }
11729 }
11730
11731
11740 {
11741 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11742
11743 if (player)
11744 {
11745 player.MessageFriendly(text);
11746 }
11747 }
11748
11749
11758 {
11759 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11760
11761 if (player)
11762 {
11763 player.MessageImportant(text);
11764 }
11765 }
11766
11768 {
11769 return true;
11770 }
11771
11772
11773 override bool KindOf(
string tag)
11774 {
11775 bool found = false;
11776 string item_name = this.
GetType();
11779
11780 int array_size = item_tag_array.Count();
11781 for (int i = 0; i < array_size; i++)
11782 {
11783 if (item_tag_array.Get(i) == tag)
11784 {
11785 found = true;
11786 break;
11787 }
11788 }
11789 return found;
11790 }
11791
11792
11794 {
11795
11796 super.OnRPC(sender, rpc_type,ctx);
11797
11798
11799 switch (rpc_type)
11800 {
11801 #ifndef SERVER
11802 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11803 Param2<bool, string> p = new Param2<bool, string>(false, "");
11804
11806 return;
11807
11808 bool play = p.param1;
11809 string soundSet = p.param2;
11810
11811 if (play)
11812 {
11814 {
11816 {
11818 }
11819 }
11820 else
11821 {
11823 }
11824 }
11825 else
11826 {
11828 }
11829
11830 break;
11831 #endif
11832
11833 }
11834
11836 {
11838 }
11839 }
11840
11841
11842
11843
11845 {
11846 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11847 return plugin.GetID(
name);
11848 }
11849
11851 {
11852 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11853 return plugin.GetName(id);
11854 }
11855
11858 {
11859
11860
11861 int varFlags;
11862 if (!ctx.
Read(varFlags))
11863 return;
11864
11865 if (varFlags & ItemVariableFlags.FLOAT)
11866 {
11868 }
11869 }
11870
11872 {
11873
11874 super.SerializeNumericalVars(floats_out);
11875
11876
11877
11879 {
11881 }
11882
11884 {
11886 }
11887
11889 {
11891 }
11892
11894 {
11899 }
11900
11902 {
11904 }
11905 }
11906
11908 {
11909
11910 super.DeSerializeNumericalVars(floats);
11911
11912
11913 int index = 0;
11914 int mask = Math.Round(floats.Get(index));
11915
11916 index++;
11917
11919 {
11921 {
11923 }
11924 else
11925 {
11926 float quantity = floats.Get(index);
11927 SetQuantity(quantity,
true,
false,
false,
false);
11928 }
11929 index++;
11930 }
11931
11933 {
11934 float wet = floats.Get(index);
11936 index++;
11937 }
11938
11940 {
11941 int liquidtype = Math.Round(floats.Get(index));
11943 index++;
11944 }
11945
11947 {
11949 index++;
11951 index++;
11953 index++;
11955 index++;
11956 }
11957
11959 {
11960 int cleanness = Math.Round(floats.Get(index));
11962 index++;
11963 }
11964 }
11965
11967 {
11968 super.WriteVarsToCTX(ctx);
11969
11970
11972 {
11974 }
11975
11977 {
11979 }
11980
11982 {
11984 }
11985
11987 {
11988 int r,g,b,a;
11994 }
11995
11997 {
11999 }
12000 }
12001
12003 {
12004 if (!super.ReadVarsFromCTX(ctx,version))
12005 return false;
12006
12007 int intValue;
12008 float value;
12009
12010 if (version < 140)
12011 {
12012 if (!ctx.
Read(intValue))
12013 return false;
12014
12015 m_VariablesMask = intValue;
12016 }
12017
12019 {
12020 if (!ctx.
Read(value))
12021 return false;
12022
12024 {
12026 }
12027 else
12028 {
12030 }
12031 }
12032
12033 if (version < 140)
12034 {
12036 {
12037 if (!ctx.
Read(value))
12038 return false;
12039 SetTemperatureDirect(value);
12040 }
12041 }
12042
12044 {
12045 if (!ctx.
Read(value))
12046 return false;
12048 }
12049
12051 {
12052 if (!ctx.
Read(intValue))
12053 return false;
12055 }
12056
12058 {
12059 int r,g,b,a;
12061 return false;
12063 return false;
12065 return false;
12067 return false;
12068
12070 }
12071
12073 {
12074 if (!ctx.
Read(intValue))
12075 return false;
12077 }
12078
12079 if (version >= 138 && version < 140)
12080 {
12082 {
12083 if (!ctx.
Read(intValue))
12084 return false;
12085 SetFrozen(intValue);
12086 }
12087 }
12088
12089 return true;
12090 }
12091
12092
12094 {
12097 {
12099 }
12100
12101 if (!super.OnStoreLoad(ctx, version))
12102 {
12104 return false;
12105 }
12106
12107 if (version >= 114)
12108 {
12109 bool hasQuickBarIndexSaved;
12110
12111 if (!ctx.
Read(hasQuickBarIndexSaved))
12112 {
12114 return false;
12115 }
12116
12117 if (hasQuickBarIndexSaved)
12118 {
12119 int itmQBIndex;
12120
12121
12122 if (!ctx.
Read(itmQBIndex))
12123 {
12125 return false;
12126 }
12127
12128 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12129 if (itmQBIndex != -1 && parentPlayer)
12130 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12131 }
12132 }
12133 else
12134 {
12135
12136 PlayerBase player;
12137 int itemQBIndex;
12138 if (version ==
int.
MAX)
12139 {
12140 if (!ctx.
Read(itemQBIndex))
12141 {
12143 return false;
12144 }
12145 }
12146 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12147 {
12148
12149 if (!ctx.
Read(itemQBIndex))
12150 {
12152 return false;
12153 }
12154 if (itemQBIndex != -1 && player)
12155 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12156 }
12157 }
12158
12159 if (version < 140)
12160 {
12161
12162 if (!LoadVariables(ctx, version))
12163 {
12165 return false;
12166 }
12167 }
12168
12169
12171 {
12173 return false;
12174 }
12175 if (version >= 132)
12176 {
12178 if (raib)
12179 {
12181 {
12183 return false;
12184 }
12185 }
12186 }
12187
12189 return true;
12190 }
12191
12192
12193
12195 {
12196 super.OnStoreSave(ctx);
12197
12198 PlayerBase player;
12199 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12200 {
12202
12203 int itemQBIndex = -1;
12204 itemQBIndex = player.FindQuickBarEntityIndex(this);
12205 ctx.
Write(itemQBIndex);
12206 }
12207 else
12208 {
12210 }
12211
12213
12215 if (raib)
12216 {
12218 }
12219 }
12220
12221
12223 {
12224 super.AfterStoreLoad();
12225
12227 {
12229 }
12230
12232 {
12235 }
12236 }
12237
12239 {
12240 super.EEOnAfterLoad();
12241
12243 {
12245 }
12246
12249 }
12250
12252 {
12253 return false;
12254 }
12255
12256
12257
12259 {
12261 {
12262 #ifdef PLATFORM_CONSOLE
12263
12265 {
12267 if (menu)
12268 {
12270 }
12271 }
12272 #endif
12273 }
12274
12276 {
12279 }
12280
12282 {
12283 SetWeightDirty();
12285 }
12287 {
12290 }
12291
12293 {
12296 }
12298 {
12301 }
12302
12303 super.OnVariablesSynchronized();
12304 }
12305
12306
12307
12309 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12310 {
12311 if (!IsServerCheck(allow_client))
12312 return false;
12313
12315 return false;
12316
12319
12320 if (value <= (min + 0.001))
12321 value = min;
12322
12323 if (value == min)
12324 {
12325 if (destroy_config)
12326 {
12327 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12328 if (dstr)
12329 {
12331 this.Delete();
12332 return true;
12333 }
12334 }
12335 else if (destroy_forced)
12336 {
12338 this.Delete();
12339 return true;
12340 }
12341
12343 }
12344
12347
12349 {
12351
12352 if (delta)
12354 }
12355
12357
12358 return false;
12359 }
12360
12361
12363 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12364 {
12366 }
12367
12369 {
12372 }
12373
12375 {
12378 }
12379
12382 {
12383 float value_clamped = Math.Clamp(value, 0, 1);
12385 SetQuantity(result, destroy_config, destroy_forced);
12386 }
12387
12388
12391 {
12393 }
12394
12396 {
12398 }
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12410 {
12411 int slot = -1;
12412 if (GetInventory())
12413 {
12414 InventoryLocation il = new InventoryLocation;
12415 GetInventory().GetCurrentInventoryLocation(il);
12417 }
12418
12420 }
12421
12423 {
12424 float quantity_max = 0;
12425
12427 {
12428 if (attSlotID != -1)
12429 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12430
12431 if (quantity_max <= 0)
12433 }
12434
12435 if (quantity_max <= 0)
12437
12438 return quantity_max;
12439 }
12440
12442 {
12444 }
12445
12447 {
12449 }
12450
12451
12453 {
12455 }
12456
12458 {
12460 }
12461
12463 {
12465 }
12466
12467
12469 {
12470
12471 float weightEx = GetWeightEx();
12472 float special = GetInventoryAndCargoWeight();
12473 return weightEx - special;
12474 }
12475
12476
12478 {
12480 }
12481
12483 {
12485 {
12486 #ifdef DEVELOPER
12487 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12488 {
12489 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12491 }
12492 #endif
12493
12494 return GetQuantity() * GetConfigWeightModified();
12495 }
12496 else if (HasEnergyManager())
12497 {
12498 #ifdef DEVELOPER
12499 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12500 {
12501 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12502 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12503 }
12504 #endif
12505 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12506 }
12507 else
12508 {
12509 #ifdef DEVELOPER
12510 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12511 {
12512 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12513 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12514 }
12515 #endif
12516 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12517 }
12518 }
12519
12522 {
12523 int item_count = 0;
12525
12526 if (GetInventory().GetCargo() != NULL)
12527 {
12528 item_count = GetInventory().GetCargo().GetItemCount();
12529 }
12530
12531 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12532 {
12533 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12534 if (item)
12535 item_count += item.GetNumberOfItems();
12536 }
12537 return item_count;
12538 }
12539
12542 {
12543 float weight = 0;
12544 float wetness = 1;
12545 if (include_wetness)
12548 {
12549 weight = wetness * m_ConfigWeight;
12550 }
12552 {
12553 weight = 1;
12554 }
12555 return weight;
12556 }
12557
12558
12559
12561 {
12562 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12563 {
12564 GameInventory inv = GetInventory();
12565 array<EntityAI> items = new array<EntityAI>;
12567 for (int i = 0; i < items.Count(); i++)
12568 {
12570 if (item)
12571 {
12573 }
12574 }
12575 }
12576 }
12577
12578
12579
12580
12582 {
12583 float energy = 0;
12584 if (HasEnergyManager())
12585 {
12586 energy = GetCompEM().GetEnergy();
12587 }
12588 return energy;
12589 }
12590
12591
12593 {
12594 super.OnEnergyConsumed();
12595
12597 }
12598
12600 {
12601 super.OnEnergyAdded();
12602
12604 }
12605
12606
12608 {
12609 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12610 {
12612 {
12613 float energy_0to1 = GetCompEM().GetEnergy0To1();
12615 }
12616 }
12617 }
12618
12619
12621 {
12622 return ConfigGetFloat("heatIsolation");
12623 }
12624
12626 {
12628 }
12629
12631 {
12632 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12633 if (
GetGame().ConfigIsExisting(paramPath))
12635
12636 return 0.0;
12637 }
12638
12640 {
12641 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12642 if (
GetGame().ConfigIsExisting(paramPath))
12644
12645 return 0.0;
12646 }
12647
12648 override void SetWet(
float value,
bool allow_client =
false)
12649 {
12650 if (!IsServerCheck(allow_client))
12651 return;
12652
12655
12657
12658 m_VarWet = Math.Clamp(value, min, max);
12659
12661 {
12664 }
12665 }
12666
12667 override void AddWet(
float value)
12668 {
12670 }
12671
12673 {
12675 }
12676
12678 {
12680 }
12681
12683 {
12685 }
12686
12688 {
12690 }
12691
12693 {
12695 }
12696
12697 override void OnWetChanged(
float newVal,
float oldVal)
12698 {
12701 if (newLevel != oldLevel)
12702 {
12704 }
12705 }
12706
12708 {
12709 SetWeightDirty();
12710 }
12711
12713 {
12714 return GetWetLevelInternal(
m_VarWet);
12715 }
12716
12717
12718
12720 {
12722 }
12723
12725 {
12727 }
12728
12730 {
12732 }
12733
12735 {
12737 }
12738
12739
12740
12742 {
12743 if (ConfigIsExisting("itemModelLength"))
12744 {
12745 return ConfigGetFloat("itemModelLength");
12746 }
12747 return 0;
12748 }
12749
12751 {
12752 if (ConfigIsExisting("itemAttachOffset"))
12753 {
12754 return ConfigGetFloat("itemAttachOffset");
12755 }
12756 return 0;
12757 }
12758
12759 override void SetCleanness(
int value,
bool allow_client =
false)
12760 {
12761 if (!IsServerCheck(allow_client))
12762 return;
12763
12765
12767
12770 }
12771
12773 {
12775 }
12776
12778 {
12779 return true;
12780 }
12781
12782
12783
12784
12786 {
12788 }
12789
12791 {
12793 }
12794
12795
12796
12797
12798 override void SetColor(
int r,
int g,
int b,
int a)
12799 {
12805 }
12807 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12808 {
12813 }
12814
12816 {
12818 }
12819
12822 {
12823 int r,g,b,a;
12825 r = r/255;
12826 g = g/255;
12827 b = b/255;
12828 a = a/255;
12829 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12830 }
12831
12832
12833
12834 override void SetLiquidType(
int value,
bool allow_client =
false)
12835 {
12836 if (!IsServerCheck(allow_client))
12837 return;
12838
12843 }
12844
12846 {
12847 return ConfigGetInt("varLiquidTypeInit");
12848 }
12849
12851 {
12853 }
12854
12856 {
12858 SetFrozen(false);
12859 }
12860
12863 {
12864 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12865 }
12866
12867
12870 {
12871 PlayerBase nplayer;
12872 if (PlayerBase.CastTo(nplayer, player))
12873 {
12875
12876 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12877 }
12878 }
12879
12880
12883 {
12884 PlayerBase nplayer;
12885 if (PlayerBase.CastTo(nplayer,player))
12886 {
12887
12888 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12889
12890 }
12891
12892
12893 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12894
12895
12896 if (HasEnergyManager())
12897 {
12898 GetCompEM().UpdatePlugState();
12899 }
12900 }
12901
12902
12904 {
12905 super.OnPlacementStarted(player);
12906
12908 }
12909
12910 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12911 {
12913 {
12914 m_AdminLog.OnPlacementComplete(player,
this);
12915 }
12916
12917 super.OnPlacementComplete(player, position, orientation);
12918 }
12919
12920
12921
12922
12923
12925 {
12927 {
12928 return true;
12929 }
12930 else
12931 {
12932 return false;
12933 }
12934 }
12935
12936
12938 {
12940 {
12942 }
12943 }
12944
12945
12947 {
12949 }
12950
12952 {
12954 }
12955
12956 override void InsertAgent(
int agent,
float count = 1)
12957 {
12958 if (count < 1)
12959 return;
12960
12962 }
12963
12966 {
12968 }
12969
12970
12972 {
12974 }
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13018 {
13020 return false;
13021 return true;
13022 }
13023
13025 {
13026
13028 }
13029
13030
13033 {
13034 super.CheckForRoofLimited(timeTresholdMS);
13035
13037 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13038 {
13039 m_PreviousRoofTestTime = time;
13040 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13041 }
13042 }
13043
13044
13046 {
13048 {
13049 return 0;
13050 }
13051
13052 if (GetInventory().GetAttachmentSlotsCount() != 0)
13053 {
13054 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13055 if (filter)
13056 return filter.GetProtectionLevel(type, false, system);
13057 else
13058 return 0;
13059 }
13060
13061 string subclassPath, entryName;
13062
13063 switch (type)
13064 {
13066 entryName = "biological";
13067 break;
13069 entryName = "chemical";
13070 break;
13071 default:
13072 entryName = "biological";
13073 break;
13074 }
13075
13076 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13077
13079 }
13080
13081
13082
13085 {
13086 if (!IsMagazine())
13088
13090 }
13091
13092
13093
13094
13095
13100 {
13101 return true;
13102 }
13103
13105 {
13107 }
13108
13109
13110
13111
13112
13114 {
13115 if (parent)
13116 {
13117 if (parent.IsInherited(DayZInfected))
13118 return true;
13119
13120 if (!parent.IsRuined())
13121 return true;
13122 }
13123
13124 return true;
13125 }
13126
13128 {
13129 if (!super.CanPutAsAttachment(parent))
13130 {
13131 return false;
13132 }
13133
13134 if (!IsRuined() && !parent.IsRuined())
13135 {
13136 return true;
13137 }
13138
13139 return false;
13140 }
13141
13143 {
13144
13145
13146
13147
13148 return super.CanReceiveItemIntoCargo(item);
13149 }
13150
13152 {
13153
13154
13155
13156
13157 GameInventory attachmentInv = attachment.GetInventory();
13159 {
13160 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13161 return false;
13162 }
13163
13164 InventoryLocation loc = new InventoryLocation();
13165 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13166 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13167 return false;
13168
13169 return super.CanReceiveAttachment(attachment, slotId);
13170 }
13171
13173 {
13174 if (!super.CanReleaseAttachment(attachment))
13175 return false;
13176
13177 return GetInventory().AreChildrenAccessible();
13178 }
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13201 {
13202 int id = muzzle_owner.GetMuzzleID();
13203 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13204
13205 if (WPOF_array)
13206 {
13207 for (int i = 0; i < WPOF_array.Count(); i++)
13208 {
13209 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13210
13211 if (WPOF)
13212 {
13213 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13214 }
13215 }
13216 }
13217 }
13218
13219
13221 {
13222 int id = muzzle_owner.GetMuzzleID();
13224
13225 if (WPOBE_array)
13226 {
13227 for (int i = 0; i < WPOBE_array.Count(); i++)
13228 {
13229 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13230
13231 if (WPOBE)
13232 {
13233 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13234 }
13235 }
13236 }
13237 }
13238
13239
13241 {
13242 int id = muzzle_owner.GetMuzzleID();
13243 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13244
13245 if (WPOOH_array)
13246 {
13247 for (int i = 0; i < WPOOH_array.Count(); i++)
13248 {
13249 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13250
13251 if (WPOOH)
13252 {
13253 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13254 }
13255 }
13256 }
13257 }
13258
13259
13261 {
13262 int id = muzzle_owner.GetMuzzleID();
13263 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13264
13265 if (WPOOH_array)
13266 {
13267 for (int i = 0; i < WPOOH_array.Count(); i++)
13268 {
13269 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13270
13271 if (WPOOH)
13272 {
13273 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13274 }
13275 }
13276 }
13277 }
13278
13279
13281 {
13282 int id = muzzle_owner.GetMuzzleID();
13283 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13284
13285 if (WPOOH_array)
13286 {
13287 for (int i = 0; i < WPOOH_array.Count(); i++)
13288 {
13289 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13290
13291 if (WPOOH)
13292 {
13293 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13294 }
13295 }
13296 }
13297 }
13298
13299
13300
13302 {
13304 {
13305 return true;
13306 }
13307
13308 return false;
13309 }
13310
13312 {
13314 {
13315 return true;
13316 }
13317
13318 return false;
13319 }
13320
13322 {
13324 {
13325 return true;
13326 }
13327
13328 return false;
13329 }
13330
13332 {
13333 return false;
13334 }
13335
13338 {
13339 return UATimeSpent.DEFAULT_DEPLOY;
13340 }
13341
13342
13343
13344
13346 {
13348 SetSynchDirty();
13349 }
13350
13352 {
13354 }
13355
13356
13358 {
13359 return false;
13360 }
13361
13364 {
13365 string att_type = "None";
13366
13367 if (ConfigIsExisting("soundAttType"))
13368 {
13369 att_type = ConfigGetString("soundAttType");
13370 }
13371
13373 }
13374
13376 {
13378 }
13379
13380
13381
13382
13383
13387
13389 {
13392
13394 }
13395
13396
13398 {
13400 return;
13401
13403
13406
13409
13410 SoundParameters params = new SoundParameters();
13414 }
13415
13416
13418 {
13420 return;
13421
13423 SetSynchDirty();
13424
13427 }
13428
13429
13431 {
13433 return;
13434
13436 SetSynchDirty();
13437
13440 }
13441
13443 {
13445 }
13446
13448 {
13450 }
13451
13454 {
13455 if (!
GetGame().IsDedicatedServer())
13456 {
13457 if (ConfigIsExisting("attachSoundSet"))
13458 {
13459 string cfg_path = "";
13460 string soundset = "";
13461 string type_name =
GetType();
13462
13465 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13466 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13467
13468 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13469 {
13470 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13471 {
13472 if (cfg_slot_array[i] == slot_type)
13473 {
13474 soundset = cfg_soundset_array[i];
13475 break;
13476 }
13477 }
13478 }
13479
13480 if (soundset != "")
13481 {
13482 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13484 }
13485 }
13486 }
13487 }
13488
13490 {
13491
13492 }
13493
13494 void OnApply(PlayerBase player);
13495
13497 {
13498 return 1.0;
13499 };
13500
13502 {
13504 }
13505
13507 {
13509 }
13510
13512
13514 {
13515 SetDynamicPhysicsLifeTime(0.01);
13517 }
13518
13520 {
13521 array<string> zone_names = new array<string>;
13522 GetDamageZones(zone_names);
13523 for (int i = 0; i < zone_names.Count(); i++)
13524 {
13525 SetHealthMax(zone_names.Get(i),"Health");
13526 }
13527 SetHealthMax("","Health");
13528 }
13529
13532 {
13533 float global_health = GetHealth01("","Health");
13534 array<string> zones = new array<string>;
13535 GetDamageZones(zones);
13536
13537 for (int i = 0; i < zones.Count(); i++)
13538 {
13539 SetHealth01(zones.Get(i),"Health",global_health);
13540 }
13541 }
13542
13545 {
13546 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13547 }
13548
13550 {
13551 if (!hasRootAsPlayer)
13552 {
13553 if (refParentIB)
13554 {
13555
13556 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13557 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13558
13559 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13560 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13561
13564 }
13565 else
13566 {
13567
13570 }
13571 }
13572 }
13573
13575 {
13577 {
13578 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13579 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13580 {
13581 float heatPermCoef = 1.0;
13583 while (ent)
13584 {
13585 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13586 ent = ent.GetHierarchyParent();
13587 }
13588
13589 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13590 }
13591 }
13592 }
13593
13595 {
13596
13597 EntityAI parent = GetHierarchyParent();
13598 if (!parent)
13599 {
13600 hasParent = false;
13601 hasRootAsPlayer = false;
13602 }
13603 else
13604 {
13605 hasParent = true;
13606 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13607 refParentIB =
ItemBase.Cast(parent);
13608 }
13609 }
13610
13611 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13612 {
13613
13614 }
13615
13617 {
13618
13619 return false;
13620 }
13621
13623 {
13624
13625
13626 return false;
13627 }
13628
13630 {
13631
13632 return false;
13633 }
13634
13637 {
13638 return !GetIsFrozen() &&
IsOpen();
13639 }
13640
13642 {
13643 bool hasParent = false, hasRootAsPlayer = false;
13645
13646 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13647 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13648
13649 if (wwtu || foodDecay)
13650 {
13654
13655 if (processWetness || processTemperature || processDecay)
13656 {
13658
13659 if (processWetness)
13660 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13661
13662 if (processTemperature)
13664
13665 if (processDecay)
13666 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13667 }
13668 }
13669 }
13670
13673 {
13675 }
13676
13678 {
13681
13682 return super.GetTemperatureFreezeThreshold();
13683 }
13684
13686 {
13689
13690 return super.GetTemperatureThawThreshold();
13691 }
13692
13694 {
13697
13698 return super.GetItemOverheatThreshold();
13699 }
13700
13702 {
13704 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13705
13706 return super.GetTemperatureFreezeTime();
13707 }
13708
13710 {
13712 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13713
13714 return super.GetTemperatureThawTime();
13715 }
13716
13721
13723 {
13724 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13725 }
13726
13728 {
13729 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13730 }
13731
13734 {
13736 }
13737
13739 {
13741 }
13742
13744 {
13746 }
13747
13750 {
13751 return null;
13752 }
13753
13756 {
13757 return false;
13758 }
13759
13761 {
13763 {
13766 if (!trg)
13767 {
13769 explosive = this;
13770 }
13771
13772 explosive.PairRemote(trg);
13774
13775 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13776 trg.SetPersistentPairID(persistentID);
13777 explosive.SetPersistentPairID(persistentID);
13778
13779 return true;
13780 }
13781 return false;
13782 }
13783
13786 {
13787 float ret = 1.0;
13790 ret *= GetHealth01();
13791
13792 return ret;
13793 }
13794
13795 #ifdef DEVELOPER
13796 override void SetDebugItem()
13797 {
13798 super.SetDebugItem();
13799 _itemBase = this;
13800 }
13801
13803 {
13804 string text = super.GetDebugText();
13805
13807 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13808
13809 return text;
13810 }
13811 #endif
13812
13814 {
13815 return true;
13816 }
13817
13819
13821
13823 {
13826 }
13827
13828
13836
13852}
13853
13855{
13857 if (entity)
13858 {
13859 bool is_item = entity.IsInherited(
ItemBase);
13860 if (is_item && full_quantity)
13861 {
13864 }
13865 }
13866 else
13867 {
13869 return NULL;
13870 }
13871 return entity;
13872}
13873
13875{
13876 if (item)
13877 {
13878 if (health > 0)
13879 item.SetHealth("", "", health);
13880
13881 if (item.CanHaveTemperature())
13882 {
13884 if (item.CanFreeze())
13885 item.SetFrozen(false);
13886 }
13887
13888 if (item.HasEnergyManager())
13889 {
13890 if (quantity >= 0)
13891 {
13892 item.GetCompEM().SetEnergy0To1(quantity);
13893 }
13894 else
13895 {
13897 }
13898 }
13899 else if (item.IsMagazine())
13900 {
13901 Magazine mag = Magazine.Cast(item);
13902 if (quantity >= 0)
13903 {
13904 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13905 }
13906 else
13907 {
13909 }
13910
13911 }
13912 else
13913 {
13914 if (quantity >= 0)
13915 {
13916 item.SetQuantityNormalized(quantity, false);
13917 }
13918 else
13919 {
13921 }
13922
13923 }
13924 }
13925}
13926
13927#ifdef DEVELOPER
13929#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.