9038{
9040 {
9041 return true;
9042 }
9043};
9044
9045
9046
9048{
9052
9054
9057
9058
9059
9060
9061
9070
9076
9081
9086
9107 protected bool m_IsResultOfSplit
9108
9110
9115
9116
9117
9119
9123
9124
9125
9127
9130
9131
9132
9138
9139
9147
9150
9151
9153
9154
9156
9157
9162
9163
9168
9169
9171
9172
9174 {
9179
9180 if (!
GetGame().IsDedicatedServer())
9181 {
9183 {
9185
9187 {
9189 }
9190 }
9191
9194 }
9195
9196 m_OldLocation = null;
9197
9199 {
9201 }
9202
9203 if (ConfigIsExisting("headSelectionsToHide"))
9204 {
9207 }
9208
9210 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9211 {
9213 }
9214
9216
9217 m_IsResultOfSplit = false;
9218
9220 }
9221
9223 {
9224 super.InitItemVariables();
9225
9231 m_Count = ConfigGetInt(
"count");
9232
9235
9240
9243
9248
9260
9264
9265
9268 if (ConfigIsExisting("canBeSplit"))
9269 {
9272 }
9273
9275 if (ConfigIsExisting("itemBehaviour"))
9277
9278
9281 RegisterNetSyncVariableInt("m_VarLiquidType");
9282 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9283
9284 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9285 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9286 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9287
9288 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9289 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9290 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9291 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9292
9293 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9294 RegisterNetSyncVariableBool("m_IsTakeable");
9295 RegisterNetSyncVariableBool("m_IsHologram");
9296
9299 {
9302 }
9303
9305
9307 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9309
9310 }
9311
9313 {
9315 }
9316
9318 {
9321 {
9326 }
9327 }
9328
9329 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9330 {
9332 {
9335 }
9336
9338 }
9339
9341 {
9347 }
9348
9350
9352 {
9354
9355 if (!action)
9356 {
9357 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9358 return;
9359 }
9360
9362 if (!ai)
9363 {
9365 return;
9366 }
9367
9369 if (!action_array)
9370 {
9371 action_array = new array<ActionBase_Basic>;
9373 }
9374 if (LogManager.IsActionLogEnable())
9375 {
9376 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9377 }
9378
9379 if (action_array.Find(action) != -1)
9380 {
9381 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9382 }
9383 else
9384 {
9385 action_array.Insert(action);
9386 }
9387 }
9388
9390 {
9392 ActionBase action = player.GetActionManager().GetAction(actionName);
9395
9396 if (action_array)
9397 {
9398 action_array.RemoveItem(action);
9399 }
9400 }
9401
9402
9403
9405 {
9406 ActionOverrideData overrideData = new ActionOverrideData();
9410
9412 if (!actionMap)
9413 {
9416 }
9417
9418 actionMap.Insert(this.
Type(), overrideData);
9419
9420 }
9421
9423
9425
9426
9428 {
9431
9434
9435 string config_to_search = "CfgVehicles";
9436 string muzzle_owner_config;
9437
9439 {
9440 if (IsInherited(Weapon))
9441 config_to_search = "CfgWeapons";
9442
9443 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9444
9445 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9446
9448
9449 if (config_OnFire_subclass_count > 0)
9450 {
9451 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9452
9453 for (int i = 0; i < config_OnFire_subclass_count; i++)
9454 {
9455 string particle_class = "";
9457 string config_OnFire_entry = config_OnFire_class + particle_class;
9458 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9459 WPOF_array.Insert(WPOF);
9460 }
9461
9462
9464 }
9465 }
9466
9468 {
9469 config_to_search = "CfgWeapons";
9470 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9471
9472 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9473
9475
9476 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9477 {
9478 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9479
9480 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9481 {
9482 string particle_class2 = "";
9484 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9485 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9486 WPOBE_array.Insert(WPOBE);
9487 }
9488
9489
9491 }
9492 }
9493 }
9494
9495
9497 {
9500
9502 {
9503 string config_to_search = "CfgVehicles";
9504
9505 if (IsInherited(Weapon))
9506 config_to_search = "CfgWeapons";
9507
9508 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9509 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9510
9511 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9512 {
9513
9515
9517 {
9519 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9521 return;
9522 }
9523
9526
9527
9528
9530 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9531
9532 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9533 {
9534 string particle_class = "";
9536 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9538
9539 if (entry_type == CT_CLASS)
9540 {
9541 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9542 WPOOH_array.Insert(WPOF);
9543 }
9544 }
9545
9546
9548 }
9549 }
9550 }
9551
9553 {
9555 }
9556
9558 {
9560 {
9562
9565
9568
9569 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9570 }
9571 }
9572
9574 {
9576 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9577
9579 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9580
9582 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9583
9585 {
9587 }
9588 }
9589
9591 {
9593 }
9594
9596 {
9599 else
9601
9603 {
9606 }
9607 else
9608 {
9611
9614 }
9615
9617 }
9618
9620 {
9622 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9623 }
9624
9626 {
9628 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9630 }
9631
9633 {
9635 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9636 }
9637
9639 {
9642
9643 OverheatingParticle OP = new OverheatingParticle();
9648
9650 }
9651
9653 {
9656
9657 return -1;
9658 }
9659
9661 {
9663 {
9666
9667 for (int i = count; i > 0; --i)
9668 {
9669 int id = i - 1;
9672
9675
9676 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9677 {
9678 if (p)
9679 {
9682 }
9683 }
9684 }
9685 }
9686 }
9687
9689 {
9691 {
9693 {
9694 int id = i - 1;
9696
9697 if (OP)
9698 {
9700
9701 if (p)
9702 {
9704 }
9705
9706 delete OP;
9707 }
9708 }
9709
9712 }
9713 }
9714
9717 {
9718 return 0.0;
9719 }
9720
9721
9723 {
9724 return 250;
9725 }
9726
9728 {
9729 return 0;
9730 }
9731
9734 {
9736 return true;
9737
9738 return false;
9739 }
9740
9743 {
9746
9748 {
9750 }
9751 else
9752 {
9753
9755 }
9756
9758 }
9759
9766 {
9767 return -1;
9768 }
9769
9770
9771
9772
9774 {
9776 {
9778 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9779
9780 if (r_index >= 0)
9781 {
9782 InventoryLocation r_il = new InventoryLocation;
9783 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9784
9785 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9788 {
9789 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9790 }
9792 {
9793 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9794 }
9795
9796 }
9797
9798 player.GetHumanInventory().ClearUserReservedLocation(this);
9799 }
9800
9803 }
9804
9805
9806
9807
9809 {
9810 return ItemBase.m_DebugActionsMask;
9811 }
9812
9814 {
9815 return ItemBase.m_DebugActionsMask & mask;
9816 }
9817
9819 {
9820 ItemBase.m_DebugActionsMask = mask;
9821 }
9822
9824 {
9825 ItemBase.m_DebugActionsMask |= mask;
9826 }
9827
9829 {
9830 ItemBase.m_DebugActionsMask &= ~mask;
9831 }
9832
9834 {
9836 {
9838 }
9839 else
9840 {
9842 }
9843 }
9844
9845
9847 {
9848 if (GetEconomyProfile())
9849 {
9850 float q_max = GetEconomyProfile().GetQuantityMax();
9851 if (q_max > 0)
9852 {
9853 float q_min = GetEconomyProfile().GetQuantityMin();
9854 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9855
9857 {
9858 ComponentEnergyManager comp = GetCompEM();
9860 {
9862 }
9863 }
9865 {
9867
9868 }
9869
9870 }
9871 }
9872 }
9873
9876 {
9877 EntityAI parent = GetHierarchyParent();
9878
9879 if (parent)
9880 {
9881 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9882 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9883 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9884 }
9885 }
9886
9889 {
9890 EntityAI parent = GetHierarchyParent();
9891
9892 if (parent)
9893 {
9894 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9895 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9896 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9897 }
9898 }
9899
9901 {
9902
9903
9904
9905
9907
9909 {
9910 if (ScriptInputUserData.CanStoreInputUserData())
9911 {
9912 ScriptInputUserData ctx = new ScriptInputUserData;
9918 ctx.
Write(use_stack_max);
9921
9923 {
9924 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9925 }
9926 }
9927 }
9928 else if (!
GetGame().IsMultiplayer())
9929 {
9931 }
9932 }
9933
9935 {
9937 }
9938
9940 {
9942 }
9943
9945 {
9947 }
9948
9950 {
9951
9952 return false;
9953 }
9954
9956 {
9957 return false;
9958 }
9959
9963 {
9964 return false;
9965 }
9966
9968 {
9969 return "";
9970 }
9971
9973
9975 {
9976 return false;
9977 }
9978
9980 {
9981 return true;
9982 }
9983
9984
9985
9987 {
9988 return true;
9989 }
9990
9992 {
9993 return true;
9994 }
9995
9997 {
9998 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10000 }
10001
10003 {
10005 }
10006
10008 {
10010 if (!is_being_placed)
10012 SetSynchDirty();
10013 }
10014
10015
10017
10019 {
10021 }
10022
10024 {
10026 }
10027
10029 {
10030 return 1;
10031 }
10032
10034 {
10035 return false;
10036 }
10037
10039 {
10041 SetSynchDirty();
10042 }
10043
10044
10045
10046
10047
10048
10049
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
10079 {
10080 super.OnMovedInsideCargo(container);
10081
10082 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10083 }
10084
10085 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10086 {
10087 super.EEItemLocationChanged(oldLoc,newLoc);
10088
10089 PlayerBase new_player = null;
10090 PlayerBase old_player = null;
10091
10092 if (newLoc.GetParent())
10093 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10094
10095 if (oldLoc.GetParent())
10096 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10097
10099 {
10100 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10101
10102 if (r_index >= 0)
10103 {
10104 InventoryLocation r_il = new InventoryLocation;
10105 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10106
10107 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10110 {
10111 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10112 }
10114 {
10115 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10116 }
10117
10118 }
10119 }
10120
10122 {
10123 if (new_player)
10124 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10125
10126 if (new_player == old_player)
10127 {
10128
10129 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10130 {
10132 {
10133 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10134 {
10135 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10136 }
10137 }
10138 else
10139 {
10140 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10141 }
10142 }
10143
10144 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10145 {
10146 int type = oldLoc.GetType();
10148 {
10149 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10150 }
10152 {
10153 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10154 }
10155 }
10156 if (!m_OldLocation)
10157 {
10158 m_OldLocation = new InventoryLocation;
10159 }
10160 m_OldLocation.Copy(oldLoc);
10161 }
10162 else
10163 {
10164 if (m_OldLocation)
10165 {
10166 m_OldLocation.Reset();
10167 }
10168 }
10169
10171 }
10172 else
10173 {
10174 if (new_player)
10175 {
10176 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10177 if (res_index >= 0)
10178 {
10179 InventoryLocation il = new InventoryLocation;
10180 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10182 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10185 {
10186 il.
GetParent().GetOnReleaseLock().Invoke(it);
10187 }
10189 {
10191 }
10192
10193 }
10194 }
10196 {
10197
10199 }
10200
10201 if (m_OldLocation)
10202 {
10203 m_OldLocation.Reset();
10204 }
10205 }
10206 }
10207
10208 override void EOnContact(IEntity other, Contact extra)
10209 {
10211 {
10212 int liquidType = -1;
10214 if (impactSpeed > 0.0)
10215 {
10217 #ifndef SERVER
10219 #else
10221 SetSynchDirty();
10222 #endif
10224 }
10225 }
10226
10227 #ifdef SERVER
10228 if (GetCompEM() && GetCompEM().IsPlugged())
10229 {
10230 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10231 GetCompEM().UnplugThis();
10232 }
10233 #endif
10234 }
10235
10237
10239 {
10241 }
10242
10244 {
10245
10246 }
10247
10249 {
10250 super.OnItemLocationChanged(old_owner, new_owner);
10251
10252 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10253 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10254
10255 if (!relatedPlayer && playerNew)
10256 relatedPlayer = playerNew;
10257
10258 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10259 {
10261 if (actionMgr)
10262 {
10263 ActionBase currentAction = actionMgr.GetRunningAction();
10264 if (currentAction)
10266 }
10267 }
10268
10269 Man ownerPlayerOld = null;
10270 Man ownerPlayerNew = null;
10271
10272 if (old_owner)
10273 {
10274 if (old_owner.
IsMan())
10275 {
10276 ownerPlayerOld = Man.Cast(old_owner);
10277 }
10278 else
10279 {
10280 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10281 }
10282 }
10283 else
10284 {
10286 {
10288
10289 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10290 {
10291 GetCompEM().UnplugThis();
10292 }
10293 }
10294 }
10295
10296 if (new_owner)
10297 {
10298 if (new_owner.
IsMan())
10299 {
10300 ownerPlayerNew = Man.Cast(new_owner);
10301 }
10302 else
10303 {
10304 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10305 }
10306 }
10307
10308 if (ownerPlayerOld != ownerPlayerNew)
10309 {
10310 if (ownerPlayerOld)
10311 {
10312 array<EntityAI> subItemsExit = new array<EntityAI>;
10314 for (int i = 0; i < subItemsExit.Count(); i++)
10315 {
10318 }
10319 }
10320
10321 if (ownerPlayerNew)
10322 {
10323 array<EntityAI> subItemsEnter = new array<EntityAI>;
10325 for (int j = 0; j < subItemsEnter.Count(); j++)
10326 {
10329 }
10330 }
10331 }
10332 else if (ownerPlayerNew != null)
10333 {
10334 PlayerBase nplayer;
10335 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10336 {
10337 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10339 for (int k = 0; k < subItemsUpdate.Count(); k++)
10340 {
10342 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10343 }
10344 }
10345 }
10346
10347 if (old_owner)
10348 old_owner.OnChildItemRemoved(this);
10349 if (new_owner)
10350 new_owner.OnChildItemReceived(this);
10351 }
10352
10353
10355 {
10356 super.EEDelete(parent);
10357 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10358 if (player)
10359 {
10361
10362 if (player.IsAlive())
10363 {
10364 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10365 if (r_index >= 0)
10366 {
10367 InventoryLocation r_il = new InventoryLocation;
10368 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10369
10370 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10373 {
10374 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10375 }
10377 {
10378 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10379 }
10380
10381 }
10382
10383 player.RemoveQuickBarEntityShortcut(this);
10384 }
10385 }
10386 }
10387
10389 {
10390 super.EEKilled(killer);
10391
10394 {
10395 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10396 {
10397 if (IsMagazine())
10398 {
10399 if (Magazine.Cast(this).GetAmmoCount() > 0)
10400 {
10402 }
10403 }
10404 else
10405 {
10407 }
10408 }
10409 }
10410 }
10411
10413 {
10414 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10415
10416 super.OnWasAttached(parent, slot_id);
10417
10420
10422 }
10423
10425 {
10426 super.OnWasDetached(parent, slot_id);
10427
10430 }
10431
10433 {
10434 int idx;
10437
10438 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10439 if (inventory_slots.Count() < 1)
10440 {
10441 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10442 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10443 }
10444 else
10445 {
10446 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10447 }
10448
10449 idx = inventory_slots.Find(slot);
10450 if (idx < 0)
10451 return "";
10452
10453 return attach_types.Get(idx);
10454 }
10455
10457 {
10458 int idx = -1;
10459 string slot;
10460
10463
10464 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10465 if (inventory_slots.Count() < 1)
10466 {
10467 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10468 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10469 }
10470 else
10471 {
10472 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10473 if (detach_types.Count() < 1)
10474 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10475 }
10476
10477 for (int i = 0; i < inventory_slots.Count(); i++)
10478 {
10479 slot = inventory_slots.Get(i);
10480 }
10481
10482 if (slot != "")
10483 {
10484 if (detach_types.Count() == 1)
10485 idx = 0;
10486 else
10487 idx = inventory_slots.Find(slot);
10488 }
10489 if (idx < 0)
10490 return "";
10491
10492 return detach_types.Get(idx);
10493 }
10494
10496 {
10497
10499
10500
10501 float min_time = 1;
10502 float max_time = 3;
10503 float delay = Math.RandomFloat(min_time, max_time);
10504
10505 explode_timer.Run(delay, this, "DoAmmoExplosion");
10506 }
10507
10509 {
10510 Magazine magazine = Magazine.Cast(this);
10511 int pop_sounds_count = 6;
10512 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10513
10514
10515 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10516 string sound_name = pop_sounds[ sound_idx ];
10518
10519
10520 magazine.ServerAddAmmoCount(-1);
10521
10522
10523 float min_temp_to_explode = 100;
10524
10525 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10526 {
10528 }
10529 }
10530
10531
10532 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10533 {
10534 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10535
10536 const int CHANCE_DAMAGE_CARGO = 4;
10537 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10538 const int CHANCE_DAMAGE_NOTHING = 2;
10539
10541 {
10542 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10543 int chances;
10544 int rnd;
10545
10546 if (GetInventory().GetCargo())
10547 {
10548 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10549 rnd = Math.RandomInt(0,chances);
10550
10551 if (rnd < CHANCE_DAMAGE_CARGO)
10552 {
10554 }
10555 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10556 {
10558 }
10559 }
10560 else
10561 {
10562 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10563 rnd = Math.RandomInt(0,chances);
10564
10565 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10566 {
10568 }
10569 }
10570 }
10571 }
10572
10574 {
10575 if (GetInventory().GetCargo())
10576 {
10577 int item_count = GetInventory().GetCargo().GetItemCount();
10578 if (item_count > 0)
10579 {
10580 int random_pick = Math.RandomInt(0, item_count);
10582 if (!item.IsExplosive())
10583 {
10584 item.AddHealth("","",damage);
10585 return true;
10586 }
10587 }
10588 }
10589 return false;
10590 }
10591
10593 {
10594 int attachment_count = GetInventory().AttachmentCount();
10595 if (attachment_count > 0)
10596 {
10597 int random_pick = Math.RandomInt(0, attachment_count);
10598 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10599 if (!attachment.IsExplosive())
10600 {
10601 attachment.AddHealth("","",damage);
10602 return true;
10603 }
10604 }
10605 return false;
10606 }
10607
10609 {
10611 }
10612
10614 {
10616 return GetInventory().CanRemoveEntity();
10617
10618 return false;
10619 }
10620
10622 {
10624 return;
10625
10627 {
10628 if (ScriptInputUserData.CanStoreInputUserData())
10629 {
10630 ScriptInputUserData ctx = new ScriptInputUserData;
10635 ctx.
Write(destination_entity);
10637 ctx.
Write(slot_id);
10639 }
10640 }
10641 else if (!
GetGame().IsMultiplayer())
10642 {
10644 }
10645 }
10646
10648 {
10650 return;
10651
10652 float split_quantity_new;
10656 InventoryLocation loc = new InventoryLocation;
10657
10658 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10659 {
10661 split_quantity_new = stack_max;
10662 else
10664
10665 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10666 if (new_item)
10667 {
10668 new_item.SetResultOfSplit(true);
10669 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10671 new_item.SetQuantity(split_quantity_new);
10672 }
10673 }
10674 else if (destination_entity && slot_id == -1)
10675 {
10676 if (quantity > stack_max)
10677 split_quantity_new = stack_max;
10678 else
10679 split_quantity_new = quantity;
10680
10682 {
10685 }
10686
10687 if (new_item)
10688 {
10689 new_item.SetResultOfSplit(true);
10690 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10692 new_item.SetQuantity(split_quantity_new);
10693 }
10694 }
10695 else
10696 {
10697 if (stack_max != 0)
10698 {
10700 {
10702 }
10703
10704 if (split_quantity_new == 0)
10705 {
10706 if (!
GetGame().IsMultiplayer())
10707 player.PhysicalPredictiveDropItem(this);
10708 else
10709 player.ServerDropEntity(this);
10710 return;
10711 }
10712
10714
10715 if (new_item)
10716 {
10717 new_item.SetResultOfSplit(true);
10718 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10720 new_item.SetQuantity(stack_max);
10721 new_item.PlaceOnSurface();
10722 }
10723 }
10724 }
10725 }
10726
10728 {
10730 return;
10731
10732 float split_quantity_new;
10736 InventoryLocation loc = new InventoryLocation;
10737
10738 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10739 {
10741 split_quantity_new = stack_max;
10742 else
10744
10745 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10746 if (new_item)
10747 {
10748 new_item.SetResultOfSplit(true);
10749 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10751 new_item.SetQuantity(split_quantity_new);
10752 }
10753 }
10754 else if (destination_entity && slot_id == -1)
10755 {
10756 if (quantity > stack_max)
10757 split_quantity_new = stack_max;
10758 else
10759 split_quantity_new = quantity;
10760
10762 {
10765 }
10766
10767 if (new_item)
10768 {
10769 new_item.SetResultOfSplit(true);
10770 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10772 new_item.SetQuantity(split_quantity_new);
10773 }
10774 }
10775 else
10776 {
10777 if (stack_max != 0)
10778 {
10780 {
10782 }
10783
10785
10786 if (new_item)
10787 {
10788 new_item.SetResultOfSplit(true);
10789 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10791 new_item.SetQuantity(stack_max);
10792 new_item.PlaceOnSurface();
10793 }
10794 }
10795 }
10796 }
10797
10799 {
10801 return;
10802
10804 {
10805 if (ScriptInputUserData.CanStoreInputUserData())
10806 {
10807 ScriptInputUserData ctx = new ScriptInputUserData;
10812 dst.WriteToContext(ctx);
10814 }
10815 }
10816 else if (!
GetGame().IsMultiplayer())
10817 {
10819 }
10820 }
10821
10823 {
10825 return;
10826
10828 {
10829 if (ScriptInputUserData.CanStoreInputUserData())
10830 {
10831 ScriptInputUserData ctx = new ScriptInputUserData;
10836 ctx.
Write(destination_entity);
10842 }
10843 }
10844 else if (!
GetGame().IsMultiplayer())
10845 {
10847 }
10848 }
10849
10851 {
10853 }
10854
10856 {
10858 return this;
10859
10861 float split_quantity_new;
10863 if (dst.IsValid())
10864 {
10865 int slot_id = dst.GetSlot();
10867
10868 if (quantity > stack_max)
10869 split_quantity_new = stack_max;
10870 else
10871 split_quantity_new = quantity;
10872
10874
10875 if (new_item)
10876 {
10877 new_item.SetResultOfSplit(true);
10878 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10881 }
10882
10883 return new_item;
10884 }
10885
10886 return null;
10887 }
10888
10890 {
10892 return;
10893
10895 float split_quantity_new;
10897 if (destination_entity)
10898 {
10900 if (quantity > stackable)
10901 split_quantity_new = stackable;
10902 else
10903 split_quantity_new = quantity;
10904
10905 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10906 if (new_item)
10907 {
10908 new_item.SetResultOfSplit(true);
10909 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10911 new_item.SetQuantity(split_quantity_new);
10912 }
10913 }
10914 }
10915
10917 {
10919 return;
10920
10922 {
10923 if (ScriptInputUserData.CanStoreInputUserData())
10924 {
10925 ScriptInputUserData ctx = new ScriptInputUserData;
10930 ItemBase destination_entity =
this;
10931 ctx.
Write(destination_entity);
10935 }
10936 }
10937 else if (!
GetGame().IsMultiplayer())
10938 {
10940 }
10941 }
10942
10944 {
10946 return;
10947
10949 float split_quantity_new;
10951 if (player)
10952 {
10954 if (quantity > stackable)
10955 split_quantity_new = stackable;
10956 else
10957 split_quantity_new = quantity;
10958
10959 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10960 new_item =
ItemBase.Cast(in_hands);
10961 if (new_item)
10962 {
10963 new_item.SetResultOfSplit(true);
10964 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10966 new_item.SetQuantity(split_quantity_new);
10967 }
10968 }
10969 }
10970
10972 {
10974 return;
10975
10977 float split_quantity_new = Math.Floor(quantity * 0.5);
10978
10980
10981 if (new_item)
10982 {
10983 if (new_item.GetQuantityMax() < split_quantity_new)
10984 {
10985 split_quantity_new = new_item.GetQuantityMax();
10986 }
10987
10988 new_item.SetResultOfSplit(true);
10989 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10990
10992 {
10995 }
10996 else
10997 {
11000 }
11001 }
11002 }
11003
11005 {
11007 return;
11008
11010 float split_quantity_new = Math.Floor(quantity / 2);
11011
11012 InventoryLocation invloc = new InventoryLocation;
11014
11016 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11017
11018 if (new_item)
11019 {
11020 if (new_item.GetQuantityMax() < split_quantity_new)
11021 {
11022 split_quantity_new = new_item.GetQuantityMax();
11023 }
11025 {
11028 }
11029 else
11030 {
11033 }
11034 }
11035 }
11036
11039 {
11040 SetWeightDirty();
11042
11043 if (parent)
11044 parent.OnAttachmentQuantityChangedEx(this, delta);
11045
11047 {
11049 {
11051 }
11053 {
11054 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11056 }
11057 }
11058
11059 }
11060
11063 {
11064
11065 }
11066
11069 {
11071 }
11072
11074 {
11075 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11076
11078 {
11079 if (newLevel == GameConstants.STATE_RUINED)
11080 {
11082 EntityAI parent = GetHierarchyParent();
11083 if (parent && parent.IsFireplace())
11084 {
11085 CargoBase cargo = GetInventory().GetCargo();
11086 if (cargo)
11087 {
11089 {
11091 }
11092 }
11093 }
11094 }
11095
11097 {
11098
11100 return;
11101 }
11102
11103 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11104 {
11106 }
11107 }
11108 }
11109
11110
11112 {
11113 super.OnRightClick();
11114
11116 {
11118 {
11119 if (ScriptInputUserData.CanStoreInputUserData())
11120 {
11121 vector m4[4];
11123
11124 EntityAI root = GetHierarchyRoot();
11125
11126 InventoryLocation dst = new InventoryLocation;
11128 {
11129 if (root)
11130 {
11131 root.GetTransform(m4);
11133 }
11134 else
11135 GetInventory().GetCurrentInventoryLocation(dst);
11136 }
11137 else
11138 {
11140
11141
11142 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11143 {
11144 if (root)
11145 {
11146 root.GetTransform(m4);
11148 }
11149 else
11150 GetInventory().GetCurrentInventoryLocation(dst);
11151 }
11152 else
11153 {
11154 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11155 }
11156 }
11157
11158 ScriptInputUserData ctx = new ScriptInputUserData;
11166 }
11167 }
11168 else if (!
GetGame().IsMultiplayer())
11169 {
11171 }
11172 }
11173 }
11174
11175 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11176 {
11177
11178 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11179 return false;
11180
11181 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11182 return false;
11183
11184
11186 return false;
11187
11188
11189 Magazine mag = Magazine.Cast(this);
11190 if (mag)
11191 {
11192 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11193 return false;
11194
11195 if (stack_max_limit)
11196 {
11197 Magazine other_mag = Magazine.Cast(other_item);
11198 if (other_item)
11199 {
11200 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11201 return false;
11202 }
11203
11204 }
11205 }
11206 else
11207 {
11208
11210 return false;
11211
11213 return false;
11214 }
11215
11216 PlayerBase player = null;
11217 if (CastTo(player, GetHierarchyRootPlayer()))
11218 {
11219 if (player.GetInventory().HasAttachment(this))
11220 return false;
11221
11222 if (player.IsItemsToDelete())
11223 return false;
11224 }
11225
11226 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11227 return false;
11228
11229 int slotID;
11231 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11232 return false;
11233
11234 return true;
11235 }
11236
11238 {
11240 }
11241
11243 {
11244 return m_IsResultOfSplit;
11245 }
11246
11248 {
11249 m_IsResultOfSplit = value;
11250 }
11251
11253 {
11255 }
11256
11258 {
11259 float other_item_quantity = other_item.GetQuantity();
11260 float this_free_space;
11261
11263
11265
11266 if (other_item_quantity > this_free_space)
11267 {
11268 return this_free_space;
11269 }
11270 else
11271 {
11272 return other_item_quantity;
11273 }
11274 }
11275
11277 {
11279 }
11280
11282 {
11284 return;
11285
11286 if (!IsMagazine() && other_item)
11287 {
11289 if (quantity_used != 0)
11290 {
11291 float hp1 = GetHealth01("","");
11292 float hp2 = other_item.GetHealth01("","");
11293 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11294 hpResult = hpResult / (
GetQuantity() + quantity_used);
11295
11296 hpResult *= GetMaxHealth();
11297 Math.Round(hpResult);
11298 SetHealth("", "Health", hpResult);
11299
11301 other_item.AddQuantity(-quantity_used);
11302 }
11303 }
11305 }
11306
11308 {
11309 #ifdef SERVER
11310 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11311 GetHierarchyParent().IncreaseLifetimeUp();
11312 #endif
11313 };
11314
11316 {
11317 PlayerBase p = PlayerBase.Cast(player);
11318
11319 array<int> recipesIds = p.m_Recipes;
11320 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11321 if (moduleRecipesManager)
11322 {
11323 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11324 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11325 }
11326
11327 for (int i = 0;i < recipesIds.Count(); i++)
11328 {
11329 int key = recipesIds.Get(i);
11330 string recipeName = moduleRecipesManager.GetRecipeName(key);
11332 }
11333 }
11334
11335
11336 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11337 {
11338 super.GetDebugActions(outputList);
11339
11340
11345
11346
11350
11354
11355
11358
11359
11361 {
11364 }
11365
11367
11370
11374 }
11375
11376
11377
11378
11380 {
11381 super.OnAction(action_id, player, ctx);
11382 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11383 {
11384 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11385 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11386 PlayerBase p = PlayerBase.Cast(player);
11387 if (
EActions.RECIPES_RANGE_START < 1000)
11388 {
11389 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11390 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11391 }
11392 }
11393 #ifndef SERVER
11394 else if (action_id ==
EActions.WATCH_PLAYER)
11395 {
11396 PluginDeveloper.SetDeveloperItemClientEx(player);
11397 }
11398 #endif
11400 {
11401 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11402 {
11403 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11404 OnDebugButtonPressServer(id + 1);
11405 }
11406
11407 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11408 {
11409 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11411 }
11412
11413 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11414 {
11415 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11417 }
11418
11419 else if (action_id ==
EActions.ADD_QUANTITY)
11420 {
11421 if (IsMagazine())
11422 {
11423 Magazine mag = Magazine.Cast(this);
11424 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11425 }
11426 else
11427 {
11429 }
11430
11431 if (m_EM)
11432 {
11433 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11434 }
11435
11436 }
11437
11438 else if (action_id ==
EActions.REMOVE_QUANTITY)
11439 {
11440 if (IsMagazine())
11441 {
11442 Magazine mag2 = Magazine.Cast(this);
11443 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11444 }
11445 else
11446 {
11448 }
11449 if (m_EM)
11450 {
11451 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11452 }
11453
11454 }
11455
11456 else if (action_id ==
EActions.SET_QUANTITY_0)
11457 {
11459
11460 if (m_EM)
11461 {
11462 m_EM.SetEnergy(0);
11463 }
11464 }
11465
11466 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11467 {
11469
11470 if (m_EM)
11471 {
11472 m_EM.SetEnergy(m_EM.GetEnergyMax());
11473 }
11474 }
11475
11476 else if (action_id ==
EActions.ADD_HEALTH)
11477 {
11478 AddHealth("","",GetMaxHealth("","Health")/5);
11479 }
11480 else if (action_id ==
EActions.REMOVE_HEALTH)
11481 {
11482 AddHealth("","",-GetMaxHealth("","Health")/5);
11483 }
11484 else if (action_id ==
EActions.DESTROY_HEALTH)
11485 {
11486 SetHealth01("","",0);
11487 }
11488 else if (action_id ==
EActions.WATCH_ITEM)
11489 {
11491 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11492 #ifdef DEVELOPER
11493 SetDebugDeveloper_item(this);
11494 #endif
11495 }
11496
11497 else if (action_id ==
EActions.ADD_TEMPERATURE)
11498 {
11499 AddTemperature(20);
11500
11501 }
11502
11503 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11504 {
11505 AddTemperature(-20);
11506
11507 }
11508
11509 else if (action_id ==
EActions.FLIP_FROZEN)
11510 {
11511 SetFrozen(!GetIsFrozen());
11512
11513 }
11514
11515 else if (action_id ==
EActions.ADD_WETNESS)
11516 {
11518
11519 }
11520
11521 else if (action_id ==
EActions.REMOVE_WETNESS)
11522 {
11524
11525 }
11526
11527 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11528 {
11531
11532
11533 }
11534
11535 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11536 {
11539 }
11540
11541 else if (action_id ==
EActions.MAKE_SPECIAL)
11542 {
11543 auto debugParams = DebugSpawnParams.WithPlayer(player);
11544 OnDebugSpawnEx(debugParams);
11545 }
11546
11547 else if (action_id ==
EActions.DELETE)
11548 {
11549 Delete();
11550 }
11551
11552 }
11553
11554
11555 return false;
11556 }
11557
11558
11559
11560
11564
11567
11568
11569
11571 {
11572 return false;
11573 }
11574
11575
11577 {
11578 return true;
11579 }
11580
11581
11583 {
11584 return true;
11585 }
11586
11587
11588
11590 {
11591 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11593 }
11594
11597 {
11598 return null;
11599 }
11600
11602 {
11603 return false;
11604 }
11605
11607 {
11608 return false;
11609 }
11610
11614
11615
11617 {
11618 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11619 return module_repairing.CanRepair(this, item_repair_kit);
11620 }
11621
11622
11623 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11624 {
11625 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11626 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11627 }
11628
11629
11631 {
11632
11633
11634
11635
11636
11637
11638
11639
11640 return 1;
11641 }
11642
11643
11644
11646 {
11648 }
11649
11650
11651
11653 {
11655 }
11656
11657
11666 {
11667 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11668
11669 if (player)
11670 {
11671 player.MessageStatus(text);
11672 }
11673 }
11674
11675
11684 {
11685 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11686
11687 if (player)
11688 {
11689 player.MessageAction(text);
11690 }
11691 }
11692
11693
11702 {
11703 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11704
11705 if (player)
11706 {
11707 player.MessageFriendly(text);
11708 }
11709 }
11710
11711
11720 {
11721 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11722
11723 if (player)
11724 {
11725 player.MessageImportant(text);
11726 }
11727 }
11728
11730 {
11731 return true;
11732 }
11733
11734
11735 override bool KindOf(
string tag)
11736 {
11737 bool found = false;
11738 string item_name = this.
GetType();
11741
11742 int array_size = item_tag_array.Count();
11743 for (int i = 0; i < array_size; i++)
11744 {
11745 if (item_tag_array.Get(i) == tag)
11746 {
11747 found = true;
11748 break;
11749 }
11750 }
11751 return found;
11752 }
11753
11754
11756 {
11757
11758 super.OnRPC(sender, rpc_type,ctx);
11759
11760
11761 switch (rpc_type)
11762 {
11763 #ifndef SERVER
11764 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11765 Param2<bool, string> p = new Param2<bool, string>(false, "");
11766
11768 return;
11769
11770 bool play = p.param1;
11771 string soundSet = p.param2;
11772
11773 if (play)
11774 {
11776 {
11778 {
11780 }
11781 }
11782 else
11783 {
11785 }
11786 }
11787 else
11788 {
11790 }
11791
11792 break;
11793 #endif
11794
11795 }
11796
11798 {
11800 }
11801 }
11802
11803
11804
11805
11807 {
11808 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11809 return plugin.GetID(
name);
11810 }
11811
11813 {
11814 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11815 return plugin.GetName(id);
11816 }
11817
11820 {
11821
11822
11823 int varFlags;
11824 if (!ctx.
Read(varFlags))
11825 return;
11826
11827 if (varFlags & ItemVariableFlags.FLOAT)
11828 {
11830 }
11831 }
11832
11834 {
11835
11836 super.SerializeNumericalVars(floats_out);
11837
11838
11839
11841 {
11843 }
11844
11846 {
11848 }
11849
11851 {
11853 }
11854
11856 {
11861 }
11862
11864 {
11866 }
11867 }
11868
11870 {
11871
11872 super.DeSerializeNumericalVars(floats);
11873
11874
11875 int index = 0;
11876 int mask = Math.Round(floats.Get(index));
11877
11878 index++;
11879
11881 {
11883 {
11885 }
11886 else
11887 {
11888 float quantity = floats.Get(index);
11889 SetQuantity(quantity,
true,
false,
false,
false);
11890 }
11891 index++;
11892 }
11893
11895 {
11896 float wet = floats.Get(index);
11898 index++;
11899 }
11900
11902 {
11903 int liquidtype = Math.Round(floats.Get(index));
11905 index++;
11906 }
11907
11909 {
11911 index++;
11913 index++;
11915 index++;
11917 index++;
11918 }
11919
11921 {
11922 int cleanness = Math.Round(floats.Get(index));
11924 index++;
11925 }
11926 }
11927
11929 {
11930 super.WriteVarsToCTX(ctx);
11931
11932
11934 {
11936 }
11937
11939 {
11941 }
11942
11944 {
11946 }
11947
11949 {
11950 int r,g,b,a;
11956 }
11957
11959 {
11961 }
11962 }
11963
11965 {
11966 if (!super.ReadVarsFromCTX(ctx,version))
11967 return false;
11968
11969 int intValue;
11970 float value;
11971
11972 if (version < 140)
11973 {
11974 if (!ctx.
Read(intValue))
11975 return false;
11976
11977 m_VariablesMask = intValue;
11978 }
11979
11981 {
11982 if (!ctx.
Read(value))
11983 return false;
11984
11986 {
11988 }
11989 else
11990 {
11992 }
11993 }
11994
11995 if (version < 140)
11996 {
11998 {
11999 if (!ctx.
Read(value))
12000 return false;
12001 SetTemperatureDirect(value);
12002 }
12003 }
12004
12006 {
12007 if (!ctx.
Read(value))
12008 return false;
12010 }
12011
12013 {
12014 if (!ctx.
Read(intValue))
12015 return false;
12017 }
12018
12020 {
12021 int r,g,b,a;
12023 return false;
12025 return false;
12027 return false;
12029 return false;
12030
12032 }
12033
12035 {
12036 if (!ctx.
Read(intValue))
12037 return false;
12039 }
12040
12041 if (version >= 138 && version < 140)
12042 {
12044 {
12045 if (!ctx.
Read(intValue))
12046 return false;
12047 SetFrozen(intValue);
12048 }
12049 }
12050
12051 return true;
12052 }
12053
12054
12056 {
12059 {
12061 }
12062
12063 if (!super.OnStoreLoad(ctx, version))
12064 {
12066 return false;
12067 }
12068
12069 if (version >= 114)
12070 {
12071 bool hasQuickBarIndexSaved;
12072
12073 if (!ctx.
Read(hasQuickBarIndexSaved))
12074 {
12076 return false;
12077 }
12078
12079 if (hasQuickBarIndexSaved)
12080 {
12081 int itmQBIndex;
12082
12083
12084 if (!ctx.
Read(itmQBIndex))
12085 {
12087 return false;
12088 }
12089
12090 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12091 if (itmQBIndex != -1 && parentPlayer)
12092 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12093 }
12094 }
12095 else
12096 {
12097
12098 PlayerBase player;
12099 int itemQBIndex;
12100 if (version ==
int.
MAX)
12101 {
12102 if (!ctx.
Read(itemQBIndex))
12103 {
12105 return false;
12106 }
12107 }
12108 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12109 {
12110
12111 if (!ctx.
Read(itemQBIndex))
12112 {
12114 return false;
12115 }
12116 if (itemQBIndex != -1 && player)
12117 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12118 }
12119 }
12120
12121 if (version < 140)
12122 {
12123
12124 if (!LoadVariables(ctx, version))
12125 {
12127 return false;
12128 }
12129 }
12130
12131
12133 {
12135 return false;
12136 }
12137 if (version >= 132)
12138 {
12140 if (raib)
12141 {
12143 {
12145 return false;
12146 }
12147 }
12148 }
12149
12151 return true;
12152 }
12153
12154
12155
12157 {
12158 super.OnStoreSave(ctx);
12159
12160 PlayerBase player;
12161 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12162 {
12164
12165 int itemQBIndex = -1;
12166 itemQBIndex = player.FindQuickBarEntityIndex(this);
12167 ctx.
Write(itemQBIndex);
12168 }
12169 else
12170 {
12172 }
12173
12175
12177 if (raib)
12178 {
12180 }
12181 }
12182
12183
12185 {
12186 super.AfterStoreLoad();
12187
12189 {
12191 }
12192
12194 {
12197 }
12198 }
12199
12201 {
12202 super.EEOnAfterLoad();
12203
12205 {
12207 }
12208
12211 }
12212
12214 {
12215 return false;
12216 }
12217
12218
12219
12221 {
12223 {
12224 #ifdef PLATFORM_CONSOLE
12225
12227 {
12229 if (menu)
12230 {
12232 }
12233 }
12234 #endif
12235 }
12236
12238 {
12241 }
12242
12244 {
12245 SetWeightDirty();
12247 }
12249 {
12252 }
12253
12255 {
12258 }
12260 {
12263 }
12264
12265 super.OnVariablesSynchronized();
12266 }
12267
12268
12269
12271 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12272 {
12273 if (!IsServerCheck(allow_client))
12274 return false;
12275
12277 return false;
12278
12281
12282 if (value <= (min + 0.001))
12283 value = min;
12284
12285 if (value == min)
12286 {
12287 if (destroy_config)
12288 {
12289 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12290 if (dstr)
12291 {
12293 this.Delete();
12294 return true;
12295 }
12296 }
12297 else if (destroy_forced)
12298 {
12300 this.Delete();
12301 return true;
12302 }
12303
12305 }
12306
12309
12311 {
12313
12314 if (delta)
12316 }
12317
12319
12320 return false;
12321 }
12322
12323
12325 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12326 {
12328 }
12329
12331 {
12334 }
12335
12337 {
12340 }
12341
12344 {
12345 float value_clamped = Math.Clamp(value, 0, 1);
12347 SetQuantity(result, destroy_config, destroy_forced);
12348 }
12349
12350
12353 {
12355 }
12356
12358 {
12360 }
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12372 {
12373 int slot = -1;
12374 if (GetInventory())
12375 {
12376 InventoryLocation il = new InventoryLocation;
12377 GetInventory().GetCurrentInventoryLocation(il);
12379 }
12380
12382 }
12383
12385 {
12386 float quantity_max = 0;
12387
12389 {
12390 if (attSlotID != -1)
12391 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12392
12393 if (quantity_max <= 0)
12395 }
12396
12397 if (quantity_max <= 0)
12399
12400 return quantity_max;
12401 }
12402
12404 {
12406 }
12407
12409 {
12411 }
12412
12413
12415 {
12417 }
12418
12420 {
12422 }
12423
12425 {
12427 }
12428
12429
12431 {
12432
12433 float weightEx = GetWeightEx();
12434 float special = GetInventoryAndCargoWeight();
12435 return weightEx - special;
12436 }
12437
12438
12440 {
12442 }
12443
12445 {
12447 {
12448 #ifdef DEVELOPER
12449 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12450 {
12451 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12453 }
12454 #endif
12455
12456 return GetQuantity() * GetConfigWeightModified();
12457 }
12458 else if (HasEnergyManager())
12459 {
12460 #ifdef DEVELOPER
12461 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12462 {
12463 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12464 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12465 }
12466 #endif
12467 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12468 }
12469 else
12470 {
12471 #ifdef DEVELOPER
12472 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12473 {
12474 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12475 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12476 }
12477 #endif
12478 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12479 }
12480 }
12481
12484 {
12485 int item_count = 0;
12487
12488 if (GetInventory().GetCargo() != NULL)
12489 {
12490 item_count = GetInventory().GetCargo().GetItemCount();
12491 }
12492
12493 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12494 {
12495 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12496 if (item)
12497 item_count += item.GetNumberOfItems();
12498 }
12499 return item_count;
12500 }
12501
12504 {
12505 float weight = 0;
12506 float wetness = 1;
12507 if (include_wetness)
12510 {
12511 weight = wetness * m_ConfigWeight;
12512 }
12514 {
12515 weight = 1;
12516 }
12517 return weight;
12518 }
12519
12520
12521
12523 {
12524 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12525 {
12526 GameInventory inv = GetInventory();
12527 array<EntityAI> items = new array<EntityAI>;
12529 for (int i = 0; i < items.Count(); i++)
12530 {
12532 if (item)
12533 {
12535 }
12536 }
12537 }
12538 }
12539
12540
12541
12542
12544 {
12545 float energy = 0;
12546 if (HasEnergyManager())
12547 {
12548 energy = GetCompEM().GetEnergy();
12549 }
12550 return energy;
12551 }
12552
12553
12555 {
12556 super.OnEnergyConsumed();
12557
12559 }
12560
12562 {
12563 super.OnEnergyAdded();
12564
12566 }
12567
12568
12570 {
12571 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12572 {
12574 {
12575 float energy_0to1 = GetCompEM().GetEnergy0To1();
12577 }
12578 }
12579 }
12580
12581
12583 {
12584 return ConfigGetFloat("heatIsolation");
12585 }
12586
12588 {
12590 }
12591
12593 {
12594 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12595 if (
GetGame().ConfigIsExisting(paramPath))
12597
12598 return 0.0;
12599 }
12600
12602 {
12603 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12604 if (
GetGame().ConfigIsExisting(paramPath))
12606
12607 return 0.0;
12608 }
12609
12610 override void SetWet(
float value,
bool allow_client =
false)
12611 {
12612 if (!IsServerCheck(allow_client))
12613 return;
12614
12617
12619
12620 m_VarWet = Math.Clamp(value, min, max);
12621
12623 {
12626 }
12627 }
12628
12629 override void AddWet(
float value)
12630 {
12632 }
12633
12635 {
12637 }
12638
12640 {
12642 }
12643
12645 {
12647 }
12648
12650 {
12652 }
12653
12655 {
12657 }
12658
12659 override void OnWetChanged(
float newVal,
float oldVal)
12660 {
12663 if (newLevel != oldLevel)
12664 {
12666 }
12667 }
12668
12670 {
12671 SetWeightDirty();
12672 }
12673
12675 {
12676 return GetWetLevelInternal(
m_VarWet);
12677 }
12678
12679
12680
12682 {
12684 }
12685
12687 {
12689 }
12690
12692 {
12694 }
12695
12697 {
12699 }
12700
12701
12702
12704 {
12705 if (ConfigIsExisting("itemModelLength"))
12706 {
12707 return ConfigGetFloat("itemModelLength");
12708 }
12709 return 0;
12710 }
12711
12713 {
12714 if (ConfigIsExisting("itemAttachOffset"))
12715 {
12716 return ConfigGetFloat("itemAttachOffset");
12717 }
12718 return 0;
12719 }
12720
12721 override void SetCleanness(
int value,
bool allow_client =
false)
12722 {
12723 if (!IsServerCheck(allow_client))
12724 return;
12725
12727
12729
12732 }
12733
12735 {
12737 }
12738
12740 {
12741 return true;
12742 }
12743
12744
12745
12746
12748 {
12750 }
12751
12753 {
12755 }
12756
12757
12758
12759
12760 override void SetColor(
int r,
int g,
int b,
int a)
12761 {
12767 }
12769 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12770 {
12775 }
12776
12778 {
12780 }
12781
12784 {
12785 int r,g,b,a;
12787 r = r/255;
12788 g = g/255;
12789 b = b/255;
12790 a = a/255;
12791 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12792 }
12793
12794
12795
12796 override void SetLiquidType(
int value,
bool allow_client =
false)
12797 {
12798 if (!IsServerCheck(allow_client))
12799 return;
12800
12805 }
12806
12808 {
12809 return ConfigGetInt("varLiquidTypeInit");
12810 }
12811
12813 {
12815 }
12816
12818 {
12820 SetFrozen(false);
12821 }
12822
12825 {
12826 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12827 }
12828
12829
12832 {
12833 PlayerBase nplayer;
12834 if (PlayerBase.CastTo(nplayer, player))
12835 {
12837
12838 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12839 }
12840 }
12841
12842
12845 {
12846 PlayerBase nplayer;
12847 if (PlayerBase.CastTo(nplayer,player))
12848 {
12849
12850 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12851
12852 }
12853
12854
12855 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12856
12857
12858 if (HasEnergyManager())
12859 {
12860 GetCompEM().UpdatePlugState();
12861 }
12862 }
12863
12864
12866 {
12867 super.OnPlacementStarted(player);
12868
12870 }
12871
12872 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12873 {
12875 {
12876 m_AdminLog.OnPlacementComplete(player,
this);
12877 }
12878
12879 super.OnPlacementComplete(player, position, orientation);
12880 }
12881
12882
12883
12884
12885
12887 {
12889 {
12890 return true;
12891 }
12892 else
12893 {
12894 return false;
12895 }
12896 }
12897
12898
12900 {
12902 {
12904 }
12905 }
12906
12907
12909 {
12911 }
12912
12914 {
12916 }
12917
12918 override void InsertAgent(
int agent,
float count = 1)
12919 {
12920 if (count < 1)
12921 return;
12922
12924 }
12925
12928 {
12930 }
12931
12932
12934 {
12936 }
12937
12938
12939
12940
12941
12942
12943
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
12980 {
12982 return false;
12983 return true;
12984 }
12985
12987 {
12988
12990 }
12991
12992
12995 {
12996 super.CheckForRoofLimited(timeTresholdMS);
12997
12999 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13000 {
13001 m_PreviousRoofTestTime = time;
13002 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13003 }
13004 }
13005
13006
13008 {
13010 {
13011 return 0;
13012 }
13013
13014 if (GetInventory().GetAttachmentSlotsCount() != 0)
13015 {
13016 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13017 if (filter)
13018 return filter.GetProtectionLevel(type, false, system);
13019 else
13020 return 0;
13021 }
13022
13023 string subclassPath, entryName;
13024
13025 switch (type)
13026 {
13028 entryName = "biological";
13029 break;
13031 entryName = "chemical";
13032 break;
13033 default:
13034 entryName = "biological";
13035 break;
13036 }
13037
13038 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13039
13041 }
13042
13043
13044
13047 {
13048 if (!IsMagazine())
13050
13052 }
13053
13054
13055
13056
13057
13062 {
13063 return true;
13064 }
13065
13067 {
13069 }
13070
13071
13072
13073
13074
13076 {
13077 if (parent)
13078 {
13079 if (parent.IsInherited(DayZInfected))
13080 return true;
13081
13082 if (!parent.IsRuined())
13083 return true;
13084 }
13085
13086 return true;
13087 }
13088
13090 {
13091 if (!super.CanPutAsAttachment(parent))
13092 {
13093 return false;
13094 }
13095
13096 if (!IsRuined() && !parent.IsRuined())
13097 {
13098 return true;
13099 }
13100
13101 return false;
13102 }
13103
13105 {
13106
13107
13108
13109
13110 return super.CanReceiveItemIntoCargo(item);
13111 }
13112
13114 {
13115
13116
13117
13118
13119 GameInventory attachmentInv = attachment.GetInventory();
13121 {
13122 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13123 return false;
13124 }
13125
13126 InventoryLocation loc = new InventoryLocation();
13127 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13128 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13129 return false;
13130
13131 return super.CanReceiveAttachment(attachment, slotId);
13132 }
13133
13135 {
13136 if (!super.CanReleaseAttachment(attachment))
13137 return false;
13138
13139 return GetInventory().AreChildrenAccessible();
13140 }
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13163 {
13164 int id = muzzle_owner.GetMuzzleID();
13165 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13166
13167 if (WPOF_array)
13168 {
13169 for (int i = 0; i < WPOF_array.Count(); i++)
13170 {
13171 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13172
13173 if (WPOF)
13174 {
13175 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13176 }
13177 }
13178 }
13179 }
13180
13181
13183 {
13184 int id = muzzle_owner.GetMuzzleID();
13186
13187 if (WPOBE_array)
13188 {
13189 for (int i = 0; i < WPOBE_array.Count(); i++)
13190 {
13191 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13192
13193 if (WPOBE)
13194 {
13195 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13196 }
13197 }
13198 }
13199 }
13200
13201
13203 {
13204 int id = muzzle_owner.GetMuzzleID();
13205 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13206
13207 if (WPOOH_array)
13208 {
13209 for (int i = 0; i < WPOOH_array.Count(); i++)
13210 {
13211 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13212
13213 if (WPOOH)
13214 {
13215 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13216 }
13217 }
13218 }
13219 }
13220
13221
13223 {
13224 int id = muzzle_owner.GetMuzzleID();
13225 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13226
13227 if (WPOOH_array)
13228 {
13229 for (int i = 0; i < WPOOH_array.Count(); i++)
13230 {
13231 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13232
13233 if (WPOOH)
13234 {
13235 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13236 }
13237 }
13238 }
13239 }
13240
13241
13243 {
13244 int id = muzzle_owner.GetMuzzleID();
13245 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13246
13247 if (WPOOH_array)
13248 {
13249 for (int i = 0; i < WPOOH_array.Count(); i++)
13250 {
13251 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13252
13253 if (WPOOH)
13254 {
13255 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13256 }
13257 }
13258 }
13259 }
13260
13261
13262
13264 {
13266 {
13267 return true;
13268 }
13269
13270 return false;
13271 }
13272
13274 {
13276 {
13277 return true;
13278 }
13279
13280 return false;
13281 }
13282
13284 {
13286 {
13287 return true;
13288 }
13289
13290 return false;
13291 }
13292
13294 {
13295 return false;
13296 }
13297
13300 {
13301 return UATimeSpent.DEFAULT_DEPLOY;
13302 }
13303
13304
13305
13306
13308 {
13310 SetSynchDirty();
13311 }
13312
13314 {
13316 }
13317
13318
13320 {
13321 return false;
13322 }
13323
13326 {
13327 string att_type = "None";
13328
13329 if (ConfigIsExisting("soundAttType"))
13330 {
13331 att_type = ConfigGetString("soundAttType");
13332 }
13333
13335 }
13336
13338 {
13340 }
13341
13342
13343
13344
13345
13349
13351 {
13354
13356 }
13357
13358
13360 {
13362 return;
13363
13365
13368
13371
13372 SoundParameters params = new SoundParameters();
13376 }
13377
13378
13380 {
13382 return;
13383
13385 SetSynchDirty();
13386
13389 }
13390
13391
13393 {
13395 return;
13396
13398 SetSynchDirty();
13399
13402 }
13403
13405 {
13407 }
13408
13410 {
13412 }
13413
13416 {
13417 if (!
GetGame().IsDedicatedServer())
13418 {
13419 if (ConfigIsExisting("attachSoundSet"))
13420 {
13421 string cfg_path = "";
13422 string soundset = "";
13423 string type_name =
GetType();
13424
13427 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13428 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13429
13430 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13431 {
13432 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13433 {
13434 if (cfg_slot_array[i] == slot_type)
13435 {
13436 soundset = cfg_soundset_array[i];
13437 break;
13438 }
13439 }
13440 }
13441
13442 if (soundset != "")
13443 {
13444 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13446 }
13447 }
13448 }
13449 }
13450
13452 {
13453
13454 }
13455
13456 void OnApply(PlayerBase player);
13457
13459 {
13460 return 1.0;
13461 };
13462
13464 {
13466 }
13467
13469 {
13471 }
13472
13474
13476 {
13477 SetDynamicPhysicsLifeTime(0.01);
13479 }
13480
13482 {
13483 array<string> zone_names = new array<string>;
13484 GetDamageZones(zone_names);
13485 for (int i = 0; i < zone_names.Count(); i++)
13486 {
13487 SetHealthMax(zone_names.Get(i),"Health");
13488 }
13489 SetHealthMax("","Health");
13490 }
13491
13494 {
13495 float global_health = GetHealth01("","Health");
13496 array<string> zones = new array<string>;
13497 GetDamageZones(zones);
13498
13499 for (int i = 0; i < zones.Count(); i++)
13500 {
13501 SetHealth01(zones.Get(i),"Health",global_health);
13502 }
13503 }
13504
13507 {
13508 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13509 }
13510
13512 {
13513 if (!hasRootAsPlayer)
13514 {
13515 if (refParentIB)
13516 {
13517
13518 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13519 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13520
13521 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13522 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13523
13526 }
13527 else
13528 {
13529
13532 }
13533 }
13534 }
13535
13537 {
13539 {
13540 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13541 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13542 {
13543 float heatPermCoef = 1.0;
13545 while (ent)
13546 {
13547 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13548 ent = ent.GetHierarchyParent();
13549 }
13550
13551 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13552 }
13553 }
13554 }
13555
13557 {
13558
13559 EntityAI parent = GetHierarchyParent();
13560 if (!parent)
13561 {
13562 hasParent = false;
13563 hasRootAsPlayer = false;
13564 }
13565 else
13566 {
13567 hasParent = true;
13568 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13569 refParentIB =
ItemBase.Cast(parent);
13570 }
13571 }
13572
13573 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13574 {
13575
13576 }
13577
13579 {
13580
13581 return false;
13582 }
13583
13585 {
13586
13587
13588 return false;
13589 }
13590
13592 {
13593
13594 return false;
13595 }
13596
13599 {
13600 return !GetIsFrozen() &&
IsOpen();
13601 }
13602
13604 {
13605 bool hasParent = false, hasRootAsPlayer = false;
13607
13608 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13609 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13610
13611 if (wwtu || foodDecay)
13612 {
13616
13617 if (processWetness || processTemperature || processDecay)
13618 {
13620
13621 if (processWetness)
13622 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13623
13624 if (processTemperature)
13626
13627 if (processDecay)
13628 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13629 }
13630 }
13631 }
13632
13635 {
13637 }
13638
13640 {
13643
13644 return super.GetTemperatureFreezeThreshold();
13645 }
13646
13648 {
13651
13652 return super.GetTemperatureThawThreshold();
13653 }
13654
13656 {
13659
13660 return super.GetItemOverheatThreshold();
13661 }
13662
13664 {
13666 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13667
13668 return super.GetTemperatureFreezeTime();
13669 }
13670
13672 {
13674 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13675
13676 return super.GetTemperatureThawTime();
13677 }
13678
13683
13685 {
13686 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13687 }
13688
13690 {
13691 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13692 }
13693
13696 {
13698 }
13699
13701 {
13703 }
13704
13706 {
13708 }
13709
13712 {
13713 return null;
13714 }
13715
13718 {
13719 return false;
13720 }
13721
13723 {
13725 {
13728 if (!trg)
13729 {
13731 explosive = this;
13732 }
13733
13734 explosive.PairRemote(trg);
13736
13737 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13738 trg.SetPersistentPairID(persistentID);
13739 explosive.SetPersistentPairID(persistentID);
13740
13741 return true;
13742 }
13743 return false;
13744 }
13745
13748 {
13749 float ret = 1.0;
13752 ret *= GetHealth01();
13753
13754 return ret;
13755 }
13756
13757 #ifdef DEVELOPER
13758 override void SetDebugItem()
13759 {
13760 super.SetDebugItem();
13761 _itemBase = this;
13762 }
13763
13765 {
13766 string text = super.GetDebugText();
13767
13769 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13770
13771 return text;
13772 }
13773 #endif
13774
13776 {
13777 return true;
13778 }
13779
13781
13783
13785 {
13788 }
13789
13790
13798
13814}
13815
13817{
13819 if (entity)
13820 {
13821 bool is_item = entity.IsInherited(
ItemBase);
13822 if (is_item && full_quantity)
13823 {
13826 }
13827 }
13828 else
13829 {
13831 return NULL;
13832 }
13833 return entity;
13834}
13835
13837{
13838 if (item)
13839 {
13840 if (health > 0)
13841 item.SetHealth("", "", health);
13842
13843 if (item.CanHaveTemperature())
13844 {
13846 if (item.CanFreeze())
13847 item.SetFrozen(false);
13848 }
13849
13850 if (item.HasEnergyManager())
13851 {
13852 if (quantity >= 0)
13853 {
13854 item.GetCompEM().SetEnergy0To1(quantity);
13855 }
13856 else
13857 {
13859 }
13860 }
13861 else if (item.IsMagazine())
13862 {
13863 Magazine mag = Magazine.Cast(item);
13864 if (quantity >= 0)
13865 {
13866 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13867 }
13868 else
13869 {
13871 }
13872
13873 }
13874 else
13875 {
13876 if (quantity >= 0)
13877 {
13878 item.SetQuantityNormalized(quantity, false);
13879 }
13880 else
13881 {
13883 }
13884
13885 }
13886 }
13887}
13888
13889#ifdef DEVELOPER
13891#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.