9143{
9145 {
9146 return true;
9147 }
9148};
9149
9150
9151
9153{
9157
9159
9162
9163
9164
9165
9166
9175
9181
9186
9191
9212 protected bool m_IsResultOfSplit
9213
9215
9220
9221
9222
9224
9228
9229
9230
9232
9235
9236
9237
9243
9244
9252
9255
9256
9258
9259
9261
9262
9267
9268
9273
9274
9276
9277
9279 {
9284
9285 if (!
GetGame().IsDedicatedServer())
9286 {
9288 {
9290
9292 {
9294 }
9295 }
9296
9299 }
9300
9301 m_OldLocation = null;
9302
9304 {
9306 }
9307
9308 if (ConfigIsExisting("headSelectionsToHide"))
9309 {
9312 }
9313
9315 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9316 {
9318 }
9319
9321
9322 m_IsResultOfSplit = false;
9323
9325 }
9326
9328 {
9329 super.InitItemVariables();
9330
9336 m_Count = ConfigGetInt(
"count");
9337
9340
9345
9348
9353
9365
9369
9370
9373 if (ConfigIsExisting("canBeSplit"))
9374 {
9377 }
9378
9380 if (ConfigIsExisting("itemBehaviour"))
9382
9383
9386 RegisterNetSyncVariableInt("m_VarLiquidType");
9387 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9388
9389 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9390 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9391 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9392
9393 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9394 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9395 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9396 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9397
9398 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9399 RegisterNetSyncVariableBool("m_IsTakeable");
9400 RegisterNetSyncVariableBool("m_IsHologram");
9401
9404 {
9407 }
9408
9410
9412 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9414
9415 }
9416
9418 {
9420 }
9421
9423 {
9426 {
9431 }
9432 }
9433
9434 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9435 {
9437 {
9440 }
9441
9443 }
9444
9446 {
9452 }
9453
9455
9457 {
9459
9460 if (!action)
9461 {
9462 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9463 return;
9464 }
9465
9467 if (!ai)
9468 {
9470 return;
9471 }
9472
9474 if (!action_array)
9475 {
9476 action_array = new array<ActionBase_Basic>;
9478 }
9479 if (LogManager.IsActionLogEnable())
9480 {
9481 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9482 }
9483
9484 if (action_array.Find(action) != -1)
9485 {
9486 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9487 }
9488 else
9489 {
9490 action_array.Insert(action);
9491 }
9492 }
9493
9495 {
9497 ActionBase action = player.GetActionManager().GetAction(actionName);
9500
9501 if (action_array)
9502 {
9503 action_array.RemoveItem(action);
9504 }
9505 }
9506
9507
9508
9510 {
9511 ActionOverrideData overrideData = new ActionOverrideData();
9515
9517 if (!actionMap)
9518 {
9521 }
9522
9523 actionMap.Insert(this.
Type(), overrideData);
9524
9525 }
9526
9528
9530
9531
9533 {
9536
9539
9540 string config_to_search = "CfgVehicles";
9541 string muzzle_owner_config;
9542
9544 {
9545 if (IsInherited(Weapon))
9546 config_to_search = "CfgWeapons";
9547
9548 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9549
9550 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9551
9553
9554 if (config_OnFire_subclass_count > 0)
9555 {
9556 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9557
9558 for (int i = 0; i < config_OnFire_subclass_count; i++)
9559 {
9560 string particle_class = "";
9562 string config_OnFire_entry = config_OnFire_class + particle_class;
9563 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9564 WPOF_array.Insert(WPOF);
9565 }
9566
9567
9569 }
9570 }
9571
9573 {
9574 config_to_search = "CfgWeapons";
9575 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9576
9577 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9578
9580
9581 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9582 {
9583 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9584
9585 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9586 {
9587 string particle_class2 = "";
9589 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9590 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9591 WPOBE_array.Insert(WPOBE);
9592 }
9593
9594
9596 }
9597 }
9598 }
9599
9600
9602 {
9605
9607 {
9608 string config_to_search = "CfgVehicles";
9609
9610 if (IsInherited(Weapon))
9611 config_to_search = "CfgWeapons";
9612
9613 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9614 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9615
9616 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9617 {
9618
9620
9622 {
9624 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9626 return;
9627 }
9628
9631
9632
9633
9635 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9636
9637 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9638 {
9639 string particle_class = "";
9641 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9643
9644 if (entry_type == CT_CLASS)
9645 {
9646 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9647 WPOOH_array.Insert(WPOF);
9648 }
9649 }
9650
9651
9653 }
9654 }
9655 }
9656
9658 {
9660 }
9661
9663 {
9665 {
9667
9670
9673
9674 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9675 }
9676 }
9677
9679 {
9681 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9682
9684 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9685
9687 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9688
9690 {
9692 }
9693 }
9694
9696 {
9698 }
9699
9701 {
9704 else
9706
9708 {
9711 }
9712 else
9713 {
9716
9719 }
9720
9722 }
9723
9725 {
9727 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9728 }
9729
9731 {
9733 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9735 }
9736
9738 {
9740 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9741 }
9742
9744 {
9747
9748 OverheatingParticle OP = new OverheatingParticle();
9753
9755 }
9756
9758 {
9761
9762 return -1;
9763 }
9764
9766 {
9768 {
9771
9772 for (int i = count; i > 0; --i)
9773 {
9774 int id = i - 1;
9777
9780
9781 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9782 {
9783 if (p)
9784 {
9787 }
9788 }
9789 }
9790 }
9791 }
9792
9794 {
9796 {
9798 {
9799 int id = i - 1;
9801
9802 if (OP)
9803 {
9805
9806 if (p)
9807 {
9809 }
9810
9811 delete OP;
9812 }
9813 }
9814
9817 }
9818 }
9819
9822 {
9823 return 0.0;
9824 }
9825
9826
9828 {
9829 return 250;
9830 }
9831
9833 {
9834 return 0;
9835 }
9836
9839 {
9841 return true;
9842
9843 return false;
9844 }
9845
9848 {
9851
9853 {
9855 }
9856 else
9857 {
9858
9860 }
9861
9863 }
9864
9871 {
9872 return -1;
9873 }
9874
9875
9876
9877
9879 {
9881 {
9883 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9884
9885 if (r_index >= 0)
9886 {
9887 InventoryLocation r_il = new InventoryLocation;
9888 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9889
9890 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9893 {
9894 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9895 }
9897 {
9898 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9899 }
9900
9901 }
9902
9903 player.GetHumanInventory().ClearUserReservedLocation(this);
9904 }
9905
9908 }
9909
9910
9911
9912
9914 {
9915 return ItemBase.m_DebugActionsMask;
9916 }
9917
9919 {
9920 return ItemBase.m_DebugActionsMask & mask;
9921 }
9922
9924 {
9925 ItemBase.m_DebugActionsMask = mask;
9926 }
9927
9929 {
9930 ItemBase.m_DebugActionsMask |= mask;
9931 }
9932
9934 {
9935 ItemBase.m_DebugActionsMask &= ~mask;
9936 }
9937
9939 {
9941 {
9943 }
9944 else
9945 {
9947 }
9948 }
9949
9950
9952 {
9953 if (GetEconomyProfile())
9954 {
9955 float q_max = GetEconomyProfile().GetQuantityMax();
9956 if (q_max > 0)
9957 {
9958 float q_min = GetEconomyProfile().GetQuantityMin();
9959 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9960
9962 {
9963 ComponentEnergyManager comp = GetCompEM();
9965 {
9967 }
9968 }
9970 {
9972
9973 }
9974
9975 }
9976 }
9977 }
9978
9981 {
9982 EntityAI parent = GetHierarchyParent();
9983
9984 if (parent)
9985 {
9986 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9987 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9988 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9989 }
9990 }
9991
9994 {
9995 EntityAI parent = GetHierarchyParent();
9996
9997 if (parent)
9998 {
9999 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
10000 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
10001 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
10002 }
10003 }
10004
10006 {
10007
10008
10009
10010
10012
10014 {
10015 if (ScriptInputUserData.CanStoreInputUserData())
10016 {
10017 ScriptInputUserData ctx = new ScriptInputUserData;
10023 ctx.
Write(use_stack_max);
10026
10028 {
10029 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
10030 }
10031 }
10032 }
10033 else if (!
GetGame().IsMultiplayer())
10034 {
10036 }
10037 }
10038
10040 {
10042 }
10043
10045 {
10047 }
10048
10050 {
10052 }
10053
10055 {
10056
10057 return false;
10058 }
10059
10061 {
10062 return false;
10063 }
10064
10068 {
10069 return false;
10070 }
10071
10073 {
10074 return "";
10075 }
10076
10078
10080 {
10081 return false;
10082 }
10083
10085 {
10086 return true;
10087 }
10088
10089
10090
10092 {
10093 return true;
10094 }
10095
10097 {
10098 return true;
10099 }
10100
10102 {
10103 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10105 }
10106
10108 {
10110 }
10111
10113 {
10115 if (!is_being_placed)
10117 SetSynchDirty();
10118 }
10119
10120
10122
10124 {
10126 }
10127
10129 {
10131 }
10132
10134 {
10135 return 1;
10136 }
10137
10139 {
10140 return false;
10141 }
10142
10144 {
10146 SetSynchDirty();
10147 }
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10184 {
10185 super.OnMovedInsideCargo(container);
10186
10187 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10188 }
10189
10190 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10191 {
10192 super.EEItemLocationChanged(oldLoc,newLoc);
10193
10194 PlayerBase new_player = null;
10195 PlayerBase old_player = null;
10196
10197 if (newLoc.GetParent())
10198 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10199
10200 if (oldLoc.GetParent())
10201 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10202
10204 {
10205 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10206
10207 if (r_index >= 0)
10208 {
10209 InventoryLocation r_il = new InventoryLocation;
10210 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10211
10212 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10215 {
10216 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10217 }
10219 {
10220 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10221 }
10222
10223 }
10224 }
10225
10227 {
10228 if (new_player)
10229 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10230
10231 if (new_player == old_player)
10232 {
10233
10234 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10235 {
10237 {
10238 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10239 {
10240 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10241 }
10242 }
10243 else
10244 {
10245 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10246 }
10247 }
10248
10249 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10250 {
10251 int type = oldLoc.GetType();
10253 {
10254 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10255 }
10257 {
10258 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10259 }
10260 }
10261 if (!m_OldLocation)
10262 {
10263 m_OldLocation = new InventoryLocation;
10264 }
10265 m_OldLocation.Copy(oldLoc);
10266 }
10267 else
10268 {
10269 if (m_OldLocation)
10270 {
10271 m_OldLocation.Reset();
10272 }
10273 }
10274
10276 }
10277 else
10278 {
10279 if (new_player)
10280 {
10281 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10282 if (res_index >= 0)
10283 {
10284 InventoryLocation il = new InventoryLocation;
10285 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10287 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10290 {
10291 il.
GetParent().GetOnReleaseLock().Invoke(it);
10292 }
10294 {
10296 }
10297
10298 }
10299 }
10301 {
10302
10304 }
10305
10306 if (m_OldLocation)
10307 {
10308 m_OldLocation.Reset();
10309 }
10310 }
10311 }
10312
10313 override void EOnContact(IEntity other, Contact extra)
10314 {
10316 {
10317 int liquidType = -1;
10319 if (impactSpeed > 0.0)
10320 {
10322 #ifndef SERVER
10324 #else
10326 SetSynchDirty();
10327 #endif
10329 }
10330 }
10331
10332 #ifdef SERVER
10333 if (GetCompEM() && GetCompEM().IsPlugged())
10334 {
10335 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10336 GetCompEM().UnplugThis();
10337 }
10338 #endif
10339 }
10340
10342
10344 {
10346 }
10347
10349 {
10350
10351 }
10352
10354 {
10355 super.OnItemLocationChanged(old_owner, new_owner);
10356
10357 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10358 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10359
10360 if (!relatedPlayer && playerNew)
10361 relatedPlayer = playerNew;
10362
10363 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10364 {
10366 if (actionMgr)
10367 {
10368 ActionBase currentAction = actionMgr.GetRunningAction();
10369 if (currentAction)
10371 }
10372 }
10373
10374 Man ownerPlayerOld = null;
10375 Man ownerPlayerNew = null;
10376
10377 if (old_owner)
10378 {
10379 if (old_owner.
IsMan())
10380 {
10381 ownerPlayerOld = Man.Cast(old_owner);
10382 }
10383 else
10384 {
10385 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10386 }
10387 }
10388 else
10389 {
10391 {
10393
10394 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10395 {
10396 GetCompEM().UnplugThis();
10397 }
10398 }
10399 }
10400
10401 if (new_owner)
10402 {
10403 if (new_owner.
IsMan())
10404 {
10405 ownerPlayerNew = Man.Cast(new_owner);
10406 }
10407 else
10408 {
10409 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10410 }
10411 }
10412
10413 if (ownerPlayerOld != ownerPlayerNew)
10414 {
10415 if (ownerPlayerOld)
10416 {
10417 array<EntityAI> subItemsExit = new array<EntityAI>;
10419 for (int i = 0; i < subItemsExit.Count(); i++)
10420 {
10423 }
10424 }
10425
10426 if (ownerPlayerNew)
10427 {
10428 array<EntityAI> subItemsEnter = new array<EntityAI>;
10430 for (int j = 0; j < subItemsEnter.Count(); j++)
10431 {
10434 }
10435 }
10436 }
10437 else if (ownerPlayerNew != null)
10438 {
10439 PlayerBase nplayer;
10440 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10441 {
10442 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10444 for (int k = 0; k < subItemsUpdate.Count(); k++)
10445 {
10447 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10448 }
10449 }
10450 }
10451
10452 if (old_owner)
10453 old_owner.OnChildItemRemoved(this);
10454 if (new_owner)
10455 new_owner.OnChildItemReceived(this);
10456 }
10457
10458
10460 {
10461 super.EEDelete(parent);
10462 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10463 if (player)
10464 {
10466
10467 if (player.IsAlive())
10468 {
10469 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10470 if (r_index >= 0)
10471 {
10472 InventoryLocation r_il = new InventoryLocation;
10473 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10474
10475 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10478 {
10479 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10480 }
10482 {
10483 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10484 }
10485
10486 }
10487
10488 player.RemoveQuickBarEntityShortcut(this);
10489 }
10490 }
10491 }
10492
10494 {
10495 super.EEKilled(killer);
10496
10499 {
10500 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10501 {
10502 if (IsMagazine())
10503 {
10504 if (Magazine.Cast(this).GetAmmoCount() > 0)
10505 {
10507 }
10508 }
10509 else
10510 {
10512 }
10513 }
10514 }
10515 }
10516
10518 {
10519 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10520
10521 super.OnWasAttached(parent, slot_id);
10522
10525
10527 }
10528
10530 {
10531 super.OnWasDetached(parent, slot_id);
10532
10535 }
10536
10538 {
10539 int idx;
10542
10543 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10544 if (inventory_slots.Count() < 1)
10545 {
10546 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10547 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10548 }
10549 else
10550 {
10551 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10552 }
10553
10554 idx = inventory_slots.Find(slot);
10555 if (idx < 0)
10556 return "";
10557
10558 return attach_types.Get(idx);
10559 }
10560
10562 {
10563 int idx = -1;
10564 string slot;
10565
10568
10569 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10570 if (inventory_slots.Count() < 1)
10571 {
10572 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10573 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10574 }
10575 else
10576 {
10577 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10578 if (detach_types.Count() < 1)
10579 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10580 }
10581
10582 for (int i = 0; i < inventory_slots.Count(); i++)
10583 {
10584 slot = inventory_slots.Get(i);
10585 }
10586
10587 if (slot != "")
10588 {
10589 if (detach_types.Count() == 1)
10590 idx = 0;
10591 else
10592 idx = inventory_slots.Find(slot);
10593 }
10594 if (idx < 0)
10595 return "";
10596
10597 return detach_types.Get(idx);
10598 }
10599
10601 {
10602
10604
10605
10606 float min_time = 1;
10607 float max_time = 3;
10608 float delay = Math.RandomFloat(min_time, max_time);
10609
10610 explode_timer.Run(delay, this, "DoAmmoExplosion");
10611 }
10612
10614 {
10615 Magazine magazine = Magazine.Cast(this);
10616 int pop_sounds_count = 6;
10617 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10618
10619
10620 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10621 string sound_name = pop_sounds[ sound_idx ];
10623
10624
10625 magazine.ServerAddAmmoCount(-1);
10626
10627
10628 float min_temp_to_explode = 100;
10629
10630 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10631 {
10633 }
10634 }
10635
10636
10637 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10638 {
10639 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10640
10641 const int CHANCE_DAMAGE_CARGO = 4;
10642 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10643 const int CHANCE_DAMAGE_NOTHING = 2;
10644
10646 {
10647 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10648 int chances;
10649 int rnd;
10650
10651 if (GetInventory().GetCargo())
10652 {
10653 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10654 rnd = Math.RandomInt(0,chances);
10655
10656 if (rnd < CHANCE_DAMAGE_CARGO)
10657 {
10659 }
10660 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10661 {
10663 }
10664 }
10665 else
10666 {
10667 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10668 rnd = Math.RandomInt(0,chances);
10669
10670 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10671 {
10673 }
10674 }
10675 }
10676 }
10677
10679 {
10680 if (GetInventory().GetCargo())
10681 {
10682 int item_count = GetInventory().GetCargo().GetItemCount();
10683 if (item_count > 0)
10684 {
10685 int random_pick = Math.RandomInt(0, item_count);
10687 if (!item.IsExplosive())
10688 {
10689 item.AddHealth("","",damage);
10690 return true;
10691 }
10692 }
10693 }
10694 return false;
10695 }
10696
10698 {
10699 int attachment_count = GetInventory().AttachmentCount();
10700 if (attachment_count > 0)
10701 {
10702 int random_pick = Math.RandomInt(0, attachment_count);
10703 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10704 if (!attachment.IsExplosive())
10705 {
10706 attachment.AddHealth("","",damage);
10707 return true;
10708 }
10709 }
10710 return false;
10711 }
10712
10714 {
10716 }
10717
10719 {
10721 return GetInventory().CanRemoveEntity();
10722
10723 return false;
10724 }
10725
10727 {
10729 return;
10730
10732 {
10733 if (ScriptInputUserData.CanStoreInputUserData())
10734 {
10735 ScriptInputUserData ctx = new ScriptInputUserData;
10740 ctx.
Write(destination_entity);
10742 ctx.
Write(slot_id);
10744 }
10745 }
10746 else if (!
GetGame().IsMultiplayer())
10747 {
10749 }
10750 }
10751
10753 {
10755 return;
10756
10757 float split_quantity_new;
10761 InventoryLocation loc = new InventoryLocation;
10762
10763 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10764 {
10766 split_quantity_new = stack_max;
10767 else
10769
10770 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10771 if (new_item)
10772 {
10773 new_item.SetResultOfSplit(true);
10774 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10776 new_item.SetQuantity(split_quantity_new);
10777 }
10778 }
10779 else if (destination_entity && slot_id == -1)
10780 {
10781 if (quantity > stack_max)
10782 split_quantity_new = stack_max;
10783 else
10784 split_quantity_new = quantity;
10785
10787 {
10790 }
10791
10792 if (new_item)
10793 {
10794 new_item.SetResultOfSplit(true);
10795 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10797 new_item.SetQuantity(split_quantity_new);
10798 }
10799 }
10800 else
10801 {
10802 if (stack_max != 0)
10803 {
10805 {
10807 }
10808
10809 if (split_quantity_new == 0)
10810 {
10811 if (!
GetGame().IsMultiplayer())
10812 player.PhysicalPredictiveDropItem(this);
10813 else
10814 player.ServerDropEntity(this);
10815 return;
10816 }
10817
10819
10820 if (new_item)
10821 {
10822 new_item.SetResultOfSplit(true);
10823 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10825 new_item.SetQuantity(stack_max);
10826 new_item.PlaceOnSurface();
10827 }
10828 }
10829 }
10830 }
10831
10833 {
10835 return;
10836
10837 float split_quantity_new;
10841 InventoryLocation loc = new InventoryLocation;
10842
10843 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10844 {
10846 split_quantity_new = stack_max;
10847 else
10849
10850 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10851 if (new_item)
10852 {
10853 new_item.SetResultOfSplit(true);
10854 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10856 new_item.SetQuantity(split_quantity_new);
10857 }
10858 }
10859 else if (destination_entity && slot_id == -1)
10860 {
10861 if (quantity > stack_max)
10862 split_quantity_new = stack_max;
10863 else
10864 split_quantity_new = quantity;
10865
10867 {
10870 }
10871
10872 if (new_item)
10873 {
10874 new_item.SetResultOfSplit(true);
10875 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10877 new_item.SetQuantity(split_quantity_new);
10878 }
10879 }
10880 else
10881 {
10882 if (stack_max != 0)
10883 {
10885 {
10887 }
10888
10890
10891 if (new_item)
10892 {
10893 new_item.SetResultOfSplit(true);
10894 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10896 new_item.SetQuantity(stack_max);
10897 new_item.PlaceOnSurface();
10898 }
10899 }
10900 }
10901 }
10902
10904 {
10906 return;
10907
10909 {
10910 if (ScriptInputUserData.CanStoreInputUserData())
10911 {
10912 ScriptInputUserData ctx = new ScriptInputUserData;
10917 dst.WriteToContext(ctx);
10919 }
10920 }
10921 else if (!
GetGame().IsMultiplayer())
10922 {
10924 }
10925 }
10926
10928 {
10930 return;
10931
10933 {
10934 if (ScriptInputUserData.CanStoreInputUserData())
10935 {
10936 ScriptInputUserData ctx = new ScriptInputUserData;
10941 ctx.
Write(destination_entity);
10947 }
10948 }
10949 else if (!
GetGame().IsMultiplayer())
10950 {
10952 }
10953 }
10954
10956 {
10958 }
10959
10961 {
10963 return this;
10964
10966 float split_quantity_new;
10968 if (dst.IsValid())
10969 {
10970 int slot_id = dst.GetSlot();
10972
10973 if (quantity > stack_max)
10974 split_quantity_new = stack_max;
10975 else
10976 split_quantity_new = quantity;
10977
10979
10980 if (new_item)
10981 {
10982 new_item.SetResultOfSplit(true);
10983 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10986 }
10987
10988 return new_item;
10989 }
10990
10991 return null;
10992 }
10993
10995 {
10997 return;
10998
11000 float split_quantity_new;
11002 if (destination_entity)
11003 {
11005 if (quantity > stackable)
11006 split_quantity_new = stackable;
11007 else
11008 split_quantity_new = quantity;
11009
11010 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
11011 if (new_item)
11012 {
11013 new_item.SetResultOfSplit(true);
11014 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11016 new_item.SetQuantity(split_quantity_new);
11017 }
11018 }
11019 }
11020
11022 {
11024 return;
11025
11027 {
11028 if (ScriptInputUserData.CanStoreInputUserData())
11029 {
11030 ScriptInputUserData ctx = new ScriptInputUserData;
11035 ItemBase destination_entity =
this;
11036 ctx.
Write(destination_entity);
11040 }
11041 }
11042 else if (!
GetGame().IsMultiplayer())
11043 {
11045 }
11046 }
11047
11049 {
11051 return;
11052
11054 float split_quantity_new;
11056 if (player)
11057 {
11059 if (quantity > stackable)
11060 split_quantity_new = stackable;
11061 else
11062 split_quantity_new = quantity;
11063
11064 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11065 new_item =
ItemBase.Cast(in_hands);
11066 if (new_item)
11067 {
11068 new_item.SetResultOfSplit(true);
11069 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11071 new_item.SetQuantity(split_quantity_new);
11072 }
11073 }
11074 }
11075
11077 {
11079 return;
11080
11082 float split_quantity_new = Math.Floor(quantity * 0.5);
11083
11085
11086 if (new_item)
11087 {
11088 if (new_item.GetQuantityMax() < split_quantity_new)
11089 {
11090 split_quantity_new = new_item.GetQuantityMax();
11091 }
11092
11093 new_item.SetResultOfSplit(true);
11094 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11095
11097 {
11100 }
11101 else
11102 {
11105 }
11106 }
11107 }
11108
11110 {
11112 return;
11113
11115 float split_quantity_new = Math.Floor(quantity / 2);
11116
11117 InventoryLocation invloc = new InventoryLocation;
11119
11121 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11122
11123 if (new_item)
11124 {
11125 if (new_item.GetQuantityMax() < split_quantity_new)
11126 {
11127 split_quantity_new = new_item.GetQuantityMax();
11128 }
11130 {
11133 }
11134 else
11135 {
11138 }
11139 }
11140 }
11141
11144 {
11145 SetWeightDirty();
11147
11148 if (parent)
11149 parent.OnAttachmentQuantityChangedEx(this, delta);
11150
11152 {
11154 {
11156 }
11158 {
11159 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11161 }
11162 }
11163
11164 }
11165
11168 {
11169
11170 }
11171
11174 {
11176 }
11177
11179 {
11180 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11181
11183 {
11184 if (newLevel == GameConstants.STATE_RUINED)
11185 {
11187 EntityAI parent = GetHierarchyParent();
11188 if (parent && parent.IsFireplace())
11189 {
11190 CargoBase cargo = GetInventory().GetCargo();
11191 if (cargo)
11192 {
11194 {
11196 }
11197 }
11198 }
11199 }
11200
11202 {
11203
11205 return;
11206 }
11207
11208 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11209 {
11211 }
11212 }
11213 }
11214
11215
11217 {
11218 super.OnRightClick();
11219
11221 {
11223 {
11224 if (ScriptInputUserData.CanStoreInputUserData())
11225 {
11226 vector m4[4];
11228
11229 EntityAI root = GetHierarchyRoot();
11230
11231 InventoryLocation dst = new InventoryLocation;
11233 {
11234 if (root)
11235 {
11236 root.GetTransform(m4);
11238 }
11239 else
11240 GetInventory().GetCurrentInventoryLocation(dst);
11241 }
11242 else
11243 {
11245
11246
11247 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11248 {
11249 if (root)
11250 {
11251 root.GetTransform(m4);
11253 }
11254 else
11255 GetInventory().GetCurrentInventoryLocation(dst);
11256 }
11257 else
11258 {
11259 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11260 }
11261 }
11262
11263 ScriptInputUserData ctx = new ScriptInputUserData;
11271 }
11272 }
11273 else if (!
GetGame().IsMultiplayer())
11274 {
11276 }
11277 }
11278 }
11279
11280 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11281 {
11282
11283 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11284 return false;
11285
11286 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11287 return false;
11288
11289
11291 return false;
11292
11293
11294 Magazine mag = Magazine.Cast(this);
11295 if (mag)
11296 {
11297 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11298 return false;
11299
11300 if (stack_max_limit)
11301 {
11302 Magazine other_mag = Magazine.Cast(other_item);
11303 if (other_item)
11304 {
11305 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11306 return false;
11307 }
11308
11309 }
11310 }
11311 else
11312 {
11313
11315 return false;
11316
11318 return false;
11319 }
11320
11321 PlayerBase player = null;
11322 if (CastTo(player, GetHierarchyRootPlayer()))
11323 {
11324 if (player.GetInventory().HasAttachment(this))
11325 return false;
11326
11327 if (player.IsItemsToDelete())
11328 return false;
11329 }
11330
11331 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11332 return false;
11333
11334 int slotID;
11336 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11337 return false;
11338
11339 return true;
11340 }
11341
11343 {
11345 }
11346
11348 {
11349 return m_IsResultOfSplit;
11350 }
11351
11353 {
11354 m_IsResultOfSplit = value;
11355 }
11356
11358 {
11360 }
11361
11363 {
11364 float other_item_quantity = other_item.GetQuantity();
11365 float this_free_space;
11366
11368
11370
11371 if (other_item_quantity > this_free_space)
11372 {
11373 return this_free_space;
11374 }
11375 else
11376 {
11377 return other_item_quantity;
11378 }
11379 }
11380
11382 {
11384 }
11385
11387 {
11389 return;
11390
11391 if (!IsMagazine() && other_item)
11392 {
11394 if (quantity_used != 0)
11395 {
11396 float hp1 = GetHealth01("","");
11397 float hp2 = other_item.GetHealth01("","");
11398 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11399 hpResult = hpResult / (
GetQuantity() + quantity_used);
11400
11401 hpResult *= GetMaxHealth();
11402 Math.Round(hpResult);
11403 SetHealth("", "Health", hpResult);
11404
11406 other_item.AddQuantity(-quantity_used);
11407 }
11408 }
11410 }
11411
11413 {
11414 #ifdef SERVER
11415 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11416 GetHierarchyParent().IncreaseLifetimeUp();
11417 #endif
11418 };
11419
11421 {
11422 PlayerBase p = PlayerBase.Cast(player);
11423
11424 array<int> recipesIds = p.m_Recipes;
11425 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11426 if (moduleRecipesManager)
11427 {
11428 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11429 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11430 }
11431
11432 for (int i = 0;i < recipesIds.Count(); i++)
11433 {
11434 int key = recipesIds.Get(i);
11435 string recipeName = moduleRecipesManager.GetRecipeName(key);
11437 }
11438 }
11439
11440
11441 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11442 {
11443 super.GetDebugActions(outputList);
11444
11445
11450
11451
11455
11459
11460
11463
11464
11466 {
11469 }
11470
11472
11475
11479 }
11480
11481
11482
11483
11485 {
11486 super.OnAction(action_id, player, ctx);
11487 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11488 {
11489 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11490 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11491 PlayerBase p = PlayerBase.Cast(player);
11492 if (
EActions.RECIPES_RANGE_START < 1000)
11493 {
11494 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11495 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11496 }
11497 }
11498 #ifndef SERVER
11499 else if (action_id ==
EActions.WATCH_PLAYER)
11500 {
11501 PluginDeveloper.SetDeveloperItemClientEx(player);
11502 }
11503 #endif
11505 {
11506 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11507 {
11508 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11509 OnDebugButtonPressServer(id + 1);
11510 }
11511
11512 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11513 {
11514 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11516 }
11517
11518 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11519 {
11520 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11522 }
11523
11524 else if (action_id ==
EActions.ADD_QUANTITY)
11525 {
11526 if (IsMagazine())
11527 {
11528 Magazine mag = Magazine.Cast(this);
11529 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11530 }
11531 else
11532 {
11534 }
11535
11536 if (m_EM)
11537 {
11538 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11539 }
11540
11541 }
11542
11543 else if (action_id ==
EActions.REMOVE_QUANTITY)
11544 {
11545 if (IsMagazine())
11546 {
11547 Magazine mag2 = Magazine.Cast(this);
11548 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11549 }
11550 else
11551 {
11553 }
11554 if (m_EM)
11555 {
11556 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11557 }
11558
11559 }
11560
11561 else if (action_id ==
EActions.SET_QUANTITY_0)
11562 {
11564
11565 if (m_EM)
11566 {
11567 m_EM.SetEnergy(0);
11568 }
11569 }
11570
11571 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11572 {
11574
11575 if (m_EM)
11576 {
11577 m_EM.SetEnergy(m_EM.GetEnergyMax());
11578 }
11579 }
11580
11581 else if (action_id ==
EActions.ADD_HEALTH)
11582 {
11583 AddHealth("","",GetMaxHealth("","Health")/5);
11584 }
11585 else if (action_id ==
EActions.REMOVE_HEALTH)
11586 {
11587 AddHealth("","",-GetMaxHealth("","Health")/5);
11588 }
11589 else if (action_id ==
EActions.DESTROY_HEALTH)
11590 {
11591 SetHealth01("","",0);
11592 }
11593 else if (action_id ==
EActions.WATCH_ITEM)
11594 {
11596 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11597 #ifdef DEVELOPER
11598 SetDebugDeveloper_item(this);
11599 #endif
11600 }
11601
11602 else if (action_id ==
EActions.ADD_TEMPERATURE)
11603 {
11604 AddTemperature(20);
11605
11606 }
11607
11608 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11609 {
11610 AddTemperature(-20);
11611
11612 }
11613
11614 else if (action_id ==
EActions.FLIP_FROZEN)
11615 {
11616 SetFrozen(!GetIsFrozen());
11617
11618 }
11619
11620 else if (action_id ==
EActions.ADD_WETNESS)
11621 {
11623
11624 }
11625
11626 else if (action_id ==
EActions.REMOVE_WETNESS)
11627 {
11629
11630 }
11631
11632 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11633 {
11636
11637
11638 }
11639
11640 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11641 {
11644 }
11645
11646 else if (action_id ==
EActions.MAKE_SPECIAL)
11647 {
11648 auto debugParams = DebugSpawnParams.WithPlayer(player);
11649 OnDebugSpawnEx(debugParams);
11650 }
11651
11652 else if (action_id ==
EActions.DELETE)
11653 {
11654 Delete();
11655 }
11656
11657 }
11658
11659
11660 return false;
11661 }
11662
11663
11664
11665
11669
11672
11673
11674
11676 {
11677 return false;
11678 }
11679
11680
11682 {
11683 return true;
11684 }
11685
11686
11688 {
11689 return true;
11690 }
11691
11692
11693
11695 {
11696 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11698 }
11699
11702 {
11703 return null;
11704 }
11705
11707 {
11708 return false;
11709 }
11710
11712 {
11713 return false;
11714 }
11715
11719
11720
11722 {
11723 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11724 return module_repairing.CanRepair(this, item_repair_kit);
11725 }
11726
11727
11728 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11729 {
11730 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11731 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11732 }
11733
11734
11736 {
11737
11738
11739
11740
11741
11742
11743
11744
11745 return 1;
11746 }
11747
11748
11749
11751 {
11753 }
11754
11755
11756
11758 {
11760 }
11761
11762
11771 {
11772 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11773
11774 if (player)
11775 {
11776 player.MessageStatus(text);
11777 }
11778 }
11779
11780
11789 {
11790 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11791
11792 if (player)
11793 {
11794 player.MessageAction(text);
11795 }
11796 }
11797
11798
11807 {
11808 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11809
11810 if (player)
11811 {
11812 player.MessageFriendly(text);
11813 }
11814 }
11815
11816
11825 {
11826 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11827
11828 if (player)
11829 {
11830 player.MessageImportant(text);
11831 }
11832 }
11833
11835 {
11836 return true;
11837 }
11838
11839
11840 override bool KindOf(
string tag)
11841 {
11842 bool found = false;
11843 string item_name = this.
GetType();
11846
11847 int array_size = item_tag_array.Count();
11848 for (int i = 0; i < array_size; i++)
11849 {
11850 if (item_tag_array.Get(i) == tag)
11851 {
11852 found = true;
11853 break;
11854 }
11855 }
11856 return found;
11857 }
11858
11859
11861 {
11862
11863 super.OnRPC(sender, rpc_type,ctx);
11864
11865
11866 switch (rpc_type)
11867 {
11868 #ifndef SERVER
11869 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11870 Param2<bool, string> p = new Param2<bool, string>(false, "");
11871
11873 return;
11874
11875 bool play = p.param1;
11876 string soundSet = p.param2;
11877
11878 if (play)
11879 {
11881 {
11883 {
11885 }
11886 }
11887 else
11888 {
11890 }
11891 }
11892 else
11893 {
11895 }
11896
11897 break;
11898 #endif
11899
11900 }
11901
11903 {
11905 }
11906 }
11907
11908
11909
11910
11912 {
11913 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11914 return plugin.GetID(
name);
11915 }
11916
11918 {
11919 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11920 return plugin.GetName(id);
11921 }
11922
11925 {
11926
11927
11928 int varFlags;
11929 if (!ctx.
Read(varFlags))
11930 return;
11931
11932 if (varFlags & ItemVariableFlags.FLOAT)
11933 {
11935 }
11936 }
11937
11939 {
11940
11941 super.SerializeNumericalVars(floats_out);
11942
11943
11944
11946 {
11948 }
11949
11951 {
11953 }
11954
11956 {
11958 }
11959
11961 {
11966 }
11967
11969 {
11971 }
11972 }
11973
11975 {
11976
11977 super.DeSerializeNumericalVars(floats);
11978
11979
11980 int index = 0;
11981 int mask = Math.Round(floats.Get(index));
11982
11983 index++;
11984
11986 {
11988 {
11990 }
11991 else
11992 {
11993 float quantity = floats.Get(index);
11994 SetQuantity(quantity,
true,
false,
false,
false);
11995 }
11996 index++;
11997 }
11998
12000 {
12001 float wet = floats.Get(index);
12003 index++;
12004 }
12005
12007 {
12008 int liquidtype = Math.Round(floats.Get(index));
12010 index++;
12011 }
12012
12014 {
12016 index++;
12018 index++;
12020 index++;
12022 index++;
12023 }
12024
12026 {
12027 int cleanness = Math.Round(floats.Get(index));
12029 index++;
12030 }
12031 }
12032
12034 {
12035 super.WriteVarsToCTX(ctx);
12036
12037
12039 {
12041 }
12042
12044 {
12046 }
12047
12049 {
12051 }
12052
12054 {
12055 int r,g,b,a;
12061 }
12062
12064 {
12066 }
12067 }
12068
12070 {
12071 if (!super.ReadVarsFromCTX(ctx,version))
12072 return false;
12073
12074 int intValue;
12075 float value;
12076
12077 if (version < 140)
12078 {
12079 if (!ctx.
Read(intValue))
12080 return false;
12081
12082 m_VariablesMask = intValue;
12083 }
12084
12086 {
12087 if (!ctx.
Read(value))
12088 return false;
12089
12091 {
12093 }
12094 else
12095 {
12097 }
12098 }
12099
12100 if (version < 140)
12101 {
12103 {
12104 if (!ctx.
Read(value))
12105 return false;
12106 SetTemperatureDirect(value);
12107 }
12108 }
12109
12111 {
12112 if (!ctx.
Read(value))
12113 return false;
12115 }
12116
12118 {
12119 if (!ctx.
Read(intValue))
12120 return false;
12122 }
12123
12125 {
12126 int r,g,b,a;
12128 return false;
12130 return false;
12132 return false;
12134 return false;
12135
12137 }
12138
12140 {
12141 if (!ctx.
Read(intValue))
12142 return false;
12144 }
12145
12146 if (version >= 138 && version < 140)
12147 {
12149 {
12150 if (!ctx.
Read(intValue))
12151 return false;
12152 SetFrozen(intValue);
12153 }
12154 }
12155
12156 return true;
12157 }
12158
12159
12161 {
12164 {
12166 }
12167
12168 if (!super.OnStoreLoad(ctx, version))
12169 {
12171 return false;
12172 }
12173
12174 if (version >= 114)
12175 {
12176 bool hasQuickBarIndexSaved;
12177
12178 if (!ctx.
Read(hasQuickBarIndexSaved))
12179 {
12181 return false;
12182 }
12183
12184 if (hasQuickBarIndexSaved)
12185 {
12186 int itmQBIndex;
12187
12188
12189 if (!ctx.
Read(itmQBIndex))
12190 {
12192 return false;
12193 }
12194
12195 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12196 if (itmQBIndex != -1 && parentPlayer)
12197 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12198 }
12199 }
12200 else
12201 {
12202
12203 PlayerBase player;
12204 int itemQBIndex;
12205 if (version ==
int.
MAX)
12206 {
12207 if (!ctx.
Read(itemQBIndex))
12208 {
12210 return false;
12211 }
12212 }
12213 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12214 {
12215
12216 if (!ctx.
Read(itemQBIndex))
12217 {
12219 return false;
12220 }
12221 if (itemQBIndex != -1 && player)
12222 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12223 }
12224 }
12225
12226 if (version < 140)
12227 {
12228
12229 if (!LoadVariables(ctx, version))
12230 {
12232 return false;
12233 }
12234 }
12235
12236
12238 {
12240 return false;
12241 }
12242 if (version >= 132)
12243 {
12245 if (raib)
12246 {
12248 {
12250 return false;
12251 }
12252 }
12253 }
12254
12256 return true;
12257 }
12258
12259
12260
12262 {
12263 super.OnStoreSave(ctx);
12264
12265 PlayerBase player;
12266 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12267 {
12269
12270 int itemQBIndex = -1;
12271 itemQBIndex = player.FindQuickBarEntityIndex(this);
12272 ctx.
Write(itemQBIndex);
12273 }
12274 else
12275 {
12277 }
12278
12280
12282 if (raib)
12283 {
12285 }
12286 }
12287
12288
12290 {
12291 super.AfterStoreLoad();
12292
12294 {
12296 }
12297
12299 {
12302 }
12303 }
12304
12306 {
12307 super.EEOnAfterLoad();
12308
12310 {
12312 }
12313
12316 }
12317
12319 {
12320 return false;
12321 }
12322
12323
12324
12326 {
12328 {
12329 #ifdef PLATFORM_CONSOLE
12330
12332 {
12334 if (menu)
12335 {
12337 }
12338 }
12339 #endif
12340 }
12341
12343 {
12346 }
12347
12349 {
12350 SetWeightDirty();
12352 }
12354 {
12357 }
12358
12360 {
12363 }
12365 {
12368 }
12369
12370 super.OnVariablesSynchronized();
12371 }
12372
12373
12374
12376 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12377 {
12378 if (!IsServerCheck(allow_client))
12379 return false;
12380
12382 return false;
12383
12386
12387 if (value <= (min + 0.001))
12388 value = min;
12389
12390 if (value == min)
12391 {
12392 if (destroy_config)
12393 {
12394 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12395 if (dstr)
12396 {
12398 this.Delete();
12399 return true;
12400 }
12401 }
12402 else if (destroy_forced)
12403 {
12405 this.Delete();
12406 return true;
12407 }
12408
12410 }
12411
12414
12416 {
12418
12419 if (delta)
12421 }
12422
12424
12425 return false;
12426 }
12427
12428
12430 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12431 {
12433 }
12434
12436 {
12439 }
12440
12442 {
12445 }
12446
12449 {
12450 float value_clamped = Math.Clamp(value, 0, 1);
12452 SetQuantity(result, destroy_config, destroy_forced);
12453 }
12454
12455
12458 {
12460 }
12461
12463 {
12465 }
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12477 {
12478 int slot = -1;
12479 if (GetInventory())
12480 {
12481 InventoryLocation il = new InventoryLocation;
12482 GetInventory().GetCurrentInventoryLocation(il);
12484 }
12485
12487 }
12488
12490 {
12491 float quantity_max = 0;
12492
12494 {
12495 if (attSlotID != -1)
12496 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12497
12498 if (quantity_max <= 0)
12500 }
12501
12502 if (quantity_max <= 0)
12504
12505 return quantity_max;
12506 }
12507
12509 {
12511 }
12512
12514 {
12516 }
12517
12518
12520 {
12522 }
12523
12525 {
12527 }
12528
12530 {
12532 }
12533
12534
12536 {
12537
12538 float weightEx = GetWeightEx();
12539 float special = GetInventoryAndCargoWeight();
12540 return weightEx - special;
12541 }
12542
12543
12545 {
12547 }
12548
12550 {
12552 {
12553 #ifdef DEVELOPER
12554 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12555 {
12556 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12558 }
12559 #endif
12560
12561 return GetQuantity() * GetConfigWeightModified();
12562 }
12563 else if (HasEnergyManager())
12564 {
12565 #ifdef DEVELOPER
12566 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12567 {
12568 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12569 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12570 }
12571 #endif
12572 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12573 }
12574 else
12575 {
12576 #ifdef DEVELOPER
12577 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12578 {
12579 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12580 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12581 }
12582 #endif
12583 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12584 }
12585 }
12586
12589 {
12590 int item_count = 0;
12592
12593 if (GetInventory().GetCargo() != NULL)
12594 {
12595 item_count = GetInventory().GetCargo().GetItemCount();
12596 }
12597
12598 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12599 {
12600 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12601 if (item)
12602 item_count += item.GetNumberOfItems();
12603 }
12604 return item_count;
12605 }
12606
12609 {
12610 float weight = 0;
12611 float wetness = 1;
12612 if (include_wetness)
12615 {
12616 weight = wetness * m_ConfigWeight;
12617 }
12619 {
12620 weight = 1;
12621 }
12622 return weight;
12623 }
12624
12625
12626
12628 {
12629 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12630 {
12631 GameInventory inv = GetInventory();
12632 array<EntityAI> items = new array<EntityAI>;
12634 for (int i = 0; i < items.Count(); i++)
12635 {
12637 if (item)
12638 {
12640 }
12641 }
12642 }
12643 }
12644
12645
12646
12647
12649 {
12650 float energy = 0;
12651 if (HasEnergyManager())
12652 {
12653 energy = GetCompEM().GetEnergy();
12654 }
12655 return energy;
12656 }
12657
12658
12660 {
12661 super.OnEnergyConsumed();
12662
12664 }
12665
12667 {
12668 super.OnEnergyAdded();
12669
12671 }
12672
12673
12675 {
12676 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12677 {
12679 {
12680 float energy_0to1 = GetCompEM().GetEnergy0To1();
12682 }
12683 }
12684 }
12685
12686
12688 {
12689 return ConfigGetFloat("heatIsolation");
12690 }
12691
12693 {
12695 }
12696
12698 {
12699 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12700 if (
GetGame().ConfigIsExisting(paramPath))
12702
12703 return 0.0;
12704 }
12705
12707 {
12708 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12709 if (
GetGame().ConfigIsExisting(paramPath))
12711
12712 return 0.0;
12713 }
12714
12715 override void SetWet(
float value,
bool allow_client =
false)
12716 {
12717 if (!IsServerCheck(allow_client))
12718 return;
12719
12722
12724
12725 m_VarWet = Math.Clamp(value, min, max);
12726
12728 {
12731 }
12732 }
12733
12734 override void AddWet(
float value)
12735 {
12737 }
12738
12740 {
12742 }
12743
12745 {
12747 }
12748
12750 {
12752 }
12753
12755 {
12757 }
12758
12760 {
12762 }
12763
12764 override void OnWetChanged(
float newVal,
float oldVal)
12765 {
12768 if (newLevel != oldLevel)
12769 {
12771 }
12772 }
12773
12775 {
12776 SetWeightDirty();
12777 }
12778
12780 {
12781 return GetWetLevelInternal(
m_VarWet);
12782 }
12783
12784
12785
12787 {
12789 }
12790
12792 {
12794 }
12795
12797 {
12799 }
12800
12802 {
12804 }
12805
12806
12807
12809 {
12810 if (ConfigIsExisting("itemModelLength"))
12811 {
12812 return ConfigGetFloat("itemModelLength");
12813 }
12814 return 0;
12815 }
12816
12818 {
12819 if (ConfigIsExisting("itemAttachOffset"))
12820 {
12821 return ConfigGetFloat("itemAttachOffset");
12822 }
12823 return 0;
12824 }
12825
12826 override void SetCleanness(
int value,
bool allow_client =
false)
12827 {
12828 if (!IsServerCheck(allow_client))
12829 return;
12830
12832
12834
12837 }
12838
12840 {
12842 }
12843
12845 {
12846 return true;
12847 }
12848
12849
12850
12851
12853 {
12855 }
12856
12858 {
12860 }
12861
12862
12863
12864
12865 override void SetColor(
int r,
int g,
int b,
int a)
12866 {
12872 }
12874 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12875 {
12880 }
12881
12883 {
12885 }
12886
12889 {
12890 int r,g,b,a;
12892 r = r/255;
12893 g = g/255;
12894 b = b/255;
12895 a = a/255;
12896 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12897 }
12898
12899
12900
12901 override void SetLiquidType(
int value,
bool allow_client =
false)
12902 {
12903 if (!IsServerCheck(allow_client))
12904 return;
12905
12910 }
12911
12913 {
12914 return ConfigGetInt("varLiquidTypeInit");
12915 }
12916
12918 {
12920 }
12921
12923 {
12925 SetFrozen(false);
12926 }
12927
12930 {
12931 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12932 }
12933
12934
12937 {
12938 PlayerBase nplayer;
12939 if (PlayerBase.CastTo(nplayer, player))
12940 {
12942
12943 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12944 }
12945 }
12946
12947
12950 {
12951 PlayerBase nplayer;
12952 if (PlayerBase.CastTo(nplayer,player))
12953 {
12954
12955 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12956
12957 }
12958
12959
12960 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12961
12962
12963 if (HasEnergyManager())
12964 {
12965 GetCompEM().UpdatePlugState();
12966 }
12967 }
12968
12969
12971 {
12972 super.OnPlacementStarted(player);
12973
12975 }
12976
12977 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12978 {
12980 {
12981 m_AdminLog.OnPlacementComplete(player,
this);
12982 }
12983
12984 super.OnPlacementComplete(player, position, orientation);
12985 }
12986
12987
12988
12989
12990
12992 {
12994 {
12995 return true;
12996 }
12997 else
12998 {
12999 return false;
13000 }
13001 }
13002
13003
13005 {
13007 {
13009 }
13010 }
13011
13012
13014 {
13016 }
13017
13019 {
13021 }
13022
13023 override void InsertAgent(
int agent,
float count = 1)
13024 {
13025 if (count < 1)
13026 return;
13027
13029 }
13030
13033 {
13035 }
13036
13037
13039 {
13041 }
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13085 {
13087 return false;
13088 return true;
13089 }
13090
13092 {
13093
13095 }
13096
13097
13100 {
13101 super.CheckForRoofLimited(timeTresholdMS);
13102
13104 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13105 {
13106 m_PreviousRoofTestTime = time;
13107 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13108 }
13109 }
13110
13111
13113 {
13115 {
13116 return 0;
13117 }
13118
13119 if (GetInventory().GetAttachmentSlotsCount() != 0)
13120 {
13121 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13122 if (filter)
13123 return filter.GetProtectionLevel(type, false, system);
13124 else
13125 return 0;
13126 }
13127
13128 string subclassPath, entryName;
13129
13130 switch (type)
13131 {
13133 entryName = "biological";
13134 break;
13136 entryName = "chemical";
13137 break;
13138 default:
13139 entryName = "biological";
13140 break;
13141 }
13142
13143 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13144
13146 }
13147
13148
13149
13152 {
13153 if (!IsMagazine())
13155
13157 }
13158
13159
13160
13161
13162
13167 {
13168 return true;
13169 }
13170
13172 {
13174 }
13175
13176
13177
13178
13179
13181 {
13182 if (parent)
13183 {
13184 if (parent.IsInherited(DayZInfected))
13185 return true;
13186
13187 if (!parent.IsRuined())
13188 return true;
13189 }
13190
13191 return true;
13192 }
13193
13195 {
13196 if (!super.CanPutAsAttachment(parent))
13197 {
13198 return false;
13199 }
13200
13201 if (!IsRuined() && !parent.IsRuined())
13202 {
13203 return true;
13204 }
13205
13206 return false;
13207 }
13208
13210 {
13211
13212
13213
13214
13215 return super.CanReceiveItemIntoCargo(item);
13216 }
13217
13219 {
13220
13221
13222
13223
13224 GameInventory attachmentInv = attachment.GetInventory();
13226 {
13227 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13228 return false;
13229 }
13230
13231 InventoryLocation loc = new InventoryLocation();
13232 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13233 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13234 return false;
13235
13236 return super.CanReceiveAttachment(attachment, slotId);
13237 }
13238
13240 {
13241 if (!super.CanReleaseAttachment(attachment))
13242 return false;
13243
13244 return GetInventory().AreChildrenAccessible();
13245 }
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13268 {
13269 int id = muzzle_owner.GetMuzzleID();
13270 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13271
13272 if (WPOF_array)
13273 {
13274 for (int i = 0; i < WPOF_array.Count(); i++)
13275 {
13276 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13277
13278 if (WPOF)
13279 {
13280 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13281 }
13282 }
13283 }
13284 }
13285
13286
13288 {
13289 int id = muzzle_owner.GetMuzzleID();
13291
13292 if (WPOBE_array)
13293 {
13294 for (int i = 0; i < WPOBE_array.Count(); i++)
13295 {
13296 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13297
13298 if (WPOBE)
13299 {
13300 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13301 }
13302 }
13303 }
13304 }
13305
13306
13308 {
13309 int id = muzzle_owner.GetMuzzleID();
13310 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13311
13312 if (WPOOH_array)
13313 {
13314 for (int i = 0; i < WPOOH_array.Count(); i++)
13315 {
13316 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13317
13318 if (WPOOH)
13319 {
13320 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13321 }
13322 }
13323 }
13324 }
13325
13326
13328 {
13329 int id = muzzle_owner.GetMuzzleID();
13330 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13331
13332 if (WPOOH_array)
13333 {
13334 for (int i = 0; i < WPOOH_array.Count(); i++)
13335 {
13336 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13337
13338 if (WPOOH)
13339 {
13340 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13341 }
13342 }
13343 }
13344 }
13345
13346
13348 {
13349 int id = muzzle_owner.GetMuzzleID();
13350 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13351
13352 if (WPOOH_array)
13353 {
13354 for (int i = 0; i < WPOOH_array.Count(); i++)
13355 {
13356 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13357
13358 if (WPOOH)
13359 {
13360 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13361 }
13362 }
13363 }
13364 }
13365
13366
13367
13369 {
13371 {
13372 return true;
13373 }
13374
13375 return false;
13376 }
13377
13379 {
13381 {
13382 return true;
13383 }
13384
13385 return false;
13386 }
13387
13389 {
13391 {
13392 return true;
13393 }
13394
13395 return false;
13396 }
13397
13399 {
13400 return false;
13401 }
13402
13405 {
13406 return UATimeSpent.DEFAULT_DEPLOY;
13407 }
13408
13409
13410
13411
13413 {
13415 SetSynchDirty();
13416 }
13417
13419 {
13421 }
13422
13423
13425 {
13426 return false;
13427 }
13428
13431 {
13432 string att_type = "None";
13433
13434 if (ConfigIsExisting("soundAttType"))
13435 {
13436 att_type = ConfigGetString("soundAttType");
13437 }
13438
13440 }
13441
13443 {
13445 }
13446
13447
13448
13449
13450
13454
13456 {
13459
13461 }
13462
13463
13465 {
13467 return;
13468
13470
13473
13476
13477 SoundParameters params = new SoundParameters();
13481 }
13482
13483
13485 {
13487 return;
13488
13490 SetSynchDirty();
13491
13494 }
13495
13496
13498 {
13500 return;
13501
13503 SetSynchDirty();
13504
13507 }
13508
13510 {
13512 }
13513
13515 {
13517 }
13518
13521 {
13522 if (!
GetGame().IsDedicatedServer())
13523 {
13524 if (ConfigIsExisting("attachSoundSet"))
13525 {
13526 string cfg_path = "";
13527 string soundset = "";
13528 string type_name =
GetType();
13529
13532 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13533 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13534
13535 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13536 {
13537 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13538 {
13539 if (cfg_slot_array[i] == slot_type)
13540 {
13541 soundset = cfg_soundset_array[i];
13542 break;
13543 }
13544 }
13545 }
13546
13547 if (soundset != "")
13548 {
13549 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13551 }
13552 }
13553 }
13554 }
13555
13557 {
13558
13559 }
13560
13561 void OnApply(PlayerBase player);
13562
13564 {
13565 return 1.0;
13566 };
13567
13569 {
13571 }
13572
13574 {
13576 }
13577
13579
13581 {
13582 SetDynamicPhysicsLifeTime(0.01);
13584 }
13585
13587 {
13588 array<string> zone_names = new array<string>;
13589 GetDamageZones(zone_names);
13590 for (int i = 0; i < zone_names.Count(); i++)
13591 {
13592 SetHealthMax(zone_names.Get(i),"Health");
13593 }
13594 SetHealthMax("","Health");
13595 }
13596
13599 {
13600 float global_health = GetHealth01("","Health");
13601 array<string> zones = new array<string>;
13602 GetDamageZones(zones);
13603
13604 for (int i = 0; i < zones.Count(); i++)
13605 {
13606 SetHealth01(zones.Get(i),"Health",global_health);
13607 }
13608 }
13609
13612 {
13613 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13614 }
13615
13617 {
13618 if (!hasRootAsPlayer)
13619 {
13620 if (refParentIB)
13621 {
13622
13623 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13624 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13625
13626 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13627 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13628
13631 }
13632 else
13633 {
13634
13637 }
13638 }
13639 }
13640
13642 {
13644 {
13645 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13646 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13647 {
13648 float heatPermCoef = 1.0;
13650 while (ent)
13651 {
13652 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13653 ent = ent.GetHierarchyParent();
13654 }
13655
13656 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13657 }
13658 }
13659 }
13660
13662 {
13663
13664 EntityAI parent = GetHierarchyParent();
13665 if (!parent)
13666 {
13667 hasParent = false;
13668 hasRootAsPlayer = false;
13669 }
13670 else
13671 {
13672 hasParent = true;
13673 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13674 refParentIB =
ItemBase.Cast(parent);
13675 }
13676 }
13677
13678 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13679 {
13680
13681 }
13682
13684 {
13685
13686 return false;
13687 }
13688
13690 {
13691
13692
13693 return false;
13694 }
13695
13697 {
13698
13699 return false;
13700 }
13701
13704 {
13705 return !GetIsFrozen() &&
IsOpen();
13706 }
13707
13709 {
13710 bool hasParent = false, hasRootAsPlayer = false;
13712
13713 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13714 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13715
13716 if (wwtu || foodDecay)
13717 {
13721
13722 if (processWetness || processTemperature || processDecay)
13723 {
13725
13726 if (processWetness)
13727 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13728
13729 if (processTemperature)
13731
13732 if (processDecay)
13733 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13734 }
13735 }
13736 }
13737
13740 {
13742 }
13743
13745 {
13748
13749 return super.GetTemperatureFreezeThreshold();
13750 }
13751
13753 {
13756
13757 return super.GetTemperatureThawThreshold();
13758 }
13759
13761 {
13764
13765 return super.GetItemOverheatThreshold();
13766 }
13767
13769 {
13771 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13772
13773 return super.GetTemperatureFreezeTime();
13774 }
13775
13777 {
13779 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13780
13781 return super.GetTemperatureThawTime();
13782 }
13783
13788
13790 {
13791 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13792 }
13793
13795 {
13796 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13797 }
13798
13801 {
13803 }
13804
13806 {
13808 }
13809
13811 {
13813 }
13814
13817 {
13818 return null;
13819 }
13820
13823 {
13824 return false;
13825 }
13826
13828 {
13830 {
13833 if (!trg)
13834 {
13836 explosive = this;
13837 }
13838
13839 explosive.PairRemote(trg);
13841
13842 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13843 trg.SetPersistentPairID(persistentID);
13844 explosive.SetPersistentPairID(persistentID);
13845
13846 return true;
13847 }
13848 return false;
13849 }
13850
13853 {
13854 float ret = 1.0;
13857 ret *= GetHealth01();
13858
13859 return ret;
13860 }
13861
13862 #ifdef DEVELOPER
13863 override void SetDebugItem()
13864 {
13865 super.SetDebugItem();
13866 _itemBase = this;
13867 }
13868
13870 {
13871 string text = super.GetDebugText();
13872
13874 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13875
13876 return text;
13877 }
13878 #endif
13879
13881 {
13882 return true;
13883 }
13884
13886
13888
13890 {
13893 }
13894
13895
13903
13919}
13920
13922{
13924 if (entity)
13925 {
13926 bool is_item = entity.IsInherited(
ItemBase);
13927 if (is_item && full_quantity)
13928 {
13931 }
13932 }
13933 else
13934 {
13936 return NULL;
13937 }
13938 return entity;
13939}
13940
13942{
13943 if (item)
13944 {
13945 if (health > 0)
13946 item.SetHealth("", "", health);
13947
13948 if (item.CanHaveTemperature())
13949 {
13951 if (item.CanFreeze())
13952 item.SetFrozen(false);
13953 }
13954
13955 if (item.HasEnergyManager())
13956 {
13957 if (quantity >= 0)
13958 {
13959 item.GetCompEM().SetEnergy0To1(quantity);
13960 }
13961 else
13962 {
13964 }
13965 }
13966 else if (item.IsMagazine())
13967 {
13968 Magazine mag = Magazine.Cast(item);
13969 if (quantity >= 0)
13970 {
13971 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13972 }
13973 else
13974 {
13976 }
13977
13978 }
13979 else
13980 {
13981 if (quantity >= 0)
13982 {
13983 item.SetQuantityNormalized(quantity, false);
13984 }
13985 else
13986 {
13988 }
13989
13990 }
13991 }
13992}
13993
13994#ifdef DEVELOPER
13996#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.