9262{
9264 {
9265 return true;
9266 }
9267};
9268
9269
9270
9272{
9276
9278
9281
9282
9283
9284
9285
9294
9300
9305
9310
9331 protected bool m_IsResultOfSplit
9332
9334
9339
9340
9341
9343
9347
9348
9349
9351
9354
9355
9356
9362
9363
9371
9374
9375
9377
9378
9380
9381
9386
9387
9392
9393
9395
9396
9398 {
9403
9404 if (!
GetGame().IsDedicatedServer())
9405 {
9407 {
9409
9411 {
9413 }
9414 }
9415
9418 }
9419
9420 m_OldLocation = null;
9421
9423 {
9425 }
9426
9427 if (ConfigIsExisting("headSelectionsToHide"))
9428 {
9431 }
9432
9434 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9435 {
9437 }
9438
9440
9441 m_IsResultOfSplit = false;
9442
9444 }
9445
9447 {
9448 super.InitItemVariables();
9449
9455 m_Count = ConfigGetInt(
"count");
9456
9459
9464
9467
9472
9484
9488
9489
9492 if (ConfigIsExisting("canBeSplit"))
9493 {
9496 }
9497
9499 if (ConfigIsExisting("itemBehaviour"))
9501
9502
9505 RegisterNetSyncVariableInt("m_VarLiquidType");
9506 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9507
9508 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9509 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9510 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9511
9512 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9513 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9514 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9515 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9516
9517 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9518 RegisterNetSyncVariableBool("m_IsTakeable");
9519 RegisterNetSyncVariableBool("m_IsHologram");
9520
9523 {
9526 }
9527
9529
9531 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9533
9534 }
9535
9537 {
9539 }
9540
9542 {
9545 {
9550 }
9551 }
9552
9553 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9554 {
9556 {
9559 }
9560
9562 }
9563
9565 {
9571 }
9572
9574
9576 {
9578
9579 if (!action)
9580 {
9581 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9582 return;
9583 }
9584
9586 if (!ai)
9587 {
9589 return;
9590 }
9591
9593 if (!action_array)
9594 {
9595 action_array = new array<ActionBase_Basic>;
9597 }
9598 if (LogManager.IsActionLogEnable())
9599 {
9600 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9601 }
9602
9603 if (action_array.Find(action) != -1)
9604 {
9605 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9606 }
9607 else
9608 {
9609 action_array.Insert(action);
9610 }
9611 }
9612
9614 {
9616 ActionBase action = player.GetActionManager().GetAction(actionName);
9619
9620 if (action_array)
9621 {
9622 action_array.RemoveItem(action);
9623 }
9624 }
9625
9626
9627
9629 {
9630 ActionOverrideData overrideData = new ActionOverrideData();
9634
9636 if (!actionMap)
9637 {
9640 }
9641
9642 actionMap.Insert(this.
Type(), overrideData);
9643
9644 }
9645
9647
9649
9650
9652 {
9655
9658
9659 string config_to_search = "CfgVehicles";
9660 string muzzle_owner_config;
9661
9663 {
9664 if (IsInherited(Weapon))
9665 config_to_search = "CfgWeapons";
9666
9667 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9668
9669 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9670
9672
9673 if (config_OnFire_subclass_count > 0)
9674 {
9675 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9676
9677 for (int i = 0; i < config_OnFire_subclass_count; i++)
9678 {
9679 string particle_class = "";
9681 string config_OnFire_entry = config_OnFire_class + particle_class;
9682 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9683 WPOF_array.Insert(WPOF);
9684 }
9685
9686
9688 }
9689 }
9690
9692 {
9693 config_to_search = "CfgWeapons";
9694 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9695
9696 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9697
9699
9700 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9701 {
9702 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9703
9704 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9705 {
9706 string particle_class2 = "";
9708 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9709 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9710 WPOBE_array.Insert(WPOBE);
9711 }
9712
9713
9715 }
9716 }
9717 }
9718
9719
9721 {
9724
9726 {
9727 string config_to_search = "CfgVehicles";
9728
9729 if (IsInherited(Weapon))
9730 config_to_search = "CfgWeapons";
9731
9732 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9733 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9734
9735 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9736 {
9737
9739
9741 {
9743 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9745 return;
9746 }
9747
9750
9751
9752
9754 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9755
9756 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9757 {
9758 string particle_class = "";
9760 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9762
9763 if (entry_type == CT_CLASS)
9764 {
9765 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9766 WPOOH_array.Insert(WPOF);
9767 }
9768 }
9769
9770
9772 }
9773 }
9774 }
9775
9777 {
9779 }
9780
9782 {
9784 {
9786
9789
9792
9793 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9794 }
9795 }
9796
9798 {
9800 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9801
9803 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9804
9806 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9807
9809 {
9811 }
9812 }
9813
9815 {
9817 }
9818
9820 {
9823 else
9825
9827 {
9830 }
9831 else
9832 {
9835
9838 }
9839
9841 }
9842
9844 {
9846 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9847 }
9848
9850 {
9852 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9854 }
9855
9857 {
9859 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9860 }
9861
9863 {
9866
9867 OverheatingParticle OP = new OverheatingParticle();
9872
9874 }
9875
9877 {
9880
9881 return -1;
9882 }
9883
9885 {
9887 {
9890
9891 for (int i = count; i > 0; --i)
9892 {
9893 int id = i - 1;
9896
9899
9900 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9901 {
9902 if (p)
9903 {
9906 }
9907 }
9908 }
9909 }
9910 }
9911
9913 {
9915 {
9917 {
9918 int id = i - 1;
9920
9921 if (OP)
9922 {
9924
9925 if (p)
9926 {
9928 }
9929
9930 delete OP;
9931 }
9932 }
9933
9936 }
9937 }
9938
9941 {
9942 return 0.0;
9943 }
9944
9945
9947 {
9948 return 250;
9949 }
9950
9952 {
9953 return 0;
9954 }
9955
9958 {
9960 return true;
9961
9962 return false;
9963 }
9964
9967 {
9970
9972 {
9974 }
9975 else
9976 {
9977
9979 }
9980
9982 }
9983
9990 {
9991 return -1;
9992 }
9993
9994
9995
9996
9998 {
10000 {
10002 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10003
10004 if (r_index >= 0)
10005 {
10006 InventoryLocation r_il = new InventoryLocation;
10007 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10008
10009 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10012 {
10013 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10014 }
10016 {
10017 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10018 }
10019
10020 }
10021
10022 player.GetHumanInventory().ClearUserReservedLocation(this);
10023 }
10024
10027 }
10028
10029
10030
10031
10033 {
10034 return ItemBase.m_DebugActionsMask;
10035 }
10036
10038 {
10039 return ItemBase.m_DebugActionsMask & mask;
10040 }
10041
10043 {
10044 ItemBase.m_DebugActionsMask = mask;
10045 }
10046
10048 {
10049 ItemBase.m_DebugActionsMask |= mask;
10050 }
10051
10053 {
10054 ItemBase.m_DebugActionsMask &= ~mask;
10055 }
10056
10058 {
10060 {
10062 }
10063 else
10064 {
10066 }
10067 }
10068
10069
10071 {
10072 if (GetEconomyProfile())
10073 {
10074 float q_max = GetEconomyProfile().GetQuantityMax();
10075 if (q_max > 0)
10076 {
10077 float q_min = GetEconomyProfile().GetQuantityMin();
10078 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10079
10081 {
10082 ComponentEnergyManager comp = GetCompEM();
10084 {
10086 }
10087 }
10089 {
10091
10092 }
10093
10094 }
10095 }
10096 }
10097
10100 {
10101 EntityAI parent = GetHierarchyParent();
10102
10103 if (parent)
10104 {
10105 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10106 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10107 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10108 }
10109 }
10110
10113 {
10114 EntityAI parent = GetHierarchyParent();
10115
10116 if (parent)
10117 {
10118 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10119 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10120 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10121 }
10122 }
10123
10125 {
10126
10127
10128
10129
10131
10133 {
10134 if (ScriptInputUserData.CanStoreInputUserData())
10135 {
10136 ScriptInputUserData ctx = new ScriptInputUserData;
10142 ctx.
Write(use_stack_max);
10145
10147 {
10148 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10149 }
10150 }
10151 }
10152 else if (!
GetGame().IsMultiplayer())
10153 {
10155 }
10156 }
10157
10159 {
10161 }
10162
10164 {
10166 }
10167
10169 {
10171 }
10172
10174 {
10175
10176 return false;
10177 }
10178
10180 {
10181 return false;
10182 }
10183
10187 {
10188 return false;
10189 }
10190
10192 {
10193 return "";
10194 }
10195
10197
10199 {
10200 return false;
10201 }
10202
10204 {
10205 return true;
10206 }
10207
10208
10209
10211 {
10212 return true;
10213 }
10214
10216 {
10217 return true;
10218 }
10219
10221 {
10222 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10224 }
10225
10227 {
10229 }
10230
10232 {
10234 if (!is_being_placed)
10236 SetSynchDirty();
10237 }
10238
10239
10241
10243 {
10245 }
10246
10248 {
10250 }
10251
10253 {
10254 return 1;
10255 }
10256
10258 {
10259 return false;
10260 }
10261
10263 {
10265 SetSynchDirty();
10266 }
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10303 {
10304 super.OnMovedInsideCargo(container);
10305
10306 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10307 }
10308
10309 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10310 {
10311 super.EEItemLocationChanged(oldLoc,newLoc);
10312
10313 PlayerBase new_player = null;
10314 PlayerBase old_player = null;
10315
10316 if (newLoc.GetParent())
10317 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10318
10319 if (oldLoc.GetParent())
10320 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10321
10323 {
10324 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10325
10326 if (r_index >= 0)
10327 {
10328 InventoryLocation r_il = new InventoryLocation;
10329 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10330
10331 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10334 {
10335 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10336 }
10338 {
10339 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10340 }
10341
10342 }
10343 }
10344
10346 {
10347 if (new_player)
10348 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10349
10350 if (new_player == old_player)
10351 {
10352
10353 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10354 {
10356 {
10357 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10358 {
10359 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10360 }
10361 }
10362 else
10363 {
10364 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10365 }
10366 }
10367
10368 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10369 {
10370 int type = oldLoc.GetType();
10372 {
10373 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10374 }
10376 {
10377 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10378 }
10379 }
10380 if (!m_OldLocation)
10381 {
10382 m_OldLocation = new InventoryLocation;
10383 }
10384 m_OldLocation.Copy(oldLoc);
10385 }
10386 else
10387 {
10388 if (m_OldLocation)
10389 {
10390 m_OldLocation.Reset();
10391 }
10392 }
10393
10395 }
10396 else
10397 {
10398 if (new_player)
10399 {
10400 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10401 if (res_index >= 0)
10402 {
10403 InventoryLocation il = new InventoryLocation;
10404 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10406 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10409 {
10410 il.
GetParent().GetOnReleaseLock().Invoke(it);
10411 }
10413 {
10415 }
10416
10417 }
10418 }
10420 {
10421
10423 }
10424
10425 if (m_OldLocation)
10426 {
10427 m_OldLocation.Reset();
10428 }
10429 }
10430 }
10431
10432 override void EOnContact(IEntity other, Contact extra)
10433 {
10435 {
10436 int liquidType = -1;
10438 if (impactSpeed > 0.0)
10439 {
10441 #ifndef SERVER
10443 #else
10445 SetSynchDirty();
10446 #endif
10448 }
10449 }
10450
10451 #ifdef SERVER
10452 if (GetCompEM() && GetCompEM().IsPlugged())
10453 {
10454 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10455 GetCompEM().UnplugThis();
10456 }
10457 #endif
10458 }
10459
10461
10463 {
10465 }
10466
10468 {
10469
10470 }
10471
10473 {
10474 super.OnItemLocationChanged(old_owner, new_owner);
10475
10476 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10477 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10478
10479 if (!relatedPlayer && playerNew)
10480 relatedPlayer = playerNew;
10481
10482 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10483 {
10485 if (actionMgr)
10486 {
10487 ActionBase currentAction = actionMgr.GetRunningAction();
10488 if (currentAction)
10490 }
10491 }
10492
10493 Man ownerPlayerOld = null;
10494 Man ownerPlayerNew = null;
10495
10496 if (old_owner)
10497 {
10498 if (old_owner.
IsMan())
10499 {
10500 ownerPlayerOld = Man.Cast(old_owner);
10501 }
10502 else
10503 {
10504 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10505 }
10506 }
10507 else
10508 {
10510 {
10512
10513 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10514 {
10515 GetCompEM().UnplugThis();
10516 }
10517 }
10518 }
10519
10520 if (new_owner)
10521 {
10522 if (new_owner.
IsMan())
10523 {
10524 ownerPlayerNew = Man.Cast(new_owner);
10525 }
10526 else
10527 {
10528 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10529 }
10530 }
10531
10532 if (ownerPlayerOld != ownerPlayerNew)
10533 {
10534 if (ownerPlayerOld)
10535 {
10536 array<EntityAI> subItemsExit = new array<EntityAI>;
10538 for (int i = 0; i < subItemsExit.Count(); i++)
10539 {
10542 }
10543 }
10544
10545 if (ownerPlayerNew)
10546 {
10547 array<EntityAI> subItemsEnter = new array<EntityAI>;
10549 for (int j = 0; j < subItemsEnter.Count(); j++)
10550 {
10553 }
10554 }
10555 }
10556 else if (ownerPlayerNew != null)
10557 {
10558 PlayerBase nplayer;
10559 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10560 {
10561 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10563 for (int k = 0; k < subItemsUpdate.Count(); k++)
10564 {
10566 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10567 }
10568 }
10569 }
10570
10571 if (old_owner)
10572 old_owner.OnChildItemRemoved(this);
10573 if (new_owner)
10574 new_owner.OnChildItemReceived(this);
10575 }
10576
10577
10579 {
10580 super.EEDelete(parent);
10581 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10582 if (player)
10583 {
10585
10586 if (player.IsAlive())
10587 {
10588 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10589 if (r_index >= 0)
10590 {
10591 InventoryLocation r_il = new InventoryLocation;
10592 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10593
10594 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10597 {
10598 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10599 }
10601 {
10602 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10603 }
10604
10605 }
10606
10607 player.RemoveQuickBarEntityShortcut(this);
10608 }
10609 }
10610 }
10611
10613 {
10614 super.EEKilled(killer);
10615
10618 {
10619 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10620 {
10621 if (IsMagazine())
10622 {
10623 if (Magazine.Cast(this).GetAmmoCount() > 0)
10624 {
10626 }
10627 }
10628 else
10629 {
10631 }
10632 }
10633 }
10634 }
10635
10637 {
10638 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10639
10640 super.OnWasAttached(parent, slot_id);
10641
10644
10646 }
10647
10649 {
10650 super.OnWasDetached(parent, slot_id);
10651
10654 }
10655
10657 {
10658 int idx;
10661
10662 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10663 if (inventory_slots.Count() < 1)
10664 {
10665 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10666 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10667 }
10668 else
10669 {
10670 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10671 }
10672
10673 idx = inventory_slots.Find(slot);
10674 if (idx < 0)
10675 return "";
10676
10677 return attach_types.Get(idx);
10678 }
10679
10681 {
10682 int idx = -1;
10683 string slot;
10684
10687
10688 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10689 if (inventory_slots.Count() < 1)
10690 {
10691 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10692 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10693 }
10694 else
10695 {
10696 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10697 if (detach_types.Count() < 1)
10698 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10699 }
10700
10701 for (int i = 0; i < inventory_slots.Count(); i++)
10702 {
10703 slot = inventory_slots.Get(i);
10704 }
10705
10706 if (slot != "")
10707 {
10708 if (detach_types.Count() == 1)
10709 idx = 0;
10710 else
10711 idx = inventory_slots.Find(slot);
10712 }
10713 if (idx < 0)
10714 return "";
10715
10716 return detach_types.Get(idx);
10717 }
10718
10720 {
10721
10723
10724
10725 float min_time = 1;
10726 float max_time = 3;
10727 float delay = Math.RandomFloat(min_time, max_time);
10728
10729 explode_timer.Run(delay, this, "DoAmmoExplosion");
10730 }
10731
10733 {
10734 Magazine magazine = Magazine.Cast(this);
10735 int pop_sounds_count = 6;
10736 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10737
10738
10739 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10740 string sound_name = pop_sounds[ sound_idx ];
10742
10743
10744 magazine.ServerAddAmmoCount(-1);
10745
10746
10747 float min_temp_to_explode = 100;
10748
10749 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10750 {
10752 }
10753 }
10754
10755
10756 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10757 {
10758 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10759
10760 const int CHANCE_DAMAGE_CARGO = 4;
10761 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10762 const int CHANCE_DAMAGE_NOTHING = 2;
10763
10765 {
10766 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10767 int chances;
10768 int rnd;
10769
10770 if (GetInventory().GetCargo())
10771 {
10772 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10773 rnd = Math.RandomInt(0,chances);
10774
10775 if (rnd < CHANCE_DAMAGE_CARGO)
10776 {
10778 }
10779 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10780 {
10782 }
10783 }
10784 else
10785 {
10786 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10787 rnd = Math.RandomInt(0,chances);
10788
10789 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10790 {
10792 }
10793 }
10794 }
10795 }
10796
10798 {
10799 if (GetInventory().GetCargo())
10800 {
10801 int item_count = GetInventory().GetCargo().GetItemCount();
10802 if (item_count > 0)
10803 {
10804 int random_pick = Math.RandomInt(0, item_count);
10806 if (!item.IsExplosive())
10807 {
10808 item.AddHealth("","",damage);
10809 return true;
10810 }
10811 }
10812 }
10813 return false;
10814 }
10815
10817 {
10818 int attachment_count = GetInventory().AttachmentCount();
10819 if (attachment_count > 0)
10820 {
10821 int random_pick = Math.RandomInt(0, attachment_count);
10822 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10823 if (!attachment.IsExplosive())
10824 {
10825 attachment.AddHealth("","",damage);
10826 return true;
10827 }
10828 }
10829 return false;
10830 }
10831
10833 {
10835 }
10836
10838 {
10840 return GetInventory().CanRemoveEntity();
10841
10842 return false;
10843 }
10844
10846 {
10847
10849 return false;
10850
10851
10853 return false;
10854
10855
10856
10858 if (delta == 0)
10859 return false;
10860
10861
10862 return true;
10863 }
10864
10866 {
10868 {
10869 if (ScriptInputUserData.CanStoreInputUserData())
10870 {
10871 ScriptInputUserData ctx = new ScriptInputUserData;
10876 ctx.
Write(destination_entity);
10878 ctx.
Write(slot_id);
10880 }
10881 }
10882 else if (!
GetGame().IsMultiplayer())
10883 {
10885 }
10886 }
10887
10889 {
10890 float split_quantity_new;
10894 InventoryLocation loc = new InventoryLocation;
10895
10896 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10897 {
10899 split_quantity_new = stack_max;
10900 else
10902
10904 {
10905 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10906 if (new_item)
10907 {
10908 new_item.SetResultOfSplit(true);
10909 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10911 new_item.
SetQuantity(split_quantity_new,
false,
true);
10912 }
10913 }
10914 }
10915 else if (destination_entity && slot_id == -1)
10916 {
10917 if (quantity > stack_max)
10918 split_quantity_new = stack_max;
10919 else
10920 split_quantity_new = quantity;
10921
10923 {
10925 {
10928 }
10929
10930 if (new_item)
10931 {
10932 new_item.SetResultOfSplit(true);
10933 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10935 new_item.
SetQuantity(split_quantity_new,
false,
true);
10936 }
10937 }
10938 }
10939 else
10940 {
10941 if (stack_max != 0)
10942 {
10944 {
10946 }
10947
10948 if (split_quantity_new == 0)
10949 {
10950 if (!
GetGame().IsMultiplayer())
10951 player.PhysicalPredictiveDropItem(this);
10952 else
10953 player.ServerDropEntity(this);
10954 return;
10955 }
10956
10958 {
10960
10961 if (new_item)
10962 {
10963 new_item.SetResultOfSplit(true);
10964 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10967 new_item.PlaceOnSurface();
10968 }
10969 }
10970 }
10971 }
10972 }
10973
10975 {
10976 float split_quantity_new;
10980 InventoryLocation loc = new InventoryLocation;
10981
10982 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10983 {
10985 split_quantity_new = stack_max;
10986 else
10988
10990 {
10991 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10992 if (new_item)
10993 {
10994 new_item.SetResultOfSplit(true);
10995 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10997 new_item.
SetQuantity(split_quantity_new,
false,
true);
10998 }
10999 }
11000 }
11001 else if (destination_entity && slot_id == -1)
11002 {
11003 if (quantity > stack_max)
11004 split_quantity_new = stack_max;
11005 else
11006 split_quantity_new = quantity;
11007
11009 {
11011 {
11014 }
11015
11016 if (new_item)
11017 {
11018 new_item.SetResultOfSplit(true);
11019 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11021 new_item.
SetQuantity(split_quantity_new,
false,
true);
11022 }
11023 }
11024 }
11025 else
11026 {
11027 if (stack_max != 0)
11028 {
11030 {
11032 }
11033
11035 {
11037
11038 if (new_item)
11039 {
11040 new_item.SetResultOfSplit(true);
11041 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11044 new_item.PlaceOnSurface();
11045 }
11046 }
11047 }
11048 }
11049 }
11050
11052 {
11054 {
11055 if (ScriptInputUserData.CanStoreInputUserData())
11056 {
11057 ScriptInputUserData ctx = new ScriptInputUserData;
11062 dst.WriteToContext(ctx);
11064 }
11065 }
11066 else if (!
GetGame().IsMultiplayer())
11067 {
11069 }
11070 }
11071
11073 {
11075 {
11076 if (ScriptInputUserData.CanStoreInputUserData())
11077 {
11078 ScriptInputUserData ctx = new ScriptInputUserData;
11083 ctx.
Write(destination_entity);
11089 }
11090 }
11091 else if (!
GetGame().IsMultiplayer())
11092 {
11094 }
11095 }
11096
11098 {
11100 }
11101
11103 {
11105 float split_quantity_new;
11107 if (dst.IsValid())
11108 {
11109 int slot_id = dst.GetSlot();
11111
11112 if (quantity > stack_max)
11113 split_quantity_new = stack_max;
11114 else
11115 split_quantity_new = quantity;
11116
11118 {
11120
11121 if (new_item)
11122 {
11123 new_item.SetResultOfSplit(true);
11124 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11126 new_item.
SetQuantity(split_quantity_new,
false,
true);
11127 }
11128
11129 return new_item;
11130 }
11131 }
11132
11133 return null;
11134 }
11135
11137 {
11139 float split_quantity_new;
11141 if (destination_entity)
11142 {
11144 if (quantity > stackable)
11145 split_quantity_new = stackable;
11146 else
11147 split_quantity_new = quantity;
11148
11150 {
11151 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11152 if (new_item)
11153 {
11154 new_item.SetResultOfSplit(true);
11155 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11157 new_item.
SetQuantity(split_quantity_new,
false,
true);
11158 }
11159 }
11160 }
11161 }
11162
11164 {
11166 {
11167 if (ScriptInputUserData.CanStoreInputUserData())
11168 {
11169 ScriptInputUserData ctx = new ScriptInputUserData;
11174 ItemBase destination_entity =
this;
11175 ctx.
Write(destination_entity);
11179 }
11180 }
11181 else if (!
GetGame().IsMultiplayer())
11182 {
11184 }
11185 }
11186
11188 {
11190 float split_quantity_new;
11192 if (player)
11193 {
11195 if (quantity > stackable)
11196 split_quantity_new = stackable;
11197 else
11198 split_quantity_new = quantity;
11199
11201 {
11202 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11203 new_item =
ItemBase.Cast(in_hands);
11204 if (new_item)
11205 {
11206 new_item.SetResultOfSplit(true);
11207 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11209 new_item.SetQuantity(split_quantity_new, false, true);
11210 }
11211 }
11212 }
11213 }
11214
11216 {
11218 float split_quantity_new = Math.Floor(quantity * 0.5);
11219
11221 return;
11222
11224
11225 if (new_item)
11226 {
11227 if (new_item.GetQuantityMax() < split_quantity_new)
11228 {
11229 split_quantity_new = new_item.GetQuantityMax();
11230 }
11231
11232 new_item.SetResultOfSplit(true);
11233 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11234
11236 {
11239 }
11240 else
11241 {
11243 new_item.
SetQuantity(split_quantity_new,
false,
true);
11244 }
11245 }
11246 }
11247
11249 {
11251 float split_quantity_new = Math.Floor(quantity / 2);
11252
11254 return;
11255
11256 InventoryLocation invloc = new InventoryLocation;
11258
11260 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11261
11262 if (new_item)
11263 {
11264 if (new_item.GetQuantityMax() < split_quantity_new)
11265 {
11266 split_quantity_new = new_item.GetQuantityMax();
11267 }
11269 {
11272 }
11273 else if (split_quantity_new > 1)
11274 {
11276 new_item.
SetQuantity(split_quantity_new,
false,
true);
11277 }
11278 }
11279 }
11280
11283 {
11284 SetWeightDirty();
11286
11287 if (parent)
11288 parent.OnAttachmentQuantityChangedEx(this, delta);
11289
11291 {
11293 {
11295 }
11297 {
11298 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11300 }
11301 }
11302
11303 }
11304
11307 {
11308
11309 }
11310
11313 {
11315 }
11316
11318 {
11319 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11320
11322 {
11323 if (newLevel == GameConstants.STATE_RUINED)
11324 {
11326 EntityAI parent = GetHierarchyParent();
11327 if (parent && parent.IsFireplace())
11328 {
11329 CargoBase cargo = GetInventory().GetCargo();
11330 if (cargo)
11331 {
11333 {
11335 }
11336 }
11337 }
11338 }
11339
11341 {
11342
11344 return;
11345 }
11346
11347 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11348 {
11350 }
11351 }
11352 }
11353
11354
11356 {
11357 super.OnRightClick();
11358
11360 {
11362 {
11363 if (ScriptInputUserData.CanStoreInputUserData())
11364 {
11365 EntityAI root = GetHierarchyRoot();
11366 Man playerOwner = GetHierarchyRootPlayer();
11367 InventoryLocation dst = new InventoryLocation;
11368
11369
11370 if (!playerOwner && root && root == this)
11371 {
11373 }
11374 else
11375 {
11376
11377 GetInventory().GetCurrentInventoryLocation(dst);
11379 {
11382 {
11384 }
11385 else
11386 {
11388
11389
11390 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11391 {
11393 }
11394 else
11395 {
11396 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11397 }
11398 }
11399 }
11400 }
11401
11402 ScriptInputUserData ctx = new ScriptInputUserData;
11410 }
11411 }
11412 else if (!
GetGame().IsMultiplayer())
11413 {
11415 }
11416 }
11417 }
11418
11420 {
11421 if (root)
11422 {
11423 vector m4[4];
11424 root.GetTransform(m4);
11425 dst.SetGround(this, m4);
11426 }
11427 else
11428 {
11429 GetInventory().GetCurrentInventoryLocation(dst);
11430 }
11431 }
11432
11433 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11434 {
11435
11436 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11437 return false;
11438
11439 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11440 return false;
11441
11442
11444 return false;
11445
11446
11447 Magazine mag = Magazine.Cast(this);
11448 if (mag)
11449 {
11450 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11451 return false;
11452
11453 if (stack_max_limit)
11454 {
11455 Magazine other_mag = Magazine.Cast(other_item);
11456 if (other_item)
11457 {
11458 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11459 return false;
11460 }
11461
11462 }
11463 }
11464 else
11465 {
11466
11468 return false;
11469
11471 return false;
11472 }
11473
11474 PlayerBase player = null;
11475 if (CastTo(player, GetHierarchyRootPlayer()))
11476 {
11477 if (player.GetInventory().HasAttachment(this))
11478 return false;
11479
11480 if (player.IsItemsToDelete())
11481 return false;
11482 }
11483
11484 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11485 return false;
11486
11487 int slotID;
11489 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11490 return false;
11491
11492 return true;
11493 }
11494
11496 {
11498 }
11499
11501 {
11502 return m_IsResultOfSplit;
11503 }
11504
11506 {
11507 m_IsResultOfSplit = value;
11508 }
11509
11511 {
11513 }
11514
11516 {
11517 float other_item_quantity = other_item.GetQuantity();
11518 float this_free_space;
11519
11521
11523
11524 if (other_item_quantity > this_free_space)
11525 {
11526 return this_free_space;
11527 }
11528 else
11529 {
11530 return other_item_quantity;
11531 }
11532 }
11533
11535 {
11537 }
11538
11540 {
11542 return;
11543
11544 if (!IsMagazine() && other_item)
11545 {
11547 if (quantity_used != 0)
11548 {
11549 float hp1 = GetHealth01("","");
11550 float hp2 = other_item.GetHealth01("","");
11551 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11552 hpResult = hpResult / (
GetQuantity() + quantity_used);
11553
11554 hpResult *= GetMaxHealth();
11555 Math.Round(hpResult);
11556 SetHealth("", "Health", hpResult);
11557
11559 other_item.AddQuantity(-quantity_used);
11560 }
11561 }
11563 }
11564
11566 {
11567 #ifdef SERVER
11568 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11569 GetHierarchyParent().IncreaseLifetimeUp();
11570 #endif
11571 };
11572
11574 {
11575 PlayerBase p = PlayerBase.Cast(player);
11576
11577 array<int> recipesIds = p.m_Recipes;
11578 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11579 if (moduleRecipesManager)
11580 {
11581 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11582 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11583 }
11584
11585 for (int i = 0;i < recipesIds.Count(); i++)
11586 {
11587 int key = recipesIds.Get(i);
11588 string recipeName = moduleRecipesManager.GetRecipeName(key);
11590 }
11591 }
11592
11593
11594 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11595 {
11596 super.GetDebugActions(outputList);
11597
11598
11604
11605
11610
11615
11616
11620
11621
11623 {
11627 }
11628
11631
11632
11636
11638
11639 InventoryLocation loc = new InventoryLocation();
11640 GetInventory().GetCurrentInventoryLocation(loc);
11642 {
11643 if (Gizmo_IsSupported())
11646 }
11647
11649 }
11650
11651
11652
11653
11655 {
11656 super.OnAction(action_id, player, ctx);
11657
11659 {
11660 switch (action_id)
11661 {
11664 return true;
11667 return true;
11668 }
11669 }
11670
11672 {
11673 switch (action_id)
11674 {
11676 Delete();
11677 return true;
11678 }
11679 }
11680
11681 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11682 {
11683 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11684 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11685 PlayerBase p = PlayerBase.Cast(player);
11686 if (
EActions.RECIPES_RANGE_START < 1000)
11687 {
11688 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11689 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11690 }
11691 }
11692 #ifndef SERVER
11693 else if (action_id ==
EActions.WATCH_PLAYER)
11694 {
11695 PluginDeveloper.SetDeveloperItemClientEx(player);
11696 }
11697 #endif
11699 {
11700 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11701 {
11702 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11703 OnDebugButtonPressServer(id + 1);
11704 }
11705
11706 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11707 {
11708 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11710 }
11711
11712 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11713 {
11714 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11716 }
11717
11718 else if (action_id ==
EActions.ADD_QUANTITY)
11719 {
11720 if (IsMagazine())
11721 {
11722 Magazine mag = Magazine.Cast(this);
11723 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11724 }
11725 else
11726 {
11728 }
11729
11730 if (m_EM)
11731 {
11732 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11733 }
11734
11735 }
11736
11737 else if (action_id ==
EActions.REMOVE_QUANTITY)
11738 {
11739 if (IsMagazine())
11740 {
11741 Magazine mag2 = Magazine.Cast(this);
11742 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11743 }
11744 else
11745 {
11747 }
11748 if (m_EM)
11749 {
11750 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11751 }
11752
11753 }
11754
11755 else if (action_id ==
EActions.SET_QUANTITY_0)
11756 {
11758
11759 if (m_EM)
11760 {
11761 m_EM.SetEnergy(0);
11762 }
11763 }
11764
11765 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11766 {
11768
11769 if (m_EM)
11770 {
11771 m_EM.SetEnergy(m_EM.GetEnergyMax());
11772 }
11773 }
11774
11775 else if (action_id ==
EActions.ADD_HEALTH)
11776 {
11777 AddHealth("","",GetMaxHealth("","Health")/5);
11778 }
11779 else if (action_id ==
EActions.REMOVE_HEALTH)
11780 {
11781 AddHealth("","",-GetMaxHealth("","Health")/5);
11782 }
11783 else if (action_id ==
EActions.DESTROY_HEALTH)
11784 {
11785 SetHealth01("","",0);
11786 }
11787 else if (action_id ==
EActions.WATCH_ITEM)
11788 {
11790 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11791 #ifdef DEVELOPER
11792 SetDebugDeveloper_item(this);
11793 #endif
11794 }
11795
11796 else if (action_id ==
EActions.ADD_TEMPERATURE)
11797 {
11798 AddTemperature(20);
11799
11800 }
11801
11802 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11803 {
11804 AddTemperature(-20);
11805
11806 }
11807
11808 else if (action_id ==
EActions.FLIP_FROZEN)
11809 {
11810 SetFrozen(!GetIsFrozen());
11811
11812 }
11813
11814 else if (action_id ==
EActions.ADD_WETNESS)
11815 {
11817
11818 }
11819
11820 else if (action_id ==
EActions.REMOVE_WETNESS)
11821 {
11823
11824 }
11825
11826 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11827 {
11830
11831
11832 }
11833
11834 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11835 {
11838 }
11839
11840 else if (action_id ==
EActions.MAKE_SPECIAL)
11841 {
11842 auto debugParams = DebugSpawnParams.WithPlayer(player);
11843 OnDebugSpawnEx(debugParams);
11844 }
11845
11846 }
11847
11848
11849 return false;
11850 }
11851
11852
11853
11854
11858
11861
11862
11863
11865 {
11866 return false;
11867 }
11868
11869
11871 {
11872 return true;
11873 }
11874
11875
11877 {
11878 return true;
11879 }
11880
11881
11882
11884 {
11885 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11887 }
11888
11891 {
11892 return null;
11893 }
11894
11896 {
11897 return false;
11898 }
11899
11901 {
11902 return false;
11903 }
11904
11908
11909
11911 {
11912 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11913 return module_repairing.CanRepair(this, item_repair_kit);
11914 }
11915
11916
11917 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11918 {
11919 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11920 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11921 }
11922
11923
11925 {
11926
11927
11928
11929
11930
11931
11932
11933
11934 return 1;
11935 }
11936
11937
11938
11940 {
11942 }
11943
11944
11945
11947 {
11949 }
11950
11951
11960 {
11961 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11962
11963 if (player)
11964 {
11965 player.MessageStatus(text);
11966 }
11967 }
11968
11969
11978 {
11979 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11980
11981 if (player)
11982 {
11983 player.MessageAction(text);
11984 }
11985 }
11986
11987
11996 {
11997 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11998
11999 if (player)
12000 {
12001 player.MessageFriendly(text);
12002 }
12003 }
12004
12005
12014 {
12015 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
12016
12017 if (player)
12018 {
12019 player.MessageImportant(text);
12020 }
12021 }
12022
12024 {
12025 return true;
12026 }
12027
12028
12029 override bool KindOf(
string tag)
12030 {
12031 bool found = false;
12032 string item_name = this.
GetType();
12035
12036 int array_size = item_tag_array.Count();
12037 for (int i = 0; i < array_size; i++)
12038 {
12039 if (item_tag_array.Get(i) == tag)
12040 {
12041 found = true;
12042 break;
12043 }
12044 }
12045 return found;
12046 }
12047
12048
12050 {
12051
12052 super.OnRPC(sender, rpc_type,ctx);
12053
12054
12055 switch (rpc_type)
12056 {
12057 #ifndef SERVER
12058 case ERPCs.RPC_SOUND_LOCK_ATTACH:
12059 Param2<bool, string> p = new Param2<bool, string>(false, "");
12060
12062 return;
12063
12064 bool play = p.param1;
12065 string soundSet = p.param2;
12066
12067 if (play)
12068 {
12070 {
12072 {
12074 }
12075 }
12076 else
12077 {
12079 }
12080 }
12081 else
12082 {
12084 }
12085
12086 break;
12087 #endif
12088
12089 }
12090
12092 {
12094 }
12095 }
12096
12097
12098
12099
12101 {
12102 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12103 return plugin.GetID(
name);
12104 }
12105
12107 {
12108 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12109 return plugin.GetName(id);
12110 }
12111
12114 {
12115
12116
12117 int varFlags;
12118 if (!ctx.
Read(varFlags))
12119 return;
12120
12121 if (varFlags & ItemVariableFlags.FLOAT)
12122 {
12124 }
12125 }
12126
12128 {
12129
12130 super.SerializeNumericalVars(floats_out);
12131
12132
12133
12135 {
12137 }
12138
12140 {
12142 }
12143
12145 {
12147 }
12148
12150 {
12155 }
12156
12158 {
12160 }
12161 }
12162
12164 {
12165
12166 super.DeSerializeNumericalVars(floats);
12167
12168
12169 int index = 0;
12170 int mask = Math.Round(floats.Get(index));
12171
12172 index++;
12173
12175 {
12177 {
12179 }
12180 else
12181 {
12182 float quantity = floats.Get(index);
12183 SetQuantity(quantity,
true,
false,
false,
false);
12184 }
12185 index++;
12186 }
12187
12189 {
12190 float wet = floats.Get(index);
12192 index++;
12193 }
12194
12196 {
12197 int liquidtype = Math.Round(floats.Get(index));
12199 index++;
12200 }
12201
12203 {
12205 index++;
12207 index++;
12209 index++;
12211 index++;
12212 }
12213
12215 {
12216 int cleanness = Math.Round(floats.Get(index));
12218 index++;
12219 }
12220 }
12221
12223 {
12224 super.WriteVarsToCTX(ctx);
12225
12226
12228 {
12230 }
12231
12233 {
12235 }
12236
12238 {
12240 }
12241
12243 {
12244 int r,g,b,a;
12250 }
12251
12253 {
12255 }
12256 }
12257
12259 {
12260 if (!super.ReadVarsFromCTX(ctx,version))
12261 return false;
12262
12263 int intValue;
12264 float value;
12265
12266 if (version < 140)
12267 {
12268 if (!ctx.
Read(intValue))
12269 return false;
12270
12271 m_VariablesMask = intValue;
12272 }
12273
12275 {
12276 if (!ctx.
Read(value))
12277 return false;
12278
12280 {
12282 }
12283 else
12284 {
12286 }
12287 }
12288
12289 if (version < 140)
12290 {
12292 {
12293 if (!ctx.
Read(value))
12294 return false;
12295 SetTemperatureDirect(value);
12296 }
12297 }
12298
12300 {
12301 if (!ctx.
Read(value))
12302 return false;
12304 }
12305
12307 {
12308 if (!ctx.
Read(intValue))
12309 return false;
12311 }
12312
12314 {
12315 int r,g,b,a;
12317 return false;
12319 return false;
12321 return false;
12323 return false;
12324
12326 }
12327
12329 {
12330 if (!ctx.
Read(intValue))
12331 return false;
12333 }
12334
12335 if (version >= 138 && version < 140)
12336 {
12338 {
12339 if (!ctx.
Read(intValue))
12340 return false;
12341 SetFrozen(intValue);
12342 }
12343 }
12344
12345 return true;
12346 }
12347
12348
12350 {
12353 {
12355 }
12356
12357 if (!super.OnStoreLoad(ctx, version))
12358 {
12360 return false;
12361 }
12362
12363 if (version >= 114)
12364 {
12365 bool hasQuickBarIndexSaved;
12366
12367 if (!ctx.
Read(hasQuickBarIndexSaved))
12368 {
12370 return false;
12371 }
12372
12373 if (hasQuickBarIndexSaved)
12374 {
12375 int itmQBIndex;
12376
12377
12378 if (!ctx.
Read(itmQBIndex))
12379 {
12381 return false;
12382 }
12383
12384 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12385 if (itmQBIndex != -1 && parentPlayer)
12386 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12387 }
12388 }
12389 else
12390 {
12391
12392 PlayerBase player;
12393 int itemQBIndex;
12394 if (version ==
int.
MAX)
12395 {
12396 if (!ctx.
Read(itemQBIndex))
12397 {
12399 return false;
12400 }
12401 }
12402 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12403 {
12404
12405 if (!ctx.
Read(itemQBIndex))
12406 {
12408 return false;
12409 }
12410 if (itemQBIndex != -1 && player)
12411 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12412 }
12413 }
12414
12415 if (version < 140)
12416 {
12417
12418 if (!LoadVariables(ctx, version))
12419 {
12421 return false;
12422 }
12423 }
12424
12425
12427 {
12429 return false;
12430 }
12431 if (version >= 132)
12432 {
12434 if (raib)
12435 {
12437 {
12439 return false;
12440 }
12441 }
12442 }
12443
12445 return true;
12446 }
12447
12448
12449
12451 {
12452 super.OnStoreSave(ctx);
12453
12454 PlayerBase player;
12455 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12456 {
12458
12459 int itemQBIndex = -1;
12460 itemQBIndex = player.FindQuickBarEntityIndex(this);
12461 ctx.
Write(itemQBIndex);
12462 }
12463 else
12464 {
12466 }
12467
12469
12471 if (raib)
12472 {
12474 }
12475 }
12476
12477
12479 {
12480 super.AfterStoreLoad();
12481
12483 {
12485 }
12486
12488 {
12491 }
12492 }
12493
12495 {
12496 super.EEOnAfterLoad();
12497
12499 {
12501 }
12502
12505 }
12506
12508 {
12509 return false;
12510 }
12511
12512
12513
12515 {
12517 {
12518 #ifdef PLATFORM_CONSOLE
12519
12521 {
12523 if (menu)
12524 {
12526 }
12527 }
12528 #endif
12529 }
12530
12532 {
12535 }
12536
12538 {
12539 SetWeightDirty();
12541 }
12543 {
12546 }
12547
12549 {
12552 }
12554 {
12557 }
12558
12559 super.OnVariablesSynchronized();
12560 }
12561
12562
12563
12565 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12566 {
12567 if (!IsServerCheck(allow_client))
12568 return false;
12569
12571 return false;
12572
12575
12576 if (value <= (min + 0.001))
12577 value = min;
12578
12579 if (value == min)
12580 {
12581 if (destroy_config)
12582 {
12583 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12584 if (dstr)
12585 {
12587 this.Delete();
12588 return true;
12589 }
12590 }
12591 else if (destroy_forced)
12592 {
12594 this.Delete();
12595 return true;
12596 }
12597
12599 }
12600
12603
12605 {
12607
12608 if (delta)
12610 }
12611
12613
12614 return false;
12615 }
12616
12617
12619 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12620 {
12622 }
12623
12625 {
12628 }
12629
12631 {
12634 }
12635
12637 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12638 {
12639 float value_clamped = Math.Clamp(value, 0, 1);
12641 SetQuantity(result, destroy_config, destroy_forced);
12642 }
12643
12644
12647 {
12649 }
12650
12652 {
12654 }
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12666 {
12667 int slot = -1;
12668 if (GetInventory())
12669 {
12670 InventoryLocation il = new InventoryLocation;
12671 GetInventory().GetCurrentInventoryLocation(il);
12673 }
12674
12676 }
12677
12679 {
12680 float quantity_max = 0;
12681
12683 {
12684 if (attSlotID != -1)
12685 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12686
12687 if (quantity_max <= 0)
12689 }
12690
12691 if (quantity_max <= 0)
12693
12694 return quantity_max;
12695 }
12696
12698 {
12700 }
12701
12703 {
12705 }
12706
12707
12709 {
12711 }
12712
12714 {
12716 }
12717
12719 {
12721 }
12722
12723
12725 {
12726
12727 float weightEx = GetWeightEx();
12728 float special = GetInventoryAndCargoWeight();
12729 return weightEx - special;
12730 }
12731
12732
12734 {
12736 }
12737
12739 {
12741 {
12742 #ifdef DEVELOPER
12743 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12744 {
12745 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12747 }
12748 #endif
12749
12750 return GetQuantity() * GetConfigWeightModified();
12751 }
12752 else if (HasEnergyManager())
12753 {
12754 #ifdef DEVELOPER
12755 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12756 {
12757 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12758 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12759 }
12760 #endif
12761 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12762 }
12763 else
12764 {
12765 #ifdef DEVELOPER
12766 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12767 {
12768 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12769 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12770 }
12771 #endif
12772 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12773 }
12774 }
12775
12778 {
12779 int item_count = 0;
12781
12782 if (GetInventory().GetCargo() != NULL)
12783 {
12784 item_count = GetInventory().GetCargo().GetItemCount();
12785 }
12786
12787 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12788 {
12789 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12790 if (item)
12791 item_count += item.GetNumberOfItems();
12792 }
12793 return item_count;
12794 }
12795
12798 {
12799 float weight = 0;
12800 float wetness = 1;
12801 if (include_wetness)
12804 {
12805 weight = wetness * m_ConfigWeight;
12806 }
12808 {
12809 weight = 1;
12810 }
12811 return weight;
12812 }
12813
12814
12815
12817 {
12818 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12819 {
12820 GameInventory inv = GetInventory();
12821 array<EntityAI> items = new array<EntityAI>;
12823 for (int i = 0; i < items.Count(); i++)
12824 {
12826 if (item)
12827 {
12829 }
12830 }
12831 }
12832 }
12833
12834
12835
12836
12838 {
12839 float energy = 0;
12840 if (HasEnergyManager())
12841 {
12842 energy = GetCompEM().GetEnergy();
12843 }
12844 return energy;
12845 }
12846
12847
12849 {
12850 super.OnEnergyConsumed();
12851
12853 }
12854
12856 {
12857 super.OnEnergyAdded();
12858
12860 }
12861
12862
12864 {
12865 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12866 {
12868 {
12869 float energy_0to1 = GetCompEM().GetEnergy0To1();
12871 }
12872 }
12873 }
12874
12875
12877 {
12878 return ConfigGetFloat("heatIsolation");
12879 }
12880
12882 {
12884 }
12885
12887 {
12888 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12889 if (
GetGame().ConfigIsExisting(paramPath))
12891
12892 return 0.0;
12893 }
12894
12896 {
12897 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12898 if (
GetGame().ConfigIsExisting(paramPath))
12900
12901 return 0.0;
12902 }
12903
12904 override void SetWet(
float value,
bool allow_client =
false)
12905 {
12906 if (!IsServerCheck(allow_client))
12907 return;
12908
12911
12913
12914 m_VarWet = Math.Clamp(value, min, max);
12915
12917 {
12920 }
12921 }
12922
12923 override void AddWet(
float value)
12924 {
12926 }
12927
12929 {
12931 }
12932
12934 {
12936 }
12937
12939 {
12941 }
12942
12944 {
12946 }
12947
12949 {
12951 }
12952
12953 override void OnWetChanged(
float newVal,
float oldVal)
12954 {
12957 if (newLevel != oldLevel)
12958 {
12960 }
12961 }
12962
12964 {
12965 SetWeightDirty();
12966 }
12967
12969 {
12970 return GetWetLevelInternal(
m_VarWet);
12971 }
12972
12973
12974
12976 {
12978 }
12979
12981 {
12983 }
12984
12986 {
12988 }
12989
12991 {
12993 }
12994
12995
12996
12998 {
12999 if (ConfigIsExisting("itemModelLength"))
13000 {
13001 return ConfigGetFloat("itemModelLength");
13002 }
13003 return 0;
13004 }
13005
13007 {
13008 if (ConfigIsExisting("itemAttachOffset"))
13009 {
13010 return ConfigGetFloat("itemAttachOffset");
13011 }
13012 return 0;
13013 }
13014
13015 override void SetCleanness(
int value,
bool allow_client =
false)
13016 {
13017 if (!IsServerCheck(allow_client))
13018 return;
13019
13021
13023
13026 }
13027
13029 {
13031 }
13032
13034 {
13035 return true;
13036 }
13037
13038
13039
13040
13042 {
13044 }
13045
13047 {
13049 }
13050
13051
13052
13053
13054 override void SetColor(
int r,
int g,
int b,
int a)
13055 {
13061 }
13063 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13064 {
13069 }
13070
13072 {
13074 }
13075
13078 {
13079 int r,g,b,a;
13081 r = r/255;
13082 g = g/255;
13083 b = b/255;
13084 a = a/255;
13085 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13086 }
13087
13088
13089
13090 override void SetLiquidType(
int value,
bool allow_client =
false)
13091 {
13092 if (!IsServerCheck(allow_client))
13093 return;
13094
13099 }
13100
13102 {
13103 return ConfigGetInt("varLiquidTypeInit");
13104 }
13105
13107 {
13109 }
13110
13112 {
13114 SetFrozen(false);
13115 }
13116
13119 {
13120 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13121 }
13122
13123
13126 {
13127 PlayerBase nplayer;
13128 if (PlayerBase.CastTo(nplayer, player))
13129 {
13131
13132 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13133 }
13134 }
13135
13136
13139 {
13140 PlayerBase nplayer;
13141 if (PlayerBase.CastTo(nplayer,player))
13142 {
13143
13144 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13145
13146 }
13147
13148
13149 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13150
13151
13152 if (HasEnergyManager())
13153 {
13154 GetCompEM().UpdatePlugState();
13155 }
13156 }
13157
13158
13160 {
13161 super.OnPlacementStarted(player);
13162
13164 }
13165
13166 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13167 {
13169 {
13170 m_AdminLog.OnPlacementComplete(player,
this);
13171 }
13172
13173 super.OnPlacementComplete(player, position, orientation);
13174 }
13175
13176
13177
13178
13179
13181 {
13183 {
13184 return true;
13185 }
13186 else
13187 {
13188 return false;
13189 }
13190 }
13191
13192
13194 {
13196 {
13198 }
13199 }
13200
13201
13203 {
13205 }
13206
13208 {
13210 }
13211
13212 override void InsertAgent(
int agent,
float count = 1)
13213 {
13214 if (count < 1)
13215 return;
13216
13218 }
13219
13222 {
13224 }
13225
13226
13228 {
13230 }
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13274 {
13276 return false;
13277 return true;
13278 }
13279
13281 {
13282
13284 }
13285
13286
13289 {
13290 super.CheckForRoofLimited(timeTresholdMS);
13291
13293 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13294 {
13295 m_PreviousRoofTestTime = time;
13296 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13297 }
13298 }
13299
13300
13302 {
13304 {
13305 return 0;
13306 }
13307
13308 if (GetInventory().GetAttachmentSlotsCount() != 0)
13309 {
13310 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13311 if (filter)
13312 return filter.GetProtectionLevel(type, false, system);
13313 else
13314 return 0;
13315 }
13316
13317 string subclassPath, entryName;
13318
13319 switch (type)
13320 {
13322 entryName = "biological";
13323 break;
13325 entryName = "chemical";
13326 break;
13327 default:
13328 entryName = "biological";
13329 break;
13330 }
13331
13332 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13333
13335 }
13336
13337
13338
13341 {
13342 if (!IsMagazine())
13344
13346 }
13347
13348
13349
13350
13351
13356 {
13357 return true;
13358 }
13359
13361 {
13363 }
13364
13365
13366
13367
13368
13370 {
13371 if (parent)
13372 {
13373 if (parent.IsInherited(DayZInfected))
13374 return true;
13375
13376 if (!parent.IsRuined())
13377 return true;
13378 }
13379
13380 return true;
13381 }
13382
13384 {
13385 if (!super.CanPutAsAttachment(parent))
13386 {
13387 return false;
13388 }
13389
13390 if (!IsRuined() && !parent.IsRuined())
13391 {
13392 return true;
13393 }
13394
13395 return false;
13396 }
13397
13399 {
13400
13401
13402
13403
13404 return super.CanReceiveItemIntoCargo(item);
13405 }
13406
13408 {
13409
13410
13411
13412
13413 GameInventory attachmentInv = attachment.GetInventory();
13415 {
13416 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13417 return false;
13418 }
13419
13420 InventoryLocation loc = new InventoryLocation();
13421 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13422 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13423 return false;
13424
13425 return super.CanReceiveAttachment(attachment, slotId);
13426 }
13427
13429 {
13430 if (!super.CanReleaseAttachment(attachment))
13431 return false;
13432
13433 return GetInventory().AreChildrenAccessible();
13434 }
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13457 {
13458 int id = muzzle_owner.GetMuzzleID();
13459 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13460
13461 if (WPOF_array)
13462 {
13463 for (int i = 0; i < WPOF_array.Count(); i++)
13464 {
13465 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13466
13467 if (WPOF)
13468 {
13469 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13470 }
13471 }
13472 }
13473 }
13474
13475
13477 {
13478 int id = muzzle_owner.GetMuzzleID();
13480
13481 if (WPOBE_array)
13482 {
13483 for (int i = 0; i < WPOBE_array.Count(); i++)
13484 {
13485 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13486
13487 if (WPOBE)
13488 {
13489 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13490 }
13491 }
13492 }
13493 }
13494
13495
13497 {
13498 int id = muzzle_owner.GetMuzzleID();
13499 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13500
13501 if (WPOOH_array)
13502 {
13503 for (int i = 0; i < WPOOH_array.Count(); i++)
13504 {
13505 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13506
13507 if (WPOOH)
13508 {
13509 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13510 }
13511 }
13512 }
13513 }
13514
13515
13517 {
13518 int id = muzzle_owner.GetMuzzleID();
13519 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13520
13521 if (WPOOH_array)
13522 {
13523 for (int i = 0; i < WPOOH_array.Count(); i++)
13524 {
13525 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13526
13527 if (WPOOH)
13528 {
13529 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13530 }
13531 }
13532 }
13533 }
13534
13535
13537 {
13538 int id = muzzle_owner.GetMuzzleID();
13539 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13540
13541 if (WPOOH_array)
13542 {
13543 for (int i = 0; i < WPOOH_array.Count(); i++)
13544 {
13545 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13546
13547 if (WPOOH)
13548 {
13549 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13550 }
13551 }
13552 }
13553 }
13554
13555
13556
13558 {
13560 {
13561 return true;
13562 }
13563
13564 return false;
13565 }
13566
13568 {
13570 {
13571 return true;
13572 }
13573
13574 return false;
13575 }
13576
13578 {
13580 {
13581 return true;
13582 }
13583
13584 return false;
13585 }
13586
13588 {
13589 return false;
13590 }
13591
13594 {
13595 return UATimeSpent.DEFAULT_DEPLOY;
13596 }
13597
13598
13599
13600
13602 {
13604 SetSynchDirty();
13605 }
13606
13608 {
13610 }
13611
13612
13614 {
13615 return false;
13616 }
13617
13620 {
13621 string att_type = "None";
13622
13623 if (ConfigIsExisting("soundAttType"))
13624 {
13625 att_type = ConfigGetString("soundAttType");
13626 }
13627
13629 }
13630
13632 {
13634 }
13635
13636
13637
13638
13639
13645
13647 {
13650
13652 }
13653
13654
13656 {
13658 return;
13659
13661
13664
13667
13668 SoundParameters params = new SoundParameters();
13672 }
13673
13674
13676 {
13678 return;
13679
13681 SetSynchDirty();
13682
13685 }
13686
13687
13689 {
13691 return;
13692
13694 SetSynchDirty();
13695
13698 }
13699
13701 {
13703 }
13704
13706 {
13708 }
13709
13712 {
13713 if (!
GetGame().IsDedicatedServer())
13714 {
13715 if (ConfigIsExisting("attachSoundSet"))
13716 {
13717 string cfg_path = "";
13718 string soundset = "";
13719 string type_name =
GetType();
13720
13723 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13724 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13725
13726 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13727 {
13728 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13729 {
13730 if (cfg_slot_array[i] == slot_type)
13731 {
13732 soundset = cfg_soundset_array[i];
13733 break;
13734 }
13735 }
13736 }
13737
13738 if (soundset != "")
13739 {
13740 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13742 }
13743 }
13744 }
13745 }
13746
13748 {
13749
13750 }
13751
13752 void OnApply(PlayerBase player);
13753
13755 {
13756 return 1.0;
13757 };
13758
13760 {
13762 }
13763
13765 {
13767 }
13768
13770
13772 {
13773 SetDynamicPhysicsLifeTime(0.01);
13775 }
13776
13778 {
13779 array<string> zone_names = new array<string>;
13780 GetDamageZones(zone_names);
13781 for (int i = 0; i < zone_names.Count(); i++)
13782 {
13783 SetHealthMax(zone_names.Get(i),"Health");
13784 }
13785 SetHealthMax("","Health");
13786 }
13787
13790 {
13791 float global_health = GetHealth01("","Health");
13792 array<string> zones = new array<string>;
13793 GetDamageZones(zones);
13794
13795 for (int i = 0; i < zones.Count(); i++)
13796 {
13797 SetHealth01(zones.Get(i),"Health",global_health);
13798 }
13799 }
13800
13803 {
13804 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13805 }
13806
13808 {
13809 if (!hasRootAsPlayer)
13810 {
13811 if (refParentIB)
13812 {
13813
13814 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13815 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13816
13817 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13818 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13819
13822 }
13823 else
13824 {
13825
13828 }
13829 }
13830 }
13831
13833 {
13835 {
13836 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13837 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13838 {
13839 float heatPermCoef = 1.0;
13841 while (ent)
13842 {
13843 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13844 ent = ent.GetHierarchyParent();
13845 }
13846
13847 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13848 }
13849 }
13850 }
13851
13853 {
13854
13855 EntityAI parent = GetHierarchyParent();
13856 if (!parent)
13857 {
13858 hasParent = false;
13859 hasRootAsPlayer = false;
13860 }
13861 else
13862 {
13863 hasParent = true;
13864 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13865 refParentIB =
ItemBase.Cast(parent);
13866 }
13867 }
13868
13869 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13870 {
13871
13872 }
13873
13875 {
13876
13877 return false;
13878 }
13879
13881 {
13882
13883
13884 return false;
13885 }
13886
13888 {
13889
13890 return false;
13891 }
13892
13895 {
13896 return !GetIsFrozen() &&
IsOpen();
13897 }
13898
13900 {
13901 bool hasParent = false, hasRootAsPlayer = false;
13903
13904 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13905 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13906
13907 if (wwtu || foodDecay)
13908 {
13912
13913 if (processWetness || processTemperature || processDecay)
13914 {
13916
13917 if (processWetness)
13918 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13919
13920 if (processTemperature)
13922
13923 if (processDecay)
13924 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13925 }
13926 }
13927 }
13928
13931 {
13933 }
13934
13936 {
13939
13940 return super.GetTemperatureFreezeThreshold();
13941 }
13942
13944 {
13947
13948 return super.GetTemperatureThawThreshold();
13949 }
13950
13952 {
13955
13956 return super.GetItemOverheatThreshold();
13957 }
13958
13960 {
13962 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13963
13964 return super.GetTemperatureFreezeTime();
13965 }
13966
13968 {
13970 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13971
13972 return super.GetTemperatureThawTime();
13973 }
13974
13979
13981 {
13982 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13983 }
13984
13986 {
13987 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13988 }
13989
13992 {
13994 }
13995
13997 {
13999 }
14000
14002 {
14004 }
14005
14008 {
14009 return null;
14010 }
14011
14014 {
14015 return false;
14016 }
14017
14019 {
14021 {
14024 if (!trg)
14025 {
14027 explosive = this;
14028 }
14029
14030 explosive.PairRemote(trg);
14032
14033 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
14034 trg.SetPersistentPairID(persistentID);
14035 explosive.SetPersistentPairID(persistentID);
14036
14037 return true;
14038 }
14039 return false;
14040 }
14041
14044 {
14045 float ret = 1.0;
14048 ret *= GetHealth01();
14049
14050 return ret;
14051 }
14052
14053 #ifdef DEVELOPER
14054 override void SetDebugItem()
14055 {
14056 super.SetDebugItem();
14057 _itemBase = this;
14058 }
14059
14061 {
14062 string text = super.GetDebugText();
14063
14065 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14066
14067 return text;
14068 }
14069 #endif
14070
14072 {
14073 return true;
14074 }
14075
14077
14079
14081 {
14084 }
14085
14086
14094
14110}
14111
14113{
14115 if (entity)
14116 {
14117 bool is_item = entity.IsInherited(
ItemBase);
14118 if (is_item && full_quantity)
14119 {
14122 }
14123 }
14124 else
14125 {
14127 return NULL;
14128 }
14129 return entity;
14130}
14131
14133{
14134 if (item)
14135 {
14136 if (health > 0)
14137 item.SetHealth("", "", health);
14138
14139 if (item.CanHaveTemperature())
14140 {
14142 if (item.CanFreeze())
14143 item.SetFrozen(false);
14144 }
14145
14146 if (item.HasEnergyManager())
14147 {
14148 if (quantity >= 0)
14149 {
14150 item.GetCompEM().SetEnergy0To1(quantity);
14151 }
14152 else
14153 {
14155 }
14156 }
14157 else if (item.IsMagazine())
14158 {
14159 Magazine mag = Magazine.Cast(item);
14160 if (quantity >= 0)
14161 {
14162 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14163 }
14164 else
14165 {
14167 }
14168
14169 }
14170 else
14171 {
14172 if (quantity >= 0)
14173 {
14174 item.SetQuantityNormalized(quantity, false);
14175 }
14176 else
14177 {
14179 }
14180
14181 }
14182 }
14183}
14184
14185#ifdef DEVELOPER
14187#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.