9046{
9048 {
9049 return true;
9050 }
9051};
9052
9053
9054
9056{
9060
9062
9065
9066
9067
9068
9069
9078
9084
9089
9094
9115 protected bool m_IsResultOfSplit
9116
9118
9123
9124
9125
9127
9131
9132
9133
9135
9138
9139
9140
9146
9147
9155
9158
9159
9161
9162
9164
9165
9170
9171
9176
9177
9179
9180
9182 {
9187
9188 if (!
GetGame().IsDedicatedServer())
9189 {
9191 {
9193
9195 {
9197 }
9198 }
9199
9202 }
9203
9204 m_OldLocation = null;
9205
9207 {
9209 }
9210
9211 if (ConfigIsExisting("headSelectionsToHide"))
9212 {
9215 }
9216
9218 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9219 {
9221 }
9222
9224
9225 m_IsResultOfSplit = false;
9226
9228 }
9229
9231 {
9232 super.InitItemVariables();
9233
9239 m_Count = ConfigGetInt(
"count");
9240
9243
9248
9251
9256
9268
9272
9273
9276 if (ConfigIsExisting("canBeSplit"))
9277 {
9280 }
9281
9283 if (ConfigIsExisting("itemBehaviour"))
9285
9286
9289 RegisterNetSyncVariableInt("m_VarLiquidType");
9290 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9291
9292 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9293 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9294 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9295
9296 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9297 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9298 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9299 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9300
9301 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9302 RegisterNetSyncVariableBool("m_IsTakeable");
9303 RegisterNetSyncVariableBool("m_IsHologram");
9304
9307 {
9310 }
9311
9313
9315 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9317
9318 }
9319
9321 {
9323 }
9324
9326 {
9329 {
9334 }
9335 }
9336
9337 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9338 {
9340 {
9343 }
9344
9346 }
9347
9349 {
9355 }
9356
9358
9360 {
9362
9363 if (!action)
9364 {
9365 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9366 return;
9367 }
9368
9370 if (!ai)
9371 {
9373 return;
9374 }
9375
9377 if (!action_array)
9378 {
9379 action_array = new array<ActionBase_Basic>;
9381 }
9382 if (LogManager.IsActionLogEnable())
9383 {
9384 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9385 }
9386
9387 if (action_array.Find(action) != -1)
9388 {
9389 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9390 }
9391 else
9392 {
9393 action_array.Insert(action);
9394 }
9395 }
9396
9398 {
9400 ActionBase action = player.GetActionManager().GetAction(actionName);
9403
9404 if (action_array)
9405 {
9406 action_array.RemoveItem(action);
9407 }
9408 }
9409
9410
9411
9413 {
9414 ActionOverrideData overrideData = new ActionOverrideData();
9418
9420 if (!actionMap)
9421 {
9424 }
9425
9426 actionMap.Insert(this.
Type(), overrideData);
9427
9428 }
9429
9431
9433
9434
9436 {
9439
9442
9443 string config_to_search = "CfgVehicles";
9444 string muzzle_owner_config;
9445
9447 {
9448 if (IsInherited(Weapon))
9449 config_to_search = "CfgWeapons";
9450
9451 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9452
9453 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9454
9456
9457 if (config_OnFire_subclass_count > 0)
9458 {
9459 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9460
9461 for (int i = 0; i < config_OnFire_subclass_count; i++)
9462 {
9463 string particle_class = "";
9465 string config_OnFire_entry = config_OnFire_class + particle_class;
9466 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9467 WPOF_array.Insert(WPOF);
9468 }
9469
9470
9472 }
9473 }
9474
9476 {
9477 config_to_search = "CfgWeapons";
9478 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9479
9480 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9481
9483
9484 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9485 {
9486 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9487
9488 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9489 {
9490 string particle_class2 = "";
9492 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9493 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9494 WPOBE_array.Insert(WPOBE);
9495 }
9496
9497
9499 }
9500 }
9501 }
9502
9503
9505 {
9508
9510 {
9511 string config_to_search = "CfgVehicles";
9512
9513 if (IsInherited(Weapon))
9514 config_to_search = "CfgWeapons";
9515
9516 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9517 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9518
9519 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9520 {
9521
9523
9525 {
9527 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9529 return;
9530 }
9531
9534
9535
9536
9538 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9539
9540 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9541 {
9542 string particle_class = "";
9544 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9546
9547 if (entry_type == CT_CLASS)
9548 {
9549 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9550 WPOOH_array.Insert(WPOF);
9551 }
9552 }
9553
9554
9556 }
9557 }
9558 }
9559
9561 {
9563 }
9564
9566 {
9568 {
9570
9573
9576
9577 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9578 }
9579 }
9580
9582 {
9584 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9585
9587 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9588
9590 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9591
9593 {
9595 }
9596 }
9597
9599 {
9601 }
9602
9604 {
9607 else
9609
9611 {
9614 }
9615 else
9616 {
9619
9622 }
9623
9625 }
9626
9628 {
9630 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9631 }
9632
9634 {
9636 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9638 }
9639
9641 {
9643 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9644 }
9645
9647 {
9650
9651 OverheatingParticle OP = new OverheatingParticle();
9656
9658 }
9659
9661 {
9664
9665 return -1;
9666 }
9667
9669 {
9671 {
9674
9675 for (int i = count; i > 0; --i)
9676 {
9677 int id = i - 1;
9680
9683
9684 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9685 {
9686 if (p)
9687 {
9690 }
9691 }
9692 }
9693 }
9694 }
9695
9697 {
9699 {
9701 {
9702 int id = i - 1;
9704
9705 if (OP)
9706 {
9708
9709 if (p)
9710 {
9712 }
9713
9714 delete OP;
9715 }
9716 }
9717
9720 }
9721 }
9722
9725 {
9726 return 0.0;
9727 }
9728
9729
9731 {
9732 return 250;
9733 }
9734
9736 {
9737 return 0;
9738 }
9739
9742 {
9744 return true;
9745
9746 return false;
9747 }
9748
9751 {
9754
9756 {
9758 }
9759 else
9760 {
9761
9763 }
9764
9766 }
9767
9774 {
9775 return -1;
9776 }
9777
9778
9779
9780
9782 {
9784 {
9786 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9787
9788 if (r_index >= 0)
9789 {
9790 InventoryLocation r_il = new InventoryLocation;
9791 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9792
9793 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9796 {
9797 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9798 }
9800 {
9801 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9802 }
9803
9804 }
9805
9806 player.GetHumanInventory().ClearUserReservedLocation(this);
9807 }
9808
9811 }
9812
9813
9814
9815
9817 {
9818 return ItemBase.m_DebugActionsMask;
9819 }
9820
9822 {
9823 return ItemBase.m_DebugActionsMask & mask;
9824 }
9825
9827 {
9828 ItemBase.m_DebugActionsMask = mask;
9829 }
9830
9832 {
9833 ItemBase.m_DebugActionsMask |= mask;
9834 }
9835
9837 {
9838 ItemBase.m_DebugActionsMask &= ~mask;
9839 }
9840
9842 {
9844 {
9846 }
9847 else
9848 {
9850 }
9851 }
9852
9853
9855 {
9856 if (GetEconomyProfile())
9857 {
9858 float q_max = GetEconomyProfile().GetQuantityMax();
9859 if (q_max > 0)
9860 {
9861 float q_min = GetEconomyProfile().GetQuantityMin();
9862 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9863
9865 {
9866 ComponentEnergyManager comp = GetCompEM();
9868 {
9870 }
9871 }
9873 {
9875
9876 }
9877
9878 }
9879 }
9880 }
9881
9884 {
9885 EntityAI parent = GetHierarchyParent();
9886
9887 if (parent)
9888 {
9889 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9890 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9891 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9892 }
9893 }
9894
9897 {
9898 EntityAI parent = GetHierarchyParent();
9899
9900 if (parent)
9901 {
9902 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9903 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9904 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9905 }
9906 }
9907
9909 {
9910
9911
9912
9913
9915
9917 {
9918 if (ScriptInputUserData.CanStoreInputUserData())
9919 {
9920 ScriptInputUserData ctx = new ScriptInputUserData;
9926 ctx.
Write(use_stack_max);
9929
9931 {
9932 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9933 }
9934 }
9935 }
9936 else if (!
GetGame().IsMultiplayer())
9937 {
9939 }
9940 }
9941
9943 {
9945 }
9946
9948 {
9950 }
9951
9953 {
9955 }
9956
9958 {
9959
9960 return false;
9961 }
9962
9964 {
9965 return false;
9966 }
9967
9971 {
9972 return false;
9973 }
9974
9976 {
9977 return "";
9978 }
9979
9981
9983 {
9984 return false;
9985 }
9986
9988 {
9989 return true;
9990 }
9991
9992
9993
9995 {
9996 return true;
9997 }
9998
10000 {
10001 return true;
10002 }
10003
10005 {
10006 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10008 }
10009
10011 {
10013 }
10014
10016 {
10018 if (!is_being_placed)
10020 SetSynchDirty();
10021 }
10022
10023
10025
10027 {
10029 }
10030
10032 {
10034 }
10035
10037 {
10038 return 1;
10039 }
10040
10042 {
10043 return false;
10044 }
10045
10047 {
10049 SetSynchDirty();
10050 }
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10087 {
10088 super.OnMovedInsideCargo(container);
10089
10090 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10091 }
10092
10093 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10094 {
10095 super.EEItemLocationChanged(oldLoc,newLoc);
10096
10097 PlayerBase new_player = null;
10098 PlayerBase old_player = null;
10099
10100 if (newLoc.GetParent())
10101 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10102
10103 if (oldLoc.GetParent())
10104 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10105
10107 {
10108 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10109
10110 if (r_index >= 0)
10111 {
10112 InventoryLocation r_il = new InventoryLocation;
10113 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10114
10115 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10118 {
10119 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10120 }
10122 {
10123 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10124 }
10125
10126 }
10127 }
10128
10130 {
10131 if (new_player)
10132 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10133
10134 if (new_player == old_player)
10135 {
10136
10137 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10138 {
10140 {
10141 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10142 {
10143 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10144 }
10145 }
10146 else
10147 {
10148 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10149 }
10150 }
10151
10152 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10153 {
10154 int type = oldLoc.GetType();
10156 {
10157 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10158 }
10160 {
10161 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10162 }
10163 }
10164 if (!m_OldLocation)
10165 {
10166 m_OldLocation = new InventoryLocation;
10167 }
10168 m_OldLocation.Copy(oldLoc);
10169 }
10170 else
10171 {
10172 if (m_OldLocation)
10173 {
10174 m_OldLocation.Reset();
10175 }
10176 }
10177
10179 }
10180 else
10181 {
10182 if (new_player)
10183 {
10184 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10185 if (res_index >= 0)
10186 {
10187 InventoryLocation il = new InventoryLocation;
10188 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10190 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10193 {
10194 il.
GetParent().GetOnReleaseLock().Invoke(it);
10195 }
10197 {
10199 }
10200
10201 }
10202 }
10204 {
10205
10207 }
10208
10209 if (m_OldLocation)
10210 {
10211 m_OldLocation.Reset();
10212 }
10213 }
10214 }
10215
10216 override void EOnContact(IEntity other, Contact extra)
10217 {
10219 {
10220 int liquidType = -1;
10222 if (impactSpeed > 0.0)
10223 {
10225 #ifndef SERVER
10227 #else
10229 SetSynchDirty();
10230 #endif
10232 }
10233 }
10234
10235 #ifdef SERVER
10236 if (GetCompEM() && GetCompEM().IsPlugged())
10237 {
10238 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10239 GetCompEM().UnplugThis();
10240 }
10241 #endif
10242 }
10243
10245
10247 {
10249 }
10250
10252 {
10253
10254 }
10255
10257 {
10258 super.OnItemLocationChanged(old_owner, new_owner);
10259
10260 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10261 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10262
10263 if (!relatedPlayer && playerNew)
10264 relatedPlayer = playerNew;
10265
10266 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10267 {
10269 if (actionMgr)
10270 {
10271 ActionBase currentAction = actionMgr.GetRunningAction();
10272 if (currentAction)
10274 }
10275 }
10276
10277 Man ownerPlayerOld = null;
10278 Man ownerPlayerNew = null;
10279
10280 if (old_owner)
10281 {
10282 if (old_owner.
IsMan())
10283 {
10284 ownerPlayerOld = Man.Cast(old_owner);
10285 }
10286 else
10287 {
10288 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10289 }
10290 }
10291 else
10292 {
10294 {
10296
10297 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10298 {
10299 GetCompEM().UnplugThis();
10300 }
10301 }
10302 }
10303
10304 if (new_owner)
10305 {
10306 if (new_owner.
IsMan())
10307 {
10308 ownerPlayerNew = Man.Cast(new_owner);
10309 }
10310 else
10311 {
10312 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10313 }
10314 }
10315
10316 if (ownerPlayerOld != ownerPlayerNew)
10317 {
10318 if (ownerPlayerOld)
10319 {
10320 array<EntityAI> subItemsExit = new array<EntityAI>;
10322 for (int i = 0; i < subItemsExit.Count(); i++)
10323 {
10326 }
10327 }
10328
10329 if (ownerPlayerNew)
10330 {
10331 array<EntityAI> subItemsEnter = new array<EntityAI>;
10333 for (int j = 0; j < subItemsEnter.Count(); j++)
10334 {
10337 }
10338 }
10339 }
10340 else if (ownerPlayerNew != null)
10341 {
10342 PlayerBase nplayer;
10343 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10344 {
10345 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10347 for (int k = 0; k < subItemsUpdate.Count(); k++)
10348 {
10350 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10351 }
10352 }
10353 }
10354
10355 if (old_owner)
10356 old_owner.OnChildItemRemoved(this);
10357 if (new_owner)
10358 new_owner.OnChildItemReceived(this);
10359 }
10360
10361
10363 {
10364 super.EEDelete(parent);
10365 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10366 if (player)
10367 {
10369
10370 if (player.IsAlive())
10371 {
10372 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10373 if (r_index >= 0)
10374 {
10375 InventoryLocation r_il = new InventoryLocation;
10376 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10377
10378 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10381 {
10382 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10383 }
10385 {
10386 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10387 }
10388
10389 }
10390
10391 player.RemoveQuickBarEntityShortcut(this);
10392 }
10393 }
10394 }
10395
10397 {
10398 super.EEKilled(killer);
10399
10402 {
10403 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10404 {
10405 if (IsMagazine())
10406 {
10407 if (Magazine.Cast(this).GetAmmoCount() > 0)
10408 {
10410 }
10411 }
10412 else
10413 {
10415 }
10416 }
10417 }
10418 }
10419
10421 {
10422 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10423
10424 super.OnWasAttached(parent, slot_id);
10425
10428
10430 }
10431
10433 {
10434 super.OnWasDetached(parent, slot_id);
10435
10438 }
10439
10441 {
10442 int idx;
10445
10446 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10447 if (inventory_slots.Count() < 1)
10448 {
10449 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10450 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10451 }
10452 else
10453 {
10454 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10455 }
10456
10457 idx = inventory_slots.Find(slot);
10458 if (idx < 0)
10459 return "";
10460
10461 return attach_types.Get(idx);
10462 }
10463
10465 {
10466 int idx = -1;
10467 string slot;
10468
10471
10472 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10473 if (inventory_slots.Count() < 1)
10474 {
10475 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10476 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10477 }
10478 else
10479 {
10480 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10481 if (detach_types.Count() < 1)
10482 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10483 }
10484
10485 for (int i = 0; i < inventory_slots.Count(); i++)
10486 {
10487 slot = inventory_slots.Get(i);
10488 }
10489
10490 if (slot != "")
10491 {
10492 if (detach_types.Count() == 1)
10493 idx = 0;
10494 else
10495 idx = inventory_slots.Find(slot);
10496 }
10497 if (idx < 0)
10498 return "";
10499
10500 return detach_types.Get(idx);
10501 }
10502
10504 {
10505
10507
10508
10509 float min_time = 1;
10510 float max_time = 3;
10511 float delay = Math.RandomFloat(min_time, max_time);
10512
10513 explode_timer.Run(delay, this, "DoAmmoExplosion");
10514 }
10515
10517 {
10518 Magazine magazine = Magazine.Cast(this);
10519 int pop_sounds_count = 6;
10520 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10521
10522
10523 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10524 string sound_name = pop_sounds[ sound_idx ];
10526
10527
10528 magazine.ServerAddAmmoCount(-1);
10529
10530
10531 float min_temp_to_explode = 100;
10532
10533 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10534 {
10536 }
10537 }
10538
10539
10540 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10541 {
10542 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10543
10544 const int CHANCE_DAMAGE_CARGO = 4;
10545 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10546 const int CHANCE_DAMAGE_NOTHING = 2;
10547
10549 {
10550 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10551 int chances;
10552 int rnd;
10553
10554 if (GetInventory().GetCargo())
10555 {
10556 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10557 rnd = Math.RandomInt(0,chances);
10558
10559 if (rnd < CHANCE_DAMAGE_CARGO)
10560 {
10562 }
10563 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10564 {
10566 }
10567 }
10568 else
10569 {
10570 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10571 rnd = Math.RandomInt(0,chances);
10572
10573 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10574 {
10576 }
10577 }
10578 }
10579 }
10580
10582 {
10583 if (GetInventory().GetCargo())
10584 {
10585 int item_count = GetInventory().GetCargo().GetItemCount();
10586 if (item_count > 0)
10587 {
10588 int random_pick = Math.RandomInt(0, item_count);
10590 if (!item.IsExplosive())
10591 {
10592 item.AddHealth("","",damage);
10593 return true;
10594 }
10595 }
10596 }
10597 return false;
10598 }
10599
10601 {
10602 int attachment_count = GetInventory().AttachmentCount();
10603 if (attachment_count > 0)
10604 {
10605 int random_pick = Math.RandomInt(0, attachment_count);
10606 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10607 if (!attachment.IsExplosive())
10608 {
10609 attachment.AddHealth("","",damage);
10610 return true;
10611 }
10612 }
10613 return false;
10614 }
10615
10617 {
10619 }
10620
10622 {
10624 return GetInventory().CanRemoveEntity();
10625
10626 return false;
10627 }
10628
10630 {
10632 return;
10633
10635 {
10636 if (ScriptInputUserData.CanStoreInputUserData())
10637 {
10638 ScriptInputUserData ctx = new ScriptInputUserData;
10643 ctx.
Write(destination_entity);
10645 ctx.
Write(slot_id);
10647 }
10648 }
10649 else if (!
GetGame().IsMultiplayer())
10650 {
10652 }
10653 }
10654
10656 {
10658 return;
10659
10660 float split_quantity_new;
10664 InventoryLocation loc = new InventoryLocation;
10665
10666 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10667 {
10669 split_quantity_new = stack_max;
10670 else
10672
10673 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10674 if (new_item)
10675 {
10676 new_item.SetResultOfSplit(true);
10677 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10679 new_item.SetQuantity(split_quantity_new);
10680 }
10681 }
10682 else if (destination_entity && slot_id == -1)
10683 {
10684 if (quantity > stack_max)
10685 split_quantity_new = stack_max;
10686 else
10687 split_quantity_new = quantity;
10688
10690 {
10693 }
10694
10695 if (new_item)
10696 {
10697 new_item.SetResultOfSplit(true);
10698 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10700 new_item.SetQuantity(split_quantity_new);
10701 }
10702 }
10703 else
10704 {
10705 if (stack_max != 0)
10706 {
10708 {
10710 }
10711
10712 if (split_quantity_new == 0)
10713 {
10714 if (!
GetGame().IsMultiplayer())
10715 player.PhysicalPredictiveDropItem(this);
10716 else
10717 player.ServerDropEntity(this);
10718 return;
10719 }
10720
10722
10723 if (new_item)
10724 {
10725 new_item.SetResultOfSplit(true);
10726 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10728 new_item.SetQuantity(stack_max);
10729 new_item.PlaceOnSurface();
10730 }
10731 }
10732 }
10733 }
10734
10736 {
10738 return;
10739
10740 float split_quantity_new;
10744 InventoryLocation loc = new InventoryLocation;
10745
10746 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10747 {
10749 split_quantity_new = stack_max;
10750 else
10752
10753 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10754 if (new_item)
10755 {
10756 new_item.SetResultOfSplit(true);
10757 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10759 new_item.SetQuantity(split_quantity_new);
10760 }
10761 }
10762 else if (destination_entity && slot_id == -1)
10763 {
10764 if (quantity > stack_max)
10765 split_quantity_new = stack_max;
10766 else
10767 split_quantity_new = quantity;
10768
10770 {
10773 }
10774
10775 if (new_item)
10776 {
10777 new_item.SetResultOfSplit(true);
10778 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10780 new_item.SetQuantity(split_quantity_new);
10781 }
10782 }
10783 else
10784 {
10785 if (stack_max != 0)
10786 {
10788 {
10790 }
10791
10793
10794 if (new_item)
10795 {
10796 new_item.SetResultOfSplit(true);
10797 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10799 new_item.SetQuantity(stack_max);
10800 new_item.PlaceOnSurface();
10801 }
10802 }
10803 }
10804 }
10805
10807 {
10809 return;
10810
10812 {
10813 if (ScriptInputUserData.CanStoreInputUserData())
10814 {
10815 ScriptInputUserData ctx = new ScriptInputUserData;
10820 dst.WriteToContext(ctx);
10822 }
10823 }
10824 else if (!
GetGame().IsMultiplayer())
10825 {
10827 }
10828 }
10829
10831 {
10833 return;
10834
10836 {
10837 if (ScriptInputUserData.CanStoreInputUserData())
10838 {
10839 ScriptInputUserData ctx = new ScriptInputUserData;
10844 ctx.
Write(destination_entity);
10850 }
10851 }
10852 else if (!
GetGame().IsMultiplayer())
10853 {
10855 }
10856 }
10857
10859 {
10861 }
10862
10864 {
10866 return this;
10867
10869 float split_quantity_new;
10871 if (dst.IsValid())
10872 {
10873 int slot_id = dst.GetSlot();
10875
10876 if (quantity > stack_max)
10877 split_quantity_new = stack_max;
10878 else
10879 split_quantity_new = quantity;
10880
10882
10883 if (new_item)
10884 {
10885 new_item.SetResultOfSplit(true);
10886 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10889 }
10890
10891 return new_item;
10892 }
10893
10894 return null;
10895 }
10896
10898 {
10900 return;
10901
10903 float split_quantity_new;
10905 if (destination_entity)
10906 {
10908 if (quantity > stackable)
10909 split_quantity_new = stackable;
10910 else
10911 split_quantity_new = quantity;
10912
10913 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10914 if (new_item)
10915 {
10916 new_item.SetResultOfSplit(true);
10917 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10919 new_item.SetQuantity(split_quantity_new);
10920 }
10921 }
10922 }
10923
10925 {
10927 return;
10928
10930 {
10931 if (ScriptInputUserData.CanStoreInputUserData())
10932 {
10933 ScriptInputUserData ctx = new ScriptInputUserData;
10938 ItemBase destination_entity =
this;
10939 ctx.
Write(destination_entity);
10943 }
10944 }
10945 else if (!
GetGame().IsMultiplayer())
10946 {
10948 }
10949 }
10950
10952 {
10954 return;
10955
10957 float split_quantity_new;
10959 if (player)
10960 {
10962 if (quantity > stackable)
10963 split_quantity_new = stackable;
10964 else
10965 split_quantity_new = quantity;
10966
10967 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10968 new_item =
ItemBase.Cast(in_hands);
10969 if (new_item)
10970 {
10971 new_item.SetResultOfSplit(true);
10972 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10974 new_item.SetQuantity(split_quantity_new);
10975 }
10976 }
10977 }
10978
10980 {
10982 return;
10983
10985 float split_quantity_new = Math.Floor(quantity * 0.5);
10986
10988
10989 if (new_item)
10990 {
10991 if (new_item.GetQuantityMax() < split_quantity_new)
10992 {
10993 split_quantity_new = new_item.GetQuantityMax();
10994 }
10995
10996 new_item.SetResultOfSplit(true);
10997 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10998
11000 {
11003 }
11004 else
11005 {
11008 }
11009 }
11010 }
11011
11013 {
11015 return;
11016
11018 float split_quantity_new = Math.Floor(quantity / 2);
11019
11020 InventoryLocation invloc = new InventoryLocation;
11022
11024 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11025
11026 if (new_item)
11027 {
11028 if (new_item.GetQuantityMax() < split_quantity_new)
11029 {
11030 split_quantity_new = new_item.GetQuantityMax();
11031 }
11033 {
11036 }
11037 else
11038 {
11041 }
11042 }
11043 }
11044
11047 {
11048 SetWeightDirty();
11050
11051 if (parent)
11052 parent.OnAttachmentQuantityChangedEx(this, delta);
11053
11055 {
11057 {
11059 }
11061 {
11062 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11064 }
11065 }
11066
11067 }
11068
11071 {
11072
11073 }
11074
11077 {
11079 }
11080
11082 {
11083 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11084
11086 {
11087 if (newLevel == GameConstants.STATE_RUINED)
11088 {
11090 EntityAI parent = GetHierarchyParent();
11091 if (parent && parent.IsFireplace())
11092 {
11093 CargoBase cargo = GetInventory().GetCargo();
11094 if (cargo)
11095 {
11097 {
11099 }
11100 }
11101 }
11102 }
11103
11105 {
11106
11108 return;
11109 }
11110
11111 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11112 {
11114 }
11115 }
11116 }
11117
11118
11120 {
11121 super.OnRightClick();
11122
11124 {
11126 {
11127 if (ScriptInputUserData.CanStoreInputUserData())
11128 {
11129 vector m4[4];
11131
11132 EntityAI root = GetHierarchyRoot();
11133
11134 InventoryLocation dst = new InventoryLocation;
11136 {
11137 if (root)
11138 {
11139 root.GetTransform(m4);
11141 }
11142 else
11143 GetInventory().GetCurrentInventoryLocation(dst);
11144 }
11145 else
11146 {
11148
11149
11150 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11151 {
11152 if (root)
11153 {
11154 root.GetTransform(m4);
11156 }
11157 else
11158 GetInventory().GetCurrentInventoryLocation(dst);
11159 }
11160 else
11161 {
11162 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11163 }
11164 }
11165
11166 ScriptInputUserData ctx = new ScriptInputUserData;
11174 }
11175 }
11176 else if (!
GetGame().IsMultiplayer())
11177 {
11179 }
11180 }
11181 }
11182
11183 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11184 {
11185
11186 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11187 return false;
11188
11189 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11190 return false;
11191
11192
11194 return false;
11195
11196
11197 Magazine mag = Magazine.Cast(this);
11198 if (mag)
11199 {
11200 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11201 return false;
11202
11203 if (stack_max_limit)
11204 {
11205 Magazine other_mag = Magazine.Cast(other_item);
11206 if (other_item)
11207 {
11208 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11209 return false;
11210 }
11211
11212 }
11213 }
11214 else
11215 {
11216
11218 return false;
11219
11221 return false;
11222 }
11223
11224 PlayerBase player = null;
11225 if (CastTo(player, GetHierarchyRootPlayer()))
11226 {
11227 if (player.GetInventory().HasAttachment(this))
11228 return false;
11229
11230 if (player.IsItemsToDelete())
11231 return false;
11232 }
11233
11234 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11235 return false;
11236
11237 int slotID;
11239 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11240 return false;
11241
11242 return true;
11243 }
11244
11246 {
11248 }
11249
11251 {
11252 return m_IsResultOfSplit;
11253 }
11254
11256 {
11257 m_IsResultOfSplit = value;
11258 }
11259
11261 {
11263 }
11264
11266 {
11267 float other_item_quantity = other_item.GetQuantity();
11268 float this_free_space;
11269
11271
11273
11274 if (other_item_quantity > this_free_space)
11275 {
11276 return this_free_space;
11277 }
11278 else
11279 {
11280 return other_item_quantity;
11281 }
11282 }
11283
11285 {
11287 }
11288
11290 {
11292 return;
11293
11294 if (!IsMagazine() && other_item)
11295 {
11297 if (quantity_used != 0)
11298 {
11299 float hp1 = GetHealth01("","");
11300 float hp2 = other_item.GetHealth01("","");
11301 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11302 hpResult = hpResult / (
GetQuantity() + quantity_used);
11303
11304 hpResult *= GetMaxHealth();
11305 Math.Round(hpResult);
11306 SetHealth("", "Health", hpResult);
11307
11309 other_item.AddQuantity(-quantity_used);
11310 }
11311 }
11313 }
11314
11316 {
11317 #ifdef SERVER
11318 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11319 GetHierarchyParent().IncreaseLifetimeUp();
11320 #endif
11321 };
11322
11324 {
11325 PlayerBase p = PlayerBase.Cast(player);
11326
11327 array<int> recipesIds = p.m_Recipes;
11328 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11329 if (moduleRecipesManager)
11330 {
11331 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11332 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11333 }
11334
11335 for (int i = 0;i < recipesIds.Count(); i++)
11336 {
11337 int key = recipesIds.Get(i);
11338 string recipeName = moduleRecipesManager.GetRecipeName(key);
11340 }
11341 }
11342
11343
11344 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11345 {
11346 super.GetDebugActions(outputList);
11347
11348
11353
11354
11358
11362
11363
11366
11367
11369 {
11372 }
11373
11375
11378
11382 }
11383
11384
11385
11386
11388 {
11389 super.OnAction(action_id, player, ctx);
11390 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11391 {
11392 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11393 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11394 PlayerBase p = PlayerBase.Cast(player);
11395 if (
EActions.RECIPES_RANGE_START < 1000)
11396 {
11397 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11398 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11399 }
11400 }
11401 #ifndef SERVER
11402 else if (action_id ==
EActions.WATCH_PLAYER)
11403 {
11404 PluginDeveloper.SetDeveloperItemClientEx(player);
11405 }
11406 #endif
11408 {
11409 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11410 {
11411 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11412 OnDebugButtonPressServer(id + 1);
11413 }
11414
11415 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11416 {
11417 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11419 }
11420
11421 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11422 {
11423 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11425 }
11426
11427 else if (action_id ==
EActions.ADD_QUANTITY)
11428 {
11429 if (IsMagazine())
11430 {
11431 Magazine mag = Magazine.Cast(this);
11432 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11433 }
11434 else
11435 {
11437 }
11438
11439 if (m_EM)
11440 {
11441 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11442 }
11443
11444 }
11445
11446 else if (action_id ==
EActions.REMOVE_QUANTITY)
11447 {
11448 if (IsMagazine())
11449 {
11450 Magazine mag2 = Magazine.Cast(this);
11451 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11452 }
11453 else
11454 {
11456 }
11457 if (m_EM)
11458 {
11459 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11460 }
11461
11462 }
11463
11464 else if (action_id ==
EActions.SET_QUANTITY_0)
11465 {
11467
11468 if (m_EM)
11469 {
11470 m_EM.SetEnergy(0);
11471 }
11472 }
11473
11474 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11475 {
11477
11478 if (m_EM)
11479 {
11480 m_EM.SetEnergy(m_EM.GetEnergyMax());
11481 }
11482 }
11483
11484 else if (action_id ==
EActions.ADD_HEALTH)
11485 {
11486 AddHealth("","",GetMaxHealth("","Health")/5);
11487 }
11488 else if (action_id ==
EActions.REMOVE_HEALTH)
11489 {
11490 AddHealth("","",-GetMaxHealth("","Health")/5);
11491 }
11492 else if (action_id ==
EActions.DESTROY_HEALTH)
11493 {
11494 SetHealth01("","",0);
11495 }
11496 else if (action_id ==
EActions.WATCH_ITEM)
11497 {
11499 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11500 #ifdef DEVELOPER
11501 SetDebugDeveloper_item(this);
11502 #endif
11503 }
11504
11505 else if (action_id ==
EActions.ADD_TEMPERATURE)
11506 {
11507 AddTemperature(20);
11508
11509 }
11510
11511 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11512 {
11513 AddTemperature(-20);
11514
11515 }
11516
11517 else if (action_id ==
EActions.FLIP_FROZEN)
11518 {
11519 SetFrozen(!GetIsFrozen());
11520
11521 }
11522
11523 else if (action_id ==
EActions.ADD_WETNESS)
11524 {
11526
11527 }
11528
11529 else if (action_id ==
EActions.REMOVE_WETNESS)
11530 {
11532
11533 }
11534
11535 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11536 {
11539
11540
11541 }
11542
11543 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11544 {
11547 }
11548
11549 else if (action_id ==
EActions.MAKE_SPECIAL)
11550 {
11551 auto debugParams = DebugSpawnParams.WithPlayer(player);
11552 OnDebugSpawnEx(debugParams);
11553 }
11554
11555 else if (action_id ==
EActions.DELETE)
11556 {
11557 Delete();
11558 }
11559
11560 }
11561
11562
11563 return false;
11564 }
11565
11566
11567
11568
11572
11575
11576
11577
11579 {
11580 return false;
11581 }
11582
11583
11585 {
11586 return true;
11587 }
11588
11589
11591 {
11592 return true;
11593 }
11594
11595
11596
11598 {
11599 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11601 }
11602
11605 {
11606 return null;
11607 }
11608
11610 {
11611 return false;
11612 }
11613
11615 {
11616 return false;
11617 }
11618
11622
11623
11625 {
11626 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11627 return module_repairing.CanRepair(this, item_repair_kit);
11628 }
11629
11630
11631 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11632 {
11633 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11634 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11635 }
11636
11637
11639 {
11640
11641
11642
11643
11644
11645
11646
11647
11648 return 1;
11649 }
11650
11651
11652
11654 {
11656 }
11657
11658
11659
11661 {
11663 }
11664
11665
11674 {
11675 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11676
11677 if (player)
11678 {
11679 player.MessageStatus(text);
11680 }
11681 }
11682
11683
11692 {
11693 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11694
11695 if (player)
11696 {
11697 player.MessageAction(text);
11698 }
11699 }
11700
11701
11710 {
11711 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11712
11713 if (player)
11714 {
11715 player.MessageFriendly(text);
11716 }
11717 }
11718
11719
11728 {
11729 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11730
11731 if (player)
11732 {
11733 player.MessageImportant(text);
11734 }
11735 }
11736
11738 {
11739 return true;
11740 }
11741
11742
11743 override bool KindOf(
string tag)
11744 {
11745 bool found = false;
11746 string item_name = this.
GetType();
11749
11750 int array_size = item_tag_array.Count();
11751 for (int i = 0; i < array_size; i++)
11752 {
11753 if (item_tag_array.Get(i) == tag)
11754 {
11755 found = true;
11756 break;
11757 }
11758 }
11759 return found;
11760 }
11761
11762
11764 {
11765
11766 super.OnRPC(sender, rpc_type,ctx);
11767
11768
11769 switch (rpc_type)
11770 {
11771 #ifndef SERVER
11772 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11773 Param2<bool, string> p = new Param2<bool, string>(false, "");
11774
11776 return;
11777
11778 bool play = p.param1;
11779 string soundSet = p.param2;
11780
11781 if (play)
11782 {
11784 {
11786 {
11788 }
11789 }
11790 else
11791 {
11793 }
11794 }
11795 else
11796 {
11798 }
11799
11800 break;
11801 #endif
11802
11803 }
11804
11806 {
11808 }
11809 }
11810
11811
11812
11813
11815 {
11816 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11817 return plugin.GetID(
name);
11818 }
11819
11821 {
11822 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11823 return plugin.GetName(id);
11824 }
11825
11828 {
11829
11830
11831 int varFlags;
11832 if (!ctx.
Read(varFlags))
11833 return;
11834
11835 if (varFlags & ItemVariableFlags.FLOAT)
11836 {
11838 }
11839 }
11840
11842 {
11843
11844 super.SerializeNumericalVars(floats_out);
11845
11846
11847
11849 {
11851 }
11852
11854 {
11856 }
11857
11859 {
11861 }
11862
11864 {
11869 }
11870
11872 {
11874 }
11875 }
11876
11878 {
11879
11880 super.DeSerializeNumericalVars(floats);
11881
11882
11883 int index = 0;
11884 int mask = Math.Round(floats.Get(index));
11885
11886 index++;
11887
11889 {
11891 {
11893 }
11894 else
11895 {
11896 float quantity = floats.Get(index);
11897 SetQuantity(quantity,
true,
false,
false,
false);
11898 }
11899 index++;
11900 }
11901
11903 {
11904 float wet = floats.Get(index);
11906 index++;
11907 }
11908
11910 {
11911 int liquidtype = Math.Round(floats.Get(index));
11913 index++;
11914 }
11915
11917 {
11919 index++;
11921 index++;
11923 index++;
11925 index++;
11926 }
11927
11929 {
11930 int cleanness = Math.Round(floats.Get(index));
11932 index++;
11933 }
11934 }
11935
11937 {
11938 super.WriteVarsToCTX(ctx);
11939
11940
11942 {
11944 }
11945
11947 {
11949 }
11950
11952 {
11954 }
11955
11957 {
11958 int r,g,b,a;
11964 }
11965
11967 {
11969 }
11970 }
11971
11973 {
11974 if (!super.ReadVarsFromCTX(ctx,version))
11975 return false;
11976
11977 int intValue;
11978 float value;
11979
11980 if (version < 140)
11981 {
11982 if (!ctx.
Read(intValue))
11983 return false;
11984
11985 m_VariablesMask = intValue;
11986 }
11987
11989 {
11990 if (!ctx.
Read(value))
11991 return false;
11992
11994 {
11996 }
11997 else
11998 {
12000 }
12001 }
12002
12003 if (version < 140)
12004 {
12006 {
12007 if (!ctx.
Read(value))
12008 return false;
12009 SetTemperatureDirect(value);
12010 }
12011 }
12012
12014 {
12015 if (!ctx.
Read(value))
12016 return false;
12018 }
12019
12021 {
12022 if (!ctx.
Read(intValue))
12023 return false;
12025 }
12026
12028 {
12029 int r,g,b,a;
12031 return false;
12033 return false;
12035 return false;
12037 return false;
12038
12040 }
12041
12043 {
12044 if (!ctx.
Read(intValue))
12045 return false;
12047 }
12048
12049 if (version >= 138 && version < 140)
12050 {
12052 {
12053 if (!ctx.
Read(intValue))
12054 return false;
12055 SetFrozen(intValue);
12056 }
12057 }
12058
12059 return true;
12060 }
12061
12062
12064 {
12067 {
12069 }
12070
12071 if (!super.OnStoreLoad(ctx, version))
12072 {
12074 return false;
12075 }
12076
12077 if (version >= 114)
12078 {
12079 bool hasQuickBarIndexSaved;
12080
12081 if (!ctx.
Read(hasQuickBarIndexSaved))
12082 {
12084 return false;
12085 }
12086
12087 if (hasQuickBarIndexSaved)
12088 {
12089 int itmQBIndex;
12090
12091
12092 if (!ctx.
Read(itmQBIndex))
12093 {
12095 return false;
12096 }
12097
12098 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12099 if (itmQBIndex != -1 && parentPlayer)
12100 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12101 }
12102 }
12103 else
12104 {
12105
12106 PlayerBase player;
12107 int itemQBIndex;
12108 if (version ==
int.
MAX)
12109 {
12110 if (!ctx.
Read(itemQBIndex))
12111 {
12113 return false;
12114 }
12115 }
12116 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12117 {
12118
12119 if (!ctx.
Read(itemQBIndex))
12120 {
12122 return false;
12123 }
12124 if (itemQBIndex != -1 && player)
12125 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12126 }
12127 }
12128
12129 if (version < 140)
12130 {
12131
12132 if (!LoadVariables(ctx, version))
12133 {
12135 return false;
12136 }
12137 }
12138
12139
12141 {
12143 return false;
12144 }
12145 if (version >= 132)
12146 {
12148 if (raib)
12149 {
12151 {
12153 return false;
12154 }
12155 }
12156 }
12157
12159 return true;
12160 }
12161
12162
12163
12165 {
12166 super.OnStoreSave(ctx);
12167
12168 PlayerBase player;
12169 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12170 {
12172
12173 int itemQBIndex = -1;
12174 itemQBIndex = player.FindQuickBarEntityIndex(this);
12175 ctx.
Write(itemQBIndex);
12176 }
12177 else
12178 {
12180 }
12181
12183
12185 if (raib)
12186 {
12188 }
12189 }
12190
12191
12193 {
12194 super.AfterStoreLoad();
12195
12197 {
12199 }
12200
12202 {
12205 }
12206 }
12207
12209 {
12210 super.EEOnAfterLoad();
12211
12213 {
12215 }
12216
12219 }
12220
12222 {
12223 return false;
12224 }
12225
12226
12227
12229 {
12231 {
12232 #ifdef PLATFORM_CONSOLE
12233
12235 {
12237 if (menu)
12238 {
12240 }
12241 }
12242 #endif
12243 }
12244
12246 {
12249 }
12250
12252 {
12253 SetWeightDirty();
12255 }
12257 {
12260 }
12261
12263 {
12266 }
12268 {
12271 }
12272
12273 super.OnVariablesSynchronized();
12274 }
12275
12276
12277
12279 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12280 {
12281 if (!IsServerCheck(allow_client))
12282 return false;
12283
12285 return false;
12286
12289
12290 if (value <= (min + 0.001))
12291 value = min;
12292
12293 if (value == min)
12294 {
12295 if (destroy_config)
12296 {
12297 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12298 if (dstr)
12299 {
12301 this.Delete();
12302 return true;
12303 }
12304 }
12305 else if (destroy_forced)
12306 {
12308 this.Delete();
12309 return true;
12310 }
12311
12313 }
12314
12317
12319 {
12321
12322 if (delta)
12324 }
12325
12327
12328 return false;
12329 }
12330
12331
12333 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12334 {
12336 }
12337
12339 {
12342 }
12343
12345 {
12348 }
12349
12352 {
12353 float value_clamped = Math.Clamp(value, 0, 1);
12355 SetQuantity(result, destroy_config, destroy_forced);
12356 }
12357
12358
12361 {
12363 }
12364
12366 {
12368 }
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12380 {
12381 int slot = -1;
12382 if (GetInventory())
12383 {
12384 InventoryLocation il = new InventoryLocation;
12385 GetInventory().GetCurrentInventoryLocation(il);
12387 }
12388
12390 }
12391
12393 {
12394 float quantity_max = 0;
12395
12397 {
12398 if (attSlotID != -1)
12399 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12400
12401 if (quantity_max <= 0)
12403 }
12404
12405 if (quantity_max <= 0)
12407
12408 return quantity_max;
12409 }
12410
12412 {
12414 }
12415
12417 {
12419 }
12420
12421
12423 {
12425 }
12426
12428 {
12430 }
12431
12433 {
12435 }
12436
12437
12439 {
12440
12441 float weightEx = GetWeightEx();
12442 float special = GetInventoryAndCargoWeight();
12443 return weightEx - special;
12444 }
12445
12446
12448 {
12450 }
12451
12453 {
12455 {
12456 #ifdef DEVELOPER
12457 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12458 {
12459 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12461 }
12462 #endif
12463
12464 return GetQuantity() * GetConfigWeightModified();
12465 }
12466 else if (HasEnergyManager())
12467 {
12468 #ifdef DEVELOPER
12469 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12470 {
12471 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12472 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12473 }
12474 #endif
12475 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12476 }
12477 else
12478 {
12479 #ifdef DEVELOPER
12480 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12481 {
12482 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12483 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12484 }
12485 #endif
12486 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12487 }
12488 }
12489
12492 {
12493 int item_count = 0;
12495
12496 if (GetInventory().GetCargo() != NULL)
12497 {
12498 item_count = GetInventory().GetCargo().GetItemCount();
12499 }
12500
12501 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12502 {
12503 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12504 if (item)
12505 item_count += item.GetNumberOfItems();
12506 }
12507 return item_count;
12508 }
12509
12512 {
12513 float weight = 0;
12514 float wetness = 1;
12515 if (include_wetness)
12518 {
12519 weight = wetness * m_ConfigWeight;
12520 }
12522 {
12523 weight = 1;
12524 }
12525 return weight;
12526 }
12527
12528
12529
12531 {
12532 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12533 {
12534 GameInventory inv = GetInventory();
12535 array<EntityAI> items = new array<EntityAI>;
12537 for (int i = 0; i < items.Count(); i++)
12538 {
12540 if (item)
12541 {
12543 }
12544 }
12545 }
12546 }
12547
12548
12549
12550
12552 {
12553 float energy = 0;
12554 if (HasEnergyManager())
12555 {
12556 energy = GetCompEM().GetEnergy();
12557 }
12558 return energy;
12559 }
12560
12561
12563 {
12564 super.OnEnergyConsumed();
12565
12567 }
12568
12570 {
12571 super.OnEnergyAdded();
12572
12574 }
12575
12576
12578 {
12579 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12580 {
12582 {
12583 float energy_0to1 = GetCompEM().GetEnergy0To1();
12585 }
12586 }
12587 }
12588
12589
12591 {
12592 return ConfigGetFloat("heatIsolation");
12593 }
12594
12596 {
12598 }
12599
12601 {
12602 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12603 if (
GetGame().ConfigIsExisting(paramPath))
12605
12606 return 0.0;
12607 }
12608
12610 {
12611 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12612 if (
GetGame().ConfigIsExisting(paramPath))
12614
12615 return 0.0;
12616 }
12617
12618 override void SetWet(
float value,
bool allow_client =
false)
12619 {
12620 if (!IsServerCheck(allow_client))
12621 return;
12622
12625
12627
12628 m_VarWet = Math.Clamp(value, min, max);
12629
12631 {
12634 }
12635 }
12636
12637 override void AddWet(
float value)
12638 {
12640 }
12641
12643 {
12645 }
12646
12648 {
12650 }
12651
12653 {
12655 }
12656
12658 {
12660 }
12661
12663 {
12665 }
12666
12667 override void OnWetChanged(
float newVal,
float oldVal)
12668 {
12671 if (newLevel != oldLevel)
12672 {
12674 }
12675 }
12676
12678 {
12679 SetWeightDirty();
12680 }
12681
12683 {
12684 return GetWetLevelInternal(
m_VarWet);
12685 }
12686
12687
12688
12690 {
12692 }
12693
12695 {
12697 }
12698
12700 {
12702 }
12703
12705 {
12707 }
12708
12709
12710
12712 {
12713 if (ConfigIsExisting("itemModelLength"))
12714 {
12715 return ConfigGetFloat("itemModelLength");
12716 }
12717 return 0;
12718 }
12719
12721 {
12722 if (ConfigIsExisting("itemAttachOffset"))
12723 {
12724 return ConfigGetFloat("itemAttachOffset");
12725 }
12726 return 0;
12727 }
12728
12729 override void SetCleanness(
int value,
bool allow_client =
false)
12730 {
12731 if (!IsServerCheck(allow_client))
12732 return;
12733
12735
12737
12740 }
12741
12743 {
12745 }
12746
12748 {
12749 return true;
12750 }
12751
12752
12753
12754
12756 {
12758 }
12759
12761 {
12763 }
12764
12765
12766
12767
12768 override void SetColor(
int r,
int g,
int b,
int a)
12769 {
12775 }
12777 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12778 {
12783 }
12784
12786 {
12788 }
12789
12792 {
12793 int r,g,b,a;
12795 r = r/255;
12796 g = g/255;
12797 b = b/255;
12798 a = a/255;
12799 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12800 }
12801
12802
12803
12804 override void SetLiquidType(
int value,
bool allow_client =
false)
12805 {
12806 if (!IsServerCheck(allow_client))
12807 return;
12808
12813 }
12814
12816 {
12817 return ConfigGetInt("varLiquidTypeInit");
12818 }
12819
12821 {
12823 }
12824
12826 {
12828 SetFrozen(false);
12829 }
12830
12833 {
12834 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12835 }
12836
12837
12840 {
12841 PlayerBase nplayer;
12842 if (PlayerBase.CastTo(nplayer, player))
12843 {
12845
12846 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12847 }
12848 }
12849
12850
12853 {
12854 PlayerBase nplayer;
12855 if (PlayerBase.CastTo(nplayer,player))
12856 {
12857
12858 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12859
12860 }
12861
12862
12863 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12864
12865
12866 if (HasEnergyManager())
12867 {
12868 GetCompEM().UpdatePlugState();
12869 }
12870 }
12871
12872
12874 {
12875 super.OnPlacementStarted(player);
12876
12878 }
12879
12880 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12881 {
12883 {
12884 m_AdminLog.OnPlacementComplete(player,
this);
12885 }
12886
12887 super.OnPlacementComplete(player, position, orientation);
12888 }
12889
12890
12891
12892
12893
12895 {
12897 {
12898 return true;
12899 }
12900 else
12901 {
12902 return false;
12903 }
12904 }
12905
12906
12908 {
12910 {
12912 }
12913 }
12914
12915
12917 {
12919 }
12920
12922 {
12924 }
12925
12926 override void InsertAgent(
int agent,
float count = 1)
12927 {
12928 if (count < 1)
12929 return;
12930
12932 }
12933
12936 {
12938 }
12939
12940
12942 {
12944 }
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12988 {
12990 return false;
12991 return true;
12992 }
12993
12995 {
12996
12998 }
12999
13000
13003 {
13004 super.CheckForRoofLimited(timeTresholdMS);
13005
13007 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13008 {
13009 m_PreviousRoofTestTime = time;
13010 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13011 }
13012 }
13013
13014
13016 {
13018 {
13019 return 0;
13020 }
13021
13022 if (GetInventory().GetAttachmentSlotsCount() != 0)
13023 {
13024 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13025 if (filter)
13026 return filter.GetProtectionLevel(type, false, system);
13027 else
13028 return 0;
13029 }
13030
13031 string subclassPath, entryName;
13032
13033 switch (type)
13034 {
13036 entryName = "biological";
13037 break;
13039 entryName = "chemical";
13040 break;
13041 default:
13042 entryName = "biological";
13043 break;
13044 }
13045
13046 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13047
13049 }
13050
13051
13052
13055 {
13056 if (!IsMagazine())
13058
13060 }
13061
13062
13063
13064
13065
13070 {
13071 return true;
13072 }
13073
13075 {
13077 }
13078
13079
13080
13081
13082
13084 {
13085 if (parent)
13086 {
13087 if (parent.IsInherited(DayZInfected))
13088 return true;
13089
13090 if (!parent.IsRuined())
13091 return true;
13092 }
13093
13094 return true;
13095 }
13096
13098 {
13099 if (!super.CanPutAsAttachment(parent))
13100 {
13101 return false;
13102 }
13103
13104 if (!IsRuined() && !parent.IsRuined())
13105 {
13106 return true;
13107 }
13108
13109 return false;
13110 }
13111
13113 {
13114
13115
13116
13117
13118 return super.CanReceiveItemIntoCargo(item);
13119 }
13120
13122 {
13123
13124
13125
13126
13127 GameInventory attachmentInv = attachment.GetInventory();
13129 {
13130 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13131 return false;
13132 }
13133
13134 InventoryLocation loc = new InventoryLocation();
13135 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13136 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13137 return false;
13138
13139 return super.CanReceiveAttachment(attachment, slotId);
13140 }
13141
13143 {
13144 if (!super.CanReleaseAttachment(attachment))
13145 return false;
13146
13147 return GetInventory().AreChildrenAccessible();
13148 }
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13171 {
13172 int id = muzzle_owner.GetMuzzleID();
13173 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13174
13175 if (WPOF_array)
13176 {
13177 for (int i = 0; i < WPOF_array.Count(); i++)
13178 {
13179 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13180
13181 if (WPOF)
13182 {
13183 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13184 }
13185 }
13186 }
13187 }
13188
13189
13191 {
13192 int id = muzzle_owner.GetMuzzleID();
13194
13195 if (WPOBE_array)
13196 {
13197 for (int i = 0; i < WPOBE_array.Count(); i++)
13198 {
13199 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13200
13201 if (WPOBE)
13202 {
13203 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13204 }
13205 }
13206 }
13207 }
13208
13209
13211 {
13212 int id = muzzle_owner.GetMuzzleID();
13213 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13214
13215 if (WPOOH_array)
13216 {
13217 for (int i = 0; i < WPOOH_array.Count(); i++)
13218 {
13219 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13220
13221 if (WPOOH)
13222 {
13223 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13224 }
13225 }
13226 }
13227 }
13228
13229
13231 {
13232 int id = muzzle_owner.GetMuzzleID();
13233 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13234
13235 if (WPOOH_array)
13236 {
13237 for (int i = 0; i < WPOOH_array.Count(); i++)
13238 {
13239 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13240
13241 if (WPOOH)
13242 {
13243 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13244 }
13245 }
13246 }
13247 }
13248
13249
13251 {
13252 int id = muzzle_owner.GetMuzzleID();
13253 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13254
13255 if (WPOOH_array)
13256 {
13257 for (int i = 0; i < WPOOH_array.Count(); i++)
13258 {
13259 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13260
13261 if (WPOOH)
13262 {
13263 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13264 }
13265 }
13266 }
13267 }
13268
13269
13270
13272 {
13274 {
13275 return true;
13276 }
13277
13278 return false;
13279 }
13280
13282 {
13284 {
13285 return true;
13286 }
13287
13288 return false;
13289 }
13290
13292 {
13294 {
13295 return true;
13296 }
13297
13298 return false;
13299 }
13300
13302 {
13303 return false;
13304 }
13305
13308 {
13309 return UATimeSpent.DEFAULT_DEPLOY;
13310 }
13311
13312
13313
13314
13316 {
13318 SetSynchDirty();
13319 }
13320
13322 {
13324 }
13325
13326
13328 {
13329 return false;
13330 }
13331
13334 {
13335 string att_type = "None";
13336
13337 if (ConfigIsExisting("soundAttType"))
13338 {
13339 att_type = ConfigGetString("soundAttType");
13340 }
13341
13343 }
13344
13346 {
13348 }
13349
13350
13351
13352
13353
13357
13359 {
13362
13364 }
13365
13366
13368 {
13370 return;
13371
13373
13376
13379
13380 SoundParameters params = new SoundParameters();
13384 }
13385
13386
13388 {
13390 return;
13391
13393 SetSynchDirty();
13394
13397 }
13398
13399
13401 {
13403 return;
13404
13406 SetSynchDirty();
13407
13410 }
13411
13413 {
13415 }
13416
13418 {
13420 }
13421
13424 {
13425 if (!
GetGame().IsDedicatedServer())
13426 {
13427 if (ConfigIsExisting("attachSoundSet"))
13428 {
13429 string cfg_path = "";
13430 string soundset = "";
13431 string type_name =
GetType();
13432
13435 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13436 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13437
13438 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13439 {
13440 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13441 {
13442 if (cfg_slot_array[i] == slot_type)
13443 {
13444 soundset = cfg_soundset_array[i];
13445 break;
13446 }
13447 }
13448 }
13449
13450 if (soundset != "")
13451 {
13452 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13454 }
13455 }
13456 }
13457 }
13458
13460 {
13461
13462 }
13463
13464 void OnApply(PlayerBase player);
13465
13467 {
13468 return 1.0;
13469 };
13470
13472 {
13474 }
13475
13477 {
13479 }
13480
13482
13484 {
13485 SetDynamicPhysicsLifeTime(0.01);
13487 }
13488
13490 {
13491 array<string> zone_names = new array<string>;
13492 GetDamageZones(zone_names);
13493 for (int i = 0; i < zone_names.Count(); i++)
13494 {
13495 SetHealthMax(zone_names.Get(i),"Health");
13496 }
13497 SetHealthMax("","Health");
13498 }
13499
13502 {
13503 float global_health = GetHealth01("","Health");
13504 array<string> zones = new array<string>;
13505 GetDamageZones(zones);
13506
13507 for (int i = 0; i < zones.Count(); i++)
13508 {
13509 SetHealth01(zones.Get(i),"Health",global_health);
13510 }
13511 }
13512
13515 {
13516 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13517 }
13518
13520 {
13521 if (!hasRootAsPlayer)
13522 {
13523 if (refParentIB)
13524 {
13525
13526 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13527 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13528
13529 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13530 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13531
13534 }
13535 else
13536 {
13537
13540 }
13541 }
13542 }
13543
13545 {
13547 {
13548 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13549 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13550 {
13551 float heatPermCoef = 1.0;
13553 while (ent)
13554 {
13555 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13556 ent = ent.GetHierarchyParent();
13557 }
13558
13559 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13560 }
13561 }
13562 }
13563
13565 {
13566
13567 EntityAI parent = GetHierarchyParent();
13568 if (!parent)
13569 {
13570 hasParent = false;
13571 hasRootAsPlayer = false;
13572 }
13573 else
13574 {
13575 hasParent = true;
13576 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13577 refParentIB =
ItemBase.Cast(parent);
13578 }
13579 }
13580
13581 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13582 {
13583
13584 }
13585
13587 {
13588
13589 return false;
13590 }
13591
13593 {
13594
13595
13596 return false;
13597 }
13598
13600 {
13601
13602 return false;
13603 }
13604
13607 {
13608 return !GetIsFrozen() &&
IsOpen();
13609 }
13610
13612 {
13613 bool hasParent = false, hasRootAsPlayer = false;
13615
13616 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13617 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13618
13619 if (wwtu || foodDecay)
13620 {
13624
13625 if (processWetness || processTemperature || processDecay)
13626 {
13628
13629 if (processWetness)
13630 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13631
13632 if (processTemperature)
13634
13635 if (processDecay)
13636 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13637 }
13638 }
13639 }
13640
13643 {
13645 }
13646
13648 {
13651
13652 return super.GetTemperatureFreezeThreshold();
13653 }
13654
13656 {
13659
13660 return super.GetTemperatureThawThreshold();
13661 }
13662
13664 {
13667
13668 return super.GetItemOverheatThreshold();
13669 }
13670
13672 {
13674 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13675
13676 return super.GetTemperatureFreezeTime();
13677 }
13678
13680 {
13682 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13683
13684 return super.GetTemperatureThawTime();
13685 }
13686
13691
13693 {
13694 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13695 }
13696
13698 {
13699 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13700 }
13701
13704 {
13706 }
13707
13709 {
13711 }
13712
13714 {
13716 }
13717
13720 {
13721 return null;
13722 }
13723
13726 {
13727 return false;
13728 }
13729
13731 {
13733 {
13736 if (!trg)
13737 {
13739 explosive = this;
13740 }
13741
13742 explosive.PairRemote(trg);
13744
13745 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13746 trg.SetPersistentPairID(persistentID);
13747 explosive.SetPersistentPairID(persistentID);
13748
13749 return true;
13750 }
13751 return false;
13752 }
13753
13756 {
13757 float ret = 1.0;
13760 ret *= GetHealth01();
13761
13762 return ret;
13763 }
13764
13765 #ifdef DEVELOPER
13766 override void SetDebugItem()
13767 {
13768 super.SetDebugItem();
13769 _itemBase = this;
13770 }
13771
13773 {
13774 string text = super.GetDebugText();
13775
13777 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13778
13779 return text;
13780 }
13781 #endif
13782
13784 {
13785 return true;
13786 }
13787
13789
13791
13793 {
13796 }
13797
13798
13806
13822}
13823
13825{
13827 if (entity)
13828 {
13829 bool is_item = entity.IsInherited(
ItemBase);
13830 if (is_item && full_quantity)
13831 {
13834 }
13835 }
13836 else
13837 {
13839 return NULL;
13840 }
13841 return entity;
13842}
13843
13845{
13846 if (item)
13847 {
13848 if (health > 0)
13849 item.SetHealth("", "", health);
13850
13851 if (item.CanHaveTemperature())
13852 {
13854 if (item.CanFreeze())
13855 item.SetFrozen(false);
13856 }
13857
13858 if (item.HasEnergyManager())
13859 {
13860 if (quantity >= 0)
13861 {
13862 item.GetCompEM().SetEnergy0To1(quantity);
13863 }
13864 else
13865 {
13867 }
13868 }
13869 else if (item.IsMagazine())
13870 {
13871 Magazine mag = Magazine.Cast(item);
13872 if (quantity >= 0)
13873 {
13874 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13875 }
13876 else
13877 {
13879 }
13880
13881 }
13882 else
13883 {
13884 if (quantity >= 0)
13885 {
13886 item.SetQuantityNormalized(quantity, false);
13887 }
13888 else
13889 {
13891 }
13892
13893 }
13894 }
13895}
13896
13897#ifdef DEVELOPER
13899#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.