9250{
9252 {
9253 return true;
9254 }
9255};
9256
9257
9258
9260{
9264
9266
9269
9270
9271
9272
9273
9282
9288
9293
9298
9319 protected bool m_IsResultOfSplit
9320
9322
9327
9328
9329
9331
9335
9336
9337
9339
9342
9343
9344
9350
9351
9359
9362
9363
9365
9366
9368
9369
9374
9375
9380
9381
9383
9384
9386 {
9391
9392 if (!
GetGame().IsDedicatedServer())
9393 {
9395 {
9397
9399 {
9401 }
9402 }
9403
9406 }
9407
9408 m_OldLocation = null;
9409
9411 {
9413 }
9414
9415 if (ConfigIsExisting("headSelectionsToHide"))
9416 {
9419 }
9420
9422 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9423 {
9425 }
9426
9428
9429 m_IsResultOfSplit = false;
9430
9432 }
9433
9435 {
9436 super.InitItemVariables();
9437
9443 m_Count = ConfigGetInt(
"count");
9444
9447
9452
9455
9460
9472
9476
9477
9480 if (ConfigIsExisting("canBeSplit"))
9481 {
9484 }
9485
9487 if (ConfigIsExisting("itemBehaviour"))
9489
9490
9493 RegisterNetSyncVariableInt("m_VarLiquidType");
9494 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9495
9496 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9497 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9498 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9499
9500 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9501 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9502 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9503 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9504
9505 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9506 RegisterNetSyncVariableBool("m_IsTakeable");
9507 RegisterNetSyncVariableBool("m_IsHologram");
9508
9511 {
9514 }
9515
9517
9519 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9521
9522 }
9523
9525 {
9527 }
9528
9530 {
9533 {
9538 }
9539 }
9540
9541 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9542 {
9544 {
9547 }
9548
9550 }
9551
9553 {
9559 }
9560
9562
9564 {
9566
9567 if (!action)
9568 {
9569 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9570 return;
9571 }
9572
9574 if (!ai)
9575 {
9577 return;
9578 }
9579
9581 if (!action_array)
9582 {
9583 action_array = new array<ActionBase_Basic>;
9585 }
9586 if (LogManager.IsActionLogEnable())
9587 {
9588 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9589 }
9590
9591 if (action_array.Find(action) != -1)
9592 {
9593 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9594 }
9595 else
9596 {
9597 action_array.Insert(action);
9598 }
9599 }
9600
9602 {
9604 ActionBase action = player.GetActionManager().GetAction(actionName);
9607
9608 if (action_array)
9609 {
9610 action_array.RemoveItem(action);
9611 }
9612 }
9613
9614
9615
9617 {
9618 ActionOverrideData overrideData = new ActionOverrideData();
9622
9624 if (!actionMap)
9625 {
9628 }
9629
9630 actionMap.Insert(this.
Type(), overrideData);
9631
9632 }
9633
9635
9637
9638
9640 {
9643
9646
9647 string config_to_search = "CfgVehicles";
9648 string muzzle_owner_config;
9649
9651 {
9652 if (IsInherited(Weapon))
9653 config_to_search = "CfgWeapons";
9654
9655 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9656
9657 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9658
9660
9661 if (config_OnFire_subclass_count > 0)
9662 {
9663 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9664
9665 for (int i = 0; i < config_OnFire_subclass_count; i++)
9666 {
9667 string particle_class = "";
9669 string config_OnFire_entry = config_OnFire_class + particle_class;
9670 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9671 WPOF_array.Insert(WPOF);
9672 }
9673
9674
9676 }
9677 }
9678
9680 {
9681 config_to_search = "CfgWeapons";
9682 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9683
9684 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9685
9687
9688 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9689 {
9690 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9691
9692 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9693 {
9694 string particle_class2 = "";
9696 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9697 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9698 WPOBE_array.Insert(WPOBE);
9699 }
9700
9701
9703 }
9704 }
9705 }
9706
9707
9709 {
9712
9714 {
9715 string config_to_search = "CfgVehicles";
9716
9717 if (IsInherited(Weapon))
9718 config_to_search = "CfgWeapons";
9719
9720 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9721 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9722
9723 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9724 {
9725
9727
9729 {
9731 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9733 return;
9734 }
9735
9738
9739
9740
9742 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9743
9744 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9745 {
9746 string particle_class = "";
9748 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9750
9751 if (entry_type == CT_CLASS)
9752 {
9753 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9754 WPOOH_array.Insert(WPOF);
9755 }
9756 }
9757
9758
9760 }
9761 }
9762 }
9763
9765 {
9767 }
9768
9770 {
9772 {
9774
9777
9780
9781 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9782 }
9783 }
9784
9786 {
9788 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9789
9791 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9792
9794 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9795
9797 {
9799 }
9800 }
9801
9803 {
9805 }
9806
9808 {
9811 else
9813
9815 {
9818 }
9819 else
9820 {
9823
9826 }
9827
9829 }
9830
9832 {
9834 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9835 }
9836
9838 {
9840 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9842 }
9843
9845 {
9847 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9848 }
9849
9851 {
9854
9855 OverheatingParticle OP = new OverheatingParticle();
9860
9862 }
9863
9865 {
9868
9869 return -1;
9870 }
9871
9873 {
9875 {
9878
9879 for (int i = count; i > 0; --i)
9880 {
9881 int id = i - 1;
9884
9887
9888 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9889 {
9890 if (p)
9891 {
9894 }
9895 }
9896 }
9897 }
9898 }
9899
9901 {
9903 {
9905 {
9906 int id = i - 1;
9908
9909 if (OP)
9910 {
9912
9913 if (p)
9914 {
9916 }
9917
9918 delete OP;
9919 }
9920 }
9921
9924 }
9925 }
9926
9929 {
9930 return 0.0;
9931 }
9932
9933
9935 {
9936 return 250;
9937 }
9938
9940 {
9941 return 0;
9942 }
9943
9946 {
9948 return true;
9949
9950 return false;
9951 }
9952
9955 {
9958
9960 {
9962 }
9963 else
9964 {
9965
9967 }
9968
9970 }
9971
9978 {
9979 return -1;
9980 }
9981
9982
9983
9984
9986 {
9988 {
9990 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9991
9992 if (r_index >= 0)
9993 {
9994 InventoryLocation r_il = new InventoryLocation;
9995 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9996
9997 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10000 {
10001 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10002 }
10004 {
10005 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10006 }
10007
10008 }
10009
10010 player.GetHumanInventory().ClearUserReservedLocation(this);
10011 }
10012
10015 }
10016
10017
10018
10019
10021 {
10022 return ItemBase.m_DebugActionsMask;
10023 }
10024
10026 {
10027 return ItemBase.m_DebugActionsMask & mask;
10028 }
10029
10031 {
10032 ItemBase.m_DebugActionsMask = mask;
10033 }
10034
10036 {
10037 ItemBase.m_DebugActionsMask |= mask;
10038 }
10039
10041 {
10042 ItemBase.m_DebugActionsMask &= ~mask;
10043 }
10044
10046 {
10048 {
10050 }
10051 else
10052 {
10054 }
10055 }
10056
10057
10059 {
10060 if (GetEconomyProfile())
10061 {
10062 float q_max = GetEconomyProfile().GetQuantityMax();
10063 if (q_max > 0)
10064 {
10065 float q_min = GetEconomyProfile().GetQuantityMin();
10066 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10067
10069 {
10070 ComponentEnergyManager comp = GetCompEM();
10072 {
10074 }
10075 }
10077 {
10079
10080 }
10081
10082 }
10083 }
10084 }
10085
10088 {
10089 EntityAI parent = GetHierarchyParent();
10090
10091 if (parent)
10092 {
10093 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10094 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10095 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10096 }
10097 }
10098
10101 {
10102 EntityAI parent = GetHierarchyParent();
10103
10104 if (parent)
10105 {
10106 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10107 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10108 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10109 }
10110 }
10111
10113 {
10114
10115
10116
10117
10119
10121 {
10122 if (ScriptInputUserData.CanStoreInputUserData())
10123 {
10124 ScriptInputUserData ctx = new ScriptInputUserData;
10130 ctx.
Write(use_stack_max);
10133
10135 {
10136 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10137 }
10138 }
10139 }
10140 else if (!
GetGame().IsMultiplayer())
10141 {
10143 }
10144 }
10145
10147 {
10149 }
10150
10152 {
10154 }
10155
10157 {
10159 }
10160
10162 {
10163
10164 return false;
10165 }
10166
10168 {
10169 return false;
10170 }
10171
10175 {
10176 return false;
10177 }
10178
10180 {
10181 return "";
10182 }
10183
10185
10187 {
10188 return false;
10189 }
10190
10192 {
10193 return true;
10194 }
10195
10196
10197
10199 {
10200 return true;
10201 }
10202
10204 {
10205 return true;
10206 }
10207
10209 {
10210 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10212 }
10213
10215 {
10217 }
10218
10220 {
10222 if (!is_being_placed)
10224 SetSynchDirty();
10225 }
10226
10227
10229
10231 {
10233 }
10234
10236 {
10238 }
10239
10241 {
10242 return 1;
10243 }
10244
10246 {
10247 return false;
10248 }
10249
10251 {
10253 SetSynchDirty();
10254 }
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10291 {
10292 super.OnMovedInsideCargo(container);
10293
10294 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10295 }
10296
10297 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10298 {
10299 super.EEItemLocationChanged(oldLoc,newLoc);
10300
10301 PlayerBase new_player = null;
10302 PlayerBase old_player = null;
10303
10304 if (newLoc.GetParent())
10305 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10306
10307 if (oldLoc.GetParent())
10308 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10309
10311 {
10312 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10313
10314 if (r_index >= 0)
10315 {
10316 InventoryLocation r_il = new InventoryLocation;
10317 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10318
10319 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10322 {
10323 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10324 }
10326 {
10327 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10328 }
10329
10330 }
10331 }
10332
10334 {
10335 if (new_player)
10336 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10337
10338 if (new_player == old_player)
10339 {
10340
10341 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10342 {
10344 {
10345 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10346 {
10347 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10348 }
10349 }
10350 else
10351 {
10352 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10353 }
10354 }
10355
10356 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10357 {
10358 int type = oldLoc.GetType();
10360 {
10361 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10362 }
10364 {
10365 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10366 }
10367 }
10368 if (!m_OldLocation)
10369 {
10370 m_OldLocation = new InventoryLocation;
10371 }
10372 m_OldLocation.Copy(oldLoc);
10373 }
10374 else
10375 {
10376 if (m_OldLocation)
10377 {
10378 m_OldLocation.Reset();
10379 }
10380 }
10381
10383 }
10384 else
10385 {
10386 if (new_player)
10387 {
10388 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10389 if (res_index >= 0)
10390 {
10391 InventoryLocation il = new InventoryLocation;
10392 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10394 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10397 {
10398 il.
GetParent().GetOnReleaseLock().Invoke(it);
10399 }
10401 {
10403 }
10404
10405 }
10406 }
10408 {
10409
10411 }
10412
10413 if (m_OldLocation)
10414 {
10415 m_OldLocation.Reset();
10416 }
10417 }
10418 }
10419
10420 override void EOnContact(IEntity other, Contact extra)
10421 {
10423 {
10424 int liquidType = -1;
10426 if (impactSpeed > 0.0)
10427 {
10429 #ifndef SERVER
10431 #else
10433 SetSynchDirty();
10434 #endif
10436 }
10437 }
10438
10439 #ifdef SERVER
10440 if (GetCompEM() && GetCompEM().IsPlugged())
10441 {
10442 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10443 GetCompEM().UnplugThis();
10444 }
10445 #endif
10446 }
10447
10449
10451 {
10453 }
10454
10456 {
10457
10458 }
10459
10461 {
10462 super.OnItemLocationChanged(old_owner, new_owner);
10463
10464 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10465 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10466
10467 if (!relatedPlayer && playerNew)
10468 relatedPlayer = playerNew;
10469
10470 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10471 {
10473 if (actionMgr)
10474 {
10475 ActionBase currentAction = actionMgr.GetRunningAction();
10476 if (currentAction)
10478 }
10479 }
10480
10481 Man ownerPlayerOld = null;
10482 Man ownerPlayerNew = null;
10483
10484 if (old_owner)
10485 {
10486 if (old_owner.
IsMan())
10487 {
10488 ownerPlayerOld = Man.Cast(old_owner);
10489 }
10490 else
10491 {
10492 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10493 }
10494 }
10495 else
10496 {
10498 {
10500
10501 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10502 {
10503 GetCompEM().UnplugThis();
10504 }
10505 }
10506 }
10507
10508 if (new_owner)
10509 {
10510 if (new_owner.
IsMan())
10511 {
10512 ownerPlayerNew = Man.Cast(new_owner);
10513 }
10514 else
10515 {
10516 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10517 }
10518 }
10519
10520 if (ownerPlayerOld != ownerPlayerNew)
10521 {
10522 if (ownerPlayerOld)
10523 {
10524 array<EntityAI> subItemsExit = new array<EntityAI>;
10526 for (int i = 0; i < subItemsExit.Count(); i++)
10527 {
10530 }
10531 }
10532
10533 if (ownerPlayerNew)
10534 {
10535 array<EntityAI> subItemsEnter = new array<EntityAI>;
10537 for (int j = 0; j < subItemsEnter.Count(); j++)
10538 {
10541 }
10542 }
10543 }
10544 else if (ownerPlayerNew != null)
10545 {
10546 PlayerBase nplayer;
10547 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10548 {
10549 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10551 for (int k = 0; k < subItemsUpdate.Count(); k++)
10552 {
10554 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10555 }
10556 }
10557 }
10558
10559 if (old_owner)
10560 old_owner.OnChildItemRemoved(this);
10561 if (new_owner)
10562 new_owner.OnChildItemReceived(this);
10563 }
10564
10565
10567 {
10568 super.EEDelete(parent);
10569 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10570 if (player)
10571 {
10573
10574 if (player.IsAlive())
10575 {
10576 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10577 if (r_index >= 0)
10578 {
10579 InventoryLocation r_il = new InventoryLocation;
10580 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10581
10582 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10585 {
10586 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10587 }
10589 {
10590 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10591 }
10592
10593 }
10594
10595 player.RemoveQuickBarEntityShortcut(this);
10596 }
10597 }
10598 }
10599
10601 {
10602 super.EEKilled(killer);
10603
10606 {
10607 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10608 {
10609 if (IsMagazine())
10610 {
10611 if (Magazine.Cast(this).GetAmmoCount() > 0)
10612 {
10614 }
10615 }
10616 else
10617 {
10619 }
10620 }
10621 }
10622 }
10623
10625 {
10626 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10627
10628 super.OnWasAttached(parent, slot_id);
10629
10632
10634 }
10635
10637 {
10638 super.OnWasDetached(parent, slot_id);
10639
10642 }
10643
10645 {
10646 int idx;
10649
10650 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10651 if (inventory_slots.Count() < 1)
10652 {
10653 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10654 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10655 }
10656 else
10657 {
10658 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10659 }
10660
10661 idx = inventory_slots.Find(slot);
10662 if (idx < 0)
10663 return "";
10664
10665 return attach_types.Get(idx);
10666 }
10667
10669 {
10670 int idx = -1;
10671 string slot;
10672
10675
10676 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10677 if (inventory_slots.Count() < 1)
10678 {
10679 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10680 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10681 }
10682 else
10683 {
10684 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10685 if (detach_types.Count() < 1)
10686 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10687 }
10688
10689 for (int i = 0; i < inventory_slots.Count(); i++)
10690 {
10691 slot = inventory_slots.Get(i);
10692 }
10693
10694 if (slot != "")
10695 {
10696 if (detach_types.Count() == 1)
10697 idx = 0;
10698 else
10699 idx = inventory_slots.Find(slot);
10700 }
10701 if (idx < 0)
10702 return "";
10703
10704 return detach_types.Get(idx);
10705 }
10706
10708 {
10709
10711
10712
10713 float min_time = 1;
10714 float max_time = 3;
10715 float delay = Math.RandomFloat(min_time, max_time);
10716
10717 explode_timer.Run(delay, this, "DoAmmoExplosion");
10718 }
10719
10721 {
10722 Magazine magazine = Magazine.Cast(this);
10723 int pop_sounds_count = 6;
10724 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10725
10726
10727 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10728 string sound_name = pop_sounds[ sound_idx ];
10730
10731
10732 magazine.ServerAddAmmoCount(-1);
10733
10734
10735 float min_temp_to_explode = 100;
10736
10737 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10738 {
10740 }
10741 }
10742
10743
10744 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10745 {
10746 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10747
10748 const int CHANCE_DAMAGE_CARGO = 4;
10749 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10750 const int CHANCE_DAMAGE_NOTHING = 2;
10751
10753 {
10754 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10755 int chances;
10756 int rnd;
10757
10758 if (GetInventory().GetCargo())
10759 {
10760 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10761 rnd = Math.RandomInt(0,chances);
10762
10763 if (rnd < CHANCE_DAMAGE_CARGO)
10764 {
10766 }
10767 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10768 {
10770 }
10771 }
10772 else
10773 {
10774 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10775 rnd = Math.RandomInt(0,chances);
10776
10777 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10778 {
10780 }
10781 }
10782 }
10783 }
10784
10786 {
10787 if (GetInventory().GetCargo())
10788 {
10789 int item_count = GetInventory().GetCargo().GetItemCount();
10790 if (item_count > 0)
10791 {
10792 int random_pick = Math.RandomInt(0, item_count);
10794 if (!item.IsExplosive())
10795 {
10796 item.AddHealth("","",damage);
10797 return true;
10798 }
10799 }
10800 }
10801 return false;
10802 }
10803
10805 {
10806 int attachment_count = GetInventory().AttachmentCount();
10807 if (attachment_count > 0)
10808 {
10809 int random_pick = Math.RandomInt(0, attachment_count);
10810 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10811 if (!attachment.IsExplosive())
10812 {
10813 attachment.AddHealth("","",damage);
10814 return true;
10815 }
10816 }
10817 return false;
10818 }
10819
10821 {
10823 }
10824
10826 {
10828 return GetInventory().CanRemoveEntity();
10829
10830 return false;
10831 }
10832
10834 {
10836 return;
10837
10839 {
10840 if (ScriptInputUserData.CanStoreInputUserData())
10841 {
10842 ScriptInputUserData ctx = new ScriptInputUserData;
10847 ctx.
Write(destination_entity);
10849 ctx.
Write(slot_id);
10851 }
10852 }
10853 else if (!
GetGame().IsMultiplayer())
10854 {
10856 }
10857 }
10858
10860 {
10862 return;
10863
10864 float split_quantity_new;
10868 InventoryLocation loc = new InventoryLocation;
10869
10870 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10871 {
10873 split_quantity_new = stack_max;
10874 else
10876
10877 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10878 if (new_item)
10879 {
10880 new_item.SetResultOfSplit(true);
10881 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10883 new_item.SetQuantity(split_quantity_new);
10884 }
10885 }
10886 else if (destination_entity && slot_id == -1)
10887 {
10888 if (quantity > stack_max)
10889 split_quantity_new = stack_max;
10890 else
10891 split_quantity_new = quantity;
10892
10894 {
10897 }
10898
10899 if (new_item)
10900 {
10901 new_item.SetResultOfSplit(true);
10902 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10904 new_item.SetQuantity(split_quantity_new);
10905 }
10906 }
10907 else
10908 {
10909 if (stack_max != 0)
10910 {
10912 {
10914 }
10915
10916 if (split_quantity_new == 0)
10917 {
10918 if (!
GetGame().IsMultiplayer())
10919 player.PhysicalPredictiveDropItem(this);
10920 else
10921 player.ServerDropEntity(this);
10922 return;
10923 }
10924
10926
10927 if (new_item)
10928 {
10929 new_item.SetResultOfSplit(true);
10930 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10932 new_item.SetQuantity(stack_max);
10933 new_item.PlaceOnSurface();
10934 }
10935 }
10936 }
10937 }
10938
10940 {
10942 return;
10943
10944 float split_quantity_new;
10948 InventoryLocation loc = new InventoryLocation;
10949
10950 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10951 {
10953 split_quantity_new = stack_max;
10954 else
10956
10957 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10958 if (new_item)
10959 {
10960 new_item.SetResultOfSplit(true);
10961 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10963 new_item.SetQuantity(split_quantity_new);
10964 }
10965 }
10966 else if (destination_entity && slot_id == -1)
10967 {
10968 if (quantity > stack_max)
10969 split_quantity_new = stack_max;
10970 else
10971 split_quantity_new = quantity;
10972
10974 {
10977 }
10978
10979 if (new_item)
10980 {
10981 new_item.SetResultOfSplit(true);
10982 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10984 new_item.SetQuantity(split_quantity_new);
10985 }
10986 }
10987 else
10988 {
10989 if (stack_max != 0)
10990 {
10992 {
10994 }
10995
10997
10998 if (new_item)
10999 {
11000 new_item.SetResultOfSplit(true);
11001 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11003 new_item.SetQuantity(stack_max);
11004 new_item.PlaceOnSurface();
11005 }
11006 }
11007 }
11008 }
11009
11011 {
11013 return;
11014
11016 {
11017 if (ScriptInputUserData.CanStoreInputUserData())
11018 {
11019 ScriptInputUserData ctx = new ScriptInputUserData;
11024 dst.WriteToContext(ctx);
11026 }
11027 }
11028 else if (!
GetGame().IsMultiplayer())
11029 {
11031 }
11032 }
11033
11035 {
11037 return;
11038
11040 {
11041 if (ScriptInputUserData.CanStoreInputUserData())
11042 {
11043 ScriptInputUserData ctx = new ScriptInputUserData;
11048 ctx.
Write(destination_entity);
11054 }
11055 }
11056 else if (!
GetGame().IsMultiplayer())
11057 {
11059 }
11060 }
11061
11063 {
11065 }
11066
11068 {
11070 return this;
11071
11073 float split_quantity_new;
11075 if (dst.IsValid())
11076 {
11077 int slot_id = dst.GetSlot();
11079
11080 if (quantity > stack_max)
11081 split_quantity_new = stack_max;
11082 else
11083 split_quantity_new = quantity;
11084
11086
11087 if (new_item)
11088 {
11089 new_item.SetResultOfSplit(true);
11090 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11093 }
11094
11095 return new_item;
11096 }
11097
11098 return null;
11099 }
11100
11102 {
11104 return;
11105
11107 float split_quantity_new;
11109 if (destination_entity)
11110 {
11112 if (quantity > stackable)
11113 split_quantity_new = stackable;
11114 else
11115 split_quantity_new = quantity;
11116
11117 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11118 if (new_item)
11119 {
11120 new_item.SetResultOfSplit(true);
11121 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11123 new_item.SetQuantity(split_quantity_new);
11124 }
11125 }
11126 }
11127
11129 {
11131 return;
11132
11134 {
11135 if (ScriptInputUserData.CanStoreInputUserData())
11136 {
11137 ScriptInputUserData ctx = new ScriptInputUserData;
11142 ItemBase destination_entity =
this;
11143 ctx.
Write(destination_entity);
11147 }
11148 }
11149 else if (!
GetGame().IsMultiplayer())
11150 {
11152 }
11153 }
11154
11156 {
11158 return;
11159
11161 float split_quantity_new;
11163 if (player)
11164 {
11166 if (quantity > stackable)
11167 split_quantity_new = stackable;
11168 else
11169 split_quantity_new = quantity;
11170
11171 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11172 new_item =
ItemBase.Cast(in_hands);
11173 if (new_item)
11174 {
11175 new_item.SetResultOfSplit(true);
11176 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11178 new_item.SetQuantity(split_quantity_new);
11179 }
11180 }
11181 }
11182
11184 {
11186 return;
11187
11189 float split_quantity_new = Math.Floor(quantity * 0.5);
11190
11192
11193 if (new_item)
11194 {
11195 if (new_item.GetQuantityMax() < split_quantity_new)
11196 {
11197 split_quantity_new = new_item.GetQuantityMax();
11198 }
11199
11200 new_item.SetResultOfSplit(true);
11201 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11202
11204 {
11207 }
11208 else
11209 {
11212 }
11213 }
11214 }
11215
11217 {
11219 return;
11220
11222 float split_quantity_new = Math.Floor(quantity / 2);
11223
11224 InventoryLocation invloc = new InventoryLocation;
11226
11228 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11229
11230 if (new_item)
11231 {
11232 if (new_item.GetQuantityMax() < split_quantity_new)
11233 {
11234 split_quantity_new = new_item.GetQuantityMax();
11235 }
11237 {
11240 }
11241 else
11242 {
11245 }
11246 }
11247 }
11248
11251 {
11252 SetWeightDirty();
11254
11255 if (parent)
11256 parent.OnAttachmentQuantityChangedEx(this, delta);
11257
11259 {
11261 {
11263 }
11265 {
11266 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11268 }
11269 }
11270
11271 }
11272
11275 {
11276
11277 }
11278
11281 {
11283 }
11284
11286 {
11287 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11288
11290 {
11291 if (newLevel == GameConstants.STATE_RUINED)
11292 {
11294 EntityAI parent = GetHierarchyParent();
11295 if (parent && parent.IsFireplace())
11296 {
11297 CargoBase cargo = GetInventory().GetCargo();
11298 if (cargo)
11299 {
11301 {
11303 }
11304 }
11305 }
11306 }
11307
11309 {
11310
11312 return;
11313 }
11314
11315 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11316 {
11318 }
11319 }
11320 }
11321
11322
11324 {
11325 super.OnRightClick();
11326
11328 {
11330 {
11331 if (ScriptInputUserData.CanStoreInputUserData())
11332 {
11333 vector m4[4];
11335
11336 EntityAI root = GetHierarchyRoot();
11337
11338 InventoryLocation dst = new InventoryLocation;
11340 {
11341 if (root)
11342 {
11343 root.GetTransform(m4);
11345 }
11346 else
11347 GetInventory().GetCurrentInventoryLocation(dst);
11348 }
11349 else
11350 {
11352
11353
11354 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11355 {
11356 if (root)
11357 {
11358 root.GetTransform(m4);
11360 }
11361 else
11362 GetInventory().GetCurrentInventoryLocation(dst);
11363 }
11364 else
11365 {
11366 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11367 }
11368 }
11369
11370 ScriptInputUserData ctx = new ScriptInputUserData;
11378 }
11379 }
11380 else if (!
GetGame().IsMultiplayer())
11381 {
11383 }
11384 }
11385 }
11386
11387 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11388 {
11389
11390 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11391 return false;
11392
11393 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11394 return false;
11395
11396
11398 return false;
11399
11400
11401 Magazine mag = Magazine.Cast(this);
11402 if (mag)
11403 {
11404 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11405 return false;
11406
11407 if (stack_max_limit)
11408 {
11409 Magazine other_mag = Magazine.Cast(other_item);
11410 if (other_item)
11411 {
11412 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11413 return false;
11414 }
11415
11416 }
11417 }
11418 else
11419 {
11420
11422 return false;
11423
11425 return false;
11426 }
11427
11428 PlayerBase player = null;
11429 if (CastTo(player, GetHierarchyRootPlayer()))
11430 {
11431 if (player.GetInventory().HasAttachment(this))
11432 return false;
11433
11434 if (player.IsItemsToDelete())
11435 return false;
11436 }
11437
11438 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11439 return false;
11440
11441 int slotID;
11443 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11444 return false;
11445
11446 return true;
11447 }
11448
11450 {
11452 }
11453
11455 {
11456 return m_IsResultOfSplit;
11457 }
11458
11460 {
11461 m_IsResultOfSplit = value;
11462 }
11463
11465 {
11467 }
11468
11470 {
11471 float other_item_quantity = other_item.GetQuantity();
11472 float this_free_space;
11473
11475
11477
11478 if (other_item_quantity > this_free_space)
11479 {
11480 return this_free_space;
11481 }
11482 else
11483 {
11484 return other_item_quantity;
11485 }
11486 }
11487
11489 {
11491 }
11492
11494 {
11496 return;
11497
11498 if (!IsMagazine() && other_item)
11499 {
11501 if (quantity_used != 0)
11502 {
11503 float hp1 = GetHealth01("","");
11504 float hp2 = other_item.GetHealth01("","");
11505 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11506 hpResult = hpResult / (
GetQuantity() + quantity_used);
11507
11508 hpResult *= GetMaxHealth();
11509 Math.Round(hpResult);
11510 SetHealth("", "Health", hpResult);
11511
11513 other_item.AddQuantity(-quantity_used);
11514 }
11515 }
11517 }
11518
11520 {
11521 #ifdef SERVER
11522 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11523 GetHierarchyParent().IncreaseLifetimeUp();
11524 #endif
11525 };
11526
11528 {
11529 PlayerBase p = PlayerBase.Cast(player);
11530
11531 array<int> recipesIds = p.m_Recipes;
11532 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11533 if (moduleRecipesManager)
11534 {
11535 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11536 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11537 }
11538
11539 for (int i = 0;i < recipesIds.Count(); i++)
11540 {
11541 int key = recipesIds.Get(i);
11542 string recipeName = moduleRecipesManager.GetRecipeName(key);
11544 }
11545 }
11546
11547
11548 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11549 {
11550 super.GetDebugActions(outputList);
11551
11552
11557
11558
11562
11566
11567
11570
11571
11573 {
11576 }
11577
11579
11582
11586 }
11587
11588
11589
11590
11592 {
11593 super.OnAction(action_id, player, ctx);
11594 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11595 {
11596 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11597 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11598 PlayerBase p = PlayerBase.Cast(player);
11599 if (
EActions.RECIPES_RANGE_START < 1000)
11600 {
11601 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11602 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11603 }
11604 }
11605 #ifndef SERVER
11606 else if (action_id ==
EActions.WATCH_PLAYER)
11607 {
11608 PluginDeveloper.SetDeveloperItemClientEx(player);
11609 }
11610 #endif
11612 {
11613 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11614 {
11615 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11616 OnDebugButtonPressServer(id + 1);
11617 }
11618
11619 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11620 {
11621 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11623 }
11624
11625 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11626 {
11627 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11629 }
11630
11631 else if (action_id ==
EActions.ADD_QUANTITY)
11632 {
11633 if (IsMagazine())
11634 {
11635 Magazine mag = Magazine.Cast(this);
11636 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11637 }
11638 else
11639 {
11641 }
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.REMOVE_QUANTITY)
11651 {
11652 if (IsMagazine())
11653 {
11654 Magazine mag2 = Magazine.Cast(this);
11655 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11656 }
11657 else
11658 {
11660 }
11661 if (m_EM)
11662 {
11663 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11664 }
11665
11666 }
11667
11668 else if (action_id ==
EActions.SET_QUANTITY_0)
11669 {
11671
11672 if (m_EM)
11673 {
11674 m_EM.SetEnergy(0);
11675 }
11676 }
11677
11678 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11679 {
11681
11682 if (m_EM)
11683 {
11684 m_EM.SetEnergy(m_EM.GetEnergyMax());
11685 }
11686 }
11687
11688 else if (action_id ==
EActions.ADD_HEALTH)
11689 {
11690 AddHealth("","",GetMaxHealth("","Health")/5);
11691 }
11692 else if (action_id ==
EActions.REMOVE_HEALTH)
11693 {
11694 AddHealth("","",-GetMaxHealth("","Health")/5);
11695 }
11696 else if (action_id ==
EActions.DESTROY_HEALTH)
11697 {
11698 SetHealth01("","",0);
11699 }
11700 else if (action_id ==
EActions.WATCH_ITEM)
11701 {
11703 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11704 #ifdef DEVELOPER
11705 SetDebugDeveloper_item(this);
11706 #endif
11707 }
11708
11709 else if (action_id ==
EActions.ADD_TEMPERATURE)
11710 {
11711 AddTemperature(20);
11712
11713 }
11714
11715 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11716 {
11717 AddTemperature(-20);
11718
11719 }
11720
11721 else if (action_id ==
EActions.FLIP_FROZEN)
11722 {
11723 SetFrozen(!GetIsFrozen());
11724
11725 }
11726
11727 else if (action_id ==
EActions.ADD_WETNESS)
11728 {
11730
11731 }
11732
11733 else if (action_id ==
EActions.REMOVE_WETNESS)
11734 {
11736
11737 }
11738
11739 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11740 {
11743
11744
11745 }
11746
11747 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11748 {
11751 }
11752
11753 else if (action_id ==
EActions.MAKE_SPECIAL)
11754 {
11755 auto debugParams = DebugSpawnParams.WithPlayer(player);
11756 OnDebugSpawnEx(debugParams);
11757 }
11758
11759 else if (action_id ==
EActions.DELETE)
11760 {
11761 Delete();
11762 }
11763
11764 }
11765
11766
11767 return false;
11768 }
11769
11770
11771
11772
11776
11779
11780
11781
11783 {
11784 return false;
11785 }
11786
11787
11789 {
11790 return true;
11791 }
11792
11793
11795 {
11796 return true;
11797 }
11798
11799
11800
11802 {
11803 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11805 }
11806
11809 {
11810 return null;
11811 }
11812
11814 {
11815 return false;
11816 }
11817
11819 {
11820 return false;
11821 }
11822
11826
11827
11829 {
11830 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11831 return module_repairing.CanRepair(this, item_repair_kit);
11832 }
11833
11834
11835 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11836 {
11837 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11838 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11839 }
11840
11841
11843 {
11844
11845
11846
11847
11848
11849
11850
11851
11852 return 1;
11853 }
11854
11855
11856
11858 {
11860 }
11861
11862
11863
11865 {
11867 }
11868
11869
11878 {
11879 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11880
11881 if (player)
11882 {
11883 player.MessageStatus(text);
11884 }
11885 }
11886
11887
11896 {
11897 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11898
11899 if (player)
11900 {
11901 player.MessageAction(text);
11902 }
11903 }
11904
11905
11914 {
11915 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11916
11917 if (player)
11918 {
11919 player.MessageFriendly(text);
11920 }
11921 }
11922
11923
11932 {
11933 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11934
11935 if (player)
11936 {
11937 player.MessageImportant(text);
11938 }
11939 }
11940
11942 {
11943 return true;
11944 }
11945
11946
11947 override bool KindOf(
string tag)
11948 {
11949 bool found = false;
11950 string item_name = this.
GetType();
11953
11954 int array_size = item_tag_array.Count();
11955 for (int i = 0; i < array_size; i++)
11956 {
11957 if (item_tag_array.Get(i) == tag)
11958 {
11959 found = true;
11960 break;
11961 }
11962 }
11963 return found;
11964 }
11965
11966
11968 {
11969
11970 super.OnRPC(sender, rpc_type,ctx);
11971
11972
11973 switch (rpc_type)
11974 {
11975 #ifndef SERVER
11976 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11977 Param2<bool, string> p = new Param2<bool, string>(false, "");
11978
11980 return;
11981
11982 bool play = p.param1;
11983 string soundSet = p.param2;
11984
11985 if (play)
11986 {
11988 {
11990 {
11992 }
11993 }
11994 else
11995 {
11997 }
11998 }
11999 else
12000 {
12002 }
12003
12004 break;
12005 #endif
12006
12007 }
12008
12010 {
12012 }
12013 }
12014
12015
12016
12017
12019 {
12020 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12021 return plugin.GetID(
name);
12022 }
12023
12025 {
12026 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12027 return plugin.GetName(id);
12028 }
12029
12032 {
12033
12034
12035 int varFlags;
12036 if (!ctx.
Read(varFlags))
12037 return;
12038
12039 if (varFlags & ItemVariableFlags.FLOAT)
12040 {
12042 }
12043 }
12044
12046 {
12047
12048 super.SerializeNumericalVars(floats_out);
12049
12050
12051
12053 {
12055 }
12056
12058 {
12060 }
12061
12063 {
12065 }
12066
12068 {
12073 }
12074
12076 {
12078 }
12079 }
12080
12082 {
12083
12084 super.DeSerializeNumericalVars(floats);
12085
12086
12087 int index = 0;
12088 int mask = Math.Round(floats.Get(index));
12089
12090 index++;
12091
12093 {
12095 {
12097 }
12098 else
12099 {
12100 float quantity = floats.Get(index);
12101 SetQuantity(quantity,
true,
false,
false,
false);
12102 }
12103 index++;
12104 }
12105
12107 {
12108 float wet = floats.Get(index);
12110 index++;
12111 }
12112
12114 {
12115 int liquidtype = Math.Round(floats.Get(index));
12117 index++;
12118 }
12119
12121 {
12123 index++;
12125 index++;
12127 index++;
12129 index++;
12130 }
12131
12133 {
12134 int cleanness = Math.Round(floats.Get(index));
12136 index++;
12137 }
12138 }
12139
12141 {
12142 super.WriteVarsToCTX(ctx);
12143
12144
12146 {
12148 }
12149
12151 {
12153 }
12154
12156 {
12158 }
12159
12161 {
12162 int r,g,b,a;
12168 }
12169
12171 {
12173 }
12174 }
12175
12177 {
12178 if (!super.ReadVarsFromCTX(ctx,version))
12179 return false;
12180
12181 int intValue;
12182 float value;
12183
12184 if (version < 140)
12185 {
12186 if (!ctx.
Read(intValue))
12187 return false;
12188
12189 m_VariablesMask = intValue;
12190 }
12191
12193 {
12194 if (!ctx.
Read(value))
12195 return false;
12196
12198 {
12200 }
12201 else
12202 {
12204 }
12205 }
12206
12207 if (version < 140)
12208 {
12210 {
12211 if (!ctx.
Read(value))
12212 return false;
12213 SetTemperatureDirect(value);
12214 }
12215 }
12216
12218 {
12219 if (!ctx.
Read(value))
12220 return false;
12222 }
12223
12225 {
12226 if (!ctx.
Read(intValue))
12227 return false;
12229 }
12230
12232 {
12233 int r,g,b,a;
12235 return false;
12237 return false;
12239 return false;
12241 return false;
12242
12244 }
12245
12247 {
12248 if (!ctx.
Read(intValue))
12249 return false;
12251 }
12252
12253 if (version >= 138 && version < 140)
12254 {
12256 {
12257 if (!ctx.
Read(intValue))
12258 return false;
12259 SetFrozen(intValue);
12260 }
12261 }
12262
12263 return true;
12264 }
12265
12266
12268 {
12271 {
12273 }
12274
12275 if (!super.OnStoreLoad(ctx, version))
12276 {
12278 return false;
12279 }
12280
12281 if (version >= 114)
12282 {
12283 bool hasQuickBarIndexSaved;
12284
12285 if (!ctx.
Read(hasQuickBarIndexSaved))
12286 {
12288 return false;
12289 }
12290
12291 if (hasQuickBarIndexSaved)
12292 {
12293 int itmQBIndex;
12294
12295
12296 if (!ctx.
Read(itmQBIndex))
12297 {
12299 return false;
12300 }
12301
12302 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12303 if (itmQBIndex != -1 && parentPlayer)
12304 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12305 }
12306 }
12307 else
12308 {
12309
12310 PlayerBase player;
12311 int itemQBIndex;
12312 if (version ==
int.
MAX)
12313 {
12314 if (!ctx.
Read(itemQBIndex))
12315 {
12317 return false;
12318 }
12319 }
12320 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12321 {
12322
12323 if (!ctx.
Read(itemQBIndex))
12324 {
12326 return false;
12327 }
12328 if (itemQBIndex != -1 && player)
12329 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12330 }
12331 }
12332
12333 if (version < 140)
12334 {
12335
12336 if (!LoadVariables(ctx, version))
12337 {
12339 return false;
12340 }
12341 }
12342
12343
12345 {
12347 return false;
12348 }
12349 if (version >= 132)
12350 {
12352 if (raib)
12353 {
12355 {
12357 return false;
12358 }
12359 }
12360 }
12361
12363 return true;
12364 }
12365
12366
12367
12369 {
12370 super.OnStoreSave(ctx);
12371
12372 PlayerBase player;
12373 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12374 {
12376
12377 int itemQBIndex = -1;
12378 itemQBIndex = player.FindQuickBarEntityIndex(this);
12379 ctx.
Write(itemQBIndex);
12380 }
12381 else
12382 {
12384 }
12385
12387
12389 if (raib)
12390 {
12392 }
12393 }
12394
12395
12397 {
12398 super.AfterStoreLoad();
12399
12401 {
12403 }
12404
12406 {
12409 }
12410 }
12411
12413 {
12414 super.EEOnAfterLoad();
12415
12417 {
12419 }
12420
12423 }
12424
12426 {
12427 return false;
12428 }
12429
12430
12431
12433 {
12435 {
12436 #ifdef PLATFORM_CONSOLE
12437
12439 {
12441 if (menu)
12442 {
12444 }
12445 }
12446 #endif
12447 }
12448
12450 {
12453 }
12454
12456 {
12457 SetWeightDirty();
12459 }
12461 {
12464 }
12465
12467 {
12470 }
12472 {
12475 }
12476
12477 super.OnVariablesSynchronized();
12478 }
12479
12480
12481
12483 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12484 {
12485 if (!IsServerCheck(allow_client))
12486 return false;
12487
12489 return false;
12490
12493
12494 if (value <= (min + 0.001))
12495 value = min;
12496
12497 if (value == min)
12498 {
12499 if (destroy_config)
12500 {
12501 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12502 if (dstr)
12503 {
12505 this.Delete();
12506 return true;
12507 }
12508 }
12509 else if (destroy_forced)
12510 {
12512 this.Delete();
12513 return true;
12514 }
12515
12517 }
12518
12521
12523 {
12525
12526 if (delta)
12528 }
12529
12531
12532 return false;
12533 }
12534
12535
12537 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12538 {
12540 }
12541
12543 {
12546 }
12547
12549 {
12552 }
12553
12556 {
12557 float value_clamped = Math.Clamp(value, 0, 1);
12559 SetQuantity(result, destroy_config, destroy_forced);
12560 }
12561
12562
12565 {
12567 }
12568
12570 {
12572 }
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12584 {
12585 int slot = -1;
12586 if (GetInventory())
12587 {
12588 InventoryLocation il = new InventoryLocation;
12589 GetInventory().GetCurrentInventoryLocation(il);
12591 }
12592
12594 }
12595
12597 {
12598 float quantity_max = 0;
12599
12601 {
12602 if (attSlotID != -1)
12603 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12604
12605 if (quantity_max <= 0)
12607 }
12608
12609 if (quantity_max <= 0)
12611
12612 return quantity_max;
12613 }
12614
12616 {
12618 }
12619
12621 {
12623 }
12624
12625
12627 {
12629 }
12630
12632 {
12634 }
12635
12637 {
12639 }
12640
12641
12643 {
12644
12645 float weightEx = GetWeightEx();
12646 float special = GetInventoryAndCargoWeight();
12647 return weightEx - special;
12648 }
12649
12650
12652 {
12654 }
12655
12657 {
12659 {
12660 #ifdef DEVELOPER
12661 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12662 {
12663 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12665 }
12666 #endif
12667
12668 return GetQuantity() * GetConfigWeightModified();
12669 }
12670 else if (HasEnergyManager())
12671 {
12672 #ifdef DEVELOPER
12673 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12674 {
12675 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12676 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12677 }
12678 #endif
12679 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12680 }
12681 else
12682 {
12683 #ifdef DEVELOPER
12684 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12685 {
12686 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12687 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12688 }
12689 #endif
12690 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12691 }
12692 }
12693
12696 {
12697 int item_count = 0;
12699
12700 if (GetInventory().GetCargo() != NULL)
12701 {
12702 item_count = GetInventory().GetCargo().GetItemCount();
12703 }
12704
12705 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12706 {
12707 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12708 if (item)
12709 item_count += item.GetNumberOfItems();
12710 }
12711 return item_count;
12712 }
12713
12716 {
12717 float weight = 0;
12718 float wetness = 1;
12719 if (include_wetness)
12722 {
12723 weight = wetness * m_ConfigWeight;
12724 }
12726 {
12727 weight = 1;
12728 }
12729 return weight;
12730 }
12731
12732
12733
12735 {
12736 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12737 {
12738 GameInventory inv = GetInventory();
12739 array<EntityAI> items = new array<EntityAI>;
12741 for (int i = 0; i < items.Count(); i++)
12742 {
12744 if (item)
12745 {
12747 }
12748 }
12749 }
12750 }
12751
12752
12753
12754
12756 {
12757 float energy = 0;
12758 if (HasEnergyManager())
12759 {
12760 energy = GetCompEM().GetEnergy();
12761 }
12762 return energy;
12763 }
12764
12765
12767 {
12768 super.OnEnergyConsumed();
12769
12771 }
12772
12774 {
12775 super.OnEnergyAdded();
12776
12778 }
12779
12780
12782 {
12783 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12784 {
12786 {
12787 float energy_0to1 = GetCompEM().GetEnergy0To1();
12789 }
12790 }
12791 }
12792
12793
12795 {
12796 return ConfigGetFloat("heatIsolation");
12797 }
12798
12800 {
12802 }
12803
12805 {
12806 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12807 if (
GetGame().ConfigIsExisting(paramPath))
12809
12810 return 0.0;
12811 }
12812
12814 {
12815 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12816 if (
GetGame().ConfigIsExisting(paramPath))
12818
12819 return 0.0;
12820 }
12821
12822 override void SetWet(
float value,
bool allow_client =
false)
12823 {
12824 if (!IsServerCheck(allow_client))
12825 return;
12826
12829
12831
12832 m_VarWet = Math.Clamp(value, min, max);
12833
12835 {
12838 }
12839 }
12840
12841 override void AddWet(
float value)
12842 {
12844 }
12845
12847 {
12849 }
12850
12852 {
12854 }
12855
12857 {
12859 }
12860
12862 {
12864 }
12865
12867 {
12869 }
12870
12871 override void OnWetChanged(
float newVal,
float oldVal)
12872 {
12875 if (newLevel != oldLevel)
12876 {
12878 }
12879 }
12880
12882 {
12883 SetWeightDirty();
12884 }
12885
12887 {
12888 return GetWetLevelInternal(
m_VarWet);
12889 }
12890
12891
12892
12894 {
12896 }
12897
12899 {
12901 }
12902
12904 {
12906 }
12907
12909 {
12911 }
12912
12913
12914
12916 {
12917 if (ConfigIsExisting("itemModelLength"))
12918 {
12919 return ConfigGetFloat("itemModelLength");
12920 }
12921 return 0;
12922 }
12923
12925 {
12926 if (ConfigIsExisting("itemAttachOffset"))
12927 {
12928 return ConfigGetFloat("itemAttachOffset");
12929 }
12930 return 0;
12931 }
12932
12933 override void SetCleanness(
int value,
bool allow_client =
false)
12934 {
12935 if (!IsServerCheck(allow_client))
12936 return;
12937
12939
12941
12944 }
12945
12947 {
12949 }
12950
12952 {
12953 return true;
12954 }
12955
12956
12957
12958
12960 {
12962 }
12963
12965 {
12967 }
12968
12969
12970
12971
12972 override void SetColor(
int r,
int g,
int b,
int a)
12973 {
12979 }
12981 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12982 {
12987 }
12988
12990 {
12992 }
12993
12996 {
12997 int r,g,b,a;
12999 r = r/255;
13000 g = g/255;
13001 b = b/255;
13002 a = a/255;
13003 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13004 }
13005
13006
13007
13008 override void SetLiquidType(
int value,
bool allow_client =
false)
13009 {
13010 if (!IsServerCheck(allow_client))
13011 return;
13012
13017 }
13018
13020 {
13021 return ConfigGetInt("varLiquidTypeInit");
13022 }
13023
13025 {
13027 }
13028
13030 {
13032 SetFrozen(false);
13033 }
13034
13037 {
13038 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13039 }
13040
13041
13044 {
13045 PlayerBase nplayer;
13046 if (PlayerBase.CastTo(nplayer, player))
13047 {
13049
13050 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13051 }
13052 }
13053
13054
13057 {
13058 PlayerBase nplayer;
13059 if (PlayerBase.CastTo(nplayer,player))
13060 {
13061
13062 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13063
13064 }
13065
13066
13067 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13068
13069
13070 if (HasEnergyManager())
13071 {
13072 GetCompEM().UpdatePlugState();
13073 }
13074 }
13075
13076
13078 {
13079 super.OnPlacementStarted(player);
13080
13082 }
13083
13084 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13085 {
13087 {
13088 m_AdminLog.OnPlacementComplete(player,
this);
13089 }
13090
13091 super.OnPlacementComplete(player, position, orientation);
13092 }
13093
13094
13095
13096
13097
13099 {
13101 {
13102 return true;
13103 }
13104 else
13105 {
13106 return false;
13107 }
13108 }
13109
13110
13112 {
13114 {
13116 }
13117 }
13118
13119
13121 {
13123 }
13124
13126 {
13128 }
13129
13130 override void InsertAgent(
int agent,
float count = 1)
13131 {
13132 if (count < 1)
13133 return;
13134
13136 }
13137
13140 {
13142 }
13143
13144
13146 {
13148 }
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13192 {
13194 return false;
13195 return true;
13196 }
13197
13199 {
13200
13202 }
13203
13204
13207 {
13208 super.CheckForRoofLimited(timeTresholdMS);
13209
13211 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13212 {
13213 m_PreviousRoofTestTime = time;
13214 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13215 }
13216 }
13217
13218
13220 {
13222 {
13223 return 0;
13224 }
13225
13226 if (GetInventory().GetAttachmentSlotsCount() != 0)
13227 {
13228 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13229 if (filter)
13230 return filter.GetProtectionLevel(type, false, system);
13231 else
13232 return 0;
13233 }
13234
13235 string subclassPath, entryName;
13236
13237 switch (type)
13238 {
13240 entryName = "biological";
13241 break;
13243 entryName = "chemical";
13244 break;
13245 default:
13246 entryName = "biological";
13247 break;
13248 }
13249
13250 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13251
13253 }
13254
13255
13256
13259 {
13260 if (!IsMagazine())
13262
13264 }
13265
13266
13267
13268
13269
13274 {
13275 return true;
13276 }
13277
13279 {
13281 }
13282
13283
13284
13285
13286
13288 {
13289 if (parent)
13290 {
13291 if (parent.IsInherited(DayZInfected))
13292 return true;
13293
13294 if (!parent.IsRuined())
13295 return true;
13296 }
13297
13298 return true;
13299 }
13300
13302 {
13303 if (!super.CanPutAsAttachment(parent))
13304 {
13305 return false;
13306 }
13307
13308 if (!IsRuined() && !parent.IsRuined())
13309 {
13310 return true;
13311 }
13312
13313 return false;
13314 }
13315
13317 {
13318
13319
13320
13321
13322 return super.CanReceiveItemIntoCargo(item);
13323 }
13324
13326 {
13327
13328
13329
13330
13331 GameInventory attachmentInv = attachment.GetInventory();
13333 {
13334 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13335 return false;
13336 }
13337
13338 InventoryLocation loc = new InventoryLocation();
13339 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13340 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13341 return false;
13342
13343 return super.CanReceiveAttachment(attachment, slotId);
13344 }
13345
13347 {
13348 if (!super.CanReleaseAttachment(attachment))
13349 return false;
13350
13351 return GetInventory().AreChildrenAccessible();
13352 }
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13375 {
13376 int id = muzzle_owner.GetMuzzleID();
13377 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13378
13379 if (WPOF_array)
13380 {
13381 for (int i = 0; i < WPOF_array.Count(); i++)
13382 {
13383 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13384
13385 if (WPOF)
13386 {
13387 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13388 }
13389 }
13390 }
13391 }
13392
13393
13395 {
13396 int id = muzzle_owner.GetMuzzleID();
13398
13399 if (WPOBE_array)
13400 {
13401 for (int i = 0; i < WPOBE_array.Count(); i++)
13402 {
13403 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13404
13405 if (WPOBE)
13406 {
13407 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13408 }
13409 }
13410 }
13411 }
13412
13413
13415 {
13416 int id = muzzle_owner.GetMuzzleID();
13417 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13418
13419 if (WPOOH_array)
13420 {
13421 for (int i = 0; i < WPOOH_array.Count(); i++)
13422 {
13423 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13424
13425 if (WPOOH)
13426 {
13427 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13428 }
13429 }
13430 }
13431 }
13432
13433
13435 {
13436 int id = muzzle_owner.GetMuzzleID();
13437 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13438
13439 if (WPOOH_array)
13440 {
13441 for (int i = 0; i < WPOOH_array.Count(); i++)
13442 {
13443 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13444
13445 if (WPOOH)
13446 {
13447 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13448 }
13449 }
13450 }
13451 }
13452
13453
13455 {
13456 int id = muzzle_owner.GetMuzzleID();
13457 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13458
13459 if (WPOOH_array)
13460 {
13461 for (int i = 0; i < WPOOH_array.Count(); i++)
13462 {
13463 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13464
13465 if (WPOOH)
13466 {
13467 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13468 }
13469 }
13470 }
13471 }
13472
13473
13474
13476 {
13478 {
13479 return true;
13480 }
13481
13482 return false;
13483 }
13484
13486 {
13488 {
13489 return true;
13490 }
13491
13492 return false;
13493 }
13494
13496 {
13498 {
13499 return true;
13500 }
13501
13502 return false;
13503 }
13504
13506 {
13507 return false;
13508 }
13509
13512 {
13513 return UATimeSpent.DEFAULT_DEPLOY;
13514 }
13515
13516
13517
13518
13520 {
13522 SetSynchDirty();
13523 }
13524
13526 {
13528 }
13529
13530
13532 {
13533 return false;
13534 }
13535
13538 {
13539 string att_type = "None";
13540
13541 if (ConfigIsExisting("soundAttType"))
13542 {
13543 att_type = ConfigGetString("soundAttType");
13544 }
13545
13547 }
13548
13550 {
13552 }
13553
13554
13555
13556
13557
13561
13563 {
13566
13568 }
13569
13570
13572 {
13574 return;
13575
13577
13580
13583
13584 SoundParameters params = new SoundParameters();
13588 }
13589
13590
13592 {
13594 return;
13595
13597 SetSynchDirty();
13598
13601 }
13602
13603
13605 {
13607 return;
13608
13610 SetSynchDirty();
13611
13614 }
13615
13617 {
13619 }
13620
13622 {
13624 }
13625
13628 {
13629 if (!
GetGame().IsDedicatedServer())
13630 {
13631 if (ConfigIsExisting("attachSoundSet"))
13632 {
13633 string cfg_path = "";
13634 string soundset = "";
13635 string type_name =
GetType();
13636
13639 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13640 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13641
13642 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13643 {
13644 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13645 {
13646 if (cfg_slot_array[i] == slot_type)
13647 {
13648 soundset = cfg_soundset_array[i];
13649 break;
13650 }
13651 }
13652 }
13653
13654 if (soundset != "")
13655 {
13656 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13658 }
13659 }
13660 }
13661 }
13662
13664 {
13665
13666 }
13667
13668 void OnApply(PlayerBase player);
13669
13671 {
13672 return 1.0;
13673 };
13674
13676 {
13678 }
13679
13681 {
13683 }
13684
13686
13688 {
13689 SetDynamicPhysicsLifeTime(0.01);
13691 }
13692
13694 {
13695 array<string> zone_names = new array<string>;
13696 GetDamageZones(zone_names);
13697 for (int i = 0; i < zone_names.Count(); i++)
13698 {
13699 SetHealthMax(zone_names.Get(i),"Health");
13700 }
13701 SetHealthMax("","Health");
13702 }
13703
13706 {
13707 float global_health = GetHealth01("","Health");
13708 array<string> zones = new array<string>;
13709 GetDamageZones(zones);
13710
13711 for (int i = 0; i < zones.Count(); i++)
13712 {
13713 SetHealth01(zones.Get(i),"Health",global_health);
13714 }
13715 }
13716
13719 {
13720 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13721 }
13722
13724 {
13725 if (!hasRootAsPlayer)
13726 {
13727 if (refParentIB)
13728 {
13729
13730 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13731 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13732
13733 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13734 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13735
13738 }
13739 else
13740 {
13741
13744 }
13745 }
13746 }
13747
13749 {
13751 {
13752 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13753 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13754 {
13755 float heatPermCoef = 1.0;
13757 while (ent)
13758 {
13759 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13760 ent = ent.GetHierarchyParent();
13761 }
13762
13763 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13764 }
13765 }
13766 }
13767
13769 {
13770
13771 EntityAI parent = GetHierarchyParent();
13772 if (!parent)
13773 {
13774 hasParent = false;
13775 hasRootAsPlayer = false;
13776 }
13777 else
13778 {
13779 hasParent = true;
13780 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13781 refParentIB =
ItemBase.Cast(parent);
13782 }
13783 }
13784
13785 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13786 {
13787
13788 }
13789
13791 {
13792
13793 return false;
13794 }
13795
13797 {
13798
13799
13800 return false;
13801 }
13802
13804 {
13805
13806 return false;
13807 }
13808
13811 {
13812 return !GetIsFrozen() &&
IsOpen();
13813 }
13814
13816 {
13817 bool hasParent = false, hasRootAsPlayer = false;
13819
13820 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13821 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13822
13823 if (wwtu || foodDecay)
13824 {
13828
13829 if (processWetness || processTemperature || processDecay)
13830 {
13832
13833 if (processWetness)
13834 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13835
13836 if (processTemperature)
13838
13839 if (processDecay)
13840 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13841 }
13842 }
13843 }
13844
13847 {
13849 }
13850
13852 {
13855
13856 return super.GetTemperatureFreezeThreshold();
13857 }
13858
13860 {
13863
13864 return super.GetTemperatureThawThreshold();
13865 }
13866
13868 {
13871
13872 return super.GetItemOverheatThreshold();
13873 }
13874
13876 {
13878 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13879
13880 return super.GetTemperatureFreezeTime();
13881 }
13882
13884 {
13886 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13887
13888 return super.GetTemperatureThawTime();
13889 }
13890
13895
13897 {
13898 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13899 }
13900
13902 {
13903 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13904 }
13905
13908 {
13910 }
13911
13913 {
13915 }
13916
13918 {
13920 }
13921
13924 {
13925 return null;
13926 }
13927
13930 {
13931 return false;
13932 }
13933
13935 {
13937 {
13940 if (!trg)
13941 {
13943 explosive = this;
13944 }
13945
13946 explosive.PairRemote(trg);
13948
13949 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13950 trg.SetPersistentPairID(persistentID);
13951 explosive.SetPersistentPairID(persistentID);
13952
13953 return true;
13954 }
13955 return false;
13956 }
13957
13960 {
13961 float ret = 1.0;
13964 ret *= GetHealth01();
13965
13966 return ret;
13967 }
13968
13969 #ifdef DEVELOPER
13970 override void SetDebugItem()
13971 {
13972 super.SetDebugItem();
13973 _itemBase = this;
13974 }
13975
13977 {
13978 string text = super.GetDebugText();
13979
13981 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13982
13983 return text;
13984 }
13985 #endif
13986
13988 {
13989 return true;
13990 }
13991
13993
13995
13997 {
14000 }
14001
14002
14010
14026}
14027
14029{
14031 if (entity)
14032 {
14033 bool is_item = entity.IsInherited(
ItemBase);
14034 if (is_item && full_quantity)
14035 {
14038 }
14039 }
14040 else
14041 {
14043 return NULL;
14044 }
14045 return entity;
14046}
14047
14049{
14050 if (item)
14051 {
14052 if (health > 0)
14053 item.SetHealth("", "", health);
14054
14055 if (item.CanHaveTemperature())
14056 {
14058 if (item.CanFreeze())
14059 item.SetFrozen(false);
14060 }
14061
14062 if (item.HasEnergyManager())
14063 {
14064 if (quantity >= 0)
14065 {
14066 item.GetCompEM().SetEnergy0To1(quantity);
14067 }
14068 else
14069 {
14071 }
14072 }
14073 else if (item.IsMagazine())
14074 {
14075 Magazine mag = Magazine.Cast(item);
14076 if (quantity >= 0)
14077 {
14078 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14079 }
14080 else
14081 {
14083 }
14084
14085 }
14086 else
14087 {
14088 if (quantity >= 0)
14089 {
14090 item.SetQuantityNormalized(quantity, false);
14091 }
14092 else
14093 {
14095 }
14096
14097 }
14098 }
14099}
14100
14101#ifdef DEVELOPER
14103#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.