9052{
9054 {
9055 return true;
9056 }
9057};
9058
9059
9060
9062{
9066
9068
9071
9072
9073
9074
9075
9084
9090
9095
9100
9121 protected bool m_IsResultOfSplit
9122
9124
9129
9130
9131
9133
9137
9138
9139
9141
9144
9145
9146
9152
9153
9161
9164
9165
9167
9168
9170
9171
9176
9177
9182
9183
9185
9186
9188 {
9193
9194 if (!
GetGame().IsDedicatedServer())
9195 {
9197 {
9199
9201 {
9203 }
9204 }
9205
9208 }
9209
9210 m_OldLocation = null;
9211
9213 {
9215 }
9216
9217 if (ConfigIsExisting("headSelectionsToHide"))
9218 {
9221 }
9222
9224 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9225 {
9227 }
9228
9230
9231 m_IsResultOfSplit = false;
9232
9234 }
9235
9237 {
9238 super.InitItemVariables();
9239
9245 m_Count = ConfigGetInt(
"count");
9246
9249
9254
9257
9262
9274
9278
9279
9282 if (ConfigIsExisting("canBeSplit"))
9283 {
9286 }
9287
9289 if (ConfigIsExisting("itemBehaviour"))
9291
9292
9295 RegisterNetSyncVariableInt("m_VarLiquidType");
9296 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9297
9298 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9299 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9300 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9301
9302 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9303 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9304 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9305 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9306
9307 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9308 RegisterNetSyncVariableBool("m_IsTakeable");
9309 RegisterNetSyncVariableBool("m_IsHologram");
9310
9313 {
9316 }
9317
9319
9321 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9323
9324 }
9325
9327 {
9329 }
9330
9332 {
9335 {
9340 }
9341 }
9342
9343 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9344 {
9346 {
9349 }
9350
9352 }
9353
9355 {
9361 }
9362
9364
9366 {
9368
9369 if (!action)
9370 {
9371 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9372 return;
9373 }
9374
9376 if (!ai)
9377 {
9379 return;
9380 }
9381
9383 if (!action_array)
9384 {
9385 action_array = new array<ActionBase_Basic>;
9387 }
9388 if (LogManager.IsActionLogEnable())
9389 {
9390 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9391 }
9392
9393 if (action_array.Find(action) != -1)
9394 {
9395 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9396 }
9397 else
9398 {
9399 action_array.Insert(action);
9400 }
9401 }
9402
9404 {
9406 ActionBase action = player.GetActionManager().GetAction(actionName);
9409
9410 if (action_array)
9411 {
9412 action_array.RemoveItem(action);
9413 }
9414 }
9415
9416
9417
9419 {
9420 ActionOverrideData overrideData = new ActionOverrideData();
9424
9426 if (!actionMap)
9427 {
9430 }
9431
9432 actionMap.Insert(this.
Type(), overrideData);
9433
9434 }
9435
9437
9439
9440
9442 {
9445
9448
9449 string config_to_search = "CfgVehicles";
9450 string muzzle_owner_config;
9451
9453 {
9454 if (IsInherited(Weapon))
9455 config_to_search = "CfgWeapons";
9456
9457 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9458
9459 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9460
9462
9463 if (config_OnFire_subclass_count > 0)
9464 {
9465 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9466
9467 for (int i = 0; i < config_OnFire_subclass_count; i++)
9468 {
9469 string particle_class = "";
9471 string config_OnFire_entry = config_OnFire_class + particle_class;
9472 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9473 WPOF_array.Insert(WPOF);
9474 }
9475
9476
9478 }
9479 }
9480
9482 {
9483 config_to_search = "CfgWeapons";
9484 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9485
9486 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9487
9489
9490 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9491 {
9492 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9493
9494 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9495 {
9496 string particle_class2 = "";
9498 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9499 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9500 WPOBE_array.Insert(WPOBE);
9501 }
9502
9503
9505 }
9506 }
9507 }
9508
9509
9511 {
9514
9516 {
9517 string config_to_search = "CfgVehicles";
9518
9519 if (IsInherited(Weapon))
9520 config_to_search = "CfgWeapons";
9521
9522 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9523 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9524
9525 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9526 {
9527
9529
9531 {
9533 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9535 return;
9536 }
9537
9540
9541
9542
9544 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9545
9546 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9547 {
9548 string particle_class = "";
9550 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9552
9553 if (entry_type == CT_CLASS)
9554 {
9555 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9556 WPOOH_array.Insert(WPOF);
9557 }
9558 }
9559
9560
9562 }
9563 }
9564 }
9565
9567 {
9569 }
9570
9572 {
9574 {
9576
9579
9582
9583 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9584 }
9585 }
9586
9588 {
9590 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9591
9593 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9594
9596 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9597
9599 {
9601 }
9602 }
9603
9605 {
9607 }
9608
9610 {
9613 else
9615
9617 {
9620 }
9621 else
9622 {
9625
9628 }
9629
9631 }
9632
9634 {
9636 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9637 }
9638
9640 {
9642 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9644 }
9645
9647 {
9649 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9650 }
9651
9653 {
9656
9657 OverheatingParticle OP = new OverheatingParticle();
9662
9664 }
9665
9667 {
9670
9671 return -1;
9672 }
9673
9675 {
9677 {
9680
9681 for (int i = count; i > 0; --i)
9682 {
9683 int id = i - 1;
9686
9689
9690 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9691 {
9692 if (p)
9693 {
9696 }
9697 }
9698 }
9699 }
9700 }
9701
9703 {
9705 {
9707 {
9708 int id = i - 1;
9710
9711 if (OP)
9712 {
9714
9715 if (p)
9716 {
9718 }
9719
9720 delete OP;
9721 }
9722 }
9723
9726 }
9727 }
9728
9731 {
9732 return 0.0;
9733 }
9734
9735
9737 {
9738 return 250;
9739 }
9740
9742 {
9743 return 0;
9744 }
9745
9748 {
9750 return true;
9751
9752 return false;
9753 }
9754
9757 {
9760
9762 {
9764 }
9765 else
9766 {
9767
9769 }
9770
9772 }
9773
9780 {
9781 return -1;
9782 }
9783
9784
9785
9786
9788 {
9790 {
9792 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9793
9794 if (r_index >= 0)
9795 {
9796 InventoryLocation r_il = new InventoryLocation;
9797 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9798
9799 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9802 {
9803 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9804 }
9806 {
9807 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9808 }
9809
9810 }
9811
9812 player.GetHumanInventory().ClearUserReservedLocation(this);
9813 }
9814
9817 }
9818
9819
9820
9821
9823 {
9824 return ItemBase.m_DebugActionsMask;
9825 }
9826
9828 {
9829 return ItemBase.m_DebugActionsMask & mask;
9830 }
9831
9833 {
9834 ItemBase.m_DebugActionsMask = mask;
9835 }
9836
9838 {
9839 ItemBase.m_DebugActionsMask |= mask;
9840 }
9841
9843 {
9844 ItemBase.m_DebugActionsMask &= ~mask;
9845 }
9846
9848 {
9850 {
9852 }
9853 else
9854 {
9856 }
9857 }
9858
9859
9861 {
9862 if (GetEconomyProfile())
9863 {
9864 float q_max = GetEconomyProfile().GetQuantityMax();
9865 if (q_max > 0)
9866 {
9867 float q_min = GetEconomyProfile().GetQuantityMin();
9868 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9869
9871 {
9872 ComponentEnergyManager comp = GetCompEM();
9874 {
9876 }
9877 }
9879 {
9881
9882 }
9883
9884 }
9885 }
9886 }
9887
9890 {
9891 EntityAI parent = GetHierarchyParent();
9892
9893 if (parent)
9894 {
9895 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9896 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9897 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9898 }
9899 }
9900
9903 {
9904 EntityAI parent = GetHierarchyParent();
9905
9906 if (parent)
9907 {
9908 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9909 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9910 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9911 }
9912 }
9913
9915 {
9916
9917
9918
9919
9921
9923 {
9924 if (ScriptInputUserData.CanStoreInputUserData())
9925 {
9926 ScriptInputUserData ctx = new ScriptInputUserData;
9932 ctx.
Write(use_stack_max);
9935
9937 {
9938 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9939 }
9940 }
9941 }
9942 else if (!
GetGame().IsMultiplayer())
9943 {
9945 }
9946 }
9947
9949 {
9951 }
9952
9954 {
9956 }
9957
9959 {
9961 }
9962
9964 {
9965
9966 return false;
9967 }
9968
9970 {
9971 return false;
9972 }
9973
9977 {
9978 return false;
9979 }
9980
9982 {
9983 return "";
9984 }
9985
9987
9989 {
9990 return false;
9991 }
9992
9994 {
9995 return true;
9996 }
9997
9998
9999
10001 {
10002 return true;
10003 }
10004
10006 {
10007 return true;
10008 }
10009
10011 {
10012 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10014 }
10015
10017 {
10019 }
10020
10022 {
10024 if (!is_being_placed)
10026 SetSynchDirty();
10027 }
10028
10029
10031
10033 {
10035 }
10036
10038 {
10040 }
10041
10043 {
10044 return 1;
10045 }
10046
10048 {
10049 return false;
10050 }
10051
10053 {
10055 SetSynchDirty();
10056 }
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10093 {
10094 super.OnMovedInsideCargo(container);
10095
10096 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10097 }
10098
10099 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10100 {
10101 super.EEItemLocationChanged(oldLoc,newLoc);
10102
10103 PlayerBase new_player = null;
10104 PlayerBase old_player = null;
10105
10106 if (newLoc.GetParent())
10107 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10108
10109 if (oldLoc.GetParent())
10110 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10111
10113 {
10114 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10115
10116 if (r_index >= 0)
10117 {
10118 InventoryLocation r_il = new InventoryLocation;
10119 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10120
10121 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10124 {
10125 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10126 }
10128 {
10129 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10130 }
10131
10132 }
10133 }
10134
10136 {
10137 if (new_player)
10138 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10139
10140 if (new_player == old_player)
10141 {
10142
10143 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10144 {
10146 {
10147 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10148 {
10149 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10150 }
10151 }
10152 else
10153 {
10154 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10155 }
10156 }
10157
10158 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10159 {
10160 int type = oldLoc.GetType();
10162 {
10163 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10164 }
10166 {
10167 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10168 }
10169 }
10170 if (!m_OldLocation)
10171 {
10172 m_OldLocation = new InventoryLocation;
10173 }
10174 m_OldLocation.Copy(oldLoc);
10175 }
10176 else
10177 {
10178 if (m_OldLocation)
10179 {
10180 m_OldLocation.Reset();
10181 }
10182 }
10183
10185 }
10186 else
10187 {
10188 if (new_player)
10189 {
10190 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10191 if (res_index >= 0)
10192 {
10193 InventoryLocation il = new InventoryLocation;
10194 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10196 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10199 {
10200 il.
GetParent().GetOnReleaseLock().Invoke(it);
10201 }
10203 {
10205 }
10206
10207 }
10208 }
10210 {
10211
10213 }
10214
10215 if (m_OldLocation)
10216 {
10217 m_OldLocation.Reset();
10218 }
10219 }
10220 }
10221
10222 override void EOnContact(IEntity other, Contact extra)
10223 {
10225 {
10226 int liquidType = -1;
10228 if (impactSpeed > 0.0)
10229 {
10231 #ifndef SERVER
10233 #else
10235 SetSynchDirty();
10236 #endif
10238 }
10239 }
10240
10241 #ifdef SERVER
10242 if (GetCompEM() && GetCompEM().IsPlugged())
10243 {
10244 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10245 GetCompEM().UnplugThis();
10246 }
10247 #endif
10248 }
10249
10251
10253 {
10255 }
10256
10258 {
10259
10260 }
10261
10263 {
10264 super.OnItemLocationChanged(old_owner, new_owner);
10265
10266 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10267 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10268
10269 if (!relatedPlayer && playerNew)
10270 relatedPlayer = playerNew;
10271
10272 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10273 {
10275 if (actionMgr)
10276 {
10277 ActionBase currentAction = actionMgr.GetRunningAction();
10278 if (currentAction)
10280 }
10281 }
10282
10283 Man ownerPlayerOld = null;
10284 Man ownerPlayerNew = null;
10285
10286 if (old_owner)
10287 {
10288 if (old_owner.
IsMan())
10289 {
10290 ownerPlayerOld = Man.Cast(old_owner);
10291 }
10292 else
10293 {
10294 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10295 }
10296 }
10297 else
10298 {
10300 {
10302
10303 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10304 {
10305 GetCompEM().UnplugThis();
10306 }
10307 }
10308 }
10309
10310 if (new_owner)
10311 {
10312 if (new_owner.
IsMan())
10313 {
10314 ownerPlayerNew = Man.Cast(new_owner);
10315 }
10316 else
10317 {
10318 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10319 }
10320 }
10321
10322 if (ownerPlayerOld != ownerPlayerNew)
10323 {
10324 if (ownerPlayerOld)
10325 {
10326 array<EntityAI> subItemsExit = new array<EntityAI>;
10328 for (int i = 0; i < subItemsExit.Count(); i++)
10329 {
10332 }
10333 }
10334
10335 if (ownerPlayerNew)
10336 {
10337 array<EntityAI> subItemsEnter = new array<EntityAI>;
10339 for (int j = 0; j < subItemsEnter.Count(); j++)
10340 {
10343 }
10344 }
10345 }
10346 else if (ownerPlayerNew != null)
10347 {
10348 PlayerBase nplayer;
10349 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10350 {
10351 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10353 for (int k = 0; k < subItemsUpdate.Count(); k++)
10354 {
10356 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10357 }
10358 }
10359 }
10360
10361 if (old_owner)
10362 old_owner.OnChildItemRemoved(this);
10363 if (new_owner)
10364 new_owner.OnChildItemReceived(this);
10365 }
10366
10367
10369 {
10370 super.EEDelete(parent);
10371 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10372 if (player)
10373 {
10375
10376 if (player.IsAlive())
10377 {
10378 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10379 if (r_index >= 0)
10380 {
10381 InventoryLocation r_il = new InventoryLocation;
10382 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10383
10384 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10387 {
10388 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10389 }
10391 {
10392 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10393 }
10394
10395 }
10396
10397 player.RemoveQuickBarEntityShortcut(this);
10398 }
10399 }
10400 }
10401
10403 {
10404 super.EEKilled(killer);
10405
10408 {
10409 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10410 {
10411 if (IsMagazine())
10412 {
10413 if (Magazine.Cast(this).GetAmmoCount() > 0)
10414 {
10416 }
10417 }
10418 else
10419 {
10421 }
10422 }
10423 }
10424 }
10425
10427 {
10428 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10429
10430 super.OnWasAttached(parent, slot_id);
10431
10434
10436 }
10437
10439 {
10440 super.OnWasDetached(parent, slot_id);
10441
10444 }
10445
10447 {
10448 int idx;
10451
10452 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10453 if (inventory_slots.Count() < 1)
10454 {
10455 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10456 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10457 }
10458 else
10459 {
10460 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10461 }
10462
10463 idx = inventory_slots.Find(slot);
10464 if (idx < 0)
10465 return "";
10466
10467 return attach_types.Get(idx);
10468 }
10469
10471 {
10472 int idx = -1;
10473 string slot;
10474
10477
10478 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10479 if (inventory_slots.Count() < 1)
10480 {
10481 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10482 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10483 }
10484 else
10485 {
10486 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10487 if (detach_types.Count() < 1)
10488 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10489 }
10490
10491 for (int i = 0; i < inventory_slots.Count(); i++)
10492 {
10493 slot = inventory_slots.Get(i);
10494 }
10495
10496 if (slot != "")
10497 {
10498 if (detach_types.Count() == 1)
10499 idx = 0;
10500 else
10501 idx = inventory_slots.Find(slot);
10502 }
10503 if (idx < 0)
10504 return "";
10505
10506 return detach_types.Get(idx);
10507 }
10508
10510 {
10511
10513
10514
10515 float min_time = 1;
10516 float max_time = 3;
10517 float delay = Math.RandomFloat(min_time, max_time);
10518
10519 explode_timer.Run(delay, this, "DoAmmoExplosion");
10520 }
10521
10523 {
10524 Magazine magazine = Magazine.Cast(this);
10525 int pop_sounds_count = 6;
10526 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10527
10528
10529 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10530 string sound_name = pop_sounds[ sound_idx ];
10532
10533
10534 magazine.ServerAddAmmoCount(-1);
10535
10536
10537 float min_temp_to_explode = 100;
10538
10539 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10540 {
10542 }
10543 }
10544
10545
10546 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10547 {
10548 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10549
10550 const int CHANCE_DAMAGE_CARGO = 4;
10551 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10552 const int CHANCE_DAMAGE_NOTHING = 2;
10553
10555 {
10556 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10557 int chances;
10558 int rnd;
10559
10560 if (GetInventory().GetCargo())
10561 {
10562 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10563 rnd = Math.RandomInt(0,chances);
10564
10565 if (rnd < CHANCE_DAMAGE_CARGO)
10566 {
10568 }
10569 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10570 {
10572 }
10573 }
10574 else
10575 {
10576 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10577 rnd = Math.RandomInt(0,chances);
10578
10579 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10580 {
10582 }
10583 }
10584 }
10585 }
10586
10588 {
10589 if (GetInventory().GetCargo())
10590 {
10591 int item_count = GetInventory().GetCargo().GetItemCount();
10592 if (item_count > 0)
10593 {
10594 int random_pick = Math.RandomInt(0, item_count);
10596 if (!item.IsExplosive())
10597 {
10598 item.AddHealth("","",damage);
10599 return true;
10600 }
10601 }
10602 }
10603 return false;
10604 }
10605
10607 {
10608 int attachment_count = GetInventory().AttachmentCount();
10609 if (attachment_count > 0)
10610 {
10611 int random_pick = Math.RandomInt(0, attachment_count);
10612 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10613 if (!attachment.IsExplosive())
10614 {
10615 attachment.AddHealth("","",damage);
10616 return true;
10617 }
10618 }
10619 return false;
10620 }
10621
10623 {
10625 }
10626
10628 {
10630 return GetInventory().CanRemoveEntity();
10631
10632 return false;
10633 }
10634
10636 {
10638 return;
10639
10641 {
10642 if (ScriptInputUserData.CanStoreInputUserData())
10643 {
10644 ScriptInputUserData ctx = new ScriptInputUserData;
10649 ctx.
Write(destination_entity);
10651 ctx.
Write(slot_id);
10653 }
10654 }
10655 else if (!
GetGame().IsMultiplayer())
10656 {
10658 }
10659 }
10660
10662 {
10664 return;
10665
10666 float split_quantity_new;
10670 InventoryLocation loc = new InventoryLocation;
10671
10672 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10673 {
10675 split_quantity_new = stack_max;
10676 else
10678
10679 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10680 if (new_item)
10681 {
10682 new_item.SetResultOfSplit(true);
10683 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10685 new_item.SetQuantity(split_quantity_new);
10686 }
10687 }
10688 else if (destination_entity && slot_id == -1)
10689 {
10690 if (quantity > stack_max)
10691 split_quantity_new = stack_max;
10692 else
10693 split_quantity_new = quantity;
10694
10696 {
10699 }
10700
10701 if (new_item)
10702 {
10703 new_item.SetResultOfSplit(true);
10704 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10706 new_item.SetQuantity(split_quantity_new);
10707 }
10708 }
10709 else
10710 {
10711 if (stack_max != 0)
10712 {
10714 {
10716 }
10717
10718 if (split_quantity_new == 0)
10719 {
10720 if (!
GetGame().IsMultiplayer())
10721 player.PhysicalPredictiveDropItem(this);
10722 else
10723 player.ServerDropEntity(this);
10724 return;
10725 }
10726
10728
10729 if (new_item)
10730 {
10731 new_item.SetResultOfSplit(true);
10732 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10734 new_item.SetQuantity(stack_max);
10735 new_item.PlaceOnSurface();
10736 }
10737 }
10738 }
10739 }
10740
10742 {
10744 return;
10745
10746 float split_quantity_new;
10750 InventoryLocation loc = new InventoryLocation;
10751
10752 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10753 {
10755 split_quantity_new = stack_max;
10756 else
10758
10759 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10760 if (new_item)
10761 {
10762 new_item.SetResultOfSplit(true);
10763 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10765 new_item.SetQuantity(split_quantity_new);
10766 }
10767 }
10768 else if (destination_entity && slot_id == -1)
10769 {
10770 if (quantity > stack_max)
10771 split_quantity_new = stack_max;
10772 else
10773 split_quantity_new = quantity;
10774
10776 {
10779 }
10780
10781 if (new_item)
10782 {
10783 new_item.SetResultOfSplit(true);
10784 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10786 new_item.SetQuantity(split_quantity_new);
10787 }
10788 }
10789 else
10790 {
10791 if (stack_max != 0)
10792 {
10794 {
10796 }
10797
10799
10800 if (new_item)
10801 {
10802 new_item.SetResultOfSplit(true);
10803 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10805 new_item.SetQuantity(stack_max);
10806 new_item.PlaceOnSurface();
10807 }
10808 }
10809 }
10810 }
10811
10813 {
10815 return;
10816
10818 {
10819 if (ScriptInputUserData.CanStoreInputUserData())
10820 {
10821 ScriptInputUserData ctx = new ScriptInputUserData;
10826 dst.WriteToContext(ctx);
10828 }
10829 }
10830 else if (!
GetGame().IsMultiplayer())
10831 {
10833 }
10834 }
10835
10837 {
10839 return;
10840
10842 {
10843 if (ScriptInputUserData.CanStoreInputUserData())
10844 {
10845 ScriptInputUserData ctx = new ScriptInputUserData;
10850 ctx.
Write(destination_entity);
10856 }
10857 }
10858 else if (!
GetGame().IsMultiplayer())
10859 {
10861 }
10862 }
10863
10865 {
10867 }
10868
10870 {
10872 return this;
10873
10875 float split_quantity_new;
10877 if (dst.IsValid())
10878 {
10879 int slot_id = dst.GetSlot();
10881
10882 if (quantity > stack_max)
10883 split_quantity_new = stack_max;
10884 else
10885 split_quantity_new = quantity;
10886
10888
10889 if (new_item)
10890 {
10891 new_item.SetResultOfSplit(true);
10892 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10895 }
10896
10897 return new_item;
10898 }
10899
10900 return null;
10901 }
10902
10904 {
10906 return;
10907
10909 float split_quantity_new;
10911 if (destination_entity)
10912 {
10914 if (quantity > stackable)
10915 split_quantity_new = stackable;
10916 else
10917 split_quantity_new = quantity;
10918
10919 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10920 if (new_item)
10921 {
10922 new_item.SetResultOfSplit(true);
10923 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10925 new_item.SetQuantity(split_quantity_new);
10926 }
10927 }
10928 }
10929
10931 {
10933 return;
10934
10936 {
10937 if (ScriptInputUserData.CanStoreInputUserData())
10938 {
10939 ScriptInputUserData ctx = new ScriptInputUserData;
10944 ItemBase destination_entity =
this;
10945 ctx.
Write(destination_entity);
10949 }
10950 }
10951 else if (!
GetGame().IsMultiplayer())
10952 {
10954 }
10955 }
10956
10958 {
10960 return;
10961
10963 float split_quantity_new;
10965 if (player)
10966 {
10968 if (quantity > stackable)
10969 split_quantity_new = stackable;
10970 else
10971 split_quantity_new = quantity;
10972
10973 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10974 new_item =
ItemBase.Cast(in_hands);
10975 if (new_item)
10976 {
10977 new_item.SetResultOfSplit(true);
10978 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10980 new_item.SetQuantity(split_quantity_new);
10981 }
10982 }
10983 }
10984
10986 {
10988 return;
10989
10991 float split_quantity_new = Math.Floor(quantity * 0.5);
10992
10994
10995 if (new_item)
10996 {
10997 if (new_item.GetQuantityMax() < split_quantity_new)
10998 {
10999 split_quantity_new = new_item.GetQuantityMax();
11000 }
11001
11002 new_item.SetResultOfSplit(true);
11003 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11004
11006 {
11009 }
11010 else
11011 {
11014 }
11015 }
11016 }
11017
11019 {
11021 return;
11022
11024 float split_quantity_new = Math.Floor(quantity / 2);
11025
11026 InventoryLocation invloc = new InventoryLocation;
11028
11030 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11031
11032 if (new_item)
11033 {
11034 if (new_item.GetQuantityMax() < split_quantity_new)
11035 {
11036 split_quantity_new = new_item.GetQuantityMax();
11037 }
11039 {
11042 }
11043 else
11044 {
11047 }
11048 }
11049 }
11050
11053 {
11054 SetWeightDirty();
11056
11057 if (parent)
11058 parent.OnAttachmentQuantityChangedEx(this, delta);
11059
11061 {
11063 {
11065 }
11067 {
11068 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11070 }
11071 }
11072
11073 }
11074
11077 {
11078
11079 }
11080
11083 {
11085 }
11086
11088 {
11089 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11090
11092 {
11093 if (newLevel == GameConstants.STATE_RUINED)
11094 {
11096 EntityAI parent = GetHierarchyParent();
11097 if (parent && parent.IsFireplace())
11098 {
11099 CargoBase cargo = GetInventory().GetCargo();
11100 if (cargo)
11101 {
11103 {
11105 }
11106 }
11107 }
11108 }
11109
11111 {
11112
11114 return;
11115 }
11116
11117 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11118 {
11120 }
11121 }
11122 }
11123
11124
11126 {
11127 super.OnRightClick();
11128
11130 {
11132 {
11133 if (ScriptInputUserData.CanStoreInputUserData())
11134 {
11135 vector m4[4];
11137
11138 EntityAI root = GetHierarchyRoot();
11139
11140 InventoryLocation dst = new InventoryLocation;
11142 {
11143 if (root)
11144 {
11145 root.GetTransform(m4);
11147 }
11148 else
11149 GetInventory().GetCurrentInventoryLocation(dst);
11150 }
11151 else
11152 {
11154
11155
11156 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11157 {
11158 if (root)
11159 {
11160 root.GetTransform(m4);
11162 }
11163 else
11164 GetInventory().GetCurrentInventoryLocation(dst);
11165 }
11166 else
11167 {
11168 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11169 }
11170 }
11171
11172 ScriptInputUserData ctx = new ScriptInputUserData;
11180 }
11181 }
11182 else if (!
GetGame().IsMultiplayer())
11183 {
11185 }
11186 }
11187 }
11188
11189 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11190 {
11191
11192 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11193 return false;
11194
11195 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11196 return false;
11197
11198
11200 return false;
11201
11202
11203 Magazine mag = Magazine.Cast(this);
11204 if (mag)
11205 {
11206 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11207 return false;
11208
11209 if (stack_max_limit)
11210 {
11211 Magazine other_mag = Magazine.Cast(other_item);
11212 if (other_item)
11213 {
11214 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11215 return false;
11216 }
11217
11218 }
11219 }
11220 else
11221 {
11222
11224 return false;
11225
11227 return false;
11228 }
11229
11230 PlayerBase player = null;
11231 if (CastTo(player, GetHierarchyRootPlayer()))
11232 {
11233 if (player.GetInventory().HasAttachment(this))
11234 return false;
11235
11236 if (player.IsItemsToDelete())
11237 return false;
11238 }
11239
11240 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11241 return false;
11242
11243 int slotID;
11245 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11246 return false;
11247
11248 return true;
11249 }
11250
11252 {
11254 }
11255
11257 {
11258 return m_IsResultOfSplit;
11259 }
11260
11262 {
11263 m_IsResultOfSplit = value;
11264 }
11265
11267 {
11269 }
11270
11272 {
11273 float other_item_quantity = other_item.GetQuantity();
11274 float this_free_space;
11275
11277
11279
11280 if (other_item_quantity > this_free_space)
11281 {
11282 return this_free_space;
11283 }
11284 else
11285 {
11286 return other_item_quantity;
11287 }
11288 }
11289
11291 {
11293 }
11294
11296 {
11298 return;
11299
11300 if (!IsMagazine() && other_item)
11301 {
11303 if (quantity_used != 0)
11304 {
11305 float hp1 = GetHealth01("","");
11306 float hp2 = other_item.GetHealth01("","");
11307 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11308 hpResult = hpResult / (
GetQuantity() + quantity_used);
11309
11310 hpResult *= GetMaxHealth();
11311 Math.Round(hpResult);
11312 SetHealth("", "Health", hpResult);
11313
11315 other_item.AddQuantity(-quantity_used);
11316 }
11317 }
11319 }
11320
11322 {
11323 #ifdef SERVER
11324 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11325 GetHierarchyParent().IncreaseLifetimeUp();
11326 #endif
11327 };
11328
11330 {
11331 PlayerBase p = PlayerBase.Cast(player);
11332
11333 array<int> recipesIds = p.m_Recipes;
11334 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11335 if (moduleRecipesManager)
11336 {
11337 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11338 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11339 }
11340
11341 for (int i = 0;i < recipesIds.Count(); i++)
11342 {
11343 int key = recipesIds.Get(i);
11344 string recipeName = moduleRecipesManager.GetRecipeName(key);
11346 }
11347 }
11348
11349
11350 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11351 {
11352 super.GetDebugActions(outputList);
11353
11354
11359
11360
11364
11368
11369
11372
11373
11375 {
11378 }
11379
11381
11384
11388 }
11389
11390
11391
11392
11394 {
11395 super.OnAction(action_id, player, ctx);
11396 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11397 {
11398 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11399 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11400 PlayerBase p = PlayerBase.Cast(player);
11401 if (
EActions.RECIPES_RANGE_START < 1000)
11402 {
11403 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11404 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11405 }
11406 }
11407 #ifndef SERVER
11408 else if (action_id ==
EActions.WATCH_PLAYER)
11409 {
11410 PluginDeveloper.SetDeveloperItemClientEx(player);
11411 }
11412 #endif
11414 {
11415 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11416 {
11417 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11418 OnDebugButtonPressServer(id + 1);
11419 }
11420
11421 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11422 {
11423 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11425 }
11426
11427 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11428 {
11429 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11431 }
11432
11433 else if (action_id ==
EActions.ADD_QUANTITY)
11434 {
11435 if (IsMagazine())
11436 {
11437 Magazine mag = Magazine.Cast(this);
11438 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11439 }
11440 else
11441 {
11443 }
11444
11445 if (m_EM)
11446 {
11447 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11448 }
11449
11450 }
11451
11452 else if (action_id ==
EActions.REMOVE_QUANTITY)
11453 {
11454 if (IsMagazine())
11455 {
11456 Magazine mag2 = Magazine.Cast(this);
11457 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11458 }
11459 else
11460 {
11462 }
11463 if (m_EM)
11464 {
11465 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11466 }
11467
11468 }
11469
11470 else if (action_id ==
EActions.SET_QUANTITY_0)
11471 {
11473
11474 if (m_EM)
11475 {
11476 m_EM.SetEnergy(0);
11477 }
11478 }
11479
11480 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11481 {
11483
11484 if (m_EM)
11485 {
11486 m_EM.SetEnergy(m_EM.GetEnergyMax());
11487 }
11488 }
11489
11490 else if (action_id ==
EActions.ADD_HEALTH)
11491 {
11492 AddHealth("","",GetMaxHealth("","Health")/5);
11493 }
11494 else if (action_id ==
EActions.REMOVE_HEALTH)
11495 {
11496 AddHealth("","",-GetMaxHealth("","Health")/5);
11497 }
11498 else if (action_id ==
EActions.DESTROY_HEALTH)
11499 {
11500 SetHealth01("","",0);
11501 }
11502 else if (action_id ==
EActions.WATCH_ITEM)
11503 {
11505 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11506 #ifdef DEVELOPER
11507 SetDebugDeveloper_item(this);
11508 #endif
11509 }
11510
11511 else if (action_id ==
EActions.ADD_TEMPERATURE)
11512 {
11513 AddTemperature(20);
11514
11515 }
11516
11517 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11518 {
11519 AddTemperature(-20);
11520
11521 }
11522
11523 else if (action_id ==
EActions.FLIP_FROZEN)
11524 {
11525 SetFrozen(!GetIsFrozen());
11526
11527 }
11528
11529 else if (action_id ==
EActions.ADD_WETNESS)
11530 {
11532
11533 }
11534
11535 else if (action_id ==
EActions.REMOVE_WETNESS)
11536 {
11538
11539 }
11540
11541 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11542 {
11545
11546
11547 }
11548
11549 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11550 {
11553 }
11554
11555 else if (action_id ==
EActions.MAKE_SPECIAL)
11556 {
11557 auto debugParams = DebugSpawnParams.WithPlayer(player);
11558 OnDebugSpawnEx(debugParams);
11559 }
11560
11561 else if (action_id ==
EActions.DELETE)
11562 {
11563 Delete();
11564 }
11565
11566 }
11567
11568
11569 return false;
11570 }
11571
11572
11573
11574
11578
11581
11582
11583
11585 {
11586 return false;
11587 }
11588
11589
11591 {
11592 return true;
11593 }
11594
11595
11597 {
11598 return true;
11599 }
11600
11601
11602
11604 {
11605 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11607 }
11608
11611 {
11612 return null;
11613 }
11614
11616 {
11617 return false;
11618 }
11619
11621 {
11622 return false;
11623 }
11624
11628
11629
11631 {
11632 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11633 return module_repairing.CanRepair(this, item_repair_kit);
11634 }
11635
11636
11637 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11638 {
11639 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11640 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11641 }
11642
11643
11645 {
11646
11647
11648
11649
11650
11651
11652
11653
11654 return 1;
11655 }
11656
11657
11658
11660 {
11662 }
11663
11664
11665
11667 {
11669 }
11670
11671
11680 {
11681 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11682
11683 if (player)
11684 {
11685 player.MessageStatus(text);
11686 }
11687 }
11688
11689
11698 {
11699 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11700
11701 if (player)
11702 {
11703 player.MessageAction(text);
11704 }
11705 }
11706
11707
11716 {
11717 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11718
11719 if (player)
11720 {
11721 player.MessageFriendly(text);
11722 }
11723 }
11724
11725
11734 {
11735 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11736
11737 if (player)
11738 {
11739 player.MessageImportant(text);
11740 }
11741 }
11742
11744 {
11745 return true;
11746 }
11747
11748
11749 override bool KindOf(
string tag)
11750 {
11751 bool found = false;
11752 string item_name = this.
GetType();
11755
11756 int array_size = item_tag_array.Count();
11757 for (int i = 0; i < array_size; i++)
11758 {
11759 if (item_tag_array.Get(i) == tag)
11760 {
11761 found = true;
11762 break;
11763 }
11764 }
11765 return found;
11766 }
11767
11768
11770 {
11771
11772 super.OnRPC(sender, rpc_type,ctx);
11773
11774
11775 switch (rpc_type)
11776 {
11777 #ifndef SERVER
11778 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11779 Param2<bool, string> p = new Param2<bool, string>(false, "");
11780
11782 return;
11783
11784 bool play = p.param1;
11785 string soundSet = p.param2;
11786
11787 if (play)
11788 {
11790 {
11792 {
11794 }
11795 }
11796 else
11797 {
11799 }
11800 }
11801 else
11802 {
11804 }
11805
11806 break;
11807 #endif
11808
11809 }
11810
11812 {
11814 }
11815 }
11816
11817
11818
11819
11821 {
11822 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11823 return plugin.GetID(
name);
11824 }
11825
11827 {
11828 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11829 return plugin.GetName(id);
11830 }
11831
11834 {
11835
11836
11837 int varFlags;
11838 if (!ctx.
Read(varFlags))
11839 return;
11840
11841 if (varFlags & ItemVariableFlags.FLOAT)
11842 {
11844 }
11845 }
11846
11848 {
11849
11850 super.SerializeNumericalVars(floats_out);
11851
11852
11853
11855 {
11857 }
11858
11860 {
11862 }
11863
11865 {
11867 }
11868
11870 {
11875 }
11876
11878 {
11880 }
11881 }
11882
11884 {
11885
11886 super.DeSerializeNumericalVars(floats);
11887
11888
11889 int index = 0;
11890 int mask = Math.Round(floats.Get(index));
11891
11892 index++;
11893
11895 {
11897 {
11899 }
11900 else
11901 {
11902 float quantity = floats.Get(index);
11903 SetQuantity(quantity,
true,
false,
false,
false);
11904 }
11905 index++;
11906 }
11907
11909 {
11910 float wet = floats.Get(index);
11912 index++;
11913 }
11914
11916 {
11917 int liquidtype = Math.Round(floats.Get(index));
11919 index++;
11920 }
11921
11923 {
11925 index++;
11927 index++;
11929 index++;
11931 index++;
11932 }
11933
11935 {
11936 int cleanness = Math.Round(floats.Get(index));
11938 index++;
11939 }
11940 }
11941
11943 {
11944 super.WriteVarsToCTX(ctx);
11945
11946
11948 {
11950 }
11951
11953 {
11955 }
11956
11958 {
11960 }
11961
11963 {
11964 int r,g,b,a;
11970 }
11971
11973 {
11975 }
11976 }
11977
11979 {
11980 if (!super.ReadVarsFromCTX(ctx,version))
11981 return false;
11982
11983 int intValue;
11984 float value;
11985
11986 if (version < 140)
11987 {
11988 if (!ctx.
Read(intValue))
11989 return false;
11990
11991 m_VariablesMask = intValue;
11992 }
11993
11995 {
11996 if (!ctx.
Read(value))
11997 return false;
11998
12000 {
12002 }
12003 else
12004 {
12006 }
12007 }
12008
12009 if (version < 140)
12010 {
12012 {
12013 if (!ctx.
Read(value))
12014 return false;
12015 SetTemperatureDirect(value);
12016 }
12017 }
12018
12020 {
12021 if (!ctx.
Read(value))
12022 return false;
12024 }
12025
12027 {
12028 if (!ctx.
Read(intValue))
12029 return false;
12031 }
12032
12034 {
12035 int r,g,b,a;
12037 return false;
12039 return false;
12041 return false;
12043 return false;
12044
12046 }
12047
12049 {
12050 if (!ctx.
Read(intValue))
12051 return false;
12053 }
12054
12055 if (version >= 138 && version < 140)
12056 {
12058 {
12059 if (!ctx.
Read(intValue))
12060 return false;
12061 SetFrozen(intValue);
12062 }
12063 }
12064
12065 return true;
12066 }
12067
12068
12070 {
12073 {
12075 }
12076
12077 if (!super.OnStoreLoad(ctx, version))
12078 {
12080 return false;
12081 }
12082
12083 if (version >= 114)
12084 {
12085 bool hasQuickBarIndexSaved;
12086
12087 if (!ctx.
Read(hasQuickBarIndexSaved))
12088 {
12090 return false;
12091 }
12092
12093 if (hasQuickBarIndexSaved)
12094 {
12095 int itmQBIndex;
12096
12097
12098 if (!ctx.
Read(itmQBIndex))
12099 {
12101 return false;
12102 }
12103
12104 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12105 if (itmQBIndex != -1 && parentPlayer)
12106 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12107 }
12108 }
12109 else
12110 {
12111
12112 PlayerBase player;
12113 int itemQBIndex;
12114 if (version ==
int.
MAX)
12115 {
12116 if (!ctx.
Read(itemQBIndex))
12117 {
12119 return false;
12120 }
12121 }
12122 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12123 {
12124
12125 if (!ctx.
Read(itemQBIndex))
12126 {
12128 return false;
12129 }
12130 if (itemQBIndex != -1 && player)
12131 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12132 }
12133 }
12134
12135 if (version < 140)
12136 {
12137
12138 if (!LoadVariables(ctx, version))
12139 {
12141 return false;
12142 }
12143 }
12144
12145
12147 {
12149 return false;
12150 }
12151 if (version >= 132)
12152 {
12154 if (raib)
12155 {
12157 {
12159 return false;
12160 }
12161 }
12162 }
12163
12165 return true;
12166 }
12167
12168
12169
12171 {
12172 super.OnStoreSave(ctx);
12173
12174 PlayerBase player;
12175 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12176 {
12178
12179 int itemQBIndex = -1;
12180 itemQBIndex = player.FindQuickBarEntityIndex(this);
12181 ctx.
Write(itemQBIndex);
12182 }
12183 else
12184 {
12186 }
12187
12189
12191 if (raib)
12192 {
12194 }
12195 }
12196
12197
12199 {
12200 super.AfterStoreLoad();
12201
12203 {
12205 }
12206
12208 {
12211 }
12212 }
12213
12215 {
12216 super.EEOnAfterLoad();
12217
12219 {
12221 }
12222
12225 }
12226
12228 {
12229 return false;
12230 }
12231
12232
12233
12235 {
12237 {
12238 #ifdef PLATFORM_CONSOLE
12239
12241 {
12243 if (menu)
12244 {
12246 }
12247 }
12248 #endif
12249 }
12250
12252 {
12255 }
12256
12258 {
12259 SetWeightDirty();
12261 }
12263 {
12266 }
12267
12269 {
12272 }
12274 {
12277 }
12278
12279 super.OnVariablesSynchronized();
12280 }
12281
12282
12283
12285 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12286 {
12287 if (!IsServerCheck(allow_client))
12288 return false;
12289
12291 return false;
12292
12295
12296 if (value <= (min + 0.001))
12297 value = min;
12298
12299 if (value == min)
12300 {
12301 if (destroy_config)
12302 {
12303 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12304 if (dstr)
12305 {
12307 this.Delete();
12308 return true;
12309 }
12310 }
12311 else if (destroy_forced)
12312 {
12314 this.Delete();
12315 return true;
12316 }
12317
12319 }
12320
12323
12325 {
12327
12328 if (delta)
12330 }
12331
12333
12334 return false;
12335 }
12336
12337
12339 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12340 {
12342 }
12343
12345 {
12348 }
12349
12351 {
12354 }
12355
12358 {
12359 float value_clamped = Math.Clamp(value, 0, 1);
12361 SetQuantity(result, destroy_config, destroy_forced);
12362 }
12363
12364
12367 {
12369 }
12370
12372 {
12374 }
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12386 {
12387 int slot = -1;
12388 if (GetInventory())
12389 {
12390 InventoryLocation il = new InventoryLocation;
12391 GetInventory().GetCurrentInventoryLocation(il);
12393 }
12394
12396 }
12397
12399 {
12400 float quantity_max = 0;
12401
12403 {
12404 if (attSlotID != -1)
12405 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12406
12407 if (quantity_max <= 0)
12409 }
12410
12411 if (quantity_max <= 0)
12413
12414 return quantity_max;
12415 }
12416
12418 {
12420 }
12421
12423 {
12425 }
12426
12427
12429 {
12431 }
12432
12434 {
12436 }
12437
12439 {
12441 }
12442
12443
12445 {
12446
12447 float weightEx = GetWeightEx();
12448 float special = GetInventoryAndCargoWeight();
12449 return weightEx - special;
12450 }
12451
12452
12454 {
12456 }
12457
12459 {
12461 {
12462 #ifdef DEVELOPER
12463 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12464 {
12465 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12467 }
12468 #endif
12469
12470 return GetQuantity() * GetConfigWeightModified();
12471 }
12472 else if (HasEnergyManager())
12473 {
12474 #ifdef DEVELOPER
12475 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12476 {
12477 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12478 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12479 }
12480 #endif
12481 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12482 }
12483 else
12484 {
12485 #ifdef DEVELOPER
12486 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12487 {
12488 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12489 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12490 }
12491 #endif
12492 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12493 }
12494 }
12495
12498 {
12499 int item_count = 0;
12501
12502 if (GetInventory().GetCargo() != NULL)
12503 {
12504 item_count = GetInventory().GetCargo().GetItemCount();
12505 }
12506
12507 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12508 {
12509 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12510 if (item)
12511 item_count += item.GetNumberOfItems();
12512 }
12513 return item_count;
12514 }
12515
12518 {
12519 float weight = 0;
12520 float wetness = 1;
12521 if (include_wetness)
12524 {
12525 weight = wetness * m_ConfigWeight;
12526 }
12528 {
12529 weight = 1;
12530 }
12531 return weight;
12532 }
12533
12534
12535
12537 {
12538 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12539 {
12540 GameInventory inv = GetInventory();
12541 array<EntityAI> items = new array<EntityAI>;
12543 for (int i = 0; i < items.Count(); i++)
12544 {
12546 if (item)
12547 {
12549 }
12550 }
12551 }
12552 }
12553
12554
12555
12556
12558 {
12559 float energy = 0;
12560 if (HasEnergyManager())
12561 {
12562 energy = GetCompEM().GetEnergy();
12563 }
12564 return energy;
12565 }
12566
12567
12569 {
12570 super.OnEnergyConsumed();
12571
12573 }
12574
12576 {
12577 super.OnEnergyAdded();
12578
12580 }
12581
12582
12584 {
12585 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12586 {
12588 {
12589 float energy_0to1 = GetCompEM().GetEnergy0To1();
12591 }
12592 }
12593 }
12594
12595
12597 {
12598 return ConfigGetFloat("heatIsolation");
12599 }
12600
12602 {
12604 }
12605
12607 {
12608 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12609 if (
GetGame().ConfigIsExisting(paramPath))
12611
12612 return 0.0;
12613 }
12614
12616 {
12617 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12618 if (
GetGame().ConfigIsExisting(paramPath))
12620
12621 return 0.0;
12622 }
12623
12624 override void SetWet(
float value,
bool allow_client =
false)
12625 {
12626 if (!IsServerCheck(allow_client))
12627 return;
12628
12631
12633
12634 m_VarWet = Math.Clamp(value, min, max);
12635
12637 {
12640 }
12641 }
12642
12643 override void AddWet(
float value)
12644 {
12646 }
12647
12649 {
12651 }
12652
12654 {
12656 }
12657
12659 {
12661 }
12662
12664 {
12666 }
12667
12669 {
12671 }
12672
12673 override void OnWetChanged(
float newVal,
float oldVal)
12674 {
12677 if (newLevel != oldLevel)
12678 {
12680 }
12681 }
12682
12684 {
12685 SetWeightDirty();
12686 }
12687
12689 {
12690 return GetWetLevelInternal(
m_VarWet);
12691 }
12692
12693
12694
12696 {
12698 }
12699
12701 {
12703 }
12704
12706 {
12708 }
12709
12711 {
12713 }
12714
12715
12716
12718 {
12719 if (ConfigIsExisting("itemModelLength"))
12720 {
12721 return ConfigGetFloat("itemModelLength");
12722 }
12723 return 0;
12724 }
12725
12727 {
12728 if (ConfigIsExisting("itemAttachOffset"))
12729 {
12730 return ConfigGetFloat("itemAttachOffset");
12731 }
12732 return 0;
12733 }
12734
12735 override void SetCleanness(
int value,
bool allow_client =
false)
12736 {
12737 if (!IsServerCheck(allow_client))
12738 return;
12739
12741
12743
12746 }
12747
12749 {
12751 }
12752
12754 {
12755 return true;
12756 }
12757
12758
12759
12760
12762 {
12764 }
12765
12767 {
12769 }
12770
12771
12772
12773
12774 override void SetColor(
int r,
int g,
int b,
int a)
12775 {
12781 }
12783 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12784 {
12789 }
12790
12792 {
12794 }
12795
12798 {
12799 int r,g,b,a;
12801 r = r/255;
12802 g = g/255;
12803 b = b/255;
12804 a = a/255;
12805 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12806 }
12807
12808
12809
12810 override void SetLiquidType(
int value,
bool allow_client =
false)
12811 {
12812 if (!IsServerCheck(allow_client))
12813 return;
12814
12819 }
12820
12822 {
12823 return ConfigGetInt("varLiquidTypeInit");
12824 }
12825
12827 {
12829 }
12830
12832 {
12834 SetFrozen(false);
12835 }
12836
12839 {
12840 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12841 }
12842
12843
12846 {
12847 PlayerBase nplayer;
12848 if (PlayerBase.CastTo(nplayer, player))
12849 {
12851
12852 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12853 }
12854 }
12855
12856
12859 {
12860 PlayerBase nplayer;
12861 if (PlayerBase.CastTo(nplayer,player))
12862 {
12863
12864 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12865
12866 }
12867
12868
12869 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12870
12871
12872 if (HasEnergyManager())
12873 {
12874 GetCompEM().UpdatePlugState();
12875 }
12876 }
12877
12878
12880 {
12881 super.OnPlacementStarted(player);
12882
12884 }
12885
12886 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12887 {
12889 {
12890 m_AdminLog.OnPlacementComplete(player,
this);
12891 }
12892
12893 super.OnPlacementComplete(player, position, orientation);
12894 }
12895
12896
12897
12898
12899
12901 {
12903 {
12904 return true;
12905 }
12906 else
12907 {
12908 return false;
12909 }
12910 }
12911
12912
12914 {
12916 {
12918 }
12919 }
12920
12921
12923 {
12925 }
12926
12928 {
12930 }
12931
12932 override void InsertAgent(
int agent,
float count = 1)
12933 {
12934 if (count < 1)
12935 return;
12936
12938 }
12939
12942 {
12944 }
12945
12946
12948 {
12950 }
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12994 {
12996 return false;
12997 return true;
12998 }
12999
13001 {
13002
13004 }
13005
13006
13009 {
13010 super.CheckForRoofLimited(timeTresholdMS);
13011
13013 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13014 {
13015 m_PreviousRoofTestTime = time;
13016 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13017 }
13018 }
13019
13020
13022 {
13024 {
13025 return 0;
13026 }
13027
13028 if (GetInventory().GetAttachmentSlotsCount() != 0)
13029 {
13030 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13031 if (filter)
13032 return filter.GetProtectionLevel(type, false, system);
13033 else
13034 return 0;
13035 }
13036
13037 string subclassPath, entryName;
13038
13039 switch (type)
13040 {
13042 entryName = "biological";
13043 break;
13045 entryName = "chemical";
13046 break;
13047 default:
13048 entryName = "biological";
13049 break;
13050 }
13051
13052 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13053
13055 }
13056
13057
13058
13061 {
13062 if (!IsMagazine())
13064
13066 }
13067
13068
13069
13070
13071
13076 {
13077 return true;
13078 }
13079
13081 {
13083 }
13084
13085
13086
13087
13088
13090 {
13091 if (parent)
13092 {
13093 if (parent.IsInherited(DayZInfected))
13094 return true;
13095
13096 if (!parent.IsRuined())
13097 return true;
13098 }
13099
13100 return true;
13101 }
13102
13104 {
13105 if (!super.CanPutAsAttachment(parent))
13106 {
13107 return false;
13108 }
13109
13110 if (!IsRuined() && !parent.IsRuined())
13111 {
13112 return true;
13113 }
13114
13115 return false;
13116 }
13117
13119 {
13120
13121
13122
13123
13124 return super.CanReceiveItemIntoCargo(item);
13125 }
13126
13128 {
13129
13130
13131
13132
13133 GameInventory attachmentInv = attachment.GetInventory();
13135 {
13136 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13137 return false;
13138 }
13139
13140 InventoryLocation loc = new InventoryLocation();
13141 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13142 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13143 return false;
13144
13145 return super.CanReceiveAttachment(attachment, slotId);
13146 }
13147
13149 {
13150 if (!super.CanReleaseAttachment(attachment))
13151 return false;
13152
13153 return GetInventory().AreChildrenAccessible();
13154 }
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13177 {
13178 int id = muzzle_owner.GetMuzzleID();
13179 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13180
13181 if (WPOF_array)
13182 {
13183 for (int i = 0; i < WPOF_array.Count(); i++)
13184 {
13185 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13186
13187 if (WPOF)
13188 {
13189 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13190 }
13191 }
13192 }
13193 }
13194
13195
13197 {
13198 int id = muzzle_owner.GetMuzzleID();
13200
13201 if (WPOBE_array)
13202 {
13203 for (int i = 0; i < WPOBE_array.Count(); i++)
13204 {
13205 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13206
13207 if (WPOBE)
13208 {
13209 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13210 }
13211 }
13212 }
13213 }
13214
13215
13217 {
13218 int id = muzzle_owner.GetMuzzleID();
13219 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13220
13221 if (WPOOH_array)
13222 {
13223 for (int i = 0; i < WPOOH_array.Count(); i++)
13224 {
13225 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13226
13227 if (WPOOH)
13228 {
13229 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13230 }
13231 }
13232 }
13233 }
13234
13235
13237 {
13238 int id = muzzle_owner.GetMuzzleID();
13239 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13240
13241 if (WPOOH_array)
13242 {
13243 for (int i = 0; i < WPOOH_array.Count(); i++)
13244 {
13245 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13246
13247 if (WPOOH)
13248 {
13249 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13250 }
13251 }
13252 }
13253 }
13254
13255
13257 {
13258 int id = muzzle_owner.GetMuzzleID();
13259 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13260
13261 if (WPOOH_array)
13262 {
13263 for (int i = 0; i < WPOOH_array.Count(); i++)
13264 {
13265 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13266
13267 if (WPOOH)
13268 {
13269 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13270 }
13271 }
13272 }
13273 }
13274
13275
13276
13278 {
13280 {
13281 return true;
13282 }
13283
13284 return false;
13285 }
13286
13288 {
13290 {
13291 return true;
13292 }
13293
13294 return false;
13295 }
13296
13298 {
13300 {
13301 return true;
13302 }
13303
13304 return false;
13305 }
13306
13308 {
13309 return false;
13310 }
13311
13314 {
13315 return UATimeSpent.DEFAULT_DEPLOY;
13316 }
13317
13318
13319
13320
13322 {
13324 SetSynchDirty();
13325 }
13326
13328 {
13330 }
13331
13332
13334 {
13335 return false;
13336 }
13337
13340 {
13341 string att_type = "None";
13342
13343 if (ConfigIsExisting("soundAttType"))
13344 {
13345 att_type = ConfigGetString("soundAttType");
13346 }
13347
13349 }
13350
13352 {
13354 }
13355
13356
13357
13358
13359
13363
13365 {
13368
13370 }
13371
13372
13374 {
13376 return;
13377
13379
13382
13385
13386 SoundParameters params = new SoundParameters();
13390 }
13391
13392
13394 {
13396 return;
13397
13399 SetSynchDirty();
13400
13403 }
13404
13405
13407 {
13409 return;
13410
13412 SetSynchDirty();
13413
13416 }
13417
13419 {
13421 }
13422
13424 {
13426 }
13427
13430 {
13431 if (!
GetGame().IsDedicatedServer())
13432 {
13433 if (ConfigIsExisting("attachSoundSet"))
13434 {
13435 string cfg_path = "";
13436 string soundset = "";
13437 string type_name =
GetType();
13438
13441 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13442 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13443
13444 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13445 {
13446 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13447 {
13448 if (cfg_slot_array[i] == slot_type)
13449 {
13450 soundset = cfg_soundset_array[i];
13451 break;
13452 }
13453 }
13454 }
13455
13456 if (soundset != "")
13457 {
13458 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13460 }
13461 }
13462 }
13463 }
13464
13466 {
13467
13468 }
13469
13470 void OnApply(PlayerBase player);
13471
13473 {
13474 return 1.0;
13475 };
13476
13478 {
13480 }
13481
13483 {
13485 }
13486
13488
13490 {
13491 SetDynamicPhysicsLifeTime(0.01);
13493 }
13494
13496 {
13497 array<string> zone_names = new array<string>;
13498 GetDamageZones(zone_names);
13499 for (int i = 0; i < zone_names.Count(); i++)
13500 {
13501 SetHealthMax(zone_names.Get(i),"Health");
13502 }
13503 SetHealthMax("","Health");
13504 }
13505
13508 {
13509 float global_health = GetHealth01("","Health");
13510 array<string> zones = new array<string>;
13511 GetDamageZones(zones);
13512
13513 for (int i = 0; i < zones.Count(); i++)
13514 {
13515 SetHealth01(zones.Get(i),"Health",global_health);
13516 }
13517 }
13518
13521 {
13522 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13523 }
13524
13526 {
13527 if (!hasRootAsPlayer)
13528 {
13529 if (refParentIB)
13530 {
13531
13532 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13533 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13534
13535 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13536 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13537
13540 }
13541 else
13542 {
13543
13546 }
13547 }
13548 }
13549
13551 {
13553 {
13554 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13555 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13556 {
13557 float heatPermCoef = 1.0;
13559 while (ent)
13560 {
13561 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13562 ent = ent.GetHierarchyParent();
13563 }
13564
13565 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13566 }
13567 }
13568 }
13569
13571 {
13572
13573 EntityAI parent = GetHierarchyParent();
13574 if (!parent)
13575 {
13576 hasParent = false;
13577 hasRootAsPlayer = false;
13578 }
13579 else
13580 {
13581 hasParent = true;
13582 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13583 refParentIB =
ItemBase.Cast(parent);
13584 }
13585 }
13586
13587 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13588 {
13589
13590 }
13591
13593 {
13594
13595 return false;
13596 }
13597
13599 {
13600
13601
13602 return false;
13603 }
13604
13606 {
13607
13608 return false;
13609 }
13610
13613 {
13614 return !GetIsFrozen() &&
IsOpen();
13615 }
13616
13618 {
13619 bool hasParent = false, hasRootAsPlayer = false;
13621
13622 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13623 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13624
13625 if (wwtu || foodDecay)
13626 {
13630
13631 if (processWetness || processTemperature || processDecay)
13632 {
13634
13635 if (processWetness)
13636 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13637
13638 if (processTemperature)
13640
13641 if (processDecay)
13642 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13643 }
13644 }
13645 }
13646
13649 {
13651 }
13652
13654 {
13657
13658 return super.GetTemperatureFreezeThreshold();
13659 }
13660
13662 {
13665
13666 return super.GetTemperatureThawThreshold();
13667 }
13668
13670 {
13673
13674 return super.GetItemOverheatThreshold();
13675 }
13676
13678 {
13680 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13681
13682 return super.GetTemperatureFreezeTime();
13683 }
13684
13686 {
13688 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13689
13690 return super.GetTemperatureThawTime();
13691 }
13692
13697
13699 {
13700 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13701 }
13702
13704 {
13705 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13706 }
13707
13710 {
13712 }
13713
13715 {
13717 }
13718
13720 {
13722 }
13723
13726 {
13727 return null;
13728 }
13729
13732 {
13733 return false;
13734 }
13735
13737 {
13739 {
13742 if (!trg)
13743 {
13745 explosive = this;
13746 }
13747
13748 explosive.PairRemote(trg);
13750
13751 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13752 trg.SetPersistentPairID(persistentID);
13753 explosive.SetPersistentPairID(persistentID);
13754
13755 return true;
13756 }
13757 return false;
13758 }
13759
13762 {
13763 float ret = 1.0;
13766 ret *= GetHealth01();
13767
13768 return ret;
13769 }
13770
13771 #ifdef DEVELOPER
13772 override void SetDebugItem()
13773 {
13774 super.SetDebugItem();
13775 _itemBase = this;
13776 }
13777
13779 {
13780 string text = super.GetDebugText();
13781
13783 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13784
13785 return text;
13786 }
13787 #endif
13788
13790 {
13791 return true;
13792 }
13793
13795
13797
13799 {
13802 }
13803
13804
13812
13828}
13829
13831{
13833 if (entity)
13834 {
13835 bool is_item = entity.IsInherited(
ItemBase);
13836 if (is_item && full_quantity)
13837 {
13840 }
13841 }
13842 else
13843 {
13845 return NULL;
13846 }
13847 return entity;
13848}
13849
13851{
13852 if (item)
13853 {
13854 if (health > 0)
13855 item.SetHealth("", "", health);
13856
13857 if (item.CanHaveTemperature())
13858 {
13860 if (item.CanFreeze())
13861 item.SetFrozen(false);
13862 }
13863
13864 if (item.HasEnergyManager())
13865 {
13866 if (quantity >= 0)
13867 {
13868 item.GetCompEM().SetEnergy0To1(quantity);
13869 }
13870 else
13871 {
13873 }
13874 }
13875 else if (item.IsMagazine())
13876 {
13877 Magazine mag = Magazine.Cast(item);
13878 if (quantity >= 0)
13879 {
13880 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13881 }
13882 else
13883 {
13885 }
13886
13887 }
13888 else
13889 {
13890 if (quantity >= 0)
13891 {
13892 item.SetQuantityNormalized(quantity, false);
13893 }
13894 else
13895 {
13897 }
13898
13899 }
13900 }
13901}
13902
13903#ifdef DEVELOPER
13905#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.