9232{
9234 {
9235 return true;
9236 }
9237};
9238
9239
9240
9242{
9246
9248
9251
9252
9253
9254
9255
9264
9270
9275
9280
9301 protected bool m_IsResultOfSplit
9302
9304
9309
9310
9311
9313
9317
9318
9319
9321
9324
9325
9326
9332
9333
9341
9344
9345
9347
9348
9350
9351
9356
9357
9362
9363
9365
9366
9368 {
9373
9374 if (!
GetGame().IsDedicatedServer())
9375 {
9377 {
9379
9381 {
9383 }
9384 }
9385
9388 }
9389
9390 m_OldLocation = null;
9391
9393 {
9395 }
9396
9397 if (ConfigIsExisting("headSelectionsToHide"))
9398 {
9401 }
9402
9404 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9405 {
9407 }
9408
9410
9411 m_IsResultOfSplit = false;
9412
9414 }
9415
9417 {
9418 super.InitItemVariables();
9419
9425 m_Count = ConfigGetInt(
"count");
9426
9429
9434
9437
9442
9454
9458
9459
9462 if (ConfigIsExisting("canBeSplit"))
9463 {
9466 }
9467
9469 if (ConfigIsExisting("itemBehaviour"))
9471
9472
9475 RegisterNetSyncVariableInt("m_VarLiquidType");
9476 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9477
9478 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9479 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9480 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9481
9482 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9483 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9484 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9485 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9486
9487 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9488 RegisterNetSyncVariableBool("m_IsTakeable");
9489 RegisterNetSyncVariableBool("m_IsHologram");
9490
9493 {
9496 }
9497
9499
9501 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9503
9504 }
9505
9507 {
9509 }
9510
9512 {
9515 {
9520 }
9521 }
9522
9523 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9524 {
9526 {
9529 }
9530
9532 }
9533
9535 {
9541 }
9542
9544
9546 {
9548
9549 if (!action)
9550 {
9551 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9552 return;
9553 }
9554
9556 if (!ai)
9557 {
9559 return;
9560 }
9561
9563 if (!action_array)
9564 {
9565 action_array = new array<ActionBase_Basic>;
9567 }
9568 if (LogManager.IsActionLogEnable())
9569 {
9570 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9571 }
9572
9573 if (action_array.Find(action) != -1)
9574 {
9575 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9576 }
9577 else
9578 {
9579 action_array.Insert(action);
9580 }
9581 }
9582
9584 {
9586 ActionBase action = player.GetActionManager().GetAction(actionName);
9589
9590 if (action_array)
9591 {
9592 action_array.RemoveItem(action);
9593 }
9594 }
9595
9596
9597
9599 {
9600 ActionOverrideData overrideData = new ActionOverrideData();
9604
9606 if (!actionMap)
9607 {
9610 }
9611
9612 actionMap.Insert(this.
Type(), overrideData);
9613
9614 }
9615
9617
9619
9620
9622 {
9625
9628
9629 string config_to_search = "CfgVehicles";
9630 string muzzle_owner_config;
9631
9633 {
9634 if (IsInherited(Weapon))
9635 config_to_search = "CfgWeapons";
9636
9637 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9638
9639 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9640
9642
9643 if (config_OnFire_subclass_count > 0)
9644 {
9645 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9646
9647 for (int i = 0; i < config_OnFire_subclass_count; i++)
9648 {
9649 string particle_class = "";
9651 string config_OnFire_entry = config_OnFire_class + particle_class;
9652 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9653 WPOF_array.Insert(WPOF);
9654 }
9655
9656
9658 }
9659 }
9660
9662 {
9663 config_to_search = "CfgWeapons";
9664 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9665
9666 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9667
9669
9670 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9671 {
9672 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9673
9674 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9675 {
9676 string particle_class2 = "";
9678 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9679 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9680 WPOBE_array.Insert(WPOBE);
9681 }
9682
9683
9685 }
9686 }
9687 }
9688
9689
9691 {
9694
9696 {
9697 string config_to_search = "CfgVehicles";
9698
9699 if (IsInherited(Weapon))
9700 config_to_search = "CfgWeapons";
9701
9702 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9703 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9704
9705 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9706 {
9707
9709
9711 {
9713 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9715 return;
9716 }
9717
9720
9721
9722
9724 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9725
9726 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9727 {
9728 string particle_class = "";
9730 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9732
9733 if (entry_type == CT_CLASS)
9734 {
9735 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9736 WPOOH_array.Insert(WPOF);
9737 }
9738 }
9739
9740
9742 }
9743 }
9744 }
9745
9747 {
9749 }
9750
9752 {
9754 {
9756
9759
9762
9763 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9764 }
9765 }
9766
9768 {
9770 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9771
9773 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9774
9776 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9777
9779 {
9781 }
9782 }
9783
9785 {
9787 }
9788
9790 {
9793 else
9795
9797 {
9800 }
9801 else
9802 {
9805
9808 }
9809
9811 }
9812
9814 {
9816 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9817 }
9818
9820 {
9822 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9824 }
9825
9827 {
9829 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9830 }
9831
9833 {
9836
9837 OverheatingParticle OP = new OverheatingParticle();
9842
9844 }
9845
9847 {
9850
9851 return -1;
9852 }
9853
9855 {
9857 {
9860
9861 for (int i = count; i > 0; --i)
9862 {
9863 int id = i - 1;
9866
9869
9870 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9871 {
9872 if (p)
9873 {
9876 }
9877 }
9878 }
9879 }
9880 }
9881
9883 {
9885 {
9887 {
9888 int id = i - 1;
9890
9891 if (OP)
9892 {
9894
9895 if (p)
9896 {
9898 }
9899
9900 delete OP;
9901 }
9902 }
9903
9906 }
9907 }
9908
9911 {
9912 return 0.0;
9913 }
9914
9915
9917 {
9918 return 250;
9919 }
9920
9922 {
9923 return 0;
9924 }
9925
9928 {
9930 return true;
9931
9932 return false;
9933 }
9934
9937 {
9940
9942 {
9944 }
9945 else
9946 {
9947
9949 }
9950
9952 }
9953
9960 {
9961 return -1;
9962 }
9963
9964
9965
9966
9968 {
9970 {
9972 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9973
9974 if (r_index >= 0)
9975 {
9976 InventoryLocation r_il = new InventoryLocation;
9977 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9978
9979 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9982 {
9983 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9984 }
9986 {
9987 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9988 }
9989
9990 }
9991
9992 player.GetHumanInventory().ClearUserReservedLocation(this);
9993 }
9994
9997 }
9998
9999
10000
10001
10003 {
10004 return ItemBase.m_DebugActionsMask;
10005 }
10006
10008 {
10009 return ItemBase.m_DebugActionsMask & mask;
10010 }
10011
10013 {
10014 ItemBase.m_DebugActionsMask = mask;
10015 }
10016
10018 {
10019 ItemBase.m_DebugActionsMask |= mask;
10020 }
10021
10023 {
10024 ItemBase.m_DebugActionsMask &= ~mask;
10025 }
10026
10028 {
10030 {
10032 }
10033 else
10034 {
10036 }
10037 }
10038
10039
10041 {
10042 if (GetEconomyProfile())
10043 {
10044 float q_max = GetEconomyProfile().GetQuantityMax();
10045 if (q_max > 0)
10046 {
10047 float q_min = GetEconomyProfile().GetQuantityMin();
10048 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10049
10051 {
10052 ComponentEnergyManager comp = GetCompEM();
10054 {
10056 }
10057 }
10059 {
10061
10062 }
10063
10064 }
10065 }
10066 }
10067
10070 {
10071 EntityAI parent = GetHierarchyParent();
10072
10073 if (parent)
10074 {
10075 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10076 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10077 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10078 }
10079 }
10080
10083 {
10084 EntityAI parent = GetHierarchyParent();
10085
10086 if (parent)
10087 {
10088 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10089 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10090 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10091 }
10092 }
10093
10095 {
10096
10097
10098
10099
10101
10103 {
10104 if (ScriptInputUserData.CanStoreInputUserData())
10105 {
10106 ScriptInputUserData ctx = new ScriptInputUserData;
10112 ctx.
Write(use_stack_max);
10115
10117 {
10118 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10119 }
10120 }
10121 }
10122 else if (!
GetGame().IsMultiplayer())
10123 {
10125 }
10126 }
10127
10129 {
10131 }
10132
10134 {
10136 }
10137
10139 {
10141 }
10142
10144 {
10145
10146 return false;
10147 }
10148
10150 {
10151 return false;
10152 }
10153
10157 {
10158 return false;
10159 }
10160
10162 {
10163 return "";
10164 }
10165
10167
10169 {
10170 return false;
10171 }
10172
10174 {
10175 return true;
10176 }
10177
10178
10179
10181 {
10182 return true;
10183 }
10184
10186 {
10187 return true;
10188 }
10189
10191 {
10192 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10194 }
10195
10197 {
10199 }
10200
10202 {
10204 if (!is_being_placed)
10206 SetSynchDirty();
10207 }
10208
10209
10211
10213 {
10215 }
10216
10218 {
10220 }
10221
10223 {
10224 return 1;
10225 }
10226
10228 {
10229 return false;
10230 }
10231
10233 {
10235 SetSynchDirty();
10236 }
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10273 {
10274 super.OnMovedInsideCargo(container);
10275
10276 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10277 }
10278
10279 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10280 {
10281 super.EEItemLocationChanged(oldLoc,newLoc);
10282
10283 PlayerBase new_player = null;
10284 PlayerBase old_player = null;
10285
10286 if (newLoc.GetParent())
10287 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10288
10289 if (oldLoc.GetParent())
10290 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10291
10293 {
10294 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10295
10296 if (r_index >= 0)
10297 {
10298 InventoryLocation r_il = new InventoryLocation;
10299 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10300
10301 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10304 {
10305 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10306 }
10308 {
10309 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10310 }
10311
10312 }
10313 }
10314
10316 {
10317 if (new_player)
10318 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10319
10320 if (new_player == old_player)
10321 {
10322
10323 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10324 {
10326 {
10327 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10328 {
10329 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10330 }
10331 }
10332 else
10333 {
10334 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10335 }
10336 }
10337
10338 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10339 {
10340 int type = oldLoc.GetType();
10342 {
10343 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10344 }
10346 {
10347 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10348 }
10349 }
10350 if (!m_OldLocation)
10351 {
10352 m_OldLocation = new InventoryLocation;
10353 }
10354 m_OldLocation.Copy(oldLoc);
10355 }
10356 else
10357 {
10358 if (m_OldLocation)
10359 {
10360 m_OldLocation.Reset();
10361 }
10362 }
10363
10365 }
10366 else
10367 {
10368 if (new_player)
10369 {
10370 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10371 if (res_index >= 0)
10372 {
10373 InventoryLocation il = new InventoryLocation;
10374 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10376 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10379 {
10380 il.
GetParent().GetOnReleaseLock().Invoke(it);
10381 }
10383 {
10385 }
10386
10387 }
10388 }
10390 {
10391
10393 }
10394
10395 if (m_OldLocation)
10396 {
10397 m_OldLocation.Reset();
10398 }
10399 }
10400 }
10401
10402 override void EOnContact(IEntity other, Contact extra)
10403 {
10405 {
10406 int liquidType = -1;
10408 if (impactSpeed > 0.0)
10409 {
10411 #ifndef SERVER
10413 #else
10415 SetSynchDirty();
10416 #endif
10418 }
10419 }
10420
10421 #ifdef SERVER
10422 if (GetCompEM() && GetCompEM().IsPlugged())
10423 {
10424 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10425 GetCompEM().UnplugThis();
10426 }
10427 #endif
10428 }
10429
10431
10433 {
10435 }
10436
10438 {
10439
10440 }
10441
10443 {
10444 super.OnItemLocationChanged(old_owner, new_owner);
10445
10446 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10447 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10448
10449 if (!relatedPlayer && playerNew)
10450 relatedPlayer = playerNew;
10451
10452 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10453 {
10455 if (actionMgr)
10456 {
10457 ActionBase currentAction = actionMgr.GetRunningAction();
10458 if (currentAction)
10460 }
10461 }
10462
10463 Man ownerPlayerOld = null;
10464 Man ownerPlayerNew = null;
10465
10466 if (old_owner)
10467 {
10468 if (old_owner.
IsMan())
10469 {
10470 ownerPlayerOld = Man.Cast(old_owner);
10471 }
10472 else
10473 {
10474 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10475 }
10476 }
10477 else
10478 {
10480 {
10482
10483 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10484 {
10485 GetCompEM().UnplugThis();
10486 }
10487 }
10488 }
10489
10490 if (new_owner)
10491 {
10492 if (new_owner.
IsMan())
10493 {
10494 ownerPlayerNew = Man.Cast(new_owner);
10495 }
10496 else
10497 {
10498 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10499 }
10500 }
10501
10502 if (ownerPlayerOld != ownerPlayerNew)
10503 {
10504 if (ownerPlayerOld)
10505 {
10506 array<EntityAI> subItemsExit = new array<EntityAI>;
10508 for (int i = 0; i < subItemsExit.Count(); i++)
10509 {
10512 }
10513 }
10514
10515 if (ownerPlayerNew)
10516 {
10517 array<EntityAI> subItemsEnter = new array<EntityAI>;
10519 for (int j = 0; j < subItemsEnter.Count(); j++)
10520 {
10523 }
10524 }
10525 }
10526 else if (ownerPlayerNew != null)
10527 {
10528 PlayerBase nplayer;
10529 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10530 {
10531 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10533 for (int k = 0; k < subItemsUpdate.Count(); k++)
10534 {
10536 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10537 }
10538 }
10539 }
10540
10541 if (old_owner)
10542 old_owner.OnChildItemRemoved(this);
10543 if (new_owner)
10544 new_owner.OnChildItemReceived(this);
10545 }
10546
10547
10549 {
10550 super.EEDelete(parent);
10551 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10552 if (player)
10553 {
10555
10556 if (player.IsAlive())
10557 {
10558 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10559 if (r_index >= 0)
10560 {
10561 InventoryLocation r_il = new InventoryLocation;
10562 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10563
10564 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10567 {
10568 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10569 }
10571 {
10572 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10573 }
10574
10575 }
10576
10577 player.RemoveQuickBarEntityShortcut(this);
10578 }
10579 }
10580 }
10581
10583 {
10584 super.EEKilled(killer);
10585
10588 {
10589 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10590 {
10591 if (IsMagazine())
10592 {
10593 if (Magazine.Cast(this).GetAmmoCount() > 0)
10594 {
10596 }
10597 }
10598 else
10599 {
10601 }
10602 }
10603 }
10604 }
10605
10607 {
10608 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10609
10610 super.OnWasAttached(parent, slot_id);
10611
10614
10616 }
10617
10619 {
10620 super.OnWasDetached(parent, slot_id);
10621
10624 }
10625
10627 {
10628 int idx;
10631
10632 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10633 if (inventory_slots.Count() < 1)
10634 {
10635 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10636 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10637 }
10638 else
10639 {
10640 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10641 }
10642
10643 idx = inventory_slots.Find(slot);
10644 if (idx < 0)
10645 return "";
10646
10647 return attach_types.Get(idx);
10648 }
10649
10651 {
10652 int idx = -1;
10653 string slot;
10654
10657
10658 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10659 if (inventory_slots.Count() < 1)
10660 {
10661 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10662 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10663 }
10664 else
10665 {
10666 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10667 if (detach_types.Count() < 1)
10668 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10669 }
10670
10671 for (int i = 0; i < inventory_slots.Count(); i++)
10672 {
10673 slot = inventory_slots.Get(i);
10674 }
10675
10676 if (slot != "")
10677 {
10678 if (detach_types.Count() == 1)
10679 idx = 0;
10680 else
10681 idx = inventory_slots.Find(slot);
10682 }
10683 if (idx < 0)
10684 return "";
10685
10686 return detach_types.Get(idx);
10687 }
10688
10690 {
10691
10693
10694
10695 float min_time = 1;
10696 float max_time = 3;
10697 float delay = Math.RandomFloat(min_time, max_time);
10698
10699 explode_timer.Run(delay, this, "DoAmmoExplosion");
10700 }
10701
10703 {
10704 Magazine magazine = Magazine.Cast(this);
10705 int pop_sounds_count = 6;
10706 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10707
10708
10709 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10710 string sound_name = pop_sounds[ sound_idx ];
10712
10713
10714 magazine.ServerAddAmmoCount(-1);
10715
10716
10717 float min_temp_to_explode = 100;
10718
10719 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10720 {
10722 }
10723 }
10724
10725
10726 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10727 {
10728 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10729
10730 const int CHANCE_DAMAGE_CARGO = 4;
10731 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10732 const int CHANCE_DAMAGE_NOTHING = 2;
10733
10735 {
10736 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10737 int chances;
10738 int rnd;
10739
10740 if (GetInventory().GetCargo())
10741 {
10742 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10743 rnd = Math.RandomInt(0,chances);
10744
10745 if (rnd < CHANCE_DAMAGE_CARGO)
10746 {
10748 }
10749 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10750 {
10752 }
10753 }
10754 else
10755 {
10756 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10757 rnd = Math.RandomInt(0,chances);
10758
10759 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10760 {
10762 }
10763 }
10764 }
10765 }
10766
10768 {
10769 if (GetInventory().GetCargo())
10770 {
10771 int item_count = GetInventory().GetCargo().GetItemCount();
10772 if (item_count > 0)
10773 {
10774 int random_pick = Math.RandomInt(0, item_count);
10776 if (!item.IsExplosive())
10777 {
10778 item.AddHealth("","",damage);
10779 return true;
10780 }
10781 }
10782 }
10783 return false;
10784 }
10785
10787 {
10788 int attachment_count = GetInventory().AttachmentCount();
10789 if (attachment_count > 0)
10790 {
10791 int random_pick = Math.RandomInt(0, attachment_count);
10792 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10793 if (!attachment.IsExplosive())
10794 {
10795 attachment.AddHealth("","",damage);
10796 return true;
10797 }
10798 }
10799 return false;
10800 }
10801
10803 {
10805 }
10806
10808 {
10810 return GetInventory().CanRemoveEntity();
10811
10812 return false;
10813 }
10814
10816 {
10818 return;
10819
10821 {
10822 if (ScriptInputUserData.CanStoreInputUserData())
10823 {
10824 ScriptInputUserData ctx = new ScriptInputUserData;
10829 ctx.
Write(destination_entity);
10831 ctx.
Write(slot_id);
10833 }
10834 }
10835 else if (!
GetGame().IsMultiplayer())
10836 {
10838 }
10839 }
10840
10842 {
10844 return;
10845
10846 float split_quantity_new;
10850 InventoryLocation loc = new InventoryLocation;
10851
10852 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10853 {
10855 split_quantity_new = stack_max;
10856 else
10858
10859 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10860 if (new_item)
10861 {
10862 new_item.SetResultOfSplit(true);
10863 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10865 new_item.SetQuantity(split_quantity_new);
10866 }
10867 }
10868 else if (destination_entity && slot_id == -1)
10869 {
10870 if (quantity > stack_max)
10871 split_quantity_new = stack_max;
10872 else
10873 split_quantity_new = quantity;
10874
10876 {
10879 }
10880
10881 if (new_item)
10882 {
10883 new_item.SetResultOfSplit(true);
10884 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10886 new_item.SetQuantity(split_quantity_new);
10887 }
10888 }
10889 else
10890 {
10891 if (stack_max != 0)
10892 {
10894 {
10896 }
10897
10898 if (split_quantity_new == 0)
10899 {
10900 if (!
GetGame().IsMultiplayer())
10901 player.PhysicalPredictiveDropItem(this);
10902 else
10903 player.ServerDropEntity(this);
10904 return;
10905 }
10906
10908
10909 if (new_item)
10910 {
10911 new_item.SetResultOfSplit(true);
10912 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10914 new_item.SetQuantity(stack_max);
10915 new_item.PlaceOnSurface();
10916 }
10917 }
10918 }
10919 }
10920
10922 {
10924 return;
10925
10926 float split_quantity_new;
10930 InventoryLocation loc = new InventoryLocation;
10931
10932 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10933 {
10935 split_quantity_new = stack_max;
10936 else
10938
10939 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10940 if (new_item)
10941 {
10942 new_item.SetResultOfSplit(true);
10943 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10945 new_item.SetQuantity(split_quantity_new);
10946 }
10947 }
10948 else if (destination_entity && slot_id == -1)
10949 {
10950 if (quantity > stack_max)
10951 split_quantity_new = stack_max;
10952 else
10953 split_quantity_new = quantity;
10954
10956 {
10959 }
10960
10961 if (new_item)
10962 {
10963 new_item.SetResultOfSplit(true);
10964 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10966 new_item.SetQuantity(split_quantity_new);
10967 }
10968 }
10969 else
10970 {
10971 if (stack_max != 0)
10972 {
10974 {
10976 }
10977
10979
10980 if (new_item)
10981 {
10982 new_item.SetResultOfSplit(true);
10983 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10985 new_item.SetQuantity(stack_max);
10986 new_item.PlaceOnSurface();
10987 }
10988 }
10989 }
10990 }
10991
10993 {
10995 return;
10996
10998 {
10999 if (ScriptInputUserData.CanStoreInputUserData())
11000 {
11001 ScriptInputUserData ctx = new ScriptInputUserData;
11006 dst.WriteToContext(ctx);
11008 }
11009 }
11010 else if (!
GetGame().IsMultiplayer())
11011 {
11013 }
11014 }
11015
11017 {
11019 return;
11020
11022 {
11023 if (ScriptInputUserData.CanStoreInputUserData())
11024 {
11025 ScriptInputUserData ctx = new ScriptInputUserData;
11030 ctx.
Write(destination_entity);
11036 }
11037 }
11038 else if (!
GetGame().IsMultiplayer())
11039 {
11041 }
11042 }
11043
11045 {
11047 }
11048
11050 {
11052 return this;
11053
11055 float split_quantity_new;
11057 if (dst.IsValid())
11058 {
11059 int slot_id = dst.GetSlot();
11061
11062 if (quantity > stack_max)
11063 split_quantity_new = stack_max;
11064 else
11065 split_quantity_new = quantity;
11066
11068
11069 if (new_item)
11070 {
11071 new_item.SetResultOfSplit(true);
11072 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11075 }
11076
11077 return new_item;
11078 }
11079
11080 return null;
11081 }
11082
11084 {
11086 return;
11087
11089 float split_quantity_new;
11091 if (destination_entity)
11092 {
11094 if (quantity > stackable)
11095 split_quantity_new = stackable;
11096 else
11097 split_quantity_new = quantity;
11098
11099 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11100 if (new_item)
11101 {
11102 new_item.SetResultOfSplit(true);
11103 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11105 new_item.SetQuantity(split_quantity_new);
11106 }
11107 }
11108 }
11109
11111 {
11113 return;
11114
11116 {
11117 if (ScriptInputUserData.CanStoreInputUserData())
11118 {
11119 ScriptInputUserData ctx = new ScriptInputUserData;
11124 ItemBase destination_entity =
this;
11125 ctx.
Write(destination_entity);
11129 }
11130 }
11131 else if (!
GetGame().IsMultiplayer())
11132 {
11134 }
11135 }
11136
11138 {
11140 return;
11141
11143 float split_quantity_new;
11145 if (player)
11146 {
11148 if (quantity > stackable)
11149 split_quantity_new = stackable;
11150 else
11151 split_quantity_new = quantity;
11152
11153 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11154 new_item =
ItemBase.Cast(in_hands);
11155 if (new_item)
11156 {
11157 new_item.SetResultOfSplit(true);
11158 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11160 new_item.SetQuantity(split_quantity_new);
11161 }
11162 }
11163 }
11164
11166 {
11168 return;
11169
11171 float split_quantity_new = Math.Floor(quantity * 0.5);
11172
11174
11175 if (new_item)
11176 {
11177 if (new_item.GetQuantityMax() < split_quantity_new)
11178 {
11179 split_quantity_new = new_item.GetQuantityMax();
11180 }
11181
11182 new_item.SetResultOfSplit(true);
11183 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11184
11186 {
11189 }
11190 else
11191 {
11194 }
11195 }
11196 }
11197
11199 {
11201 return;
11202
11204 float split_quantity_new = Math.Floor(quantity / 2);
11205
11206 InventoryLocation invloc = new InventoryLocation;
11208
11210 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11211
11212 if (new_item)
11213 {
11214 if (new_item.GetQuantityMax() < split_quantity_new)
11215 {
11216 split_quantity_new = new_item.GetQuantityMax();
11217 }
11219 {
11222 }
11223 else
11224 {
11227 }
11228 }
11229 }
11230
11233 {
11234 SetWeightDirty();
11236
11237 if (parent)
11238 parent.OnAttachmentQuantityChangedEx(this, delta);
11239
11241 {
11243 {
11245 }
11247 {
11248 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11250 }
11251 }
11252
11253 }
11254
11257 {
11258
11259 }
11260
11263 {
11265 }
11266
11268 {
11269 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11270
11272 {
11273 if (newLevel == GameConstants.STATE_RUINED)
11274 {
11276 EntityAI parent = GetHierarchyParent();
11277 if (parent && parent.IsFireplace())
11278 {
11279 CargoBase cargo = GetInventory().GetCargo();
11280 if (cargo)
11281 {
11283 {
11285 }
11286 }
11287 }
11288 }
11289
11291 {
11292
11294 return;
11295 }
11296
11297 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11298 {
11300 }
11301 }
11302 }
11303
11304
11306 {
11307 super.OnRightClick();
11308
11310 {
11312 {
11313 if (ScriptInputUserData.CanStoreInputUserData())
11314 {
11315 vector m4[4];
11317
11318 EntityAI root = GetHierarchyRoot();
11319
11320 InventoryLocation dst = new InventoryLocation;
11322 {
11323 if (root)
11324 {
11325 root.GetTransform(m4);
11327 }
11328 else
11329 GetInventory().GetCurrentInventoryLocation(dst);
11330 }
11331 else
11332 {
11334
11335
11336 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11337 {
11338 if (root)
11339 {
11340 root.GetTransform(m4);
11342 }
11343 else
11344 GetInventory().GetCurrentInventoryLocation(dst);
11345 }
11346 else
11347 {
11348 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11349 }
11350 }
11351
11352 ScriptInputUserData ctx = new ScriptInputUserData;
11360 }
11361 }
11362 else if (!
GetGame().IsMultiplayer())
11363 {
11365 }
11366 }
11367 }
11368
11369 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11370 {
11371
11372 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11373 return false;
11374
11375 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11376 return false;
11377
11378
11380 return false;
11381
11382
11383 Magazine mag = Magazine.Cast(this);
11384 if (mag)
11385 {
11386 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11387 return false;
11388
11389 if (stack_max_limit)
11390 {
11391 Magazine other_mag = Magazine.Cast(other_item);
11392 if (other_item)
11393 {
11394 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11395 return false;
11396 }
11397
11398 }
11399 }
11400 else
11401 {
11402
11404 return false;
11405
11407 return false;
11408 }
11409
11410 PlayerBase player = null;
11411 if (CastTo(player, GetHierarchyRootPlayer()))
11412 {
11413 if (player.GetInventory().HasAttachment(this))
11414 return false;
11415
11416 if (player.IsItemsToDelete())
11417 return false;
11418 }
11419
11420 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11421 return false;
11422
11423 int slotID;
11425 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11426 return false;
11427
11428 return true;
11429 }
11430
11432 {
11434 }
11435
11437 {
11438 return m_IsResultOfSplit;
11439 }
11440
11442 {
11443 m_IsResultOfSplit = value;
11444 }
11445
11447 {
11449 }
11450
11452 {
11453 float other_item_quantity = other_item.GetQuantity();
11454 float this_free_space;
11455
11457
11459
11460 if (other_item_quantity > this_free_space)
11461 {
11462 return this_free_space;
11463 }
11464 else
11465 {
11466 return other_item_quantity;
11467 }
11468 }
11469
11471 {
11473 }
11474
11476 {
11478 return;
11479
11480 if (!IsMagazine() && other_item)
11481 {
11483 if (quantity_used != 0)
11484 {
11485 float hp1 = GetHealth01("","");
11486 float hp2 = other_item.GetHealth01("","");
11487 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11488 hpResult = hpResult / (
GetQuantity() + quantity_used);
11489
11490 hpResult *= GetMaxHealth();
11491 Math.Round(hpResult);
11492 SetHealth("", "Health", hpResult);
11493
11495 other_item.AddQuantity(-quantity_used);
11496 }
11497 }
11499 }
11500
11502 {
11503 #ifdef SERVER
11504 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11505 GetHierarchyParent().IncreaseLifetimeUp();
11506 #endif
11507 };
11508
11510 {
11511 PlayerBase p = PlayerBase.Cast(player);
11512
11513 array<int> recipesIds = p.m_Recipes;
11514 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11515 if (moduleRecipesManager)
11516 {
11517 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11518 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11519 }
11520
11521 for (int i = 0;i < recipesIds.Count(); i++)
11522 {
11523 int key = recipesIds.Get(i);
11524 string recipeName = moduleRecipesManager.GetRecipeName(key);
11526 }
11527 }
11528
11529
11530 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11531 {
11532 super.GetDebugActions(outputList);
11533
11534
11539
11540
11544
11548
11549
11552
11553
11555 {
11558 }
11559
11561
11564
11568 }
11569
11570
11571
11572
11574 {
11575 super.OnAction(action_id, player, ctx);
11576 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11577 {
11578 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11579 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11580 PlayerBase p = PlayerBase.Cast(player);
11581 if (
EActions.RECIPES_RANGE_START < 1000)
11582 {
11583 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11584 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11585 }
11586 }
11587 #ifndef SERVER
11588 else if (action_id ==
EActions.WATCH_PLAYER)
11589 {
11590 PluginDeveloper.SetDeveloperItemClientEx(player);
11591 }
11592 #endif
11594 {
11595 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11596 {
11597 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11598 OnDebugButtonPressServer(id + 1);
11599 }
11600
11601 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11602 {
11603 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11605 }
11606
11607 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11608 {
11609 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11611 }
11612
11613 else if (action_id ==
EActions.ADD_QUANTITY)
11614 {
11615 if (IsMagazine())
11616 {
11617 Magazine mag = Magazine.Cast(this);
11618 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11619 }
11620 else
11621 {
11623 }
11624
11625 if (m_EM)
11626 {
11627 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11628 }
11629
11630 }
11631
11632 else if (action_id ==
EActions.REMOVE_QUANTITY)
11633 {
11634 if (IsMagazine())
11635 {
11636 Magazine mag2 = Magazine.Cast(this);
11637 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11638 }
11639 else
11640 {
11642 }
11643 if (m_EM)
11644 {
11645 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11646 }
11647
11648 }
11649
11650 else if (action_id ==
EActions.SET_QUANTITY_0)
11651 {
11653
11654 if (m_EM)
11655 {
11656 m_EM.SetEnergy(0);
11657 }
11658 }
11659
11660 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11661 {
11663
11664 if (m_EM)
11665 {
11666 m_EM.SetEnergy(m_EM.GetEnergyMax());
11667 }
11668 }
11669
11670 else if (action_id ==
EActions.ADD_HEALTH)
11671 {
11672 AddHealth("","",GetMaxHealth("","Health")/5);
11673 }
11674 else if (action_id ==
EActions.REMOVE_HEALTH)
11675 {
11676 AddHealth("","",-GetMaxHealth("","Health")/5);
11677 }
11678 else if (action_id ==
EActions.DESTROY_HEALTH)
11679 {
11680 SetHealth01("","",0);
11681 }
11682 else if (action_id ==
EActions.WATCH_ITEM)
11683 {
11685 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11686 #ifdef DEVELOPER
11687 SetDebugDeveloper_item(this);
11688 #endif
11689 }
11690
11691 else if (action_id ==
EActions.ADD_TEMPERATURE)
11692 {
11693 AddTemperature(20);
11694
11695 }
11696
11697 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11698 {
11699 AddTemperature(-20);
11700
11701 }
11702
11703 else if (action_id ==
EActions.FLIP_FROZEN)
11704 {
11705 SetFrozen(!GetIsFrozen());
11706
11707 }
11708
11709 else if (action_id ==
EActions.ADD_WETNESS)
11710 {
11712
11713 }
11714
11715 else if (action_id ==
EActions.REMOVE_WETNESS)
11716 {
11718
11719 }
11720
11721 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11722 {
11725
11726
11727 }
11728
11729 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11730 {
11733 }
11734
11735 else if (action_id ==
EActions.MAKE_SPECIAL)
11736 {
11737 auto debugParams = DebugSpawnParams.WithPlayer(player);
11738 OnDebugSpawnEx(debugParams);
11739 }
11740
11741 else if (action_id ==
EActions.DELETE)
11742 {
11743 Delete();
11744 }
11745
11746 }
11747
11748
11749 return false;
11750 }
11751
11752
11753
11754
11758
11761
11762
11763
11765 {
11766 return false;
11767 }
11768
11769
11771 {
11772 return true;
11773 }
11774
11775
11777 {
11778 return true;
11779 }
11780
11781
11782
11784 {
11785 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11787 }
11788
11791 {
11792 return null;
11793 }
11794
11796 {
11797 return false;
11798 }
11799
11801 {
11802 return false;
11803 }
11804
11808
11809
11811 {
11812 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11813 return module_repairing.CanRepair(this, item_repair_kit);
11814 }
11815
11816
11817 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11818 {
11819 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11820 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11821 }
11822
11823
11825 {
11826
11827
11828
11829
11830
11831
11832
11833
11834 return 1;
11835 }
11836
11837
11838
11840 {
11842 }
11843
11844
11845
11847 {
11849 }
11850
11851
11860 {
11861 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11862
11863 if (player)
11864 {
11865 player.MessageStatus(text);
11866 }
11867 }
11868
11869
11878 {
11879 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11880
11881 if (player)
11882 {
11883 player.MessageAction(text);
11884 }
11885 }
11886
11887
11896 {
11897 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11898
11899 if (player)
11900 {
11901 player.MessageFriendly(text);
11902 }
11903 }
11904
11905
11914 {
11915 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11916
11917 if (player)
11918 {
11919 player.MessageImportant(text);
11920 }
11921 }
11922
11924 {
11925 return true;
11926 }
11927
11928
11929 override bool KindOf(
string tag)
11930 {
11931 bool found = false;
11932 string item_name = this.
GetType();
11935
11936 int array_size = item_tag_array.Count();
11937 for (int i = 0; i < array_size; i++)
11938 {
11939 if (item_tag_array.Get(i) == tag)
11940 {
11941 found = true;
11942 break;
11943 }
11944 }
11945 return found;
11946 }
11947
11948
11950 {
11951
11952 super.OnRPC(sender, rpc_type,ctx);
11953
11954
11955 switch (rpc_type)
11956 {
11957 #ifndef SERVER
11958 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11959 Param2<bool, string> p = new Param2<bool, string>(false, "");
11960
11962 return;
11963
11964 bool play = p.param1;
11965 string soundSet = p.param2;
11966
11967 if (play)
11968 {
11970 {
11972 {
11974 }
11975 }
11976 else
11977 {
11979 }
11980 }
11981 else
11982 {
11984 }
11985
11986 break;
11987 #endif
11988
11989 }
11990
11992 {
11994 }
11995 }
11996
11997
11998
11999
12001 {
12002 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12003 return plugin.GetID(
name);
12004 }
12005
12007 {
12008 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12009 return plugin.GetName(id);
12010 }
12011
12014 {
12015
12016
12017 int varFlags;
12018 if (!ctx.
Read(varFlags))
12019 return;
12020
12021 if (varFlags & ItemVariableFlags.FLOAT)
12022 {
12024 }
12025 }
12026
12028 {
12029
12030 super.SerializeNumericalVars(floats_out);
12031
12032
12033
12035 {
12037 }
12038
12040 {
12042 }
12043
12045 {
12047 }
12048
12050 {
12055 }
12056
12058 {
12060 }
12061 }
12062
12064 {
12065
12066 super.DeSerializeNumericalVars(floats);
12067
12068
12069 int index = 0;
12070 int mask = Math.Round(floats.Get(index));
12071
12072 index++;
12073
12075 {
12077 {
12079 }
12080 else
12081 {
12082 float quantity = floats.Get(index);
12083 SetQuantity(quantity,
true,
false,
false,
false);
12084 }
12085 index++;
12086 }
12087
12089 {
12090 float wet = floats.Get(index);
12092 index++;
12093 }
12094
12096 {
12097 int liquidtype = Math.Round(floats.Get(index));
12099 index++;
12100 }
12101
12103 {
12105 index++;
12107 index++;
12109 index++;
12111 index++;
12112 }
12113
12115 {
12116 int cleanness = Math.Round(floats.Get(index));
12118 index++;
12119 }
12120 }
12121
12123 {
12124 super.WriteVarsToCTX(ctx);
12125
12126
12128 {
12130 }
12131
12133 {
12135 }
12136
12138 {
12140 }
12141
12143 {
12144 int r,g,b,a;
12150 }
12151
12153 {
12155 }
12156 }
12157
12159 {
12160 if (!super.ReadVarsFromCTX(ctx,version))
12161 return false;
12162
12163 int intValue;
12164 float value;
12165
12166 if (version < 140)
12167 {
12168 if (!ctx.
Read(intValue))
12169 return false;
12170
12171 m_VariablesMask = intValue;
12172 }
12173
12175 {
12176 if (!ctx.
Read(value))
12177 return false;
12178
12180 {
12182 }
12183 else
12184 {
12186 }
12187 }
12188
12189 if (version < 140)
12190 {
12192 {
12193 if (!ctx.
Read(value))
12194 return false;
12195 SetTemperatureDirect(value);
12196 }
12197 }
12198
12200 {
12201 if (!ctx.
Read(value))
12202 return false;
12204 }
12205
12207 {
12208 if (!ctx.
Read(intValue))
12209 return false;
12211 }
12212
12214 {
12215 int r,g,b,a;
12217 return false;
12219 return false;
12221 return false;
12223 return false;
12224
12226 }
12227
12229 {
12230 if (!ctx.
Read(intValue))
12231 return false;
12233 }
12234
12235 if (version >= 138 && version < 140)
12236 {
12238 {
12239 if (!ctx.
Read(intValue))
12240 return false;
12241 SetFrozen(intValue);
12242 }
12243 }
12244
12245 return true;
12246 }
12247
12248
12250 {
12253 {
12255 }
12256
12257 if (!super.OnStoreLoad(ctx, version))
12258 {
12260 return false;
12261 }
12262
12263 if (version >= 114)
12264 {
12265 bool hasQuickBarIndexSaved;
12266
12267 if (!ctx.
Read(hasQuickBarIndexSaved))
12268 {
12270 return false;
12271 }
12272
12273 if (hasQuickBarIndexSaved)
12274 {
12275 int itmQBIndex;
12276
12277
12278 if (!ctx.
Read(itmQBIndex))
12279 {
12281 return false;
12282 }
12283
12284 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12285 if (itmQBIndex != -1 && parentPlayer)
12286 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12287 }
12288 }
12289 else
12290 {
12291
12292 PlayerBase player;
12293 int itemQBIndex;
12294 if (version ==
int.
MAX)
12295 {
12296 if (!ctx.
Read(itemQBIndex))
12297 {
12299 return false;
12300 }
12301 }
12302 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12303 {
12304
12305 if (!ctx.
Read(itemQBIndex))
12306 {
12308 return false;
12309 }
12310 if (itemQBIndex != -1 && player)
12311 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12312 }
12313 }
12314
12315 if (version < 140)
12316 {
12317
12318 if (!LoadVariables(ctx, version))
12319 {
12321 return false;
12322 }
12323 }
12324
12325
12327 {
12329 return false;
12330 }
12331 if (version >= 132)
12332 {
12334 if (raib)
12335 {
12337 {
12339 return false;
12340 }
12341 }
12342 }
12343
12345 return true;
12346 }
12347
12348
12349
12351 {
12352 super.OnStoreSave(ctx);
12353
12354 PlayerBase player;
12355 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12356 {
12358
12359 int itemQBIndex = -1;
12360 itemQBIndex = player.FindQuickBarEntityIndex(this);
12361 ctx.
Write(itemQBIndex);
12362 }
12363 else
12364 {
12366 }
12367
12369
12371 if (raib)
12372 {
12374 }
12375 }
12376
12377
12379 {
12380 super.AfterStoreLoad();
12381
12383 {
12385 }
12386
12388 {
12391 }
12392 }
12393
12395 {
12396 super.EEOnAfterLoad();
12397
12399 {
12401 }
12402
12405 }
12406
12408 {
12409 return false;
12410 }
12411
12412
12413
12415 {
12417 {
12418 #ifdef PLATFORM_CONSOLE
12419
12421 {
12423 if (menu)
12424 {
12426 }
12427 }
12428 #endif
12429 }
12430
12432 {
12435 }
12436
12438 {
12439 SetWeightDirty();
12441 }
12443 {
12446 }
12447
12449 {
12452 }
12454 {
12457 }
12458
12459 super.OnVariablesSynchronized();
12460 }
12461
12462
12463
12465 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12466 {
12467 if (!IsServerCheck(allow_client))
12468 return false;
12469
12471 return false;
12472
12475
12476 if (value <= (min + 0.001))
12477 value = min;
12478
12479 if (value == min)
12480 {
12481 if (destroy_config)
12482 {
12483 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12484 if (dstr)
12485 {
12487 this.Delete();
12488 return true;
12489 }
12490 }
12491 else if (destroy_forced)
12492 {
12494 this.Delete();
12495 return true;
12496 }
12497
12499 }
12500
12503
12505 {
12507
12508 if (delta)
12510 }
12511
12513
12514 return false;
12515 }
12516
12517
12519 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12520 {
12522 }
12523
12525 {
12528 }
12529
12531 {
12534 }
12535
12538 {
12539 float value_clamped = Math.Clamp(value, 0, 1);
12541 SetQuantity(result, destroy_config, destroy_forced);
12542 }
12543
12544
12547 {
12549 }
12550
12552 {
12554 }
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12566 {
12567 int slot = -1;
12568 if (GetInventory())
12569 {
12570 InventoryLocation il = new InventoryLocation;
12571 GetInventory().GetCurrentInventoryLocation(il);
12573 }
12574
12576 }
12577
12579 {
12580 float quantity_max = 0;
12581
12583 {
12584 if (attSlotID != -1)
12585 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12586
12587 if (quantity_max <= 0)
12589 }
12590
12591 if (quantity_max <= 0)
12593
12594 return quantity_max;
12595 }
12596
12598 {
12600 }
12601
12603 {
12605 }
12606
12607
12609 {
12611 }
12612
12614 {
12616 }
12617
12619 {
12621 }
12622
12623
12625 {
12626
12627 float weightEx = GetWeightEx();
12628 float special = GetInventoryAndCargoWeight();
12629 return weightEx - special;
12630 }
12631
12632
12634 {
12636 }
12637
12639 {
12641 {
12642 #ifdef DEVELOPER
12643 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12644 {
12645 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12647 }
12648 #endif
12649
12650 return GetQuantity() * GetConfigWeightModified();
12651 }
12652 else if (HasEnergyManager())
12653 {
12654 #ifdef DEVELOPER
12655 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12656 {
12657 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12658 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12659 }
12660 #endif
12661 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12662 }
12663 else
12664 {
12665 #ifdef DEVELOPER
12666 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12667 {
12668 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12669 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12670 }
12671 #endif
12672 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12673 }
12674 }
12675
12678 {
12679 int item_count = 0;
12681
12682 if (GetInventory().GetCargo() != NULL)
12683 {
12684 item_count = GetInventory().GetCargo().GetItemCount();
12685 }
12686
12687 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12688 {
12689 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12690 if (item)
12691 item_count += item.GetNumberOfItems();
12692 }
12693 return item_count;
12694 }
12695
12698 {
12699 float weight = 0;
12700 float wetness = 1;
12701 if (include_wetness)
12704 {
12705 weight = wetness * m_ConfigWeight;
12706 }
12708 {
12709 weight = 1;
12710 }
12711 return weight;
12712 }
12713
12714
12715
12717 {
12718 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12719 {
12720 GameInventory inv = GetInventory();
12721 array<EntityAI> items = new array<EntityAI>;
12723 for (int i = 0; i < items.Count(); i++)
12724 {
12726 if (item)
12727 {
12729 }
12730 }
12731 }
12732 }
12733
12734
12735
12736
12738 {
12739 float energy = 0;
12740 if (HasEnergyManager())
12741 {
12742 energy = GetCompEM().GetEnergy();
12743 }
12744 return energy;
12745 }
12746
12747
12749 {
12750 super.OnEnergyConsumed();
12751
12753 }
12754
12756 {
12757 super.OnEnergyAdded();
12758
12760 }
12761
12762
12764 {
12765 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12766 {
12768 {
12769 float energy_0to1 = GetCompEM().GetEnergy0To1();
12771 }
12772 }
12773 }
12774
12775
12777 {
12778 return ConfigGetFloat("heatIsolation");
12779 }
12780
12782 {
12784 }
12785
12787 {
12788 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12789 if (
GetGame().ConfigIsExisting(paramPath))
12791
12792 return 0.0;
12793 }
12794
12796 {
12797 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12798 if (
GetGame().ConfigIsExisting(paramPath))
12800
12801 return 0.0;
12802 }
12803
12804 override void SetWet(
float value,
bool allow_client =
false)
12805 {
12806 if (!IsServerCheck(allow_client))
12807 return;
12808
12811
12813
12814 m_VarWet = Math.Clamp(value, min, max);
12815
12817 {
12820 }
12821 }
12822
12823 override void AddWet(
float value)
12824 {
12826 }
12827
12829 {
12831 }
12832
12834 {
12836 }
12837
12839 {
12841 }
12842
12844 {
12846 }
12847
12849 {
12851 }
12852
12853 override void OnWetChanged(
float newVal,
float oldVal)
12854 {
12857 if (newLevel != oldLevel)
12858 {
12860 }
12861 }
12862
12864 {
12865 SetWeightDirty();
12866 }
12867
12869 {
12870 return GetWetLevelInternal(
m_VarWet);
12871 }
12872
12873
12874
12876 {
12878 }
12879
12881 {
12883 }
12884
12886 {
12888 }
12889
12891 {
12893 }
12894
12895
12896
12898 {
12899 if (ConfigIsExisting("itemModelLength"))
12900 {
12901 return ConfigGetFloat("itemModelLength");
12902 }
12903 return 0;
12904 }
12905
12907 {
12908 if (ConfigIsExisting("itemAttachOffset"))
12909 {
12910 return ConfigGetFloat("itemAttachOffset");
12911 }
12912 return 0;
12913 }
12914
12915 override void SetCleanness(
int value,
bool allow_client =
false)
12916 {
12917 if (!IsServerCheck(allow_client))
12918 return;
12919
12921
12923
12926 }
12927
12929 {
12931 }
12932
12934 {
12935 return true;
12936 }
12937
12938
12939
12940
12942 {
12944 }
12945
12947 {
12949 }
12950
12951
12952
12953
12954 override void SetColor(
int r,
int g,
int b,
int a)
12955 {
12961 }
12963 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12964 {
12969 }
12970
12972 {
12974 }
12975
12978 {
12979 int r,g,b,a;
12981 r = r/255;
12982 g = g/255;
12983 b = b/255;
12984 a = a/255;
12985 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12986 }
12987
12988
12989
12990 override void SetLiquidType(
int value,
bool allow_client =
false)
12991 {
12992 if (!IsServerCheck(allow_client))
12993 return;
12994
12999 }
13000
13002 {
13003 return ConfigGetInt("varLiquidTypeInit");
13004 }
13005
13007 {
13009 }
13010
13012 {
13014 SetFrozen(false);
13015 }
13016
13019 {
13020 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13021 }
13022
13023
13026 {
13027 PlayerBase nplayer;
13028 if (PlayerBase.CastTo(nplayer, player))
13029 {
13031
13032 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13033 }
13034 }
13035
13036
13039 {
13040 PlayerBase nplayer;
13041 if (PlayerBase.CastTo(nplayer,player))
13042 {
13043
13044 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13045
13046 }
13047
13048
13049 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13050
13051
13052 if (HasEnergyManager())
13053 {
13054 GetCompEM().UpdatePlugState();
13055 }
13056 }
13057
13058
13060 {
13061 super.OnPlacementStarted(player);
13062
13064 }
13065
13066 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13067 {
13069 {
13070 m_AdminLog.OnPlacementComplete(player,
this);
13071 }
13072
13073 super.OnPlacementComplete(player, position, orientation);
13074 }
13075
13076
13077
13078
13079
13081 {
13083 {
13084 return true;
13085 }
13086 else
13087 {
13088 return false;
13089 }
13090 }
13091
13092
13094 {
13096 {
13098 }
13099 }
13100
13101
13103 {
13105 }
13106
13108 {
13110 }
13111
13112 override void InsertAgent(
int agent,
float count = 1)
13113 {
13114 if (count < 1)
13115 return;
13116
13118 }
13119
13122 {
13124 }
13125
13126
13128 {
13130 }
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
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
13174 {
13176 return false;
13177 return true;
13178 }
13179
13181 {
13182
13184 }
13185
13186
13189 {
13190 super.CheckForRoofLimited(timeTresholdMS);
13191
13193 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13194 {
13195 m_PreviousRoofTestTime = time;
13196 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13197 }
13198 }
13199
13200
13202 {
13204 {
13205 return 0;
13206 }
13207
13208 if (GetInventory().GetAttachmentSlotsCount() != 0)
13209 {
13210 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13211 if (filter)
13212 return filter.GetProtectionLevel(type, false, system);
13213 else
13214 return 0;
13215 }
13216
13217 string subclassPath, entryName;
13218
13219 switch (type)
13220 {
13222 entryName = "biological";
13223 break;
13225 entryName = "chemical";
13226 break;
13227 default:
13228 entryName = "biological";
13229 break;
13230 }
13231
13232 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13233
13235 }
13236
13237
13238
13241 {
13242 if (!IsMagazine())
13244
13246 }
13247
13248
13249
13250
13251
13256 {
13257 return true;
13258 }
13259
13261 {
13263 }
13264
13265
13266
13267
13268
13270 {
13271 if (parent)
13272 {
13273 if (parent.IsInherited(DayZInfected))
13274 return true;
13275
13276 if (!parent.IsRuined())
13277 return true;
13278 }
13279
13280 return true;
13281 }
13282
13284 {
13285 if (!super.CanPutAsAttachment(parent))
13286 {
13287 return false;
13288 }
13289
13290 if (!IsRuined() && !parent.IsRuined())
13291 {
13292 return true;
13293 }
13294
13295 return false;
13296 }
13297
13299 {
13300
13301
13302
13303
13304 return super.CanReceiveItemIntoCargo(item);
13305 }
13306
13308 {
13309
13310
13311
13312
13313 GameInventory attachmentInv = attachment.GetInventory();
13315 {
13316 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13317 return false;
13318 }
13319
13320 InventoryLocation loc = new InventoryLocation();
13321 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13322 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13323 return false;
13324
13325 return super.CanReceiveAttachment(attachment, slotId);
13326 }
13327
13329 {
13330 if (!super.CanReleaseAttachment(attachment))
13331 return false;
13332
13333 return GetInventory().AreChildrenAccessible();
13334 }
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13357 {
13358 int id = muzzle_owner.GetMuzzleID();
13359 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13360
13361 if (WPOF_array)
13362 {
13363 for (int i = 0; i < WPOF_array.Count(); i++)
13364 {
13365 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13366
13367 if (WPOF)
13368 {
13369 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13370 }
13371 }
13372 }
13373 }
13374
13375
13377 {
13378 int id = muzzle_owner.GetMuzzleID();
13380
13381 if (WPOBE_array)
13382 {
13383 for (int i = 0; i < WPOBE_array.Count(); i++)
13384 {
13385 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13386
13387 if (WPOBE)
13388 {
13389 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13390 }
13391 }
13392 }
13393 }
13394
13395
13397 {
13398 int id = muzzle_owner.GetMuzzleID();
13399 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13400
13401 if (WPOOH_array)
13402 {
13403 for (int i = 0; i < WPOOH_array.Count(); i++)
13404 {
13405 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13406
13407 if (WPOOH)
13408 {
13409 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13410 }
13411 }
13412 }
13413 }
13414
13415
13417 {
13418 int id = muzzle_owner.GetMuzzleID();
13419 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13420
13421 if (WPOOH_array)
13422 {
13423 for (int i = 0; i < WPOOH_array.Count(); i++)
13424 {
13425 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13426
13427 if (WPOOH)
13428 {
13429 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13430 }
13431 }
13432 }
13433 }
13434
13435
13437 {
13438 int id = muzzle_owner.GetMuzzleID();
13439 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13440
13441 if (WPOOH_array)
13442 {
13443 for (int i = 0; i < WPOOH_array.Count(); i++)
13444 {
13445 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13446
13447 if (WPOOH)
13448 {
13449 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13450 }
13451 }
13452 }
13453 }
13454
13455
13456
13458 {
13460 {
13461 return true;
13462 }
13463
13464 return false;
13465 }
13466
13468 {
13470 {
13471 return true;
13472 }
13473
13474 return false;
13475 }
13476
13478 {
13480 {
13481 return true;
13482 }
13483
13484 return false;
13485 }
13486
13488 {
13489 return false;
13490 }
13491
13494 {
13495 return UATimeSpent.DEFAULT_DEPLOY;
13496 }
13497
13498
13499
13500
13502 {
13504 SetSynchDirty();
13505 }
13506
13508 {
13510 }
13511
13512
13514 {
13515 return false;
13516 }
13517
13520 {
13521 string att_type = "None";
13522
13523 if (ConfigIsExisting("soundAttType"))
13524 {
13525 att_type = ConfigGetString("soundAttType");
13526 }
13527
13529 }
13530
13532 {
13534 }
13535
13536
13537
13538
13539
13543
13545 {
13548
13550 }
13551
13552
13554 {
13556 return;
13557
13559
13562
13565
13566 SoundParameters params = new SoundParameters();
13570 }
13571
13572
13574 {
13576 return;
13577
13579 SetSynchDirty();
13580
13583 }
13584
13585
13587 {
13589 return;
13590
13592 SetSynchDirty();
13593
13596 }
13597
13599 {
13601 }
13602
13604 {
13606 }
13607
13610 {
13611 if (!
GetGame().IsDedicatedServer())
13612 {
13613 if (ConfigIsExisting("attachSoundSet"))
13614 {
13615 string cfg_path = "";
13616 string soundset = "";
13617 string type_name =
GetType();
13618
13621 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13622 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13623
13624 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13625 {
13626 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13627 {
13628 if (cfg_slot_array[i] == slot_type)
13629 {
13630 soundset = cfg_soundset_array[i];
13631 break;
13632 }
13633 }
13634 }
13635
13636 if (soundset != "")
13637 {
13638 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13640 }
13641 }
13642 }
13643 }
13644
13646 {
13647
13648 }
13649
13650 void OnApply(PlayerBase player);
13651
13653 {
13654 return 1.0;
13655 };
13656
13658 {
13660 }
13661
13663 {
13665 }
13666
13668
13670 {
13671 SetDynamicPhysicsLifeTime(0.01);
13673 }
13674
13676 {
13677 array<string> zone_names = new array<string>;
13678 GetDamageZones(zone_names);
13679 for (int i = 0; i < zone_names.Count(); i++)
13680 {
13681 SetHealthMax(zone_names.Get(i),"Health");
13682 }
13683 SetHealthMax("","Health");
13684 }
13685
13688 {
13689 float global_health = GetHealth01("","Health");
13690 array<string> zones = new array<string>;
13691 GetDamageZones(zones);
13692
13693 for (int i = 0; i < zones.Count(); i++)
13694 {
13695 SetHealth01(zones.Get(i),"Health",global_health);
13696 }
13697 }
13698
13701 {
13702 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13703 }
13704
13706 {
13707 if (!hasRootAsPlayer)
13708 {
13709 if (refParentIB)
13710 {
13711
13712 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13713 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13714
13715 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13716 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13717
13720 }
13721 else
13722 {
13723
13726 }
13727 }
13728 }
13729
13731 {
13733 {
13734 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13735 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13736 {
13737 float heatPermCoef = 1.0;
13739 while (ent)
13740 {
13741 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13742 ent = ent.GetHierarchyParent();
13743 }
13744
13745 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13746 }
13747 }
13748 }
13749
13751 {
13752
13753 EntityAI parent = GetHierarchyParent();
13754 if (!parent)
13755 {
13756 hasParent = false;
13757 hasRootAsPlayer = false;
13758 }
13759 else
13760 {
13761 hasParent = true;
13762 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13763 refParentIB =
ItemBase.Cast(parent);
13764 }
13765 }
13766
13767 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13768 {
13769
13770 }
13771
13773 {
13774
13775 return false;
13776 }
13777
13779 {
13780
13781
13782 return false;
13783 }
13784
13786 {
13787
13788 return false;
13789 }
13790
13793 {
13794 return !GetIsFrozen() &&
IsOpen();
13795 }
13796
13798 {
13799 bool hasParent = false, hasRootAsPlayer = false;
13801
13802 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13803 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13804
13805 if (wwtu || foodDecay)
13806 {
13810
13811 if (processWetness || processTemperature || processDecay)
13812 {
13814
13815 if (processWetness)
13816 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13817
13818 if (processTemperature)
13820
13821 if (processDecay)
13822 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13823 }
13824 }
13825 }
13826
13829 {
13831 }
13832
13834 {
13837
13838 return super.GetTemperatureFreezeThreshold();
13839 }
13840
13842 {
13845
13846 return super.GetTemperatureThawThreshold();
13847 }
13848
13850 {
13853
13854 return super.GetItemOverheatThreshold();
13855 }
13856
13858 {
13860 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13861
13862 return super.GetTemperatureFreezeTime();
13863 }
13864
13866 {
13868 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13869
13870 return super.GetTemperatureThawTime();
13871 }
13872
13877
13879 {
13880 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13881 }
13882
13884 {
13885 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13886 }
13887
13890 {
13892 }
13893
13895 {
13897 }
13898
13900 {
13902 }
13903
13906 {
13907 return null;
13908 }
13909
13912 {
13913 return false;
13914 }
13915
13917 {
13919 {
13922 if (!trg)
13923 {
13925 explosive = this;
13926 }
13927
13928 explosive.PairRemote(trg);
13930
13931 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13932 trg.SetPersistentPairID(persistentID);
13933 explosive.SetPersistentPairID(persistentID);
13934
13935 return true;
13936 }
13937 return false;
13938 }
13939
13942 {
13943 float ret = 1.0;
13946 ret *= GetHealth01();
13947
13948 return ret;
13949 }
13950
13951 #ifdef DEVELOPER
13952 override void SetDebugItem()
13953 {
13954 super.SetDebugItem();
13955 _itemBase = this;
13956 }
13957
13959 {
13960 string text = super.GetDebugText();
13961
13963 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13964
13965 return text;
13966 }
13967 #endif
13968
13970 {
13971 return true;
13972 }
13973
13975
13977
13979 {
13982 }
13983
13984
13992
14008}
14009
14011{
14013 if (entity)
14014 {
14015 bool is_item = entity.IsInherited(
ItemBase);
14016 if (is_item && full_quantity)
14017 {
14020 }
14021 }
14022 else
14023 {
14025 return NULL;
14026 }
14027 return entity;
14028}
14029
14031{
14032 if (item)
14033 {
14034 if (health > 0)
14035 item.SetHealth("", "", health);
14036
14037 if (item.CanHaveTemperature())
14038 {
14040 if (item.CanFreeze())
14041 item.SetFrozen(false);
14042 }
14043
14044 if (item.HasEnergyManager())
14045 {
14046 if (quantity >= 0)
14047 {
14048 item.GetCompEM().SetEnergy0To1(quantity);
14049 }
14050 else
14051 {
14053 }
14054 }
14055 else if (item.IsMagazine())
14056 {
14057 Magazine mag = Magazine.Cast(item);
14058 if (quantity >= 0)
14059 {
14060 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14061 }
14062 else
14063 {
14065 }
14066
14067 }
14068 else
14069 {
14070 if (quantity >= 0)
14071 {
14072 item.SetQuantityNormalized(quantity, false);
14073 }
14074 else
14075 {
14077 }
14078
14079 }
14080 }
14081}
14082
14083#ifdef DEVELOPER
14085#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.