9200{
9202 {
9203 return true;
9204 }
9205};
9206
9207
9208
9210{
9214
9216
9219
9220
9221
9222
9223
9232
9238
9243
9248
9269 protected bool m_IsResultOfSplit
9270
9272
9277
9278
9279
9281
9285
9286
9287
9289
9292
9293
9294
9300
9301
9309
9312
9313
9315
9316
9318
9319
9324
9325
9330
9331
9333
9334
9336 {
9341
9342 if (!
GetGame().IsDedicatedServer())
9343 {
9345 {
9347
9349 {
9351 }
9352 }
9353
9356 }
9357
9358 m_OldLocation = null;
9359
9361 {
9363 }
9364
9365 if (ConfigIsExisting("headSelectionsToHide"))
9366 {
9369 }
9370
9372 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9373 {
9375 }
9376
9378
9379 m_IsResultOfSplit = false;
9380
9382 }
9383
9385 {
9386 super.InitItemVariables();
9387
9393 m_Count = ConfigGetInt(
"count");
9394
9397
9402
9405
9410
9422
9426
9427
9430 if (ConfigIsExisting("canBeSplit"))
9431 {
9434 }
9435
9437 if (ConfigIsExisting("itemBehaviour"))
9439
9440
9443 RegisterNetSyncVariableInt("m_VarLiquidType");
9444 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9445
9446 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9447 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9448 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9449
9450 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9451 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9452 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9453 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9454
9455 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9456 RegisterNetSyncVariableBool("m_IsTakeable");
9457 RegisterNetSyncVariableBool("m_IsHologram");
9458
9461 {
9464 }
9465
9467
9469 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9471
9472 }
9473
9475 {
9477 }
9478
9480 {
9483 {
9488 }
9489 }
9490
9491 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9492 {
9494 {
9497 }
9498
9500 }
9501
9503 {
9509 }
9510
9512
9514 {
9516
9517 if (!action)
9518 {
9519 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9520 return;
9521 }
9522
9524 if (!ai)
9525 {
9527 return;
9528 }
9529
9531 if (!action_array)
9532 {
9533 action_array = new array<ActionBase_Basic>;
9535 }
9536 if (LogManager.IsActionLogEnable())
9537 {
9538 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9539 }
9540
9541 if (action_array.Find(action) != -1)
9542 {
9543 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9544 }
9545 else
9546 {
9547 action_array.Insert(action);
9548 }
9549 }
9550
9552 {
9554 ActionBase action = player.GetActionManager().GetAction(actionName);
9557
9558 if (action_array)
9559 {
9560 action_array.RemoveItem(action);
9561 }
9562 }
9563
9564
9565
9567 {
9568 ActionOverrideData overrideData = new ActionOverrideData();
9572
9574 if (!actionMap)
9575 {
9578 }
9579
9580 actionMap.Insert(this.
Type(), overrideData);
9581
9582 }
9583
9585
9587
9588
9590 {
9593
9596
9597 string config_to_search = "CfgVehicles";
9598 string muzzle_owner_config;
9599
9601 {
9602 if (IsInherited(Weapon))
9603 config_to_search = "CfgWeapons";
9604
9605 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9606
9607 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9608
9610
9611 if (config_OnFire_subclass_count > 0)
9612 {
9613 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9614
9615 for (int i = 0; i < config_OnFire_subclass_count; i++)
9616 {
9617 string particle_class = "";
9619 string config_OnFire_entry = config_OnFire_class + particle_class;
9620 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9621 WPOF_array.Insert(WPOF);
9622 }
9623
9624
9626 }
9627 }
9628
9630 {
9631 config_to_search = "CfgWeapons";
9632 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9633
9634 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9635
9637
9638 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9639 {
9640 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9641
9642 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9643 {
9644 string particle_class2 = "";
9646 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9647 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9648 WPOBE_array.Insert(WPOBE);
9649 }
9650
9651
9653 }
9654 }
9655 }
9656
9657
9659 {
9662
9664 {
9665 string config_to_search = "CfgVehicles";
9666
9667 if (IsInherited(Weapon))
9668 config_to_search = "CfgWeapons";
9669
9670 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9671 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9672
9673 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9674 {
9675
9677
9679 {
9681 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9683 return;
9684 }
9685
9688
9689
9690
9692 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9693
9694 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9695 {
9696 string particle_class = "";
9698 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9700
9701 if (entry_type == CT_CLASS)
9702 {
9703 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9704 WPOOH_array.Insert(WPOF);
9705 }
9706 }
9707
9708
9710 }
9711 }
9712 }
9713
9715 {
9717 }
9718
9720 {
9722 {
9724
9727
9730
9731 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9732 }
9733 }
9734
9736 {
9738 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9739
9741 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9742
9744 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9745
9747 {
9749 }
9750 }
9751
9753 {
9755 }
9756
9758 {
9761 else
9763
9765 {
9768 }
9769 else
9770 {
9773
9776 }
9777
9779 }
9780
9782 {
9784 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9785 }
9786
9788 {
9790 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9792 }
9793
9795 {
9797 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9798 }
9799
9801 {
9804
9805 OverheatingParticle OP = new OverheatingParticle();
9810
9812 }
9813
9815 {
9818
9819 return -1;
9820 }
9821
9823 {
9825 {
9828
9829 for (int i = count; i > 0; --i)
9830 {
9831 int id = i - 1;
9834
9837
9838 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9839 {
9840 if (p)
9841 {
9844 }
9845 }
9846 }
9847 }
9848 }
9849
9851 {
9853 {
9855 {
9856 int id = i - 1;
9858
9859 if (OP)
9860 {
9862
9863 if (p)
9864 {
9866 }
9867
9868 delete OP;
9869 }
9870 }
9871
9874 }
9875 }
9876
9879 {
9880 return 0.0;
9881 }
9882
9883
9885 {
9886 return 250;
9887 }
9888
9890 {
9891 return 0;
9892 }
9893
9896 {
9898 return true;
9899
9900 return false;
9901 }
9902
9905 {
9908
9910 {
9912 }
9913 else
9914 {
9915
9917 }
9918
9920 }
9921
9928 {
9929 return -1;
9930 }
9931
9932
9933
9934
9936 {
9938 {
9940 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9941
9942 if (r_index >= 0)
9943 {
9944 InventoryLocation r_il = new InventoryLocation;
9945 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9946
9947 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9950 {
9951 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9952 }
9954 {
9955 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9956 }
9957
9958 }
9959
9960 player.GetHumanInventory().ClearUserReservedLocation(this);
9961 }
9962
9965 }
9966
9967
9968
9969
9971 {
9972 return ItemBase.m_DebugActionsMask;
9973 }
9974
9976 {
9977 return ItemBase.m_DebugActionsMask & mask;
9978 }
9979
9981 {
9982 ItemBase.m_DebugActionsMask = mask;
9983 }
9984
9986 {
9987 ItemBase.m_DebugActionsMask |= mask;
9988 }
9989
9991 {
9992 ItemBase.m_DebugActionsMask &= ~mask;
9993 }
9994
9996 {
9998 {
10000 }
10001 else
10002 {
10004 }
10005 }
10006
10007
10009 {
10010 if (GetEconomyProfile())
10011 {
10012 float q_max = GetEconomyProfile().GetQuantityMax();
10013 if (q_max > 0)
10014 {
10015 float q_min = GetEconomyProfile().GetQuantityMin();
10016 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
10017
10019 {
10020 ComponentEnergyManager comp = GetCompEM();
10022 {
10024 }
10025 }
10027 {
10029
10030 }
10031
10032 }
10033 }
10034 }
10035
10038 {
10039 EntityAI parent = GetHierarchyParent();
10040
10041 if (parent)
10042 {
10043 InventoryLocation inventory_location_to_lock = new InventoryLocation;
10044 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
10045 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
10046 }
10047 }
10048
10051 {
10052 EntityAI parent = GetHierarchyParent();
10053
10054 if (parent)
10055 {
10056 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10057 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10058 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10059 }
10060 }
10061
10063 {
10064
10065
10066
10067
10069
10071 {
10072 if (ScriptInputUserData.CanStoreInputUserData())
10073 {
10074 ScriptInputUserData ctx = new ScriptInputUserData;
10080 ctx.
Write(use_stack_max);
10083
10085 {
10086 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10087 }
10088 }
10089 }
10090 else if (!
GetGame().IsMultiplayer())
10091 {
10093 }
10094 }
10095
10097 {
10099 }
10100
10102 {
10104 }
10105
10107 {
10109 }
10110
10112 {
10113
10114 return false;
10115 }
10116
10118 {
10119 return false;
10120 }
10121
10125 {
10126 return false;
10127 }
10128
10130 {
10131 return "";
10132 }
10133
10135
10137 {
10138 return false;
10139 }
10140
10142 {
10143 return true;
10144 }
10145
10146
10147
10149 {
10150 return true;
10151 }
10152
10154 {
10155 return true;
10156 }
10157
10159 {
10160 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10162 }
10163
10165 {
10167 }
10168
10170 {
10172 if (!is_being_placed)
10174 SetSynchDirty();
10175 }
10176
10177
10179
10181 {
10183 }
10184
10186 {
10188 }
10189
10191 {
10192 return 1;
10193 }
10194
10196 {
10197 return false;
10198 }
10199
10201 {
10203 SetSynchDirty();
10204 }
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10241 {
10242 super.OnMovedInsideCargo(container);
10243
10244 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10245 }
10246
10247 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10248 {
10249 super.EEItemLocationChanged(oldLoc,newLoc);
10250
10251 PlayerBase new_player = null;
10252 PlayerBase old_player = null;
10253
10254 if (newLoc.GetParent())
10255 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10256
10257 if (oldLoc.GetParent())
10258 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10259
10261 {
10262 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10263
10264 if (r_index >= 0)
10265 {
10266 InventoryLocation r_il = new InventoryLocation;
10267 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10268
10269 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10272 {
10273 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10274 }
10276 {
10277 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10278 }
10279
10280 }
10281 }
10282
10284 {
10285 if (new_player)
10286 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10287
10288 if (new_player == old_player)
10289 {
10290
10291 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10292 {
10294 {
10295 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10296 {
10297 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10298 }
10299 }
10300 else
10301 {
10302 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10303 }
10304 }
10305
10306 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10307 {
10308 int type = oldLoc.GetType();
10310 {
10311 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10312 }
10314 {
10315 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10316 }
10317 }
10318 if (!m_OldLocation)
10319 {
10320 m_OldLocation = new InventoryLocation;
10321 }
10322 m_OldLocation.Copy(oldLoc);
10323 }
10324 else
10325 {
10326 if (m_OldLocation)
10327 {
10328 m_OldLocation.Reset();
10329 }
10330 }
10331
10333 }
10334 else
10335 {
10336 if (new_player)
10337 {
10338 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10339 if (res_index >= 0)
10340 {
10341 InventoryLocation il = new InventoryLocation;
10342 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10344 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10347 {
10348 il.
GetParent().GetOnReleaseLock().Invoke(it);
10349 }
10351 {
10353 }
10354
10355 }
10356 }
10358 {
10359
10361 }
10362
10363 if (m_OldLocation)
10364 {
10365 m_OldLocation.Reset();
10366 }
10367 }
10368 }
10369
10370 override void EOnContact(IEntity other, Contact extra)
10371 {
10373 {
10374 int liquidType = -1;
10376 if (impactSpeed > 0.0)
10377 {
10379 #ifndef SERVER
10381 #else
10383 SetSynchDirty();
10384 #endif
10386 }
10387 }
10388
10389 #ifdef SERVER
10390 if (GetCompEM() && GetCompEM().IsPlugged())
10391 {
10392 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10393 GetCompEM().UnplugThis();
10394 }
10395 #endif
10396 }
10397
10399
10401 {
10403 }
10404
10406 {
10407
10408 }
10409
10411 {
10412 super.OnItemLocationChanged(old_owner, new_owner);
10413
10414 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10415 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10416
10417 if (!relatedPlayer && playerNew)
10418 relatedPlayer = playerNew;
10419
10420 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10421 {
10423 if (actionMgr)
10424 {
10425 ActionBase currentAction = actionMgr.GetRunningAction();
10426 if (currentAction)
10428 }
10429 }
10430
10431 Man ownerPlayerOld = null;
10432 Man ownerPlayerNew = null;
10433
10434 if (old_owner)
10435 {
10436 if (old_owner.
IsMan())
10437 {
10438 ownerPlayerOld = Man.Cast(old_owner);
10439 }
10440 else
10441 {
10442 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10443 }
10444 }
10445 else
10446 {
10448 {
10450
10451 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10452 {
10453 GetCompEM().UnplugThis();
10454 }
10455 }
10456 }
10457
10458 if (new_owner)
10459 {
10460 if (new_owner.
IsMan())
10461 {
10462 ownerPlayerNew = Man.Cast(new_owner);
10463 }
10464 else
10465 {
10466 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10467 }
10468 }
10469
10470 if (ownerPlayerOld != ownerPlayerNew)
10471 {
10472 if (ownerPlayerOld)
10473 {
10474 array<EntityAI> subItemsExit = new array<EntityAI>;
10476 for (int i = 0; i < subItemsExit.Count(); i++)
10477 {
10480 }
10481 }
10482
10483 if (ownerPlayerNew)
10484 {
10485 array<EntityAI> subItemsEnter = new array<EntityAI>;
10487 for (int j = 0; j < subItemsEnter.Count(); j++)
10488 {
10491 }
10492 }
10493 }
10494 else if (ownerPlayerNew != null)
10495 {
10496 PlayerBase nplayer;
10497 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10498 {
10499 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10501 for (int k = 0; k < subItemsUpdate.Count(); k++)
10502 {
10504 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10505 }
10506 }
10507 }
10508
10509 if (old_owner)
10510 old_owner.OnChildItemRemoved(this);
10511 if (new_owner)
10512 new_owner.OnChildItemReceived(this);
10513 }
10514
10515
10517 {
10518 super.EEDelete(parent);
10519 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10520 if (player)
10521 {
10523
10524 if (player.IsAlive())
10525 {
10526 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10527 if (r_index >= 0)
10528 {
10529 InventoryLocation r_il = new InventoryLocation;
10530 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10531
10532 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10535 {
10536 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10537 }
10539 {
10540 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10541 }
10542
10543 }
10544
10545 player.RemoveQuickBarEntityShortcut(this);
10546 }
10547 }
10548 }
10549
10551 {
10552 super.EEKilled(killer);
10553
10556 {
10557 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10558 {
10559 if (IsMagazine())
10560 {
10561 if (Magazine.Cast(this).GetAmmoCount() > 0)
10562 {
10564 }
10565 }
10566 else
10567 {
10569 }
10570 }
10571 }
10572 }
10573
10575 {
10576 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10577
10578 super.OnWasAttached(parent, slot_id);
10579
10582
10584 }
10585
10587 {
10588 super.OnWasDetached(parent, slot_id);
10589
10592 }
10593
10595 {
10596 int idx;
10599
10600 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10601 if (inventory_slots.Count() < 1)
10602 {
10603 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10604 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10605 }
10606 else
10607 {
10608 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10609 }
10610
10611 idx = inventory_slots.Find(slot);
10612 if (idx < 0)
10613 return "";
10614
10615 return attach_types.Get(idx);
10616 }
10617
10619 {
10620 int idx = -1;
10621 string slot;
10622
10625
10626 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10627 if (inventory_slots.Count() < 1)
10628 {
10629 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10630 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10631 }
10632 else
10633 {
10634 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10635 if (detach_types.Count() < 1)
10636 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10637 }
10638
10639 for (int i = 0; i < inventory_slots.Count(); i++)
10640 {
10641 slot = inventory_slots.Get(i);
10642 }
10643
10644 if (slot != "")
10645 {
10646 if (detach_types.Count() == 1)
10647 idx = 0;
10648 else
10649 idx = inventory_slots.Find(slot);
10650 }
10651 if (idx < 0)
10652 return "";
10653
10654 return detach_types.Get(idx);
10655 }
10656
10658 {
10659
10661
10662
10663 float min_time = 1;
10664 float max_time = 3;
10665 float delay = Math.RandomFloat(min_time, max_time);
10666
10667 explode_timer.Run(delay, this, "DoAmmoExplosion");
10668 }
10669
10671 {
10672 Magazine magazine = Magazine.Cast(this);
10673 int pop_sounds_count = 6;
10674 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10675
10676
10677 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10678 string sound_name = pop_sounds[ sound_idx ];
10680
10681
10682 magazine.ServerAddAmmoCount(-1);
10683
10684
10685 float min_temp_to_explode = 100;
10686
10687 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10688 {
10690 }
10691 }
10692
10693
10694 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10695 {
10696 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10697
10698 const int CHANCE_DAMAGE_CARGO = 4;
10699 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10700 const int CHANCE_DAMAGE_NOTHING = 2;
10701
10703 {
10704 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10705 int chances;
10706 int rnd;
10707
10708 if (GetInventory().GetCargo())
10709 {
10710 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10711 rnd = Math.RandomInt(0,chances);
10712
10713 if (rnd < CHANCE_DAMAGE_CARGO)
10714 {
10716 }
10717 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10718 {
10720 }
10721 }
10722 else
10723 {
10724 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10725 rnd = Math.RandomInt(0,chances);
10726
10727 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10728 {
10730 }
10731 }
10732 }
10733 }
10734
10736 {
10737 if (GetInventory().GetCargo())
10738 {
10739 int item_count = GetInventory().GetCargo().GetItemCount();
10740 if (item_count > 0)
10741 {
10742 int random_pick = Math.RandomInt(0, item_count);
10744 if (!item.IsExplosive())
10745 {
10746 item.AddHealth("","",damage);
10747 return true;
10748 }
10749 }
10750 }
10751 return false;
10752 }
10753
10755 {
10756 int attachment_count = GetInventory().AttachmentCount();
10757 if (attachment_count > 0)
10758 {
10759 int random_pick = Math.RandomInt(0, attachment_count);
10760 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10761 if (!attachment.IsExplosive())
10762 {
10763 attachment.AddHealth("","",damage);
10764 return true;
10765 }
10766 }
10767 return false;
10768 }
10769
10771 {
10773 }
10774
10776 {
10778 return GetInventory().CanRemoveEntity();
10779
10780 return false;
10781 }
10782
10784 {
10785
10787 return false;
10788
10789
10791 return false;
10792
10793
10794
10796 if (delta == 0)
10797 return false;
10798
10799
10800 return true;
10801 }
10802
10804 {
10806 {
10807 if (ScriptInputUserData.CanStoreInputUserData())
10808 {
10809 ScriptInputUserData ctx = new ScriptInputUserData;
10814 ctx.
Write(destination_entity);
10816 ctx.
Write(slot_id);
10818 }
10819 }
10820 else if (!
GetGame().IsMultiplayer())
10821 {
10823 }
10824 }
10825
10827 {
10828 float split_quantity_new;
10832 InventoryLocation loc = new InventoryLocation;
10833
10834 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10835 {
10837 split_quantity_new = stack_max;
10838 else
10840
10842 {
10843 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10844 if (new_item)
10845 {
10846 new_item.SetResultOfSplit(true);
10847 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10849 new_item.
SetQuantity(split_quantity_new,
false,
true);
10850 }
10851 }
10852 }
10853 else if (destination_entity && slot_id == -1)
10854 {
10855 if (quantity > stack_max)
10856 split_quantity_new = stack_max;
10857 else
10858 split_quantity_new = quantity;
10859
10861 {
10863 {
10866 }
10867
10868 if (new_item)
10869 {
10870 new_item.SetResultOfSplit(true);
10871 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10873 new_item.
SetQuantity(split_quantity_new,
false,
true);
10874 }
10875 }
10876 }
10877 else
10878 {
10879 if (stack_max != 0)
10880 {
10882 {
10884 }
10885
10886 if (split_quantity_new == 0)
10887 {
10888 if (!
GetGame().IsMultiplayer())
10889 player.PhysicalPredictiveDropItem(this);
10890 else
10891 player.ServerDropEntity(this);
10892 return;
10893 }
10894
10896 {
10898
10899 if (new_item)
10900 {
10901 new_item.SetResultOfSplit(true);
10902 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10905 new_item.PlaceOnSurface();
10906 }
10907 }
10908 }
10909 }
10910 }
10911
10913 {
10914 float split_quantity_new;
10918 InventoryLocation loc = new InventoryLocation;
10919
10920 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10921 {
10923 split_quantity_new = stack_max;
10924 else
10926
10928 {
10929 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10930 if (new_item)
10931 {
10932 new_item.SetResultOfSplit(true);
10933 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10935 new_item.
SetQuantity(split_quantity_new,
false,
true);
10936 }
10937 }
10938 }
10939 else if (destination_entity && slot_id == -1)
10940 {
10941 if (quantity > stack_max)
10942 split_quantity_new = stack_max;
10943 else
10944 split_quantity_new = quantity;
10945
10947 {
10949 {
10952 }
10953
10954 if (new_item)
10955 {
10956 new_item.SetResultOfSplit(true);
10957 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10959 new_item.
SetQuantity(split_quantity_new,
false,
true);
10960 }
10961 }
10962 }
10963 else
10964 {
10965 if (stack_max != 0)
10966 {
10968 {
10970 }
10971
10973 {
10975
10976 if (new_item)
10977 {
10978 new_item.SetResultOfSplit(true);
10979 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10982 new_item.PlaceOnSurface();
10983 }
10984 }
10985 }
10986 }
10987 }
10988
10990 {
10992 {
10993 if (ScriptInputUserData.CanStoreInputUserData())
10994 {
10995 ScriptInputUserData ctx = new ScriptInputUserData;
11000 dst.WriteToContext(ctx);
11002 }
11003 }
11004 else if (!
GetGame().IsMultiplayer())
11005 {
11007 }
11008 }
11009
11011 {
11013 {
11014 if (ScriptInputUserData.CanStoreInputUserData())
11015 {
11016 ScriptInputUserData ctx = new ScriptInputUserData;
11021 ctx.
Write(destination_entity);
11027 }
11028 }
11029 else if (!
GetGame().IsMultiplayer())
11030 {
11032 }
11033 }
11034
11036 {
11038 }
11039
11041 {
11043 float split_quantity_new;
11045 if (dst.IsValid())
11046 {
11047 int slot_id = dst.GetSlot();
11049
11050 if (quantity > stack_max)
11051 split_quantity_new = stack_max;
11052 else
11053 split_quantity_new = quantity;
11054
11056 {
11058
11059 if (new_item)
11060 {
11061 new_item.SetResultOfSplit(true);
11062 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11064 new_item.
SetQuantity(split_quantity_new,
false,
true);
11065 }
11066
11067 return new_item;
11068 }
11069 }
11070
11071 return null;
11072 }
11073
11075 {
11077 float split_quantity_new;
11079 if (destination_entity)
11080 {
11082 if (quantity > stackable)
11083 split_quantity_new = stackable;
11084 else
11085 split_quantity_new = quantity;
11086
11088 {
11089 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11090 if (new_item)
11091 {
11092 new_item.SetResultOfSplit(true);
11093 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11095 new_item.
SetQuantity(split_quantity_new,
false,
true);
11096 }
11097 }
11098 }
11099 }
11100
11102 {
11104 {
11105 if (ScriptInputUserData.CanStoreInputUserData())
11106 {
11107 ScriptInputUserData ctx = new ScriptInputUserData;
11112 ItemBase destination_entity =
this;
11113 ctx.
Write(destination_entity);
11117 }
11118 }
11119 else if (!
GetGame().IsMultiplayer())
11120 {
11122 }
11123 }
11124
11126 {
11128 float split_quantity_new;
11130 if (player)
11131 {
11133 if (quantity > stackable)
11134 split_quantity_new = stackable;
11135 else
11136 split_quantity_new = quantity;
11137
11139 {
11140 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11141 new_item =
ItemBase.Cast(in_hands);
11142 if (new_item)
11143 {
11144 new_item.SetResultOfSplit(true);
11145 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11147 new_item.SetQuantity(split_quantity_new, false, true);
11148 }
11149 }
11150 }
11151 }
11152
11154 {
11156 float split_quantity_new = Math.Floor(quantity * 0.5);
11157
11159 return;
11160
11162
11163 if (new_item)
11164 {
11165 if (new_item.GetQuantityMax() < split_quantity_new)
11166 {
11167 split_quantity_new = new_item.GetQuantityMax();
11168 }
11169
11170 new_item.SetResultOfSplit(true);
11171 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11172
11174 {
11177 }
11178 else
11179 {
11181 new_item.
SetQuantity(split_quantity_new,
false,
true);
11182 }
11183 }
11184 }
11185
11187 {
11189 float split_quantity_new = Math.Floor(quantity / 2);
11190
11192 return;
11193
11194 InventoryLocation invloc = new InventoryLocation;
11196
11198 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11199
11200 if (new_item)
11201 {
11202 if (new_item.GetQuantityMax() < split_quantity_new)
11203 {
11204 split_quantity_new = new_item.GetQuantityMax();
11205 }
11207 {
11210 }
11211 else if (split_quantity_new > 1)
11212 {
11214 new_item.
SetQuantity(split_quantity_new,
false,
true);
11215 }
11216 }
11217 }
11218
11221 {
11222 SetWeightDirty();
11224
11225 if (parent)
11226 parent.OnAttachmentQuantityChangedEx(this, delta);
11227
11229 {
11231 {
11233 }
11235 {
11236 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11238 }
11239 }
11240
11241 }
11242
11245 {
11246
11247 }
11248
11251 {
11253 }
11254
11256 {
11257 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11258
11260 {
11261 if (newLevel == GameConstants.STATE_RUINED)
11262 {
11264 EntityAI parent = GetHierarchyParent();
11265 if (parent && parent.IsFireplace())
11266 {
11267 CargoBase cargo = GetInventory().GetCargo();
11268 if (cargo)
11269 {
11271 {
11273 }
11274 }
11275 }
11276 }
11277
11279 {
11280
11282 return;
11283 }
11284
11285 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11286 {
11288 }
11289 }
11290 }
11291
11292
11294 {
11295 super.OnRightClick();
11296
11298 {
11300 {
11301 if (ScriptInputUserData.CanStoreInputUserData())
11302 {
11303 EntityAI root = GetHierarchyRoot();
11304 Man playerOwner = GetHierarchyRootPlayer();
11305 InventoryLocation dst = new InventoryLocation;
11306
11307
11308 if (!playerOwner && root && root == this)
11309 {
11311 }
11312 else
11313 {
11314
11315 GetInventory().GetCurrentInventoryLocation(dst);
11317 {
11320 {
11322 }
11323 else
11324 {
11326
11327
11328 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11329 {
11331 }
11332 else
11333 {
11334 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11335 }
11336 }
11337 }
11338 }
11339
11340 ScriptInputUserData ctx = new ScriptInputUserData;
11348 }
11349 }
11350 else if (!
GetGame().IsMultiplayer())
11351 {
11353 }
11354 }
11355 }
11356
11358 {
11359 if (root)
11360 {
11361 vector m4[4];
11362 root.GetTransform(m4);
11363 dst.SetGround(this, m4);
11364 }
11365 else
11366 {
11367 GetInventory().GetCurrentInventoryLocation(dst);
11368 }
11369 }
11370
11371 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11372 {
11373
11374 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11375 return false;
11376
11377 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11378 return false;
11379
11380
11382 return false;
11383
11384
11385 Magazine mag = Magazine.Cast(this);
11386 if (mag)
11387 {
11388 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11389 return false;
11390
11391 if (stack_max_limit)
11392 {
11393 Magazine other_mag = Magazine.Cast(other_item);
11394 if (other_item)
11395 {
11396 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11397 return false;
11398 }
11399
11400 }
11401 }
11402 else
11403 {
11404
11406 return false;
11407
11409 return false;
11410 }
11411
11412 PlayerBase player = null;
11413 if (CastTo(player, GetHierarchyRootPlayer()))
11414 {
11415 if (player.GetInventory().HasAttachment(this))
11416 return false;
11417
11418 if (player.IsItemsToDelete())
11419 return false;
11420 }
11421
11422 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11423 return false;
11424
11425 int slotID;
11427 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11428 return false;
11429
11430 return true;
11431 }
11432
11434 {
11436 }
11437
11439 {
11440 return m_IsResultOfSplit;
11441 }
11442
11444 {
11445 m_IsResultOfSplit = value;
11446 }
11447
11449 {
11451 }
11452
11454 {
11455 float other_item_quantity = other_item.GetQuantity();
11456 float this_free_space;
11457
11459
11461
11462 if (other_item_quantity > this_free_space)
11463 {
11464 return this_free_space;
11465 }
11466 else
11467 {
11468 return other_item_quantity;
11469 }
11470 }
11471
11473 {
11475 }
11476
11478 {
11480 return;
11481
11482 if (!IsMagazine() && other_item)
11483 {
11485 if (quantity_used != 0)
11486 {
11487 float hp1 = GetHealth01("","");
11488 float hp2 = other_item.GetHealth01("","");
11489 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11490 hpResult = hpResult / (
GetQuantity() + quantity_used);
11491
11492 hpResult *= GetMaxHealth();
11493 Math.Round(hpResult);
11494 SetHealth("", "Health", hpResult);
11495
11497 other_item.AddQuantity(-quantity_used);
11498 }
11499 }
11501 }
11502
11504 {
11505 #ifdef SERVER
11506 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11507 GetHierarchyParent().IncreaseLifetimeUp();
11508 #endif
11509 };
11510
11512 {
11513 PlayerBase p = PlayerBase.Cast(player);
11514
11515 array<int> recipesIds = p.m_Recipes;
11516 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11517 if (moduleRecipesManager)
11518 {
11519 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11520 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11521 }
11522
11523 for (int i = 0;i < recipesIds.Count(); i++)
11524 {
11525 int key = recipesIds.Get(i);
11526 string recipeName = moduleRecipesManager.GetRecipeName(key);
11528 }
11529 }
11530
11531
11532 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11533 {
11534 super.GetDebugActions(outputList);
11535
11536
11542
11543
11548
11553
11554
11558
11559
11561 {
11565 }
11566
11569
11570
11574
11576
11577 InventoryLocation loc = new InventoryLocation();
11578 GetInventory().GetCurrentInventoryLocation(loc);
11580 {
11581 if (Gizmo_IsSupported())
11584 }
11585
11587 }
11588
11589
11590
11591
11593 {
11594 super.OnAction(action_id, player, ctx);
11595
11597 {
11598 switch (action_id)
11599 {
11602 return true;
11605 return true;
11606 }
11607 }
11608
11610 {
11611 switch (action_id)
11612 {
11614 Delete();
11615 return true;
11616 }
11617 }
11618
11619 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11620 {
11621 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11622 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11623 PlayerBase p = PlayerBase.Cast(player);
11624 if (
EActions.RECIPES_RANGE_START < 1000)
11625 {
11626 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11627 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11628 }
11629 }
11630 #ifndef SERVER
11631 else if (action_id ==
EActions.WATCH_PLAYER)
11632 {
11633 PluginDeveloper.SetDeveloperItemClientEx(player);
11634 }
11635 #endif
11637 {
11638 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11639 {
11640 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11641 OnDebugButtonPressServer(id + 1);
11642 }
11643
11644 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11645 {
11646 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11648 }
11649
11650 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11651 {
11652 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11654 }
11655
11656 else if (action_id ==
EActions.ADD_QUANTITY)
11657 {
11658 if (IsMagazine())
11659 {
11660 Magazine mag = Magazine.Cast(this);
11661 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11662 }
11663 else
11664 {
11666 }
11667
11668 if (m_EM)
11669 {
11670 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11671 }
11672
11673 }
11674
11675 else if (action_id ==
EActions.REMOVE_QUANTITY)
11676 {
11677 if (IsMagazine())
11678 {
11679 Magazine mag2 = Magazine.Cast(this);
11680 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11681 }
11682 else
11683 {
11685 }
11686 if (m_EM)
11687 {
11688 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11689 }
11690
11691 }
11692
11693 else if (action_id ==
EActions.SET_QUANTITY_0)
11694 {
11696
11697 if (m_EM)
11698 {
11699 m_EM.SetEnergy(0);
11700 }
11701 }
11702
11703 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11704 {
11706
11707 if (m_EM)
11708 {
11709 m_EM.SetEnergy(m_EM.GetEnergyMax());
11710 }
11711 }
11712
11713 else if (action_id ==
EActions.ADD_HEALTH)
11714 {
11715 AddHealth("","",GetMaxHealth("","Health")/5);
11716 }
11717 else if (action_id ==
EActions.REMOVE_HEALTH)
11718 {
11719 AddHealth("","",-GetMaxHealth("","Health")/5);
11720 }
11721 else if (action_id ==
EActions.DESTROY_HEALTH)
11722 {
11723 SetHealth01("","",0);
11724 }
11725 else if (action_id ==
EActions.WATCH_ITEM)
11726 {
11728 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11729 #ifdef DEVELOPER
11730 SetDebugDeveloper_item(this);
11731 #endif
11732 }
11733
11734 else if (action_id ==
EActions.ADD_TEMPERATURE)
11735 {
11736 AddTemperature(20);
11737
11738 }
11739
11740 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11741 {
11742 AddTemperature(-20);
11743
11744 }
11745
11746 else if (action_id ==
EActions.FLIP_FROZEN)
11747 {
11748 SetFrozen(!GetIsFrozen());
11749
11750 }
11751
11752 else if (action_id ==
EActions.ADD_WETNESS)
11753 {
11755
11756 }
11757
11758 else if (action_id ==
EActions.REMOVE_WETNESS)
11759 {
11761
11762 }
11763
11764 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11765 {
11768
11769
11770 }
11771
11772 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11773 {
11776 }
11777
11778 else if (action_id ==
EActions.MAKE_SPECIAL)
11779 {
11780 auto debugParams = DebugSpawnParams.WithPlayer(player);
11781 OnDebugSpawnEx(debugParams);
11782 }
11783
11784 }
11785
11786
11787 return false;
11788 }
11789
11790
11791
11792
11796
11799
11800
11801
11803 {
11804 return false;
11805 }
11806
11807
11809 {
11810 return true;
11811 }
11812
11813
11815 {
11816 return true;
11817 }
11818
11819
11820
11822 {
11823 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11825 }
11826
11829 {
11830 return null;
11831 }
11832
11834 {
11835 return false;
11836 }
11837
11839 {
11840 return false;
11841 }
11842
11846
11847
11849 {
11850 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11851 return module_repairing.CanRepair(this, item_repair_kit);
11852 }
11853
11854
11855 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11856 {
11857 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11858 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11859 }
11860
11861
11863 {
11864
11865
11866
11867
11868
11869
11870
11871
11872 return 1;
11873 }
11874
11875
11876
11878 {
11880 }
11881
11882
11883
11885 {
11887 }
11888
11889
11898 {
11899 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11900
11901 if (player)
11902 {
11903 player.MessageStatus(text);
11904 }
11905 }
11906
11907
11916 {
11917 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11918
11919 if (player)
11920 {
11921 player.MessageAction(text);
11922 }
11923 }
11924
11925
11934 {
11935 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11936
11937 if (player)
11938 {
11939 player.MessageFriendly(text);
11940 }
11941 }
11942
11943
11952 {
11953 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11954
11955 if (player)
11956 {
11957 player.MessageImportant(text);
11958 }
11959 }
11960
11962 {
11963 return true;
11964 }
11965
11966
11967 override bool KindOf(
string tag)
11968 {
11969 bool found = false;
11970 string item_name = this.
GetType();
11973
11974 int array_size = item_tag_array.Count();
11975 for (int i = 0; i < array_size; i++)
11976 {
11977 if (item_tag_array.Get(i) == tag)
11978 {
11979 found = true;
11980 break;
11981 }
11982 }
11983 return found;
11984 }
11985
11986
11988 {
11989
11990 super.OnRPC(sender, rpc_type,ctx);
11991
11992
11993 switch (rpc_type)
11994 {
11995 #ifndef SERVER
11996 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11997 Param2<bool, string> p = new Param2<bool, string>(false, "");
11998
12000 return;
12001
12002 bool play = p.param1;
12003 string soundSet = p.param2;
12004
12005 if (play)
12006 {
12008 {
12010 {
12012 }
12013 }
12014 else
12015 {
12017 }
12018 }
12019 else
12020 {
12022 }
12023
12024 break;
12025 #endif
12026
12027 }
12028
12030 {
12032 }
12033 }
12034
12035
12036
12037
12039 {
12040 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12041 return plugin.GetID(
name);
12042 }
12043
12045 {
12046 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
12047 return plugin.GetName(id);
12048 }
12049
12052 {
12053
12054
12055 int varFlags;
12056 if (!ctx.
Read(varFlags))
12057 return;
12058
12059 if (varFlags & ItemVariableFlags.FLOAT)
12060 {
12062 }
12063 }
12064
12066 {
12067
12068 super.SerializeNumericalVars(floats_out);
12069
12070
12071
12073 {
12075 }
12076
12078 {
12080 }
12081
12083 {
12085 }
12086
12088 {
12093 }
12094
12096 {
12098 }
12099 }
12100
12102 {
12103
12104 super.DeSerializeNumericalVars(floats);
12105
12106
12107 int index = 0;
12108 int mask = Math.Round(floats.Get(index));
12109
12110 index++;
12111
12113 {
12115 {
12117 }
12118 else
12119 {
12120 float quantity = floats.Get(index);
12121 SetQuantity(quantity,
true,
false,
false,
false);
12122 }
12123 index++;
12124 }
12125
12127 {
12128 float wet = floats.Get(index);
12130 index++;
12131 }
12132
12134 {
12135 int liquidtype = Math.Round(floats.Get(index));
12137 index++;
12138 }
12139
12141 {
12143 index++;
12145 index++;
12147 index++;
12149 index++;
12150 }
12151
12153 {
12154 int cleanness = Math.Round(floats.Get(index));
12156 index++;
12157 }
12158 }
12159
12161 {
12162 super.WriteVarsToCTX(ctx);
12163
12164
12166 {
12168 }
12169
12171 {
12173 }
12174
12176 {
12178 }
12179
12181 {
12182 int r,g,b,a;
12188 }
12189
12191 {
12193 }
12194 }
12195
12197 {
12198 if (!super.ReadVarsFromCTX(ctx,version))
12199 return false;
12200
12201 int intValue;
12202 float value;
12203
12204 if (version < 140)
12205 {
12206 if (!ctx.
Read(intValue))
12207 return false;
12208
12209 m_VariablesMask = intValue;
12210 }
12211
12213 {
12214 if (!ctx.
Read(value))
12215 return false;
12216
12218 {
12220 }
12221 else
12222 {
12224 }
12225 }
12226
12227 if (version < 140)
12228 {
12230 {
12231 if (!ctx.
Read(value))
12232 return false;
12233 SetTemperatureDirect(value);
12234 }
12235 }
12236
12238 {
12239 if (!ctx.
Read(value))
12240 return false;
12242 }
12243
12245 {
12246 if (!ctx.
Read(intValue))
12247 return false;
12249 }
12250
12252 {
12253 int r,g,b,a;
12255 return false;
12257 return false;
12259 return false;
12261 return false;
12262
12264 }
12265
12267 {
12268 if (!ctx.
Read(intValue))
12269 return false;
12271 }
12272
12273 if (version >= 138 && version < 140)
12274 {
12276 {
12277 if (!ctx.
Read(intValue))
12278 return false;
12279 SetFrozen(intValue);
12280 }
12281 }
12282
12283 return true;
12284 }
12285
12286
12288 {
12291 {
12293 }
12294
12295 if (!super.OnStoreLoad(ctx, version))
12296 {
12298 return false;
12299 }
12300
12301 if (version >= 114)
12302 {
12303 bool hasQuickBarIndexSaved;
12304
12305 if (!ctx.
Read(hasQuickBarIndexSaved))
12306 {
12308 return false;
12309 }
12310
12311 if (hasQuickBarIndexSaved)
12312 {
12313 int itmQBIndex;
12314
12315
12316 if (!ctx.
Read(itmQBIndex))
12317 {
12319 return false;
12320 }
12321
12322 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12323 if (itmQBIndex != -1 && parentPlayer)
12324 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12325 }
12326 }
12327 else
12328 {
12329
12330 PlayerBase player;
12331 int itemQBIndex;
12332 if (version ==
int.
MAX)
12333 {
12334 if (!ctx.
Read(itemQBIndex))
12335 {
12337 return false;
12338 }
12339 }
12340 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12341 {
12342
12343 if (!ctx.
Read(itemQBIndex))
12344 {
12346 return false;
12347 }
12348 if (itemQBIndex != -1 && player)
12349 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12350 }
12351 }
12352
12353 if (version < 140)
12354 {
12355
12356 if (!LoadVariables(ctx, version))
12357 {
12359 return false;
12360 }
12361 }
12362
12363
12365 {
12367 return false;
12368 }
12369 if (version >= 132)
12370 {
12372 if (raib)
12373 {
12375 {
12377 return false;
12378 }
12379 }
12380 }
12381
12383 return true;
12384 }
12385
12386
12387
12389 {
12390 super.OnStoreSave(ctx);
12391
12392 PlayerBase player;
12393 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12394 {
12396
12397 int itemQBIndex = -1;
12398 itemQBIndex = player.FindQuickBarEntityIndex(this);
12399 ctx.
Write(itemQBIndex);
12400 }
12401 else
12402 {
12404 }
12405
12407
12409 if (raib)
12410 {
12412 }
12413 }
12414
12415
12417 {
12418 super.AfterStoreLoad();
12419
12421 {
12423 }
12424
12426 {
12429 }
12430 }
12431
12433 {
12434 super.EEOnAfterLoad();
12435
12437 {
12439 }
12440
12443 }
12444
12446 {
12447 return false;
12448 }
12449
12450
12451
12453 {
12455 {
12456 #ifdef PLATFORM_CONSOLE
12457
12459 {
12461 if (menu)
12462 {
12464 }
12465 }
12466 #endif
12467 }
12468
12470 {
12473 }
12474
12476 {
12477 SetWeightDirty();
12479 }
12481 {
12484 }
12485
12487 {
12490 }
12492 {
12495 }
12496
12497 super.OnVariablesSynchronized();
12498 }
12499
12500
12501
12503 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12504 {
12505 if (!IsServerCheck(allow_client))
12506 return false;
12507
12509 return false;
12510
12513
12514 if (value <= (min + 0.001))
12515 value = min;
12516
12517 if (value == min)
12518 {
12519 if (destroy_config)
12520 {
12521 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12522 if (dstr)
12523 {
12525 this.Delete();
12526 return true;
12527 }
12528 }
12529 else if (destroy_forced)
12530 {
12532 this.Delete();
12533 return true;
12534 }
12535
12537 }
12538
12541
12543 {
12545
12546 if (delta)
12548 }
12549
12551
12552 return false;
12553 }
12554
12555
12557 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12558 {
12560 }
12561
12563 {
12566 }
12567
12569 {
12572 }
12573
12575 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12576 {
12577 float value_clamped = Math.Clamp(value, 0, 1);
12579 SetQuantity(result, destroy_config, destroy_forced);
12580 }
12581
12582
12585 {
12587 }
12588
12590 {
12592 }
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12604 {
12605 int slot = -1;
12606 if (GetInventory())
12607 {
12608 InventoryLocation il = new InventoryLocation;
12609 GetInventory().GetCurrentInventoryLocation(il);
12611 }
12612
12614 }
12615
12617 {
12618 float quantity_max = 0;
12619
12621 {
12622 if (attSlotID != -1)
12623 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12624
12625 if (quantity_max <= 0)
12627 }
12628
12629 if (quantity_max <= 0)
12631
12632 return quantity_max;
12633 }
12634
12636 {
12638 }
12639
12641 {
12643 }
12644
12645
12647 {
12649 }
12650
12652 {
12654 }
12655
12657 {
12659 }
12660
12661
12663 {
12664
12665 float weightEx = GetWeightEx();
12666 float special = GetInventoryAndCargoWeight();
12667 return weightEx - special;
12668 }
12669
12670
12672 {
12674 }
12675
12677 {
12679 {
12680 #ifdef DEVELOPER
12681 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12682 {
12683 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12685 }
12686 #endif
12687
12688 return GetQuantity() * GetConfigWeightModified();
12689 }
12690 else if (HasEnergyManager())
12691 {
12692 #ifdef DEVELOPER
12693 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12694 {
12695 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12696 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12697 }
12698 #endif
12699 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12700 }
12701 else
12702 {
12703 #ifdef DEVELOPER
12704 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12705 {
12706 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12707 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12708 }
12709 #endif
12710 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12711 }
12712 }
12713
12716 {
12717 int item_count = 0;
12719
12720 if (GetInventory().GetCargo() != NULL)
12721 {
12722 item_count = GetInventory().GetCargo().GetItemCount();
12723 }
12724
12725 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12726 {
12727 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12728 if (item)
12729 item_count += item.GetNumberOfItems();
12730 }
12731 return item_count;
12732 }
12733
12736 {
12737 float weight = 0;
12738 float wetness = 1;
12739 if (include_wetness)
12742 {
12743 weight = wetness * m_ConfigWeight;
12744 }
12746 {
12747 weight = 1;
12748 }
12749 return weight;
12750 }
12751
12752
12753
12755 {
12756 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12757 {
12758 GameInventory inv = GetInventory();
12759 array<EntityAI> items = new array<EntityAI>;
12761 for (int i = 0; i < items.Count(); i++)
12762 {
12764 if (item)
12765 {
12767 }
12768 }
12769 }
12770 }
12771
12772
12773
12774
12776 {
12777 float energy = 0;
12778 if (HasEnergyManager())
12779 {
12780 energy = GetCompEM().GetEnergy();
12781 }
12782 return energy;
12783 }
12784
12785
12787 {
12788 super.OnEnergyConsumed();
12789
12791 }
12792
12794 {
12795 super.OnEnergyAdded();
12796
12798 }
12799
12800
12802 {
12803 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12804 {
12806 {
12807 float energy_0to1 = GetCompEM().GetEnergy0To1();
12809 }
12810 }
12811 }
12812
12813
12815 {
12816 return ConfigGetFloat("heatIsolation");
12817 }
12818
12820 {
12822 }
12823
12825 {
12826 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12827 if (
GetGame().ConfigIsExisting(paramPath))
12829
12830 return 0.0;
12831 }
12832
12834 {
12835 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12836 if (
GetGame().ConfigIsExisting(paramPath))
12838
12839 return 0.0;
12840 }
12841
12842 override void SetWet(
float value,
bool allow_client =
false)
12843 {
12844 if (!IsServerCheck(allow_client))
12845 return;
12846
12849
12851
12852 m_VarWet = Math.Clamp(value, min, max);
12853
12855 {
12858 }
12859 }
12860
12861 override void AddWet(
float value)
12862 {
12864 }
12865
12867 {
12869 }
12870
12872 {
12874 }
12875
12877 {
12879 }
12880
12882 {
12884 }
12885
12887 {
12889 }
12890
12891 override void OnWetChanged(
float newVal,
float oldVal)
12892 {
12895 if (newLevel != oldLevel)
12896 {
12898 }
12899 }
12900
12902 {
12903 SetWeightDirty();
12904 }
12905
12907 {
12908 return GetWetLevelInternal(
m_VarWet);
12909 }
12910
12911
12912
12914 {
12916 }
12917
12919 {
12921 }
12922
12924 {
12926 }
12927
12929 {
12931 }
12932
12933
12934
12936 {
12937 if (ConfigIsExisting("itemModelLength"))
12938 {
12939 return ConfigGetFloat("itemModelLength");
12940 }
12941 return 0;
12942 }
12943
12945 {
12946 if (ConfigIsExisting("itemAttachOffset"))
12947 {
12948 return ConfigGetFloat("itemAttachOffset");
12949 }
12950 return 0;
12951 }
12952
12953 override void SetCleanness(
int value,
bool allow_client =
false)
12954 {
12955 if (!IsServerCheck(allow_client))
12956 return;
12957
12959
12961
12964 }
12965
12967 {
12969 }
12970
12972 {
12973 return true;
12974 }
12975
12976
12977
12978
12980 {
12982 }
12983
12985 {
12987 }
12988
12989
12990
12991
12992 override void SetColor(
int r,
int g,
int b,
int a)
12993 {
12999 }
13001 override void GetColor(out
int r,out
int g,out
int b,out
int a)
13002 {
13007 }
13008
13010 {
13012 }
13013
13016 {
13017 int r,g,b,a;
13019 r = r/255;
13020 g = g/255;
13021 b = b/255;
13022 a = a/255;
13023 return MiscGameplayFunctions.GetColorString(r, g, b, a);
13024 }
13025
13026
13027
13028 override void SetLiquidType(
int value,
bool allow_client =
false)
13029 {
13030 if (!IsServerCheck(allow_client))
13031 return;
13032
13037 }
13038
13040 {
13041 return ConfigGetInt("varLiquidTypeInit");
13042 }
13043
13045 {
13047 }
13048
13050 {
13052 SetFrozen(false);
13053 }
13054
13057 {
13058 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13059 }
13060
13061
13064 {
13065 PlayerBase nplayer;
13066 if (PlayerBase.CastTo(nplayer, player))
13067 {
13069
13070 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
13071 }
13072 }
13073
13074
13077 {
13078 PlayerBase nplayer;
13079 if (PlayerBase.CastTo(nplayer,player))
13080 {
13081
13082 nplayer.SetEnableQuickBarEntityShortcut(this,false);
13083
13084 }
13085
13086
13087 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
13088
13089
13090 if (HasEnergyManager())
13091 {
13092 GetCompEM().UpdatePlugState();
13093 }
13094 }
13095
13096
13098 {
13099 super.OnPlacementStarted(player);
13100
13102 }
13103
13104 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
13105 {
13107 {
13108 m_AdminLog.OnPlacementComplete(player,
this);
13109 }
13110
13111 super.OnPlacementComplete(player, position, orientation);
13112 }
13113
13114
13115
13116
13117
13119 {
13121 {
13122 return true;
13123 }
13124 else
13125 {
13126 return false;
13127 }
13128 }
13129
13130
13132 {
13134 {
13136 }
13137 }
13138
13139
13141 {
13143 }
13144
13146 {
13148 }
13149
13150 override void InsertAgent(
int agent,
float count = 1)
13151 {
13152 if (count < 1)
13153 return;
13154
13156 }
13157
13160 {
13162 }
13163
13164
13166 {
13168 }
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13212 {
13214 return false;
13215 return true;
13216 }
13217
13219 {
13220
13222 }
13223
13224
13227 {
13228 super.CheckForRoofLimited(timeTresholdMS);
13229
13231 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13232 {
13233 m_PreviousRoofTestTime = time;
13234 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13235 }
13236 }
13237
13238
13240 {
13242 {
13243 return 0;
13244 }
13245
13246 if (GetInventory().GetAttachmentSlotsCount() != 0)
13247 {
13248 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13249 if (filter)
13250 return filter.GetProtectionLevel(type, false, system);
13251 else
13252 return 0;
13253 }
13254
13255 string subclassPath, entryName;
13256
13257 switch (type)
13258 {
13260 entryName = "biological";
13261 break;
13263 entryName = "chemical";
13264 break;
13265 default:
13266 entryName = "biological";
13267 break;
13268 }
13269
13270 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13271
13273 }
13274
13275
13276
13279 {
13280 if (!IsMagazine())
13282
13284 }
13285
13286
13287
13288
13289
13294 {
13295 return true;
13296 }
13297
13299 {
13301 }
13302
13303
13304
13305
13306
13308 {
13309 if (parent)
13310 {
13311 if (parent.IsInherited(DayZInfected))
13312 return true;
13313
13314 if (!parent.IsRuined())
13315 return true;
13316 }
13317
13318 return true;
13319 }
13320
13322 {
13323 if (!super.CanPutAsAttachment(parent))
13324 {
13325 return false;
13326 }
13327
13328 if (!IsRuined() && !parent.IsRuined())
13329 {
13330 return true;
13331 }
13332
13333 return false;
13334 }
13335
13337 {
13338
13339
13340
13341
13342 return super.CanReceiveItemIntoCargo(item);
13343 }
13344
13346 {
13347
13348
13349
13350
13351 GameInventory attachmentInv = attachment.GetInventory();
13353 {
13354 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13355 return false;
13356 }
13357
13358 InventoryLocation loc = new InventoryLocation();
13359 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13360 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13361 return false;
13362
13363 return super.CanReceiveAttachment(attachment, slotId);
13364 }
13365
13367 {
13368 if (!super.CanReleaseAttachment(attachment))
13369 return false;
13370
13371 return GetInventory().AreChildrenAccessible();
13372 }
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13395 {
13396 int id = muzzle_owner.GetMuzzleID();
13397 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13398
13399 if (WPOF_array)
13400 {
13401 for (int i = 0; i < WPOF_array.Count(); i++)
13402 {
13403 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13404
13405 if (WPOF)
13406 {
13407 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13408 }
13409 }
13410 }
13411 }
13412
13413
13415 {
13416 int id = muzzle_owner.GetMuzzleID();
13418
13419 if (WPOBE_array)
13420 {
13421 for (int i = 0; i < WPOBE_array.Count(); i++)
13422 {
13423 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13424
13425 if (WPOBE)
13426 {
13427 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13428 }
13429 }
13430 }
13431 }
13432
13433
13435 {
13436 int id = muzzle_owner.GetMuzzleID();
13437 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13438
13439 if (WPOOH_array)
13440 {
13441 for (int i = 0; i < WPOOH_array.Count(); i++)
13442 {
13443 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13444
13445 if (WPOOH)
13446 {
13447 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13448 }
13449 }
13450 }
13451 }
13452
13453
13455 {
13456 int id = muzzle_owner.GetMuzzleID();
13457 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13458
13459 if (WPOOH_array)
13460 {
13461 for (int i = 0; i < WPOOH_array.Count(); i++)
13462 {
13463 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13464
13465 if (WPOOH)
13466 {
13467 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13468 }
13469 }
13470 }
13471 }
13472
13473
13475 {
13476 int id = muzzle_owner.GetMuzzleID();
13477 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13478
13479 if (WPOOH_array)
13480 {
13481 for (int i = 0; i < WPOOH_array.Count(); i++)
13482 {
13483 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13484
13485 if (WPOOH)
13486 {
13487 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13488 }
13489 }
13490 }
13491 }
13492
13493
13494
13496 {
13498 {
13499 return true;
13500 }
13501
13502 return false;
13503 }
13504
13506 {
13508 {
13509 return true;
13510 }
13511
13512 return false;
13513 }
13514
13516 {
13518 {
13519 return true;
13520 }
13521
13522 return false;
13523 }
13524
13526 {
13527 return false;
13528 }
13529
13532 {
13533 return UATimeSpent.DEFAULT_DEPLOY;
13534 }
13535
13536
13537
13538
13540 {
13542 SetSynchDirty();
13543 }
13544
13546 {
13548 }
13549
13550
13552 {
13553 return false;
13554 }
13555
13558 {
13559 string att_type = "None";
13560
13561 if (ConfigIsExisting("soundAttType"))
13562 {
13563 att_type = ConfigGetString("soundAttType");
13564 }
13565
13567 }
13568
13570 {
13572 }
13573
13574
13575
13576
13577
13583
13585 {
13588
13590 }
13591
13592
13594 {
13596 return;
13597
13599
13602
13605
13606 SoundParameters params = new SoundParameters();
13610 }
13611
13612
13614 {
13616 return;
13617
13619 SetSynchDirty();
13620
13623 }
13624
13625
13627 {
13629 return;
13630
13632 SetSynchDirty();
13633
13636 }
13637
13639 {
13641 }
13642
13644 {
13646 }
13647
13650 {
13651 if (!
GetGame().IsDedicatedServer())
13652 {
13653 if (ConfigIsExisting("attachSoundSet"))
13654 {
13655 string cfg_path = "";
13656 string soundset = "";
13657 string type_name =
GetType();
13658
13661 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13662 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13663
13664 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13665 {
13666 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13667 {
13668 if (cfg_slot_array[i] == slot_type)
13669 {
13670 soundset = cfg_soundset_array[i];
13671 break;
13672 }
13673 }
13674 }
13675
13676 if (soundset != "")
13677 {
13678 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13680 }
13681 }
13682 }
13683 }
13684
13686 {
13687
13688 }
13689
13690 void OnApply(PlayerBase player);
13691
13693 {
13694 return 1.0;
13695 };
13696
13698 {
13700 }
13701
13703 {
13705 }
13706
13708
13710 {
13711 SetDynamicPhysicsLifeTime(0.01);
13713 }
13714
13716 {
13717 array<string> zone_names = new array<string>;
13718 GetDamageZones(zone_names);
13719 for (int i = 0; i < zone_names.Count(); i++)
13720 {
13721 SetHealthMax(zone_names.Get(i),"Health");
13722 }
13723 SetHealthMax("","Health");
13724 }
13725
13728 {
13729 float global_health = GetHealth01("","Health");
13730 array<string> zones = new array<string>;
13731 GetDamageZones(zones);
13732
13733 for (int i = 0; i < zones.Count(); i++)
13734 {
13735 SetHealth01(zones.Get(i),"Health",global_health);
13736 }
13737 }
13738
13741 {
13742 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13743 }
13744
13746 {
13747 if (!hasRootAsPlayer)
13748 {
13749 if (refParentIB)
13750 {
13751
13752 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13753 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13754
13755 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13756 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13757
13760 }
13761 else
13762 {
13763
13766 }
13767 }
13768 }
13769
13771 {
13773 {
13774 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13775 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13776 {
13777 float heatPermCoef = 1.0;
13779 while (ent)
13780 {
13781 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13782 ent = ent.GetHierarchyParent();
13783 }
13784
13785 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13786 }
13787 }
13788 }
13789
13791 {
13792
13793 EntityAI parent = GetHierarchyParent();
13794 if (!parent)
13795 {
13796 hasParent = false;
13797 hasRootAsPlayer = false;
13798 }
13799 else
13800 {
13801 hasParent = true;
13802 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13803 refParentIB =
ItemBase.Cast(parent);
13804 }
13805 }
13806
13807 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13808 {
13809
13810 }
13811
13813 {
13814
13815 return false;
13816 }
13817
13819 {
13820
13821
13822 return false;
13823 }
13824
13826 {
13827
13828 return false;
13829 }
13830
13833 {
13834 return !GetIsFrozen() &&
IsOpen();
13835 }
13836
13838 {
13839 bool hasParent = false, hasRootAsPlayer = false;
13841
13842 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13843 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13844
13845 if (wwtu || foodDecay)
13846 {
13850
13851 if (processWetness || processTemperature || processDecay)
13852 {
13854
13855 if (processWetness)
13856 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13857
13858 if (processTemperature)
13860
13861 if (processDecay)
13862 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13863 }
13864 }
13865 }
13866
13869 {
13871 }
13872
13874 {
13877
13878 return super.GetTemperatureFreezeThreshold();
13879 }
13880
13882 {
13885
13886 return super.GetTemperatureThawThreshold();
13887 }
13888
13890 {
13893
13894 return super.GetItemOverheatThreshold();
13895 }
13896
13898 {
13900 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13901
13902 return super.GetTemperatureFreezeTime();
13903 }
13904
13906 {
13908 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13909
13910 return super.GetTemperatureThawTime();
13911 }
13912
13917
13919 {
13920 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13921 }
13922
13924 {
13925 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13926 }
13927
13930 {
13932 }
13933
13935 {
13937 }
13938
13940 {
13942 }
13943
13946 {
13947 return null;
13948 }
13949
13952 {
13953 return false;
13954 }
13955
13957 {
13959 {
13962 if (!trg)
13963 {
13965 explosive = this;
13966 }
13967
13968 explosive.PairRemote(trg);
13970
13971 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13972 trg.SetPersistentPairID(persistentID);
13973 explosive.SetPersistentPairID(persistentID);
13974
13975 return true;
13976 }
13977 return false;
13978 }
13979
13982 {
13983 float ret = 1.0;
13986 ret *= GetHealth01();
13987
13988 return ret;
13989 }
13990
13991 #ifdef DEVELOPER
13992 override void SetDebugItem()
13993 {
13994 super.SetDebugItem();
13995 _itemBase = this;
13996 }
13997
13999 {
14000 string text = super.GetDebugText();
14001
14003 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
14004
14005 return text;
14006 }
14007 #endif
14008
14010 {
14011 return true;
14012 }
14013
14015
14017
14019 {
14022 }
14023
14024
14032
14048}
14049
14051{
14053 if (entity)
14054 {
14055 bool is_item = entity.IsInherited(
ItemBase);
14056 if (is_item && full_quantity)
14057 {
14060 }
14061 }
14062 else
14063 {
14065 return NULL;
14066 }
14067 return entity;
14068}
14069
14071{
14072 if (item)
14073 {
14074 if (health > 0)
14075 item.SetHealth("", "", health);
14076
14077 if (item.CanHaveTemperature())
14078 {
14080 if (item.CanFreeze())
14081 item.SetFrozen(false);
14082 }
14083
14084 if (item.HasEnergyManager())
14085 {
14086 if (quantity >= 0)
14087 {
14088 item.GetCompEM().SetEnergy0To1(quantity);
14089 }
14090 else
14091 {
14093 }
14094 }
14095 else if (item.IsMagazine())
14096 {
14097 Magazine mag = Magazine.Cast(item);
14098 if (quantity >= 0)
14099 {
14100 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
14101 }
14102 else
14103 {
14105 }
14106
14107 }
14108 else
14109 {
14110 if (quantity >= 0)
14111 {
14112 item.SetQuantityNormalized(quantity, false);
14113 }
14114 else
14115 {
14117 }
14118
14119 }
14120 }
14121}
14122
14123#ifdef DEVELOPER
14125#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.