9174{
9176 {
9177 return true;
9178 }
9179};
9180
9181
9182
9184{
9188
9190
9193
9194
9195
9196
9197
9206
9212
9217
9222
9243 protected bool m_IsResultOfSplit
9244
9246
9251
9252
9253
9255
9259
9260
9261
9263
9266
9267
9268
9274
9275
9283
9286
9287
9289
9290
9292
9293
9298
9299
9304
9305
9307
9308
9310 {
9315
9316 if (!
GetGame().IsDedicatedServer())
9317 {
9319 {
9321
9323 {
9325 }
9326 }
9327
9330 }
9331
9332 m_OldLocation = null;
9333
9335 {
9337 }
9338
9339 if (ConfigIsExisting("headSelectionsToHide"))
9340 {
9343 }
9344
9346 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9347 {
9349 }
9350
9352
9353 m_IsResultOfSplit = false;
9354
9356 }
9357
9359 {
9360 super.InitItemVariables();
9361
9367 m_Count = ConfigGetInt(
"count");
9368
9371
9376
9379
9384
9396
9400
9401
9404 if (ConfigIsExisting("canBeSplit"))
9405 {
9408 }
9409
9411 if (ConfigIsExisting("itemBehaviour"))
9413
9414
9417 RegisterNetSyncVariableInt("m_VarLiquidType");
9418 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9419
9420 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9421 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9422 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9423
9424 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9425 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9426 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9427 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9428
9429 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9430 RegisterNetSyncVariableBool("m_IsTakeable");
9431 RegisterNetSyncVariableBool("m_IsHologram");
9432
9435 {
9438 }
9439
9441
9443 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9445
9446 }
9447
9449 {
9451 }
9452
9454 {
9457 {
9462 }
9463 }
9464
9465 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9466 {
9468 {
9471 }
9472
9474 }
9475
9477 {
9483 }
9484
9486
9488 {
9490
9491 if (!action)
9492 {
9493 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9494 return;
9495 }
9496
9498 if (!ai)
9499 {
9501 return;
9502 }
9503
9505 if (!action_array)
9506 {
9507 action_array = new array<ActionBase_Basic>;
9509 }
9510 if (LogManager.IsActionLogEnable())
9511 {
9512 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9513 }
9514
9515 if (action_array.Find(action) != -1)
9516 {
9517 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9518 }
9519 else
9520 {
9521 action_array.Insert(action);
9522 }
9523 }
9524
9526 {
9528 ActionBase action = player.GetActionManager().GetAction(actionName);
9531
9532 if (action_array)
9533 {
9534 action_array.RemoveItem(action);
9535 }
9536 }
9537
9538
9539
9541 {
9542 ActionOverrideData overrideData = new ActionOverrideData();
9546
9548 if (!actionMap)
9549 {
9552 }
9553
9554 actionMap.Insert(this.
Type(), overrideData);
9555
9556 }
9557
9559
9561
9562
9564 {
9567
9570
9571 string config_to_search = "CfgVehicles";
9572 string muzzle_owner_config;
9573
9575 {
9576 if (IsInherited(Weapon))
9577 config_to_search = "CfgWeapons";
9578
9579 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9580
9581 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9582
9584
9585 if (config_OnFire_subclass_count > 0)
9586 {
9587 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9588
9589 for (int i = 0; i < config_OnFire_subclass_count; i++)
9590 {
9591 string particle_class = "";
9593 string config_OnFire_entry = config_OnFire_class + particle_class;
9594 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9595 WPOF_array.Insert(WPOF);
9596 }
9597
9598
9600 }
9601 }
9602
9604 {
9605 config_to_search = "CfgWeapons";
9606 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9607
9608 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9609
9611
9612 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9613 {
9614 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9615
9616 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9617 {
9618 string particle_class2 = "";
9620 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9621 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9622 WPOBE_array.Insert(WPOBE);
9623 }
9624
9625
9627 }
9628 }
9629 }
9630
9631
9633 {
9636
9638 {
9639 string config_to_search = "CfgVehicles";
9640
9641 if (IsInherited(Weapon))
9642 config_to_search = "CfgWeapons";
9643
9644 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9645 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9646
9647 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9648 {
9649
9651
9653 {
9655 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9657 return;
9658 }
9659
9662
9663
9664
9666 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9667
9668 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9669 {
9670 string particle_class = "";
9672 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9674
9675 if (entry_type == CT_CLASS)
9676 {
9677 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9678 WPOOH_array.Insert(WPOF);
9679 }
9680 }
9681
9682
9684 }
9685 }
9686 }
9687
9689 {
9691 }
9692
9694 {
9696 {
9698
9701
9704
9705 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9706 }
9707 }
9708
9710 {
9712 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9713
9715 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9716
9718 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9719
9721 {
9723 }
9724 }
9725
9727 {
9729 }
9730
9732 {
9735 else
9737
9739 {
9742 }
9743 else
9744 {
9747
9750 }
9751
9753 }
9754
9756 {
9758 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9759 }
9760
9762 {
9764 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9766 }
9767
9769 {
9771 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9772 }
9773
9775 {
9778
9779 OverheatingParticle OP = new OverheatingParticle();
9784
9786 }
9787
9789 {
9792
9793 return -1;
9794 }
9795
9797 {
9799 {
9802
9803 for (int i = count; i > 0; --i)
9804 {
9805 int id = i - 1;
9808
9811
9812 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9813 {
9814 if (p)
9815 {
9818 }
9819 }
9820 }
9821 }
9822 }
9823
9825 {
9827 {
9829 {
9830 int id = i - 1;
9832
9833 if (OP)
9834 {
9836
9837 if (p)
9838 {
9840 }
9841
9842 delete OP;
9843 }
9844 }
9845
9848 }
9849 }
9850
9853 {
9854 return 0.0;
9855 }
9856
9857
9859 {
9860 return 250;
9861 }
9862
9864 {
9865 return 0;
9866 }
9867
9870 {
9872 return true;
9873
9874 return false;
9875 }
9876
9879 {
9882
9884 {
9886 }
9887 else
9888 {
9889
9891 }
9892
9894 }
9895
9902 {
9903 return -1;
9904 }
9905
9906
9907
9908
9910 {
9912 {
9914 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9915
9916 if (r_index >= 0)
9917 {
9918 InventoryLocation r_il = new InventoryLocation;
9919 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9920
9921 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9924 {
9925 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9926 }
9928 {
9929 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9930 }
9931
9932 }
9933
9934 player.GetHumanInventory().ClearUserReservedLocation(this);
9935 }
9936
9939 }
9940
9941
9942
9943
9945 {
9946 return ItemBase.m_DebugActionsMask;
9947 }
9948
9950 {
9951 return ItemBase.m_DebugActionsMask & mask;
9952 }
9953
9955 {
9956 ItemBase.m_DebugActionsMask = mask;
9957 }
9958
9960 {
9961 ItemBase.m_DebugActionsMask |= mask;
9962 }
9963
9965 {
9966 ItemBase.m_DebugActionsMask &= ~mask;
9967 }
9968
9970 {
9972 {
9974 }
9975 else
9976 {
9978 }
9979 }
9980
9981
9983 {
9984 if (GetEconomyProfile())
9985 {
9986 float q_max = GetEconomyProfile().GetQuantityMax();
9987 if (q_max > 0)
9988 {
9989 float q_min = GetEconomyProfile().GetQuantityMin();
9990 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9991
9993 {
9994 ComponentEnergyManager comp = GetCompEM();
9996 {
9998 }
9999 }
10001 {
10003
10004 }
10005
10006 }
10007 }
10008 }
10009
10012 {
10013 EntityAI parent = GetHierarchyParent();
10014
10015 if (parent)
10016 {
10017 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10018 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10019 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10020 }
10021 }
10022
10025 {
10026 EntityAI parent = GetHierarchyParent();
10027
10028 if (parent)
10029 {
10030 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10031 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10032 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10033 }
10034 }
10035
10037 {
10038
10039
10040
10041
10043
10045 {
10046 if (ScriptInputUserData.CanStoreInputUserData())
10047 {
10048 ScriptInputUserData ctx = new ScriptInputUserData;
10054 ctx.
Write(use_stack_max);
10057
10059 {
10060 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10061 }
10062 }
10063 }
10064 else if (!
GetGame().IsMultiplayer())
10065 {
10067 }
10068 }
10069
10071 {
10073 }
10074
10076 {
10078 }
10079
10081 {
10083 }
10084
10086 {
10087
10088 return false;
10089 }
10090
10092 {
10093 return false;
10094 }
10095
10099 {
10100 return false;
10101 }
10102
10104 {
10105 return "";
10106 }
10107
10109
10111 {
10112 return false;
10113 }
10114
10116 {
10117 return true;
10118 }
10119
10120
10121
10123 {
10124 return true;
10125 }
10126
10128 {
10129 return true;
10130 }
10131
10133 {
10134 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10136 }
10137
10139 {
10141 }
10142
10144 {
10146 if (!is_being_placed)
10148 SetSynchDirty();
10149 }
10150
10151
10153
10155 {
10157 }
10158
10160 {
10162 }
10163
10165 {
10166 return 1;
10167 }
10168
10170 {
10171 return false;
10172 }
10173
10175 {
10177 SetSynchDirty();
10178 }
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10215 {
10216 super.OnMovedInsideCargo(container);
10217
10218 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10219 }
10220
10221 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10222 {
10223 super.EEItemLocationChanged(oldLoc,newLoc);
10224
10225 PlayerBase new_player = null;
10226 PlayerBase old_player = null;
10227
10228 if (newLoc.GetParent())
10229 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10230
10231 if (oldLoc.GetParent())
10232 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10233
10235 {
10236 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10237
10238 if (r_index >= 0)
10239 {
10240 InventoryLocation r_il = new InventoryLocation;
10241 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10242
10243 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10246 {
10247 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10248 }
10250 {
10251 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10252 }
10253
10254 }
10255 }
10256
10258 {
10259 if (new_player)
10260 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10261
10262 if (new_player == old_player)
10263 {
10264
10265 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10266 {
10268 {
10269 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10270 {
10271 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10272 }
10273 }
10274 else
10275 {
10276 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10277 }
10278 }
10279
10280 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10281 {
10282 int type = oldLoc.GetType();
10284 {
10285 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10286 }
10288 {
10289 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10290 }
10291 }
10292 if (!m_OldLocation)
10293 {
10294 m_OldLocation = new InventoryLocation;
10295 }
10296 m_OldLocation.Copy(oldLoc);
10297 }
10298 else
10299 {
10300 if (m_OldLocation)
10301 {
10302 m_OldLocation.Reset();
10303 }
10304 }
10305
10307 }
10308 else
10309 {
10310 if (new_player)
10311 {
10312 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10313 if (res_index >= 0)
10314 {
10315 InventoryLocation il = new InventoryLocation;
10316 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10318 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10321 {
10322 il.
GetParent().GetOnReleaseLock().Invoke(it);
10323 }
10325 {
10327 }
10328
10329 }
10330 }
10332 {
10333
10335 }
10336
10337 if (m_OldLocation)
10338 {
10339 m_OldLocation.Reset();
10340 }
10341 }
10342 }
10343
10344 override void EOnContact(IEntity other, Contact extra)
10345 {
10347 {
10348 int liquidType = -1;
10350 if (impactSpeed > 0.0)
10351 {
10353 #ifndef SERVER
10355 #else
10357 SetSynchDirty();
10358 #endif
10360 }
10361 }
10362
10363 #ifdef SERVER
10364 if (GetCompEM() && GetCompEM().IsPlugged())
10365 {
10366 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10367 GetCompEM().UnplugThis();
10368 }
10369 #endif
10370 }
10371
10373
10375 {
10377 }
10378
10380 {
10381
10382 }
10383
10385 {
10386 super.OnItemLocationChanged(old_owner, new_owner);
10387
10388 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10389 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10390
10391 if (!relatedPlayer && playerNew)
10392 relatedPlayer = playerNew;
10393
10394 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10395 {
10397 if (actionMgr)
10398 {
10399 ActionBase currentAction = actionMgr.GetRunningAction();
10400 if (currentAction)
10402 }
10403 }
10404
10405 Man ownerPlayerOld = null;
10406 Man ownerPlayerNew = null;
10407
10408 if (old_owner)
10409 {
10410 if (old_owner.
IsMan())
10411 {
10412 ownerPlayerOld = Man.Cast(old_owner);
10413 }
10414 else
10415 {
10416 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10417 }
10418 }
10419 else
10420 {
10422 {
10424
10425 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10426 {
10427 GetCompEM().UnplugThis();
10428 }
10429 }
10430 }
10431
10432 if (new_owner)
10433 {
10434 if (new_owner.
IsMan())
10435 {
10436 ownerPlayerNew = Man.Cast(new_owner);
10437 }
10438 else
10439 {
10440 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10441 }
10442 }
10443
10444 if (ownerPlayerOld != ownerPlayerNew)
10445 {
10446 if (ownerPlayerOld)
10447 {
10448 array<EntityAI> subItemsExit = new array<EntityAI>;
10450 for (int i = 0; i < subItemsExit.Count(); i++)
10451 {
10454 }
10455 }
10456
10457 if (ownerPlayerNew)
10458 {
10459 array<EntityAI> subItemsEnter = new array<EntityAI>;
10461 for (int j = 0; j < subItemsEnter.Count(); j++)
10462 {
10465 }
10466 }
10467 }
10468 else if (ownerPlayerNew != null)
10469 {
10470 PlayerBase nplayer;
10471 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10472 {
10473 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10475 for (int k = 0; k < subItemsUpdate.Count(); k++)
10476 {
10478 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10479 }
10480 }
10481 }
10482
10483 if (old_owner)
10484 old_owner.OnChildItemRemoved(this);
10485 if (new_owner)
10486 new_owner.OnChildItemReceived(this);
10487 }
10488
10489
10491 {
10492 super.EEDelete(parent);
10493 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10494 if (player)
10495 {
10497
10498 if (player.IsAlive())
10499 {
10500 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10501 if (r_index >= 0)
10502 {
10503 InventoryLocation r_il = new InventoryLocation;
10504 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10505
10506 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10509 {
10510 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10511 }
10513 {
10514 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10515 }
10516
10517 }
10518
10519 player.RemoveQuickBarEntityShortcut(this);
10520 }
10521 }
10522 }
10523
10525 {
10526 super.EEKilled(killer);
10527
10530 {
10531 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10532 {
10533 if (IsMagazine())
10534 {
10535 if (Magazine.Cast(this).GetAmmoCount() > 0)
10536 {
10538 }
10539 }
10540 else
10541 {
10543 }
10544 }
10545 }
10546 }
10547
10549 {
10550 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10551
10552 super.OnWasAttached(parent, slot_id);
10553
10556
10558 }
10559
10561 {
10562 super.OnWasDetached(parent, slot_id);
10563
10566 }
10567
10569 {
10570 int idx;
10573
10574 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10575 if (inventory_slots.Count() < 1)
10576 {
10577 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10578 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10579 }
10580 else
10581 {
10582 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10583 }
10584
10585 idx = inventory_slots.Find(slot);
10586 if (idx < 0)
10587 return "";
10588
10589 return attach_types.Get(idx);
10590 }
10591
10593 {
10594 int idx = -1;
10595 string slot;
10596
10599
10600 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10601 if (inventory_slots.Count() < 1)
10602 {
10603 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10604 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10605 }
10606 else
10607 {
10608 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10609 if (detach_types.Count() < 1)
10610 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10611 }
10612
10613 for (int i = 0; i < inventory_slots.Count(); i++)
10614 {
10615 slot = inventory_slots.Get(i);
10616 }
10617
10618 if (slot != "")
10619 {
10620 if (detach_types.Count() == 1)
10621 idx = 0;
10622 else
10623 idx = inventory_slots.Find(slot);
10624 }
10625 if (idx < 0)
10626 return "";
10627
10628 return detach_types.Get(idx);
10629 }
10630
10632 {
10633
10635
10636
10637 float min_time = 1;
10638 float max_time = 3;
10639 float delay = Math.RandomFloat(min_time, max_time);
10640
10641 explode_timer.Run(delay, this, "DoAmmoExplosion");
10642 }
10643
10645 {
10646 Magazine magazine = Magazine.Cast(this);
10647 int pop_sounds_count = 6;
10648 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10649
10650
10651 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10652 string sound_name = pop_sounds[ sound_idx ];
10654
10655
10656 magazine.ServerAddAmmoCount(-1);
10657
10658
10659 float min_temp_to_explode = 100;
10660
10661 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10662 {
10664 }
10665 }
10666
10667
10668 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10669 {
10670 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10671
10672 const int CHANCE_DAMAGE_CARGO = 4;
10673 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10674 const int CHANCE_DAMAGE_NOTHING = 2;
10675
10677 {
10678 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10679 int chances;
10680 int rnd;
10681
10682 if (GetInventory().GetCargo())
10683 {
10684 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10685 rnd = Math.RandomInt(0,chances);
10686
10687 if (rnd < CHANCE_DAMAGE_CARGO)
10688 {
10690 }
10691 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10692 {
10694 }
10695 }
10696 else
10697 {
10698 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10699 rnd = Math.RandomInt(0,chances);
10700
10701 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10702 {
10704 }
10705 }
10706 }
10707 }
10708
10710 {
10711 if (GetInventory().GetCargo())
10712 {
10713 int item_count = GetInventory().GetCargo().GetItemCount();
10714 if (item_count > 0)
10715 {
10716 int random_pick = Math.RandomInt(0, item_count);
10718 if (!item.IsExplosive())
10719 {
10720 item.AddHealth("","",damage);
10721 return true;
10722 }
10723 }
10724 }
10725 return false;
10726 }
10727
10729 {
10730 int attachment_count = GetInventory().AttachmentCount();
10731 if (attachment_count > 0)
10732 {
10733 int random_pick = Math.RandomInt(0, attachment_count);
10734 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10735 if (!attachment.IsExplosive())
10736 {
10737 attachment.AddHealth("","",damage);
10738 return true;
10739 }
10740 }
10741 return false;
10742 }
10743
10745 {
10747 }
10748
10750 {
10752 return GetInventory().CanRemoveEntity();
10753
10754 return false;
10755 }
10756
10758 {
10759
10761 return false;
10762
10763
10765 return false;
10766
10767
10768
10770 if (delta == 0)
10771 return false;
10772
10773
10774 return true;
10775 }
10776
10778 {
10780 {
10781 if (ScriptInputUserData.CanStoreInputUserData())
10782 {
10783 ScriptInputUserData ctx = new ScriptInputUserData;
10788 ctx.
Write(destination_entity);
10790 ctx.
Write(slot_id);
10792 }
10793 }
10794 else if (!
GetGame().IsMultiplayer())
10795 {
10797 }
10798 }
10799
10801 {
10802 float split_quantity_new;
10806 InventoryLocation loc = new InventoryLocation;
10807
10808 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10809 {
10811 split_quantity_new = stack_max;
10812 else
10814
10816 {
10817 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10818 if (new_item)
10819 {
10820 new_item.SetResultOfSplit(true);
10821 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10823 new_item.
SetQuantity(split_quantity_new,
false,
true);
10824 }
10825 }
10826 }
10827 else if (destination_entity && slot_id == -1)
10828 {
10829 if (quantity > stack_max)
10830 split_quantity_new = stack_max;
10831 else
10832 split_quantity_new = quantity;
10833
10835 {
10837 {
10840 }
10841
10842 if (new_item)
10843 {
10844 new_item.SetResultOfSplit(true);
10845 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10847 new_item.
SetQuantity(split_quantity_new,
false,
true);
10848 }
10849 }
10850 }
10851 else
10852 {
10853 if (stack_max != 0)
10854 {
10856 {
10858 }
10859
10860 if (split_quantity_new == 0)
10861 {
10862 if (!
GetGame().IsMultiplayer())
10863 player.PhysicalPredictiveDropItem(this);
10864 else
10865 player.ServerDropEntity(this);
10866 return;
10867 }
10868
10870 {
10872
10873 if (new_item)
10874 {
10875 new_item.SetResultOfSplit(true);
10876 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10879 new_item.PlaceOnSurface();
10880 }
10881 }
10882 }
10883 }
10884 }
10885
10887 {
10888 float split_quantity_new;
10892 InventoryLocation loc = new InventoryLocation;
10893
10894 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10895 {
10897 split_quantity_new = stack_max;
10898 else
10900
10902 {
10903 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10904 if (new_item)
10905 {
10906 new_item.SetResultOfSplit(true);
10907 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10909 new_item.
SetQuantity(split_quantity_new,
false,
true);
10910 }
10911 }
10912 }
10913 else if (destination_entity && slot_id == -1)
10914 {
10915 if (quantity > stack_max)
10916 split_quantity_new = stack_max;
10917 else
10918 split_quantity_new = quantity;
10919
10921 {
10923 {
10926 }
10927
10928 if (new_item)
10929 {
10930 new_item.SetResultOfSplit(true);
10931 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10933 new_item.
SetQuantity(split_quantity_new,
false,
true);
10934 }
10935 }
10936 }
10937 else
10938 {
10939 if (stack_max != 0)
10940 {
10942 {
10944 }
10945
10947 {
10949
10950 if (new_item)
10951 {
10952 new_item.SetResultOfSplit(true);
10953 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10956 new_item.PlaceOnSurface();
10957 }
10958 }
10959 }
10960 }
10961 }
10962
10964 {
10966 {
10967 if (ScriptInputUserData.CanStoreInputUserData())
10968 {
10969 ScriptInputUserData ctx = new ScriptInputUserData;
10974 dst.WriteToContext(ctx);
10976 }
10977 }
10978 else if (!
GetGame().IsMultiplayer())
10979 {
10981 }
10982 }
10983
10985 {
10987 {
10988 if (ScriptInputUserData.CanStoreInputUserData())
10989 {
10990 ScriptInputUserData ctx = new ScriptInputUserData;
10995 ctx.
Write(destination_entity);
11001 }
11002 }
11003 else if (!
GetGame().IsMultiplayer())
11004 {
11006 }
11007 }
11008
11010 {
11012 }
11013
11015 {
11017 float split_quantity_new;
11019 if (dst.IsValid())
11020 {
11021 int slot_id = dst.GetSlot();
11023
11024 if (quantity > stack_max)
11025 split_quantity_new = stack_max;
11026 else
11027 split_quantity_new = quantity;
11028
11030 {
11032
11033 if (new_item)
11034 {
11035 new_item.SetResultOfSplit(true);
11036 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11038 new_item.
SetQuantity(split_quantity_new,
false,
true);
11039 }
11040
11041 return new_item;
11042 }
11043 }
11044
11045 return null;
11046 }
11047
11049 {
11051 float split_quantity_new;
11053 if (destination_entity)
11054 {
11056 if (quantity > stackable)
11057 split_quantity_new = stackable;
11058 else
11059 split_quantity_new = quantity;
11060
11062 {
11063 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11064 if (new_item)
11065 {
11066 new_item.SetResultOfSplit(true);
11067 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11069 new_item.
SetQuantity(split_quantity_new,
false,
true);
11070 }
11071 }
11072 }
11073 }
11074
11076 {
11078 {
11079 if (ScriptInputUserData.CanStoreInputUserData())
11080 {
11081 ScriptInputUserData ctx = new ScriptInputUserData;
11086 ItemBase destination_entity =
this;
11087 ctx.
Write(destination_entity);
11091 }
11092 }
11093 else if (!
GetGame().IsMultiplayer())
11094 {
11096 }
11097 }
11098
11100 {
11102 float split_quantity_new;
11104 if (player)
11105 {
11107 if (quantity > stackable)
11108 split_quantity_new = stackable;
11109 else
11110 split_quantity_new = quantity;
11111
11113 {
11114 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11115 new_item =
ItemBase.Cast(in_hands);
11116 if (new_item)
11117 {
11118 new_item.SetResultOfSplit(true);
11119 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11121 new_item.SetQuantity(split_quantity_new, false, true);
11122 }
11123 }
11124 }
11125 }
11126
11128 {
11130 float split_quantity_new = Math.Floor(quantity * 0.5);
11131
11133 return;
11134
11136
11137 if (new_item)
11138 {
11139 if (new_item.GetQuantityMax() < split_quantity_new)
11140 {
11141 split_quantity_new = new_item.GetQuantityMax();
11142 }
11143
11144 new_item.SetResultOfSplit(true);
11145 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11146
11148 {
11151 }
11152 else
11153 {
11155 new_item.
SetQuantity(split_quantity_new,
false,
true);
11156 }
11157 }
11158 }
11159
11161 {
11163 float split_quantity_new = Math.Floor(quantity / 2);
11164
11166 return;
11167
11168 InventoryLocation invloc = new InventoryLocation;
11170
11172 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11173
11174 if (new_item)
11175 {
11176 if (new_item.GetQuantityMax() < split_quantity_new)
11177 {
11178 split_quantity_new = new_item.GetQuantityMax();
11179 }
11181 {
11184 }
11185 else if (split_quantity_new > 1)
11186 {
11188 new_item.
SetQuantity(split_quantity_new,
false,
true);
11189 }
11190 }
11191 }
11192
11195 {
11196 SetWeightDirty();
11198
11199 if (parent)
11200 parent.OnAttachmentQuantityChangedEx(this, delta);
11201
11203 {
11205 {
11207 }
11209 {
11210 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11212 }
11213 }
11214
11215 }
11216
11219 {
11220
11221 }
11222
11225 {
11227 }
11228
11230 {
11231 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11232
11234 {
11235 if (newLevel == GameConstants.STATE_RUINED)
11236 {
11238 EntityAI parent = GetHierarchyParent();
11239 if (parent && parent.IsFireplace())
11240 {
11241 CargoBase cargo = GetInventory().GetCargo();
11242 if (cargo)
11243 {
11245 {
11247 }
11248 }
11249 }
11250 }
11251
11253 {
11254
11256 return;
11257 }
11258
11259 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11260 {
11262 }
11263 }
11264 }
11265
11266
11268 {
11269 super.OnRightClick();
11270
11272 {
11274 {
11275 if (ScriptInputUserData.CanStoreInputUserData())
11276 {
11277 EntityAI root = GetHierarchyRoot();
11278 Man playerOwner = GetHierarchyRootPlayer();
11279 InventoryLocation dst = new InventoryLocation;
11280
11281
11282 if (!playerOwner && root && root == this)
11283 {
11285 }
11286 else
11287 {
11288
11289 GetInventory().GetCurrentInventoryLocation(dst);
11291 {
11294 {
11296 }
11297 else
11298 {
11300
11301
11302 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11303 {
11305 }
11306 else
11307 {
11308 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11309 }
11310 }
11311 }
11312 }
11313
11314 ScriptInputUserData ctx = new ScriptInputUserData;
11322 }
11323 }
11324 else if (!
GetGame().IsMultiplayer())
11325 {
11327 }
11328 }
11329 }
11330
11332 {
11333 if (root)
11334 {
11335 vector m4[4];
11336 root.GetTransform(m4);
11337 dst.SetGround(this, m4);
11338 }
11339 else
11340 {
11341 GetInventory().GetCurrentInventoryLocation(dst);
11342 }
11343 }
11344
11345 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11346 {
11347
11348 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11349 return false;
11350
11351 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11352 return false;
11353
11354
11356 return false;
11357
11358
11359 Magazine mag = Magazine.Cast(this);
11360 if (mag)
11361 {
11362 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11363 return false;
11364
11365 if (stack_max_limit)
11366 {
11367 Magazine other_mag = Magazine.Cast(other_item);
11368 if (other_item)
11369 {
11370 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11371 return false;
11372 }
11373
11374 }
11375 }
11376 else
11377 {
11378
11380 return false;
11381
11383 return false;
11384 }
11385
11386 PlayerBase player = null;
11387 if (CastTo(player, GetHierarchyRootPlayer()))
11388 {
11389 if (player.GetInventory().HasAttachment(this))
11390 return false;
11391
11392 if (player.IsItemsToDelete())
11393 return false;
11394 }
11395
11396 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11397 return false;
11398
11399 int slotID;
11401 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11402 return false;
11403
11404 return true;
11405 }
11406
11408 {
11410 }
11411
11413 {
11414 return m_IsResultOfSplit;
11415 }
11416
11418 {
11419 m_IsResultOfSplit = value;
11420 }
11421
11423 {
11425 }
11426
11428 {
11429 float other_item_quantity = other_item.GetQuantity();
11430 float this_free_space;
11431
11433
11435
11436 if (other_item_quantity > this_free_space)
11437 {
11438 return this_free_space;
11439 }
11440 else
11441 {
11442 return other_item_quantity;
11443 }
11444 }
11445
11447 {
11449 }
11450
11452 {
11454 return;
11455
11456 if (!IsMagazine() && other_item)
11457 {
11459 if (quantity_used != 0)
11460 {
11461 float hp1 = GetHealth01("","");
11462 float hp2 = other_item.GetHealth01("","");
11463 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11464 hpResult = hpResult / (
GetQuantity() + quantity_used);
11465
11466 hpResult *= GetMaxHealth();
11467 Math.Round(hpResult);
11468 SetHealth("", "Health", hpResult);
11469
11471 other_item.AddQuantity(-quantity_used);
11472 }
11473 }
11475 }
11476
11478 {
11479 #ifdef SERVER
11480 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11481 GetHierarchyParent().IncreaseLifetimeUp();
11482 #endif
11483 };
11484
11486 {
11487 PlayerBase p = PlayerBase.Cast(player);
11488
11489 array<int> recipesIds = p.m_Recipes;
11490 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11491 if (moduleRecipesManager)
11492 {
11493 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11494 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11495 }
11496
11497 for (int i = 0;i < recipesIds.Count(); i++)
11498 {
11499 int key = recipesIds.Get(i);
11500 string recipeName = moduleRecipesManager.GetRecipeName(key);
11502 }
11503 }
11504
11505
11506 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11507 {
11508 super.GetDebugActions(outputList);
11509
11510
11516
11517
11522
11527
11528
11532
11533
11535 {
11539 }
11540
11543
11544
11548
11550
11551 InventoryLocation loc = new InventoryLocation();
11552 GetInventory().GetCurrentInventoryLocation(loc);
11554 {
11555 if (Gizmo_IsSupported())
11558 }
11559
11561 }
11562
11563
11564
11565
11567 {
11568 super.OnAction(action_id, player, ctx);
11569
11571 {
11572 switch (action_id)
11573 {
11576 return true;
11579 return true;
11580 }
11581 }
11582
11584 {
11585 switch (action_id)
11586 {
11588 Delete();
11589 return true;
11590 }
11591 }
11592
11593 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11594 {
11595 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11596 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11597 PlayerBase p = PlayerBase.Cast(player);
11598 if (
EActions.RECIPES_RANGE_START < 1000)
11599 {
11600 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11601 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11602 }
11603 }
11604 #ifndef SERVER
11605 else if (action_id ==
EActions.WATCH_PLAYER)
11606 {
11607 PluginDeveloper.SetDeveloperItemClientEx(player);
11608 }
11609 #endif
11611 {
11612 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11613 {
11614 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11615 OnDebugButtonPressServer(id + 1);
11616 }
11617
11618 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11619 {
11620 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11622 }
11623
11624 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11625 {
11626 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11628 }
11629
11630 else if (action_id ==
EActions.ADD_QUANTITY)
11631 {
11632 if (IsMagazine())
11633 {
11634 Magazine mag = Magazine.Cast(this);
11635 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11636 }
11637 else
11638 {
11640 }
11641
11642 if (m_EM)
11643 {
11644 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11645 }
11646
11647 }
11648
11649 else if (action_id ==
EActions.REMOVE_QUANTITY)
11650 {
11651 if (IsMagazine())
11652 {
11653 Magazine mag2 = Magazine.Cast(this);
11654 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11655 }
11656 else
11657 {
11659 }
11660 if (m_EM)
11661 {
11662 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11663 }
11664
11665 }
11666
11667 else if (action_id ==
EActions.SET_QUANTITY_0)
11668 {
11670
11671 if (m_EM)
11672 {
11673 m_EM.SetEnergy(0);
11674 }
11675 }
11676
11677 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11678 {
11680
11681 if (m_EM)
11682 {
11683 m_EM.SetEnergy(m_EM.GetEnergyMax());
11684 }
11685 }
11686
11687 else if (action_id ==
EActions.ADD_HEALTH)
11688 {
11689 AddHealth("","",GetMaxHealth("","Health")/5);
11690 }
11691 else if (action_id ==
EActions.REMOVE_HEALTH)
11692 {
11693 AddHealth("","",-GetMaxHealth("","Health")/5);
11694 }
11695 else if (action_id ==
EActions.DESTROY_HEALTH)
11696 {
11697 SetHealth01("","",0);
11698 }
11699 else if (action_id ==
EActions.WATCH_ITEM)
11700 {
11702 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11703 #ifdef DEVELOPER
11704 SetDebugDeveloper_item(this);
11705 #endif
11706 }
11707
11708 else if (action_id ==
EActions.ADD_TEMPERATURE)
11709 {
11710 AddTemperature(20);
11711
11712 }
11713
11714 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11715 {
11716 AddTemperature(-20);
11717
11718 }
11719
11720 else if (action_id ==
EActions.FLIP_FROZEN)
11721 {
11722 SetFrozen(!GetIsFrozen());
11723
11724 }
11725
11726 else if (action_id ==
EActions.ADD_WETNESS)
11727 {
11729
11730 }
11731
11732 else if (action_id ==
EActions.REMOVE_WETNESS)
11733 {
11735
11736 }
11737
11738 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11739 {
11742
11743
11744 }
11745
11746 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11747 {
11750 }
11751
11752 else if (action_id ==
EActions.MAKE_SPECIAL)
11753 {
11754 auto debugParams = DebugSpawnParams.WithPlayer(player);
11755 OnDebugSpawnEx(debugParams);
11756 }
11757
11758 }
11759
11760
11761 return false;
11762 }
11763
11764
11765
11766
11770
11773
11774
11775
11777 {
11778 return false;
11779 }
11780
11781
11783 {
11784 return true;
11785 }
11786
11787
11789 {
11790 return true;
11791 }
11792
11793
11794
11796 {
11797 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11799 }
11800
11803 {
11804 return null;
11805 }
11806
11808 {
11809 return false;
11810 }
11811
11813 {
11814 return false;
11815 }
11816
11820
11821
11823 {
11824 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11825 return module_repairing.CanRepair(this, item_repair_kit);
11826 }
11827
11828
11829 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11830 {
11831 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11832 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11833 }
11834
11835
11837 {
11838
11839
11840
11841
11842
11843
11844
11845
11846 return 1;
11847 }
11848
11849
11850
11852 {
11854 }
11855
11856
11857
11859 {
11861 }
11862
11863
11872 {
11873 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11874
11875 if (player)
11876 {
11877 player.MessageStatus(text);
11878 }
11879 }
11880
11881
11890 {
11891 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11892
11893 if (player)
11894 {
11895 player.MessageAction(text);
11896 }
11897 }
11898
11899
11908 {
11909 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11910
11911 if (player)
11912 {
11913 player.MessageFriendly(text);
11914 }
11915 }
11916
11917
11926 {
11927 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11928
11929 if (player)
11930 {
11931 player.MessageImportant(text);
11932 }
11933 }
11934
11936 {
11937 return true;
11938 }
11939
11940
11941 override bool KindOf(
string tag)
11942 {
11943 bool found = false;
11944 string item_name = this.
GetType();
11947
11948 int array_size = item_tag_array.Count();
11949 for (int i = 0; i < array_size; i++)
11950 {
11951 if (item_tag_array.Get(i) == tag)
11952 {
11953 found = true;
11954 break;
11955 }
11956 }
11957 return found;
11958 }
11959
11960
11962 {
11963
11964 super.OnRPC(sender, rpc_type,ctx);
11965
11966
11967 switch (rpc_type)
11968 {
11969 #ifndef SERVER
11970 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11971 Param2<bool, string> p = new Param2<bool, string>(false, "");
11972
11974 return;
11975
11976 bool play = p.param1;
11977 string soundSet = p.param2;
11978
11979 if (play)
11980 {
11982 {
11984 {
11986 }
11987 }
11988 else
11989 {
11991 }
11992 }
11993 else
11994 {
11996 }
11997
11998 break;
11999 #endif
12000
12001 }
12002
12004 {
12006 }
12007 }
12008
12009
12010
12011
12013 {
12014 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12015 return plugin.GetID(
name);
12016 }
12017
12019 {
12020 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12021 return plugin.GetName(id);
12022 }
12023
12026 {
12027
12028
12029 int varFlags;
12030 if (!ctx.
Read(varFlags))
12031 return;
12032
12033 if (varFlags & ItemVariableFlags.FLOAT)
12034 {
12036 }
12037 }
12038
12040 {
12041
12042 super.SerializeNumericalVars(floats_out);
12043
12044
12045
12047 {
12049 }
12050
12052 {
12054 }
12055
12057 {
12059 }
12060
12062 {
12067 }
12068
12070 {
12072 }
12073 }
12074
12076 {
12077
12078 super.DeSerializeNumericalVars(floats);
12079
12080
12081 int index = 0;
12082 int mask = Math.Round(floats.Get(index));
12083
12084 index++;
12085
12087 {
12089 {
12091 }
12092 else
12093 {
12094 float quantity = floats.Get(index);
12095 SetQuantity(quantity,
true,
false,
false,
false);
12096 }
12097 index++;
12098 }
12099
12101 {
12102 float wet = floats.Get(index);
12104 index++;
12105 }
12106
12108 {
12109 int liquidtype = Math.Round(floats.Get(index));
12111 index++;
12112 }
12113
12115 {
12117 index++;
12119 index++;
12121 index++;
12123 index++;
12124 }
12125
12127 {
12128 int cleanness = Math.Round(floats.Get(index));
12130 index++;
12131 }
12132 }
12133
12135 {
12136 super.WriteVarsToCTX(ctx);
12137
12138
12140 {
12142 }
12143
12145 {
12147 }
12148
12150 {
12152 }
12153
12155 {
12156 int r,g,b,a;
12162 }
12163
12165 {
12167 }
12168 }
12169
12171 {
12172 if (!super.ReadVarsFromCTX(ctx,version))
12173 return false;
12174
12175 int intValue;
12176 float value;
12177
12178 if (version < 140)
12179 {
12180 if (!ctx.
Read(intValue))
12181 return false;
12182
12183 m_VariablesMask = intValue;
12184 }
12185
12187 {
12188 if (!ctx.
Read(value))
12189 return false;
12190
12192 {
12194 }
12195 else
12196 {
12198 }
12199 }
12200
12201 if (version < 140)
12202 {
12204 {
12205 if (!ctx.
Read(value))
12206 return false;
12207 SetTemperatureDirect(value);
12208 }
12209 }
12210
12212 {
12213 if (!ctx.
Read(value))
12214 return false;
12216 }
12217
12219 {
12220 if (!ctx.
Read(intValue))
12221 return false;
12223 }
12224
12226 {
12227 int r,g,b,a;
12229 return false;
12231 return false;
12233 return false;
12235 return false;
12236
12238 }
12239
12241 {
12242 if (!ctx.
Read(intValue))
12243 return false;
12245 }
12246
12247 if (version >= 138 && version < 140)
12248 {
12250 {
12251 if (!ctx.
Read(intValue))
12252 return false;
12253 SetFrozen(intValue);
12254 }
12255 }
12256
12257 return true;
12258 }
12259
12260
12262 {
12265 {
12267 }
12268
12269 if (!super.OnStoreLoad(ctx, version))
12270 {
12272 return false;
12273 }
12274
12275 if (version >= 114)
12276 {
12277 bool hasQuickBarIndexSaved;
12278
12279 if (!ctx.
Read(hasQuickBarIndexSaved))
12280 {
12282 return false;
12283 }
12284
12285 if (hasQuickBarIndexSaved)
12286 {
12287 int itmQBIndex;
12288
12289
12290 if (!ctx.
Read(itmQBIndex))
12291 {
12293 return false;
12294 }
12295
12296 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12297 if (itmQBIndex != -1 && parentPlayer)
12298 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12299 }
12300 }
12301 else
12302 {
12303
12304 PlayerBase player;
12305 int itemQBIndex;
12306 if (version ==
int.
MAX)
12307 {
12308 if (!ctx.
Read(itemQBIndex))
12309 {
12311 return false;
12312 }
12313 }
12314 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12315 {
12316
12317 if (!ctx.
Read(itemQBIndex))
12318 {
12320 return false;
12321 }
12322 if (itemQBIndex != -1 && player)
12323 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12324 }
12325 }
12326
12327 if (version < 140)
12328 {
12329
12330 if (!LoadVariables(ctx, version))
12331 {
12333 return false;
12334 }
12335 }
12336
12337
12339 {
12341 return false;
12342 }
12343 if (version >= 132)
12344 {
12346 if (raib)
12347 {
12349 {
12351 return false;
12352 }
12353 }
12354 }
12355
12357 return true;
12358 }
12359
12360
12361
12363 {
12364 super.OnStoreSave(ctx);
12365
12366 PlayerBase player;
12367 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12368 {
12370
12371 int itemQBIndex = -1;
12372 itemQBIndex = player.FindQuickBarEntityIndex(this);
12373 ctx.
Write(itemQBIndex);
12374 }
12375 else
12376 {
12378 }
12379
12381
12383 if (raib)
12384 {
12386 }
12387 }
12388
12389
12391 {
12392 super.AfterStoreLoad();
12393
12395 {
12397 }
12398
12400 {
12403 }
12404 }
12405
12407 {
12408 super.EEOnAfterLoad();
12409
12411 {
12413 }
12414
12417 }
12418
12420 {
12421 return false;
12422 }
12423
12424
12425
12427 {
12429 {
12430 #ifdef PLATFORM_CONSOLE
12431
12433 {
12435 if (menu)
12436 {
12438 }
12439 }
12440 #endif
12441 }
12442
12444 {
12447 }
12448
12450 {
12451 SetWeightDirty();
12453 }
12455 {
12458 }
12459
12461 {
12464 }
12466 {
12469 }
12470
12471 super.OnVariablesSynchronized();
12472 }
12473
12474
12475
12477 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12478 {
12479 if (!IsServerCheck(allow_client))
12480 return false;
12481
12483 return false;
12484
12487
12488 if (value <= (min + 0.001))
12489 value = min;
12490
12491 if (value == min)
12492 {
12493 if (destroy_config)
12494 {
12495 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12496 if (dstr)
12497 {
12499 this.Delete();
12500 return true;
12501 }
12502 }
12503 else if (destroy_forced)
12504 {
12506 this.Delete();
12507 return true;
12508 }
12509
12511 }
12512
12515
12517 {
12519
12520 if (delta)
12522 }
12523
12525
12526 return false;
12527 }
12528
12529
12531 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12532 {
12534 }
12535
12537 {
12540 }
12541
12543 {
12546 }
12547
12549 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12550 {
12551 float value_clamped = Math.Clamp(value, 0, 1);
12553 SetQuantity(result, destroy_config, destroy_forced);
12554 }
12555
12556
12559 {
12561 }
12562
12564 {
12566 }
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12578 {
12579 int slot = -1;
12580 if (GetInventory())
12581 {
12582 InventoryLocation il = new InventoryLocation;
12583 GetInventory().GetCurrentInventoryLocation(il);
12585 }
12586
12588 }
12589
12591 {
12592 float quantity_max = 0;
12593
12595 {
12596 if (attSlotID != -1)
12597 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12598
12599 if (quantity_max <= 0)
12601 }
12602
12603 if (quantity_max <= 0)
12605
12606 return quantity_max;
12607 }
12608
12610 {
12612 }
12613
12615 {
12617 }
12618
12619
12621 {
12623 }
12624
12626 {
12628 }
12629
12631 {
12633 }
12634
12635
12637 {
12638
12639 float weightEx = GetWeightEx();
12640 float special = GetInventoryAndCargoWeight();
12641 return weightEx - special;
12642 }
12643
12644
12646 {
12648 }
12649
12651 {
12653 {
12654 #ifdef DEVELOPER
12655 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12656 {
12657 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12659 }
12660 #endif
12661
12662 return GetQuantity() * GetConfigWeightModified();
12663 }
12664 else if (HasEnergyManager())
12665 {
12666 #ifdef DEVELOPER
12667 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12668 {
12669 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12670 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12671 }
12672 #endif
12673 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12674 }
12675 else
12676 {
12677 #ifdef DEVELOPER
12678 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12679 {
12680 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12681 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12682 }
12683 #endif
12684 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12685 }
12686 }
12687
12690 {
12691 int item_count = 0;
12693
12694 if (GetInventory().GetCargo() != NULL)
12695 {
12696 item_count = GetInventory().GetCargo().GetItemCount();
12697 }
12698
12699 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12700 {
12701 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12702 if (item)
12703 item_count += item.GetNumberOfItems();
12704 }
12705 return item_count;
12706 }
12707
12710 {
12711 float weight = 0;
12712 float wetness = 1;
12713 if (include_wetness)
12716 {
12717 weight = wetness * m_ConfigWeight;
12718 }
12720 {
12721 weight = 1;
12722 }
12723 return weight;
12724 }
12725
12726
12727
12729 {
12730 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12731 {
12732 GameInventory inv = GetInventory();
12733 array<EntityAI> items = new array<EntityAI>;
12735 for (int i = 0; i < items.Count(); i++)
12736 {
12738 if (item)
12739 {
12741 }
12742 }
12743 }
12744 }
12745
12746
12747
12748
12750 {
12751 float energy = 0;
12752 if (HasEnergyManager())
12753 {
12754 energy = GetCompEM().GetEnergy();
12755 }
12756 return energy;
12757 }
12758
12759
12761 {
12762 super.OnEnergyConsumed();
12763
12765 }
12766
12768 {
12769 super.OnEnergyAdded();
12770
12772 }
12773
12774
12776 {
12777 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12778 {
12780 {
12781 float energy_0to1 = GetCompEM().GetEnergy0To1();
12783 }
12784 }
12785 }
12786
12787
12789 {
12790 return ConfigGetFloat("heatIsolation");
12791 }
12792
12794 {
12796 }
12797
12799 {
12800 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12801 if (
GetGame().ConfigIsExisting(paramPath))
12803
12804 return 0.0;
12805 }
12806
12808 {
12809 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12810 if (
GetGame().ConfigIsExisting(paramPath))
12812
12813 return 0.0;
12814 }
12815
12816 override void SetWet(
float value,
bool allow_client =
false)
12817 {
12818 if (!IsServerCheck(allow_client))
12819 return;
12820
12823
12825
12826 m_VarWet = Math.Clamp(value, min, max);
12827
12829 {
12832 }
12833 }
12834
12835 override void AddWet(
float value)
12836 {
12838 }
12839
12841 {
12843 }
12844
12846 {
12848 }
12849
12851 {
12853 }
12854
12856 {
12858 }
12859
12861 {
12863 }
12864
12865 override void OnWetChanged(
float newVal,
float oldVal)
12866 {
12869 if (newLevel != oldLevel)
12870 {
12872 }
12873 }
12874
12876 {
12877 SetWeightDirty();
12878 }
12879
12881 {
12882 return GetWetLevelInternal(
m_VarWet);
12883 }
12884
12885
12886
12888 {
12890 }
12891
12893 {
12895 }
12896
12898 {
12900 }
12901
12903 {
12905 }
12906
12907
12908
12910 {
12911 if (ConfigIsExisting("itemModelLength"))
12912 {
12913 return ConfigGetFloat("itemModelLength");
12914 }
12915 return 0;
12916 }
12917
12919 {
12920 if (ConfigIsExisting("itemAttachOffset"))
12921 {
12922 return ConfigGetFloat("itemAttachOffset");
12923 }
12924 return 0;
12925 }
12926
12927 override void SetCleanness(
int value,
bool allow_client =
false)
12928 {
12929 if (!IsServerCheck(allow_client))
12930 return;
12931
12933
12935
12938 }
12939
12941 {
12943 }
12944
12946 {
12947 return true;
12948 }
12949
12950
12951
12952
12954 {
12956 }
12957
12959 {
12961 }
12962
12963
12964
12965
12966 override void SetColor(
int r,
int g,
int b,
int a)
12967 {
12973 }
12975 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12976 {
12981 }
12982
12984 {
12986 }
12987
12990 {
12991 int r,g,b,a;
12993 r = r/255;
12994 g = g/255;
12995 b = b/255;
12996 a = a/255;
12997 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12998 }
12999
13000
13001
13002 override void SetLiquidType(
int value,
bool allow_client =
false)
13003 {
13004 if (!IsServerCheck(allow_client))
13005 return;
13006
13011 }
13012
13014 {
13015 return ConfigGetInt("varLiquidTypeInit");
13016 }
13017
13019 {
13021 }
13022
13024 {
13026 SetFrozen(false);
13027 }
13028
13031 {
13032 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13033 }
13034
13035
13038 {
13039 PlayerBase nplayer;
13040 if (PlayerBase.CastTo(nplayer, player))
13041 {
13043
13044 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13045 }
13046 }
13047
13048
13051 {
13052 PlayerBase nplayer;
13053 if (PlayerBase.CastTo(nplayer,player))
13054 {
13055
13056 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13057
13058 }
13059
13060
13061 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13062
13063
13064 if (HasEnergyManager())
13065 {
13066 GetCompEM().UpdatePlugState();
13067 }
13068 }
13069
13070
13072 {
13073 super.OnPlacementStarted(player);
13074
13076 }
13077
13078 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13079 {
13081 {
13082 m_AdminLog.OnPlacementComplete(player,
this);
13083 }
13084
13085 super.OnPlacementComplete(player, position, orientation);
13086 }
13087
13088
13089
13090
13091
13093 {
13095 {
13096 return true;
13097 }
13098 else
13099 {
13100 return false;
13101 }
13102 }
13103
13104
13106 {
13108 {
13110 }
13111 }
13112
13113
13115 {
13117 }
13118
13120 {
13122 }
13123
13124 override void InsertAgent(
int agent,
float count = 1)
13125 {
13126 if (count < 1)
13127 return;
13128
13130 }
13131
13134 {
13136 }
13137
13138
13140 {
13142 }
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13186 {
13188 return false;
13189 return true;
13190 }
13191
13193 {
13194
13196 }
13197
13198
13201 {
13202 super.CheckForRoofLimited(timeTresholdMS);
13203
13205 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13206 {
13207 m_PreviousRoofTestTime = time;
13208 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13209 }
13210 }
13211
13212
13214 {
13216 {
13217 return 0;
13218 }
13219
13220 if (GetInventory().GetAttachmentSlotsCount() != 0)
13221 {
13222 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13223 if (filter)
13224 return filter.GetProtectionLevel(type, false, system);
13225 else
13226 return 0;
13227 }
13228
13229 string subclassPath, entryName;
13230
13231 switch (type)
13232 {
13234 entryName = "biological";
13235 break;
13237 entryName = "chemical";
13238 break;
13239 default:
13240 entryName = "biological";
13241 break;
13242 }
13243
13244 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13245
13247 }
13248
13249
13250
13253 {
13254 if (!IsMagazine())
13256
13258 }
13259
13260
13261
13262
13263
13268 {
13269 return true;
13270 }
13271
13273 {
13275 }
13276
13277
13278
13279
13280
13282 {
13283 if (parent)
13284 {
13285 if (parent.IsInherited(DayZInfected))
13286 return true;
13287
13288 if (!parent.IsRuined())
13289 return true;
13290 }
13291
13292 return true;
13293 }
13294
13296 {
13297 if (!super.CanPutAsAttachment(parent))
13298 {
13299 return false;
13300 }
13301
13302 if (!IsRuined() && !parent.IsRuined())
13303 {
13304 return true;
13305 }
13306
13307 return false;
13308 }
13309
13311 {
13312
13313
13314
13315
13316 return super.CanReceiveItemIntoCargo(item);
13317 }
13318
13320 {
13321
13322
13323
13324
13325 GameInventory attachmentInv = attachment.GetInventory();
13327 {
13328 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13329 return false;
13330 }
13331
13332 InventoryLocation loc = new InventoryLocation();
13333 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13334 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13335 return false;
13336
13337 return super.CanReceiveAttachment(attachment, slotId);
13338 }
13339
13341 {
13342 if (!super.CanReleaseAttachment(attachment))
13343 return false;
13344
13345 return GetInventory().AreChildrenAccessible();
13346 }
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13369 {
13370 int id = muzzle_owner.GetMuzzleID();
13371 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13372
13373 if (WPOF_array)
13374 {
13375 for (int i = 0; i < WPOF_array.Count(); i++)
13376 {
13377 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13378
13379 if (WPOF)
13380 {
13381 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13382 }
13383 }
13384 }
13385 }
13386
13387
13389 {
13390 int id = muzzle_owner.GetMuzzleID();
13392
13393 if (WPOBE_array)
13394 {
13395 for (int i = 0; i < WPOBE_array.Count(); i++)
13396 {
13397 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13398
13399 if (WPOBE)
13400 {
13401 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13402 }
13403 }
13404 }
13405 }
13406
13407
13409 {
13410 int id = muzzle_owner.GetMuzzleID();
13411 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13412
13413 if (WPOOH_array)
13414 {
13415 for (int i = 0; i < WPOOH_array.Count(); i++)
13416 {
13417 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13418
13419 if (WPOOH)
13420 {
13421 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13422 }
13423 }
13424 }
13425 }
13426
13427
13429 {
13430 int id = muzzle_owner.GetMuzzleID();
13431 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13432
13433 if (WPOOH_array)
13434 {
13435 for (int i = 0; i < WPOOH_array.Count(); i++)
13436 {
13437 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13438
13439 if (WPOOH)
13440 {
13441 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13442 }
13443 }
13444 }
13445 }
13446
13447
13449 {
13450 int id = muzzle_owner.GetMuzzleID();
13451 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13452
13453 if (WPOOH_array)
13454 {
13455 for (int i = 0; i < WPOOH_array.Count(); i++)
13456 {
13457 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13458
13459 if (WPOOH)
13460 {
13461 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13462 }
13463 }
13464 }
13465 }
13466
13467
13468
13470 {
13472 {
13473 return true;
13474 }
13475
13476 return false;
13477 }
13478
13480 {
13482 {
13483 return true;
13484 }
13485
13486 return false;
13487 }
13488
13490 {
13492 {
13493 return true;
13494 }
13495
13496 return false;
13497 }
13498
13500 {
13501 return false;
13502 }
13503
13506 {
13507 return UATimeSpent.DEFAULT_DEPLOY;
13508 }
13509
13510
13511
13512
13514 {
13516 SetSynchDirty();
13517 }
13518
13520 {
13522 }
13523
13524
13526 {
13527 return false;
13528 }
13529
13532 {
13533 string att_type = "None";
13534
13535 if (ConfigIsExisting("soundAttType"))
13536 {
13537 att_type = ConfigGetString("soundAttType");
13538 }
13539
13541 }
13542
13544 {
13546 }
13547
13548
13549
13550
13551
13557
13559 {
13562
13564 }
13565
13566
13568 {
13570 return;
13571
13573
13576
13579
13580 SoundParameters params = new SoundParameters();
13584 }
13585
13586
13588 {
13590 return;
13591
13593 SetSynchDirty();
13594
13597 }
13598
13599
13601 {
13603 return;
13604
13606 SetSynchDirty();
13607
13610 }
13611
13613 {
13615 }
13616
13618 {
13620 }
13621
13624 {
13625 if (!
GetGame().IsDedicatedServer())
13626 {
13627 if (ConfigIsExisting("attachSoundSet"))
13628 {
13629 string cfg_path = "";
13630 string soundset = "";
13631 string type_name =
GetType();
13632
13635 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13636 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13637
13638 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13639 {
13640 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13641 {
13642 if (cfg_slot_array[i] == slot_type)
13643 {
13644 soundset = cfg_soundset_array[i];
13645 break;
13646 }
13647 }
13648 }
13649
13650 if (soundset != "")
13651 {
13652 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13654 }
13655 }
13656 }
13657 }
13658
13660 {
13661
13662 }
13663
13664 void OnApply(PlayerBase player);
13665
13667 {
13668 return 1.0;
13669 };
13670
13672 {
13674 }
13675
13677 {
13679 }
13680
13682
13684 {
13685 SetDynamicPhysicsLifeTime(0.01);
13687 }
13688
13690 {
13691 array<string> zone_names = new array<string>;
13692 GetDamageZones(zone_names);
13693 for (int i = 0; i < zone_names.Count(); i++)
13694 {
13695 SetHealthMax(zone_names.Get(i),"Health");
13696 }
13697 SetHealthMax("","Health");
13698 }
13699
13702 {
13703 float global_health = GetHealth01("","Health");
13704 array<string> zones = new array<string>;
13705 GetDamageZones(zones);
13706
13707 for (int i = 0; i < zones.Count(); i++)
13708 {
13709 SetHealth01(zones.Get(i),"Health",global_health);
13710 }
13711 }
13712
13715 {
13716 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13717 }
13718
13720 {
13721 if (!hasRootAsPlayer)
13722 {
13723 if (refParentIB)
13724 {
13725
13726 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13727 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13728
13729 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13730 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13731
13734 }
13735 else
13736 {
13737
13740 }
13741 }
13742 }
13743
13745 {
13747 {
13748 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13749 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13750 {
13751 float heatPermCoef = 1.0;
13753 while (ent)
13754 {
13755 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13756 ent = ent.GetHierarchyParent();
13757 }
13758
13759 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13760 }
13761 }
13762 }
13763
13765 {
13766
13767 EntityAI parent = GetHierarchyParent();
13768 if (!parent)
13769 {
13770 hasParent = false;
13771 hasRootAsPlayer = false;
13772 }
13773 else
13774 {
13775 hasParent = true;
13776 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13777 refParentIB =
ItemBase.Cast(parent);
13778 }
13779 }
13780
13781 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13782 {
13783
13784 }
13785
13787 {
13788
13789 return false;
13790 }
13791
13793 {
13794
13795
13796 return false;
13797 }
13798
13800 {
13801
13802 return false;
13803 }
13804
13807 {
13808 return !GetIsFrozen() &&
IsOpen();
13809 }
13810
13812 {
13813 bool hasParent = false, hasRootAsPlayer = false;
13815
13816 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13817 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13818
13819 if (wwtu || foodDecay)
13820 {
13824
13825 if (processWetness || processTemperature || processDecay)
13826 {
13828
13829 if (processWetness)
13830 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13831
13832 if (processTemperature)
13834
13835 if (processDecay)
13836 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13837 }
13838 }
13839 }
13840
13843 {
13845 }
13846
13848 {
13851
13852 return super.GetTemperatureFreezeThreshold();
13853 }
13854
13856 {
13859
13860 return super.GetTemperatureThawThreshold();
13861 }
13862
13864 {
13867
13868 return super.GetItemOverheatThreshold();
13869 }
13870
13872 {
13874 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13875
13876 return super.GetTemperatureFreezeTime();
13877 }
13878
13880 {
13882 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13883
13884 return super.GetTemperatureThawTime();
13885 }
13886
13891
13893 {
13894 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13895 }
13896
13898 {
13899 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13900 }
13901
13904 {
13906 }
13907
13909 {
13911 }
13912
13914 {
13916 }
13917
13920 {
13921 return null;
13922 }
13923
13926 {
13927 return false;
13928 }
13929
13931 {
13933 {
13936 if (!trg)
13937 {
13939 explosive = this;
13940 }
13941
13942 explosive.PairRemote(trg);
13944
13945 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13946 trg.SetPersistentPairID(persistentID);
13947 explosive.SetPersistentPairID(persistentID);
13948
13949 return true;
13950 }
13951 return false;
13952 }
13953
13956 {
13957 float ret = 1.0;
13960 ret *= GetHealth01();
13961
13962 return ret;
13963 }
13964
13965 #ifdef DEVELOPER
13966 override void SetDebugItem()
13967 {
13968 super.SetDebugItem();
13969 _itemBase = this;
13970 }
13971
13973 {
13974 string text = super.GetDebugText();
13975
13977 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13978
13979 return text;
13980 }
13981 #endif
13982
13984 {
13985 return true;
13986 }
13987
13989
13991
13993 {
13996 }
13997
13998
14006
14022}
14023
14025{
14027 if (entity)
14028 {
14029 bool is_item = entity.IsInherited(
ItemBase);
14030 if (is_item && full_quantity)
14031 {
14034 }
14035 }
14036 else
14037 {
14039 return NULL;
14040 }
14041 return entity;
14042}
14043
14045{
14046 if (item)
14047 {
14048 if (health > 0)
14049 item.SetHealth("", "", health);
14050
14051 if (item.CanHaveTemperature())
14052 {
14054 if (item.CanFreeze())
14055 item.SetFrozen(false);
14056 }
14057
14058 if (item.HasEnergyManager())
14059 {
14060 if (quantity >= 0)
14061 {
14062 item.GetCompEM().SetEnergy0To1(quantity);
14063 }
14064 else
14065 {
14067 }
14068 }
14069 else if (item.IsMagazine())
14070 {
14071 Magazine mag = Magazine.Cast(item);
14072 if (quantity >= 0)
14073 {
14074 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14075 }
14076 else
14077 {
14079 }
14080
14081 }
14082 else
14083 {
14084 if (quantity >= 0)
14085 {
14086 item.SetQuantityNormalized(quantity, false);
14087 }
14088 else
14089 {
14091 }
14092
14093 }
14094 }
14095}
14096
14097#ifdef DEVELOPER
14099#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.