9098{
9100 {
9101 return true;
9102 }
9103};
9104
9105
9106
9108{
9112
9114
9117
9118
9119
9120
9121
9130
9136
9141
9146
9167 protected bool m_IsResultOfSplit
9168
9170
9175
9176
9177
9179
9183
9184
9185
9187
9190
9191
9192
9198
9199
9207
9210
9211
9213
9214
9216
9217
9222
9223
9228
9229
9231
9232
9234 {
9239
9240 if (!
GetGame().IsDedicatedServer())
9241 {
9243 {
9245
9247 {
9249 }
9250 }
9251
9254 }
9255
9256 m_OldLocation = null;
9257
9259 {
9261 }
9262
9263 if (ConfigIsExisting("headSelectionsToHide"))
9264 {
9267 }
9268
9270 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9271 {
9273 }
9274
9276
9277 m_IsResultOfSplit = false;
9278
9280 }
9281
9283 {
9284 super.InitItemVariables();
9285
9291 m_Count = ConfigGetInt(
"count");
9292
9295
9300
9303
9308
9320
9324
9325
9328 if (ConfigIsExisting("canBeSplit"))
9329 {
9332 }
9333
9335 if (ConfigIsExisting("itemBehaviour"))
9337
9338
9341 RegisterNetSyncVariableInt("m_VarLiquidType");
9342 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9343
9344 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9345 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9346 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9347
9348 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9349 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9350 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9351 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9352
9353 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9354 RegisterNetSyncVariableBool("m_IsTakeable");
9355 RegisterNetSyncVariableBool("m_IsHologram");
9356
9359 {
9362 }
9363
9365
9367 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9369
9370 }
9371
9373 {
9375 }
9376
9378 {
9381 {
9386 }
9387 }
9388
9389 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9390 {
9392 {
9395 }
9396
9398 }
9399
9401 {
9407 }
9408
9410
9412 {
9414
9415 if (!action)
9416 {
9417 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9418 return;
9419 }
9420
9422 if (!ai)
9423 {
9425 return;
9426 }
9427
9429 if (!action_array)
9430 {
9431 action_array = new array<ActionBase_Basic>;
9433 }
9434 if (LogManager.IsActionLogEnable())
9435 {
9436 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9437 }
9438
9439 if (action_array.Find(action) != -1)
9440 {
9441 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9442 }
9443 else
9444 {
9445 action_array.Insert(action);
9446 }
9447 }
9448
9450 {
9452 ActionBase action = player.GetActionManager().GetAction(actionName);
9455
9456 if (action_array)
9457 {
9458 action_array.RemoveItem(action);
9459 }
9460 }
9461
9462
9463
9465 {
9466 ActionOverrideData overrideData = new ActionOverrideData();
9470
9472 if (!actionMap)
9473 {
9476 }
9477
9478 actionMap.Insert(this.
Type(), overrideData);
9479
9480 }
9481
9483
9485
9486
9488 {
9491
9494
9495 string config_to_search = "CfgVehicles";
9496 string muzzle_owner_config;
9497
9499 {
9500 if (IsInherited(Weapon))
9501 config_to_search = "CfgWeapons";
9502
9503 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9504
9505 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9506
9508
9509 if (config_OnFire_subclass_count > 0)
9510 {
9511 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9512
9513 for (int i = 0; i < config_OnFire_subclass_count; i++)
9514 {
9515 string particle_class = "";
9517 string config_OnFire_entry = config_OnFire_class + particle_class;
9518 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9519 WPOF_array.Insert(WPOF);
9520 }
9521
9522
9524 }
9525 }
9526
9528 {
9529 config_to_search = "CfgWeapons";
9530 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9531
9532 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9533
9535
9536 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9537 {
9538 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9539
9540 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9541 {
9542 string particle_class2 = "";
9544 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9545 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9546 WPOBE_array.Insert(WPOBE);
9547 }
9548
9549
9551 }
9552 }
9553 }
9554
9555
9557 {
9560
9562 {
9563 string config_to_search = "CfgVehicles";
9564
9565 if (IsInherited(Weapon))
9566 config_to_search = "CfgWeapons";
9567
9568 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9569 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9570
9571 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9572 {
9573
9575
9577 {
9579 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9581 return;
9582 }
9583
9586
9587
9588
9590 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9591
9592 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9593 {
9594 string particle_class = "";
9596 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9598
9599 if (entry_type == CT_CLASS)
9600 {
9601 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9602 WPOOH_array.Insert(WPOF);
9603 }
9604 }
9605
9606
9608 }
9609 }
9610 }
9611
9613 {
9615 }
9616
9618 {
9620 {
9622
9625
9628
9629 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9630 }
9631 }
9632
9634 {
9636 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9637
9639 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9640
9642 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9643
9645 {
9647 }
9648 }
9649
9651 {
9653 }
9654
9656 {
9659 else
9661
9663 {
9666 }
9667 else
9668 {
9671
9674 }
9675
9677 }
9678
9680 {
9682 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9683 }
9684
9686 {
9688 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9690 }
9691
9693 {
9695 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9696 }
9697
9699 {
9702
9703 OverheatingParticle OP = new OverheatingParticle();
9708
9710 }
9711
9713 {
9716
9717 return -1;
9718 }
9719
9721 {
9723 {
9726
9727 for (int i = count; i > 0; --i)
9728 {
9729 int id = i - 1;
9732
9735
9736 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9737 {
9738 if (p)
9739 {
9742 }
9743 }
9744 }
9745 }
9746 }
9747
9749 {
9751 {
9753 {
9754 int id = i - 1;
9756
9757 if (OP)
9758 {
9760
9761 if (p)
9762 {
9764 }
9765
9766 delete OP;
9767 }
9768 }
9769
9772 }
9773 }
9774
9777 {
9778 return 0.0;
9779 }
9780
9781
9783 {
9784 return 250;
9785 }
9786
9788 {
9789 return 0;
9790 }
9791
9794 {
9796 return true;
9797
9798 return false;
9799 }
9800
9803 {
9806
9808 {
9810 }
9811 else
9812 {
9813
9815 }
9816
9818 }
9819
9826 {
9827 return -1;
9828 }
9829
9830
9831
9832
9834 {
9836 {
9838 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9839
9840 if (r_index >= 0)
9841 {
9842 InventoryLocation r_il = new InventoryLocation;
9843 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9844
9845 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9848 {
9849 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9850 }
9852 {
9853 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9854 }
9855
9856 }
9857
9858 player.GetHumanInventory().ClearUserReservedLocation(this);
9859 }
9860
9863 }
9864
9865
9866
9867
9869 {
9870 return ItemBase.m_DebugActionsMask;
9871 }
9872
9874 {
9875 return ItemBase.m_DebugActionsMask & mask;
9876 }
9877
9879 {
9880 ItemBase.m_DebugActionsMask = mask;
9881 }
9882
9884 {
9885 ItemBase.m_DebugActionsMask |= mask;
9886 }
9887
9889 {
9890 ItemBase.m_DebugActionsMask &= ~mask;
9891 }
9892
9894 {
9896 {
9898 }
9899 else
9900 {
9902 }
9903 }
9904
9905
9907 {
9908 if (GetEconomyProfile())
9909 {
9910 float q_max = GetEconomyProfile().GetQuantityMax();
9911 if (q_max > 0)
9912 {
9913 float q_min = GetEconomyProfile().GetQuantityMin();
9914 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9915
9917 {
9918 ComponentEnergyManager comp = GetCompEM();
9920 {
9922 }
9923 }
9925 {
9927
9928 }
9929
9930 }
9931 }
9932 }
9933
9936 {
9937 EntityAI parent = GetHierarchyParent();
9938
9939 if (parent)
9940 {
9941 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9942 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9943 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9944 }
9945 }
9946
9949 {
9950 EntityAI parent = GetHierarchyParent();
9951
9952 if (parent)
9953 {
9954 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9955 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9956 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9957 }
9958 }
9959
9961 {
9962
9963
9964
9965
9967
9969 {
9970 if (ScriptInputUserData.CanStoreInputUserData())
9971 {
9972 ScriptInputUserData ctx = new ScriptInputUserData;
9978 ctx.
Write(use_stack_max);
9981
9983 {
9984 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9985 }
9986 }
9987 }
9988 else if (!
GetGame().IsMultiplayer())
9989 {
9991 }
9992 }
9993
9995 {
9997 }
9998
10000 {
10002 }
10003
10005 {
10007 }
10008
10010 {
10011
10012 return false;
10013 }
10014
10016 {
10017 return false;
10018 }
10019
10023 {
10024 return false;
10025 }
10026
10028 {
10029 return "";
10030 }
10031
10033
10035 {
10036 return false;
10037 }
10038
10040 {
10041 return true;
10042 }
10043
10044
10045
10047 {
10048 return true;
10049 }
10050
10052 {
10053 return true;
10054 }
10055
10057 {
10058 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10060 }
10061
10063 {
10065 }
10066
10068 {
10070 if (!is_being_placed)
10072 SetSynchDirty();
10073 }
10074
10075
10077
10079 {
10081 }
10082
10084 {
10086 }
10087
10089 {
10090 return 1;
10091 }
10092
10094 {
10095 return false;
10096 }
10097
10099 {
10101 SetSynchDirty();
10102 }
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10139 {
10140 super.OnMovedInsideCargo(container);
10141
10142 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10143 }
10144
10145 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10146 {
10147 super.EEItemLocationChanged(oldLoc,newLoc);
10148
10149 PlayerBase new_player = null;
10150 PlayerBase old_player = null;
10151
10152 if (newLoc.GetParent())
10153 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10154
10155 if (oldLoc.GetParent())
10156 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10157
10159 {
10160 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10161
10162 if (r_index >= 0)
10163 {
10164 InventoryLocation r_il = new InventoryLocation;
10165 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10166
10167 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10170 {
10171 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10172 }
10174 {
10175 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10176 }
10177
10178 }
10179 }
10180
10182 {
10183 if (new_player)
10184 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10185
10186 if (new_player == old_player)
10187 {
10188
10189 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10190 {
10192 {
10193 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10194 {
10195 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10196 }
10197 }
10198 else
10199 {
10200 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10201 }
10202 }
10203
10204 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10205 {
10206 int type = oldLoc.GetType();
10208 {
10209 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10210 }
10212 {
10213 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10214 }
10215 }
10216 if (!m_OldLocation)
10217 {
10218 m_OldLocation = new InventoryLocation;
10219 }
10220 m_OldLocation.Copy(oldLoc);
10221 }
10222 else
10223 {
10224 if (m_OldLocation)
10225 {
10226 m_OldLocation.Reset();
10227 }
10228 }
10229
10231 }
10232 else
10233 {
10234 if (new_player)
10235 {
10236 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10237 if (res_index >= 0)
10238 {
10239 InventoryLocation il = new InventoryLocation;
10240 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10242 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10245 {
10246 il.
GetParent().GetOnReleaseLock().Invoke(it);
10247 }
10249 {
10251 }
10252
10253 }
10254 }
10256 {
10257
10259 }
10260
10261 if (m_OldLocation)
10262 {
10263 m_OldLocation.Reset();
10264 }
10265 }
10266 }
10267
10268 override void EOnContact(IEntity other, Contact extra)
10269 {
10271 {
10272 int liquidType = -1;
10274 if (impactSpeed > 0.0)
10275 {
10277 #ifndef SERVER
10279 #else
10281 SetSynchDirty();
10282 #endif
10284 }
10285 }
10286
10287 #ifdef SERVER
10288 if (GetCompEM() && GetCompEM().IsPlugged())
10289 {
10290 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10291 GetCompEM().UnplugThis();
10292 }
10293 #endif
10294 }
10295
10297
10299 {
10301 }
10302
10304 {
10305
10306 }
10307
10309 {
10310 super.OnItemLocationChanged(old_owner, new_owner);
10311
10312 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10313 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10314
10315 if (!relatedPlayer && playerNew)
10316 relatedPlayer = playerNew;
10317
10318 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10319 {
10321 if (actionMgr)
10322 {
10323 ActionBase currentAction = actionMgr.GetRunningAction();
10324 if (currentAction)
10326 }
10327 }
10328
10329 Man ownerPlayerOld = null;
10330 Man ownerPlayerNew = null;
10331
10332 if (old_owner)
10333 {
10334 if (old_owner.
IsMan())
10335 {
10336 ownerPlayerOld = Man.Cast(old_owner);
10337 }
10338 else
10339 {
10340 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10341 }
10342 }
10343 else
10344 {
10346 {
10348
10349 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10350 {
10351 GetCompEM().UnplugThis();
10352 }
10353 }
10354 }
10355
10356 if (new_owner)
10357 {
10358 if (new_owner.
IsMan())
10359 {
10360 ownerPlayerNew = Man.Cast(new_owner);
10361 }
10362 else
10363 {
10364 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10365 }
10366 }
10367
10368 if (ownerPlayerOld != ownerPlayerNew)
10369 {
10370 if (ownerPlayerOld)
10371 {
10372 array<EntityAI> subItemsExit = new array<EntityAI>;
10374 for (int i = 0; i < subItemsExit.Count(); i++)
10375 {
10378 }
10379 }
10380
10381 if (ownerPlayerNew)
10382 {
10383 array<EntityAI> subItemsEnter = new array<EntityAI>;
10385 for (int j = 0; j < subItemsEnter.Count(); j++)
10386 {
10389 }
10390 }
10391 }
10392 else if (ownerPlayerNew != null)
10393 {
10394 PlayerBase nplayer;
10395 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10396 {
10397 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10399 for (int k = 0; k < subItemsUpdate.Count(); k++)
10400 {
10402 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10403 }
10404 }
10405 }
10406
10407 if (old_owner)
10408 old_owner.OnChildItemRemoved(this);
10409 if (new_owner)
10410 new_owner.OnChildItemReceived(this);
10411 }
10412
10413
10415 {
10416 super.EEDelete(parent);
10417 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10418 if (player)
10419 {
10421
10422 if (player.IsAlive())
10423 {
10424 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10425 if (r_index >= 0)
10426 {
10427 InventoryLocation r_il = new InventoryLocation;
10428 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10429
10430 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10433 {
10434 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10435 }
10437 {
10438 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10439 }
10440
10441 }
10442
10443 player.RemoveQuickBarEntityShortcut(this);
10444 }
10445 }
10446 }
10447
10449 {
10450 super.EEKilled(killer);
10451
10454 {
10455 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10456 {
10457 if (IsMagazine())
10458 {
10459 if (Magazine.Cast(this).GetAmmoCount() > 0)
10460 {
10462 }
10463 }
10464 else
10465 {
10467 }
10468 }
10469 }
10470 }
10471
10473 {
10474 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10475
10476 super.OnWasAttached(parent, slot_id);
10477
10480
10482 }
10483
10485 {
10486 super.OnWasDetached(parent, slot_id);
10487
10490 }
10491
10493 {
10494 int idx;
10497
10498 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10499 if (inventory_slots.Count() < 1)
10500 {
10501 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10502 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10503 }
10504 else
10505 {
10506 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10507 }
10508
10509 idx = inventory_slots.Find(slot);
10510 if (idx < 0)
10511 return "";
10512
10513 return attach_types.Get(idx);
10514 }
10515
10517 {
10518 int idx = -1;
10519 string slot;
10520
10523
10524 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10525 if (inventory_slots.Count() < 1)
10526 {
10527 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10528 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10529 }
10530 else
10531 {
10532 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10533 if (detach_types.Count() < 1)
10534 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10535 }
10536
10537 for (int i = 0; i < inventory_slots.Count(); i++)
10538 {
10539 slot = inventory_slots.Get(i);
10540 }
10541
10542 if (slot != "")
10543 {
10544 if (detach_types.Count() == 1)
10545 idx = 0;
10546 else
10547 idx = inventory_slots.Find(slot);
10548 }
10549 if (idx < 0)
10550 return "";
10551
10552 return detach_types.Get(idx);
10553 }
10554
10556 {
10557
10559
10560
10561 float min_time = 1;
10562 float max_time = 3;
10563 float delay = Math.RandomFloat(min_time, max_time);
10564
10565 explode_timer.Run(delay, this, "DoAmmoExplosion");
10566 }
10567
10569 {
10570 Magazine magazine = Magazine.Cast(this);
10571 int pop_sounds_count = 6;
10572 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10573
10574
10575 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10576 string sound_name = pop_sounds[ sound_idx ];
10578
10579
10580 magazine.ServerAddAmmoCount(-1);
10581
10582
10583 float min_temp_to_explode = 100;
10584
10585 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10586 {
10588 }
10589 }
10590
10591
10592 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10593 {
10594 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10595
10596 const int CHANCE_DAMAGE_CARGO = 4;
10597 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10598 const int CHANCE_DAMAGE_NOTHING = 2;
10599
10601 {
10602 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10603 int chances;
10604 int rnd;
10605
10606 if (GetInventory().GetCargo())
10607 {
10608 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10609 rnd = Math.RandomInt(0,chances);
10610
10611 if (rnd < CHANCE_DAMAGE_CARGO)
10612 {
10614 }
10615 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10616 {
10618 }
10619 }
10620 else
10621 {
10622 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10623 rnd = Math.RandomInt(0,chances);
10624
10625 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10626 {
10628 }
10629 }
10630 }
10631 }
10632
10634 {
10635 if (GetInventory().GetCargo())
10636 {
10637 int item_count = GetInventory().GetCargo().GetItemCount();
10638 if (item_count > 0)
10639 {
10640 int random_pick = Math.RandomInt(0, item_count);
10642 if (!item.IsExplosive())
10643 {
10644 item.AddHealth("","",damage);
10645 return true;
10646 }
10647 }
10648 }
10649 return false;
10650 }
10651
10653 {
10654 int attachment_count = GetInventory().AttachmentCount();
10655 if (attachment_count > 0)
10656 {
10657 int random_pick = Math.RandomInt(0, attachment_count);
10658 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10659 if (!attachment.IsExplosive())
10660 {
10661 attachment.AddHealth("","",damage);
10662 return true;
10663 }
10664 }
10665 return false;
10666 }
10667
10669 {
10671 }
10672
10674 {
10676 return GetInventory().CanRemoveEntity();
10677
10678 return false;
10679 }
10680
10682 {
10684 return;
10685
10687 {
10688 if (ScriptInputUserData.CanStoreInputUserData())
10689 {
10690 ScriptInputUserData ctx = new ScriptInputUserData;
10695 ctx.
Write(destination_entity);
10697 ctx.
Write(slot_id);
10699 }
10700 }
10701 else if (!
GetGame().IsMultiplayer())
10702 {
10704 }
10705 }
10706
10708 {
10710 return;
10711
10712 float split_quantity_new;
10716 InventoryLocation loc = new InventoryLocation;
10717
10718 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10719 {
10721 split_quantity_new = stack_max;
10722 else
10724
10725 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10726 if (new_item)
10727 {
10728 new_item.SetResultOfSplit(true);
10729 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10731 new_item.SetQuantity(split_quantity_new);
10732 }
10733 }
10734 else if (destination_entity && slot_id == -1)
10735 {
10736 if (quantity > stack_max)
10737 split_quantity_new = stack_max;
10738 else
10739 split_quantity_new = quantity;
10740
10742 {
10745 }
10746
10747 if (new_item)
10748 {
10749 new_item.SetResultOfSplit(true);
10750 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10752 new_item.SetQuantity(split_quantity_new);
10753 }
10754 }
10755 else
10756 {
10757 if (stack_max != 0)
10758 {
10760 {
10762 }
10763
10764 if (split_quantity_new == 0)
10765 {
10766 if (!
GetGame().IsMultiplayer())
10767 player.PhysicalPredictiveDropItem(this);
10768 else
10769 player.ServerDropEntity(this);
10770 return;
10771 }
10772
10774
10775 if (new_item)
10776 {
10777 new_item.SetResultOfSplit(true);
10778 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10780 new_item.SetQuantity(stack_max);
10781 new_item.PlaceOnSurface();
10782 }
10783 }
10784 }
10785 }
10786
10788 {
10790 return;
10791
10792 float split_quantity_new;
10796 InventoryLocation loc = new InventoryLocation;
10797
10798 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10799 {
10801 split_quantity_new = stack_max;
10802 else
10804
10805 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10806 if (new_item)
10807 {
10808 new_item.SetResultOfSplit(true);
10809 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10811 new_item.SetQuantity(split_quantity_new);
10812 }
10813 }
10814 else if (destination_entity && slot_id == -1)
10815 {
10816 if (quantity > stack_max)
10817 split_quantity_new = stack_max;
10818 else
10819 split_quantity_new = quantity;
10820
10822 {
10825 }
10826
10827 if (new_item)
10828 {
10829 new_item.SetResultOfSplit(true);
10830 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10832 new_item.SetQuantity(split_quantity_new);
10833 }
10834 }
10835 else
10836 {
10837 if (stack_max != 0)
10838 {
10840 {
10842 }
10843
10845
10846 if (new_item)
10847 {
10848 new_item.SetResultOfSplit(true);
10849 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10851 new_item.SetQuantity(stack_max);
10852 new_item.PlaceOnSurface();
10853 }
10854 }
10855 }
10856 }
10857
10859 {
10861 return;
10862
10864 {
10865 if (ScriptInputUserData.CanStoreInputUserData())
10866 {
10867 ScriptInputUserData ctx = new ScriptInputUserData;
10872 dst.WriteToContext(ctx);
10874 }
10875 }
10876 else if (!
GetGame().IsMultiplayer())
10877 {
10879 }
10880 }
10881
10883 {
10885 return;
10886
10888 {
10889 if (ScriptInputUserData.CanStoreInputUserData())
10890 {
10891 ScriptInputUserData ctx = new ScriptInputUserData;
10896 ctx.
Write(destination_entity);
10902 }
10903 }
10904 else if (!
GetGame().IsMultiplayer())
10905 {
10907 }
10908 }
10909
10911 {
10913 }
10914
10916 {
10918 return this;
10919
10921 float split_quantity_new;
10923 if (dst.IsValid())
10924 {
10925 int slot_id = dst.GetSlot();
10927
10928 if (quantity > stack_max)
10929 split_quantity_new = stack_max;
10930 else
10931 split_quantity_new = quantity;
10932
10934
10935 if (new_item)
10936 {
10937 new_item.SetResultOfSplit(true);
10938 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10941 }
10942
10943 return new_item;
10944 }
10945
10946 return null;
10947 }
10948
10950 {
10952 return;
10953
10955 float split_quantity_new;
10957 if (destination_entity)
10958 {
10960 if (quantity > stackable)
10961 split_quantity_new = stackable;
10962 else
10963 split_quantity_new = quantity;
10964
10965 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10966 if (new_item)
10967 {
10968 new_item.SetResultOfSplit(true);
10969 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10971 new_item.SetQuantity(split_quantity_new);
10972 }
10973 }
10974 }
10975
10977 {
10979 return;
10980
10982 {
10983 if (ScriptInputUserData.CanStoreInputUserData())
10984 {
10985 ScriptInputUserData ctx = new ScriptInputUserData;
10990 ItemBase destination_entity =
this;
10991 ctx.
Write(destination_entity);
10995 }
10996 }
10997 else if (!
GetGame().IsMultiplayer())
10998 {
11000 }
11001 }
11002
11004 {
11006 return;
11007
11009 float split_quantity_new;
11011 if (player)
11012 {
11014 if (quantity > stackable)
11015 split_quantity_new = stackable;
11016 else
11017 split_quantity_new = quantity;
11018
11019 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11020 new_item =
ItemBase.Cast(in_hands);
11021 if (new_item)
11022 {
11023 new_item.SetResultOfSplit(true);
11024 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11026 new_item.SetQuantity(split_quantity_new);
11027 }
11028 }
11029 }
11030
11032 {
11034 return;
11035
11037 float split_quantity_new = Math.Floor(quantity * 0.5);
11038
11040
11041 if (new_item)
11042 {
11043 if (new_item.GetQuantityMax() < split_quantity_new)
11044 {
11045 split_quantity_new = new_item.GetQuantityMax();
11046 }
11047
11048 new_item.SetResultOfSplit(true);
11049 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11050
11052 {
11055 }
11056 else
11057 {
11060 }
11061 }
11062 }
11063
11065 {
11067 return;
11068
11070 float split_quantity_new = Math.Floor(quantity / 2);
11071
11072 InventoryLocation invloc = new InventoryLocation;
11074
11076 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11077
11078 if (new_item)
11079 {
11080 if (new_item.GetQuantityMax() < split_quantity_new)
11081 {
11082 split_quantity_new = new_item.GetQuantityMax();
11083 }
11085 {
11088 }
11089 else
11090 {
11093 }
11094 }
11095 }
11096
11099 {
11100 SetWeightDirty();
11102
11103 if (parent)
11104 parent.OnAttachmentQuantityChangedEx(this, delta);
11105
11107 {
11109 {
11111 }
11113 {
11114 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11116 }
11117 }
11118
11119 }
11120
11123 {
11124
11125 }
11126
11129 {
11131 }
11132
11134 {
11135 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11136
11138 {
11139 if (newLevel == GameConstants.STATE_RUINED)
11140 {
11142 EntityAI parent = GetHierarchyParent();
11143 if (parent && parent.IsFireplace())
11144 {
11145 CargoBase cargo = GetInventory().GetCargo();
11146 if (cargo)
11147 {
11149 {
11151 }
11152 }
11153 }
11154 }
11155
11157 {
11158
11160 return;
11161 }
11162
11163 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11164 {
11166 }
11167 }
11168 }
11169
11170
11172 {
11173 super.OnRightClick();
11174
11176 {
11178 {
11179 if (ScriptInputUserData.CanStoreInputUserData())
11180 {
11181 vector m4[4];
11183
11184 EntityAI root = GetHierarchyRoot();
11185
11186 InventoryLocation dst = new InventoryLocation;
11188 {
11189 if (root)
11190 {
11191 root.GetTransform(m4);
11193 }
11194 else
11195 GetInventory().GetCurrentInventoryLocation(dst);
11196 }
11197 else
11198 {
11200
11201
11202 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11203 {
11204 if (root)
11205 {
11206 root.GetTransform(m4);
11208 }
11209 else
11210 GetInventory().GetCurrentInventoryLocation(dst);
11211 }
11212 else
11213 {
11214 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11215 }
11216 }
11217
11218 ScriptInputUserData ctx = new ScriptInputUserData;
11226 }
11227 }
11228 else if (!
GetGame().IsMultiplayer())
11229 {
11231 }
11232 }
11233 }
11234
11235 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11236 {
11237
11238 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11239 return false;
11240
11241 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11242 return false;
11243
11244
11246 return false;
11247
11248
11249 Magazine mag = Magazine.Cast(this);
11250 if (mag)
11251 {
11252 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11253 return false;
11254
11255 if (stack_max_limit)
11256 {
11257 Magazine other_mag = Magazine.Cast(other_item);
11258 if (other_item)
11259 {
11260 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11261 return false;
11262 }
11263
11264 }
11265 }
11266 else
11267 {
11268
11270 return false;
11271
11273 return false;
11274 }
11275
11276 PlayerBase player = null;
11277 if (CastTo(player, GetHierarchyRootPlayer()))
11278 {
11279 if (player.GetInventory().HasAttachment(this))
11280 return false;
11281
11282 if (player.IsItemsToDelete())
11283 return false;
11284 }
11285
11286 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11287 return false;
11288
11289 int slotID;
11291 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11292 return false;
11293
11294 return true;
11295 }
11296
11298 {
11300 }
11301
11303 {
11304 return m_IsResultOfSplit;
11305 }
11306
11308 {
11309 m_IsResultOfSplit = value;
11310 }
11311
11313 {
11315 }
11316
11318 {
11319 float other_item_quantity = other_item.GetQuantity();
11320 float this_free_space;
11321
11323
11325
11326 if (other_item_quantity > this_free_space)
11327 {
11328 return this_free_space;
11329 }
11330 else
11331 {
11332 return other_item_quantity;
11333 }
11334 }
11335
11337 {
11339 }
11340
11342 {
11344 return;
11345
11346 if (!IsMagazine() && other_item)
11347 {
11349 if (quantity_used != 0)
11350 {
11351 float hp1 = GetHealth01("","");
11352 float hp2 = other_item.GetHealth01("","");
11353 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11354 hpResult = hpResult / (
GetQuantity() + quantity_used);
11355
11356 hpResult *= GetMaxHealth();
11357 Math.Round(hpResult);
11358 SetHealth("", "Health", hpResult);
11359
11361 other_item.AddQuantity(-quantity_used);
11362 }
11363 }
11365 }
11366
11368 {
11369 #ifdef SERVER
11370 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11371 GetHierarchyParent().IncreaseLifetimeUp();
11372 #endif
11373 };
11374
11376 {
11377 PlayerBase p = PlayerBase.Cast(player);
11378
11379 array<int> recipesIds = p.m_Recipes;
11380 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11381 if (moduleRecipesManager)
11382 {
11383 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11384 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11385 }
11386
11387 for (int i = 0;i < recipesIds.Count(); i++)
11388 {
11389 int key = recipesIds.Get(i);
11390 string recipeName = moduleRecipesManager.GetRecipeName(key);
11392 }
11393 }
11394
11395
11396 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11397 {
11398 super.GetDebugActions(outputList);
11399
11400
11405
11406
11410
11414
11415
11418
11419
11421 {
11424 }
11425
11427
11430
11434 }
11435
11436
11437
11438
11440 {
11441 super.OnAction(action_id, player, ctx);
11442 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11443 {
11444 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11445 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11446 PlayerBase p = PlayerBase.Cast(player);
11447 if (
EActions.RECIPES_RANGE_START < 1000)
11448 {
11449 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11450 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11451 }
11452 }
11453 #ifndef SERVER
11454 else if (action_id ==
EActions.WATCH_PLAYER)
11455 {
11456 PluginDeveloper.SetDeveloperItemClientEx(player);
11457 }
11458 #endif
11460 {
11461 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11462 {
11463 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11464 OnDebugButtonPressServer(id + 1);
11465 }
11466
11467 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11468 {
11469 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11471 }
11472
11473 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11474 {
11475 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11477 }
11478
11479 else if (action_id ==
EActions.ADD_QUANTITY)
11480 {
11481 if (IsMagazine())
11482 {
11483 Magazine mag = Magazine.Cast(this);
11484 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11485 }
11486 else
11487 {
11489 }
11490
11491 if (m_EM)
11492 {
11493 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11494 }
11495
11496 }
11497
11498 else if (action_id ==
EActions.REMOVE_QUANTITY)
11499 {
11500 if (IsMagazine())
11501 {
11502 Magazine mag2 = Magazine.Cast(this);
11503 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11504 }
11505 else
11506 {
11508 }
11509 if (m_EM)
11510 {
11511 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11512 }
11513
11514 }
11515
11516 else if (action_id ==
EActions.SET_QUANTITY_0)
11517 {
11519
11520 if (m_EM)
11521 {
11522 m_EM.SetEnergy(0);
11523 }
11524 }
11525
11526 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11527 {
11529
11530 if (m_EM)
11531 {
11532 m_EM.SetEnergy(m_EM.GetEnergyMax());
11533 }
11534 }
11535
11536 else if (action_id ==
EActions.ADD_HEALTH)
11537 {
11538 AddHealth("","",GetMaxHealth("","Health")/5);
11539 }
11540 else if (action_id ==
EActions.REMOVE_HEALTH)
11541 {
11542 AddHealth("","",-GetMaxHealth("","Health")/5);
11543 }
11544 else if (action_id ==
EActions.DESTROY_HEALTH)
11545 {
11546 SetHealth01("","",0);
11547 }
11548 else if (action_id ==
EActions.WATCH_ITEM)
11549 {
11551 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11552 #ifdef DEVELOPER
11553 SetDebugDeveloper_item(this);
11554 #endif
11555 }
11556
11557 else if (action_id ==
EActions.ADD_TEMPERATURE)
11558 {
11559 AddTemperature(20);
11560
11561 }
11562
11563 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11564 {
11565 AddTemperature(-20);
11566
11567 }
11568
11569 else if (action_id ==
EActions.FLIP_FROZEN)
11570 {
11571 SetFrozen(!GetIsFrozen());
11572
11573 }
11574
11575 else if (action_id ==
EActions.ADD_WETNESS)
11576 {
11578
11579 }
11580
11581 else if (action_id ==
EActions.REMOVE_WETNESS)
11582 {
11584
11585 }
11586
11587 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11588 {
11591
11592
11593 }
11594
11595 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11596 {
11599 }
11600
11601 else if (action_id ==
EActions.MAKE_SPECIAL)
11602 {
11603 auto debugParams = DebugSpawnParams.WithPlayer(player);
11604 OnDebugSpawnEx(debugParams);
11605 }
11606
11607 else if (action_id ==
EActions.DELETE)
11608 {
11609 Delete();
11610 }
11611
11612 }
11613
11614
11615 return false;
11616 }
11617
11618
11619
11620
11624
11627
11628
11629
11631 {
11632 return false;
11633 }
11634
11635
11637 {
11638 return true;
11639 }
11640
11641
11643 {
11644 return true;
11645 }
11646
11647
11648
11650 {
11651 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11653 }
11654
11657 {
11658 return null;
11659 }
11660
11662 {
11663 return false;
11664 }
11665
11667 {
11668 return false;
11669 }
11670
11674
11675
11677 {
11678 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11679 return module_repairing.CanRepair(this, item_repair_kit);
11680 }
11681
11682
11683 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11684 {
11685 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11686 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11687 }
11688
11689
11691 {
11692
11693
11694
11695
11696
11697
11698
11699
11700 return 1;
11701 }
11702
11703
11704
11706 {
11708 }
11709
11710
11711
11713 {
11715 }
11716
11717
11726 {
11727 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11728
11729 if (player)
11730 {
11731 player.MessageStatus(text);
11732 }
11733 }
11734
11735
11744 {
11745 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11746
11747 if (player)
11748 {
11749 player.MessageAction(text);
11750 }
11751 }
11752
11753
11762 {
11763 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11764
11765 if (player)
11766 {
11767 player.MessageFriendly(text);
11768 }
11769 }
11770
11771
11780 {
11781 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11782
11783 if (player)
11784 {
11785 player.MessageImportant(text);
11786 }
11787 }
11788
11790 {
11791 return true;
11792 }
11793
11794
11795 override bool KindOf(
string tag)
11796 {
11797 bool found = false;
11798 string item_name = this.
GetType();
11801
11802 int array_size = item_tag_array.Count();
11803 for (int i = 0; i < array_size; i++)
11804 {
11805 if (item_tag_array.Get(i) == tag)
11806 {
11807 found = true;
11808 break;
11809 }
11810 }
11811 return found;
11812 }
11813
11814
11816 {
11817
11818 super.OnRPC(sender, rpc_type,ctx);
11819
11820
11821 switch (rpc_type)
11822 {
11823 #ifndef SERVER
11824 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11825 Param2<bool, string> p = new Param2<bool, string>(false, "");
11826
11828 return;
11829
11830 bool play = p.param1;
11831 string soundSet = p.param2;
11832
11833 if (play)
11834 {
11836 {
11838 {
11840 }
11841 }
11842 else
11843 {
11845 }
11846 }
11847 else
11848 {
11850 }
11851
11852 break;
11853 #endif
11854
11855 }
11856
11858 {
11860 }
11861 }
11862
11863
11864
11865
11867 {
11868 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11869 return plugin.GetID(
name);
11870 }
11871
11873 {
11874 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11875 return plugin.GetName(id);
11876 }
11877
11880 {
11881
11882
11883 int varFlags;
11884 if (!ctx.
Read(varFlags))
11885 return;
11886
11887 if (varFlags & ItemVariableFlags.FLOAT)
11888 {
11890 }
11891 }
11892
11894 {
11895
11896 super.SerializeNumericalVars(floats_out);
11897
11898
11899
11901 {
11903 }
11904
11906 {
11908 }
11909
11911 {
11913 }
11914
11916 {
11921 }
11922
11924 {
11926 }
11927 }
11928
11930 {
11931
11932 super.DeSerializeNumericalVars(floats);
11933
11934
11935 int index = 0;
11936 int mask = Math.Round(floats.Get(index));
11937
11938 index++;
11939
11941 {
11943 {
11945 }
11946 else
11947 {
11948 float quantity = floats.Get(index);
11949 SetQuantity(quantity,
true,
false,
false,
false);
11950 }
11951 index++;
11952 }
11953
11955 {
11956 float wet = floats.Get(index);
11958 index++;
11959 }
11960
11962 {
11963 int liquidtype = Math.Round(floats.Get(index));
11965 index++;
11966 }
11967
11969 {
11971 index++;
11973 index++;
11975 index++;
11977 index++;
11978 }
11979
11981 {
11982 int cleanness = Math.Round(floats.Get(index));
11984 index++;
11985 }
11986 }
11987
11989 {
11990 super.WriteVarsToCTX(ctx);
11991
11992
11994 {
11996 }
11997
11999 {
12001 }
12002
12004 {
12006 }
12007
12009 {
12010 int r,g,b,a;
12016 }
12017
12019 {
12021 }
12022 }
12023
12025 {
12026 if (!super.ReadVarsFromCTX(ctx,version))
12027 return false;
12028
12029 int intValue;
12030 float value;
12031
12032 if (version < 140)
12033 {
12034 if (!ctx.
Read(intValue))
12035 return false;
12036
12037 m_VariablesMask = intValue;
12038 }
12039
12041 {
12042 if (!ctx.
Read(value))
12043 return false;
12044
12046 {
12048 }
12049 else
12050 {
12052 }
12053 }
12054
12055 if (version < 140)
12056 {
12058 {
12059 if (!ctx.
Read(value))
12060 return false;
12061 SetTemperatureDirect(value);
12062 }
12063 }
12064
12066 {
12067 if (!ctx.
Read(value))
12068 return false;
12070 }
12071
12073 {
12074 if (!ctx.
Read(intValue))
12075 return false;
12077 }
12078
12080 {
12081 int r,g,b,a;
12083 return false;
12085 return false;
12087 return false;
12089 return false;
12090
12092 }
12093
12095 {
12096 if (!ctx.
Read(intValue))
12097 return false;
12099 }
12100
12101 if (version >= 138 && version < 140)
12102 {
12104 {
12105 if (!ctx.
Read(intValue))
12106 return false;
12107 SetFrozen(intValue);
12108 }
12109 }
12110
12111 return true;
12112 }
12113
12114
12116 {
12119 {
12121 }
12122
12123 if (!super.OnStoreLoad(ctx, version))
12124 {
12126 return false;
12127 }
12128
12129 if (version >= 114)
12130 {
12131 bool hasQuickBarIndexSaved;
12132
12133 if (!ctx.
Read(hasQuickBarIndexSaved))
12134 {
12136 return false;
12137 }
12138
12139 if (hasQuickBarIndexSaved)
12140 {
12141 int itmQBIndex;
12142
12143
12144 if (!ctx.
Read(itmQBIndex))
12145 {
12147 return false;
12148 }
12149
12150 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12151 if (itmQBIndex != -1 && parentPlayer)
12152 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12153 }
12154 }
12155 else
12156 {
12157
12158 PlayerBase player;
12159 int itemQBIndex;
12160 if (version ==
int.
MAX)
12161 {
12162 if (!ctx.
Read(itemQBIndex))
12163 {
12165 return false;
12166 }
12167 }
12168 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12169 {
12170
12171 if (!ctx.
Read(itemQBIndex))
12172 {
12174 return false;
12175 }
12176 if (itemQBIndex != -1 && player)
12177 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12178 }
12179 }
12180
12181 if (version < 140)
12182 {
12183
12184 if (!LoadVariables(ctx, version))
12185 {
12187 return false;
12188 }
12189 }
12190
12191
12193 {
12195 return false;
12196 }
12197 if (version >= 132)
12198 {
12200 if (raib)
12201 {
12203 {
12205 return false;
12206 }
12207 }
12208 }
12209
12211 return true;
12212 }
12213
12214
12215
12217 {
12218 super.OnStoreSave(ctx);
12219
12220 PlayerBase player;
12221 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12222 {
12224
12225 int itemQBIndex = -1;
12226 itemQBIndex = player.FindQuickBarEntityIndex(this);
12227 ctx.
Write(itemQBIndex);
12228 }
12229 else
12230 {
12232 }
12233
12235
12237 if (raib)
12238 {
12240 }
12241 }
12242
12243
12245 {
12246 super.AfterStoreLoad();
12247
12249 {
12251 }
12252
12254 {
12257 }
12258 }
12259
12261 {
12262 super.EEOnAfterLoad();
12263
12265 {
12267 }
12268
12271 }
12272
12274 {
12275 return false;
12276 }
12277
12278
12279
12281 {
12283 {
12284 #ifdef PLATFORM_CONSOLE
12285
12287 {
12289 if (menu)
12290 {
12292 }
12293 }
12294 #endif
12295 }
12296
12298 {
12301 }
12302
12304 {
12305 SetWeightDirty();
12307 }
12309 {
12312 }
12313
12315 {
12318 }
12320 {
12323 }
12324
12325 super.OnVariablesSynchronized();
12326 }
12327
12328
12329
12331 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12332 {
12333 if (!IsServerCheck(allow_client))
12334 return false;
12335
12337 return false;
12338
12341
12342 if (value <= (min + 0.001))
12343 value = min;
12344
12345 if (value == min)
12346 {
12347 if (destroy_config)
12348 {
12349 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12350 if (dstr)
12351 {
12353 this.Delete();
12354 return true;
12355 }
12356 }
12357 else if (destroy_forced)
12358 {
12360 this.Delete();
12361 return true;
12362 }
12363
12365 }
12366
12369
12371 {
12373
12374 if (delta)
12376 }
12377
12379
12380 return false;
12381 }
12382
12383
12385 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12386 {
12388 }
12389
12391 {
12394 }
12395
12397 {
12400 }
12401
12404 {
12405 float value_clamped = Math.Clamp(value, 0, 1);
12407 SetQuantity(result, destroy_config, destroy_forced);
12408 }
12409
12410
12413 {
12415 }
12416
12418 {
12420 }
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12432 {
12433 int slot = -1;
12434 if (GetInventory())
12435 {
12436 InventoryLocation il = new InventoryLocation;
12437 GetInventory().GetCurrentInventoryLocation(il);
12439 }
12440
12442 }
12443
12445 {
12446 float quantity_max = 0;
12447
12449 {
12450 if (attSlotID != -1)
12451 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12452
12453 if (quantity_max <= 0)
12455 }
12456
12457 if (quantity_max <= 0)
12459
12460 return quantity_max;
12461 }
12462
12464 {
12466 }
12467
12469 {
12471 }
12472
12473
12475 {
12477 }
12478
12480 {
12482 }
12483
12485 {
12487 }
12488
12489
12491 {
12492
12493 float weightEx = GetWeightEx();
12494 float special = GetInventoryAndCargoWeight();
12495 return weightEx - special;
12496 }
12497
12498
12500 {
12502 }
12503
12505 {
12507 {
12508 #ifdef DEVELOPER
12509 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12510 {
12511 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12513 }
12514 #endif
12515
12516 return GetQuantity() * GetConfigWeightModified();
12517 }
12518 else if (HasEnergyManager())
12519 {
12520 #ifdef DEVELOPER
12521 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12522 {
12523 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12524 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12525 }
12526 #endif
12527 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12528 }
12529 else
12530 {
12531 #ifdef DEVELOPER
12532 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12533 {
12534 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12535 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12536 }
12537 #endif
12538 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12539 }
12540 }
12541
12544 {
12545 int item_count = 0;
12547
12548 if (GetInventory().GetCargo() != NULL)
12549 {
12550 item_count = GetInventory().GetCargo().GetItemCount();
12551 }
12552
12553 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12554 {
12555 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12556 if (item)
12557 item_count += item.GetNumberOfItems();
12558 }
12559 return item_count;
12560 }
12561
12564 {
12565 float weight = 0;
12566 float wetness = 1;
12567 if (include_wetness)
12570 {
12571 weight = wetness * m_ConfigWeight;
12572 }
12574 {
12575 weight = 1;
12576 }
12577 return weight;
12578 }
12579
12580
12581
12583 {
12584 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12585 {
12586 GameInventory inv = GetInventory();
12587 array<EntityAI> items = new array<EntityAI>;
12589 for (int i = 0; i < items.Count(); i++)
12590 {
12592 if (item)
12593 {
12595 }
12596 }
12597 }
12598 }
12599
12600
12601
12602
12604 {
12605 float energy = 0;
12606 if (HasEnergyManager())
12607 {
12608 energy = GetCompEM().GetEnergy();
12609 }
12610 return energy;
12611 }
12612
12613
12615 {
12616 super.OnEnergyConsumed();
12617
12619 }
12620
12622 {
12623 super.OnEnergyAdded();
12624
12626 }
12627
12628
12630 {
12631 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12632 {
12634 {
12635 float energy_0to1 = GetCompEM().GetEnergy0To1();
12637 }
12638 }
12639 }
12640
12641
12643 {
12644 return ConfigGetFloat("heatIsolation");
12645 }
12646
12648 {
12650 }
12651
12653 {
12654 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12655 if (
GetGame().ConfigIsExisting(paramPath))
12657
12658 return 0.0;
12659 }
12660
12662 {
12663 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12664 if (
GetGame().ConfigIsExisting(paramPath))
12666
12667 return 0.0;
12668 }
12669
12670 override void SetWet(
float value,
bool allow_client =
false)
12671 {
12672 if (!IsServerCheck(allow_client))
12673 return;
12674
12677
12679
12680 m_VarWet = Math.Clamp(value, min, max);
12681
12683 {
12686 }
12687 }
12688
12689 override void AddWet(
float value)
12690 {
12692 }
12693
12695 {
12697 }
12698
12700 {
12702 }
12703
12705 {
12707 }
12708
12710 {
12712 }
12713
12715 {
12717 }
12718
12719 override void OnWetChanged(
float newVal,
float oldVal)
12720 {
12723 if (newLevel != oldLevel)
12724 {
12726 }
12727 }
12728
12730 {
12731 SetWeightDirty();
12732 }
12733
12735 {
12736 return GetWetLevelInternal(
m_VarWet);
12737 }
12738
12739
12740
12742 {
12744 }
12745
12747 {
12749 }
12750
12752 {
12754 }
12755
12757 {
12759 }
12760
12761
12762
12764 {
12765 if (ConfigIsExisting("itemModelLength"))
12766 {
12767 return ConfigGetFloat("itemModelLength");
12768 }
12769 return 0;
12770 }
12771
12773 {
12774 if (ConfigIsExisting("itemAttachOffset"))
12775 {
12776 return ConfigGetFloat("itemAttachOffset");
12777 }
12778 return 0;
12779 }
12780
12781 override void SetCleanness(
int value,
bool allow_client =
false)
12782 {
12783 if (!IsServerCheck(allow_client))
12784 return;
12785
12787
12789
12792 }
12793
12795 {
12797 }
12798
12800 {
12801 return true;
12802 }
12803
12804
12805
12806
12808 {
12810 }
12811
12813 {
12815 }
12816
12817
12818
12819
12820 override void SetColor(
int r,
int g,
int b,
int a)
12821 {
12827 }
12829 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12830 {
12835 }
12836
12838 {
12840 }
12841
12844 {
12845 int r,g,b,a;
12847 r = r/255;
12848 g = g/255;
12849 b = b/255;
12850 a = a/255;
12851 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12852 }
12853
12854
12855
12856 override void SetLiquidType(
int value,
bool allow_client =
false)
12857 {
12858 if (!IsServerCheck(allow_client))
12859 return;
12860
12865 }
12866
12868 {
12869 return ConfigGetInt("varLiquidTypeInit");
12870 }
12871
12873 {
12875 }
12876
12878 {
12880 SetFrozen(false);
12881 }
12882
12885 {
12886 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12887 }
12888
12889
12892 {
12893 PlayerBase nplayer;
12894 if (PlayerBase.CastTo(nplayer, player))
12895 {
12897
12898 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12899 }
12900 }
12901
12902
12905 {
12906 PlayerBase nplayer;
12907 if (PlayerBase.CastTo(nplayer,player))
12908 {
12909
12910 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12911
12912 }
12913
12914
12915 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12916
12917
12918 if (HasEnergyManager())
12919 {
12920 GetCompEM().UpdatePlugState();
12921 }
12922 }
12923
12924
12926 {
12927 super.OnPlacementStarted(player);
12928
12930 }
12931
12932 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12933 {
12935 {
12936 m_AdminLog.OnPlacementComplete(player,
this);
12937 }
12938
12939 super.OnPlacementComplete(player, position, orientation);
12940 }
12941
12942
12943
12944
12945
12947 {
12949 {
12950 return true;
12951 }
12952 else
12953 {
12954 return false;
12955 }
12956 }
12957
12958
12960 {
12962 {
12964 }
12965 }
12966
12967
12969 {
12971 }
12972
12974 {
12976 }
12977
12978 override void InsertAgent(
int agent,
float count = 1)
12979 {
12980 if (count < 1)
12981 return;
12982
12984 }
12985
12988 {
12990 }
12991
12992
12994 {
12996 }
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13040 {
13042 return false;
13043 return true;
13044 }
13045
13047 {
13048
13050 }
13051
13052
13055 {
13056 super.CheckForRoofLimited(timeTresholdMS);
13057
13059 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13060 {
13061 m_PreviousRoofTestTime = time;
13062 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13063 }
13064 }
13065
13066
13068 {
13070 {
13071 return 0;
13072 }
13073
13074 if (GetInventory().GetAttachmentSlotsCount() != 0)
13075 {
13076 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13077 if (filter)
13078 return filter.GetProtectionLevel(type, false, system);
13079 else
13080 return 0;
13081 }
13082
13083 string subclassPath, entryName;
13084
13085 switch (type)
13086 {
13088 entryName = "biological";
13089 break;
13091 entryName = "chemical";
13092 break;
13093 default:
13094 entryName = "biological";
13095 break;
13096 }
13097
13098 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13099
13101 }
13102
13103
13104
13107 {
13108 if (!IsMagazine())
13110
13112 }
13113
13114
13115
13116
13117
13122 {
13123 return true;
13124 }
13125
13127 {
13129 }
13130
13131
13132
13133
13134
13136 {
13137 if (parent)
13138 {
13139 if (parent.IsInherited(DayZInfected))
13140 return true;
13141
13142 if (!parent.IsRuined())
13143 return true;
13144 }
13145
13146 return true;
13147 }
13148
13150 {
13151 if (!super.CanPutAsAttachment(parent))
13152 {
13153 return false;
13154 }
13155
13156 if (!IsRuined() && !parent.IsRuined())
13157 {
13158 return true;
13159 }
13160
13161 return false;
13162 }
13163
13165 {
13166
13167
13168
13169
13170 return super.CanReceiveItemIntoCargo(item);
13171 }
13172
13174 {
13175
13176
13177
13178
13179 GameInventory attachmentInv = attachment.GetInventory();
13181 {
13182 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13183 return false;
13184 }
13185
13186 InventoryLocation loc = new InventoryLocation();
13187 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13188 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13189 return false;
13190
13191 return super.CanReceiveAttachment(attachment, slotId);
13192 }
13193
13195 {
13196 if (!super.CanReleaseAttachment(attachment))
13197 return false;
13198
13199 return GetInventory().AreChildrenAccessible();
13200 }
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13223 {
13224 int id = muzzle_owner.GetMuzzleID();
13225 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13226
13227 if (WPOF_array)
13228 {
13229 for (int i = 0; i < WPOF_array.Count(); i++)
13230 {
13231 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13232
13233 if (WPOF)
13234 {
13235 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13236 }
13237 }
13238 }
13239 }
13240
13241
13243 {
13244 int id = muzzle_owner.GetMuzzleID();
13246
13247 if (WPOBE_array)
13248 {
13249 for (int i = 0; i < WPOBE_array.Count(); i++)
13250 {
13251 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13252
13253 if (WPOBE)
13254 {
13255 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13256 }
13257 }
13258 }
13259 }
13260
13261
13263 {
13264 int id = muzzle_owner.GetMuzzleID();
13265 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13266
13267 if (WPOOH_array)
13268 {
13269 for (int i = 0; i < WPOOH_array.Count(); i++)
13270 {
13271 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13272
13273 if (WPOOH)
13274 {
13275 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13276 }
13277 }
13278 }
13279 }
13280
13281
13283 {
13284 int id = muzzle_owner.GetMuzzleID();
13285 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13286
13287 if (WPOOH_array)
13288 {
13289 for (int i = 0; i < WPOOH_array.Count(); i++)
13290 {
13291 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13292
13293 if (WPOOH)
13294 {
13295 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13296 }
13297 }
13298 }
13299 }
13300
13301
13303 {
13304 int id = muzzle_owner.GetMuzzleID();
13305 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13306
13307 if (WPOOH_array)
13308 {
13309 for (int i = 0; i < WPOOH_array.Count(); i++)
13310 {
13311 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13312
13313 if (WPOOH)
13314 {
13315 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13316 }
13317 }
13318 }
13319 }
13320
13321
13322
13324 {
13326 {
13327 return true;
13328 }
13329
13330 return false;
13331 }
13332
13334 {
13336 {
13337 return true;
13338 }
13339
13340 return false;
13341 }
13342
13344 {
13346 {
13347 return true;
13348 }
13349
13350 return false;
13351 }
13352
13354 {
13355 return false;
13356 }
13357
13360 {
13361 return UATimeSpent.DEFAULT_DEPLOY;
13362 }
13363
13364
13365
13366
13368 {
13370 SetSynchDirty();
13371 }
13372
13374 {
13376 }
13377
13378
13380 {
13381 return false;
13382 }
13383
13386 {
13387 string att_type = "None";
13388
13389 if (ConfigIsExisting("soundAttType"))
13390 {
13391 att_type = ConfigGetString("soundAttType");
13392 }
13393
13395 }
13396
13398 {
13400 }
13401
13402
13403
13404
13405
13409
13411 {
13414
13416 }
13417
13418
13420 {
13422 return;
13423
13425
13428
13431
13432 SoundParameters params = new SoundParameters();
13436 }
13437
13438
13440 {
13442 return;
13443
13445 SetSynchDirty();
13446
13449 }
13450
13451
13453 {
13455 return;
13456
13458 SetSynchDirty();
13459
13462 }
13463
13465 {
13467 }
13468
13470 {
13472 }
13473
13476 {
13477 if (!
GetGame().IsDedicatedServer())
13478 {
13479 if (ConfigIsExisting("attachSoundSet"))
13480 {
13481 string cfg_path = "";
13482 string soundset = "";
13483 string type_name =
GetType();
13484
13487 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13488 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13489
13490 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13491 {
13492 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13493 {
13494 if (cfg_slot_array[i] == slot_type)
13495 {
13496 soundset = cfg_soundset_array[i];
13497 break;
13498 }
13499 }
13500 }
13501
13502 if (soundset != "")
13503 {
13504 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13506 }
13507 }
13508 }
13509 }
13510
13512 {
13513
13514 }
13515
13516 void OnApply(PlayerBase player);
13517
13519 {
13520 return 1.0;
13521 };
13522
13524 {
13526 }
13527
13529 {
13531 }
13532
13534
13536 {
13537 SetDynamicPhysicsLifeTime(0.01);
13539 }
13540
13542 {
13543 array<string> zone_names = new array<string>;
13544 GetDamageZones(zone_names);
13545 for (int i = 0; i < zone_names.Count(); i++)
13546 {
13547 SetHealthMax(zone_names.Get(i),"Health");
13548 }
13549 SetHealthMax("","Health");
13550 }
13551
13554 {
13555 float global_health = GetHealth01("","Health");
13556 array<string> zones = new array<string>;
13557 GetDamageZones(zones);
13558
13559 for (int i = 0; i < zones.Count(); i++)
13560 {
13561 SetHealth01(zones.Get(i),"Health",global_health);
13562 }
13563 }
13564
13567 {
13568 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13569 }
13570
13572 {
13573 if (!hasRootAsPlayer)
13574 {
13575 if (refParentIB)
13576 {
13577
13578 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13579 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13580
13581 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13582 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13583
13586 }
13587 else
13588 {
13589
13592 }
13593 }
13594 }
13595
13597 {
13599 {
13600 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13601 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13602 {
13603 float heatPermCoef = 1.0;
13605 while (ent)
13606 {
13607 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13608 ent = ent.GetHierarchyParent();
13609 }
13610
13611 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13612 }
13613 }
13614 }
13615
13617 {
13618
13619 EntityAI parent = GetHierarchyParent();
13620 if (!parent)
13621 {
13622 hasParent = false;
13623 hasRootAsPlayer = false;
13624 }
13625 else
13626 {
13627 hasParent = true;
13628 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13629 refParentIB =
ItemBase.Cast(parent);
13630 }
13631 }
13632
13633 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13634 {
13635
13636 }
13637
13639 {
13640
13641 return false;
13642 }
13643
13645 {
13646
13647
13648 return false;
13649 }
13650
13652 {
13653
13654 return false;
13655 }
13656
13659 {
13660 return !GetIsFrozen() &&
IsOpen();
13661 }
13662
13664 {
13665 bool hasParent = false, hasRootAsPlayer = false;
13667
13668 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13669 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13670
13671 if (wwtu || foodDecay)
13672 {
13676
13677 if (processWetness || processTemperature || processDecay)
13678 {
13680
13681 if (processWetness)
13682 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13683
13684 if (processTemperature)
13686
13687 if (processDecay)
13688 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13689 }
13690 }
13691 }
13692
13695 {
13697 }
13698
13700 {
13703
13704 return super.GetTemperatureFreezeThreshold();
13705 }
13706
13708 {
13711
13712 return super.GetTemperatureThawThreshold();
13713 }
13714
13716 {
13719
13720 return super.GetItemOverheatThreshold();
13721 }
13722
13724 {
13726 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13727
13728 return super.GetTemperatureFreezeTime();
13729 }
13730
13732 {
13734 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13735
13736 return super.GetTemperatureThawTime();
13737 }
13738
13743
13745 {
13746 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13747 }
13748
13750 {
13751 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13752 }
13753
13756 {
13758 }
13759
13761 {
13763 }
13764
13766 {
13768 }
13769
13772 {
13773 return null;
13774 }
13775
13778 {
13779 return false;
13780 }
13781
13783 {
13785 {
13788 if (!trg)
13789 {
13791 explosive = this;
13792 }
13793
13794 explosive.PairRemote(trg);
13796
13797 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13798 trg.SetPersistentPairID(persistentID);
13799 explosive.SetPersistentPairID(persistentID);
13800
13801 return true;
13802 }
13803 return false;
13804 }
13805
13808 {
13809 float ret = 1.0;
13812 ret *= GetHealth01();
13813
13814 return ret;
13815 }
13816
13817 #ifdef DEVELOPER
13818 override void SetDebugItem()
13819 {
13820 super.SetDebugItem();
13821 _itemBase = this;
13822 }
13823
13825 {
13826 string text = super.GetDebugText();
13827
13829 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13830
13831 return text;
13832 }
13833 #endif
13834
13836 {
13837 return true;
13838 }
13839
13841
13843
13845 {
13848 }
13849
13850
13858
13874}
13875
13877{
13879 if (entity)
13880 {
13881 bool is_item = entity.IsInherited(
ItemBase);
13882 if (is_item && full_quantity)
13883 {
13886 }
13887 }
13888 else
13889 {
13891 return NULL;
13892 }
13893 return entity;
13894}
13895
13897{
13898 if (item)
13899 {
13900 if (health > 0)
13901 item.SetHealth("", "", health);
13902
13903 if (item.CanHaveTemperature())
13904 {
13906 if (item.CanFreeze())
13907 item.SetFrozen(false);
13908 }
13909
13910 if (item.HasEnergyManager())
13911 {
13912 if (quantity >= 0)
13913 {
13914 item.GetCompEM().SetEnergy0To1(quantity);
13915 }
13916 else
13917 {
13919 }
13920 }
13921 else if (item.IsMagazine())
13922 {
13923 Magazine mag = Magazine.Cast(item);
13924 if (quantity >= 0)
13925 {
13926 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13927 }
13928 else
13929 {
13931 }
13932
13933 }
13934 else
13935 {
13936 if (quantity >= 0)
13937 {
13938 item.SetQuantityNormalized(quantity, false);
13939 }
13940 else
13941 {
13943 }
13944
13945 }
13946 }
13947}
13948
13949#ifdef DEVELOPER
13951#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.