9164{
9166 {
9167 return true;
9168 }
9169};
9170
9171
9172
9174{
9178
9180
9183
9184
9185
9186
9187
9196
9202
9207
9212
9233 protected bool m_IsResultOfSplit
9234
9236
9241
9242
9243
9245
9249
9250
9251
9253
9256
9257
9258
9264
9265
9273
9276
9277
9279
9280
9282
9283
9288
9289
9294
9295
9297
9298
9300 {
9305
9306 if (!
GetGame().IsDedicatedServer())
9307 {
9309 {
9311
9313 {
9315 }
9316 }
9317
9320 }
9321
9322 m_OldLocation = null;
9323
9325 {
9327 }
9328
9329 if (ConfigIsExisting("headSelectionsToHide"))
9330 {
9333 }
9334
9336 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9337 {
9339 }
9340
9342
9343 m_IsResultOfSplit = false;
9344
9346 }
9347
9349 {
9350 super.InitItemVariables();
9351
9357 m_Count = ConfigGetInt(
"count");
9358
9361
9366
9369
9374
9386
9390
9391
9394 if (ConfigIsExisting("canBeSplit"))
9395 {
9398 }
9399
9401 if (ConfigIsExisting("itemBehaviour"))
9403
9404
9407 RegisterNetSyncVariableInt("m_VarLiquidType");
9408 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9409
9410 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9411 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9412 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9413
9414 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9415 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9416 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9417 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9418
9419 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9420 RegisterNetSyncVariableBool("m_IsTakeable");
9421 RegisterNetSyncVariableBool("m_IsHologram");
9422
9425 {
9428 }
9429
9431
9433 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9435
9436 }
9437
9439 {
9441 }
9442
9444 {
9447 {
9452 }
9453 }
9454
9455 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9456 {
9458 {
9461 }
9462
9464 }
9465
9467 {
9473 }
9474
9476
9478 {
9480
9481 if (!action)
9482 {
9483 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9484 return;
9485 }
9486
9488 if (!ai)
9489 {
9491 return;
9492 }
9493
9495 if (!action_array)
9496 {
9497 action_array = new array<ActionBase_Basic>;
9499 }
9500 if (LogManager.IsActionLogEnable())
9501 {
9502 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9503 }
9504
9505 if (action_array.Find(action) != -1)
9506 {
9507 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9508 }
9509 else
9510 {
9511 action_array.Insert(action);
9512 }
9513 }
9514
9516 {
9518 ActionBase action = player.GetActionManager().GetAction(actionName);
9521
9522 if (action_array)
9523 {
9524 action_array.RemoveItem(action);
9525 }
9526 }
9527
9528
9529
9531 {
9532 ActionOverrideData overrideData = new ActionOverrideData();
9536
9538 if (!actionMap)
9539 {
9542 }
9543
9544 actionMap.Insert(this.
Type(), overrideData);
9545
9546 }
9547
9549
9551
9552
9554 {
9557
9560
9561 string config_to_search = "CfgVehicles";
9562 string muzzle_owner_config;
9563
9565 {
9566 if (IsInherited(Weapon))
9567 config_to_search = "CfgWeapons";
9568
9569 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9570
9571 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9572
9574
9575 if (config_OnFire_subclass_count > 0)
9576 {
9577 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9578
9579 for (int i = 0; i < config_OnFire_subclass_count; i++)
9580 {
9581 string particle_class = "";
9583 string config_OnFire_entry = config_OnFire_class + particle_class;
9584 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9585 WPOF_array.Insert(WPOF);
9586 }
9587
9588
9590 }
9591 }
9592
9594 {
9595 config_to_search = "CfgWeapons";
9596 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9597
9598 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9599
9601
9602 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9603 {
9604 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9605
9606 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9607 {
9608 string particle_class2 = "";
9610 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9611 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9612 WPOBE_array.Insert(WPOBE);
9613 }
9614
9615
9617 }
9618 }
9619 }
9620
9621
9623 {
9626
9628 {
9629 string config_to_search = "CfgVehicles";
9630
9631 if (IsInherited(Weapon))
9632 config_to_search = "CfgWeapons";
9633
9634 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9635 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9636
9637 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9638 {
9639
9641
9643 {
9645 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9647 return;
9648 }
9649
9652
9653
9654
9656 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9657
9658 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9659 {
9660 string particle_class = "";
9662 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9664
9665 if (entry_type == CT_CLASS)
9666 {
9667 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9668 WPOOH_array.Insert(WPOF);
9669 }
9670 }
9671
9672
9674 }
9675 }
9676 }
9677
9679 {
9681 }
9682
9684 {
9686 {
9688
9691
9694
9695 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9696 }
9697 }
9698
9700 {
9702 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9703
9705 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9706
9708 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9709
9711 {
9713 }
9714 }
9715
9717 {
9719 }
9720
9722 {
9725 else
9727
9729 {
9732 }
9733 else
9734 {
9737
9740 }
9741
9743 }
9744
9746 {
9748 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9749 }
9750
9752 {
9754 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9756 }
9757
9759 {
9761 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9762 }
9763
9765 {
9768
9769 OverheatingParticle OP = new OverheatingParticle();
9774
9776 }
9777
9779 {
9782
9783 return -1;
9784 }
9785
9787 {
9789 {
9792
9793 for (int i = count; i > 0; --i)
9794 {
9795 int id = i - 1;
9798
9801
9802 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9803 {
9804 if (p)
9805 {
9808 }
9809 }
9810 }
9811 }
9812 }
9813
9815 {
9817 {
9819 {
9820 int id = i - 1;
9822
9823 if (OP)
9824 {
9826
9827 if (p)
9828 {
9830 }
9831
9832 delete OP;
9833 }
9834 }
9835
9838 }
9839 }
9840
9843 {
9844 return 0.0;
9845 }
9846
9847
9849 {
9850 return 250;
9851 }
9852
9854 {
9855 return 0;
9856 }
9857
9860 {
9862 return true;
9863
9864 return false;
9865 }
9866
9869 {
9872
9874 {
9876 }
9877 else
9878 {
9879
9881 }
9882
9884 }
9885
9892 {
9893 return -1;
9894 }
9895
9896
9897
9898
9900 {
9902 {
9904 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9905
9906 if (r_index >= 0)
9907 {
9908 InventoryLocation r_il = new InventoryLocation;
9909 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9910
9911 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9914 {
9915 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9916 }
9918 {
9919 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9920 }
9921
9922 }
9923
9924 player.GetHumanInventory().ClearUserReservedLocation(this);
9925 }
9926
9929 }
9930
9931
9932
9933
9935 {
9936 return ItemBase.m_DebugActionsMask;
9937 }
9938
9940 {
9941 return ItemBase.m_DebugActionsMask & mask;
9942 }
9943
9945 {
9946 ItemBase.m_DebugActionsMask = mask;
9947 }
9948
9950 {
9951 ItemBase.m_DebugActionsMask |= mask;
9952 }
9953
9955 {
9956 ItemBase.m_DebugActionsMask &= ~mask;
9957 }
9958
9960 {
9962 {
9964 }
9965 else
9966 {
9968 }
9969 }
9970
9971
9973 {
9974 if (GetEconomyProfile())
9975 {
9976 float q_max = GetEconomyProfile().GetQuantityMax();
9977 if (q_max > 0)
9978 {
9979 float q_min = GetEconomyProfile().GetQuantityMin();
9980 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9981
9983 {
9984 ComponentEnergyManager comp = GetCompEM();
9986 {
9988 }
9989 }
9991 {
9993
9994 }
9995
9996 }
9997 }
9998 }
9999
10002 {
10003 EntityAI parent = GetHierarchyParent();
10004
10005 if (parent)
10006 {
10007 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10008 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10009 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10010 }
10011 }
10012
10015 {
10016 EntityAI parent = GetHierarchyParent();
10017
10018 if (parent)
10019 {
10020 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10021 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10022 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10023 }
10024 }
10025
10027 {
10028
10029
10030
10031
10033
10035 {
10036 if (ScriptInputUserData.CanStoreInputUserData())
10037 {
10038 ScriptInputUserData ctx = new ScriptInputUserData;
10044 ctx.
Write(use_stack_max);
10047
10049 {
10050 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10051 }
10052 }
10053 }
10054 else if (!
GetGame().IsMultiplayer())
10055 {
10057 }
10058 }
10059
10061 {
10063 }
10064
10066 {
10068 }
10069
10071 {
10073 }
10074
10076 {
10077
10078 return false;
10079 }
10080
10082 {
10083 return false;
10084 }
10085
10089 {
10090 return false;
10091 }
10092
10094 {
10095 return "";
10096 }
10097
10099
10101 {
10102 return false;
10103 }
10104
10106 {
10107 return true;
10108 }
10109
10110
10111
10113 {
10114 return true;
10115 }
10116
10118 {
10119 return true;
10120 }
10121
10123 {
10124 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10126 }
10127
10129 {
10131 }
10132
10134 {
10136 if (!is_being_placed)
10138 SetSynchDirty();
10139 }
10140
10141
10143
10145 {
10147 }
10148
10150 {
10152 }
10153
10155 {
10156 return 1;
10157 }
10158
10160 {
10161 return false;
10162 }
10163
10165 {
10167 SetSynchDirty();
10168 }
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10205 {
10206 super.OnMovedInsideCargo(container);
10207
10208 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10209 }
10210
10211 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10212 {
10213 super.EEItemLocationChanged(oldLoc,newLoc);
10214
10215 PlayerBase new_player = null;
10216 PlayerBase old_player = null;
10217
10218 if (newLoc.GetParent())
10219 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10220
10221 if (oldLoc.GetParent())
10222 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10223
10225 {
10226 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10227
10228 if (r_index >= 0)
10229 {
10230 InventoryLocation r_il = new InventoryLocation;
10231 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10232
10233 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10236 {
10237 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10238 }
10240 {
10241 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10242 }
10243
10244 }
10245 }
10246
10248 {
10249 if (new_player)
10250 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10251
10252 if (new_player == old_player)
10253 {
10254
10255 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10256 {
10258 {
10259 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10260 {
10261 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10262 }
10263 }
10264 else
10265 {
10266 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10267 }
10268 }
10269
10270 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10271 {
10272 int type = oldLoc.GetType();
10274 {
10275 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10276 }
10278 {
10279 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10280 }
10281 }
10282 if (!m_OldLocation)
10283 {
10284 m_OldLocation = new InventoryLocation;
10285 }
10286 m_OldLocation.Copy(oldLoc);
10287 }
10288 else
10289 {
10290 if (m_OldLocation)
10291 {
10292 m_OldLocation.Reset();
10293 }
10294 }
10295
10297 }
10298 else
10299 {
10300 if (new_player)
10301 {
10302 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10303 if (res_index >= 0)
10304 {
10305 InventoryLocation il = new InventoryLocation;
10306 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10308 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10311 {
10312 il.
GetParent().GetOnReleaseLock().Invoke(it);
10313 }
10315 {
10317 }
10318
10319 }
10320 }
10322 {
10323
10325 }
10326
10327 if (m_OldLocation)
10328 {
10329 m_OldLocation.Reset();
10330 }
10331 }
10332 }
10333
10334 override void EOnContact(IEntity other, Contact extra)
10335 {
10337 {
10338 int liquidType = -1;
10340 if (impactSpeed > 0.0)
10341 {
10343 #ifndef SERVER
10345 #else
10347 SetSynchDirty();
10348 #endif
10350 }
10351 }
10352
10353 #ifdef SERVER
10354 if (GetCompEM() && GetCompEM().IsPlugged())
10355 {
10356 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10357 GetCompEM().UnplugThis();
10358 }
10359 #endif
10360 }
10361
10363
10365 {
10367 }
10368
10370 {
10371
10372 }
10373
10375 {
10376 super.OnItemLocationChanged(old_owner, new_owner);
10377
10378 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10379 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10380
10381 if (!relatedPlayer && playerNew)
10382 relatedPlayer = playerNew;
10383
10384 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10385 {
10387 if (actionMgr)
10388 {
10389 ActionBase currentAction = actionMgr.GetRunningAction();
10390 if (currentAction)
10392 }
10393 }
10394
10395 Man ownerPlayerOld = null;
10396 Man ownerPlayerNew = null;
10397
10398 if (old_owner)
10399 {
10400 if (old_owner.
IsMan())
10401 {
10402 ownerPlayerOld = Man.Cast(old_owner);
10403 }
10404 else
10405 {
10406 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10407 }
10408 }
10409 else
10410 {
10412 {
10414
10415 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10416 {
10417 GetCompEM().UnplugThis();
10418 }
10419 }
10420 }
10421
10422 if (new_owner)
10423 {
10424 if (new_owner.
IsMan())
10425 {
10426 ownerPlayerNew = Man.Cast(new_owner);
10427 }
10428 else
10429 {
10430 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10431 }
10432 }
10433
10434 if (ownerPlayerOld != ownerPlayerNew)
10435 {
10436 if (ownerPlayerOld)
10437 {
10438 array<EntityAI> subItemsExit = new array<EntityAI>;
10440 for (int i = 0; i < subItemsExit.Count(); i++)
10441 {
10444 }
10445 }
10446
10447 if (ownerPlayerNew)
10448 {
10449 array<EntityAI> subItemsEnter = new array<EntityAI>;
10451 for (int j = 0; j < subItemsEnter.Count(); j++)
10452 {
10455 }
10456 }
10457 }
10458 else if (ownerPlayerNew != null)
10459 {
10460 PlayerBase nplayer;
10461 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10462 {
10463 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10465 for (int k = 0; k < subItemsUpdate.Count(); k++)
10466 {
10468 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10469 }
10470 }
10471 }
10472
10473 if (old_owner)
10474 old_owner.OnChildItemRemoved(this);
10475 if (new_owner)
10476 new_owner.OnChildItemReceived(this);
10477 }
10478
10479
10481 {
10482 super.EEDelete(parent);
10483 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10484 if (player)
10485 {
10487
10488 if (player.IsAlive())
10489 {
10490 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10491 if (r_index >= 0)
10492 {
10493 InventoryLocation r_il = new InventoryLocation;
10494 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10495
10496 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10499 {
10500 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10501 }
10503 {
10504 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10505 }
10506
10507 }
10508
10509 player.RemoveQuickBarEntityShortcut(this);
10510 }
10511 }
10512 }
10513
10515 {
10516 super.EEKilled(killer);
10517
10520 {
10521 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10522 {
10523 if (IsMagazine())
10524 {
10525 if (Magazine.Cast(this).GetAmmoCount() > 0)
10526 {
10528 }
10529 }
10530 else
10531 {
10533 }
10534 }
10535 }
10536 }
10537
10539 {
10540 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10541
10542 super.OnWasAttached(parent, slot_id);
10543
10546
10548 }
10549
10551 {
10552 super.OnWasDetached(parent, slot_id);
10553
10556 }
10557
10559 {
10560 int idx;
10563
10564 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10565 if (inventory_slots.Count() < 1)
10566 {
10567 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10568 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10569 }
10570 else
10571 {
10572 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10573 }
10574
10575 idx = inventory_slots.Find(slot);
10576 if (idx < 0)
10577 return "";
10578
10579 return attach_types.Get(idx);
10580 }
10581
10583 {
10584 int idx = -1;
10585 string slot;
10586
10589
10590 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10591 if (inventory_slots.Count() < 1)
10592 {
10593 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10594 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10595 }
10596 else
10597 {
10598 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10599 if (detach_types.Count() < 1)
10600 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10601 }
10602
10603 for (int i = 0; i < inventory_slots.Count(); i++)
10604 {
10605 slot = inventory_slots.Get(i);
10606 }
10607
10608 if (slot != "")
10609 {
10610 if (detach_types.Count() == 1)
10611 idx = 0;
10612 else
10613 idx = inventory_slots.Find(slot);
10614 }
10615 if (idx < 0)
10616 return "";
10617
10618 return detach_types.Get(idx);
10619 }
10620
10622 {
10623
10625
10626
10627 float min_time = 1;
10628 float max_time = 3;
10629 float delay = Math.RandomFloat(min_time, max_time);
10630
10631 explode_timer.Run(delay, this, "DoAmmoExplosion");
10632 }
10633
10635 {
10636 Magazine magazine = Magazine.Cast(this);
10637 int pop_sounds_count = 6;
10638 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10639
10640
10641 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10642 string sound_name = pop_sounds[ sound_idx ];
10644
10645
10646 magazine.ServerAddAmmoCount(-1);
10647
10648
10649 float min_temp_to_explode = 100;
10650
10651 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10652 {
10654 }
10655 }
10656
10657
10658 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10659 {
10660 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10661
10662 const int CHANCE_DAMAGE_CARGO = 4;
10663 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10664 const int CHANCE_DAMAGE_NOTHING = 2;
10665
10667 {
10668 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10669 int chances;
10670 int rnd;
10671
10672 if (GetInventory().GetCargo())
10673 {
10674 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10675 rnd = Math.RandomInt(0,chances);
10676
10677 if (rnd < CHANCE_DAMAGE_CARGO)
10678 {
10680 }
10681 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10682 {
10684 }
10685 }
10686 else
10687 {
10688 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10689 rnd = Math.RandomInt(0,chances);
10690
10691 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10692 {
10694 }
10695 }
10696 }
10697 }
10698
10700 {
10701 if (GetInventory().GetCargo())
10702 {
10703 int item_count = GetInventory().GetCargo().GetItemCount();
10704 if (item_count > 0)
10705 {
10706 int random_pick = Math.RandomInt(0, item_count);
10708 if (!item.IsExplosive())
10709 {
10710 item.AddHealth("","",damage);
10711 return true;
10712 }
10713 }
10714 }
10715 return false;
10716 }
10717
10719 {
10720 int attachment_count = GetInventory().AttachmentCount();
10721 if (attachment_count > 0)
10722 {
10723 int random_pick = Math.RandomInt(0, attachment_count);
10724 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10725 if (!attachment.IsExplosive())
10726 {
10727 attachment.AddHealth("","",damage);
10728 return true;
10729 }
10730 }
10731 return false;
10732 }
10733
10735 {
10737 }
10738
10740 {
10742 return GetInventory().CanRemoveEntity();
10743
10744 return false;
10745 }
10746
10748 {
10749
10751 return false;
10752
10753
10755 return false;
10756
10757
10758
10760 if (delta == 0)
10761 return false;
10762
10763
10764 return true;
10765 }
10766
10768 {
10770 {
10771 if (ScriptInputUserData.CanStoreInputUserData())
10772 {
10773 ScriptInputUserData ctx = new ScriptInputUserData;
10778 ctx.
Write(destination_entity);
10780 ctx.
Write(slot_id);
10782 }
10783 }
10784 else if (!
GetGame().IsMultiplayer())
10785 {
10787 }
10788 }
10789
10791 {
10792 float split_quantity_new;
10796 InventoryLocation loc = new InventoryLocation;
10797
10798 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10799 {
10801 split_quantity_new = stack_max;
10802 else
10804
10806 {
10807 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10808 if (new_item)
10809 {
10810 new_item.SetResultOfSplit(true);
10811 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10813 new_item.
SetQuantity(split_quantity_new,
false,
true);
10814 }
10815 }
10816 }
10817 else if (destination_entity && slot_id == -1)
10818 {
10819 if (quantity > stack_max)
10820 split_quantity_new = stack_max;
10821 else
10822 split_quantity_new = quantity;
10823
10825 {
10827 {
10830 }
10831
10832 if (new_item)
10833 {
10834 new_item.SetResultOfSplit(true);
10835 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10837 new_item.
SetQuantity(split_quantity_new,
false,
true);
10838 }
10839 }
10840 }
10841 else
10842 {
10843 if (stack_max != 0)
10844 {
10846 {
10848 }
10849
10850 if (split_quantity_new == 0)
10851 {
10852 if (!
GetGame().IsMultiplayer())
10853 player.PhysicalPredictiveDropItem(this);
10854 else
10855 player.ServerDropEntity(this);
10856 return;
10857 }
10858
10860 {
10862
10863 if (new_item)
10864 {
10865 new_item.SetResultOfSplit(true);
10866 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10869 new_item.PlaceOnSurface();
10870 }
10871 }
10872 }
10873 }
10874 }
10875
10877 {
10878 float split_quantity_new;
10882 InventoryLocation loc = new InventoryLocation;
10883
10884 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10885 {
10887 split_quantity_new = stack_max;
10888 else
10890
10892 {
10893 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10894 if (new_item)
10895 {
10896 new_item.SetResultOfSplit(true);
10897 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10899 new_item.
SetQuantity(split_quantity_new,
false,
true);
10900 }
10901 }
10902 }
10903 else if (destination_entity && slot_id == -1)
10904 {
10905 if (quantity > stack_max)
10906 split_quantity_new = stack_max;
10907 else
10908 split_quantity_new = quantity;
10909
10911 {
10913 {
10916 }
10917
10918 if (new_item)
10919 {
10920 new_item.SetResultOfSplit(true);
10921 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10923 new_item.
SetQuantity(split_quantity_new,
false,
true);
10924 }
10925 }
10926 }
10927 else
10928 {
10929 if (stack_max != 0)
10930 {
10932 {
10934 }
10935
10937 {
10939
10940 if (new_item)
10941 {
10942 new_item.SetResultOfSplit(true);
10943 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10946 new_item.PlaceOnSurface();
10947 }
10948 }
10949 }
10950 }
10951 }
10952
10954 {
10956 {
10957 if (ScriptInputUserData.CanStoreInputUserData())
10958 {
10959 ScriptInputUserData ctx = new ScriptInputUserData;
10964 dst.WriteToContext(ctx);
10966 }
10967 }
10968 else if (!
GetGame().IsMultiplayer())
10969 {
10971 }
10972 }
10973
10975 {
10977 {
10978 if (ScriptInputUserData.CanStoreInputUserData())
10979 {
10980 ScriptInputUserData ctx = new ScriptInputUserData;
10985 ctx.
Write(destination_entity);
10991 }
10992 }
10993 else if (!
GetGame().IsMultiplayer())
10994 {
10996 }
10997 }
10998
11000 {
11002 }
11003
11005 {
11007 float split_quantity_new;
11009 if (dst.IsValid())
11010 {
11011 int slot_id = dst.GetSlot();
11013
11014 if (quantity > stack_max)
11015 split_quantity_new = stack_max;
11016 else
11017 split_quantity_new = quantity;
11018
11020 {
11022
11023 if (new_item)
11024 {
11025 new_item.SetResultOfSplit(true);
11026 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11028 new_item.
SetQuantity(split_quantity_new,
false,
true);
11029 }
11030
11031 return new_item;
11032 }
11033 }
11034
11035 return null;
11036 }
11037
11039 {
11041 float split_quantity_new;
11043 if (destination_entity)
11044 {
11046 if (quantity > stackable)
11047 split_quantity_new = stackable;
11048 else
11049 split_quantity_new = quantity;
11050
11052 {
11053 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11054 if (new_item)
11055 {
11056 new_item.SetResultOfSplit(true);
11057 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11059 new_item.
SetQuantity(split_quantity_new,
false,
true);
11060 }
11061 }
11062 }
11063 }
11064
11066 {
11068 {
11069 if (ScriptInputUserData.CanStoreInputUserData())
11070 {
11071 ScriptInputUserData ctx = new ScriptInputUserData;
11076 ItemBase destination_entity =
this;
11077 ctx.
Write(destination_entity);
11081 }
11082 }
11083 else if (!
GetGame().IsMultiplayer())
11084 {
11086 }
11087 }
11088
11090 {
11092 float split_quantity_new;
11094 if (player)
11095 {
11097 if (quantity > stackable)
11098 split_quantity_new = stackable;
11099 else
11100 split_quantity_new = quantity;
11101
11103 {
11104 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11105 new_item =
ItemBase.Cast(in_hands);
11106 if (new_item)
11107 {
11108 new_item.SetResultOfSplit(true);
11109 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11111 new_item.SetQuantity(split_quantity_new, false, true);
11112 }
11113 }
11114 }
11115 }
11116
11118 {
11120 float split_quantity_new = Math.Floor(quantity * 0.5);
11121
11123 return;
11124
11126
11127 if (new_item)
11128 {
11129 if (new_item.GetQuantityMax() < split_quantity_new)
11130 {
11131 split_quantity_new = new_item.GetQuantityMax();
11132 }
11133
11134 new_item.SetResultOfSplit(true);
11135 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11136
11138 {
11141 }
11142 else
11143 {
11145 new_item.
SetQuantity(split_quantity_new,
false,
true);
11146 }
11147 }
11148 }
11149
11151 {
11153 float split_quantity_new = Math.Floor(quantity / 2);
11154
11156 return;
11157
11158 InventoryLocation invloc = new InventoryLocation;
11160
11162 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11163
11164 if (new_item)
11165 {
11166 if (new_item.GetQuantityMax() < split_quantity_new)
11167 {
11168 split_quantity_new = new_item.GetQuantityMax();
11169 }
11171 {
11174 }
11175 else if (split_quantity_new > 1)
11176 {
11178 new_item.
SetQuantity(split_quantity_new,
false,
true);
11179 }
11180 }
11181 }
11182
11185 {
11186 SetWeightDirty();
11188
11189 if (parent)
11190 parent.OnAttachmentQuantityChangedEx(this, delta);
11191
11193 {
11195 {
11197 }
11199 {
11200 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11202 }
11203 }
11204
11205 }
11206
11209 {
11210
11211 }
11212
11215 {
11217 }
11218
11220 {
11221 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11222
11224 {
11225 if (newLevel == GameConstants.STATE_RUINED)
11226 {
11228 EntityAI parent = GetHierarchyParent();
11229 if (parent && parent.IsFireplace())
11230 {
11231 CargoBase cargo = GetInventory().GetCargo();
11232 if (cargo)
11233 {
11235 {
11237 }
11238 }
11239 }
11240 }
11241
11243 {
11244
11246 return;
11247 }
11248
11249 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11250 {
11252 }
11253 }
11254 }
11255
11256
11258 {
11259 super.OnRightClick();
11260
11262 {
11264 {
11265 if (ScriptInputUserData.CanStoreInputUserData())
11266 {
11267 EntityAI root = GetHierarchyRoot();
11268 Man playerOwner = GetHierarchyRootPlayer();
11269 InventoryLocation dst = new InventoryLocation;
11270
11271
11272 if (!playerOwner && root && root == this)
11273 {
11275 }
11276 else
11277 {
11278
11279 GetInventory().GetCurrentInventoryLocation(dst);
11281 {
11284 {
11286 }
11287 else
11288 {
11290
11291
11292 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11293 {
11295 }
11296 else
11297 {
11298 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11299 }
11300 }
11301 }
11302 }
11303
11304 ScriptInputUserData ctx = new ScriptInputUserData;
11312 }
11313 }
11314 else if (!
GetGame().IsMultiplayer())
11315 {
11317 }
11318 }
11319 }
11320
11322 {
11323 if (root)
11324 {
11325 vector m4[4];
11326 root.GetTransform(m4);
11327 dst.SetGround(this, m4);
11328 }
11329 else
11330 {
11331 GetInventory().GetCurrentInventoryLocation(dst);
11332 }
11333 }
11334
11335 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11336 {
11337
11338 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11339 return false;
11340
11341 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11342 return false;
11343
11344
11346 return false;
11347
11348
11349 Magazine mag = Magazine.Cast(this);
11350 if (mag)
11351 {
11352 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11353 return false;
11354
11355 if (stack_max_limit)
11356 {
11357 Magazine other_mag = Magazine.Cast(other_item);
11358 if (other_item)
11359 {
11360 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11361 return false;
11362 }
11363
11364 }
11365 }
11366 else
11367 {
11368
11370 return false;
11371
11373 return false;
11374 }
11375
11376 PlayerBase player = null;
11377 if (CastTo(player, GetHierarchyRootPlayer()))
11378 {
11379 if (player.GetInventory().HasAttachment(this))
11380 return false;
11381
11382 if (player.IsItemsToDelete())
11383 return false;
11384 }
11385
11386 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11387 return false;
11388
11389 int slotID;
11391 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11392 return false;
11393
11394 return true;
11395 }
11396
11398 {
11400 }
11401
11403 {
11404 return m_IsResultOfSplit;
11405 }
11406
11408 {
11409 m_IsResultOfSplit = value;
11410 }
11411
11413 {
11415 }
11416
11418 {
11419 float other_item_quantity = other_item.GetQuantity();
11420 float this_free_space;
11421
11423
11425
11426 if (other_item_quantity > this_free_space)
11427 {
11428 return this_free_space;
11429 }
11430 else
11431 {
11432 return other_item_quantity;
11433 }
11434 }
11435
11437 {
11439 }
11440
11442 {
11444 return;
11445
11446 if (!IsMagazine() && other_item)
11447 {
11449 if (quantity_used != 0)
11450 {
11451 float hp1 = GetHealth01("","");
11452 float hp2 = other_item.GetHealth01("","");
11453 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11454 hpResult = hpResult / (
GetQuantity() + quantity_used);
11455
11456 hpResult *= GetMaxHealth();
11457 Math.Round(hpResult);
11458 SetHealth("", "Health", hpResult);
11459
11461 other_item.AddQuantity(-quantity_used);
11462 }
11463 }
11465 }
11466
11468 {
11469 #ifdef SERVER
11470 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11471 GetHierarchyParent().IncreaseLifetimeUp();
11472 #endif
11473 };
11474
11476 {
11477 PlayerBase p = PlayerBase.Cast(player);
11478
11479 array<int> recipesIds = p.m_Recipes;
11480 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11481 if (moduleRecipesManager)
11482 {
11483 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11484 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11485 }
11486
11487 for (int i = 0;i < recipesIds.Count(); i++)
11488 {
11489 int key = recipesIds.Get(i);
11490 string recipeName = moduleRecipesManager.GetRecipeName(key);
11492 }
11493 }
11494
11495
11496 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11497 {
11498 super.GetDebugActions(outputList);
11499
11500
11506
11507
11512
11517
11518
11522
11523
11525 {
11529 }
11530
11533
11534
11538
11540
11541 InventoryLocation loc = new InventoryLocation();
11542 GetInventory().GetCurrentInventoryLocation(loc);
11544 {
11545 if (Gizmo_IsSupported())
11548 }
11549
11551 }
11552
11553
11554
11555
11557 {
11558 super.OnAction(action_id, player, ctx);
11559
11561 {
11562 switch (action_id)
11563 {
11566 return true;
11569 return true;
11570 }
11571 }
11572
11574 {
11575 switch (action_id)
11576 {
11578 Delete();
11579 return true;
11580 }
11581 }
11582
11583 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11584 {
11585 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11586 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11587 PlayerBase p = PlayerBase.Cast(player);
11588 if (
EActions.RECIPES_RANGE_START < 1000)
11589 {
11590 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11591 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11592 }
11593 }
11594 #ifndef SERVER
11595 else if (action_id ==
EActions.WATCH_PLAYER)
11596 {
11597 PluginDeveloper.SetDeveloperItemClientEx(player);
11598 }
11599 #endif
11601 {
11602 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11603 {
11604 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11605 OnDebugButtonPressServer(id + 1);
11606 }
11607
11608 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11609 {
11610 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11612 }
11613
11614 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11615 {
11616 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11618 }
11619
11620 else if (action_id ==
EActions.ADD_QUANTITY)
11621 {
11622 if (IsMagazine())
11623 {
11624 Magazine mag = Magazine.Cast(this);
11625 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11626 }
11627 else
11628 {
11630 }
11631
11632 if (m_EM)
11633 {
11634 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11635 }
11636
11637 }
11638
11639 else if (action_id ==
EActions.REMOVE_QUANTITY)
11640 {
11641 if (IsMagazine())
11642 {
11643 Magazine mag2 = Magazine.Cast(this);
11644 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11645 }
11646 else
11647 {
11649 }
11650 if (m_EM)
11651 {
11652 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11653 }
11654
11655 }
11656
11657 else if (action_id ==
EActions.SET_QUANTITY_0)
11658 {
11660
11661 if (m_EM)
11662 {
11663 m_EM.SetEnergy(0);
11664 }
11665 }
11666
11667 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11668 {
11670
11671 if (m_EM)
11672 {
11673 m_EM.SetEnergy(m_EM.GetEnergyMax());
11674 }
11675 }
11676
11677 else if (action_id ==
EActions.ADD_HEALTH)
11678 {
11679 AddHealth("","",GetMaxHealth("","Health")/5);
11680 }
11681 else if (action_id ==
EActions.REMOVE_HEALTH)
11682 {
11683 AddHealth("","",-GetMaxHealth("","Health")/5);
11684 }
11685 else if (action_id ==
EActions.DESTROY_HEALTH)
11686 {
11687 SetHealth01("","",0);
11688 }
11689 else if (action_id ==
EActions.WATCH_ITEM)
11690 {
11692 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11693 #ifdef DEVELOPER
11694 SetDebugDeveloper_item(this);
11695 #endif
11696 }
11697
11698 else if (action_id ==
EActions.ADD_TEMPERATURE)
11699 {
11700 AddTemperature(20);
11701
11702 }
11703
11704 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11705 {
11706 AddTemperature(-20);
11707
11708 }
11709
11710 else if (action_id ==
EActions.FLIP_FROZEN)
11711 {
11712 SetFrozen(!GetIsFrozen());
11713
11714 }
11715
11716 else if (action_id ==
EActions.ADD_WETNESS)
11717 {
11719
11720 }
11721
11722 else if (action_id ==
EActions.REMOVE_WETNESS)
11723 {
11725
11726 }
11727
11728 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11729 {
11732
11733
11734 }
11735
11736 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11737 {
11740 }
11741
11742 else if (action_id ==
EActions.MAKE_SPECIAL)
11743 {
11744 auto debugParams = DebugSpawnParams.WithPlayer(player);
11745 OnDebugSpawnEx(debugParams);
11746 }
11747
11748 }
11749
11750
11751 return false;
11752 }
11753
11754
11755
11756
11760
11763
11764
11765
11767 {
11768 return false;
11769 }
11770
11771
11773 {
11774 return true;
11775 }
11776
11777
11779 {
11780 return true;
11781 }
11782
11783
11784
11786 {
11787 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11789 }
11790
11793 {
11794 return null;
11795 }
11796
11798 {
11799 return false;
11800 }
11801
11803 {
11804 return false;
11805 }
11806
11810
11811
11813 {
11814 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11815 return module_repairing.CanRepair(this, item_repair_kit);
11816 }
11817
11818
11819 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11820 {
11821 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11822 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11823 }
11824
11825
11827 {
11828
11829
11830
11831
11832
11833
11834
11835
11836 return 1;
11837 }
11838
11839
11840
11842 {
11844 }
11845
11846
11847
11849 {
11851 }
11852
11853
11862 {
11863 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11864
11865 if (player)
11866 {
11867 player.MessageStatus(text);
11868 }
11869 }
11870
11871
11880 {
11881 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11882
11883 if (player)
11884 {
11885 player.MessageAction(text);
11886 }
11887 }
11888
11889
11898 {
11899 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11900
11901 if (player)
11902 {
11903 player.MessageFriendly(text);
11904 }
11905 }
11906
11907
11916 {
11917 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11918
11919 if (player)
11920 {
11921 player.MessageImportant(text);
11922 }
11923 }
11924
11926 {
11927 return true;
11928 }
11929
11930
11931 override bool KindOf(
string tag)
11932 {
11933 bool found = false;
11934 string item_name = this.
GetType();
11937
11938 int array_size = item_tag_array.Count();
11939 for (int i = 0; i < array_size; i++)
11940 {
11941 if (item_tag_array.Get(i) == tag)
11942 {
11943 found = true;
11944 break;
11945 }
11946 }
11947 return found;
11948 }
11949
11950
11952 {
11953
11954 super.OnRPC(sender, rpc_type,ctx);
11955
11956
11957 switch (rpc_type)
11958 {
11959 #ifndef SERVER
11960 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11961 Param2<bool, string> p = new Param2<bool, string>(false, "");
11962
11964 return;
11965
11966 bool play = p.param1;
11967 string soundSet = p.param2;
11968
11969 if (play)
11970 {
11972 {
11974 {
11976 }
11977 }
11978 else
11979 {
11981 }
11982 }
11983 else
11984 {
11986 }
11987
11988 break;
11989 #endif
11990
11991 }
11992
11994 {
11996 }
11997 }
11998
11999
12000
12001
12003 {
12004 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12005 return plugin.GetID(
name);
12006 }
12007
12009 {
12010 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12011 return plugin.GetName(id);
12012 }
12013
12016 {
12017
12018
12019 int varFlags;
12020 if (!ctx.
Read(varFlags))
12021 return;
12022
12023 if (varFlags & ItemVariableFlags.FLOAT)
12024 {
12026 }
12027 }
12028
12030 {
12031
12032 super.SerializeNumericalVars(floats_out);
12033
12034
12035
12037 {
12039 }
12040
12042 {
12044 }
12045
12047 {
12049 }
12050
12052 {
12057 }
12058
12060 {
12062 }
12063 }
12064
12066 {
12067
12068 super.DeSerializeNumericalVars(floats);
12069
12070
12071 int index = 0;
12072 int mask = Math.Round(floats.Get(index));
12073
12074 index++;
12075
12077 {
12079 {
12081 }
12082 else
12083 {
12084 float quantity = floats.Get(index);
12085 SetQuantity(quantity,
true,
false,
false,
false);
12086 }
12087 index++;
12088 }
12089
12091 {
12092 float wet = floats.Get(index);
12094 index++;
12095 }
12096
12098 {
12099 int liquidtype = Math.Round(floats.Get(index));
12101 index++;
12102 }
12103
12105 {
12107 index++;
12109 index++;
12111 index++;
12113 index++;
12114 }
12115
12117 {
12118 int cleanness = Math.Round(floats.Get(index));
12120 index++;
12121 }
12122 }
12123
12125 {
12126 super.WriteVarsToCTX(ctx);
12127
12128
12130 {
12132 }
12133
12135 {
12137 }
12138
12140 {
12142 }
12143
12145 {
12146 int r,g,b,a;
12152 }
12153
12155 {
12157 }
12158 }
12159
12161 {
12162 if (!super.ReadVarsFromCTX(ctx,version))
12163 return false;
12164
12165 int intValue;
12166 float value;
12167
12168 if (version < 140)
12169 {
12170 if (!ctx.
Read(intValue))
12171 return false;
12172
12173 m_VariablesMask = intValue;
12174 }
12175
12177 {
12178 if (!ctx.
Read(value))
12179 return false;
12180
12182 {
12184 }
12185 else
12186 {
12188 }
12189 }
12190
12191 if (version < 140)
12192 {
12194 {
12195 if (!ctx.
Read(value))
12196 return false;
12197 SetTemperatureDirect(value);
12198 }
12199 }
12200
12202 {
12203 if (!ctx.
Read(value))
12204 return false;
12206 }
12207
12209 {
12210 if (!ctx.
Read(intValue))
12211 return false;
12213 }
12214
12216 {
12217 int r,g,b,a;
12219 return false;
12221 return false;
12223 return false;
12225 return false;
12226
12228 }
12229
12231 {
12232 if (!ctx.
Read(intValue))
12233 return false;
12235 }
12236
12237 if (version >= 138 && version < 140)
12238 {
12240 {
12241 if (!ctx.
Read(intValue))
12242 return false;
12243 SetFrozen(intValue);
12244 }
12245 }
12246
12247 return true;
12248 }
12249
12250
12252 {
12255 {
12257 }
12258
12259 if (!super.OnStoreLoad(ctx, version))
12260 {
12262 return false;
12263 }
12264
12265 if (version >= 114)
12266 {
12267 bool hasQuickBarIndexSaved;
12268
12269 if (!ctx.
Read(hasQuickBarIndexSaved))
12270 {
12272 return false;
12273 }
12274
12275 if (hasQuickBarIndexSaved)
12276 {
12277 int itmQBIndex;
12278
12279
12280 if (!ctx.
Read(itmQBIndex))
12281 {
12283 return false;
12284 }
12285
12286 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12287 if (itmQBIndex != -1 && parentPlayer)
12288 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12289 }
12290 }
12291 else
12292 {
12293
12294 PlayerBase player;
12295 int itemQBIndex;
12296 if (version ==
int.
MAX)
12297 {
12298 if (!ctx.
Read(itemQBIndex))
12299 {
12301 return false;
12302 }
12303 }
12304 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12305 {
12306
12307 if (!ctx.
Read(itemQBIndex))
12308 {
12310 return false;
12311 }
12312 if (itemQBIndex != -1 && player)
12313 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12314 }
12315 }
12316
12317 if (version < 140)
12318 {
12319
12320 if (!LoadVariables(ctx, version))
12321 {
12323 return false;
12324 }
12325 }
12326
12327
12329 {
12331 return false;
12332 }
12333 if (version >= 132)
12334 {
12336 if (raib)
12337 {
12339 {
12341 return false;
12342 }
12343 }
12344 }
12345
12347 return true;
12348 }
12349
12350
12351
12353 {
12354 super.OnStoreSave(ctx);
12355
12356 PlayerBase player;
12357 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12358 {
12360
12361 int itemQBIndex = -1;
12362 itemQBIndex = player.FindQuickBarEntityIndex(this);
12363 ctx.
Write(itemQBIndex);
12364 }
12365 else
12366 {
12368 }
12369
12371
12373 if (raib)
12374 {
12376 }
12377 }
12378
12379
12381 {
12382 super.AfterStoreLoad();
12383
12385 {
12387 }
12388
12390 {
12393 }
12394 }
12395
12397 {
12398 super.EEOnAfterLoad();
12399
12401 {
12403 }
12404
12407 }
12408
12410 {
12411 return false;
12412 }
12413
12414
12415
12417 {
12419 {
12420 #ifdef PLATFORM_CONSOLE
12421
12423 {
12425 if (menu)
12426 {
12428 }
12429 }
12430 #endif
12431 }
12432
12434 {
12437 }
12438
12440 {
12441 SetWeightDirty();
12443 }
12445 {
12448 }
12449
12451 {
12454 }
12456 {
12459 }
12460
12461 super.OnVariablesSynchronized();
12462 }
12463
12464
12465
12467 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12468 {
12469 if (!IsServerCheck(allow_client))
12470 return false;
12471
12473 return false;
12474
12477
12478 if (value <= (min + 0.001))
12479 value = min;
12480
12481 if (value == min)
12482 {
12483 if (destroy_config)
12484 {
12485 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12486 if (dstr)
12487 {
12489 this.Delete();
12490 return true;
12491 }
12492 }
12493 else if (destroy_forced)
12494 {
12496 this.Delete();
12497 return true;
12498 }
12499
12501 }
12502
12505
12507 {
12509
12510 if (delta)
12512 }
12513
12515
12516 return false;
12517 }
12518
12519
12521 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12522 {
12524 }
12525
12527 {
12530 }
12531
12533 {
12536 }
12537
12539 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12540 {
12541 float value_clamped = Math.Clamp(value, 0, 1);
12543 SetQuantity(result, destroy_config, destroy_forced);
12544 }
12545
12546
12549 {
12551 }
12552
12554 {
12556 }
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12568 {
12569 int slot = -1;
12570 if (GetInventory())
12571 {
12572 InventoryLocation il = new InventoryLocation;
12573 GetInventory().GetCurrentInventoryLocation(il);
12575 }
12576
12578 }
12579
12581 {
12582 float quantity_max = 0;
12583
12585 {
12586 if (attSlotID != -1)
12587 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12588
12589 if (quantity_max <= 0)
12591 }
12592
12593 if (quantity_max <= 0)
12595
12596 return quantity_max;
12597 }
12598
12600 {
12602 }
12603
12605 {
12607 }
12608
12609
12611 {
12613 }
12614
12616 {
12618 }
12619
12621 {
12623 }
12624
12625
12627 {
12628
12629 float weightEx = GetWeightEx();
12630 float special = GetInventoryAndCargoWeight();
12631 return weightEx - special;
12632 }
12633
12634
12636 {
12638 }
12639
12641 {
12643 {
12644 #ifdef DEVELOPER
12645 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12646 {
12647 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12649 }
12650 #endif
12651
12652 return GetQuantity() * GetConfigWeightModified();
12653 }
12654 else if (HasEnergyManager())
12655 {
12656 #ifdef DEVELOPER
12657 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12658 {
12659 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12660 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12661 }
12662 #endif
12663 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12664 }
12665 else
12666 {
12667 #ifdef DEVELOPER
12668 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12669 {
12670 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12671 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12672 }
12673 #endif
12674 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12675 }
12676 }
12677
12680 {
12681 int item_count = 0;
12683
12684 if (GetInventory().GetCargo() != NULL)
12685 {
12686 item_count = GetInventory().GetCargo().GetItemCount();
12687 }
12688
12689 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12690 {
12691 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12692 if (item)
12693 item_count += item.GetNumberOfItems();
12694 }
12695 return item_count;
12696 }
12697
12700 {
12701 float weight = 0;
12702 float wetness = 1;
12703 if (include_wetness)
12706 {
12707 weight = wetness * m_ConfigWeight;
12708 }
12710 {
12711 weight = 1;
12712 }
12713 return weight;
12714 }
12715
12716
12717
12719 {
12720 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12721 {
12722 GameInventory inv = GetInventory();
12723 array<EntityAI> items = new array<EntityAI>;
12725 for (int i = 0; i < items.Count(); i++)
12726 {
12728 if (item)
12729 {
12731 }
12732 }
12733 }
12734 }
12735
12736
12737
12738
12740 {
12741 float energy = 0;
12742 if (HasEnergyManager())
12743 {
12744 energy = GetCompEM().GetEnergy();
12745 }
12746 return energy;
12747 }
12748
12749
12751 {
12752 super.OnEnergyConsumed();
12753
12755 }
12756
12758 {
12759 super.OnEnergyAdded();
12760
12762 }
12763
12764
12766 {
12767 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12768 {
12770 {
12771 float energy_0to1 = GetCompEM().GetEnergy0To1();
12773 }
12774 }
12775 }
12776
12777
12779 {
12780 return ConfigGetFloat("heatIsolation");
12781 }
12782
12784 {
12786 }
12787
12789 {
12790 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12791 if (
GetGame().ConfigIsExisting(paramPath))
12793
12794 return 0.0;
12795 }
12796
12798 {
12799 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12800 if (
GetGame().ConfigIsExisting(paramPath))
12802
12803 return 0.0;
12804 }
12805
12806 override void SetWet(
float value,
bool allow_client =
false)
12807 {
12808 if (!IsServerCheck(allow_client))
12809 return;
12810
12813
12815
12816 m_VarWet = Math.Clamp(value, min, max);
12817
12819 {
12822 }
12823 }
12824
12825 override void AddWet(
float value)
12826 {
12828 }
12829
12831 {
12833 }
12834
12836 {
12838 }
12839
12841 {
12843 }
12844
12846 {
12848 }
12849
12851 {
12853 }
12854
12855 override void OnWetChanged(
float newVal,
float oldVal)
12856 {
12859 if (newLevel != oldLevel)
12860 {
12862 }
12863 }
12864
12866 {
12867 SetWeightDirty();
12868 }
12869
12871 {
12872 return GetWetLevelInternal(
m_VarWet);
12873 }
12874
12875
12876
12878 {
12880 }
12881
12883 {
12885 }
12886
12888 {
12890 }
12891
12893 {
12895 }
12896
12897
12898
12900 {
12901 if (ConfigIsExisting("itemModelLength"))
12902 {
12903 return ConfigGetFloat("itemModelLength");
12904 }
12905 return 0;
12906 }
12907
12909 {
12910 if (ConfigIsExisting("itemAttachOffset"))
12911 {
12912 return ConfigGetFloat("itemAttachOffset");
12913 }
12914 return 0;
12915 }
12916
12917 override void SetCleanness(
int value,
bool allow_client =
false)
12918 {
12919 if (!IsServerCheck(allow_client))
12920 return;
12921
12923
12925
12928 }
12929
12931 {
12933 }
12934
12936 {
12937 return true;
12938 }
12939
12940
12941
12942
12944 {
12946 }
12947
12949 {
12951 }
12952
12953
12954
12955
12956 override void SetColor(
int r,
int g,
int b,
int a)
12957 {
12963 }
12965 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12966 {
12971 }
12972
12974 {
12976 }
12977
12980 {
12981 int r,g,b,a;
12983 r = r/255;
12984 g = g/255;
12985 b = b/255;
12986 a = a/255;
12987 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12988 }
12989
12990
12991
12992 override void SetLiquidType(
int value,
bool allow_client =
false)
12993 {
12994 if (!IsServerCheck(allow_client))
12995 return;
12996
13001 }
13002
13004 {
13005 return ConfigGetInt("varLiquidTypeInit");
13006 }
13007
13009 {
13011 }
13012
13014 {
13016 SetFrozen(false);
13017 }
13018
13021 {
13022 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13023 }
13024
13025
13028 {
13029 PlayerBase nplayer;
13030 if (PlayerBase.CastTo(nplayer, player))
13031 {
13033
13034 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13035 }
13036 }
13037
13038
13041 {
13042 PlayerBase nplayer;
13043 if (PlayerBase.CastTo(nplayer,player))
13044 {
13045
13046 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13047
13048 }
13049
13050
13051 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13052
13053
13054 if (HasEnergyManager())
13055 {
13056 GetCompEM().UpdatePlugState();
13057 }
13058 }
13059
13060
13062 {
13063 super.OnPlacementStarted(player);
13064
13066 }
13067
13068 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13069 {
13071 {
13072 m_AdminLog.OnPlacementComplete(player,
this);
13073 }
13074
13075 super.OnPlacementComplete(player, position, orientation);
13076 }
13077
13078
13079
13080
13081
13083 {
13085 {
13086 return true;
13087 }
13088 else
13089 {
13090 return false;
13091 }
13092 }
13093
13094
13096 {
13098 {
13100 }
13101 }
13102
13103
13105 {
13107 }
13108
13110 {
13112 }
13113
13114 override void InsertAgent(
int agent,
float count = 1)
13115 {
13116 if (count < 1)
13117 return;
13118
13120 }
13121
13124 {
13126 }
13127
13128
13130 {
13132 }
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13176 {
13178 return false;
13179 return true;
13180 }
13181
13183 {
13184
13186 }
13187
13188
13191 {
13192 super.CheckForRoofLimited(timeTresholdMS);
13193
13195 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13196 {
13197 m_PreviousRoofTestTime = time;
13198 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13199 }
13200 }
13201
13202
13204 {
13206 {
13207 return 0;
13208 }
13209
13210 if (GetInventory().GetAttachmentSlotsCount() != 0)
13211 {
13212 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13213 if (filter)
13214 return filter.GetProtectionLevel(type, false, system);
13215 else
13216 return 0;
13217 }
13218
13219 string subclassPath, entryName;
13220
13221 switch (type)
13222 {
13224 entryName = "biological";
13225 break;
13227 entryName = "chemical";
13228 break;
13229 default:
13230 entryName = "biological";
13231 break;
13232 }
13233
13234 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13235
13237 }
13238
13239
13240
13243 {
13244 if (!IsMagazine())
13246
13248 }
13249
13250
13251
13252
13253
13258 {
13259 return true;
13260 }
13261
13263 {
13265 }
13266
13267
13268
13269
13270
13272 {
13273 if (parent)
13274 {
13275 if (parent.IsInherited(DayZInfected))
13276 return true;
13277
13278 if (!parent.IsRuined())
13279 return true;
13280 }
13281
13282 return true;
13283 }
13284
13286 {
13287 if (!super.CanPutAsAttachment(parent))
13288 {
13289 return false;
13290 }
13291
13292 if (!IsRuined() && !parent.IsRuined())
13293 {
13294 return true;
13295 }
13296
13297 return false;
13298 }
13299
13301 {
13302
13303
13304
13305
13306 return super.CanReceiveItemIntoCargo(item);
13307 }
13308
13310 {
13311
13312
13313
13314
13315 GameInventory attachmentInv = attachment.GetInventory();
13317 {
13318 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13319 return false;
13320 }
13321
13322 InventoryLocation loc = new InventoryLocation();
13323 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13324 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13325 return false;
13326
13327 return super.CanReceiveAttachment(attachment, slotId);
13328 }
13329
13331 {
13332 if (!super.CanReleaseAttachment(attachment))
13333 return false;
13334
13335 return GetInventory().AreChildrenAccessible();
13336 }
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13359 {
13360 int id = muzzle_owner.GetMuzzleID();
13361 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13362
13363 if (WPOF_array)
13364 {
13365 for (int i = 0; i < WPOF_array.Count(); i++)
13366 {
13367 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13368
13369 if (WPOF)
13370 {
13371 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13372 }
13373 }
13374 }
13375 }
13376
13377
13379 {
13380 int id = muzzle_owner.GetMuzzleID();
13382
13383 if (WPOBE_array)
13384 {
13385 for (int i = 0; i < WPOBE_array.Count(); i++)
13386 {
13387 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13388
13389 if (WPOBE)
13390 {
13391 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13392 }
13393 }
13394 }
13395 }
13396
13397
13399 {
13400 int id = muzzle_owner.GetMuzzleID();
13401 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13402
13403 if (WPOOH_array)
13404 {
13405 for (int i = 0; i < WPOOH_array.Count(); i++)
13406 {
13407 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13408
13409 if (WPOOH)
13410 {
13411 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13412 }
13413 }
13414 }
13415 }
13416
13417
13419 {
13420 int id = muzzle_owner.GetMuzzleID();
13421 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13422
13423 if (WPOOH_array)
13424 {
13425 for (int i = 0; i < WPOOH_array.Count(); i++)
13426 {
13427 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13428
13429 if (WPOOH)
13430 {
13431 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13432 }
13433 }
13434 }
13435 }
13436
13437
13439 {
13440 int id = muzzle_owner.GetMuzzleID();
13441 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13442
13443 if (WPOOH_array)
13444 {
13445 for (int i = 0; i < WPOOH_array.Count(); i++)
13446 {
13447 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13448
13449 if (WPOOH)
13450 {
13451 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13452 }
13453 }
13454 }
13455 }
13456
13457
13458
13460 {
13462 {
13463 return true;
13464 }
13465
13466 return false;
13467 }
13468
13470 {
13472 {
13473 return true;
13474 }
13475
13476 return false;
13477 }
13478
13480 {
13482 {
13483 return true;
13484 }
13485
13486 return false;
13487 }
13488
13490 {
13491 return false;
13492 }
13493
13496 {
13497 return UATimeSpent.DEFAULT_DEPLOY;
13498 }
13499
13500
13501
13502
13504 {
13506 SetSynchDirty();
13507 }
13508
13510 {
13512 }
13513
13514
13516 {
13517 return false;
13518 }
13519
13522 {
13523 string att_type = "None";
13524
13525 if (ConfigIsExisting("soundAttType"))
13526 {
13527 att_type = ConfigGetString("soundAttType");
13528 }
13529
13531 }
13532
13534 {
13536 }
13537
13538
13539
13540
13541
13547
13549 {
13552
13554 }
13555
13556
13558 {
13560 return;
13561
13563
13566
13569
13570 SoundParameters params = new SoundParameters();
13574 }
13575
13576
13578 {
13580 return;
13581
13583 SetSynchDirty();
13584
13587 }
13588
13589
13591 {
13593 return;
13594
13596 SetSynchDirty();
13597
13600 }
13601
13603 {
13605 }
13606
13608 {
13610 }
13611
13614 {
13615 if (!
GetGame().IsDedicatedServer())
13616 {
13617 if (ConfigIsExisting("attachSoundSet"))
13618 {
13619 string cfg_path = "";
13620 string soundset = "";
13621 string type_name =
GetType();
13622
13625 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13626 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13627
13628 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13629 {
13630 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13631 {
13632 if (cfg_slot_array[i] == slot_type)
13633 {
13634 soundset = cfg_soundset_array[i];
13635 break;
13636 }
13637 }
13638 }
13639
13640 if (soundset != "")
13641 {
13642 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13644 }
13645 }
13646 }
13647 }
13648
13650 {
13651
13652 }
13653
13654 void OnApply(PlayerBase player);
13655
13657 {
13658 return 1.0;
13659 };
13660
13662 {
13664 }
13665
13667 {
13669 }
13670
13672
13674 {
13675 SetDynamicPhysicsLifeTime(0.01);
13677 }
13678
13680 {
13681 array<string> zone_names = new array<string>;
13682 GetDamageZones(zone_names);
13683 for (int i = 0; i < zone_names.Count(); i++)
13684 {
13685 SetHealthMax(zone_names.Get(i),"Health");
13686 }
13687 SetHealthMax("","Health");
13688 }
13689
13692 {
13693 float global_health = GetHealth01("","Health");
13694 array<string> zones = new array<string>;
13695 GetDamageZones(zones);
13696
13697 for (int i = 0; i < zones.Count(); i++)
13698 {
13699 SetHealth01(zones.Get(i),"Health",global_health);
13700 }
13701 }
13702
13705 {
13706 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13707 }
13708
13710 {
13711 if (!hasRootAsPlayer)
13712 {
13713 if (refParentIB)
13714 {
13715
13716 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13717 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13718
13719 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13720 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13721
13724 }
13725 else
13726 {
13727
13730 }
13731 }
13732 }
13733
13735 {
13737 {
13738 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13739 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13740 {
13741 float heatPermCoef = 1.0;
13743 while (ent)
13744 {
13745 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13746 ent = ent.GetHierarchyParent();
13747 }
13748
13749 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13750 }
13751 }
13752 }
13753
13755 {
13756
13757 EntityAI parent = GetHierarchyParent();
13758 if (!parent)
13759 {
13760 hasParent = false;
13761 hasRootAsPlayer = false;
13762 }
13763 else
13764 {
13765 hasParent = true;
13766 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13767 refParentIB =
ItemBase.Cast(parent);
13768 }
13769 }
13770
13771 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13772 {
13773
13774 }
13775
13777 {
13778
13779 return false;
13780 }
13781
13783 {
13784
13785
13786 return false;
13787 }
13788
13790 {
13791
13792 return false;
13793 }
13794
13797 {
13798 return !GetIsFrozen() &&
IsOpen();
13799 }
13800
13802 {
13803 bool hasParent = false, hasRootAsPlayer = false;
13805
13806 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13807 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13808
13809 if (wwtu || foodDecay)
13810 {
13814
13815 if (processWetness || processTemperature || processDecay)
13816 {
13818
13819 if (processWetness)
13820 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13821
13822 if (processTemperature)
13824
13825 if (processDecay)
13826 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13827 }
13828 }
13829 }
13830
13833 {
13835 }
13836
13838 {
13841
13842 return super.GetTemperatureFreezeThreshold();
13843 }
13844
13846 {
13849
13850 return super.GetTemperatureThawThreshold();
13851 }
13852
13854 {
13857
13858 return super.GetItemOverheatThreshold();
13859 }
13860
13862 {
13864 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13865
13866 return super.GetTemperatureFreezeTime();
13867 }
13868
13870 {
13872 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13873
13874 return super.GetTemperatureThawTime();
13875 }
13876
13881
13883 {
13884 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13885 }
13886
13888 {
13889 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13890 }
13891
13894 {
13896 }
13897
13899 {
13901 }
13902
13904 {
13906 }
13907
13910 {
13911 return null;
13912 }
13913
13916 {
13917 return false;
13918 }
13919
13921 {
13923 {
13926 if (!trg)
13927 {
13929 explosive = this;
13930 }
13931
13932 explosive.PairRemote(trg);
13934
13935 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13936 trg.SetPersistentPairID(persistentID);
13937 explosive.SetPersistentPairID(persistentID);
13938
13939 return true;
13940 }
13941 return false;
13942 }
13943
13946 {
13947 float ret = 1.0;
13950 ret *= GetHealth01();
13951
13952 return ret;
13953 }
13954
13955 #ifdef DEVELOPER
13956 override void SetDebugItem()
13957 {
13958 super.SetDebugItem();
13959 _itemBase = this;
13960 }
13961
13963 {
13964 string text = super.GetDebugText();
13965
13967 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13968
13969 return text;
13970 }
13971 #endif
13972
13974 {
13975 return true;
13976 }
13977
13979
13981
13983 {
13986 }
13987
13988
13996
14012}
14013
14015{
14017 if (entity)
14018 {
14019 bool is_item = entity.IsInherited(
ItemBase);
14020 if (is_item && full_quantity)
14021 {
14024 }
14025 }
14026 else
14027 {
14029 return NULL;
14030 }
14031 return entity;
14032}
14033
14035{
14036 if (item)
14037 {
14038 if (health > 0)
14039 item.SetHealth("", "", health);
14040
14041 if (item.CanHaveTemperature())
14042 {
14044 if (item.CanFreeze())
14045 item.SetFrozen(false);
14046 }
14047
14048 if (item.HasEnergyManager())
14049 {
14050 if (quantity >= 0)
14051 {
14052 item.GetCompEM().SetEnergy0To1(quantity);
14053 }
14054 else
14055 {
14057 }
14058 }
14059 else if (item.IsMagazine())
14060 {
14061 Magazine mag = Magazine.Cast(item);
14062 if (quantity >= 0)
14063 {
14064 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14065 }
14066 else
14067 {
14069 }
14070
14071 }
14072 else
14073 {
14074 if (quantity >= 0)
14075 {
14076 item.SetQuantityNormalized(quantity, false);
14077 }
14078 else
14079 {
14081 }
14082
14083 }
14084 }
14085}
14086
14087#ifdef DEVELOPER
14089#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.