Attachment Sound Type getting from config file.
9064{
9066 {
9067 return true;
9068 }
9069};
9070
9071
9072
9074{
9078
9080
9083
9084
9085
9086
9087
9096
9102
9107
9112
9133 protected bool m_IsResultOfSplit
9134
9136
9141
9142
9143
9145
9149
9150
9151
9153
9156
9157
9158
9164
9165
9173
9176
9177
9179
9180
9182
9183
9188
9189
9194
9195
9197
9198
9200 {
9205
9206 if (!
GetGame().IsDedicatedServer())
9207 {
9209 {
9211
9213 {
9215 }
9216 }
9217
9220 }
9221
9222 m_OldLocation = null;
9223
9225 {
9227 }
9228
9229 if (ConfigIsExisting("headSelectionsToHide"))
9230 {
9233 }
9234
9236 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9237 {
9239 }
9240
9242
9243 m_IsResultOfSplit = false;
9244
9246 }
9247
9249 {
9250 super.InitItemVariables();
9251
9257 m_Count = ConfigGetInt(
"count");
9258
9261
9266
9269
9274
9286
9290
9291
9294 if (ConfigIsExisting("canBeSplit"))
9295 {
9298 }
9299
9301 if (ConfigIsExisting("itemBehaviour"))
9303
9304
9307 RegisterNetSyncVariableInt("m_VarLiquidType");
9308 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9309
9310 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9311 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9312 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9313
9314 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9315 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9316 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9317 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9318
9319 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9320 RegisterNetSyncVariableBool("m_IsTakeable");
9321 RegisterNetSyncVariableBool("m_IsHologram");
9322
9325 {
9328 }
9329
9331
9333 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9335
9336 }
9337
9339 {
9341 }
9342
9344 {
9347 {
9352 }
9353 }
9354
9355 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9356 {
9358 {
9361 }
9362
9364 }
9365
9367 {
9373 }
9374
9376
9378 {
9380
9381 if (!action)
9382 {
9383 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9384 return;
9385 }
9386
9388 if (!ai)
9389 {
9391 return;
9392 }
9393
9395 if (!action_array)
9396 {
9397 action_array = new array<ActionBase_Basic>;
9399 }
9400 if (LogManager.IsActionLogEnable())
9401 {
9402 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9403 }
9404
9405 if (action_array.Find(action) != -1)
9406 {
9407 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9408 }
9409 else
9410 {
9411 action_array.Insert(action);
9412 }
9413 }
9414
9416 {
9418 ActionBase action = player.GetActionManager().GetAction(actionName);
9421
9422 if (action_array)
9423 {
9424 action_array.RemoveItem(action);
9425 }
9426 }
9427
9428
9429
9431 {
9432 ActionOverrideData overrideData = new ActionOverrideData();
9436
9438 if (!actionMap)
9439 {
9442 }
9443
9444 actionMap.Insert(this.
Type(), overrideData);
9445
9446 }
9447
9449
9451
9452
9454 {
9457
9460
9461 string config_to_search = "CfgVehicles";
9462 string muzzle_owner_config;
9463
9465 {
9466 if (IsInherited(Weapon))
9467 config_to_search = "CfgWeapons";
9468
9469 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9470
9471 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9472
9474
9475 if (config_OnFire_subclass_count > 0)
9476 {
9477 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9478
9479 for (int i = 0; i < config_OnFire_subclass_count; i++)
9480 {
9481 string particle_class = "";
9483 string config_OnFire_entry = config_OnFire_class + particle_class;
9484 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9485 WPOF_array.Insert(WPOF);
9486 }
9487
9488
9490 }
9491 }
9492
9494 {
9495 config_to_search = "CfgWeapons";
9496 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9497
9498 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9499
9501
9502 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9503 {
9504 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9505
9506 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9507 {
9508 string particle_class2 = "";
9510 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9511 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9512 WPOBE_array.Insert(WPOBE);
9513 }
9514
9515
9517 }
9518 }
9519 }
9520
9521
9523 {
9526
9528 {
9529 string config_to_search = "CfgVehicles";
9530
9531 if (IsInherited(Weapon))
9532 config_to_search = "CfgWeapons";
9533
9534 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9535 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9536
9537 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9538 {
9539
9541
9543 {
9545 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9547 return;
9548 }
9549
9552
9553
9554
9556 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9557
9558 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9559 {
9560 string particle_class = "";
9562 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9564
9565 if (entry_type == CT_CLASS)
9566 {
9567 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9568 WPOOH_array.Insert(WPOF);
9569 }
9570 }
9571
9572
9574 }
9575 }
9576 }
9577
9579 {
9581 }
9582
9584 {
9586 {
9588
9591
9594
9595 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9596 }
9597 }
9598
9600 {
9602 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9603
9605 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9606
9608 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9609
9611 {
9613 }
9614 }
9615
9617 {
9619 }
9620
9622 {
9625 else
9627
9629 {
9632 }
9633 else
9634 {
9637
9640 }
9641
9643 }
9644
9646 {
9648 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9649 }
9650
9652 {
9654 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9656 }
9657
9659 {
9661 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9662 }
9663
9665 {
9668
9669 OverheatingParticle OP = new OverheatingParticle();
9674
9676 }
9677
9679 {
9682
9683 return -1;
9684 }
9685
9687 {
9689 {
9692
9693 for (int i = count; i > 0; --i)
9694 {
9695 int id = i - 1;
9698
9701
9702 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9703 {
9704 if (p)
9705 {
9708 }
9709 }
9710 }
9711 }
9712 }
9713
9715 {
9717 {
9719 {
9720 int id = i - 1;
9722
9723 if (OP)
9724 {
9726
9727 if (p)
9728 {
9730 }
9731
9732 delete OP;
9733 }
9734 }
9735
9738 }
9739 }
9740
9743 {
9744 return 0.0;
9745 }
9746
9747
9749 {
9750 return 250;
9751 }
9752
9754 {
9755 return 0;
9756 }
9757
9760 {
9762 return true;
9763
9764 return false;
9765 }
9766
9769 {
9772
9774 {
9776 }
9777 else
9778 {
9779
9781 }
9782
9784 }
9785
9792 {
9793 return -1;
9794 }
9795
9796
9797
9798
9800 {
9802 {
9804 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9805
9806 if (r_index >= 0)
9807 {
9808 InventoryLocation r_il = new InventoryLocation;
9809 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9810
9811 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9814 {
9815 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9816 }
9818 {
9819 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9820 }
9821
9822 }
9823
9824 player.GetHumanInventory().ClearUserReservedLocation(this);
9825 }
9826
9829 }
9830
9831
9832
9833
9835 {
9836 return ItemBase.m_DebugActionsMask;
9837 }
9838
9840 {
9841 return ItemBase.m_DebugActionsMask & mask;
9842 }
9843
9845 {
9846 ItemBase.m_DebugActionsMask = mask;
9847 }
9848
9850 {
9851 ItemBase.m_DebugActionsMask |= mask;
9852 }
9853
9855 {
9856 ItemBase.m_DebugActionsMask &= ~mask;
9857 }
9858
9860 {
9862 {
9864 }
9865 else
9866 {
9868 }
9869 }
9870
9871
9873 {
9874 if (GetEconomyProfile())
9875 {
9876 float q_max = GetEconomyProfile().GetQuantityMax();
9877 if (q_max > 0)
9878 {
9879 float q_min = GetEconomyProfile().GetQuantityMin();
9880 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9881
9883 {
9884 ComponentEnergyManager comp = GetCompEM();
9886 {
9888 }
9889 }
9891 {
9893
9894 }
9895
9896 }
9897 }
9898 }
9899
9902 {
9903 EntityAI parent = GetHierarchyParent();
9904
9905 if (parent)
9906 {
9907 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9908 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9909 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9910 }
9911 }
9912
9915 {
9916 EntityAI parent = GetHierarchyParent();
9917
9918 if (parent)
9919 {
9920 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9921 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9922 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9923 }
9924 }
9925
9927 {
9928
9929
9930
9931
9933
9935 {
9936 if (ScriptInputUserData.CanStoreInputUserData())
9937 {
9938 ScriptInputUserData ctx = new ScriptInputUserData;
9944 ctx.
Write(use_stack_max);
9947
9949 {
9950 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9951 }
9952 }
9953 }
9954 else if (!
GetGame().IsMultiplayer())
9955 {
9957 }
9958 }
9959
9961 {
9963 }
9964
9966 {
9968 }
9969
9971 {
9973 }
9974
9976 {
9977
9978 return false;
9979 }
9980
9982 {
9983 return false;
9984 }
9985
9989 {
9990 return false;
9991 }
9992
9994 {
9995 return "";
9996 }
9997
9999
10001 {
10002 return false;
10003 }
10004
10006 {
10007 return true;
10008 }
10009
10010
10011
10013 {
10014 return true;
10015 }
10016
10018 {
10019 return true;
10020 }
10021
10023 {
10024 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10026 }
10027
10029 {
10031 }
10032
10034 {
10036 if (!is_being_placed)
10038 SetSynchDirty();
10039 }
10040
10041
10043
10045 {
10047 }
10048
10050 {
10052 }
10053
10055 {
10056 return 1;
10057 }
10058
10060 {
10061 return false;
10062 }
10063
10065 {
10067 SetSynchDirty();
10068 }
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10105 {
10106 super.OnMovedInsideCargo(container);
10107
10108 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10109 }
10110
10111 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10112 {
10113 super.EEItemLocationChanged(oldLoc,newLoc);
10114
10115 PlayerBase new_player = null;
10116 PlayerBase old_player = null;
10117
10118 if (newLoc.GetParent())
10119 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10120
10121 if (oldLoc.GetParent())
10122 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10123
10125 {
10126 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10127
10128 if (r_index >= 0)
10129 {
10130 InventoryLocation r_il = new InventoryLocation;
10131 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10132
10133 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10136 {
10137 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10138 }
10140 {
10141 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10142 }
10143
10144 }
10145 }
10146
10148 {
10149 if (new_player)
10150 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10151
10152 if (new_player == old_player)
10153 {
10154
10155 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10156 {
10158 {
10159 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10160 {
10161 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10162 }
10163 }
10164 else
10165 {
10166 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10167 }
10168 }
10169
10170 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10171 {
10172 int type = oldLoc.GetType();
10174 {
10175 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10176 }
10178 {
10179 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10180 }
10181 }
10182 if (!m_OldLocation)
10183 {
10184 m_OldLocation = new InventoryLocation;
10185 }
10186 m_OldLocation.Copy(oldLoc);
10187 }
10188 else
10189 {
10190 if (m_OldLocation)
10191 {
10192 m_OldLocation.Reset();
10193 }
10194 }
10195
10197 }
10198 else
10199 {
10200 if (new_player)
10201 {
10202 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10203 if (res_index >= 0)
10204 {
10205 InventoryLocation il = new InventoryLocation;
10206 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10208 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10211 {
10212 il.
GetParent().GetOnReleaseLock().Invoke(it);
10213 }
10215 {
10217 }
10218
10219 }
10220 }
10222 {
10223
10225 }
10226
10227 if (m_OldLocation)
10228 {
10229 m_OldLocation.Reset();
10230 }
10231 }
10232 }
10233
10234 override void EOnContact(IEntity other, Contact extra)
10235 {
10237 {
10238 int liquidType = -1;
10240 if (impactSpeed > 0.0)
10241 {
10243 #ifndef SERVER
10245 #else
10247 SetSynchDirty();
10248 #endif
10250 }
10251 }
10252
10253 #ifdef SERVER
10254 if (GetCompEM() && GetCompEM().IsPlugged())
10255 {
10256 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10257 GetCompEM().UnplugThis();
10258 }
10259 #endif
10260 }
10261
10263
10265 {
10267 }
10268
10270 {
10271
10272 }
10273
10275 {
10276 super.OnItemLocationChanged(old_owner, new_owner);
10277
10278 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10279 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10280
10281 if (!relatedPlayer && playerNew)
10282 relatedPlayer = playerNew;
10283
10284 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10285 {
10287 if (actionMgr)
10288 {
10289 ActionBase currentAction = actionMgr.GetRunningAction();
10290 if (currentAction)
10292 }
10293 }
10294
10295 Man ownerPlayerOld = null;
10296 Man ownerPlayerNew = null;
10297
10298 if (old_owner)
10299 {
10300 if (old_owner.
IsMan())
10301 {
10302 ownerPlayerOld = Man.Cast(old_owner);
10303 }
10304 else
10305 {
10306 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10307 }
10308 }
10309 else
10310 {
10312 {
10314
10315 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10316 {
10317 GetCompEM().UnplugThis();
10318 }
10319 }
10320 }
10321
10322 if (new_owner)
10323 {
10324 if (new_owner.
IsMan())
10325 {
10326 ownerPlayerNew = Man.Cast(new_owner);
10327 }
10328 else
10329 {
10330 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10331 }
10332 }
10333
10334 if (ownerPlayerOld != ownerPlayerNew)
10335 {
10336 if (ownerPlayerOld)
10337 {
10338 array<EntityAI> subItemsExit = new array<EntityAI>;
10340 for (int i = 0; i < subItemsExit.Count(); i++)
10341 {
10344 }
10345 }
10346
10347 if (ownerPlayerNew)
10348 {
10349 array<EntityAI> subItemsEnter = new array<EntityAI>;
10351 for (int j = 0; j < subItemsEnter.Count(); j++)
10352 {
10355 }
10356 }
10357 }
10358 else if (ownerPlayerNew != null)
10359 {
10360 PlayerBase nplayer;
10361 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10362 {
10363 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10365 for (int k = 0; k < subItemsUpdate.Count(); k++)
10366 {
10368 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10369 }
10370 }
10371 }
10372
10373 if (old_owner)
10374 old_owner.OnChildItemRemoved(this);
10375 if (new_owner)
10376 new_owner.OnChildItemReceived(this);
10377 }
10378
10379
10381 {
10382 super.EEDelete(parent);
10383 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10384 if (player)
10385 {
10387
10388 if (player.IsAlive())
10389 {
10390 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10391 if (r_index >= 0)
10392 {
10393 InventoryLocation r_il = new InventoryLocation;
10394 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10395
10396 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10399 {
10400 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10401 }
10403 {
10404 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10405 }
10406
10407 }
10408
10409 player.RemoveQuickBarEntityShortcut(this);
10410 }
10411 }
10412 }
10413
10415 {
10416 super.EEKilled(killer);
10417
10420 {
10421 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10422 {
10423 if (IsMagazine())
10424 {
10425 if (Magazine.Cast(this).GetAmmoCount() > 0)
10426 {
10428 }
10429 }
10430 else
10431 {
10433 }
10434 }
10435 }
10436 }
10437
10439 {
10440 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10441
10442 super.OnWasAttached(parent, slot_id);
10443
10446
10448 }
10449
10451 {
10452 super.OnWasDetached(parent, slot_id);
10453
10456 }
10457
10459 {
10460 int idx;
10463
10464 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10465 if (inventory_slots.Count() < 1)
10466 {
10467 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10468 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10469 }
10470 else
10471 {
10472 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10473 }
10474
10475 idx = inventory_slots.Find(slot);
10476 if (idx < 0)
10477 return "";
10478
10479 return attach_types.Get(idx);
10480 }
10481
10483 {
10484 int idx = -1;
10485 string slot;
10486
10489
10490 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10491 if (inventory_slots.Count() < 1)
10492 {
10493 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10494 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10495 }
10496 else
10497 {
10498 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10499 if (detach_types.Count() < 1)
10500 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10501 }
10502
10503 for (int i = 0; i < inventory_slots.Count(); i++)
10504 {
10505 slot = inventory_slots.Get(i);
10506 }
10507
10508 if (slot != "")
10509 {
10510 if (detach_types.Count() == 1)
10511 idx = 0;
10512 else
10513 idx = inventory_slots.Find(slot);
10514 }
10515 if (idx < 0)
10516 return "";
10517
10518 return detach_types.Get(idx);
10519 }
10520
10522 {
10523
10525
10526
10527 float min_time = 1;
10528 float max_time = 3;
10529 float delay = Math.RandomFloat(min_time, max_time);
10530
10531 explode_timer.Run(delay, this, "DoAmmoExplosion");
10532 }
10533
10535 {
10536 Magazine magazine = Magazine.Cast(this);
10537 int pop_sounds_count = 6;
10538 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10539
10540
10541 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10542 string sound_name = pop_sounds[ sound_idx ];
10544
10545
10546 magazine.ServerAddAmmoCount(-1);
10547
10548
10549 float min_temp_to_explode = 100;
10550
10551 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10552 {
10554 }
10555 }
10556
10557
10558 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10559 {
10560 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10561
10562 const int CHANCE_DAMAGE_CARGO = 4;
10563 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10564 const int CHANCE_DAMAGE_NOTHING = 2;
10565
10567 {
10568 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10569 int chances;
10570 int rnd;
10571
10572 if (GetInventory().GetCargo())
10573 {
10574 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10575 rnd = Math.RandomInt(0,chances);
10576
10577 if (rnd < CHANCE_DAMAGE_CARGO)
10578 {
10580 }
10581 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10582 {
10584 }
10585 }
10586 else
10587 {
10588 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10589 rnd = Math.RandomInt(0,chances);
10590
10591 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10592 {
10594 }
10595 }
10596 }
10597 }
10598
10600 {
10601 if (GetInventory().GetCargo())
10602 {
10603 int item_count = GetInventory().GetCargo().GetItemCount();
10604 if (item_count > 0)
10605 {
10606 int random_pick = Math.RandomInt(0, item_count);
10608 if (!item.IsExplosive())
10609 {
10610 item.AddHealth("","",damage);
10611 return true;
10612 }
10613 }
10614 }
10615 return false;
10616 }
10617
10619 {
10620 int attachment_count = GetInventory().AttachmentCount();
10621 if (attachment_count > 0)
10622 {
10623 int random_pick = Math.RandomInt(0, attachment_count);
10624 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10625 if (!attachment.IsExplosive())
10626 {
10627 attachment.AddHealth("","",damage);
10628 return true;
10629 }
10630 }
10631 return false;
10632 }
10633
10635 {
10637 }
10638
10640 {
10642 return GetInventory().CanRemoveEntity();
10643
10644 return false;
10645 }
10646
10648 {
10650 return;
10651
10653 {
10654 if (ScriptInputUserData.CanStoreInputUserData())
10655 {
10656 ScriptInputUserData ctx = new ScriptInputUserData;
10661 ctx.
Write(destination_entity);
10663 ctx.
Write(slot_id);
10665 }
10666 }
10667 else if (!
GetGame().IsMultiplayer())
10668 {
10670 }
10671 }
10672
10674 {
10676 return;
10677
10678 float split_quantity_new;
10682 InventoryLocation loc = new InventoryLocation;
10683
10684 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10685 {
10687 split_quantity_new = stack_max;
10688 else
10690
10691 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10692 if (new_item)
10693 {
10694 new_item.SetResultOfSplit(true);
10695 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10697 new_item.SetQuantity(split_quantity_new);
10698 }
10699 }
10700 else if (destination_entity && slot_id == -1)
10701 {
10702 if (quantity > stack_max)
10703 split_quantity_new = stack_max;
10704 else
10705 split_quantity_new = quantity;
10706
10708 {
10711 }
10712
10713 if (new_item)
10714 {
10715 new_item.SetResultOfSplit(true);
10716 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10718 new_item.SetQuantity(split_quantity_new);
10719 }
10720 }
10721 else
10722 {
10723 if (stack_max != 0)
10724 {
10726 {
10728 }
10729
10730 if (split_quantity_new == 0)
10731 {
10732 if (!
GetGame().IsMultiplayer())
10733 player.PhysicalPredictiveDropItem(this);
10734 else
10735 player.ServerDropEntity(this);
10736 return;
10737 }
10738
10740
10741 if (new_item)
10742 {
10743 new_item.SetResultOfSplit(true);
10744 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10746 new_item.SetQuantity(stack_max);
10747 new_item.PlaceOnSurface();
10748 }
10749 }
10750 }
10751 }
10752
10754 {
10756 return;
10757
10758 float split_quantity_new;
10762 InventoryLocation loc = new InventoryLocation;
10763
10764 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10765 {
10767 split_quantity_new = stack_max;
10768 else
10770
10771 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10772 if (new_item)
10773 {
10774 new_item.SetResultOfSplit(true);
10775 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10777 new_item.SetQuantity(split_quantity_new);
10778 }
10779 }
10780 else if (destination_entity && slot_id == -1)
10781 {
10782 if (quantity > stack_max)
10783 split_quantity_new = stack_max;
10784 else
10785 split_quantity_new = quantity;
10786
10788 {
10791 }
10792
10793 if (new_item)
10794 {
10795 new_item.SetResultOfSplit(true);
10796 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10798 new_item.SetQuantity(split_quantity_new);
10799 }
10800 }
10801 else
10802 {
10803 if (stack_max != 0)
10804 {
10806 {
10808 }
10809
10811
10812 if (new_item)
10813 {
10814 new_item.SetResultOfSplit(true);
10815 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10817 new_item.SetQuantity(stack_max);
10818 new_item.PlaceOnSurface();
10819 }
10820 }
10821 }
10822 }
10823
10825 {
10827 return;
10828
10830 {
10831 if (ScriptInputUserData.CanStoreInputUserData())
10832 {
10833 ScriptInputUserData ctx = new ScriptInputUserData;
10838 dst.WriteToContext(ctx);
10840 }
10841 }
10842 else if (!
GetGame().IsMultiplayer())
10843 {
10845 }
10846 }
10847
10849 {
10851 return;
10852
10854 {
10855 if (ScriptInputUserData.CanStoreInputUserData())
10856 {
10857 ScriptInputUserData ctx = new ScriptInputUserData;
10862 ctx.
Write(destination_entity);
10868 }
10869 }
10870 else if (!
GetGame().IsMultiplayer())
10871 {
10873 }
10874 }
10875
10877 {
10879 }
10880
10882 {
10884 return this;
10885
10887 float split_quantity_new;
10889 if (dst.IsValid())
10890 {
10891 int slot_id = dst.GetSlot();
10893
10894 if (quantity > stack_max)
10895 split_quantity_new = stack_max;
10896 else
10897 split_quantity_new = quantity;
10898
10900
10901 if (new_item)
10902 {
10903 new_item.SetResultOfSplit(true);
10904 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10907 }
10908
10909 return new_item;
10910 }
10911
10912 return null;
10913 }
10914
10916 {
10918 return;
10919
10921 float split_quantity_new;
10923 if (destination_entity)
10924 {
10926 if (quantity > stackable)
10927 split_quantity_new = stackable;
10928 else
10929 split_quantity_new = quantity;
10930
10931 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10932 if (new_item)
10933 {
10934 new_item.SetResultOfSplit(true);
10935 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10937 new_item.SetQuantity(split_quantity_new);
10938 }
10939 }
10940 }
10941
10943 {
10945 return;
10946
10948 {
10949 if (ScriptInputUserData.CanStoreInputUserData())
10950 {
10951 ScriptInputUserData ctx = new ScriptInputUserData;
10956 ItemBase destination_entity =
this;
10957 ctx.
Write(destination_entity);
10961 }
10962 }
10963 else if (!
GetGame().IsMultiplayer())
10964 {
10966 }
10967 }
10968
10970 {
10972 return;
10973
10975 float split_quantity_new;
10977 if (player)
10978 {
10980 if (quantity > stackable)
10981 split_quantity_new = stackable;
10982 else
10983 split_quantity_new = quantity;
10984
10985 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10986 new_item =
ItemBase.Cast(in_hands);
10987 if (new_item)
10988 {
10989 new_item.SetResultOfSplit(true);
10990 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10992 new_item.SetQuantity(split_quantity_new);
10993 }
10994 }
10995 }
10996
10998 {
11000 return;
11001
11003 float split_quantity_new = Math.Floor(quantity * 0.5);
11004
11006
11007 if (new_item)
11008 {
11009 if (new_item.GetQuantityMax() < split_quantity_new)
11010 {
11011 split_quantity_new = new_item.GetQuantityMax();
11012 }
11013
11014 new_item.SetResultOfSplit(true);
11015 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11016
11018 {
11021 }
11022 else
11023 {
11026 }
11027 }
11028 }
11029
11031 {
11033 return;
11034
11036 float split_quantity_new = Math.Floor(quantity / 2);
11037
11038 InventoryLocation invloc = new InventoryLocation;
11040
11042 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11043
11044 if (new_item)
11045 {
11046 if (new_item.GetQuantityMax() < split_quantity_new)
11047 {
11048 split_quantity_new = new_item.GetQuantityMax();
11049 }
11051 {
11054 }
11055 else
11056 {
11059 }
11060 }
11061 }
11062
11065 {
11066 SetWeightDirty();
11068
11069 if (parent)
11070 parent.OnAttachmentQuantityChangedEx(this, delta);
11071
11073 {
11075 {
11077 }
11079 {
11080 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11082 }
11083 }
11084
11085 }
11086
11089 {
11090
11091 }
11092
11095 {
11097 }
11098
11100 {
11101 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11102
11104 {
11105 if (newLevel == GameConstants.STATE_RUINED)
11106 {
11108 EntityAI parent = GetHierarchyParent();
11109 if (parent && parent.IsFireplace())
11110 {
11111 CargoBase cargo = GetInventory().GetCargo();
11112 if (cargo)
11113 {
11115 {
11117 }
11118 }
11119 }
11120 }
11121
11123 {
11124
11126 return;
11127 }
11128
11129 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11130 {
11132 }
11133 }
11134 }
11135
11136
11138 {
11139 super.OnRightClick();
11140
11142 {
11144 {
11145 if (ScriptInputUserData.CanStoreInputUserData())
11146 {
11147 vector m4[4];
11149
11150 EntityAI root = GetHierarchyRoot();
11151
11152 InventoryLocation dst = new InventoryLocation;
11154 {
11155 if (root)
11156 {
11157 root.GetTransform(m4);
11159 }
11160 else
11161 GetInventory().GetCurrentInventoryLocation(dst);
11162 }
11163 else
11164 {
11166
11167
11168 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11169 {
11170 if (root)
11171 {
11172 root.GetTransform(m4);
11174 }
11175 else
11176 GetInventory().GetCurrentInventoryLocation(dst);
11177 }
11178 else
11179 {
11180 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11181 }
11182 }
11183
11184 ScriptInputUserData ctx = new ScriptInputUserData;
11192 }
11193 }
11194 else if (!
GetGame().IsMultiplayer())
11195 {
11197 }
11198 }
11199 }
11200
11201 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11202 {
11203
11204 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11205 return false;
11206
11207 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11208 return false;
11209
11210
11212 return false;
11213
11214
11215 Magazine mag = Magazine.Cast(this);
11216 if (mag)
11217 {
11218 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11219 return false;
11220
11221 if (stack_max_limit)
11222 {
11223 Magazine other_mag = Magazine.Cast(other_item);
11224 if (other_item)
11225 {
11226 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11227 return false;
11228 }
11229
11230 }
11231 }
11232 else
11233 {
11234
11236 return false;
11237
11239 return false;
11240 }
11241
11242 PlayerBase player = null;
11243 if (CastTo(player, GetHierarchyRootPlayer()))
11244 {
11245 if (player.GetInventory().HasAttachment(this))
11246 return false;
11247
11248 if (player.IsItemsToDelete())
11249 return false;
11250 }
11251
11252 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11253 return false;
11254
11255 int slotID;
11257 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11258 return false;
11259
11260 return true;
11261 }
11262
11264 {
11266 }
11267
11269 {
11270 return m_IsResultOfSplit;
11271 }
11272
11274 {
11275 m_IsResultOfSplit = value;
11276 }
11277
11279 {
11281 }
11282
11284 {
11285 float other_item_quantity = other_item.GetQuantity();
11286 float this_free_space;
11287
11289
11291
11292 if (other_item_quantity > this_free_space)
11293 {
11294 return this_free_space;
11295 }
11296 else
11297 {
11298 return other_item_quantity;
11299 }
11300 }
11301
11303 {
11305 }
11306
11308 {
11310 return;
11311
11312 if (!IsMagazine() && other_item)
11313 {
11315 if (quantity_used != 0)
11316 {
11317 float hp1 = GetHealth01("","");
11318 float hp2 = other_item.GetHealth01("","");
11319 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11320 hpResult = hpResult / (
GetQuantity() + quantity_used);
11321
11322 hpResult *= GetMaxHealth();
11323 Math.Round(hpResult);
11324 SetHealth("", "Health", hpResult);
11325
11327 other_item.AddQuantity(-quantity_used);
11328 }
11329 }
11331 }
11332
11334 {
11335 #ifdef SERVER
11336 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11337 GetHierarchyParent().IncreaseLifetimeUp();
11338 #endif
11339 };
11340
11342 {
11343 PlayerBase p = PlayerBase.Cast(player);
11344
11345 array<int> recipesIds = p.m_Recipes;
11346 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11347 if (moduleRecipesManager)
11348 {
11349 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11350 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11351 }
11352
11353 for (int i = 0;i < recipesIds.Count(); i++)
11354 {
11355 int key = recipesIds.Get(i);
11356 string recipeName = moduleRecipesManager.GetRecipeName(key);
11358 }
11359 }
11360
11361
11362 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11363 {
11364 super.GetDebugActions(outputList);
11365
11366
11371
11372
11376
11380
11381
11384
11385
11387 {
11390 }
11391
11393
11396
11400 }
11401
11402
11403
11404
11406 {
11407 super.OnAction(action_id, player, ctx);
11408 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11409 {
11410 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11411 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11412 PlayerBase p = PlayerBase.Cast(player);
11413 if (
EActions.RECIPES_RANGE_START < 1000)
11414 {
11415 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11416 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11417 }
11418 }
11419 #ifndef SERVER
11420 else if (action_id ==
EActions.WATCH_PLAYER)
11421 {
11422 PluginDeveloper.SetDeveloperItemClientEx(player);
11423 }
11424 #endif
11426 {
11427 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11428 {
11429 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11430 OnDebugButtonPressServer(id + 1);
11431 }
11432
11433 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11434 {
11435 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11437 }
11438
11439 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11440 {
11441 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11443 }
11444
11445 else if (action_id ==
EActions.ADD_QUANTITY)
11446 {
11447 if (IsMagazine())
11448 {
11449 Magazine mag = Magazine.Cast(this);
11450 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11451 }
11452 else
11453 {
11455 }
11456
11457 if (m_EM)
11458 {
11459 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11460 }
11461
11462 }
11463
11464 else if (action_id ==
EActions.REMOVE_QUANTITY)
11465 {
11466 if (IsMagazine())
11467 {
11468 Magazine mag2 = Magazine.Cast(this);
11469 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11470 }
11471 else
11472 {
11474 }
11475 if (m_EM)
11476 {
11477 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11478 }
11479
11480 }
11481
11482 else if (action_id ==
EActions.SET_QUANTITY_0)
11483 {
11485
11486 if (m_EM)
11487 {
11488 m_EM.SetEnergy(0);
11489 }
11490 }
11491
11492 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11493 {
11495
11496 if (m_EM)
11497 {
11498 m_EM.SetEnergy(m_EM.GetEnergyMax());
11499 }
11500 }
11501
11502 else if (action_id ==
EActions.ADD_HEALTH)
11503 {
11504 AddHealth("","",GetMaxHealth("","Health")/5);
11505 }
11506 else if (action_id ==
EActions.REMOVE_HEALTH)
11507 {
11508 AddHealth("","",-GetMaxHealth("","Health")/5);
11509 }
11510 else if (action_id ==
EActions.DESTROY_HEALTH)
11511 {
11512 SetHealth01("","",0);
11513 }
11514 else if (action_id ==
EActions.WATCH_ITEM)
11515 {
11517 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11518 #ifdef DEVELOPER
11519 SetDebugDeveloper_item(this);
11520 #endif
11521 }
11522
11523 else if (action_id ==
EActions.ADD_TEMPERATURE)
11524 {
11525 AddTemperature(20);
11526
11527 }
11528
11529 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11530 {
11531 AddTemperature(-20);
11532
11533 }
11534
11535 else if (action_id ==
EActions.FLIP_FROZEN)
11536 {
11537 SetFrozen(!GetIsFrozen());
11538
11539 }
11540
11541 else if (action_id ==
EActions.ADD_WETNESS)
11542 {
11544
11545 }
11546
11547 else if (action_id ==
EActions.REMOVE_WETNESS)
11548 {
11550
11551 }
11552
11553 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11554 {
11557
11558
11559 }
11560
11561 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11562 {
11565 }
11566
11567 else if (action_id ==
EActions.MAKE_SPECIAL)
11568 {
11569 auto debugParams = DebugSpawnParams.WithPlayer(player);
11570 OnDebugSpawnEx(debugParams);
11571 }
11572
11573 else if (action_id ==
EActions.DELETE)
11574 {
11575 Delete();
11576 }
11577
11578 }
11579
11580
11581 return false;
11582 }
11583
11584
11585
11586
11590
11593
11594
11595
11597 {
11598 return false;
11599 }
11600
11601
11603 {
11604 return true;
11605 }
11606
11607
11609 {
11610 return true;
11611 }
11612
11613
11614
11616 {
11617 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11619 }
11620
11623 {
11624 return null;
11625 }
11626
11628 {
11629 return false;
11630 }
11631
11633 {
11634 return false;
11635 }
11636
11640
11641
11643 {
11644 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11645 return module_repairing.CanRepair(this, item_repair_kit);
11646 }
11647
11648
11649 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11650 {
11651 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11652 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11653 }
11654
11655
11657 {
11658
11659
11660
11661
11662
11663
11664
11665
11666 return 1;
11667 }
11668
11669
11670
11672 {
11674 }
11675
11676
11677
11679 {
11681 }
11682
11683
11692 {
11693 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11694
11695 if (player)
11696 {
11697 player.MessageStatus(text);
11698 }
11699 }
11700
11701
11710 {
11711 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11712
11713 if (player)
11714 {
11715 player.MessageAction(text);
11716 }
11717 }
11718
11719
11728 {
11729 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11730
11731 if (player)
11732 {
11733 player.MessageFriendly(text);
11734 }
11735 }
11736
11737
11746 {
11747 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11748
11749 if (player)
11750 {
11751 player.MessageImportant(text);
11752 }
11753 }
11754
11756 {
11757 return true;
11758 }
11759
11760
11761 override bool KindOf(
string tag)
11762 {
11763 bool found = false;
11764 string item_name = this.
GetType();
11767
11768 int array_size = item_tag_array.Count();
11769 for (int i = 0; i < array_size; i++)
11770 {
11771 if (item_tag_array.Get(i) == tag)
11772 {
11773 found = true;
11774 break;
11775 }
11776 }
11777 return found;
11778 }
11779
11780
11782 {
11783
11784 super.OnRPC(sender, rpc_type,ctx);
11785
11786
11787 switch (rpc_type)
11788 {
11789 #ifndef SERVER
11790 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11791 Param2<bool, string> p = new Param2<bool, string>(false, "");
11792
11794 return;
11795
11796 bool play = p.param1;
11797 string soundSet = p.param2;
11798
11799 if (play)
11800 {
11802 {
11804 {
11806 }
11807 }
11808 else
11809 {
11811 }
11812 }
11813 else
11814 {
11816 }
11817
11818 break;
11819 #endif
11820
11821 }
11822
11824 {
11826 }
11827 }
11828
11829
11830
11831
11833 {
11834 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11835 return plugin.GetID(
name);
11836 }
11837
11839 {
11840 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11841 return plugin.GetName(id);
11842 }
11843
11846 {
11847
11848
11849 int varFlags;
11850 if (!ctx.
Read(varFlags))
11851 return;
11852
11853 if (varFlags & ItemVariableFlags.FLOAT)
11854 {
11856 }
11857 }
11858
11860 {
11861
11862 super.SerializeNumericalVars(floats_out);
11863
11864
11865
11867 {
11869 }
11870
11872 {
11874 }
11875
11877 {
11879 }
11880
11882 {
11887 }
11888
11890 {
11892 }
11893 }
11894
11896 {
11897
11898 super.DeSerializeNumericalVars(floats);
11899
11900
11901 int index = 0;
11902 int mask = Math.Round(floats.Get(index));
11903
11904 index++;
11905
11907 {
11909 {
11911 }
11912 else
11913 {
11914 float quantity = floats.Get(index);
11915 SetQuantity(quantity,
true,
false,
false,
false);
11916 }
11917 index++;
11918 }
11919
11921 {
11922 float wet = floats.Get(index);
11924 index++;
11925 }
11926
11928 {
11929 int liquidtype = Math.Round(floats.Get(index));
11931 index++;
11932 }
11933
11935 {
11937 index++;
11939 index++;
11941 index++;
11943 index++;
11944 }
11945
11947 {
11948 int cleanness = Math.Round(floats.Get(index));
11950 index++;
11951 }
11952 }
11953
11955 {
11956 super.WriteVarsToCTX(ctx);
11957
11958
11960 {
11962 }
11963
11965 {
11967 }
11968
11970 {
11972 }
11973
11975 {
11976 int r,g,b,a;
11982 }
11983
11985 {
11987 }
11988 }
11989
11991 {
11992 if (!super.ReadVarsFromCTX(ctx,version))
11993 return false;
11994
11995 int intValue;
11996 float value;
11997
11998 if (version < 140)
11999 {
12000 if (!ctx.
Read(intValue))
12001 return false;
12002
12003 m_VariablesMask = intValue;
12004 }
12005
12007 {
12008 if (!ctx.
Read(value))
12009 return false;
12010
12012 {
12014 }
12015 else
12016 {
12018 }
12019 }
12020
12021 if (version < 140)
12022 {
12024 {
12025 if (!ctx.
Read(value))
12026 return false;
12027 SetTemperatureDirect(value);
12028 }
12029 }
12030
12032 {
12033 if (!ctx.
Read(value))
12034 return false;
12036 }
12037
12039 {
12040 if (!ctx.
Read(intValue))
12041 return false;
12043 }
12044
12046 {
12047 int r,g,b,a;
12049 return false;
12051 return false;
12053 return false;
12055 return false;
12056
12058 }
12059
12061 {
12062 if (!ctx.
Read(intValue))
12063 return false;
12065 }
12066
12067 if (version >= 138 && version < 140)
12068 {
12070 {
12071 if (!ctx.
Read(intValue))
12072 return false;
12073 SetFrozen(intValue);
12074 }
12075 }
12076
12077 return true;
12078 }
12079
12080
12082 {
12085 {
12087 }
12088
12089 if (!super.OnStoreLoad(ctx, version))
12090 {
12092 return false;
12093 }
12094
12095 if (version >= 114)
12096 {
12097 bool hasQuickBarIndexSaved;
12098
12099 if (!ctx.
Read(hasQuickBarIndexSaved))
12100 {
12102 return false;
12103 }
12104
12105 if (hasQuickBarIndexSaved)
12106 {
12107 int itmQBIndex;
12108
12109
12110 if (!ctx.
Read(itmQBIndex))
12111 {
12113 return false;
12114 }
12115
12116 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12117 if (itmQBIndex != -1 && parentPlayer)
12118 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12119 }
12120 }
12121 else
12122 {
12123
12124 PlayerBase player;
12125 int itemQBIndex;
12126 if (version ==
int.
MAX)
12127 {
12128 if (!ctx.
Read(itemQBIndex))
12129 {
12131 return false;
12132 }
12133 }
12134 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12135 {
12136
12137 if (!ctx.
Read(itemQBIndex))
12138 {
12140 return false;
12141 }
12142 if (itemQBIndex != -1 && player)
12143 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12144 }
12145 }
12146
12147 if (version < 140)
12148 {
12149
12150 if (!LoadVariables(ctx, version))
12151 {
12153 return false;
12154 }
12155 }
12156
12157
12159 {
12161 return false;
12162 }
12163 if (version >= 132)
12164 {
12166 if (raib)
12167 {
12169 {
12171 return false;
12172 }
12173 }
12174 }
12175
12177 return true;
12178 }
12179
12180
12181
12183 {
12184 super.OnStoreSave(ctx);
12185
12186 PlayerBase player;
12187 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12188 {
12190
12191 int itemQBIndex = -1;
12192 itemQBIndex = player.FindQuickBarEntityIndex(this);
12193 ctx.
Write(itemQBIndex);
12194 }
12195 else
12196 {
12198 }
12199
12201
12203 if (raib)
12204 {
12206 }
12207 }
12208
12209
12211 {
12212 super.AfterStoreLoad();
12213
12215 {
12217 }
12218
12220 {
12223 }
12224 }
12225
12227 {
12228 super.EEOnAfterLoad();
12229
12231 {
12233 }
12234
12237 }
12238
12240 {
12241 return false;
12242 }
12243
12244
12245
12247 {
12249 {
12250 #ifdef PLATFORM_CONSOLE
12251
12253 {
12255 if (menu)
12256 {
12258 }
12259 }
12260 #endif
12261 }
12262
12264 {
12267 }
12268
12270 {
12271 SetWeightDirty();
12273 }
12275 {
12278 }
12279
12281 {
12284 }
12286 {
12289 }
12290
12291 super.OnVariablesSynchronized();
12292 }
12293
12294
12295
12297 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12298 {
12299 if (!IsServerCheck(allow_client))
12300 return false;
12301
12303 return false;
12304
12307
12308 if (value <= (min + 0.001))
12309 value = min;
12310
12311 if (value == min)
12312 {
12313 if (destroy_config)
12314 {
12315 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12316 if (dstr)
12317 {
12319 this.Delete();
12320 return true;
12321 }
12322 }
12323 else if (destroy_forced)
12324 {
12326 this.Delete();
12327 return true;
12328 }
12329
12331 }
12332
12335
12337 {
12339
12340 if (delta)
12342 }
12343
12345
12346 return false;
12347 }
12348
12349
12351 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12352 {
12354 }
12355
12357 {
12360 }
12361
12363 {
12366 }
12367
12370 {
12371 float value_clamped = Math.Clamp(value, 0, 1);
12373 SetQuantity(result, destroy_config, destroy_forced);
12374 }
12375
12376
12379 {
12381 }
12382
12384 {
12386 }
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12398 {
12399 int slot = -1;
12400 if (GetInventory())
12401 {
12402 InventoryLocation il = new InventoryLocation;
12403 GetInventory().GetCurrentInventoryLocation(il);
12405 }
12406
12408 }
12409
12411 {
12412 float quantity_max = 0;
12413
12415 {
12416 if (attSlotID != -1)
12417 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12418
12419 if (quantity_max <= 0)
12421 }
12422
12423 if (quantity_max <= 0)
12425
12426 return quantity_max;
12427 }
12428
12430 {
12432 }
12433
12435 {
12437 }
12438
12439
12441 {
12443 }
12444
12446 {
12448 }
12449
12451 {
12453 }
12454
12455
12457 {
12458
12459 float weightEx = GetWeightEx();
12460 float special = GetInventoryAndCargoWeight();
12461 return weightEx - special;
12462 }
12463
12464
12466 {
12468 }
12469
12471 {
12473 {
12474 #ifdef DEVELOPER
12475 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12476 {
12477 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12479 }
12480 #endif
12481
12482 return GetQuantity() * GetConfigWeightModified();
12483 }
12484 else if (HasEnergyManager())
12485 {
12486 #ifdef DEVELOPER
12487 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12488 {
12489 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12490 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12491 }
12492 #endif
12493 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12494 }
12495 else
12496 {
12497 #ifdef DEVELOPER
12498 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12499 {
12500 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12501 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12502 }
12503 #endif
12504 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12505 }
12506 }
12507
12510 {
12511 int item_count = 0;
12513
12514 if (GetInventory().GetCargo() != NULL)
12515 {
12516 item_count = GetInventory().GetCargo().GetItemCount();
12517 }
12518
12519 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12520 {
12521 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12522 if (item)
12523 item_count += item.GetNumberOfItems();
12524 }
12525 return item_count;
12526 }
12527
12530 {
12531 float weight = 0;
12532 float wetness = 1;
12533 if (include_wetness)
12536 {
12537 weight = wetness * m_ConfigWeight;
12538 }
12540 {
12541 weight = 1;
12542 }
12543 return weight;
12544 }
12545
12546
12547
12549 {
12550 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12551 {
12552 GameInventory inv = GetInventory();
12553 array<EntityAI> items = new array<EntityAI>;
12555 for (int i = 0; i < items.Count(); i++)
12556 {
12558 if (item)
12559 {
12561 }
12562 }
12563 }
12564 }
12565
12566
12567
12568
12570 {
12571 float energy = 0;
12572 if (HasEnergyManager())
12573 {
12574 energy = GetCompEM().GetEnergy();
12575 }
12576 return energy;
12577 }
12578
12579
12581 {
12582 super.OnEnergyConsumed();
12583
12585 }
12586
12588 {
12589 super.OnEnergyAdded();
12590
12592 }
12593
12594
12596 {
12597 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12598 {
12600 {
12601 float energy_0to1 = GetCompEM().GetEnergy0To1();
12603 }
12604 }
12605 }
12606
12607
12609 {
12610 return ConfigGetFloat("heatIsolation");
12611 }
12612
12614 {
12616 }
12617
12619 {
12620 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12621 if (
GetGame().ConfigIsExisting(paramPath))
12623
12624 return 0.0;
12625 }
12626
12628 {
12629 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12630 if (
GetGame().ConfigIsExisting(paramPath))
12632
12633 return 0.0;
12634 }
12635
12636 override void SetWet(
float value,
bool allow_client =
false)
12637 {
12638 if (!IsServerCheck(allow_client))
12639 return;
12640
12643
12645
12646 m_VarWet = Math.Clamp(value, min, max);
12647
12649 {
12652 }
12653 }
12654
12655 override void AddWet(
float value)
12656 {
12658 }
12659
12661 {
12663 }
12664
12666 {
12668 }
12669
12671 {
12673 }
12674
12676 {
12678 }
12679
12681 {
12683 }
12684
12685 override void OnWetChanged(
float newVal,
float oldVal)
12686 {
12689 if (newLevel != oldLevel)
12690 {
12692 }
12693 }
12694
12696 {
12697 SetWeightDirty();
12698 }
12699
12701 {
12702 return GetWetLevelInternal(
m_VarWet);
12703 }
12704
12705
12706
12708 {
12710 }
12711
12713 {
12715 }
12716
12718 {
12720 }
12721
12723 {
12725 }
12726
12727
12728
12730 {
12731 if (ConfigIsExisting("itemModelLength"))
12732 {
12733 return ConfigGetFloat("itemModelLength");
12734 }
12735 return 0;
12736 }
12737
12739 {
12740 if (ConfigIsExisting("itemAttachOffset"))
12741 {
12742 return ConfigGetFloat("itemAttachOffset");
12743 }
12744 return 0;
12745 }
12746
12747 override void SetCleanness(
int value,
bool allow_client =
false)
12748 {
12749 if (!IsServerCheck(allow_client))
12750 return;
12751
12753
12755
12758 }
12759
12761 {
12763 }
12764
12766 {
12767 return true;
12768 }
12769
12770
12771
12772
12774 {
12776 }
12777
12779 {
12781 }
12782
12783
12784
12785
12786 override void SetColor(
int r,
int g,
int b,
int a)
12787 {
12793 }
12795 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12796 {
12801 }
12802
12804 {
12806 }
12807
12810 {
12811 int r,g,b,a;
12813 r = r/255;
12814 g = g/255;
12815 b = b/255;
12816 a = a/255;
12817 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12818 }
12819
12820
12821
12822 override void SetLiquidType(
int value,
bool allow_client =
false)
12823 {
12824 if (!IsServerCheck(allow_client))
12825 return;
12826
12831 }
12832
12834 {
12835 return ConfigGetInt("varLiquidTypeInit");
12836 }
12837
12839 {
12841 }
12842
12844 {
12846 SetFrozen(false);
12847 }
12848
12851 {
12852 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12853 }
12854
12855
12858 {
12859 PlayerBase nplayer;
12860 if (PlayerBase.CastTo(nplayer, player))
12861 {
12863
12864 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12865 }
12866 }
12867
12868
12871 {
12872 PlayerBase nplayer;
12873 if (PlayerBase.CastTo(nplayer,player))
12874 {
12875
12876 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12877
12878 }
12879
12880
12881 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12882
12883
12884 if (HasEnergyManager())
12885 {
12886 GetCompEM().UpdatePlugState();
12887 }
12888 }
12889
12890
12892 {
12893 super.OnPlacementStarted(player);
12894
12896 }
12897
12898 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12899 {
12901 {
12902 m_AdminLog.OnPlacementComplete(player,
this);
12903 }
12904
12905 super.OnPlacementComplete(player, position, orientation);
12906 }
12907
12908
12909
12910
12911
12913 {
12915 {
12916 return true;
12917 }
12918 else
12919 {
12920 return false;
12921 }
12922 }
12923
12924
12926 {
12928 {
12930 }
12931 }
12932
12933
12935 {
12937 }
12938
12940 {
12942 }
12943
12944 override void InsertAgent(
int agent,
float count = 1)
12945 {
12946 if (count < 1)
12947 return;
12948
12950 }
12951
12954 {
12956 }
12957
12958
12960 {
12962 }
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13006 {
13008 return false;
13009 return true;
13010 }
13011
13013 {
13014
13016 }
13017
13018
13021 {
13022 super.CheckForRoofLimited(timeTresholdMS);
13023
13025 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13026 {
13027 m_PreviousRoofTestTime = time;
13028 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13029 }
13030 }
13031
13032
13034 {
13036 {
13037 return 0;
13038 }
13039
13040 if (GetInventory().GetAttachmentSlotsCount() != 0)
13041 {
13042 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13043 if (filter)
13044 return filter.GetProtectionLevel(type, false, system);
13045 else
13046 return 0;
13047 }
13048
13049 string subclassPath, entryName;
13050
13051 switch (type)
13052 {
13054 entryName = "biological";
13055 break;
13057 entryName = "chemical";
13058 break;
13059 default:
13060 entryName = "biological";
13061 break;
13062 }
13063
13064 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13065
13067 }
13068
13069
13070
13073 {
13074 if (!IsMagazine())
13076
13078 }
13079
13080
13081
13082
13083
13088 {
13089 return true;
13090 }
13091
13093 {
13095 }
13096
13097
13098
13099
13100
13102 {
13103 if (parent)
13104 {
13105 if (parent.IsInherited(DayZInfected))
13106 return true;
13107
13108 if (!parent.IsRuined())
13109 return true;
13110 }
13111
13112 return true;
13113 }
13114
13116 {
13117 if (!super.CanPutAsAttachment(parent))
13118 {
13119 return false;
13120 }
13121
13122 if (!IsRuined() && !parent.IsRuined())
13123 {
13124 return true;
13125 }
13126
13127 return false;
13128 }
13129
13131 {
13132
13133
13134
13135
13136 return super.CanReceiveItemIntoCargo(item);
13137 }
13138
13140 {
13141
13142
13143
13144
13145 GameInventory attachmentInv = attachment.GetInventory();
13147 {
13148 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13149 return false;
13150 }
13151
13152 InventoryLocation loc = new InventoryLocation();
13153 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13154 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13155 return false;
13156
13157 return super.CanReceiveAttachment(attachment, slotId);
13158 }
13159
13161 {
13162 if (!super.CanReleaseAttachment(attachment))
13163 return false;
13164
13165 return GetInventory().AreChildrenAccessible();
13166 }
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13189 {
13190 int id = muzzle_owner.GetMuzzleID();
13191 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13192
13193 if (WPOF_array)
13194 {
13195 for (int i = 0; i < WPOF_array.Count(); i++)
13196 {
13197 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13198
13199 if (WPOF)
13200 {
13201 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13202 }
13203 }
13204 }
13205 }
13206
13207
13209 {
13210 int id = muzzle_owner.GetMuzzleID();
13212
13213 if (WPOBE_array)
13214 {
13215 for (int i = 0; i < WPOBE_array.Count(); i++)
13216 {
13217 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13218
13219 if (WPOBE)
13220 {
13221 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13222 }
13223 }
13224 }
13225 }
13226
13227
13229 {
13230 int id = muzzle_owner.GetMuzzleID();
13231 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13232
13233 if (WPOOH_array)
13234 {
13235 for (int i = 0; i < WPOOH_array.Count(); i++)
13236 {
13237 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13238
13239 if (WPOOH)
13240 {
13241 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13242 }
13243 }
13244 }
13245 }
13246
13247
13249 {
13250 int id = muzzle_owner.GetMuzzleID();
13251 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13252
13253 if (WPOOH_array)
13254 {
13255 for (int i = 0; i < WPOOH_array.Count(); i++)
13256 {
13257 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13258
13259 if (WPOOH)
13260 {
13261 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13262 }
13263 }
13264 }
13265 }
13266
13267
13269 {
13270 int id = muzzle_owner.GetMuzzleID();
13271 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13272
13273 if (WPOOH_array)
13274 {
13275 for (int i = 0; i < WPOOH_array.Count(); i++)
13276 {
13277 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13278
13279 if (WPOOH)
13280 {
13281 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13282 }
13283 }
13284 }
13285 }
13286
13287
13288
13290 {
13292 {
13293 return true;
13294 }
13295
13296 return false;
13297 }
13298
13300 {
13302 {
13303 return true;
13304 }
13305
13306 return false;
13307 }
13308
13310 {
13312 {
13313 return true;
13314 }
13315
13316 return false;
13317 }
13318
13320 {
13321 return false;
13322 }
13323
13326 {
13327 return UATimeSpent.DEFAULT_DEPLOY;
13328 }
13329
13330
13331
13332
13334 {
13336 SetSynchDirty();
13337 }
13338
13340 {
13342 }
13343
13344
13346 {
13347 return false;
13348 }
13349
13352 {
13353 string att_type = "None";
13354
13355 if (ConfigIsExisting("soundAttType"))
13356 {
13357 att_type = ConfigGetString("soundAttType");
13358 }
13359
13361 }
13362
13364 {
13366 }
13367
13368
13369
13370
13371
13375
13377 {
13380
13382 }
13383
13384
13386 {
13388 return;
13389
13391
13394
13397
13398 SoundParameters params = new SoundParameters();
13402 }
13403
13404
13406 {
13408 return;
13409
13411 SetSynchDirty();
13412
13415 }
13416
13417
13419 {
13421 return;
13422
13424 SetSynchDirty();
13425
13428 }
13429
13431 {
13433 }
13434
13436 {
13438 }
13439
13442 {
13443 if (!
GetGame().IsDedicatedServer())
13444 {
13445 if (ConfigIsExisting("attachSoundSet"))
13446 {
13447 string cfg_path = "";
13448 string soundset = "";
13449 string type_name =
GetType();
13450
13453 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13454 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13455
13456 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13457 {
13458 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13459 {
13460 if (cfg_slot_array[i] == slot_type)
13461 {
13462 soundset = cfg_soundset_array[i];
13463 break;
13464 }
13465 }
13466 }
13467
13468 if (soundset != "")
13469 {
13470 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13472 }
13473 }
13474 }
13475 }
13476
13478 {
13479
13480 }
13481
13482 void OnApply(PlayerBase player);
13483
13485 {
13486 return 1.0;
13487 };
13488
13490 {
13492 }
13493
13495 {
13497 }
13498
13500
13502 {
13503 SetDynamicPhysicsLifeTime(0.01);
13505 }
13506
13508 {
13509 array<string> zone_names = new array<string>;
13510 GetDamageZones(zone_names);
13511 for (int i = 0; i < zone_names.Count(); i++)
13512 {
13513 SetHealthMax(zone_names.Get(i),"Health");
13514 }
13515 SetHealthMax("","Health");
13516 }
13517
13520 {
13521 float global_health = GetHealth01("","Health");
13522 array<string> zones = new array<string>;
13523 GetDamageZones(zones);
13524
13525 for (int i = 0; i < zones.Count(); i++)
13526 {
13527 SetHealth01(zones.Get(i),"Health",global_health);
13528 }
13529 }
13530
13533 {
13534 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13535 }
13536
13538 {
13539 if (!hasRootAsPlayer)
13540 {
13541 if (refParentIB)
13542 {
13543
13544 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13545 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13546
13547 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13548 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13549
13552 }
13553 else
13554 {
13555
13558 }
13559 }
13560 }
13561
13563 {
13565 {
13566 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13567 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13568 {
13569 float heatPermCoef = 1.0;
13571 while (ent)
13572 {
13573 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13574 ent = ent.GetHierarchyParent();
13575 }
13576
13577 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13578 }
13579 }
13580 }
13581
13583 {
13584
13585 EntityAI parent = GetHierarchyParent();
13586 if (!parent)
13587 {
13588 hasParent = false;
13589 hasRootAsPlayer = false;
13590 }
13591 else
13592 {
13593 hasParent = true;
13594 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13595 refParentIB =
ItemBase.Cast(parent);
13596 }
13597 }
13598
13599 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13600 {
13601
13602 }
13603
13605 {
13606
13607 return false;
13608 }
13609
13611 {
13612
13613
13614 return false;
13615 }
13616
13618 {
13619
13620 return false;
13621 }
13622
13625 {
13626 return !GetIsFrozen() &&
IsOpen();
13627 }
13628
13630 {
13631 bool hasParent = false, hasRootAsPlayer = false;
13633
13634 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13635 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13636
13637 if (wwtu || foodDecay)
13638 {
13642
13643 if (processWetness || processTemperature || processDecay)
13644 {
13646
13647 if (processWetness)
13648 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13649
13650 if (processTemperature)
13652
13653 if (processDecay)
13654 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13655 }
13656 }
13657 }
13658
13661 {
13663 }
13664
13666 {
13669
13670 return super.GetTemperatureFreezeThreshold();
13671 }
13672
13674 {
13677
13678 return super.GetTemperatureThawThreshold();
13679 }
13680
13682 {
13685
13686 return super.GetItemOverheatThreshold();
13687 }
13688
13690 {
13692 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13693
13694 return super.GetTemperatureFreezeTime();
13695 }
13696
13698 {
13700 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13701
13702 return super.GetTemperatureThawTime();
13703 }
13704
13709
13711 {
13712 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13713 }
13714
13716 {
13717 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13718 }
13719
13722 {
13724 }
13725
13727 {
13729 }
13730
13732 {
13734 }
13735
13738 {
13739 return null;
13740 }
13741
13744 {
13745 return false;
13746 }
13747
13749 {
13751 {
13754 if (!trg)
13755 {
13757 explosive = this;
13758 }
13759
13760 explosive.PairRemote(trg);
13762
13763 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13764 trg.SetPersistentPairID(persistentID);
13765 explosive.SetPersistentPairID(persistentID);
13766
13767 return true;
13768 }
13769 return false;
13770 }
13771
13774 {
13775 float ret = 1.0;
13778 ret *= GetHealth01();
13779
13780 return ret;
13781 }
13782
13783 #ifdef DEVELOPER
13784 override void SetDebugItem()
13785 {
13786 super.SetDebugItem();
13787 _itemBase = this;
13788 }
13789
13791 {
13792 string text = super.GetDebugText();
13793
13795 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13796
13797 return text;
13798 }
13799 #endif
13800
13802 {
13803 return true;
13804 }
13805
13807
13809
13811 {
13814 }
13815
13816
13824
13840}
13841
13843{
13845 if (entity)
13846 {
13847 bool is_item = entity.IsInherited(
ItemBase);
13848 if (is_item && full_quantity)
13849 {
13852 }
13853 }
13854 else
13855 {
13857 return NULL;
13858 }
13859 return entity;
13860}
13861
13863{
13864 if (item)
13865 {
13866 if (health > 0)
13867 item.SetHealth("", "", health);
13868
13869 if (item.CanHaveTemperature())
13870 {
13872 if (item.CanFreeze())
13873 item.SetFrozen(false);
13874 }
13875
13876 if (item.HasEnergyManager())
13877 {
13878 if (quantity >= 0)
13879 {
13880 item.GetCompEM().SetEnergy0To1(quantity);
13881 }
13882 else
13883 {
13885 }
13886 }
13887 else if (item.IsMagazine())
13888 {
13889 Magazine mag = Magazine.Cast(item);
13890 if (quantity >= 0)
13891 {
13892 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13893 }
13894 else
13895 {
13897 }
13898
13899 }
13900 else
13901 {
13902 if (quantity >= 0)
13903 {
13904 item.SetQuantityNormalized(quantity, false);
13905 }
13906 else
13907 {
13909 }
13910
13911 }
13912 }
13913}
13914
13915#ifdef DEVELOPER
13917#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.