9022{
9024 {
9025 return true;
9026 }
9027};
9028
9029
9030
9032{
9036
9038
9041
9042
9043
9044
9045
9054
9060
9065
9070
9091 protected bool m_IsResultOfSplit
9092
9094
9099
9100
9101
9103
9107
9108
9109
9111
9114
9115
9116
9122
9123
9131
9134
9135
9137
9138
9140
9141
9146
9147
9152
9153
9155
9156
9158 {
9163
9164 if (!
GetGame().IsDedicatedServer())
9165 {
9167 {
9169
9171 {
9173 }
9174 }
9175
9178 }
9179
9180 m_OldLocation = null;
9181
9183 {
9185 }
9186
9187 if (ConfigIsExisting("headSelectionsToHide"))
9188 {
9191 }
9192
9194 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9195 {
9197 }
9198
9200
9201 m_IsResultOfSplit = false;
9202
9204 }
9205
9207 {
9208 super.InitItemVariables();
9209
9215 m_Count = ConfigGetInt(
"count");
9216
9219
9224
9227
9232
9244
9248
9249
9252 if (ConfigIsExisting("canBeSplit"))
9253 {
9256 }
9257
9259 if (ConfigIsExisting("itemBehaviour"))
9261
9262
9265 RegisterNetSyncVariableInt("m_VarLiquidType");
9266 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9267
9268 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9269 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9270 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9271
9272 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9273 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9274 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9275 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9276
9277 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9278 RegisterNetSyncVariableBool("m_IsTakeable");
9279 RegisterNetSyncVariableBool("m_IsHologram");
9280
9283 {
9286 }
9287
9289
9291 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9293
9294 }
9295
9297 {
9299 }
9300
9302 {
9305 {
9310 }
9311 }
9312
9313 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9314 {
9316 {
9319 }
9320
9322 }
9323
9325 {
9331 }
9332
9334
9336 {
9338
9339 if (!action)
9340 {
9341 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9342 return;
9343 }
9344
9346 if (!ai)
9347 {
9349 return;
9350 }
9351
9353 if (!action_array)
9354 {
9355 action_array = new array<ActionBase_Basic>;
9357 }
9358 if (LogManager.IsActionLogEnable())
9359 {
9360 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9361 }
9362
9363 if (action_array.Find(action) != -1)
9364 {
9365 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9366 }
9367 else
9368 {
9369 action_array.Insert(action);
9370 }
9371 }
9372
9374 {
9376 ActionBase action = player.GetActionManager().GetAction(actionName);
9379
9380 if (action_array)
9381 {
9382 action_array.RemoveItem(action);
9383 }
9384 }
9385
9386
9387
9389 {
9390 ActionOverrideData overrideData = new ActionOverrideData();
9394
9396 if (!actionMap)
9397 {
9400 }
9401
9402 actionMap.Insert(this.
Type(), overrideData);
9403
9404 }
9405
9407
9409
9410
9412 {
9415
9418
9419 string config_to_search = "CfgVehicles";
9420 string muzzle_owner_config;
9421
9423 {
9424 if (IsInherited(Weapon))
9425 config_to_search = "CfgWeapons";
9426
9427 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9428
9429 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9430
9432
9433 if (config_OnFire_subclass_count > 0)
9434 {
9435 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9436
9437 for (int i = 0; i < config_OnFire_subclass_count; i++)
9438 {
9439 string particle_class = "";
9441 string config_OnFire_entry = config_OnFire_class + particle_class;
9442 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9443 WPOF_array.Insert(WPOF);
9444 }
9445
9446
9448 }
9449 }
9450
9452 {
9453 config_to_search = "CfgWeapons";
9454 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9455
9456 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9457
9459
9460 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9461 {
9462 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9463
9464 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9465 {
9466 string particle_class2 = "";
9468 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9469 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9470 WPOBE_array.Insert(WPOBE);
9471 }
9472
9473
9475 }
9476 }
9477 }
9478
9479
9481 {
9484
9486 {
9487 string config_to_search = "CfgVehicles";
9488
9489 if (IsInherited(Weapon))
9490 config_to_search = "CfgWeapons";
9491
9492 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9493 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9494
9495 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9496 {
9497
9499
9501 {
9503 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9505 return;
9506 }
9507
9510
9511
9512
9514 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9515
9516 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9517 {
9518 string particle_class = "";
9520 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9522
9523 if (entry_type == CT_CLASS)
9524 {
9525 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9526 WPOOH_array.Insert(WPOF);
9527 }
9528 }
9529
9530
9532 }
9533 }
9534 }
9535
9537 {
9539 }
9540
9542 {
9544 {
9546
9549
9552
9553 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9554 }
9555 }
9556
9558 {
9560 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9561
9563 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9564
9566 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9567
9569 {
9571 }
9572 }
9573
9575 {
9577 }
9578
9580 {
9583 else
9585
9587 {
9590 }
9591 else
9592 {
9595
9598 }
9599
9601 }
9602
9604 {
9606 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9607 }
9608
9610 {
9612 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9614 }
9615
9617 {
9619 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9620 }
9621
9623 {
9626
9627 OverheatingParticle OP = new OverheatingParticle();
9632
9634 }
9635
9637 {
9640
9641 return -1;
9642 }
9643
9645 {
9647 {
9650
9651 for (int i = count; i > 0; --i)
9652 {
9653 int id = i - 1;
9656
9659
9660 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9661 {
9662 if (p)
9663 {
9666 }
9667 }
9668 }
9669 }
9670 }
9671
9673 {
9675 {
9677 {
9678 int id = i - 1;
9680
9681 if (OP)
9682 {
9684
9685 if (p)
9686 {
9688 }
9689
9690 delete OP;
9691 }
9692 }
9693
9696 }
9697 }
9698
9701 {
9702 return 0.0;
9703 }
9704
9705
9707 {
9708 return 250;
9709 }
9710
9712 {
9713 return 0;
9714 }
9715
9718 {
9720 return true;
9721
9722 return false;
9723 }
9724
9727 {
9730
9732 {
9734 }
9735 else
9736 {
9737
9739 }
9740
9742 }
9743
9750 {
9751 return -1;
9752 }
9753
9754
9755
9756
9758 {
9760 {
9762 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9763
9764 if (r_index >= 0)
9765 {
9766 InventoryLocation r_il = new InventoryLocation;
9767 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9768
9769 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9772 {
9773 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9774 }
9776 {
9777 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9778 }
9779
9780 }
9781
9782 player.GetHumanInventory().ClearUserReservedLocation(this);
9783 }
9784
9787 }
9788
9789
9790
9791
9793 {
9794 return ItemBase.m_DebugActionsMask;
9795 }
9796
9798 {
9799 return ItemBase.m_DebugActionsMask & mask;
9800 }
9801
9803 {
9804 ItemBase.m_DebugActionsMask = mask;
9805 }
9806
9808 {
9809 ItemBase.m_DebugActionsMask |= mask;
9810 }
9811
9813 {
9814 ItemBase.m_DebugActionsMask &= ~mask;
9815 }
9816
9818 {
9820 {
9822 }
9823 else
9824 {
9826 }
9827 }
9828
9829
9831 {
9832 if (GetEconomyProfile())
9833 {
9834 float q_max = GetEconomyProfile().GetQuantityMax();
9835 if (q_max > 0)
9836 {
9837 float q_min = GetEconomyProfile().GetQuantityMin();
9838 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9839
9841 {
9842 ComponentEnergyManager comp = GetCompEM();
9844 {
9846 }
9847 }
9849 {
9851
9852 }
9853
9854 }
9855 }
9856 }
9857
9860 {
9861 EntityAI parent = GetHierarchyParent();
9862
9863 if (parent)
9864 {
9865 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9866 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9867 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9868 }
9869 }
9870
9873 {
9874 EntityAI parent = GetHierarchyParent();
9875
9876 if (parent)
9877 {
9878 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9879 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9880 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9881 }
9882 }
9883
9885 {
9886
9887
9888
9889
9891
9893 {
9894 if (ScriptInputUserData.CanStoreInputUserData())
9895 {
9896 ScriptInputUserData ctx = new ScriptInputUserData;
9902 ctx.
Write(use_stack_max);
9905
9907 {
9908 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9909 }
9910 }
9911 }
9912 else if (!
GetGame().IsMultiplayer())
9913 {
9915 }
9916 }
9917
9919 {
9921 }
9922
9924 {
9926 }
9927
9929 {
9931 }
9932
9934 {
9935
9936 return false;
9937 }
9938
9940 {
9941 return false;
9942 }
9943
9947 {
9948 return false;
9949 }
9950
9952 {
9953 return "";
9954 }
9955
9957
9959 {
9960 return false;
9961 }
9962
9964 {
9965 return true;
9966 }
9967
9968
9969
9971 {
9972 return true;
9973 }
9974
9976 {
9977 return true;
9978 }
9979
9981 {
9982 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9984 }
9985
9987 {
9989 }
9990
9992 {
9994 if (!is_being_placed)
9996 SetSynchDirty();
9997 }
9998
9999
10001
10003 {
10005 }
10006
10008 {
10010 }
10011
10013 {
10014 return 1;
10015 }
10016
10018 {
10019 return false;
10020 }
10021
10023 {
10025 SetSynchDirty();
10026 }
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10063 {
10064 super.OnMovedInsideCargo(container);
10065
10066 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10067 }
10068
10069 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10070 {
10071 super.EEItemLocationChanged(oldLoc,newLoc);
10072
10073 PlayerBase new_player = null;
10074 PlayerBase old_player = null;
10075
10076 if (newLoc.GetParent())
10077 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10078
10079 if (oldLoc.GetParent())
10080 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10081
10083 {
10084 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10085
10086 if (r_index >= 0)
10087 {
10088 InventoryLocation r_il = new InventoryLocation;
10089 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10090
10091 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10094 {
10095 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10096 }
10098 {
10099 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10100 }
10101
10102 }
10103 }
10104
10106 {
10107 if (new_player)
10108 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10109
10110 if (new_player == old_player)
10111 {
10112
10113 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10114 {
10116 {
10117 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10118 {
10119 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10120 }
10121 }
10122 else
10123 {
10124 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10125 }
10126 }
10127
10128 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10129 {
10130 int type = oldLoc.GetType();
10132 {
10133 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10134 }
10136 {
10137 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10138 }
10139 }
10140 if (!m_OldLocation)
10141 {
10142 m_OldLocation = new InventoryLocation;
10143 }
10144 m_OldLocation.Copy(oldLoc);
10145 }
10146 else
10147 {
10148 if (m_OldLocation)
10149 {
10150 m_OldLocation.Reset();
10151 }
10152 }
10153
10155 }
10156 else
10157 {
10158 if (new_player)
10159 {
10160 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10161 if (res_index >= 0)
10162 {
10163 InventoryLocation il = new InventoryLocation;
10164 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10166 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10169 {
10170 il.
GetParent().GetOnReleaseLock().Invoke(it);
10171 }
10173 {
10175 }
10176
10177 }
10178 }
10180 {
10181
10183 }
10184
10185 if (m_OldLocation)
10186 {
10187 m_OldLocation.Reset();
10188 }
10189 }
10190 }
10191
10192 override void EOnContact(IEntity other, Contact extra)
10193 {
10195 {
10196 int liquidType = -1;
10198 if (impactSpeed > 0.0)
10199 {
10201 #ifndef SERVER
10203 #else
10205 SetSynchDirty();
10206 #endif
10208 }
10209 }
10210
10211 #ifdef SERVER
10212 if (GetCompEM() && GetCompEM().IsPlugged())
10213 {
10214 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10215 GetCompEM().UnplugThis();
10216 }
10217 #endif
10218 }
10219
10221
10223 {
10225 }
10226
10228 {
10229
10230 }
10231
10233 {
10234 super.OnItemLocationChanged(old_owner, new_owner);
10235
10236 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10237 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10238
10239 if (!relatedPlayer && playerNew)
10240 relatedPlayer = playerNew;
10241
10242 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10243 {
10245 if (actionMgr)
10246 {
10247 ActionBase currentAction = actionMgr.GetRunningAction();
10248 if (currentAction)
10250 }
10251 }
10252
10253 Man ownerPlayerOld = null;
10254 Man ownerPlayerNew = null;
10255
10256 if (old_owner)
10257 {
10258 if (old_owner.
IsMan())
10259 {
10260 ownerPlayerOld = Man.Cast(old_owner);
10261 }
10262 else
10263 {
10264 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10265 }
10266 }
10267 else
10268 {
10270 {
10272
10273 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10274 {
10275 GetCompEM().UnplugThis();
10276 }
10277 }
10278 }
10279
10280 if (new_owner)
10281 {
10282 if (new_owner.
IsMan())
10283 {
10284 ownerPlayerNew = Man.Cast(new_owner);
10285 }
10286 else
10287 {
10288 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10289 }
10290 }
10291
10292 if (ownerPlayerOld != ownerPlayerNew)
10293 {
10294 if (ownerPlayerOld)
10295 {
10296 array<EntityAI> subItemsExit = new array<EntityAI>;
10298 for (int i = 0; i < subItemsExit.Count(); i++)
10299 {
10302 }
10303 }
10304
10305 if (ownerPlayerNew)
10306 {
10307 array<EntityAI> subItemsEnter = new array<EntityAI>;
10309 for (int j = 0; j < subItemsEnter.Count(); j++)
10310 {
10313 }
10314 }
10315 }
10316 else if (ownerPlayerNew != null)
10317 {
10318 PlayerBase nplayer;
10319 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10320 {
10321 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10323 for (int k = 0; k < subItemsUpdate.Count(); k++)
10324 {
10326 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10327 }
10328 }
10329 }
10330
10331 if (old_owner)
10332 old_owner.OnChildItemRemoved(this);
10333 if (new_owner)
10334 new_owner.OnChildItemReceived(this);
10335 }
10336
10337
10339 {
10340 super.EEDelete(parent);
10341 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10342 if (player)
10343 {
10345
10346 if (player.IsAlive())
10347 {
10348 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10349 if (r_index >= 0)
10350 {
10351 InventoryLocation r_il = new InventoryLocation;
10352 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10353
10354 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10357 {
10358 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10359 }
10361 {
10362 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10363 }
10364
10365 }
10366
10367 player.RemoveQuickBarEntityShortcut(this);
10368 }
10369 }
10370 }
10371
10373 {
10374 super.EEKilled(killer);
10375
10378 {
10379 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10380 {
10381 if (IsMagazine())
10382 {
10383 if (Magazine.Cast(this).GetAmmoCount() > 0)
10384 {
10386 }
10387 }
10388 else
10389 {
10391 }
10392 }
10393 }
10394 }
10395
10397 {
10398 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10399
10400 super.OnWasAttached(parent, slot_id);
10401
10404
10406 }
10407
10409 {
10410 super.OnWasDetached(parent, slot_id);
10411
10414 }
10415
10417 {
10418 int idx;
10421
10422 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10423 if (inventory_slots.Count() < 1)
10424 {
10425 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10426 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10427 }
10428 else
10429 {
10430 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10431 }
10432
10433 idx = inventory_slots.Find(slot);
10434 if (idx < 0)
10435 return "";
10436
10437 return attach_types.Get(idx);
10438 }
10439
10441 {
10442 int idx = -1;
10443 string slot;
10444
10447
10448 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10449 if (inventory_slots.Count() < 1)
10450 {
10451 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10452 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10453 }
10454 else
10455 {
10456 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10457 if (detach_types.Count() < 1)
10458 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10459 }
10460
10461 for (int i = 0; i < inventory_slots.Count(); i++)
10462 {
10463 slot = inventory_slots.Get(i);
10464 }
10465
10466 if (slot != "")
10467 {
10468 if (detach_types.Count() == 1)
10469 idx = 0;
10470 else
10471 idx = inventory_slots.Find(slot);
10472 }
10473 if (idx < 0)
10474 return "";
10475
10476 return detach_types.Get(idx);
10477 }
10478
10480 {
10481
10483
10484
10485 float min_time = 1;
10486 float max_time = 3;
10487 float delay = Math.RandomFloat(min_time, max_time);
10488
10489 explode_timer.Run(delay, this, "DoAmmoExplosion");
10490 }
10491
10493 {
10494 Magazine magazine = Magazine.Cast(this);
10495 int pop_sounds_count = 6;
10496 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10497
10498
10499 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10500 string sound_name = pop_sounds[ sound_idx ];
10502
10503
10504 magazine.ServerAddAmmoCount(-1);
10505
10506
10507 float min_temp_to_explode = 100;
10508
10509 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10510 {
10512 }
10513 }
10514
10515
10516 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10517 {
10518 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10519
10520 const int CHANCE_DAMAGE_CARGO = 4;
10521 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10522 const int CHANCE_DAMAGE_NOTHING = 2;
10523
10525 {
10526 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10527 int chances;
10528 int rnd;
10529
10530 if (GetInventory().GetCargo())
10531 {
10532 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10533 rnd = Math.RandomInt(0,chances);
10534
10535 if (rnd < CHANCE_DAMAGE_CARGO)
10536 {
10538 }
10539 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10540 {
10542 }
10543 }
10544 else
10545 {
10546 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10547 rnd = Math.RandomInt(0,chances);
10548
10549 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10550 {
10552 }
10553 }
10554 }
10555 }
10556
10558 {
10559 if (GetInventory().GetCargo())
10560 {
10561 int item_count = GetInventory().GetCargo().GetItemCount();
10562 if (item_count > 0)
10563 {
10564 int random_pick = Math.RandomInt(0, item_count);
10566 if (!item.IsExplosive())
10567 {
10568 item.AddHealth("","",damage);
10569 return true;
10570 }
10571 }
10572 }
10573 return false;
10574 }
10575
10577 {
10578 int attachment_count = GetInventory().AttachmentCount();
10579 if (attachment_count > 0)
10580 {
10581 int random_pick = Math.RandomInt(0, attachment_count);
10582 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10583 if (!attachment.IsExplosive())
10584 {
10585 attachment.AddHealth("","",damage);
10586 return true;
10587 }
10588 }
10589 return false;
10590 }
10591
10593 {
10595 }
10596
10598 {
10600 return GetInventory().CanRemoveEntity();
10601
10602 return false;
10603 }
10604
10606 {
10608 return;
10609
10611 {
10612 if (ScriptInputUserData.CanStoreInputUserData())
10613 {
10614 ScriptInputUserData ctx = new ScriptInputUserData;
10619 ctx.
Write(destination_entity);
10621 ctx.
Write(slot_id);
10623 }
10624 }
10625 else if (!
GetGame().IsMultiplayer())
10626 {
10628 }
10629 }
10630
10632 {
10634 return;
10635
10636 float split_quantity_new;
10640 InventoryLocation loc = new InventoryLocation;
10641
10642 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10643 {
10645 split_quantity_new = stack_max;
10646 else
10648
10649 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10650 if (new_item)
10651 {
10652 new_item.SetResultOfSplit(true);
10653 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10655 new_item.SetQuantity(split_quantity_new);
10656 }
10657 }
10658 else if (destination_entity && slot_id == -1)
10659 {
10660 if (quantity > stack_max)
10661 split_quantity_new = stack_max;
10662 else
10663 split_quantity_new = quantity;
10664
10666 {
10669 }
10670
10671 if (new_item)
10672 {
10673 new_item.SetResultOfSplit(true);
10674 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10676 new_item.SetQuantity(split_quantity_new);
10677 }
10678 }
10679 else
10680 {
10681 if (stack_max != 0)
10682 {
10684 {
10686 }
10687
10688 if (split_quantity_new == 0)
10689 {
10690 if (!
GetGame().IsMultiplayer())
10691 player.PhysicalPredictiveDropItem(this);
10692 else
10693 player.ServerDropEntity(this);
10694 return;
10695 }
10696
10698
10699 if (new_item)
10700 {
10701 new_item.SetResultOfSplit(true);
10702 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10704 new_item.SetQuantity(stack_max);
10705 new_item.PlaceOnSurface();
10706 }
10707 }
10708 }
10709 }
10710
10712 {
10714 return;
10715
10716 float split_quantity_new;
10720 InventoryLocation loc = new InventoryLocation;
10721
10722 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10723 {
10725 split_quantity_new = stack_max;
10726 else
10728
10729 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10730 if (new_item)
10731 {
10732 new_item.SetResultOfSplit(true);
10733 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10735 new_item.SetQuantity(split_quantity_new);
10736 }
10737 }
10738 else if (destination_entity && slot_id == -1)
10739 {
10740 if (quantity > stack_max)
10741 split_quantity_new = stack_max;
10742 else
10743 split_quantity_new = quantity;
10744
10746 {
10749 }
10750
10751 if (new_item)
10752 {
10753 new_item.SetResultOfSplit(true);
10754 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10756 new_item.SetQuantity(split_quantity_new);
10757 }
10758 }
10759 else
10760 {
10761 if (stack_max != 0)
10762 {
10764 {
10766 }
10767
10769
10770 if (new_item)
10771 {
10772 new_item.SetResultOfSplit(true);
10773 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10775 new_item.SetQuantity(stack_max);
10776 new_item.PlaceOnSurface();
10777 }
10778 }
10779 }
10780 }
10781
10783 {
10785 return;
10786
10788 {
10789 if (ScriptInputUserData.CanStoreInputUserData())
10790 {
10791 ScriptInputUserData ctx = new ScriptInputUserData;
10796 dst.WriteToContext(ctx);
10798 }
10799 }
10800 else if (!
GetGame().IsMultiplayer())
10801 {
10803 }
10804 }
10805
10807 {
10809 return;
10810
10812 {
10813 if (ScriptInputUserData.CanStoreInputUserData())
10814 {
10815 ScriptInputUserData ctx = new ScriptInputUserData;
10820 ctx.
Write(destination_entity);
10826 }
10827 }
10828 else if (!
GetGame().IsMultiplayer())
10829 {
10831 }
10832 }
10833
10835 {
10837 }
10838
10840 {
10842 return this;
10843
10845 float split_quantity_new;
10847 if (dst.IsValid())
10848 {
10849 int slot_id = dst.GetSlot();
10851
10852 if (quantity > stack_max)
10853 split_quantity_new = stack_max;
10854 else
10855 split_quantity_new = quantity;
10856
10858
10859 if (new_item)
10860 {
10861 new_item.SetResultOfSplit(true);
10862 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10865 }
10866
10867 return new_item;
10868 }
10869
10870 return null;
10871 }
10872
10874 {
10876 return;
10877
10879 float split_quantity_new;
10881 if (destination_entity)
10882 {
10884 if (quantity > stackable)
10885 split_quantity_new = stackable;
10886 else
10887 split_quantity_new = quantity;
10888
10889 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10890 if (new_item)
10891 {
10892 new_item.SetResultOfSplit(true);
10893 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10895 new_item.SetQuantity(split_quantity_new);
10896 }
10897 }
10898 }
10899
10901 {
10903 return;
10904
10906 {
10907 if (ScriptInputUserData.CanStoreInputUserData())
10908 {
10909 ScriptInputUserData ctx = new ScriptInputUserData;
10914 ItemBase destination_entity =
this;
10915 ctx.
Write(destination_entity);
10919 }
10920 }
10921 else if (!
GetGame().IsMultiplayer())
10922 {
10924 }
10925 }
10926
10928 {
10930 return;
10931
10933 float split_quantity_new;
10935 if (player)
10936 {
10938 if (quantity > stackable)
10939 split_quantity_new = stackable;
10940 else
10941 split_quantity_new = quantity;
10942
10943 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10944 new_item =
ItemBase.Cast(in_hands);
10945 if (new_item)
10946 {
10947 new_item.SetResultOfSplit(true);
10948 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10950 new_item.SetQuantity(split_quantity_new);
10951 }
10952 }
10953 }
10954
10956 {
10958 return;
10959
10961 float split_quantity_new = Math.Floor(quantity * 0.5);
10962
10964
10965 if (new_item)
10966 {
10967 if (new_item.GetQuantityMax() < split_quantity_new)
10968 {
10969 split_quantity_new = new_item.GetQuantityMax();
10970 }
10971
10972 new_item.SetResultOfSplit(true);
10973 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10974
10976 {
10979 }
10980 else
10981 {
10984 }
10985 }
10986 }
10987
10989 {
10991 return;
10992
10994 float split_quantity_new = Math.Floor(quantity / 2);
10995
10996 InventoryLocation invloc = new InventoryLocation;
10998
11000 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11001
11002 if (new_item)
11003 {
11004 if (new_item.GetQuantityMax() < split_quantity_new)
11005 {
11006 split_quantity_new = new_item.GetQuantityMax();
11007 }
11009 {
11012 }
11013 else
11014 {
11017 }
11018 }
11019 }
11020
11023 {
11024 SetWeightDirty();
11026
11027 if (parent)
11028 parent.OnAttachmentQuantityChangedEx(this, delta);
11029
11031 {
11033 {
11035 }
11037 {
11038 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11040 }
11041 }
11042
11043 }
11044
11047 {
11048
11049 }
11050
11053 {
11055 }
11056
11058 {
11059 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11060
11062 {
11063 if (newLevel == GameConstants.STATE_RUINED)
11064 {
11066 EntityAI parent = GetHierarchyParent();
11067 if (parent && parent.IsFireplace())
11068 {
11069 CargoBase cargo = GetInventory().GetCargo();
11070 if (cargo)
11071 {
11073 {
11075 }
11076 }
11077 }
11078 }
11079
11081 {
11082
11084 return;
11085 }
11086
11087 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11088 {
11090 }
11091 }
11092 }
11093
11094
11096 {
11097 super.OnRightClick();
11098
11100 {
11102 {
11103 if (ScriptInputUserData.CanStoreInputUserData())
11104 {
11105 vector m4[4];
11107
11108 EntityAI root = GetHierarchyRoot();
11109
11110 InventoryLocation dst = new InventoryLocation;
11112 {
11113 if (root)
11114 {
11115 root.GetTransform(m4);
11117 }
11118 else
11119 GetInventory().GetCurrentInventoryLocation(dst);
11120 }
11121 else
11122 {
11124
11125
11126 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11127 {
11128 if (root)
11129 {
11130 root.GetTransform(m4);
11132 }
11133 else
11134 GetInventory().GetCurrentInventoryLocation(dst);
11135 }
11136 else
11137 {
11138 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11139 }
11140 }
11141
11142 ScriptInputUserData ctx = new ScriptInputUserData;
11150 }
11151 }
11152 else if (!
GetGame().IsMultiplayer())
11153 {
11155 }
11156 }
11157 }
11158
11159 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11160 {
11161
11162 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11163 return false;
11164
11165 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11166 return false;
11167
11168
11170 return false;
11171
11172
11173 Magazine mag = Magazine.Cast(this);
11174 if (mag)
11175 {
11176 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11177 return false;
11178
11179 if (stack_max_limit)
11180 {
11181 Magazine other_mag = Magazine.Cast(other_item);
11182 if (other_item)
11183 {
11184 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11185 return false;
11186 }
11187
11188 }
11189 }
11190 else
11191 {
11192
11194 return false;
11195
11197 return false;
11198 }
11199
11200 PlayerBase player = null;
11201 if (CastTo(player, GetHierarchyRootPlayer()))
11202 {
11203 if (player.GetInventory().HasAttachment(this))
11204 return false;
11205
11206 if (player.IsItemsToDelete())
11207 return false;
11208 }
11209
11210 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11211 return false;
11212
11213 int slotID;
11215 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11216 return false;
11217
11218 return true;
11219 }
11220
11222 {
11224 }
11225
11227 {
11228 return m_IsResultOfSplit;
11229 }
11230
11232 {
11233 m_IsResultOfSplit = value;
11234 }
11235
11237 {
11239 }
11240
11242 {
11243 float other_item_quantity = other_item.GetQuantity();
11244 float this_free_space;
11245
11247
11249
11250 if (other_item_quantity > this_free_space)
11251 {
11252 return this_free_space;
11253 }
11254 else
11255 {
11256 return other_item_quantity;
11257 }
11258 }
11259
11261 {
11263 }
11264
11266 {
11268 return;
11269
11270 if (!IsMagazine() && other_item)
11271 {
11273 if (quantity_used != 0)
11274 {
11275 float hp1 = GetHealth01("","");
11276 float hp2 = other_item.GetHealth01("","");
11277 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11278 hpResult = hpResult / (
GetQuantity() + quantity_used);
11279
11280 hpResult *= GetMaxHealth();
11281 Math.Round(hpResult);
11282 SetHealth("", "Health", hpResult);
11283
11285 other_item.AddQuantity(-quantity_used);
11286 }
11287 }
11289 }
11290
11292 {
11293 #ifdef SERVER
11294 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11295 GetHierarchyParent().IncreaseLifetimeUp();
11296 #endif
11297 };
11298
11300 {
11301 PlayerBase p = PlayerBase.Cast(player);
11302
11303 array<int> recipesIds = p.m_Recipes;
11304 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11305 if (moduleRecipesManager)
11306 {
11307 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11308 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11309 }
11310
11311 for (int i = 0;i < recipesIds.Count(); i++)
11312 {
11313 int key = recipesIds.Get(i);
11314 string recipeName = moduleRecipesManager.GetRecipeName(key);
11316 }
11317 }
11318
11319
11320 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11321 {
11322 super.GetDebugActions(outputList);
11323
11324
11329
11330
11334
11338
11339
11342
11343
11345 {
11348 }
11349
11351
11354
11358 }
11359
11360
11361
11362
11364 {
11365 super.OnAction(action_id, player, ctx);
11366 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11367 {
11368 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11369 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11370 PlayerBase p = PlayerBase.Cast(player);
11371 if (
EActions.RECIPES_RANGE_START < 1000)
11372 {
11373 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11374 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11375 }
11376 }
11377 #ifndef SERVER
11378 else if (action_id ==
EActions.WATCH_PLAYER)
11379 {
11380 PluginDeveloper.SetDeveloperItemClientEx(player);
11381 }
11382 #endif
11384 {
11385 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11386 {
11387 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11388 OnDebugButtonPressServer(id + 1);
11389 }
11390
11391 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11392 {
11393 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11395 }
11396
11397 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11398 {
11399 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11401 }
11402
11403 else if (action_id ==
EActions.ADD_QUANTITY)
11404 {
11405 if (IsMagazine())
11406 {
11407 Magazine mag = Magazine.Cast(this);
11408 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11409 }
11410 else
11411 {
11413 }
11414
11415 if (m_EM)
11416 {
11417 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11418 }
11419
11420 }
11421
11422 else if (action_id ==
EActions.REMOVE_QUANTITY)
11423 {
11424 if (IsMagazine())
11425 {
11426 Magazine mag2 = Magazine.Cast(this);
11427 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11428 }
11429 else
11430 {
11432 }
11433 if (m_EM)
11434 {
11435 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11436 }
11437
11438 }
11439
11440 else if (action_id ==
EActions.SET_QUANTITY_0)
11441 {
11443
11444 if (m_EM)
11445 {
11446 m_EM.SetEnergy(0);
11447 }
11448 }
11449
11450 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11451 {
11453
11454 if (m_EM)
11455 {
11456 m_EM.SetEnergy(m_EM.GetEnergyMax());
11457 }
11458 }
11459
11460 else if (action_id ==
EActions.ADD_HEALTH)
11461 {
11462 AddHealth("","",GetMaxHealth("","Health")/5);
11463 }
11464 else if (action_id ==
EActions.REMOVE_HEALTH)
11465 {
11466 AddHealth("","",-GetMaxHealth("","Health")/5);
11467 }
11468 else if (action_id ==
EActions.DESTROY_HEALTH)
11469 {
11470 SetHealth01("","",0);
11471 }
11472 else if (action_id ==
EActions.WATCH_ITEM)
11473 {
11475 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11476 #ifdef DEVELOPER
11477 SetDebugDeveloper_item(this);
11478 #endif
11479 }
11480
11481 else if (action_id ==
EActions.ADD_TEMPERATURE)
11482 {
11483 AddTemperature(20);
11484
11485 }
11486
11487 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11488 {
11489 AddTemperature(-20);
11490
11491 }
11492
11493 else if (action_id ==
EActions.FLIP_FROZEN)
11494 {
11495 SetFrozen(!GetIsFrozen());
11496
11497 }
11498
11499 else if (action_id ==
EActions.ADD_WETNESS)
11500 {
11502
11503 }
11504
11505 else if (action_id ==
EActions.REMOVE_WETNESS)
11506 {
11508
11509 }
11510
11511 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11512 {
11515
11516
11517 }
11518
11519 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11520 {
11523 }
11524
11525 else if (action_id ==
EActions.MAKE_SPECIAL)
11526 {
11527 auto debugParams = DebugSpawnParams.WithPlayer(player);
11528 OnDebugSpawnEx(debugParams);
11529 }
11530
11531 else if (action_id ==
EActions.DELETE)
11532 {
11533 Delete();
11534 }
11535
11536 }
11537
11538
11539 return false;
11540 }
11541
11542
11543
11544
11548
11551
11552
11553
11555 {
11556 return false;
11557 }
11558
11559
11561 {
11562 return true;
11563 }
11564
11565
11567 {
11568 return true;
11569 }
11570
11571
11572
11574 {
11575 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11577 }
11578
11581 {
11582 return null;
11583 }
11584
11586 {
11587 return false;
11588 }
11589
11591 {
11592 return false;
11593 }
11594
11598
11599
11601 {
11602 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11603 return module_repairing.CanRepair(this, item_repair_kit);
11604 }
11605
11606
11607 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11608 {
11609 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11610 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11611 }
11612
11613
11615 {
11616
11617
11618
11619
11620
11621
11622
11623
11624 return 1;
11625 }
11626
11627
11628
11630 {
11632 }
11633
11634
11635
11637 {
11639 }
11640
11641
11650 {
11651 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11652
11653 if (player)
11654 {
11655 player.MessageStatus(text);
11656 }
11657 }
11658
11659
11668 {
11669 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11670
11671 if (player)
11672 {
11673 player.MessageAction(text);
11674 }
11675 }
11676
11677
11686 {
11687 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11688
11689 if (player)
11690 {
11691 player.MessageFriendly(text);
11692 }
11693 }
11694
11695
11704 {
11705 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11706
11707 if (player)
11708 {
11709 player.MessageImportant(text);
11710 }
11711 }
11712
11714 {
11715 return true;
11716 }
11717
11718
11719 override bool KindOf(
string tag)
11720 {
11721 bool found = false;
11722 string item_name = this.
GetType();
11725
11726 int array_size = item_tag_array.Count();
11727 for (int i = 0; i < array_size; i++)
11728 {
11729 if (item_tag_array.Get(i) == tag)
11730 {
11731 found = true;
11732 break;
11733 }
11734 }
11735 return found;
11736 }
11737
11738
11740 {
11741
11742 super.OnRPC(sender, rpc_type,ctx);
11743
11744
11745 switch (rpc_type)
11746 {
11747 #ifndef SERVER
11748 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11749 Param2<bool, string> p = new Param2<bool, string>(false, "");
11750
11752 return;
11753
11754 bool play = p.param1;
11755 string soundSet = p.param2;
11756
11757 if (play)
11758 {
11760 {
11762 {
11764 }
11765 }
11766 else
11767 {
11769 }
11770 }
11771 else
11772 {
11774 }
11775
11776 break;
11777 #endif
11778
11779 }
11780
11782 {
11784 }
11785 }
11786
11787
11788
11789
11791 {
11792 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11793 return plugin.GetID(
name);
11794 }
11795
11797 {
11798 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11799 return plugin.GetName(id);
11800 }
11801
11804 {
11805
11806
11807 int varFlags;
11808 if (!ctx.
Read(varFlags))
11809 return;
11810
11811 if (varFlags & ItemVariableFlags.FLOAT)
11812 {
11814 }
11815 }
11816
11818 {
11819
11820 super.SerializeNumericalVars(floats_out);
11821
11822
11823
11825 {
11827 }
11828
11830 {
11832 }
11833
11835 {
11837 }
11838
11840 {
11845 }
11846
11848 {
11850 }
11851 }
11852
11854 {
11855
11856 super.DeSerializeNumericalVars(floats);
11857
11858
11859 int index = 0;
11860 int mask = Math.Round(floats.Get(index));
11861
11862 index++;
11863
11865 {
11867 {
11869 }
11870 else
11871 {
11872 float quantity = floats.Get(index);
11873 SetQuantity(quantity,
true,
false,
false,
false);
11874 }
11875 index++;
11876 }
11877
11879 {
11880 float wet = floats.Get(index);
11882 index++;
11883 }
11884
11886 {
11887 int liquidtype = Math.Round(floats.Get(index));
11889 index++;
11890 }
11891
11893 {
11895 index++;
11897 index++;
11899 index++;
11901 index++;
11902 }
11903
11905 {
11906 int cleanness = Math.Round(floats.Get(index));
11908 index++;
11909 }
11910 }
11911
11913 {
11914 super.WriteVarsToCTX(ctx);
11915
11916
11918 {
11920 }
11921
11923 {
11925 }
11926
11928 {
11930 }
11931
11933 {
11934 int r,g,b,a;
11940 }
11941
11943 {
11945 }
11946 }
11947
11949 {
11950 if (!super.ReadVarsFromCTX(ctx,version))
11951 return false;
11952
11953 int intValue;
11954 float value;
11955
11956 if (version < 140)
11957 {
11958 if (!ctx.
Read(intValue))
11959 return false;
11960
11961 m_VariablesMask = intValue;
11962 }
11963
11965 {
11966 if (!ctx.
Read(value))
11967 return false;
11968
11970 {
11972 }
11973 else
11974 {
11976 }
11977 }
11978
11979 if (version < 140)
11980 {
11982 {
11983 if (!ctx.
Read(value))
11984 return false;
11985 SetTemperatureDirect(value);
11986 }
11987 }
11988
11990 {
11991 if (!ctx.
Read(value))
11992 return false;
11994 }
11995
11997 {
11998 if (!ctx.
Read(intValue))
11999 return false;
12001 }
12002
12004 {
12005 int r,g,b,a;
12007 return false;
12009 return false;
12011 return false;
12013 return false;
12014
12016 }
12017
12019 {
12020 if (!ctx.
Read(intValue))
12021 return false;
12023 }
12024
12025 if (version >= 138 && version < 140)
12026 {
12028 {
12029 if (!ctx.
Read(intValue))
12030 return false;
12031 SetFrozen(intValue);
12032 }
12033 }
12034
12035 return true;
12036 }
12037
12038
12040 {
12043 {
12045 }
12046
12047 if (!super.OnStoreLoad(ctx, version))
12048 {
12050 return false;
12051 }
12052
12053 if (version >= 114)
12054 {
12055 bool hasQuickBarIndexSaved;
12056
12057 if (!ctx.
Read(hasQuickBarIndexSaved))
12058 {
12060 return false;
12061 }
12062
12063 if (hasQuickBarIndexSaved)
12064 {
12065 int itmQBIndex;
12066
12067
12068 if (!ctx.
Read(itmQBIndex))
12069 {
12071 return false;
12072 }
12073
12074 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12075 if (itmQBIndex != -1 && parentPlayer)
12076 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12077 }
12078 }
12079 else
12080 {
12081
12082 PlayerBase player;
12083 int itemQBIndex;
12084 if (version ==
int.
MAX)
12085 {
12086 if (!ctx.
Read(itemQBIndex))
12087 {
12089 return false;
12090 }
12091 }
12092 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12093 {
12094
12095 if (!ctx.
Read(itemQBIndex))
12096 {
12098 return false;
12099 }
12100 if (itemQBIndex != -1 && player)
12101 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12102 }
12103 }
12104
12105 if (version < 140)
12106 {
12107
12108 if (!LoadVariables(ctx, version))
12109 {
12111 return false;
12112 }
12113 }
12114
12115
12117 {
12119 return false;
12120 }
12121 if (version >= 132)
12122 {
12124 if (raib)
12125 {
12127 {
12129 return false;
12130 }
12131 }
12132 }
12133
12135 return true;
12136 }
12137
12138
12139
12141 {
12142 super.OnStoreSave(ctx);
12143
12144 PlayerBase player;
12145 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12146 {
12148
12149 int itemQBIndex = -1;
12150 itemQBIndex = player.FindQuickBarEntityIndex(this);
12151 ctx.
Write(itemQBIndex);
12152 }
12153 else
12154 {
12156 }
12157
12159
12161 if (raib)
12162 {
12164 }
12165 }
12166
12167
12169 {
12170 super.AfterStoreLoad();
12171
12173 {
12175 }
12176
12178 {
12181 }
12182 }
12183
12185 {
12186 super.EEOnAfterLoad();
12187
12189 {
12191 }
12192
12195 }
12196
12198 {
12199 return false;
12200 }
12201
12202
12203
12205 {
12207 {
12208 #ifdef PLATFORM_CONSOLE
12209
12211 {
12213 if (menu)
12214 {
12216 }
12217 }
12218 #endif
12219 }
12220
12222 {
12225 }
12226
12228 {
12229 SetWeightDirty();
12231 }
12233 {
12236 }
12237
12239 {
12242 }
12244 {
12247 }
12248
12249 super.OnVariablesSynchronized();
12250 }
12251
12252
12253
12255 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12256 {
12257 if (!IsServerCheck(allow_client))
12258 return false;
12259
12261 return false;
12262
12265
12266 if (value <= (min + 0.001))
12267 value = min;
12268
12269 if (value == min)
12270 {
12271 if (destroy_config)
12272 {
12273 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12274 if (dstr)
12275 {
12277 this.Delete();
12278 return true;
12279 }
12280 }
12281 else if (destroy_forced)
12282 {
12284 this.Delete();
12285 return true;
12286 }
12287
12289 }
12290
12293
12295 {
12297
12298 if (delta)
12300 }
12301
12303
12304 return false;
12305 }
12306
12307
12309 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12310 {
12312 }
12313
12315 {
12318 }
12319
12321 {
12324 }
12325
12328 {
12329 float value_clamped = Math.Clamp(value, 0, 1);
12331 SetQuantity(result, destroy_config, destroy_forced);
12332 }
12333
12334
12337 {
12339 }
12340
12342 {
12344 }
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12356 {
12357 int slot = -1;
12358 if (GetInventory())
12359 {
12360 InventoryLocation il = new InventoryLocation;
12361 GetInventory().GetCurrentInventoryLocation(il);
12363 }
12364
12366 }
12367
12369 {
12370 float quantity_max = 0;
12371
12373 {
12374 if (attSlotID != -1)
12375 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12376
12377 if (quantity_max <= 0)
12379 }
12380
12381 if (quantity_max <= 0)
12383
12384 return quantity_max;
12385 }
12386
12388 {
12390 }
12391
12393 {
12395 }
12396
12397
12399 {
12401 }
12402
12404 {
12406 }
12407
12409 {
12411 }
12412
12413
12415 {
12416
12417 float weightEx = GetWeightEx();
12418 float special = GetInventoryAndCargoWeight();
12419 return weightEx - special;
12420 }
12421
12422
12424 {
12426 }
12427
12429 {
12431 {
12432 #ifdef DEVELOPER
12433 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12434 {
12435 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12437 }
12438 #endif
12439
12440 return GetQuantity() * GetConfigWeightModified();
12441 }
12442 else if (HasEnergyManager())
12443 {
12444 #ifdef DEVELOPER
12445 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12446 {
12447 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12448 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12449 }
12450 #endif
12451 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12452 }
12453 else
12454 {
12455 #ifdef DEVELOPER
12456 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12457 {
12458 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12459 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12460 }
12461 #endif
12462 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12463 }
12464 }
12465
12468 {
12469 int item_count = 0;
12471
12472 if (GetInventory().GetCargo() != NULL)
12473 {
12474 item_count = GetInventory().GetCargo().GetItemCount();
12475 }
12476
12477 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12478 {
12479 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12480 if (item)
12481 item_count += item.GetNumberOfItems();
12482 }
12483 return item_count;
12484 }
12485
12488 {
12489 float weight = 0;
12490 float wetness = 1;
12491 if (include_wetness)
12494 {
12495 weight = wetness * m_ConfigWeight;
12496 }
12498 {
12499 weight = 1;
12500 }
12501 return weight;
12502 }
12503
12504
12505
12507 {
12508 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12509 {
12510 GameInventory inv = GetInventory();
12511 array<EntityAI> items = new array<EntityAI>;
12513 for (int i = 0; i < items.Count(); i++)
12514 {
12516 if (item)
12517 {
12519 }
12520 }
12521 }
12522 }
12523
12524
12525
12526
12528 {
12529 float energy = 0;
12530 if (HasEnergyManager())
12531 {
12532 energy = GetCompEM().GetEnergy();
12533 }
12534 return energy;
12535 }
12536
12537
12539 {
12540 super.OnEnergyConsumed();
12541
12543 }
12544
12546 {
12547 super.OnEnergyAdded();
12548
12550 }
12551
12552
12554 {
12555 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12556 {
12558 {
12559 float energy_0to1 = GetCompEM().GetEnergy0To1();
12561 }
12562 }
12563 }
12564
12565
12567 {
12568 return ConfigGetFloat("heatIsolation");
12569 }
12570
12572 {
12574 }
12575
12577 {
12578 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12579 if (
GetGame().ConfigIsExisting(paramPath))
12581
12582 return 0.0;
12583 }
12584
12586 {
12587 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12588 if (
GetGame().ConfigIsExisting(paramPath))
12590
12591 return 0.0;
12592 }
12593
12594 override void SetWet(
float value,
bool allow_client =
false)
12595 {
12596 if (!IsServerCheck(allow_client))
12597 return;
12598
12601
12603
12604 m_VarWet = Math.Clamp(value, min, max);
12605
12607 {
12610 }
12611 }
12612
12613 override void AddWet(
float value)
12614 {
12616 }
12617
12619 {
12621 }
12622
12624 {
12626 }
12627
12629 {
12631 }
12632
12634 {
12636 }
12637
12639 {
12641 }
12642
12643 override void OnWetChanged(
float newVal,
float oldVal)
12644 {
12647 if (newLevel != oldLevel)
12648 {
12650 }
12651 }
12652
12654 {
12655 SetWeightDirty();
12656 }
12657
12659 {
12660 return GetWetLevelInternal(
m_VarWet);
12661 }
12662
12663
12664
12666 {
12668 }
12669
12671 {
12673 }
12674
12676 {
12678 }
12679
12681 {
12683 }
12684
12685
12686
12688 {
12689 if (ConfigIsExisting("itemModelLength"))
12690 {
12691 return ConfigGetFloat("itemModelLength");
12692 }
12693 return 0;
12694 }
12695
12697 {
12698 if (ConfigIsExisting("itemAttachOffset"))
12699 {
12700 return ConfigGetFloat("itemAttachOffset");
12701 }
12702 return 0;
12703 }
12704
12705 override void SetCleanness(
int value,
bool allow_client =
false)
12706 {
12707 if (!IsServerCheck(allow_client))
12708 return;
12709
12711
12713
12716 }
12717
12719 {
12721 }
12722
12724 {
12725 return true;
12726 }
12727
12728
12729
12730
12732 {
12734 }
12735
12737 {
12739 }
12740
12741
12742
12743
12744 override void SetColor(
int r,
int g,
int b,
int a)
12745 {
12751 }
12753 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12754 {
12759 }
12760
12762 {
12764 }
12765
12768 {
12769 int r,g,b,a;
12771 r = r/255;
12772 g = g/255;
12773 b = b/255;
12774 a = a/255;
12775 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12776 }
12777
12778
12779
12780 override void SetLiquidType(
int value,
bool allow_client =
false)
12781 {
12782 if (!IsServerCheck(allow_client))
12783 return;
12784
12789 }
12790
12792 {
12793 return ConfigGetInt("varLiquidTypeInit");
12794 }
12795
12797 {
12799 }
12800
12802 {
12804 SetFrozen(false);
12805 }
12806
12809 {
12810 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12811 }
12812
12813
12816 {
12817 PlayerBase nplayer;
12818 if (PlayerBase.CastTo(nplayer, player))
12819 {
12821
12822 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12823 }
12824 }
12825
12826
12829 {
12830 PlayerBase nplayer;
12831 if (PlayerBase.CastTo(nplayer,player))
12832 {
12833
12834 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12835
12836 }
12837
12838
12839 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12840
12841
12842 if (HasEnergyManager())
12843 {
12844 GetCompEM().UpdatePlugState();
12845 }
12846 }
12847
12848
12850 {
12851 super.OnPlacementStarted(player);
12852
12854 }
12855
12856 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12857 {
12859 {
12860 m_AdminLog.OnPlacementComplete(player,
this);
12861 }
12862
12863 super.OnPlacementComplete(player, position, orientation);
12864 }
12865
12866
12867
12868
12869
12871 {
12873 {
12874 return true;
12875 }
12876 else
12877 {
12878 return false;
12879 }
12880 }
12881
12882
12884 {
12886 {
12888 }
12889 }
12890
12891
12893 {
12895 }
12896
12898 {
12900 }
12901
12902 override void InsertAgent(
int agent,
float count = 1)
12903 {
12904 if (count < 1)
12905 return;
12906
12908 }
12909
12912 {
12914 }
12915
12916
12918 {
12920 }
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12964 {
12966 return false;
12967 return true;
12968 }
12969
12971 {
12972
12974 }
12975
12976
12979 {
12980 super.CheckForRoofLimited(timeTresholdMS);
12981
12983 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12984 {
12985 m_PreviousRoofTestTime = time;
12986 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12987 }
12988 }
12989
12990
12992 {
12994 {
12995 return 0;
12996 }
12997
12998 if (GetInventory().GetAttachmentSlotsCount() != 0)
12999 {
13000 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13001 if (filter)
13002 return filter.GetProtectionLevel(type, false, system);
13003 else
13004 return 0;
13005 }
13006
13007 string subclassPath, entryName;
13008
13009 switch (type)
13010 {
13012 entryName = "biological";
13013 break;
13015 entryName = "chemical";
13016 break;
13017 default:
13018 entryName = "biological";
13019 break;
13020 }
13021
13022 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13023
13025 }
13026
13027
13028
13031 {
13032 if (!IsMagazine())
13034
13036 }
13037
13038
13039
13040
13041
13046 {
13047 return true;
13048 }
13049
13051 {
13053 }
13054
13055
13056
13057
13058
13060 {
13061 if (parent)
13062 {
13063 if (parent.IsInherited(DayZInfected))
13064 return true;
13065
13066 if (!parent.IsRuined())
13067 return true;
13068 }
13069
13070 return true;
13071 }
13072
13074 {
13075 if (!super.CanPutAsAttachment(parent))
13076 {
13077 return false;
13078 }
13079
13080 if (!IsRuined() && !parent.IsRuined())
13081 {
13082 return true;
13083 }
13084
13085 return false;
13086 }
13087
13089 {
13090
13091
13092
13093
13094 return super.CanReceiveItemIntoCargo(item);
13095 }
13096
13098 {
13099
13100
13101
13102
13103 GameInventory attachmentInv = attachment.GetInventory();
13105 {
13106 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13107 return false;
13108 }
13109
13110 InventoryLocation loc = new InventoryLocation();
13111 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13112 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13113 return false;
13114
13115 return super.CanReceiveAttachment(attachment, slotId);
13116 }
13117
13119 {
13120 if (!super.CanReleaseAttachment(attachment))
13121 return false;
13122
13123 return GetInventory().AreChildrenAccessible();
13124 }
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13147 {
13148 int id = muzzle_owner.GetMuzzleID();
13149 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13150
13151 if (WPOF_array)
13152 {
13153 for (int i = 0; i < WPOF_array.Count(); i++)
13154 {
13155 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13156
13157 if (WPOF)
13158 {
13159 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13160 }
13161 }
13162 }
13163 }
13164
13165
13167 {
13168 int id = muzzle_owner.GetMuzzleID();
13170
13171 if (WPOBE_array)
13172 {
13173 for (int i = 0; i < WPOBE_array.Count(); i++)
13174 {
13175 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13176
13177 if (WPOBE)
13178 {
13179 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13180 }
13181 }
13182 }
13183 }
13184
13185
13187 {
13188 int id = muzzle_owner.GetMuzzleID();
13189 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13190
13191 if (WPOOH_array)
13192 {
13193 for (int i = 0; i < WPOOH_array.Count(); i++)
13194 {
13195 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13196
13197 if (WPOOH)
13198 {
13199 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13200 }
13201 }
13202 }
13203 }
13204
13205
13207 {
13208 int id = muzzle_owner.GetMuzzleID();
13209 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13210
13211 if (WPOOH_array)
13212 {
13213 for (int i = 0; i < WPOOH_array.Count(); i++)
13214 {
13215 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13216
13217 if (WPOOH)
13218 {
13219 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13220 }
13221 }
13222 }
13223 }
13224
13225
13227 {
13228 int id = muzzle_owner.GetMuzzleID();
13229 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13230
13231 if (WPOOH_array)
13232 {
13233 for (int i = 0; i < WPOOH_array.Count(); i++)
13234 {
13235 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13236
13237 if (WPOOH)
13238 {
13239 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13240 }
13241 }
13242 }
13243 }
13244
13245
13246
13248 {
13250 {
13251 return true;
13252 }
13253
13254 return false;
13255 }
13256
13258 {
13260 {
13261 return true;
13262 }
13263
13264 return false;
13265 }
13266
13268 {
13270 {
13271 return true;
13272 }
13273
13274 return false;
13275 }
13276
13278 {
13279 return false;
13280 }
13281
13284 {
13285 return UATimeSpent.DEFAULT_DEPLOY;
13286 }
13287
13288
13289
13290
13292 {
13294 SetSynchDirty();
13295 }
13296
13298 {
13300 }
13301
13302
13304 {
13305 return false;
13306 }
13307
13310 {
13311 string att_type = "None";
13312
13313 if (ConfigIsExisting("soundAttType"))
13314 {
13315 att_type = ConfigGetString("soundAttType");
13316 }
13317
13319 }
13320
13322 {
13324 }
13325
13326
13327
13328
13329
13333
13335 {
13338
13340 }
13341
13342
13344 {
13346 return;
13347
13349
13352
13355
13356 SoundParameters params = new SoundParameters();
13360 }
13361
13362
13364 {
13366 return;
13367
13369 SetSynchDirty();
13370
13373 }
13374
13375
13377 {
13379 return;
13380
13382 SetSynchDirty();
13383
13386 }
13387
13389 {
13391 }
13392
13394 {
13396 }
13397
13400 {
13401 if (!
GetGame().IsDedicatedServer())
13402 {
13403 if (ConfigIsExisting("attachSoundSet"))
13404 {
13405 string cfg_path = "";
13406 string soundset = "";
13407 string type_name =
GetType();
13408
13411 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13412 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13413
13414 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13415 {
13416 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13417 {
13418 if (cfg_slot_array[i] == slot_type)
13419 {
13420 soundset = cfg_soundset_array[i];
13421 break;
13422 }
13423 }
13424 }
13425
13426 if (soundset != "")
13427 {
13428 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13430 }
13431 }
13432 }
13433 }
13434
13436 {
13437
13438 }
13439
13440 void OnApply(PlayerBase player);
13441
13443 {
13444 return 1.0;
13445 };
13446
13448 {
13450 }
13451
13453 {
13455 }
13456
13458
13460 {
13461 SetDynamicPhysicsLifeTime(0.01);
13463 }
13464
13466 {
13467 array<string> zone_names = new array<string>;
13468 GetDamageZones(zone_names);
13469 for (int i = 0; i < zone_names.Count(); i++)
13470 {
13471 SetHealthMax(zone_names.Get(i),"Health");
13472 }
13473 SetHealthMax("","Health");
13474 }
13475
13478 {
13479 float global_health = GetHealth01("","Health");
13480 array<string> zones = new array<string>;
13481 GetDamageZones(zones);
13482
13483 for (int i = 0; i < zones.Count(); i++)
13484 {
13485 SetHealth01(zones.Get(i),"Health",global_health);
13486 }
13487 }
13488
13491 {
13492 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13493 }
13494
13496 {
13497 if (!hasRootAsPlayer)
13498 {
13499 if (refParentIB)
13500 {
13501
13502 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13503 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13504
13505 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13506 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13507
13510 }
13511 else
13512 {
13513
13516 }
13517 }
13518 }
13519
13521 {
13523 {
13524 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13525 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13526 {
13527 float heatPermCoef = 1.0;
13529 while (ent)
13530 {
13531 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13532 ent = ent.GetHierarchyParent();
13533 }
13534
13535 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13536 }
13537 }
13538 }
13539
13541 {
13542
13543 EntityAI parent = GetHierarchyParent();
13544 if (!parent)
13545 {
13546 hasParent = false;
13547 hasRootAsPlayer = false;
13548 }
13549 else
13550 {
13551 hasParent = true;
13552 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13553 refParentIB =
ItemBase.Cast(parent);
13554 }
13555 }
13556
13557 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13558 {
13559
13560 }
13561
13563 {
13564
13565 return false;
13566 }
13567
13569 {
13570
13571
13572 return false;
13573 }
13574
13576 {
13577
13578 return false;
13579 }
13580
13583 {
13584 return !GetIsFrozen() &&
IsOpen();
13585 }
13586
13588 {
13589 bool hasParent = false, hasRootAsPlayer = false;
13591
13592 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13593 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13594
13595 if (wwtu || foodDecay)
13596 {
13600
13601 if (processWetness || processTemperature || processDecay)
13602 {
13604
13605 if (processWetness)
13606 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13607
13608 if (processTemperature)
13610
13611 if (processDecay)
13612 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13613 }
13614 }
13615 }
13616
13619 {
13621 }
13622
13624 {
13627
13628 return super.GetTemperatureFreezeThreshold();
13629 }
13630
13632 {
13635
13636 return super.GetTemperatureThawThreshold();
13637 }
13638
13640 {
13643
13644 return super.GetItemOverheatThreshold();
13645 }
13646
13648 {
13650 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13651
13652 return super.GetTemperatureFreezeTime();
13653 }
13654
13656 {
13658 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13659
13660 return super.GetTemperatureThawTime();
13661 }
13662
13667
13669 {
13670 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13671 }
13672
13674 {
13675 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13676 }
13677
13680 {
13682 }
13683
13685 {
13687 }
13688
13690 {
13692 }
13693
13696 {
13697 return null;
13698 }
13699
13702 {
13703 return false;
13704 }
13705
13707 {
13709 {
13712 if (!trg)
13713 {
13715 explosive = this;
13716 }
13717
13718 explosive.PairRemote(trg);
13720
13721 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13722 trg.SetPersistentPairID(persistentID);
13723 explosive.SetPersistentPairID(persistentID);
13724
13725 return true;
13726 }
13727 return false;
13728 }
13729
13732 {
13733 float ret = 1.0;
13736 ret *= GetHealth01();
13737
13738 return ret;
13739 }
13740
13741 #ifdef DEVELOPER
13742 override void SetDebugItem()
13743 {
13744 super.SetDebugItem();
13745 _itemBase = this;
13746 }
13747
13749 {
13750 string text = super.GetDebugText();
13751
13753 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13754
13755 return text;
13756 }
13757 #endif
13758
13760 {
13761 return true;
13762 }
13763
13765
13767
13769 {
13772 }
13773
13774
13782
13798}
13799
13801{
13803 if (entity)
13804 {
13805 bool is_item = entity.IsInherited(
ItemBase);
13806 if (is_item && full_quantity)
13807 {
13810 }
13811 }
13812 else
13813 {
13815 return NULL;
13816 }
13817 return entity;
13818}
13819
13821{
13822 if (item)
13823 {
13824 if (health > 0)
13825 item.SetHealth("", "", health);
13826
13827 if (item.CanHaveTemperature())
13828 {
13830 if (item.CanFreeze())
13831 item.SetFrozen(false);
13832 }
13833
13834 if (item.HasEnergyManager())
13835 {
13836 if (quantity >= 0)
13837 {
13838 item.GetCompEM().SetEnergy0To1(quantity);
13839 }
13840 else
13841 {
13843 }
13844 }
13845 else if (item.IsMagazine())
13846 {
13847 Magazine mag = Magazine.Cast(item);
13848 if (quantity >= 0)
13849 {
13850 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13851 }
13852 else
13853 {
13855 }
13856
13857 }
13858 else
13859 {
13860 if (quantity >= 0)
13861 {
13862 item.SetQuantityNormalized(quantity, false);
13863 }
13864 else
13865 {
13867 }
13868
13869 }
13870 }
13871}
13872
13873#ifdef DEVELOPER
13875#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.