8985{
8987 {
8988 return true;
8989 }
8990};
8991
8992
8993
8995{
8999
9001
9004
9005
9006
9007
9008
9017
9023
9028
9033
9054 protected bool m_IsResultOfSplit
9055
9057
9062
9063
9064
9066
9070
9071
9072
9074
9077
9078
9079
9085
9086
9094
9097
9098
9100
9101
9103
9104
9109
9110
9115
9116
9118
9119
9121 {
9126
9127 if (!
GetGame().IsDedicatedServer())
9128 {
9130 {
9132
9134 {
9136 }
9137 }
9138
9141 }
9142
9143 m_OldLocation = null;
9144
9146 {
9148 }
9149
9150 if (ConfigIsExisting("headSelectionsToHide"))
9151 {
9154 }
9155
9157 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9158 {
9160 }
9161
9163
9164 m_IsResultOfSplit = false;
9165
9167 }
9168
9170 {
9171 super.InitItemVariables();
9172
9178 m_Count = ConfigGetInt(
"count");
9179
9182
9187
9190
9195
9207
9211
9212
9215 if (ConfigIsExisting("canBeSplit"))
9216 {
9219 }
9220
9222 if (ConfigIsExisting("itemBehaviour"))
9224
9225
9228 RegisterNetSyncVariableInt("m_VarLiquidType");
9229 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9230
9231 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9232 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9233 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9234
9235 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9236 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9237 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9238 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9239
9240 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9241 RegisterNetSyncVariableBool("m_IsTakeable");
9242 RegisterNetSyncVariableBool("m_IsHologram");
9243
9246 {
9249 }
9250
9252
9254 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9256
9257 }
9258
9260 {
9262 }
9263
9265 {
9268 {
9273 }
9274 }
9275
9276 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9277 {
9279 {
9282 }
9283
9285 }
9286
9288 {
9294 }
9295
9297
9299 {
9301
9302 if (!action)
9303 {
9304 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9305 return;
9306 }
9307
9309 if (!ai)
9310 {
9312 return;
9313 }
9314
9316 if (!action_array)
9317 {
9318 action_array = new array<ActionBase_Basic>;
9320 }
9321 if (LogManager.IsActionLogEnable())
9322 {
9323 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9324 }
9325
9326 if (action_array.Find(action) != -1)
9327 {
9328 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9329 }
9330 else
9331 {
9332 action_array.Insert(action);
9333 }
9334 }
9335
9337 {
9339 ActionBase action = player.GetActionManager().GetAction(actionName);
9342
9343 if (action_array)
9344 {
9345 action_array.RemoveItem(action);
9346 }
9347 }
9348
9349
9350
9352 {
9353 ActionOverrideData overrideData = new ActionOverrideData();
9357
9359 if (!actionMap)
9360 {
9363 }
9364
9365 actionMap.Insert(this.
Type(), overrideData);
9366
9367 }
9368
9370
9372
9373
9375 {
9378
9381
9382 string config_to_search = "CfgVehicles";
9383 string muzzle_owner_config;
9384
9386 {
9387 if (IsInherited(Weapon))
9388 config_to_search = "CfgWeapons";
9389
9390 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9391
9392 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9393
9395
9396 if (config_OnFire_subclass_count > 0)
9397 {
9398 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9399
9400 for (int i = 0; i < config_OnFire_subclass_count; i++)
9401 {
9402 string particle_class = "";
9404 string config_OnFire_entry = config_OnFire_class + particle_class;
9405 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9406 WPOF_array.Insert(WPOF);
9407 }
9408
9409
9411 }
9412 }
9413
9415 {
9416 config_to_search = "CfgWeapons";
9417 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9418
9419 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9420
9422
9423 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9424 {
9425 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9426
9427 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9428 {
9429 string particle_class2 = "";
9431 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9432 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9433 WPOBE_array.Insert(WPOBE);
9434 }
9435
9436
9438 }
9439 }
9440 }
9441
9442
9444 {
9447
9449 {
9450 string config_to_search = "CfgVehicles";
9451
9452 if (IsInherited(Weapon))
9453 config_to_search = "CfgWeapons";
9454
9455 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9456 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9457
9458 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9459 {
9460
9462
9464 {
9466 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9468 return;
9469 }
9470
9473
9474
9475
9477 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9478
9479 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9480 {
9481 string particle_class = "";
9483 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9485
9486 if (entry_type == CT_CLASS)
9487 {
9488 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9489 WPOOH_array.Insert(WPOF);
9490 }
9491 }
9492
9493
9495 }
9496 }
9497 }
9498
9500 {
9502 }
9503
9505 {
9507 {
9509
9512
9515
9516 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9517 }
9518 }
9519
9521 {
9523 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9524
9526 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9527
9529 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9530
9532 {
9534 }
9535 }
9536
9538 {
9540 }
9541
9543 {
9546 else
9548
9550 {
9553 }
9554 else
9555 {
9558
9561 }
9562
9564 }
9565
9567 {
9569 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9570 }
9571
9573 {
9575 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9577 }
9578
9580 {
9582 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9583 }
9584
9586 {
9589
9590 OverheatingParticle OP = new OverheatingParticle();
9595
9597 }
9598
9600 {
9603
9604 return -1;
9605 }
9606
9608 {
9610 {
9613
9614 for (int i = count; i > 0; --i)
9615 {
9616 int id = i - 1;
9619
9622
9623 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9624 {
9625 if (p)
9626 {
9629 }
9630 }
9631 }
9632 }
9633 }
9634
9636 {
9638 {
9640 {
9641 int id = i - 1;
9643
9644 if (OP)
9645 {
9647
9648 if (p)
9649 {
9651 }
9652
9653 delete OP;
9654 }
9655 }
9656
9659 }
9660 }
9661
9664 {
9665 return 0.0;
9666 }
9667
9668
9670 {
9671 return 250;
9672 }
9673
9675 {
9676 return 0;
9677 }
9678
9681 {
9683 return true;
9684
9685 return false;
9686 }
9687
9690 {
9693
9695 {
9697 }
9698 else
9699 {
9700
9702 }
9703
9705 }
9706
9713 {
9714 return -1;
9715 }
9716
9717
9718
9719
9721 {
9723 {
9725 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9726
9727 if (r_index >= 0)
9728 {
9729 InventoryLocation r_il = new InventoryLocation;
9730 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9731
9732 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9735 {
9736 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9737 }
9739 {
9740 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9741 }
9742
9743 }
9744
9745 player.GetHumanInventory().ClearUserReservedLocation(this);
9746 }
9747
9750 }
9751
9752
9753
9754
9756 {
9757 return ItemBase.m_DebugActionsMask;
9758 }
9759
9761 {
9762 return ItemBase.m_DebugActionsMask & mask;
9763 }
9764
9766 {
9767 ItemBase.m_DebugActionsMask = mask;
9768 }
9769
9771 {
9772 ItemBase.m_DebugActionsMask |= mask;
9773 }
9774
9776 {
9777 ItemBase.m_DebugActionsMask &= ~mask;
9778 }
9779
9781 {
9783 {
9785 }
9786 else
9787 {
9789 }
9790 }
9791
9792
9794 {
9795 if (GetEconomyProfile())
9796 {
9797 float q_max = GetEconomyProfile().GetQuantityMax();
9798 if (q_max > 0)
9799 {
9800 float q_min = GetEconomyProfile().GetQuantityMin();
9801 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9802
9804 {
9805 ComponentEnergyManager comp = GetCompEM();
9807 {
9809 }
9810 }
9812 {
9814
9815 }
9816
9817 }
9818 }
9819 }
9820
9823 {
9824 EntityAI parent = GetHierarchyParent();
9825
9826 if (parent)
9827 {
9828 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9829 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9830 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9831 }
9832 }
9833
9836 {
9837 EntityAI parent = GetHierarchyParent();
9838
9839 if (parent)
9840 {
9841 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9842 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9843 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9844 }
9845 }
9846
9848 {
9849
9850
9851
9852
9854
9856 {
9857 if (ScriptInputUserData.CanStoreInputUserData())
9858 {
9859 ScriptInputUserData ctx = new ScriptInputUserData;
9865 ctx.
Write(use_stack_max);
9868
9870 {
9871 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9872 }
9873 }
9874 }
9875 else if (!
GetGame().IsMultiplayer())
9876 {
9878 }
9879 }
9880
9882 {
9884 }
9885
9887 {
9889 }
9890
9892 {
9894 }
9895
9897 {
9898
9899 return false;
9900 }
9901
9903 {
9904 return false;
9905 }
9906
9910 {
9911 return false;
9912 }
9913
9915 {
9916 return "";
9917 }
9918
9920
9922 {
9923 return false;
9924 }
9925
9927 {
9928 return true;
9929 }
9930
9931
9932
9934 {
9935 return true;
9936 }
9937
9939 {
9940 return true;
9941 }
9942
9944 {
9945 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9947 }
9948
9950 {
9952 }
9953
9955 {
9957 if (!is_being_placed)
9959 SetSynchDirty();
9960 }
9961
9962
9964
9966 {
9968 }
9969
9971 {
9973 }
9974
9976 {
9977 return 1;
9978 }
9979
9981 {
9982 return false;
9983 }
9984
9986 {
9988 SetSynchDirty();
9989 }
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10026 {
10027 super.OnMovedInsideCargo(container);
10028
10029 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10030 }
10031
10032 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10033 {
10034 super.EEItemLocationChanged(oldLoc,newLoc);
10035
10036 PlayerBase new_player = null;
10037 PlayerBase old_player = null;
10038
10039 if (newLoc.GetParent())
10040 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10041
10042 if (oldLoc.GetParent())
10043 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10044
10046 {
10047 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10048
10049 if (r_index >= 0)
10050 {
10051 InventoryLocation r_il = new InventoryLocation;
10052 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10053
10054 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10057 {
10058 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10059 }
10061 {
10062 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10063 }
10064
10065 }
10066 }
10067
10069 {
10070 if (new_player)
10071 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10072
10073 if (new_player == old_player)
10074 {
10075
10076 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10077 {
10079 {
10080 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10081 {
10082 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10083 }
10084 }
10085 else
10086 {
10087 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10088 }
10089 }
10090
10091 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10092 {
10093 int type = oldLoc.GetType();
10095 {
10096 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10097 }
10099 {
10100 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10101 }
10102 }
10103 if (!m_OldLocation)
10104 {
10105 m_OldLocation = new InventoryLocation;
10106 }
10107 m_OldLocation.Copy(oldLoc);
10108 }
10109 else
10110 {
10111 if (m_OldLocation)
10112 {
10113 m_OldLocation.Reset();
10114 }
10115 }
10116
10118 }
10119 else
10120 {
10121 if (new_player)
10122 {
10123 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10124 if (res_index >= 0)
10125 {
10126 InventoryLocation il = new InventoryLocation;
10127 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10129 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10132 {
10133 il.
GetParent().GetOnReleaseLock().Invoke(it);
10134 }
10136 {
10138 }
10139
10140 }
10141 }
10143 {
10144
10146 }
10147
10148 if (m_OldLocation)
10149 {
10150 m_OldLocation.Reset();
10151 }
10152 }
10153 }
10154
10155 override void EOnContact(IEntity other, Contact extra)
10156 {
10158 {
10159 int liquidType = -1;
10161 if (impactSpeed > 0.0)
10162 {
10164 #ifndef SERVER
10166 #else
10168 SetSynchDirty();
10169 #endif
10171 }
10172 }
10173
10174 #ifdef SERVER
10175 if (GetCompEM() && GetCompEM().IsPlugged())
10176 {
10177 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10178 GetCompEM().UnplugThis();
10179 }
10180 #endif
10181 }
10182
10184
10186 {
10188 }
10189
10191 {
10192
10193 }
10194
10196 {
10197 super.OnItemLocationChanged(old_owner, new_owner);
10198
10199 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10200 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10201
10202 if (!relatedPlayer && playerNew)
10203 relatedPlayer = playerNew;
10204
10205 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10206 {
10208 if (actionMgr)
10209 {
10210 ActionBase currentAction = actionMgr.GetRunningAction();
10211 if (currentAction)
10213 }
10214 }
10215
10216 Man ownerPlayerOld = null;
10217 Man ownerPlayerNew = null;
10218
10219 if (old_owner)
10220 {
10221 if (old_owner.
IsMan())
10222 {
10223 ownerPlayerOld = Man.Cast(old_owner);
10224 }
10225 else
10226 {
10227 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10228 }
10229 }
10230 else
10231 {
10233 {
10235
10236 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10237 {
10238 GetCompEM().UnplugThis();
10239 }
10240 }
10241 }
10242
10243 if (new_owner)
10244 {
10245 if (new_owner.
IsMan())
10246 {
10247 ownerPlayerNew = Man.Cast(new_owner);
10248 }
10249 else
10250 {
10251 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10252 }
10253 }
10254
10255 if (ownerPlayerOld != ownerPlayerNew)
10256 {
10257 if (ownerPlayerOld)
10258 {
10259 array<EntityAI> subItemsExit = new array<EntityAI>;
10261 for (int i = 0; i < subItemsExit.Count(); i++)
10262 {
10265 }
10266 }
10267
10268 if (ownerPlayerNew)
10269 {
10270 array<EntityAI> subItemsEnter = new array<EntityAI>;
10272 for (int j = 0; j < subItemsEnter.Count(); j++)
10273 {
10276 }
10277 }
10278 }
10279 else if (ownerPlayerNew != null)
10280 {
10281 PlayerBase nplayer;
10282 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10283 {
10284 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10286 for (int k = 0; k < subItemsUpdate.Count(); k++)
10287 {
10289 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10290 }
10291 }
10292 }
10293
10294 if (old_owner)
10295 old_owner.OnChildItemRemoved(this);
10296 if (new_owner)
10297 new_owner.OnChildItemReceived(this);
10298 }
10299
10300
10302 {
10303 super.EEDelete(parent);
10304 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10305 if (player)
10306 {
10308
10309 if (player.IsAlive())
10310 {
10311 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10312 if (r_index >= 0)
10313 {
10314 InventoryLocation r_il = new InventoryLocation;
10315 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10316
10317 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10320 {
10321 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10322 }
10324 {
10325 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10326 }
10327
10328 }
10329
10330 player.RemoveQuickBarEntityShortcut(this);
10331 }
10332 }
10333 }
10334
10336 {
10337 super.EEKilled(killer);
10338
10341 {
10342 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10343 {
10344 if (IsMagazine())
10345 {
10346 if (Magazine.Cast(this).GetAmmoCount() > 0)
10347 {
10349 }
10350 }
10351 else
10352 {
10354 }
10355 }
10356 }
10357 }
10358
10360 {
10361 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10362
10363 super.OnWasAttached(parent, slot_id);
10364
10367
10369 }
10370
10372 {
10373 super.OnWasDetached(parent, slot_id);
10374
10377 }
10378
10380 {
10381 int idx;
10384
10385 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10386 if (inventory_slots.Count() < 1)
10387 {
10388 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10389 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10390 }
10391 else
10392 {
10393 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10394 }
10395
10396 idx = inventory_slots.Find(slot);
10397 if (idx < 0)
10398 return "";
10399
10400 return attach_types.Get(idx);
10401 }
10402
10404 {
10405 int idx = -1;
10406 string slot;
10407
10410
10411 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10412 if (inventory_slots.Count() < 1)
10413 {
10414 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10415 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10416 }
10417 else
10418 {
10419 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10420 if (detach_types.Count() < 1)
10421 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10422 }
10423
10424 for (int i = 0; i < inventory_slots.Count(); i++)
10425 {
10426 slot = inventory_slots.Get(i);
10427 }
10428
10429 if (slot != "")
10430 {
10431 if (detach_types.Count() == 1)
10432 idx = 0;
10433 else
10434 idx = inventory_slots.Find(slot);
10435 }
10436 if (idx < 0)
10437 return "";
10438
10439 return detach_types.Get(idx);
10440 }
10441
10443 {
10444
10446
10447
10448 float min_time = 1;
10449 float max_time = 3;
10450 float delay = Math.RandomFloat(min_time, max_time);
10451
10452 explode_timer.Run(delay, this, "DoAmmoExplosion");
10453 }
10454
10456 {
10457 Magazine magazine = Magazine.Cast(this);
10458 int pop_sounds_count = 6;
10459 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10460
10461
10462 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10463 string sound_name = pop_sounds[ sound_idx ];
10465
10466
10467 magazine.ServerAddAmmoCount(-1);
10468
10469
10470 float min_temp_to_explode = 100;
10471
10472 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10473 {
10475 }
10476 }
10477
10478
10479 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10480 {
10481 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10482
10483 const int CHANCE_DAMAGE_CARGO = 4;
10484 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10485 const int CHANCE_DAMAGE_NOTHING = 2;
10486
10488 {
10489 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10490 int chances;
10491 int rnd;
10492
10493 if (GetInventory().GetCargo())
10494 {
10495 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10496 rnd = Math.RandomInt(0,chances);
10497
10498 if (rnd < CHANCE_DAMAGE_CARGO)
10499 {
10501 }
10502 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10503 {
10505 }
10506 }
10507 else
10508 {
10509 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10510 rnd = Math.RandomInt(0,chances);
10511
10512 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10513 {
10515 }
10516 }
10517 }
10518 }
10519
10521 {
10522 if (GetInventory().GetCargo())
10523 {
10524 int item_count = GetInventory().GetCargo().GetItemCount();
10525 if (item_count > 0)
10526 {
10527 int random_pick = Math.RandomInt(0, item_count);
10529 if (!item.IsExplosive())
10530 {
10531 item.AddHealth("","",damage);
10532 return true;
10533 }
10534 }
10535 }
10536 return false;
10537 }
10538
10540 {
10541 int attachment_count = GetInventory().AttachmentCount();
10542 if (attachment_count > 0)
10543 {
10544 int random_pick = Math.RandomInt(0, attachment_count);
10545 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10546 if (!attachment.IsExplosive())
10547 {
10548 attachment.AddHealth("","",damage);
10549 return true;
10550 }
10551 }
10552 return false;
10553 }
10554
10556 {
10558 }
10559
10561 {
10563 return GetInventory().CanRemoveEntity();
10564
10565 return false;
10566 }
10567
10569 {
10570
10572 return false;
10573
10574
10576 return false;
10577
10578
10579
10581 if (delta == 0)
10582 return false;
10583
10584
10585 return true;
10586 }
10587
10589 {
10591 {
10592 if (ScriptInputUserData.CanStoreInputUserData())
10593 {
10594 ScriptInputUserData ctx = new ScriptInputUserData;
10599 ctx.
Write(destination_entity);
10601 ctx.
Write(slot_id);
10603 }
10604 }
10605 else if (!
GetGame().IsMultiplayer())
10606 {
10608 }
10609 }
10610
10612 {
10613 float split_quantity_new;
10617 InventoryLocation loc = new InventoryLocation;
10618
10619 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10620 {
10622 split_quantity_new = stack_max;
10623 else
10625
10627 {
10628 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10629 if (new_item)
10630 {
10631 new_item.SetResultOfSplit(true);
10632 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10634 new_item.
SetQuantity(split_quantity_new,
false,
true);
10635 }
10636 }
10637 }
10638 else if (destination_entity && slot_id == -1)
10639 {
10640 if (quantity > stack_max)
10641 split_quantity_new = stack_max;
10642 else
10643 split_quantity_new = quantity;
10644
10646 {
10648 {
10651 }
10652
10653 if (new_item)
10654 {
10655 new_item.SetResultOfSplit(true);
10656 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10658 new_item.
SetQuantity(split_quantity_new,
false,
true);
10659 }
10660 }
10661 }
10662 else
10663 {
10664 if (stack_max != 0)
10665 {
10667 {
10669 }
10670
10671 if (split_quantity_new == 0)
10672 {
10673 if (!
GetGame().IsMultiplayer())
10674 player.PhysicalPredictiveDropItem(this);
10675 else
10676 player.ServerDropEntity(this);
10677 return;
10678 }
10679
10681 {
10683
10684 if (new_item)
10685 {
10686 new_item.SetResultOfSplit(true);
10687 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10690 new_item.PlaceOnSurface();
10691 }
10692 }
10693 }
10694 }
10695 }
10696
10698 {
10699 float split_quantity_new;
10703 InventoryLocation loc = new InventoryLocation;
10704
10705 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10706 {
10708 split_quantity_new = stack_max;
10709 else
10711
10713 {
10714 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10715 if (new_item)
10716 {
10717 new_item.SetResultOfSplit(true);
10718 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10720 new_item.
SetQuantity(split_quantity_new,
false,
true);
10721 }
10722 }
10723 }
10724 else if (destination_entity && slot_id == -1)
10725 {
10726 if (quantity > stack_max)
10727 split_quantity_new = stack_max;
10728 else
10729 split_quantity_new = quantity;
10730
10732 {
10734 {
10737 }
10738
10739 if (new_item)
10740 {
10741 new_item.SetResultOfSplit(true);
10742 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10744 new_item.
SetQuantity(split_quantity_new,
false,
true);
10745 }
10746 }
10747 }
10748 else
10749 {
10750 if (stack_max != 0)
10751 {
10753 {
10755 }
10756
10758 {
10760
10761 if (new_item)
10762 {
10763 new_item.SetResultOfSplit(true);
10764 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10767 new_item.PlaceOnSurface();
10768 }
10769 }
10770 }
10771 }
10772 }
10773
10775 {
10777 {
10778 if (ScriptInputUserData.CanStoreInputUserData())
10779 {
10780 ScriptInputUserData ctx = new ScriptInputUserData;
10785 dst.WriteToContext(ctx);
10787 }
10788 }
10789 else if (!
GetGame().IsMultiplayer())
10790 {
10792 }
10793 }
10794
10796 {
10798 {
10799 if (ScriptInputUserData.CanStoreInputUserData())
10800 {
10801 ScriptInputUserData ctx = new ScriptInputUserData;
10806 ctx.
Write(destination_entity);
10812 }
10813 }
10814 else if (!
GetGame().IsMultiplayer())
10815 {
10817 }
10818 }
10819
10821 {
10823 }
10824
10826 {
10828 float split_quantity_new;
10830 if (dst.IsValid())
10831 {
10832 int slot_id = dst.GetSlot();
10834
10835 if (quantity > stack_max)
10836 split_quantity_new = stack_max;
10837 else
10838 split_quantity_new = quantity;
10839
10841 {
10843
10844 if (new_item)
10845 {
10846 new_item.SetResultOfSplit(true);
10847 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10849 new_item.
SetQuantity(split_quantity_new,
false,
true);
10850 }
10851
10852 return new_item;
10853 }
10854 }
10855
10856 return null;
10857 }
10858
10860 {
10862 float split_quantity_new;
10864 if (destination_entity)
10865 {
10867 if (quantity > stackable)
10868 split_quantity_new = stackable;
10869 else
10870 split_quantity_new = quantity;
10871
10873 {
10874 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10875 if (new_item)
10876 {
10877 new_item.SetResultOfSplit(true);
10878 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10880 new_item.
SetQuantity(split_quantity_new,
false,
true);
10881 }
10882 }
10883 }
10884 }
10885
10887 {
10889 {
10890 if (ScriptInputUserData.CanStoreInputUserData())
10891 {
10892 ScriptInputUserData ctx = new ScriptInputUserData;
10897 ItemBase destination_entity =
this;
10898 ctx.
Write(destination_entity);
10902 }
10903 }
10904 else if (!
GetGame().IsMultiplayer())
10905 {
10907 }
10908 }
10909
10911 {
10913 float split_quantity_new;
10915 if (player)
10916 {
10918 if (quantity > stackable)
10919 split_quantity_new = stackable;
10920 else
10921 split_quantity_new = quantity;
10922
10924 {
10925 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10926 new_item =
ItemBase.Cast(in_hands);
10927 if (new_item)
10928 {
10929 new_item.SetResultOfSplit(true);
10930 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10932 new_item.SetQuantity(split_quantity_new, false, true);
10933 }
10934 }
10935 }
10936 }
10937
10939 {
10941 float split_quantity_new = Math.Floor(quantity * 0.5);
10942
10944 return;
10945
10947
10948 if (new_item)
10949 {
10950 if (new_item.GetQuantityMax() < split_quantity_new)
10951 {
10952 split_quantity_new = new_item.GetQuantityMax();
10953 }
10954
10955 new_item.SetResultOfSplit(true);
10956 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10957
10959 {
10962 }
10963 else
10964 {
10966 new_item.
SetQuantity(split_quantity_new,
false,
true);
10967 }
10968 }
10969 }
10970
10972 {
10974 float split_quantity_new = Math.Floor(quantity / 2);
10975
10977 return;
10978
10979 InventoryLocation invloc = new InventoryLocation;
10981
10983 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10984
10985 if (new_item)
10986 {
10987 if (new_item.GetQuantityMax() < split_quantity_new)
10988 {
10989 split_quantity_new = new_item.GetQuantityMax();
10990 }
10992 {
10995 }
10996 else if (split_quantity_new > 1)
10997 {
10999 new_item.
SetQuantity(split_quantity_new,
false,
true);
11000 }
11001 }
11002 }
11003
11006 {
11007 SetWeightDirty();
11009
11010 if (parent)
11011 parent.OnAttachmentQuantityChangedEx(this, delta);
11012
11014 {
11016 {
11018 }
11020 {
11021 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11023 }
11024 }
11025
11026 }
11027
11030 {
11031
11032 }
11033
11036 {
11038 }
11039
11041 {
11042 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11043
11045 {
11046 if (newLevel == GameConstants.STATE_RUINED)
11047 {
11049 EntityAI parent = GetHierarchyParent();
11050 if (parent && parent.IsFireplace())
11051 {
11052 CargoBase cargo = GetInventory().GetCargo();
11053 if (cargo)
11054 {
11056 {
11058 }
11059 }
11060 }
11061 }
11062
11064 {
11065
11067 return;
11068 }
11069
11070 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11071 {
11073 }
11074 }
11075 }
11076
11077
11079 {
11080 super.OnRightClick();
11081
11083 {
11085 {
11086 if (ScriptInputUserData.CanStoreInputUserData())
11087 {
11088 EntityAI root = GetHierarchyRoot();
11089 Man playerOwner = GetHierarchyRootPlayer();
11090 InventoryLocation dst = new InventoryLocation;
11091
11092
11093 if (!playerOwner && root && root == this)
11094 {
11096 }
11097 else
11098 {
11099
11100 GetInventory().GetCurrentInventoryLocation(dst);
11102 {
11105 {
11107 }
11108 else
11109 {
11111
11112
11113 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11114 {
11116 }
11117 else
11118 {
11119 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11120 }
11121 }
11122 }
11123 }
11124
11125 ScriptInputUserData ctx = new ScriptInputUserData;
11133 }
11134 }
11135 else if (!
GetGame().IsMultiplayer())
11136 {
11138 }
11139 }
11140 }
11141
11143 {
11144 if (root)
11145 {
11146 vector m4[4];
11147 root.GetTransform(m4);
11148 dst.SetGround(this, m4);
11149 }
11150 else
11151 {
11152 GetInventory().GetCurrentInventoryLocation(dst);
11153 }
11154 }
11155
11156 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11157 {
11158
11159 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11160 return false;
11161
11162 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11163 return false;
11164
11165
11167 return false;
11168
11169
11170 Magazine mag = Magazine.Cast(this);
11171 if (mag)
11172 {
11173 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11174 return false;
11175
11176 if (stack_max_limit)
11177 {
11178 Magazine other_mag = Magazine.Cast(other_item);
11179 if (other_item)
11180 {
11181 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11182 return false;
11183 }
11184
11185 }
11186 }
11187 else
11188 {
11189
11191 return false;
11192
11194 return false;
11195 }
11196
11197 PlayerBase player = null;
11198 if (CastTo(player, GetHierarchyRootPlayer()))
11199 {
11200 if (player.GetInventory().HasAttachment(this))
11201 return false;
11202
11203 if (player.IsItemsToDelete())
11204 return false;
11205 }
11206
11207 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11208 return false;
11209
11210 int slotID;
11212 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11213 return false;
11214
11215 return true;
11216 }
11217
11219 {
11221 }
11222
11224 {
11225 return m_IsResultOfSplit;
11226 }
11227
11229 {
11230 m_IsResultOfSplit = value;
11231 }
11232
11234 {
11236 }
11237
11239 {
11240 float other_item_quantity = other_item.GetQuantity();
11241 float this_free_space;
11242
11244
11246
11247 if (other_item_quantity > this_free_space)
11248 {
11249 return this_free_space;
11250 }
11251 else
11252 {
11253 return other_item_quantity;
11254 }
11255 }
11256
11258 {
11260 }
11261
11263 {
11265 return;
11266
11267 if (!IsMagazine() && other_item)
11268 {
11270 if (quantity_used != 0)
11271 {
11272 float hp1 = GetHealth01("","");
11273 float hp2 = other_item.GetHealth01("","");
11274 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11275 hpResult = hpResult / (
GetQuantity() + quantity_used);
11276
11277 hpResult *= GetMaxHealth();
11278 Math.Round(hpResult);
11279 SetHealth("", "Health", hpResult);
11280
11282 other_item.AddQuantity(-quantity_used);
11283 }
11284 }
11286 }
11287
11289 {
11290 #ifdef SERVER
11291 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11292 GetHierarchyParent().IncreaseLifetimeUp();
11293 #endif
11294 };
11295
11297 {
11298 PlayerBase p = PlayerBase.Cast(player);
11299
11300 array<int> recipesIds = p.m_Recipes;
11301 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11302 if (moduleRecipesManager)
11303 {
11304 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11305 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11306 }
11307
11308 for (int i = 0;i < recipesIds.Count(); i++)
11309 {
11310 int key = recipesIds.Get(i);
11311 string recipeName = moduleRecipesManager.GetRecipeName(key);
11313 }
11314 }
11315
11316
11317 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11318 {
11319 super.GetDebugActions(outputList);
11320
11321
11327
11328
11333
11338
11339
11343
11344
11346 {
11350 }
11351
11354
11355
11359
11361
11362 InventoryLocation loc = new InventoryLocation();
11363 GetInventory().GetCurrentInventoryLocation(loc);
11365 {
11366 if (Gizmo_IsSupported())
11369 }
11370
11372 }
11373
11374
11375
11376
11378 {
11379 super.OnAction(action_id, player, ctx);
11380
11382 {
11383 switch (action_id)
11384 {
11387 return true;
11390 return true;
11391 }
11392 }
11393
11395 {
11396 switch (action_id)
11397 {
11399 Delete();
11400 return true;
11401 }
11402 }
11403
11404 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11405 {
11406 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11407 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11408 PlayerBase p = PlayerBase.Cast(player);
11409 if (
EActions.RECIPES_RANGE_START < 1000)
11410 {
11411 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11412 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11413 }
11414 }
11415 #ifndef SERVER
11416 else if (action_id ==
EActions.WATCH_PLAYER)
11417 {
11418 PluginDeveloper.SetDeveloperItemClientEx(player);
11419 }
11420 #endif
11422 {
11423 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11424 {
11425 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11426 OnDebugButtonPressServer(id + 1);
11427 }
11428
11429 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11430 {
11431 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11433 }
11434
11435 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11436 {
11437 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11439 }
11440
11441 else if (action_id ==
EActions.ADD_QUANTITY)
11442 {
11443 if (IsMagazine())
11444 {
11445 Magazine mag = Magazine.Cast(this);
11446 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11447 }
11448 else
11449 {
11451 }
11452
11453 if (m_EM)
11454 {
11455 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11456 }
11457
11458 }
11459
11460 else if (action_id ==
EActions.REMOVE_QUANTITY)
11461 {
11462 if (IsMagazine())
11463 {
11464 Magazine mag2 = Magazine.Cast(this);
11465 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11466 }
11467 else
11468 {
11470 }
11471 if (m_EM)
11472 {
11473 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11474 }
11475
11476 }
11477
11478 else if (action_id ==
EActions.SET_QUANTITY_0)
11479 {
11481
11482 if (m_EM)
11483 {
11484 m_EM.SetEnergy(0);
11485 }
11486 }
11487
11488 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11489 {
11491
11492 if (m_EM)
11493 {
11494 m_EM.SetEnergy(m_EM.GetEnergyMax());
11495 }
11496 }
11497
11498 else if (action_id ==
EActions.ADD_HEALTH)
11499 {
11500 AddHealth("","",GetMaxHealth("","Health")/5);
11501 }
11502 else if (action_id ==
EActions.REMOVE_HEALTH)
11503 {
11504 AddHealth("","",-GetMaxHealth("","Health")/5);
11505 }
11506 else if (action_id ==
EActions.DESTROY_HEALTH)
11507 {
11508 SetHealth01("","",0);
11509 }
11510 else if (action_id ==
EActions.WATCH_ITEM)
11511 {
11513 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11514 #ifdef DEVELOPER
11515 SetDebugDeveloper_item(this);
11516 #endif
11517 }
11518
11519 else if (action_id ==
EActions.ADD_TEMPERATURE)
11520 {
11521 AddTemperature(20);
11522
11523 }
11524
11525 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11526 {
11527 AddTemperature(-20);
11528
11529 }
11530
11531 else if (action_id ==
EActions.FLIP_FROZEN)
11532 {
11533 SetFrozen(!GetIsFrozen());
11534
11535 }
11536
11537 else if (action_id ==
EActions.ADD_WETNESS)
11538 {
11540
11541 }
11542
11543 else if (action_id ==
EActions.REMOVE_WETNESS)
11544 {
11546
11547 }
11548
11549 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11550 {
11553
11554
11555 }
11556
11557 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11558 {
11561 }
11562
11563 else if (action_id ==
EActions.MAKE_SPECIAL)
11564 {
11565 auto debugParams = DebugSpawnParams.WithPlayer(player);
11566 OnDebugSpawnEx(debugParams);
11567 }
11568
11569 }
11570
11571
11572 return false;
11573 }
11574
11575
11576
11577
11581
11584
11585
11586
11588 {
11589 return false;
11590 }
11591
11592
11594 {
11595 return true;
11596 }
11597
11598
11600 {
11601 return true;
11602 }
11603
11604
11605
11607 {
11608 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11610 }
11611
11614 {
11615 return null;
11616 }
11617
11619 {
11620 return false;
11621 }
11622
11624 {
11625 return false;
11626 }
11627
11631
11632
11634 {
11635 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11636 return module_repairing.CanRepair(this, item_repair_kit);
11637 }
11638
11639
11640 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11641 {
11642 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11643 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11644 }
11645
11646
11648 {
11649
11650
11651
11652
11653
11654
11655
11656
11657 return 1;
11658 }
11659
11660
11661
11663 {
11665 }
11666
11667
11668
11670 {
11672 }
11673
11674
11683 {
11684 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11685
11686 if (player)
11687 {
11688 player.MessageStatus(text);
11689 }
11690 }
11691
11692
11701 {
11702 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11703
11704 if (player)
11705 {
11706 player.MessageAction(text);
11707 }
11708 }
11709
11710
11719 {
11720 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11721
11722 if (player)
11723 {
11724 player.MessageFriendly(text);
11725 }
11726 }
11727
11728
11737 {
11738 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11739
11740 if (player)
11741 {
11742 player.MessageImportant(text);
11743 }
11744 }
11745
11747 {
11748 return true;
11749 }
11750
11751
11752 override bool KindOf(
string tag)
11753 {
11754 bool found = false;
11755 string item_name = this.
GetType();
11758
11759 int array_size = item_tag_array.Count();
11760 for (int i = 0; i < array_size; i++)
11761 {
11762 if (item_tag_array.Get(i) == tag)
11763 {
11764 found = true;
11765 break;
11766 }
11767 }
11768 return found;
11769 }
11770
11771
11773 {
11774
11775 super.OnRPC(sender, rpc_type,ctx);
11776
11777
11778 switch (rpc_type)
11779 {
11780 #ifndef SERVER
11781 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11782 Param2<bool, string> p = new Param2<bool, string>(false, "");
11783
11785 return;
11786
11787 bool play = p.param1;
11788 string soundSet = p.param2;
11789
11790 if (play)
11791 {
11793 {
11795 {
11797 }
11798 }
11799 else
11800 {
11802 }
11803 }
11804 else
11805 {
11807 }
11808
11809 break;
11810 #endif
11811
11812 }
11813
11815 {
11817 }
11818 }
11819
11820
11821
11822
11824 {
11825 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11826 return plugin.GetID(
name);
11827 }
11828
11830 {
11831 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11832 return plugin.GetName(id);
11833 }
11834
11837 {
11838
11839
11840 int varFlags;
11841 if (!ctx.
Read(varFlags))
11842 return;
11843
11844 if (varFlags & ItemVariableFlags.FLOAT)
11845 {
11847 }
11848 }
11849
11851 {
11852
11853 super.SerializeNumericalVars(floats_out);
11854
11855
11856
11858 {
11860 }
11861
11863 {
11865 }
11866
11868 {
11870 }
11871
11873 {
11878 }
11879
11881 {
11883 }
11884 }
11885
11887 {
11888
11889 super.DeSerializeNumericalVars(floats);
11890
11891
11892 int index = 0;
11893 int mask = Math.Round(floats.Get(index));
11894
11895 index++;
11896
11898 {
11900 {
11902 }
11903 else
11904 {
11905 float quantity = floats.Get(index);
11906 SetQuantity(quantity,
true,
false,
false,
false);
11907 }
11908 index++;
11909 }
11910
11912 {
11913 float wet = floats.Get(index);
11915 index++;
11916 }
11917
11919 {
11920 int liquidtype = Math.Round(floats.Get(index));
11922 index++;
11923 }
11924
11926 {
11928 index++;
11930 index++;
11932 index++;
11934 index++;
11935 }
11936
11938 {
11939 int cleanness = Math.Round(floats.Get(index));
11941 index++;
11942 }
11943 }
11944
11946 {
11947 super.WriteVarsToCTX(ctx);
11948
11949
11951 {
11953 }
11954
11956 {
11958 }
11959
11961 {
11963 }
11964
11966 {
11967 int r,g,b,a;
11973 }
11974
11976 {
11978 }
11979 }
11980
11982 {
11983 if (!super.ReadVarsFromCTX(ctx,version))
11984 return false;
11985
11986 int intValue;
11987 float value;
11988
11989 if (version < 140)
11990 {
11991 if (!ctx.
Read(intValue))
11992 return false;
11993
11994 m_VariablesMask = intValue;
11995 }
11996
11998 {
11999 if (!ctx.
Read(value))
12000 return false;
12001
12003 {
12005 }
12006 else
12007 {
12009 }
12010 }
12011
12012 if (version < 140)
12013 {
12015 {
12016 if (!ctx.
Read(value))
12017 return false;
12018 SetTemperatureDirect(value);
12019 }
12020 }
12021
12023 {
12024 if (!ctx.
Read(value))
12025 return false;
12027 }
12028
12030 {
12031 if (!ctx.
Read(intValue))
12032 return false;
12034 }
12035
12037 {
12038 int r,g,b,a;
12040 return false;
12042 return false;
12044 return false;
12046 return false;
12047
12049 }
12050
12052 {
12053 if (!ctx.
Read(intValue))
12054 return false;
12056 }
12057
12058 if (version >= 138 && version < 140)
12059 {
12061 {
12062 if (!ctx.
Read(intValue))
12063 return false;
12064 SetFrozen(intValue);
12065 }
12066 }
12067
12068 return true;
12069 }
12070
12071
12073 {
12076 {
12078 }
12079
12080 if (!super.OnStoreLoad(ctx, version))
12081 {
12083 return false;
12084 }
12085
12086 if (version >= 114)
12087 {
12088 bool hasQuickBarIndexSaved;
12089
12090 if (!ctx.
Read(hasQuickBarIndexSaved))
12091 {
12093 return false;
12094 }
12095
12096 if (hasQuickBarIndexSaved)
12097 {
12098 int itmQBIndex;
12099
12100
12101 if (!ctx.
Read(itmQBIndex))
12102 {
12104 return false;
12105 }
12106
12107 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12108 if (itmQBIndex != -1 && parentPlayer)
12109 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12110 }
12111 }
12112 else
12113 {
12114
12115 PlayerBase player;
12116 int itemQBIndex;
12117 if (version ==
int.
MAX)
12118 {
12119 if (!ctx.
Read(itemQBIndex))
12120 {
12122 return false;
12123 }
12124 }
12125 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12126 {
12127
12128 if (!ctx.
Read(itemQBIndex))
12129 {
12131 return false;
12132 }
12133 if (itemQBIndex != -1 && player)
12134 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12135 }
12136 }
12137
12138 if (version < 140)
12139 {
12140
12141 if (!LoadVariables(ctx, version))
12142 {
12144 return false;
12145 }
12146 }
12147
12148
12150 {
12152 return false;
12153 }
12154 if (version >= 132)
12155 {
12157 if (raib)
12158 {
12160 {
12162 return false;
12163 }
12164 }
12165 }
12166
12168 return true;
12169 }
12170
12171
12172
12174 {
12175 super.OnStoreSave(ctx);
12176
12177 PlayerBase player;
12178 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12179 {
12181
12182 int itemQBIndex = -1;
12183 itemQBIndex = player.FindQuickBarEntityIndex(this);
12184 ctx.
Write(itemQBIndex);
12185 }
12186 else
12187 {
12189 }
12190
12192
12194 if (raib)
12195 {
12197 }
12198 }
12199
12200
12202 {
12203 super.AfterStoreLoad();
12204
12206 {
12208 }
12209
12211 {
12214 }
12215 }
12216
12218 {
12219 super.EEOnAfterLoad();
12220
12222 {
12224 }
12225
12228 }
12229
12231 {
12232 return false;
12233 }
12234
12235
12236
12238 {
12240 {
12241 #ifdef PLATFORM_CONSOLE
12242
12244 {
12246 if (menu)
12247 {
12249 }
12250 }
12251 #endif
12252 }
12253
12255 {
12258 }
12259
12261 {
12262 SetWeightDirty();
12264 }
12266 {
12269 }
12270
12272 {
12275 }
12277 {
12280 }
12281
12282 super.OnVariablesSynchronized();
12283 }
12284
12285
12286
12288 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12289 {
12290 if (!IsServerCheck(allow_client))
12291 return false;
12292
12294 return false;
12295
12298
12299 if (value <= (min + 0.001))
12300 value = min;
12301
12302 if (value == min)
12303 {
12304 if (destroy_config)
12305 {
12306 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12307 if (dstr)
12308 {
12310 this.Delete();
12311 return true;
12312 }
12313 }
12314 else if (destroy_forced)
12315 {
12317 this.Delete();
12318 return true;
12319 }
12320
12322 }
12323
12326
12328 {
12330
12331 if (delta)
12333 }
12334
12336
12337 return false;
12338 }
12339
12340
12342 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12343 {
12345 }
12346
12348 {
12351 }
12352
12354 {
12357 }
12358
12360 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12361 {
12362 float value_clamped = Math.Clamp(value, 0, 1);
12364 SetQuantity(result, destroy_config, destroy_forced);
12365 }
12366
12367
12370 {
12372 }
12373
12375 {
12377 }
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12389 {
12390 int slot = -1;
12391 if (GetInventory())
12392 {
12393 InventoryLocation il = new InventoryLocation;
12394 GetInventory().GetCurrentInventoryLocation(il);
12396 }
12397
12399 }
12400
12402 {
12403 float quantity_max = 0;
12404
12406 {
12407 if (attSlotID != -1)
12408 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12409
12410 if (quantity_max <= 0)
12412 }
12413
12414 if (quantity_max <= 0)
12416
12417 return quantity_max;
12418 }
12419
12421 {
12423 }
12424
12426 {
12428 }
12429
12430
12432 {
12434 }
12435
12437 {
12439 }
12440
12442 {
12444 }
12445
12446
12448 {
12449
12450 float weightEx = GetWeightEx();
12451 float special = GetInventoryAndCargoWeight();
12452 return weightEx - special;
12453 }
12454
12455
12457 {
12459 }
12460
12462 {
12464 {
12465 #ifdef DEVELOPER
12466 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12467 {
12468 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12470 }
12471 #endif
12472
12473 return GetQuantity() * GetConfigWeightModified();
12474 }
12475 else if (HasEnergyManager())
12476 {
12477 #ifdef DEVELOPER
12478 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12479 {
12480 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12481 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12482 }
12483 #endif
12484 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12485 }
12486 else
12487 {
12488 #ifdef DEVELOPER
12489 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12490 {
12491 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12492 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12493 }
12494 #endif
12495 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12496 }
12497 }
12498
12501 {
12502 int item_count = 0;
12504
12505 if (GetInventory().GetCargo() != NULL)
12506 {
12507 item_count = GetInventory().GetCargo().GetItemCount();
12508 }
12509
12510 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12511 {
12512 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12513 if (item)
12514 item_count += item.GetNumberOfItems();
12515 }
12516 return item_count;
12517 }
12518
12521 {
12522 float weight = 0;
12523 float wetness = 1;
12524 if (include_wetness)
12527 {
12528 weight = wetness * m_ConfigWeight;
12529 }
12531 {
12532 weight = 1;
12533 }
12534 return weight;
12535 }
12536
12537
12538
12540 {
12541 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12542 {
12543 GameInventory inv = GetInventory();
12544 array<EntityAI> items = new array<EntityAI>;
12546 for (int i = 0; i < items.Count(); i++)
12547 {
12549 if (item)
12550 {
12552 }
12553 }
12554 }
12555 }
12556
12557
12558
12559
12561 {
12562 float energy = 0;
12563 if (HasEnergyManager())
12564 {
12565 energy = GetCompEM().GetEnergy();
12566 }
12567 return energy;
12568 }
12569
12570
12572 {
12573 super.OnEnergyConsumed();
12574
12576 }
12577
12579 {
12580 super.OnEnergyAdded();
12581
12583 }
12584
12585
12587 {
12588 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12589 {
12591 {
12592 float energy_0to1 = GetCompEM().GetEnergy0To1();
12594 }
12595 }
12596 }
12597
12598
12600 {
12601 return ConfigGetFloat("heatIsolation");
12602 }
12603
12605 {
12607 }
12608
12610 {
12611 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12612 if (
GetGame().ConfigIsExisting(paramPath))
12614
12615 return 0.0;
12616 }
12617
12619 {
12620 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12621 if (
GetGame().ConfigIsExisting(paramPath))
12623
12624 return 0.0;
12625 }
12626
12627 override void SetWet(
float value,
bool allow_client =
false)
12628 {
12629 if (!IsServerCheck(allow_client))
12630 return;
12631
12634
12636
12637 m_VarWet = Math.Clamp(value, min, max);
12638
12640 {
12643 }
12644 }
12645
12646 override void AddWet(
float value)
12647 {
12649 }
12650
12652 {
12654 }
12655
12657 {
12659 }
12660
12662 {
12664 }
12665
12667 {
12669 }
12670
12672 {
12674 }
12675
12676 override void OnWetChanged(
float newVal,
float oldVal)
12677 {
12680 if (newLevel != oldLevel)
12681 {
12683 }
12684 }
12685
12687 {
12688 SetWeightDirty();
12689 }
12690
12692 {
12693 return GetWetLevelInternal(
m_VarWet);
12694 }
12695
12696
12697
12699 {
12701 }
12702
12704 {
12706 }
12707
12709 {
12711 }
12712
12714 {
12716 }
12717
12718
12719
12721 {
12722 if (ConfigIsExisting("itemModelLength"))
12723 {
12724 return ConfigGetFloat("itemModelLength");
12725 }
12726 return 0;
12727 }
12728
12730 {
12731 if (ConfigIsExisting("itemAttachOffset"))
12732 {
12733 return ConfigGetFloat("itemAttachOffset");
12734 }
12735 return 0;
12736 }
12737
12738 override void SetCleanness(
int value,
bool allow_client =
false)
12739 {
12740 if (!IsServerCheck(allow_client))
12741 return;
12742
12744
12746
12749 }
12750
12752 {
12754 }
12755
12757 {
12758 return true;
12759 }
12760
12761
12762
12763
12765 {
12767 }
12768
12770 {
12772 }
12773
12774
12775
12776
12777 override void SetColor(
int r,
int g,
int b,
int a)
12778 {
12784 }
12786 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12787 {
12792 }
12793
12795 {
12797 }
12798
12801 {
12802 int r,g,b,a;
12804 r = r/255;
12805 g = g/255;
12806 b = b/255;
12807 a = a/255;
12808 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12809 }
12810
12811
12812
12813 override void SetLiquidType(
int value,
bool allow_client =
false)
12814 {
12815 if (!IsServerCheck(allow_client))
12816 return;
12817
12822 }
12823
12825 {
12826 return ConfigGetInt("varLiquidTypeInit");
12827 }
12828
12830 {
12832 }
12833
12835 {
12837 SetFrozen(false);
12838 }
12839
12842 {
12843 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12844 }
12845
12846
12849 {
12850 PlayerBase nplayer;
12851 if (PlayerBase.CastTo(nplayer, player))
12852 {
12854
12855 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12856 }
12857 }
12858
12859
12862 {
12863 PlayerBase nplayer;
12864 if (PlayerBase.CastTo(nplayer,player))
12865 {
12866
12867 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12868
12869 }
12870
12871
12872 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12873
12874
12875 if (HasEnergyManager())
12876 {
12877 GetCompEM().UpdatePlugState();
12878 }
12879 }
12880
12881
12883 {
12884 super.OnPlacementStarted(player);
12885
12887 }
12888
12889 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12890 {
12892 {
12893 m_AdminLog.OnPlacementComplete(player,
this);
12894 }
12895
12896 super.OnPlacementComplete(player, position, orientation);
12897 }
12898
12899
12900
12901
12902
12904 {
12906 {
12907 return true;
12908 }
12909 else
12910 {
12911 return false;
12912 }
12913 }
12914
12915
12917 {
12919 {
12921 }
12922 }
12923
12924
12926 {
12928 }
12929
12931 {
12933 }
12934
12935 override void InsertAgent(
int agent,
float count = 1)
12936 {
12937 if (count < 1)
12938 return;
12939
12941 }
12942
12945 {
12947 }
12948
12949
12951 {
12953 }
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12997 {
12999 return false;
13000 return true;
13001 }
13002
13004 {
13005
13007 }
13008
13009
13012 {
13013 super.CheckForRoofLimited(timeTresholdMS);
13014
13016 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13017 {
13018 m_PreviousRoofTestTime = time;
13019 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13020 }
13021 }
13022
13023
13025 {
13027 {
13028 return 0;
13029 }
13030
13031 if (GetInventory().GetAttachmentSlotsCount() != 0)
13032 {
13033 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13034 if (filter)
13035 return filter.GetProtectionLevel(type, false, system);
13036 else
13037 return 0;
13038 }
13039
13040 string subclassPath, entryName;
13041
13042 switch (type)
13043 {
13045 entryName = "biological";
13046 break;
13048 entryName = "chemical";
13049 break;
13050 default:
13051 entryName = "biological";
13052 break;
13053 }
13054
13055 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13056
13058 }
13059
13060
13061
13064 {
13065 if (!IsMagazine())
13067
13069 }
13070
13071
13072
13073
13074
13079 {
13080 return true;
13081 }
13082
13084 {
13086 }
13087
13088
13089
13090
13091
13093 {
13094 if (parent)
13095 {
13096 if (parent.IsInherited(DayZInfected))
13097 return true;
13098
13099 if (!parent.IsRuined())
13100 return true;
13101 }
13102
13103 return true;
13104 }
13105
13107 {
13108 if (!super.CanPutAsAttachment(parent))
13109 {
13110 return false;
13111 }
13112
13113 if (!IsRuined() && !parent.IsRuined())
13114 {
13115 return true;
13116 }
13117
13118 return false;
13119 }
13120
13122 {
13123
13124
13125
13126
13127 return super.CanReceiveItemIntoCargo(item);
13128 }
13129
13131 {
13132
13133
13134
13135
13136 GameInventory attachmentInv = attachment.GetInventory();
13138 {
13139 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13140 return false;
13141 }
13142
13143 InventoryLocation loc = new InventoryLocation();
13144 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13145 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13146 return false;
13147
13148 return super.CanReceiveAttachment(attachment, slotId);
13149 }
13150
13152 {
13153 if (!super.CanReleaseAttachment(attachment))
13154 return false;
13155
13156 return GetInventory().AreChildrenAccessible();
13157 }
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13180 {
13181 int id = muzzle_owner.GetMuzzleID();
13182 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13183
13184 if (WPOF_array)
13185 {
13186 for (int i = 0; i < WPOF_array.Count(); i++)
13187 {
13188 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13189
13190 if (WPOF)
13191 {
13192 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13193 }
13194 }
13195 }
13196 }
13197
13198
13200 {
13201 int id = muzzle_owner.GetMuzzleID();
13203
13204 if (WPOBE_array)
13205 {
13206 for (int i = 0; i < WPOBE_array.Count(); i++)
13207 {
13208 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13209
13210 if (WPOBE)
13211 {
13212 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13213 }
13214 }
13215 }
13216 }
13217
13218
13220 {
13221 int id = muzzle_owner.GetMuzzleID();
13222 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13223
13224 if (WPOOH_array)
13225 {
13226 for (int i = 0; i < WPOOH_array.Count(); i++)
13227 {
13228 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13229
13230 if (WPOOH)
13231 {
13232 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13233 }
13234 }
13235 }
13236 }
13237
13238
13240 {
13241 int id = muzzle_owner.GetMuzzleID();
13242 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13243
13244 if (WPOOH_array)
13245 {
13246 for (int i = 0; i < WPOOH_array.Count(); i++)
13247 {
13248 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13249
13250 if (WPOOH)
13251 {
13252 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13253 }
13254 }
13255 }
13256 }
13257
13258
13260 {
13261 int id = muzzle_owner.GetMuzzleID();
13262 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13263
13264 if (WPOOH_array)
13265 {
13266 for (int i = 0; i < WPOOH_array.Count(); i++)
13267 {
13268 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13269
13270 if (WPOOH)
13271 {
13272 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13273 }
13274 }
13275 }
13276 }
13277
13278
13279
13281 {
13283 {
13284 return true;
13285 }
13286
13287 return false;
13288 }
13289
13291 {
13293 {
13294 return true;
13295 }
13296
13297 return false;
13298 }
13299
13301 {
13303 {
13304 return true;
13305 }
13306
13307 return false;
13308 }
13309
13311 {
13312 return false;
13313 }
13314
13317 {
13318 return UATimeSpent.DEFAULT_DEPLOY;
13319 }
13320
13321
13322
13323
13325 {
13327 SetSynchDirty();
13328 }
13329
13331 {
13333 }
13334
13335
13337 {
13338 return false;
13339 }
13340
13343 {
13344 string att_type = "None";
13345
13346 if (ConfigIsExisting("soundAttType"))
13347 {
13348 att_type = ConfigGetString("soundAttType");
13349 }
13350
13352 }
13353
13355 {
13357 }
13358
13359
13360
13361
13362
13368
13370 {
13373
13375 }
13376
13377
13379 {
13381 return;
13382
13384
13387
13390
13391 SoundParameters params = new SoundParameters();
13395 }
13396
13397
13399 {
13401 return;
13402
13404 SetSynchDirty();
13405
13408 }
13409
13410
13412 {
13414 return;
13415
13417 SetSynchDirty();
13418
13421 }
13422
13424 {
13426 }
13427
13429 {
13431 }
13432
13435 {
13436 if (!
GetGame().IsDedicatedServer())
13437 {
13438 if (ConfigIsExisting("attachSoundSet"))
13439 {
13440 string cfg_path = "";
13441 string soundset = "";
13442 string type_name =
GetType();
13443
13446 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13447 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13448
13449 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13450 {
13451 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13452 {
13453 if (cfg_slot_array[i] == slot_type)
13454 {
13455 soundset = cfg_soundset_array[i];
13456 break;
13457 }
13458 }
13459 }
13460
13461 if (soundset != "")
13462 {
13463 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13465 }
13466 }
13467 }
13468 }
13469
13471 {
13472
13473 }
13474
13475 void OnApply(PlayerBase player);
13476
13478 {
13479 return 1.0;
13480 };
13481
13483 {
13485 }
13486
13488 {
13490 }
13491
13493
13495 {
13496 SetDynamicPhysicsLifeTime(0.01);
13498 }
13499
13501 {
13502 array<string> zone_names = new array<string>;
13503 GetDamageZones(zone_names);
13504 for (int i = 0; i < zone_names.Count(); i++)
13505 {
13506 SetHealthMax(zone_names.Get(i),"Health");
13507 }
13508 SetHealthMax("","Health");
13509 }
13510
13513 {
13514 float global_health = GetHealth01("","Health");
13515 array<string> zones = new array<string>;
13516 GetDamageZones(zones);
13517
13518 for (int i = 0; i < zones.Count(); i++)
13519 {
13520 SetHealth01(zones.Get(i),"Health",global_health);
13521 }
13522 }
13523
13526 {
13527 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13528 }
13529
13531 {
13532 if (!hasRootAsPlayer)
13533 {
13534 if (refParentIB)
13535 {
13536
13537 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13538 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13539
13540 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13541 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13542
13545 }
13546 else
13547 {
13548
13551 }
13552 }
13553 }
13554
13556 {
13558 {
13559 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13560 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13561 {
13562 float heatPermCoef = 1.0;
13564 while (ent)
13565 {
13566 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13567 ent = ent.GetHierarchyParent();
13568 }
13569
13570 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13571 }
13572 }
13573 }
13574
13576 {
13577
13578 EntityAI parent = GetHierarchyParent();
13579 if (!parent)
13580 {
13581 hasParent = false;
13582 hasRootAsPlayer = false;
13583 }
13584 else
13585 {
13586 hasParent = true;
13587 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13588 refParentIB =
ItemBase.Cast(parent);
13589 }
13590 }
13591
13592 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13593 {
13594
13595 }
13596
13598 {
13599
13600 return false;
13601 }
13602
13604 {
13605
13606
13607 return false;
13608 }
13609
13611 {
13612
13613 return false;
13614 }
13615
13618 {
13619 return !GetIsFrozen() &&
IsOpen();
13620 }
13621
13623 {
13624 bool hasParent = false, hasRootAsPlayer = false;
13626
13627 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13628 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13629
13630 if (wwtu || foodDecay)
13631 {
13635
13636 if (processWetness || processTemperature || processDecay)
13637 {
13639
13640 if (processWetness)
13641 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13642
13643 if (processTemperature)
13645
13646 if (processDecay)
13647 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13648 }
13649 }
13650 }
13651
13654 {
13656 }
13657
13659 {
13662
13663 return super.GetTemperatureFreezeThreshold();
13664 }
13665
13667 {
13670
13671 return super.GetTemperatureThawThreshold();
13672 }
13673
13675 {
13678
13679 return super.GetItemOverheatThreshold();
13680 }
13681
13683 {
13685 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13686
13687 return super.GetTemperatureFreezeTime();
13688 }
13689
13691 {
13693 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13694
13695 return super.GetTemperatureThawTime();
13696 }
13697
13702
13704 {
13705 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13706 }
13707
13709 {
13710 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13711 }
13712
13715 {
13717 }
13718
13720 {
13722 }
13723
13725 {
13727 }
13728
13731 {
13732 return null;
13733 }
13734
13737 {
13738 return false;
13739 }
13740
13742 {
13744 {
13747 if (!trg)
13748 {
13750 explosive = this;
13751 }
13752
13753 explosive.PairRemote(trg);
13755
13756 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13757 trg.SetPersistentPairID(persistentID);
13758 explosive.SetPersistentPairID(persistentID);
13759
13760 return true;
13761 }
13762 return false;
13763 }
13764
13767 {
13768 float ret = 1.0;
13771 ret *= GetHealth01();
13772
13773 return ret;
13774 }
13775
13776 #ifdef DEVELOPER
13777 override void SetDebugItem()
13778 {
13779 super.SetDebugItem();
13780 _itemBase = this;
13781 }
13782
13784 {
13785 string text = super.GetDebugText();
13786
13788 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13789
13790 return text;
13791 }
13792 #endif
13793
13795 {
13796 return true;
13797 }
13798
13800
13802
13804 {
13807 }
13808
13809
13817
13833}
13834
13836{
13838 if (entity)
13839 {
13840 bool is_item = entity.IsInherited(
ItemBase);
13841 if (is_item && full_quantity)
13842 {
13845 }
13846 }
13847 else
13848 {
13850 return NULL;
13851 }
13852 return entity;
13853}
13854
13856{
13857 if (item)
13858 {
13859 if (health > 0)
13860 item.SetHealth("", "", health);
13861
13862 if (item.CanHaveTemperature())
13863 {
13865 if (item.CanFreeze())
13866 item.SetFrozen(false);
13867 }
13868
13869 if (item.HasEnergyManager())
13870 {
13871 if (quantity >= 0)
13872 {
13873 item.GetCompEM().SetEnergy0To1(quantity);
13874 }
13875 else
13876 {
13878 }
13879 }
13880 else if (item.IsMagazine())
13881 {
13882 Magazine mag = Magazine.Cast(item);
13883 if (quantity >= 0)
13884 {
13885 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13886 }
13887 else
13888 {
13890 }
13891
13892 }
13893 else
13894 {
13895 if (quantity >= 0)
13896 {
13897 item.SetQuantityNormalized(quantity, false);
13898 }
13899 else
13900 {
13902 }
13903
13904 }
13905 }
13906}
13907
13908#ifdef DEVELOPER
13910#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
Open
Implementations only.
override void EEOnCECreate()
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 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)
bool ShouldSplitQuantity(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)
override 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...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
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()
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)
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 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 void GizmoSelectObject(Object object)
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 native void GizmoSelectPhysics(Physics physics)
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
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 string GetFoldSoundset()
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 string GetLoopFoldSoundset()
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.