9089{
9091 {
9092 return true;
9093 }
9094};
9095
9096
9097
9099{
9103
9105
9108
9109
9110
9111
9112
9121
9127
9132
9137
9158 protected bool m_IsResultOfSplit
9159
9161
9166
9167
9168
9170
9174
9175
9176
9178
9181
9182
9183
9189
9190
9198
9201
9202
9204
9205
9207
9208
9213
9214
9219
9220
9222
9223
9225 {
9230
9231 if (!
GetGame().IsDedicatedServer())
9232 {
9234 {
9236
9238 {
9240 }
9241 }
9242
9245 }
9246
9247 m_OldLocation = null;
9248
9250 {
9252 }
9253
9254 if (ConfigIsExisting("headSelectionsToHide"))
9255 {
9258 }
9259
9261 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9262 {
9264 }
9265
9267
9268 m_IsResultOfSplit = false;
9269
9271 }
9272
9274 {
9275 super.InitItemVariables();
9276
9282 m_Count = ConfigGetInt(
"count");
9283
9286
9291
9294
9299
9311
9315
9316
9319 if (ConfigIsExisting("canBeSplit"))
9320 {
9323 }
9324
9326 if (ConfigIsExisting("itemBehaviour"))
9328
9329
9332 RegisterNetSyncVariableInt("m_VarLiquidType");
9333 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9334
9335 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9336 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9337 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9338
9339 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9340 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9341 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9342 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9343
9344 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9345 RegisterNetSyncVariableBool("m_IsTakeable");
9346 RegisterNetSyncVariableBool("m_IsHologram");
9347
9350 {
9353 }
9354
9356
9358 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9360
9361 }
9362
9364 {
9366 }
9367
9369 {
9372 {
9377 }
9378 }
9379
9380 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9381 {
9383 {
9386 }
9387
9389 }
9390
9392 {
9398 }
9399
9401
9403 {
9405
9406 if (!action)
9407 {
9408 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9409 return;
9410 }
9411
9413 if (!ai)
9414 {
9416 return;
9417 }
9418
9420 if (!action_array)
9421 {
9422 action_array = new array<ActionBase_Basic>;
9424 }
9425 if (LogManager.IsActionLogEnable())
9426 {
9427 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9428 }
9429
9430 if (action_array.Find(action) != -1)
9431 {
9432 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9433 }
9434 else
9435 {
9436 action_array.Insert(action);
9437 }
9438 }
9439
9441 {
9443 ActionBase action = player.GetActionManager().GetAction(actionName);
9446
9447 if (action_array)
9448 {
9449 action_array.RemoveItem(action);
9450 }
9451 }
9452
9453
9454
9456 {
9457 ActionOverrideData overrideData = new ActionOverrideData();
9461
9463 if (!actionMap)
9464 {
9467 }
9468
9469 actionMap.Insert(this.
Type(), overrideData);
9470
9471 }
9472
9474
9476
9477
9479 {
9482
9485
9486 string config_to_search = "CfgVehicles";
9487 string muzzle_owner_config;
9488
9490 {
9491 if (IsInherited(Weapon))
9492 config_to_search = "CfgWeapons";
9493
9494 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9495
9496 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9497
9499
9500 if (config_OnFire_subclass_count > 0)
9501 {
9502 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9503
9504 for (int i = 0; i < config_OnFire_subclass_count; i++)
9505 {
9506 string particle_class = "";
9508 string config_OnFire_entry = config_OnFire_class + particle_class;
9509 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9510 WPOF_array.Insert(WPOF);
9511 }
9512
9513
9515 }
9516 }
9517
9519 {
9520 config_to_search = "CfgWeapons";
9521 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9522
9523 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9524
9526
9527 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9528 {
9529 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9530
9531 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9532 {
9533 string particle_class2 = "";
9535 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9536 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9537 WPOBE_array.Insert(WPOBE);
9538 }
9539
9540
9542 }
9543 }
9544 }
9545
9546
9548 {
9551
9553 {
9554 string config_to_search = "CfgVehicles";
9555
9556 if (IsInherited(Weapon))
9557 config_to_search = "CfgWeapons";
9558
9559 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9560 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9561
9562 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9563 {
9564
9566
9568 {
9570 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9572 return;
9573 }
9574
9577
9578
9579
9581 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9582
9583 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9584 {
9585 string particle_class = "";
9587 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9589
9590 if (entry_type == CT_CLASS)
9591 {
9592 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9593 WPOOH_array.Insert(WPOF);
9594 }
9595 }
9596
9597
9599 }
9600 }
9601 }
9602
9604 {
9606 }
9607
9609 {
9611 {
9613
9616
9619
9620 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9621 }
9622 }
9623
9625 {
9627 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9628
9630 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9631
9633 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9634
9636 {
9638 }
9639 }
9640
9642 {
9644 }
9645
9647 {
9650 else
9652
9654 {
9657 }
9658 else
9659 {
9662
9665 }
9666
9668 }
9669
9671 {
9673 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9674 }
9675
9677 {
9679 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9681 }
9682
9684 {
9686 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9687 }
9688
9690 {
9693
9694 OverheatingParticle OP = new OverheatingParticle();
9699
9701 }
9702
9704 {
9707
9708 return -1;
9709 }
9710
9712 {
9714 {
9717
9718 for (int i = count; i > 0; --i)
9719 {
9720 int id = i - 1;
9723
9726
9727 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9728 {
9729 if (p)
9730 {
9733 }
9734 }
9735 }
9736 }
9737 }
9738
9740 {
9742 {
9744 {
9745 int id = i - 1;
9747
9748 if (OP)
9749 {
9751
9752 if (p)
9753 {
9755 }
9756
9757 delete OP;
9758 }
9759 }
9760
9763 }
9764 }
9765
9768 {
9769 return 0.0;
9770 }
9771
9772
9774 {
9775 return 250;
9776 }
9777
9779 {
9780 return 0;
9781 }
9782
9785 {
9787 return true;
9788
9789 return false;
9790 }
9791
9794 {
9797
9799 {
9801 }
9802 else
9803 {
9804
9806 }
9807
9809 }
9810
9817 {
9818 return -1;
9819 }
9820
9821
9822
9823
9825 {
9827 {
9829 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9830
9831 if (r_index >= 0)
9832 {
9833 InventoryLocation r_il = new InventoryLocation;
9834 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9835
9836 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9839 {
9840 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9841 }
9843 {
9844 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9845 }
9846
9847 }
9848
9849 player.GetHumanInventory().ClearUserReservedLocation(this);
9850 }
9851
9854 }
9855
9856
9857
9858
9860 {
9861 return ItemBase.m_DebugActionsMask;
9862 }
9863
9865 {
9866 return ItemBase.m_DebugActionsMask & mask;
9867 }
9868
9870 {
9871 ItemBase.m_DebugActionsMask = mask;
9872 }
9873
9875 {
9876 ItemBase.m_DebugActionsMask |= mask;
9877 }
9878
9880 {
9881 ItemBase.m_DebugActionsMask &= ~mask;
9882 }
9883
9885 {
9887 {
9889 }
9890 else
9891 {
9893 }
9894 }
9895
9896
9898 {
9899 if (GetEconomyProfile())
9900 {
9901 float q_max = GetEconomyProfile().GetQuantityMax();
9902 if (q_max > 0)
9903 {
9904 float q_min = GetEconomyProfile().GetQuantityMin();
9905 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9906
9908 {
9909 ComponentEnergyManager comp = GetCompEM();
9911 {
9913 }
9914 }
9916 {
9918
9919 }
9920
9921 }
9922 }
9923 }
9924
9927 {
9928 EntityAI parent = GetHierarchyParent();
9929
9930 if (parent)
9931 {
9932 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9933 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9934 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9935 }
9936 }
9937
9940 {
9941 EntityAI parent = GetHierarchyParent();
9942
9943 if (parent)
9944 {
9945 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9946 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9947 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9948 }
9949 }
9950
9952 {
9953
9954
9955
9956
9958
9960 {
9961 if (ScriptInputUserData.CanStoreInputUserData())
9962 {
9963 ScriptInputUserData ctx = new ScriptInputUserData;
9969 ctx.
Write(use_stack_max);
9972
9974 {
9975 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9976 }
9977 }
9978 }
9979 else if (!
GetGame().IsMultiplayer())
9980 {
9982 }
9983 }
9984
9986 {
9988 }
9989
9991 {
9993 }
9994
9996 {
9998 }
9999
10001 {
10002
10003 return false;
10004 }
10005
10007 {
10008 return false;
10009 }
10010
10014 {
10015 return false;
10016 }
10017
10019 {
10020 return "";
10021 }
10022
10024
10026 {
10027 return false;
10028 }
10029
10031 {
10032 return true;
10033 }
10034
10035
10036
10038 {
10039 return true;
10040 }
10041
10043 {
10044 return true;
10045 }
10046
10048 {
10049 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10051 }
10052
10054 {
10056 }
10057
10059 {
10061 if (!is_being_placed)
10063 SetSynchDirty();
10064 }
10065
10066
10068
10070 {
10072 }
10073
10075 {
10077 }
10078
10080 {
10081 return 1;
10082 }
10083
10085 {
10086 return false;
10087 }
10088
10090 {
10092 SetSynchDirty();
10093 }
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10130 {
10131 super.OnMovedInsideCargo(container);
10132
10133 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10134 }
10135
10136 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10137 {
10138 super.EEItemLocationChanged(oldLoc,newLoc);
10139
10140 PlayerBase new_player = null;
10141 PlayerBase old_player = null;
10142
10143 if (newLoc.GetParent())
10144 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10145
10146 if (oldLoc.GetParent())
10147 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10148
10150 {
10151 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10152
10153 if (r_index >= 0)
10154 {
10155 InventoryLocation r_il = new InventoryLocation;
10156 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10157
10158 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10161 {
10162 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10163 }
10165 {
10166 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10167 }
10168
10169 }
10170 }
10171
10173 {
10174 if (new_player)
10175 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10176
10177 if (new_player == old_player)
10178 {
10179
10180 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10181 {
10183 {
10184 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10185 {
10186 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10187 }
10188 }
10189 else
10190 {
10191 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10192 }
10193 }
10194
10195 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10196 {
10197 int type = oldLoc.GetType();
10199 {
10200 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10201 }
10203 {
10204 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10205 }
10206 }
10207 if (!m_OldLocation)
10208 {
10209 m_OldLocation = new InventoryLocation;
10210 }
10211 m_OldLocation.Copy(oldLoc);
10212 }
10213 else
10214 {
10215 if (m_OldLocation)
10216 {
10217 m_OldLocation.Reset();
10218 }
10219 }
10220
10222 }
10223 else
10224 {
10225 if (new_player)
10226 {
10227 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10228 if (res_index >= 0)
10229 {
10230 InventoryLocation il = new InventoryLocation;
10231 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10233 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10236 {
10237 il.
GetParent().GetOnReleaseLock().Invoke(it);
10238 }
10240 {
10242 }
10243
10244 }
10245 }
10247 {
10248
10250 }
10251
10252 if (m_OldLocation)
10253 {
10254 m_OldLocation.Reset();
10255 }
10256 }
10257 }
10258
10259 override void EOnContact(IEntity other, Contact extra)
10260 {
10262 {
10263 int liquidType = -1;
10265 if (impactSpeed > 0.0)
10266 {
10268 #ifndef SERVER
10270 #else
10272 SetSynchDirty();
10273 #endif
10275 }
10276 }
10277
10278 #ifdef SERVER
10279 if (GetCompEM() && GetCompEM().IsPlugged())
10280 {
10281 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10282 GetCompEM().UnplugThis();
10283 }
10284 #endif
10285 }
10286
10288
10290 {
10292 }
10293
10295 {
10296
10297 }
10298
10300 {
10301 super.OnItemLocationChanged(old_owner, new_owner);
10302
10303 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10304 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10305
10306 if (!relatedPlayer && playerNew)
10307 relatedPlayer = playerNew;
10308
10309 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10310 {
10312 if (actionMgr)
10313 {
10314 ActionBase currentAction = actionMgr.GetRunningAction();
10315 if (currentAction)
10317 }
10318 }
10319
10320 Man ownerPlayerOld = null;
10321 Man ownerPlayerNew = null;
10322
10323 if (old_owner)
10324 {
10325 if (old_owner.
IsMan())
10326 {
10327 ownerPlayerOld = Man.Cast(old_owner);
10328 }
10329 else
10330 {
10331 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10332 }
10333 }
10334 else
10335 {
10337 {
10339
10340 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10341 {
10342 GetCompEM().UnplugThis();
10343 }
10344 }
10345 }
10346
10347 if (new_owner)
10348 {
10349 if (new_owner.
IsMan())
10350 {
10351 ownerPlayerNew = Man.Cast(new_owner);
10352 }
10353 else
10354 {
10355 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10356 }
10357 }
10358
10359 if (ownerPlayerOld != ownerPlayerNew)
10360 {
10361 if (ownerPlayerOld)
10362 {
10363 array<EntityAI> subItemsExit = new array<EntityAI>;
10365 for (int i = 0; i < subItemsExit.Count(); i++)
10366 {
10369 }
10370 }
10371
10372 if (ownerPlayerNew)
10373 {
10374 array<EntityAI> subItemsEnter = new array<EntityAI>;
10376 for (int j = 0; j < subItemsEnter.Count(); j++)
10377 {
10380 }
10381 }
10382 }
10383 else if (ownerPlayerNew != null)
10384 {
10385 PlayerBase nplayer;
10386 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10387 {
10388 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10390 for (int k = 0; k < subItemsUpdate.Count(); k++)
10391 {
10393 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10394 }
10395 }
10396 }
10397
10398 if (old_owner)
10399 old_owner.OnChildItemRemoved(this);
10400 if (new_owner)
10401 new_owner.OnChildItemReceived(this);
10402 }
10403
10404
10406 {
10407 super.EEDelete(parent);
10408 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10409 if (player)
10410 {
10412
10413 if (player.IsAlive())
10414 {
10415 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10416 if (r_index >= 0)
10417 {
10418 InventoryLocation r_il = new InventoryLocation;
10419 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10420
10421 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10424 {
10425 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10426 }
10428 {
10429 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10430 }
10431
10432 }
10433
10434 player.RemoveQuickBarEntityShortcut(this);
10435 }
10436 }
10437 }
10438
10440 {
10441 super.EEKilled(killer);
10442
10445 {
10446 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10447 {
10448 if (IsMagazine())
10449 {
10450 if (Magazine.Cast(this).GetAmmoCount() > 0)
10451 {
10453 }
10454 }
10455 else
10456 {
10458 }
10459 }
10460 }
10461 }
10462
10464 {
10465 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10466
10467 super.OnWasAttached(parent, slot_id);
10468
10471
10473 }
10474
10476 {
10477 super.OnWasDetached(parent, slot_id);
10478
10481 }
10482
10484 {
10485 int idx;
10488
10489 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10490 if (inventory_slots.Count() < 1)
10491 {
10492 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10493 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10494 }
10495 else
10496 {
10497 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10498 }
10499
10500 idx = inventory_slots.Find(slot);
10501 if (idx < 0)
10502 return "";
10503
10504 return attach_types.Get(idx);
10505 }
10506
10508 {
10509 int idx = -1;
10510 string slot;
10511
10514
10515 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10516 if (inventory_slots.Count() < 1)
10517 {
10518 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10519 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10520 }
10521 else
10522 {
10523 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10524 if (detach_types.Count() < 1)
10525 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10526 }
10527
10528 for (int i = 0; i < inventory_slots.Count(); i++)
10529 {
10530 slot = inventory_slots.Get(i);
10531 }
10532
10533 if (slot != "")
10534 {
10535 if (detach_types.Count() == 1)
10536 idx = 0;
10537 else
10538 idx = inventory_slots.Find(slot);
10539 }
10540 if (idx < 0)
10541 return "";
10542
10543 return detach_types.Get(idx);
10544 }
10545
10547 {
10548
10550
10551
10552 float min_time = 1;
10553 float max_time = 3;
10554 float delay = Math.RandomFloat(min_time, max_time);
10555
10556 explode_timer.Run(delay, this, "DoAmmoExplosion");
10557 }
10558
10560 {
10561 Magazine magazine = Magazine.Cast(this);
10562 int pop_sounds_count = 6;
10563 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10564
10565
10566 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10567 string sound_name = pop_sounds[ sound_idx ];
10569
10570
10571 magazine.ServerAddAmmoCount(-1);
10572
10573
10574 float min_temp_to_explode = 100;
10575
10576 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10577 {
10579 }
10580 }
10581
10582
10583 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10584 {
10585 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10586
10587 const int CHANCE_DAMAGE_CARGO = 4;
10588 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10589 const int CHANCE_DAMAGE_NOTHING = 2;
10590
10592 {
10593 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10594 int chances;
10595 int rnd;
10596
10597 if (GetInventory().GetCargo())
10598 {
10599 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10600 rnd = Math.RandomInt(0,chances);
10601
10602 if (rnd < CHANCE_DAMAGE_CARGO)
10603 {
10605 }
10606 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10607 {
10609 }
10610 }
10611 else
10612 {
10613 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10614 rnd = Math.RandomInt(0,chances);
10615
10616 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10617 {
10619 }
10620 }
10621 }
10622 }
10623
10625 {
10626 if (GetInventory().GetCargo())
10627 {
10628 int item_count = GetInventory().GetCargo().GetItemCount();
10629 if (item_count > 0)
10630 {
10631 int random_pick = Math.RandomInt(0, item_count);
10633 if (!item.IsExplosive())
10634 {
10635 item.AddHealth("","",damage);
10636 return true;
10637 }
10638 }
10639 }
10640 return false;
10641 }
10642
10644 {
10645 int attachment_count = GetInventory().AttachmentCount();
10646 if (attachment_count > 0)
10647 {
10648 int random_pick = Math.RandomInt(0, attachment_count);
10649 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10650 if (!attachment.IsExplosive())
10651 {
10652 attachment.AddHealth("","",damage);
10653 return true;
10654 }
10655 }
10656 return false;
10657 }
10658
10660 {
10662 }
10663
10665 {
10667 return GetInventory().CanRemoveEntity();
10668
10669 return false;
10670 }
10671
10673 {
10675 return;
10676
10678 {
10679 if (ScriptInputUserData.CanStoreInputUserData())
10680 {
10681 ScriptInputUserData ctx = new ScriptInputUserData;
10686 ctx.
Write(destination_entity);
10688 ctx.
Write(slot_id);
10690 }
10691 }
10692 else if (!
GetGame().IsMultiplayer())
10693 {
10695 }
10696 }
10697
10699 {
10701 return;
10702
10703 float split_quantity_new;
10707 InventoryLocation loc = new InventoryLocation;
10708
10709 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10710 {
10712 split_quantity_new = stack_max;
10713 else
10715
10716 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10717 if (new_item)
10718 {
10719 new_item.SetResultOfSplit(true);
10720 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10722 new_item.SetQuantity(split_quantity_new);
10723 }
10724 }
10725 else if (destination_entity && slot_id == -1)
10726 {
10727 if (quantity > stack_max)
10728 split_quantity_new = stack_max;
10729 else
10730 split_quantity_new = quantity;
10731
10733 {
10736 }
10737
10738 if (new_item)
10739 {
10740 new_item.SetResultOfSplit(true);
10741 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10743 new_item.SetQuantity(split_quantity_new);
10744 }
10745 }
10746 else
10747 {
10748 if (stack_max != 0)
10749 {
10751 {
10753 }
10754
10755 if (split_quantity_new == 0)
10756 {
10757 if (!
GetGame().IsMultiplayer())
10758 player.PhysicalPredictiveDropItem(this);
10759 else
10760 player.ServerDropEntity(this);
10761 return;
10762 }
10763
10765
10766 if (new_item)
10767 {
10768 new_item.SetResultOfSplit(true);
10769 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10771 new_item.SetQuantity(stack_max);
10772 new_item.PlaceOnSurface();
10773 }
10774 }
10775 }
10776 }
10777
10779 {
10781 return;
10782
10783 float split_quantity_new;
10787 InventoryLocation loc = new InventoryLocation;
10788
10789 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10790 {
10792 split_quantity_new = stack_max;
10793 else
10795
10796 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10797 if (new_item)
10798 {
10799 new_item.SetResultOfSplit(true);
10800 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10802 new_item.SetQuantity(split_quantity_new);
10803 }
10804 }
10805 else if (destination_entity && slot_id == -1)
10806 {
10807 if (quantity > stack_max)
10808 split_quantity_new = stack_max;
10809 else
10810 split_quantity_new = quantity;
10811
10813 {
10816 }
10817
10818 if (new_item)
10819 {
10820 new_item.SetResultOfSplit(true);
10821 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10823 new_item.SetQuantity(split_quantity_new);
10824 }
10825 }
10826 else
10827 {
10828 if (stack_max != 0)
10829 {
10831 {
10833 }
10834
10836
10837 if (new_item)
10838 {
10839 new_item.SetResultOfSplit(true);
10840 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10842 new_item.SetQuantity(stack_max);
10843 new_item.PlaceOnSurface();
10844 }
10845 }
10846 }
10847 }
10848
10850 {
10852 return;
10853
10855 {
10856 if (ScriptInputUserData.CanStoreInputUserData())
10857 {
10858 ScriptInputUserData ctx = new ScriptInputUserData;
10863 dst.WriteToContext(ctx);
10865 }
10866 }
10867 else if (!
GetGame().IsMultiplayer())
10868 {
10870 }
10871 }
10872
10874 {
10876 return;
10877
10879 {
10880 if (ScriptInputUserData.CanStoreInputUserData())
10881 {
10882 ScriptInputUserData ctx = new ScriptInputUserData;
10887 ctx.
Write(destination_entity);
10893 }
10894 }
10895 else if (!
GetGame().IsMultiplayer())
10896 {
10898 }
10899 }
10900
10902 {
10904 }
10905
10907 {
10909 return this;
10910
10912 float split_quantity_new;
10914 if (dst.IsValid())
10915 {
10916 int slot_id = dst.GetSlot();
10918
10919 if (quantity > stack_max)
10920 split_quantity_new = stack_max;
10921 else
10922 split_quantity_new = quantity;
10923
10925
10926 if (new_item)
10927 {
10928 new_item.SetResultOfSplit(true);
10929 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10932 }
10933
10934 return new_item;
10935 }
10936
10937 return null;
10938 }
10939
10941 {
10943 return;
10944
10946 float split_quantity_new;
10948 if (destination_entity)
10949 {
10951 if (quantity > stackable)
10952 split_quantity_new = stackable;
10953 else
10954 split_quantity_new = quantity;
10955
10956 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10957 if (new_item)
10958 {
10959 new_item.SetResultOfSplit(true);
10960 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10962 new_item.SetQuantity(split_quantity_new);
10963 }
10964 }
10965 }
10966
10968 {
10970 return;
10971
10973 {
10974 if (ScriptInputUserData.CanStoreInputUserData())
10975 {
10976 ScriptInputUserData ctx = new ScriptInputUserData;
10981 ItemBase destination_entity =
this;
10982 ctx.
Write(destination_entity);
10986 }
10987 }
10988 else if (!
GetGame().IsMultiplayer())
10989 {
10991 }
10992 }
10993
10995 {
10997 return;
10998
11000 float split_quantity_new;
11002 if (player)
11003 {
11005 if (quantity > stackable)
11006 split_quantity_new = stackable;
11007 else
11008 split_quantity_new = quantity;
11009
11010 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11011 new_item =
ItemBase.Cast(in_hands);
11012 if (new_item)
11013 {
11014 new_item.SetResultOfSplit(true);
11015 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11017 new_item.SetQuantity(split_quantity_new);
11018 }
11019 }
11020 }
11021
11023 {
11025 return;
11026
11028 float split_quantity_new = Math.Floor(quantity * 0.5);
11029
11031
11032 if (new_item)
11033 {
11034 if (new_item.GetQuantityMax() < split_quantity_new)
11035 {
11036 split_quantity_new = new_item.GetQuantityMax();
11037 }
11038
11039 new_item.SetResultOfSplit(true);
11040 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11041
11043 {
11046 }
11047 else
11048 {
11051 }
11052 }
11053 }
11054
11056 {
11058 return;
11059
11061 float split_quantity_new = Math.Floor(quantity / 2);
11062
11063 InventoryLocation invloc = new InventoryLocation;
11065
11067 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11068
11069 if (new_item)
11070 {
11071 if (new_item.GetQuantityMax() < split_quantity_new)
11072 {
11073 split_quantity_new = new_item.GetQuantityMax();
11074 }
11076 {
11079 }
11080 else
11081 {
11084 }
11085 }
11086 }
11087
11090 {
11091 SetWeightDirty();
11093
11094 if (parent)
11095 parent.OnAttachmentQuantityChangedEx(this, delta);
11096
11098 {
11100 {
11102 }
11104 {
11105 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11107 }
11108 }
11109
11110 }
11111
11114 {
11115
11116 }
11117
11120 {
11122 }
11123
11125 {
11126 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11127
11129 {
11130 if (newLevel == GameConstants.STATE_RUINED)
11131 {
11133 EntityAI parent = GetHierarchyParent();
11134 if (parent && parent.IsFireplace())
11135 {
11136 CargoBase cargo = GetInventory().GetCargo();
11137 if (cargo)
11138 {
11140 {
11142 }
11143 }
11144 }
11145 }
11146
11148 {
11149
11151 return;
11152 }
11153
11154 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11155 {
11157 }
11158 }
11159 }
11160
11161
11163 {
11164 super.OnRightClick();
11165
11167 {
11169 {
11170 if (ScriptInputUserData.CanStoreInputUserData())
11171 {
11172 vector m4[4];
11174
11175 EntityAI root = GetHierarchyRoot();
11176
11177 InventoryLocation dst = new InventoryLocation;
11179 {
11180 if (root)
11181 {
11182 root.GetTransform(m4);
11184 }
11185 else
11186 GetInventory().GetCurrentInventoryLocation(dst);
11187 }
11188 else
11189 {
11191
11192
11193 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11194 {
11195 if (root)
11196 {
11197 root.GetTransform(m4);
11199 }
11200 else
11201 GetInventory().GetCurrentInventoryLocation(dst);
11202 }
11203 else
11204 {
11205 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11206 }
11207 }
11208
11209 ScriptInputUserData ctx = new ScriptInputUserData;
11217 }
11218 }
11219 else if (!
GetGame().IsMultiplayer())
11220 {
11222 }
11223 }
11224 }
11225
11226 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11227 {
11228
11229 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11230 return false;
11231
11232 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11233 return false;
11234
11235
11237 return false;
11238
11239
11240 Magazine mag = Magazine.Cast(this);
11241 if (mag)
11242 {
11243 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11244 return false;
11245
11246 if (stack_max_limit)
11247 {
11248 Magazine other_mag = Magazine.Cast(other_item);
11249 if (other_item)
11250 {
11251 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11252 return false;
11253 }
11254
11255 }
11256 }
11257 else
11258 {
11259
11261 return false;
11262
11264 return false;
11265 }
11266
11267 PlayerBase player = null;
11268 if (CastTo(player, GetHierarchyRootPlayer()))
11269 {
11270 if (player.GetInventory().HasAttachment(this))
11271 return false;
11272
11273 if (player.IsItemsToDelete())
11274 return false;
11275 }
11276
11277 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11278 return false;
11279
11280 int slotID;
11282 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11283 return false;
11284
11285 return true;
11286 }
11287
11289 {
11291 }
11292
11294 {
11295 return m_IsResultOfSplit;
11296 }
11297
11299 {
11300 m_IsResultOfSplit = value;
11301 }
11302
11304 {
11306 }
11307
11309 {
11310 float other_item_quantity = other_item.GetQuantity();
11311 float this_free_space;
11312
11314
11316
11317 if (other_item_quantity > this_free_space)
11318 {
11319 return this_free_space;
11320 }
11321 else
11322 {
11323 return other_item_quantity;
11324 }
11325 }
11326
11328 {
11330 }
11331
11333 {
11335 return;
11336
11337 if (!IsMagazine() && other_item)
11338 {
11340 if (quantity_used != 0)
11341 {
11342 float hp1 = GetHealth01("","");
11343 float hp2 = other_item.GetHealth01("","");
11344 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11345 hpResult = hpResult / (
GetQuantity() + quantity_used);
11346
11347 hpResult *= GetMaxHealth();
11348 Math.Round(hpResult);
11349 SetHealth("", "Health", hpResult);
11350
11352 other_item.AddQuantity(-quantity_used);
11353 }
11354 }
11356 }
11357
11359 {
11360 #ifdef SERVER
11361 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11362 GetHierarchyParent().IncreaseLifetimeUp();
11363 #endif
11364 };
11365
11367 {
11368 PlayerBase p = PlayerBase.Cast(player);
11369
11370 array<int> recipesIds = p.m_Recipes;
11371 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11372 if (moduleRecipesManager)
11373 {
11374 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11375 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11376 }
11377
11378 for (int i = 0;i < recipesIds.Count(); i++)
11379 {
11380 int key = recipesIds.Get(i);
11381 string recipeName = moduleRecipesManager.GetRecipeName(key);
11383 }
11384 }
11385
11386
11387 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11388 {
11389 super.GetDebugActions(outputList);
11390
11391
11396
11397
11401
11405
11406
11409
11410
11412 {
11415 }
11416
11418
11421
11425 }
11426
11427
11428
11429
11431 {
11432 super.OnAction(action_id, player, ctx);
11433 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11434 {
11435 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11436 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11437 PlayerBase p = PlayerBase.Cast(player);
11438 if (
EActions.RECIPES_RANGE_START < 1000)
11439 {
11440 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11441 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11442 }
11443 }
11444 #ifndef SERVER
11445 else if (action_id ==
EActions.WATCH_PLAYER)
11446 {
11447 PluginDeveloper.SetDeveloperItemClientEx(player);
11448 }
11449 #endif
11451 {
11452 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11453 {
11454 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11455 OnDebugButtonPressServer(id + 1);
11456 }
11457
11458 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11459 {
11460 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11462 }
11463
11464 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11465 {
11466 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11468 }
11469
11470 else if (action_id ==
EActions.ADD_QUANTITY)
11471 {
11472 if (IsMagazine())
11473 {
11474 Magazine mag = Magazine.Cast(this);
11475 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11476 }
11477 else
11478 {
11480 }
11481
11482 if (m_EM)
11483 {
11484 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11485 }
11486
11487 }
11488
11489 else if (action_id ==
EActions.REMOVE_QUANTITY)
11490 {
11491 if (IsMagazine())
11492 {
11493 Magazine mag2 = Magazine.Cast(this);
11494 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11495 }
11496 else
11497 {
11499 }
11500 if (m_EM)
11501 {
11502 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11503 }
11504
11505 }
11506
11507 else if (action_id ==
EActions.SET_QUANTITY_0)
11508 {
11510
11511 if (m_EM)
11512 {
11513 m_EM.SetEnergy(0);
11514 }
11515 }
11516
11517 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11518 {
11520
11521 if (m_EM)
11522 {
11523 m_EM.SetEnergy(m_EM.GetEnergyMax());
11524 }
11525 }
11526
11527 else if (action_id ==
EActions.ADD_HEALTH)
11528 {
11529 AddHealth("","",GetMaxHealth("","Health")/5);
11530 }
11531 else if (action_id ==
EActions.REMOVE_HEALTH)
11532 {
11533 AddHealth("","",-GetMaxHealth("","Health")/5);
11534 }
11535 else if (action_id ==
EActions.DESTROY_HEALTH)
11536 {
11537 SetHealth01("","",0);
11538 }
11539 else if (action_id ==
EActions.WATCH_ITEM)
11540 {
11542 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11543 #ifdef DEVELOPER
11544 SetDebugDeveloper_item(this);
11545 #endif
11546 }
11547
11548 else if (action_id ==
EActions.ADD_TEMPERATURE)
11549 {
11550 AddTemperature(20);
11551
11552 }
11553
11554 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11555 {
11556 AddTemperature(-20);
11557
11558 }
11559
11560 else if (action_id ==
EActions.FLIP_FROZEN)
11561 {
11562 SetFrozen(!GetIsFrozen());
11563
11564 }
11565
11566 else if (action_id ==
EActions.ADD_WETNESS)
11567 {
11569
11570 }
11571
11572 else if (action_id ==
EActions.REMOVE_WETNESS)
11573 {
11575
11576 }
11577
11578 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11579 {
11582
11583
11584 }
11585
11586 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11587 {
11590 }
11591
11592 else if (action_id ==
EActions.MAKE_SPECIAL)
11593 {
11594 auto debugParams = DebugSpawnParams.WithPlayer(player);
11595 OnDebugSpawnEx(debugParams);
11596 }
11597
11598 else if (action_id ==
EActions.DELETE)
11599 {
11600 Delete();
11601 }
11602
11603 }
11604
11605
11606 return false;
11607 }
11608
11609
11610
11611
11615
11618
11619
11620
11622 {
11623 return false;
11624 }
11625
11626
11628 {
11629 return true;
11630 }
11631
11632
11634 {
11635 return true;
11636 }
11637
11638
11639
11641 {
11642 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11644 }
11645
11648 {
11649 return null;
11650 }
11651
11653 {
11654 return false;
11655 }
11656
11658 {
11659 return false;
11660 }
11661
11665
11666
11668 {
11669 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11670 return module_repairing.CanRepair(this, item_repair_kit);
11671 }
11672
11673
11674 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11675 {
11676 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11677 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11678 }
11679
11680
11682 {
11683
11684
11685
11686
11687
11688
11689
11690
11691 return 1;
11692 }
11693
11694
11695
11697 {
11699 }
11700
11701
11702
11704 {
11706 }
11707
11708
11717 {
11718 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11719
11720 if (player)
11721 {
11722 player.MessageStatus(text);
11723 }
11724 }
11725
11726
11735 {
11736 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11737
11738 if (player)
11739 {
11740 player.MessageAction(text);
11741 }
11742 }
11743
11744
11753 {
11754 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11755
11756 if (player)
11757 {
11758 player.MessageFriendly(text);
11759 }
11760 }
11761
11762
11771 {
11772 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11773
11774 if (player)
11775 {
11776 player.MessageImportant(text);
11777 }
11778 }
11779
11781 {
11782 return true;
11783 }
11784
11785
11786 override bool KindOf(
string tag)
11787 {
11788 bool found = false;
11789 string item_name = this.
GetType();
11792
11793 int array_size = item_tag_array.Count();
11794 for (int i = 0; i < array_size; i++)
11795 {
11796 if (item_tag_array.Get(i) == tag)
11797 {
11798 found = true;
11799 break;
11800 }
11801 }
11802 return found;
11803 }
11804
11805
11807 {
11808
11809 super.OnRPC(sender, rpc_type,ctx);
11810
11811
11812 switch (rpc_type)
11813 {
11814 #ifndef SERVER
11815 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11816 Param2<bool, string> p = new Param2<bool, string>(false, "");
11817
11819 return;
11820
11821 bool play = p.param1;
11822 string soundSet = p.param2;
11823
11824 if (play)
11825 {
11827 {
11829 {
11831 }
11832 }
11833 else
11834 {
11836 }
11837 }
11838 else
11839 {
11841 }
11842
11843 break;
11844 #endif
11845
11846 }
11847
11849 {
11851 }
11852 }
11853
11854
11855
11856
11858 {
11859 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11860 return plugin.GetID(
name);
11861 }
11862
11864 {
11865 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11866 return plugin.GetName(id);
11867 }
11868
11871 {
11872
11873
11874 int varFlags;
11875 if (!ctx.
Read(varFlags))
11876 return;
11877
11878 if (varFlags & ItemVariableFlags.FLOAT)
11879 {
11881 }
11882 }
11883
11885 {
11886
11887 super.SerializeNumericalVars(floats_out);
11888
11889
11890
11892 {
11894 }
11895
11897 {
11899 }
11900
11902 {
11904 }
11905
11907 {
11912 }
11913
11915 {
11917 }
11918 }
11919
11921 {
11922
11923 super.DeSerializeNumericalVars(floats);
11924
11925
11926 int index = 0;
11927 int mask = Math.Round(floats.Get(index));
11928
11929 index++;
11930
11932 {
11934 {
11936 }
11937 else
11938 {
11939 float quantity = floats.Get(index);
11940 SetQuantity(quantity,
true,
false,
false,
false);
11941 }
11942 index++;
11943 }
11944
11946 {
11947 float wet = floats.Get(index);
11949 index++;
11950 }
11951
11953 {
11954 int liquidtype = Math.Round(floats.Get(index));
11956 index++;
11957 }
11958
11960 {
11962 index++;
11964 index++;
11966 index++;
11968 index++;
11969 }
11970
11972 {
11973 int cleanness = Math.Round(floats.Get(index));
11975 index++;
11976 }
11977 }
11978
11980 {
11981 super.WriteVarsToCTX(ctx);
11982
11983
11985 {
11987 }
11988
11990 {
11992 }
11993
11995 {
11997 }
11998
12000 {
12001 int r,g,b,a;
12007 }
12008
12010 {
12012 }
12013 }
12014
12016 {
12017 if (!super.ReadVarsFromCTX(ctx,version))
12018 return false;
12019
12020 int intValue;
12021 float value;
12022
12023 if (version < 140)
12024 {
12025 if (!ctx.
Read(intValue))
12026 return false;
12027
12028 m_VariablesMask = intValue;
12029 }
12030
12032 {
12033 if (!ctx.
Read(value))
12034 return false;
12035
12037 {
12039 }
12040 else
12041 {
12043 }
12044 }
12045
12046 if (version < 140)
12047 {
12049 {
12050 if (!ctx.
Read(value))
12051 return false;
12052 SetTemperatureDirect(value);
12053 }
12054 }
12055
12057 {
12058 if (!ctx.
Read(value))
12059 return false;
12061 }
12062
12064 {
12065 if (!ctx.
Read(intValue))
12066 return false;
12068 }
12069
12071 {
12072 int r,g,b,a;
12074 return false;
12076 return false;
12078 return false;
12080 return false;
12081
12083 }
12084
12086 {
12087 if (!ctx.
Read(intValue))
12088 return false;
12090 }
12091
12092 if (version >= 138 && version < 140)
12093 {
12095 {
12096 if (!ctx.
Read(intValue))
12097 return false;
12098 SetFrozen(intValue);
12099 }
12100 }
12101
12102 return true;
12103 }
12104
12105
12107 {
12110 {
12112 }
12113
12114 if (!super.OnStoreLoad(ctx, version))
12115 {
12117 return false;
12118 }
12119
12120 if (version >= 114)
12121 {
12122 bool hasQuickBarIndexSaved;
12123
12124 if (!ctx.
Read(hasQuickBarIndexSaved))
12125 {
12127 return false;
12128 }
12129
12130 if (hasQuickBarIndexSaved)
12131 {
12132 int itmQBIndex;
12133
12134
12135 if (!ctx.
Read(itmQBIndex))
12136 {
12138 return false;
12139 }
12140
12141 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12142 if (itmQBIndex != -1 && parentPlayer)
12143 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12144 }
12145 }
12146 else
12147 {
12148
12149 PlayerBase player;
12150 int itemQBIndex;
12151 if (version ==
int.
MAX)
12152 {
12153 if (!ctx.
Read(itemQBIndex))
12154 {
12156 return false;
12157 }
12158 }
12159 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12160 {
12161
12162 if (!ctx.
Read(itemQBIndex))
12163 {
12165 return false;
12166 }
12167 if (itemQBIndex != -1 && player)
12168 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12169 }
12170 }
12171
12172 if (version < 140)
12173 {
12174
12175 if (!LoadVariables(ctx, version))
12176 {
12178 return false;
12179 }
12180 }
12181
12182
12184 {
12186 return false;
12187 }
12188 if (version >= 132)
12189 {
12191 if (raib)
12192 {
12194 {
12196 return false;
12197 }
12198 }
12199 }
12200
12202 return true;
12203 }
12204
12205
12206
12208 {
12209 super.OnStoreSave(ctx);
12210
12211 PlayerBase player;
12212 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12213 {
12215
12216 int itemQBIndex = -1;
12217 itemQBIndex = player.FindQuickBarEntityIndex(this);
12218 ctx.
Write(itemQBIndex);
12219 }
12220 else
12221 {
12223 }
12224
12226
12228 if (raib)
12229 {
12231 }
12232 }
12233
12234
12236 {
12237 super.AfterStoreLoad();
12238
12240 {
12242 }
12243
12245 {
12248 }
12249 }
12250
12252 {
12253 super.EEOnAfterLoad();
12254
12256 {
12258 }
12259
12262 }
12263
12265 {
12266 return false;
12267 }
12268
12269
12270
12272 {
12274 {
12275 #ifdef PLATFORM_CONSOLE
12276
12278 {
12280 if (menu)
12281 {
12283 }
12284 }
12285 #endif
12286 }
12287
12289 {
12292 }
12293
12295 {
12296 SetWeightDirty();
12298 }
12300 {
12303 }
12304
12306 {
12309 }
12311 {
12314 }
12315
12316 super.OnVariablesSynchronized();
12317 }
12318
12319
12320
12322 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12323 {
12324 if (!IsServerCheck(allow_client))
12325 return false;
12326
12328 return false;
12329
12332
12333 if (value <= (min + 0.001))
12334 value = min;
12335
12336 if (value == min)
12337 {
12338 if (destroy_config)
12339 {
12340 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12341 if (dstr)
12342 {
12344 this.Delete();
12345 return true;
12346 }
12347 }
12348 else if (destroy_forced)
12349 {
12351 this.Delete();
12352 return true;
12353 }
12354
12356 }
12357
12360
12362 {
12364
12365 if (delta)
12367 }
12368
12370
12371 return false;
12372 }
12373
12374
12376 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12377 {
12379 }
12380
12382 {
12385 }
12386
12388 {
12391 }
12392
12395 {
12396 float value_clamped = Math.Clamp(value, 0, 1);
12398 SetQuantity(result, destroy_config, destroy_forced);
12399 }
12400
12401
12404 {
12406 }
12407
12409 {
12411 }
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12423 {
12424 int slot = -1;
12425 if (GetInventory())
12426 {
12427 InventoryLocation il = new InventoryLocation;
12428 GetInventory().GetCurrentInventoryLocation(il);
12430 }
12431
12433 }
12434
12436 {
12437 float quantity_max = 0;
12438
12440 {
12441 if (attSlotID != -1)
12442 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12443
12444 if (quantity_max <= 0)
12446 }
12447
12448 if (quantity_max <= 0)
12450
12451 return quantity_max;
12452 }
12453
12455 {
12457 }
12458
12460 {
12462 }
12463
12464
12466 {
12468 }
12469
12471 {
12473 }
12474
12476 {
12478 }
12479
12480
12482 {
12483
12484 float weightEx = GetWeightEx();
12485 float special = GetInventoryAndCargoWeight();
12486 return weightEx - special;
12487 }
12488
12489
12491 {
12493 }
12494
12496 {
12498 {
12499 #ifdef DEVELOPER
12500 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12501 {
12502 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12504 }
12505 #endif
12506
12507 return GetQuantity() * GetConfigWeightModified();
12508 }
12509 else if (HasEnergyManager())
12510 {
12511 #ifdef DEVELOPER
12512 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12513 {
12514 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12515 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12516 }
12517 #endif
12518 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12519 }
12520 else
12521 {
12522 #ifdef DEVELOPER
12523 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12524 {
12525 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12526 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12527 }
12528 #endif
12529 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12530 }
12531 }
12532
12535 {
12536 int item_count = 0;
12538
12539 if (GetInventory().GetCargo() != NULL)
12540 {
12541 item_count = GetInventory().GetCargo().GetItemCount();
12542 }
12543
12544 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12545 {
12546 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12547 if (item)
12548 item_count += item.GetNumberOfItems();
12549 }
12550 return item_count;
12551 }
12552
12555 {
12556 float weight = 0;
12557 float wetness = 1;
12558 if (include_wetness)
12561 {
12562 weight = wetness * m_ConfigWeight;
12563 }
12565 {
12566 weight = 1;
12567 }
12568 return weight;
12569 }
12570
12571
12572
12574 {
12575 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12576 {
12577 GameInventory inv = GetInventory();
12578 array<EntityAI> items = new array<EntityAI>;
12580 for (int i = 0; i < items.Count(); i++)
12581 {
12583 if (item)
12584 {
12586 }
12587 }
12588 }
12589 }
12590
12591
12592
12593
12595 {
12596 float energy = 0;
12597 if (HasEnergyManager())
12598 {
12599 energy = GetCompEM().GetEnergy();
12600 }
12601 return energy;
12602 }
12603
12604
12606 {
12607 super.OnEnergyConsumed();
12608
12610 }
12611
12613 {
12614 super.OnEnergyAdded();
12615
12617 }
12618
12619
12621 {
12622 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12623 {
12625 {
12626 float energy_0to1 = GetCompEM().GetEnergy0To1();
12628 }
12629 }
12630 }
12631
12632
12634 {
12635 return ConfigGetFloat("heatIsolation");
12636 }
12637
12639 {
12641 }
12642
12644 {
12645 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12646 if (
GetGame().ConfigIsExisting(paramPath))
12648
12649 return 0.0;
12650 }
12651
12653 {
12654 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12655 if (
GetGame().ConfigIsExisting(paramPath))
12657
12658 return 0.0;
12659 }
12660
12661 override void SetWet(
float value,
bool allow_client =
false)
12662 {
12663 if (!IsServerCheck(allow_client))
12664 return;
12665
12668
12670
12671 m_VarWet = Math.Clamp(value, min, max);
12672
12674 {
12677 }
12678 }
12679
12680 override void AddWet(
float value)
12681 {
12683 }
12684
12686 {
12688 }
12689
12691 {
12693 }
12694
12696 {
12698 }
12699
12701 {
12703 }
12704
12706 {
12708 }
12709
12710 override void OnWetChanged(
float newVal,
float oldVal)
12711 {
12714 if (newLevel != oldLevel)
12715 {
12717 }
12718 }
12719
12721 {
12722 SetWeightDirty();
12723 }
12724
12726 {
12727 return GetWetLevelInternal(
m_VarWet);
12728 }
12729
12730
12731
12733 {
12735 }
12736
12738 {
12740 }
12741
12743 {
12745 }
12746
12748 {
12750 }
12751
12752
12753
12755 {
12756 if (ConfigIsExisting("itemModelLength"))
12757 {
12758 return ConfigGetFloat("itemModelLength");
12759 }
12760 return 0;
12761 }
12762
12764 {
12765 if (ConfigIsExisting("itemAttachOffset"))
12766 {
12767 return ConfigGetFloat("itemAttachOffset");
12768 }
12769 return 0;
12770 }
12771
12772 override void SetCleanness(
int value,
bool allow_client =
false)
12773 {
12774 if (!IsServerCheck(allow_client))
12775 return;
12776
12778
12780
12783 }
12784
12786 {
12788 }
12789
12791 {
12792 return true;
12793 }
12794
12795
12796
12797
12799 {
12801 }
12802
12804 {
12806 }
12807
12808
12809
12810
12811 override void SetColor(
int r,
int g,
int b,
int a)
12812 {
12818 }
12820 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12821 {
12826 }
12827
12829 {
12831 }
12832
12835 {
12836 int r,g,b,a;
12838 r = r/255;
12839 g = g/255;
12840 b = b/255;
12841 a = a/255;
12842 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12843 }
12844
12845
12846
12847 override void SetLiquidType(
int value,
bool allow_client =
false)
12848 {
12849 if (!IsServerCheck(allow_client))
12850 return;
12851
12856 }
12857
12859 {
12860 return ConfigGetInt("varLiquidTypeInit");
12861 }
12862
12864 {
12866 }
12867
12869 {
12871 SetFrozen(false);
12872 }
12873
12876 {
12877 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12878 }
12879
12880
12883 {
12884 PlayerBase nplayer;
12885 if (PlayerBase.CastTo(nplayer, player))
12886 {
12888
12889 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12890 }
12891 }
12892
12893
12896 {
12897 PlayerBase nplayer;
12898 if (PlayerBase.CastTo(nplayer,player))
12899 {
12900
12901 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12902
12903 }
12904
12905
12906 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12907
12908
12909 if (HasEnergyManager())
12910 {
12911 GetCompEM().UpdatePlugState();
12912 }
12913 }
12914
12915
12917 {
12918 super.OnPlacementStarted(player);
12919
12921 }
12922
12923 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12924 {
12926 {
12927 m_AdminLog.OnPlacementComplete(player,
this);
12928 }
12929
12930 super.OnPlacementComplete(player, position, orientation);
12931 }
12932
12933
12934
12935
12936
12938 {
12940 {
12941 return true;
12942 }
12943 else
12944 {
12945 return false;
12946 }
12947 }
12948
12949
12951 {
12953 {
12955 }
12956 }
12957
12958
12960 {
12962 }
12963
12965 {
12967 }
12968
12969 override void InsertAgent(
int agent,
float count = 1)
12970 {
12971 if (count < 1)
12972 return;
12973
12975 }
12976
12979 {
12981 }
12982
12983
12985 {
12987 }
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13031 {
13033 return false;
13034 return true;
13035 }
13036
13038 {
13039
13041 }
13042
13043
13046 {
13047 super.CheckForRoofLimited(timeTresholdMS);
13048
13050 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13051 {
13052 m_PreviousRoofTestTime = time;
13053 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13054 }
13055 }
13056
13057
13059 {
13061 {
13062 return 0;
13063 }
13064
13065 if (GetInventory().GetAttachmentSlotsCount() != 0)
13066 {
13067 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13068 if (filter)
13069 return filter.GetProtectionLevel(type, false, system);
13070 else
13071 return 0;
13072 }
13073
13074 string subclassPath, entryName;
13075
13076 switch (type)
13077 {
13079 entryName = "biological";
13080 break;
13082 entryName = "chemical";
13083 break;
13084 default:
13085 entryName = "biological";
13086 break;
13087 }
13088
13089 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13090
13092 }
13093
13094
13095
13098 {
13099 if (!IsMagazine())
13101
13103 }
13104
13105
13106
13107
13108
13113 {
13114 return true;
13115 }
13116
13118 {
13120 }
13121
13122
13123
13124
13125
13127 {
13128 if (parent)
13129 {
13130 if (parent.IsInherited(DayZInfected))
13131 return true;
13132
13133 if (!parent.IsRuined())
13134 return true;
13135 }
13136
13137 return true;
13138 }
13139
13141 {
13142 if (!super.CanPutAsAttachment(parent))
13143 {
13144 return false;
13145 }
13146
13147 if (!IsRuined() && !parent.IsRuined())
13148 {
13149 return true;
13150 }
13151
13152 return false;
13153 }
13154
13156 {
13157
13158
13159
13160
13161 return super.CanReceiveItemIntoCargo(item);
13162 }
13163
13165 {
13166
13167
13168
13169
13170 GameInventory attachmentInv = attachment.GetInventory();
13172 {
13173 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13174 return false;
13175 }
13176
13177 InventoryLocation loc = new InventoryLocation();
13178 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13179 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13180 return false;
13181
13182 return super.CanReceiveAttachment(attachment, slotId);
13183 }
13184
13186 {
13187 if (!super.CanReleaseAttachment(attachment))
13188 return false;
13189
13190 return GetInventory().AreChildrenAccessible();
13191 }
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13214 {
13215 int id = muzzle_owner.GetMuzzleID();
13216 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13217
13218 if (WPOF_array)
13219 {
13220 for (int i = 0; i < WPOF_array.Count(); i++)
13221 {
13222 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13223
13224 if (WPOF)
13225 {
13226 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13227 }
13228 }
13229 }
13230 }
13231
13232
13234 {
13235 int id = muzzle_owner.GetMuzzleID();
13237
13238 if (WPOBE_array)
13239 {
13240 for (int i = 0; i < WPOBE_array.Count(); i++)
13241 {
13242 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13243
13244 if (WPOBE)
13245 {
13246 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13247 }
13248 }
13249 }
13250 }
13251
13252
13254 {
13255 int id = muzzle_owner.GetMuzzleID();
13256 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13257
13258 if (WPOOH_array)
13259 {
13260 for (int i = 0; i < WPOOH_array.Count(); i++)
13261 {
13262 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13263
13264 if (WPOOH)
13265 {
13266 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13267 }
13268 }
13269 }
13270 }
13271
13272
13274 {
13275 int id = muzzle_owner.GetMuzzleID();
13276 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13277
13278 if (WPOOH_array)
13279 {
13280 for (int i = 0; i < WPOOH_array.Count(); i++)
13281 {
13282 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13283
13284 if (WPOOH)
13285 {
13286 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13287 }
13288 }
13289 }
13290 }
13291
13292
13294 {
13295 int id = muzzle_owner.GetMuzzleID();
13296 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13297
13298 if (WPOOH_array)
13299 {
13300 for (int i = 0; i < WPOOH_array.Count(); i++)
13301 {
13302 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13303
13304 if (WPOOH)
13305 {
13306 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13307 }
13308 }
13309 }
13310 }
13311
13312
13313
13315 {
13317 {
13318 return true;
13319 }
13320
13321 return false;
13322 }
13323
13325 {
13327 {
13328 return true;
13329 }
13330
13331 return false;
13332 }
13333
13335 {
13337 {
13338 return true;
13339 }
13340
13341 return false;
13342 }
13343
13345 {
13346 return false;
13347 }
13348
13351 {
13352 return UATimeSpent.DEFAULT_DEPLOY;
13353 }
13354
13355
13356
13357
13359 {
13361 SetSynchDirty();
13362 }
13363
13365 {
13367 }
13368
13369
13371 {
13372 return false;
13373 }
13374
13377 {
13378 string att_type = "None";
13379
13380 if (ConfigIsExisting("soundAttType"))
13381 {
13382 att_type = ConfigGetString("soundAttType");
13383 }
13384
13386 }
13387
13389 {
13391 }
13392
13393
13394
13395
13396
13400
13402 {
13405
13407 }
13408
13409
13411 {
13413 return;
13414
13416
13419
13422
13423 SoundParameters params = new SoundParameters();
13427 }
13428
13429
13431 {
13433 return;
13434
13436 SetSynchDirty();
13437
13440 }
13441
13442
13444 {
13446 return;
13447
13449 SetSynchDirty();
13450
13453 }
13454
13456 {
13458 }
13459
13461 {
13463 }
13464
13467 {
13468 if (!
GetGame().IsDedicatedServer())
13469 {
13470 if (ConfigIsExisting("attachSoundSet"))
13471 {
13472 string cfg_path = "";
13473 string soundset = "";
13474 string type_name =
GetType();
13475
13478 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13479 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13480
13481 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13482 {
13483 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13484 {
13485 if (cfg_slot_array[i] == slot_type)
13486 {
13487 soundset = cfg_soundset_array[i];
13488 break;
13489 }
13490 }
13491 }
13492
13493 if (soundset != "")
13494 {
13495 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13497 }
13498 }
13499 }
13500 }
13501
13503 {
13504
13505 }
13506
13507 void OnApply(PlayerBase player);
13508
13510 {
13511 return 1.0;
13512 };
13513
13515 {
13517 }
13518
13520 {
13522 }
13523
13525
13527 {
13528 SetDynamicPhysicsLifeTime(0.01);
13530 }
13531
13533 {
13534 array<string> zone_names = new array<string>;
13535 GetDamageZones(zone_names);
13536 for (int i = 0; i < zone_names.Count(); i++)
13537 {
13538 SetHealthMax(zone_names.Get(i),"Health");
13539 }
13540 SetHealthMax("","Health");
13541 }
13542
13545 {
13546 float global_health = GetHealth01("","Health");
13547 array<string> zones = new array<string>;
13548 GetDamageZones(zones);
13549
13550 for (int i = 0; i < zones.Count(); i++)
13551 {
13552 SetHealth01(zones.Get(i),"Health",global_health);
13553 }
13554 }
13555
13558 {
13559 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13560 }
13561
13563 {
13564 if (!hasRootAsPlayer)
13565 {
13566 if (refParentIB)
13567 {
13568
13569 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13570 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13571
13572 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13573 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13574
13577 }
13578 else
13579 {
13580
13583 }
13584 }
13585 }
13586
13588 {
13590 {
13591 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13592 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13593 {
13594 float heatPermCoef = 1.0;
13596 while (ent)
13597 {
13598 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13599 ent = ent.GetHierarchyParent();
13600 }
13601
13602 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13603 }
13604 }
13605 }
13606
13608 {
13609
13610 EntityAI parent = GetHierarchyParent();
13611 if (!parent)
13612 {
13613 hasParent = false;
13614 hasRootAsPlayer = false;
13615 }
13616 else
13617 {
13618 hasParent = true;
13619 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13620 refParentIB =
ItemBase.Cast(parent);
13621 }
13622 }
13623
13624 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13625 {
13626
13627 }
13628
13630 {
13631
13632 return false;
13633 }
13634
13636 {
13637
13638
13639 return false;
13640 }
13641
13643 {
13644
13645 return false;
13646 }
13647
13650 {
13651 return !GetIsFrozen() &&
IsOpen();
13652 }
13653
13655 {
13656 bool hasParent = false, hasRootAsPlayer = false;
13658
13659 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13660 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13661
13662 if (wwtu || foodDecay)
13663 {
13667
13668 if (processWetness || processTemperature || processDecay)
13669 {
13671
13672 if (processWetness)
13673 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13674
13675 if (processTemperature)
13677
13678 if (processDecay)
13679 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13680 }
13681 }
13682 }
13683
13686 {
13688 }
13689
13691 {
13694
13695 return super.GetTemperatureFreezeThreshold();
13696 }
13697
13699 {
13702
13703 return super.GetTemperatureThawThreshold();
13704 }
13705
13707 {
13710
13711 return super.GetItemOverheatThreshold();
13712 }
13713
13715 {
13717 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13718
13719 return super.GetTemperatureFreezeTime();
13720 }
13721
13723 {
13725 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13726
13727 return super.GetTemperatureThawTime();
13728 }
13729
13734
13736 {
13737 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13738 }
13739
13741 {
13742 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13743 }
13744
13747 {
13749 }
13750
13752 {
13754 }
13755
13757 {
13759 }
13760
13763 {
13764 return null;
13765 }
13766
13769 {
13770 return false;
13771 }
13772
13774 {
13776 {
13779 if (!trg)
13780 {
13782 explosive = this;
13783 }
13784
13785 explosive.PairRemote(trg);
13787
13788 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13789 trg.SetPersistentPairID(persistentID);
13790 explosive.SetPersistentPairID(persistentID);
13791
13792 return true;
13793 }
13794 return false;
13795 }
13796
13799 {
13800 float ret = 1.0;
13803 ret *= GetHealth01();
13804
13805 return ret;
13806 }
13807
13808 #ifdef DEVELOPER
13809 override void SetDebugItem()
13810 {
13811 super.SetDebugItem();
13812 _itemBase = this;
13813 }
13814
13816 {
13817 string text = super.GetDebugText();
13818
13820 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13821
13822 return text;
13823 }
13824 #endif
13825
13827 {
13828 return true;
13829 }
13830
13832
13834
13836 {
13839 }
13840
13841
13849
13865}
13866
13868{
13870 if (entity)
13871 {
13872 bool is_item = entity.IsInherited(
ItemBase);
13873 if (is_item && full_quantity)
13874 {
13877 }
13878 }
13879 else
13880 {
13882 return NULL;
13883 }
13884 return entity;
13885}
13886
13888{
13889 if (item)
13890 {
13891 if (health > 0)
13892 item.SetHealth("", "", health);
13893
13894 if (item.CanHaveTemperature())
13895 {
13897 if (item.CanFreeze())
13898 item.SetFrozen(false);
13899 }
13900
13901 if (item.HasEnergyManager())
13902 {
13903 if (quantity >= 0)
13904 {
13905 item.GetCompEM().SetEnergy0To1(quantity);
13906 }
13907 else
13908 {
13910 }
13911 }
13912 else if (item.IsMagazine())
13913 {
13914 Magazine mag = Magazine.Cast(item);
13915 if (quantity >= 0)
13916 {
13917 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13918 }
13919 else
13920 {
13922 }
13923
13924 }
13925 else
13926 {
13927 if (quantity >= 0)
13928 {
13929 item.SetQuantityNormalized(quantity, false);
13930 }
13931 else
13932 {
13934 }
13935
13936 }
13937 }
13938}
13939
13940#ifdef DEVELOPER
13942#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.