9012{
9014 {
9015 return true;
9016 }
9017};
9018
9019
9020
9022{
9026
9028
9031
9032
9033
9034
9035
9044
9050
9055
9060
9081 protected bool m_IsResultOfSplit
9082
9084
9089
9090
9091
9093
9097
9098
9099
9101
9104
9105
9106
9112
9113
9121
9124
9125
9127
9128
9130
9131
9136
9137
9142
9143
9145
9146
9148 {
9153
9154 if (!
GetGame().IsDedicatedServer())
9155 {
9157 {
9159
9161 {
9163 }
9164 }
9165
9168 }
9169
9170 m_OldLocation = null;
9171
9173 {
9175 }
9176
9177 if (ConfigIsExisting("headSelectionsToHide"))
9178 {
9181 }
9182
9184 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9185 {
9187 }
9188
9190
9191 m_IsResultOfSplit = false;
9192
9194 }
9195
9197 {
9198 super.InitItemVariables();
9199
9205 m_Count = ConfigGetInt(
"count");
9206
9209
9214
9217
9222
9234
9238
9239
9242 if (ConfigIsExisting("canBeSplit"))
9243 {
9246 }
9247
9249 if (ConfigIsExisting("itemBehaviour"))
9251
9252
9255 RegisterNetSyncVariableInt("m_VarLiquidType");
9256 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9257
9258 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9259 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9260 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9261
9262 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9263 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9264 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9265 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9266
9267 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9268 RegisterNetSyncVariableBool("m_IsTakeable");
9269 RegisterNetSyncVariableBool("m_IsHologram");
9270
9273 {
9276 }
9277
9279
9281 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9283
9284 }
9285
9287 {
9289 }
9290
9292 {
9295 {
9300 }
9301 }
9302
9303 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9304 {
9306 {
9309 }
9310
9312 }
9313
9315 {
9321 }
9322
9324
9326 {
9328
9329 if (!action)
9330 {
9331 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9332 return;
9333 }
9334
9336 if (!ai)
9337 {
9339 return;
9340 }
9341
9343 if (!action_array)
9344 {
9345 action_array = new array<ActionBase_Basic>;
9347 }
9348 if (LogManager.IsActionLogEnable())
9349 {
9350 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9351 }
9352
9353 if (action_array.Find(action) != -1)
9354 {
9355 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9356 }
9357 else
9358 {
9359 action_array.Insert(action);
9360 }
9361 }
9362
9364 {
9366 ActionBase action = player.GetActionManager().GetAction(actionName);
9369
9370 if (action_array)
9371 {
9372 action_array.RemoveItem(action);
9373 }
9374 }
9375
9376
9377
9379 {
9380 ActionOverrideData overrideData = new ActionOverrideData();
9384
9386 if (!actionMap)
9387 {
9390 }
9391
9392 actionMap.Insert(this.
Type(), overrideData);
9393
9394 }
9395
9397
9399
9400
9402 {
9405
9408
9409 string config_to_search = "CfgVehicles";
9410 string muzzle_owner_config;
9411
9413 {
9414 if (IsInherited(Weapon))
9415 config_to_search = "CfgWeapons";
9416
9417 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9418
9419 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9420
9422
9423 if (config_OnFire_subclass_count > 0)
9424 {
9425 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9426
9427 for (int i = 0; i < config_OnFire_subclass_count; i++)
9428 {
9429 string particle_class = "";
9431 string config_OnFire_entry = config_OnFire_class + particle_class;
9432 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9433 WPOF_array.Insert(WPOF);
9434 }
9435
9436
9438 }
9439 }
9440
9442 {
9443 config_to_search = "CfgWeapons";
9444 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9445
9446 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9447
9449
9450 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9451 {
9452 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9453
9454 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9455 {
9456 string particle_class2 = "";
9458 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9459 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9460 WPOBE_array.Insert(WPOBE);
9461 }
9462
9463
9465 }
9466 }
9467 }
9468
9469
9471 {
9474
9476 {
9477 string config_to_search = "CfgVehicles";
9478
9479 if (IsInherited(Weapon))
9480 config_to_search = "CfgWeapons";
9481
9482 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9483 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9484
9485 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9486 {
9487
9489
9491 {
9493 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9495 return;
9496 }
9497
9500
9501
9502
9504 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9505
9506 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9507 {
9508 string particle_class = "";
9510 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9512
9513 if (entry_type == CT_CLASS)
9514 {
9515 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9516 WPOOH_array.Insert(WPOF);
9517 }
9518 }
9519
9520
9522 }
9523 }
9524 }
9525
9527 {
9529 }
9530
9532 {
9534 {
9536
9539
9542
9543 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9544 }
9545 }
9546
9548 {
9550 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9551
9553 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9554
9556 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9557
9559 {
9561 }
9562 }
9563
9565 {
9567 }
9568
9570 {
9573 else
9575
9577 {
9580 }
9581 else
9582 {
9585
9588 }
9589
9591 }
9592
9594 {
9596 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9597 }
9598
9600 {
9602 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9604 }
9605
9607 {
9609 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9610 }
9611
9613 {
9616
9617 OverheatingParticle OP = new OverheatingParticle();
9622
9624 }
9625
9627 {
9630
9631 return -1;
9632 }
9633
9635 {
9637 {
9640
9641 for (int i = count; i > 0; --i)
9642 {
9643 int id = i - 1;
9646
9649
9650 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9651 {
9652 if (p)
9653 {
9656 }
9657 }
9658 }
9659 }
9660 }
9661
9663 {
9665 {
9667 {
9668 int id = i - 1;
9670
9671 if (OP)
9672 {
9674
9675 if (p)
9676 {
9678 }
9679
9680 delete OP;
9681 }
9682 }
9683
9686 }
9687 }
9688
9691 {
9692 return 0.0;
9693 }
9694
9695
9697 {
9698 return 250;
9699 }
9700
9702 {
9703 return 0;
9704 }
9705
9708 {
9710 return true;
9711
9712 return false;
9713 }
9714
9717 {
9720
9722 {
9724 }
9725 else
9726 {
9727
9729 }
9730
9732 }
9733
9740 {
9741 return -1;
9742 }
9743
9744
9745
9746
9748 {
9750 {
9752 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9753
9754 if (r_index >= 0)
9755 {
9756 InventoryLocation r_il = new InventoryLocation;
9757 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9758
9759 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9762 {
9763 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9764 }
9766 {
9767 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9768 }
9769
9770 }
9771
9772 player.GetHumanInventory().ClearUserReservedLocation(this);
9773 }
9774
9777 }
9778
9779
9780
9781
9783 {
9784 return ItemBase.m_DebugActionsMask;
9785 }
9786
9788 {
9789 return ItemBase.m_DebugActionsMask & mask;
9790 }
9791
9793 {
9794 ItemBase.m_DebugActionsMask = mask;
9795 }
9796
9798 {
9799 ItemBase.m_DebugActionsMask |= mask;
9800 }
9801
9803 {
9804 ItemBase.m_DebugActionsMask &= ~mask;
9805 }
9806
9808 {
9810 {
9812 }
9813 else
9814 {
9816 }
9817 }
9818
9819
9821 {
9822 if (GetEconomyProfile())
9823 {
9824 float q_max = GetEconomyProfile().GetQuantityMax();
9825 if (q_max > 0)
9826 {
9827 float q_min = GetEconomyProfile().GetQuantityMin();
9828 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9829
9831 {
9832 ComponentEnergyManager comp = GetCompEM();
9834 {
9836 }
9837 }
9839 {
9841
9842 }
9843
9844 }
9845 }
9846 }
9847
9850 {
9851 EntityAI parent = GetHierarchyParent();
9852
9853 if (parent)
9854 {
9855 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9856 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9857 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9858 }
9859 }
9860
9863 {
9864 EntityAI parent = GetHierarchyParent();
9865
9866 if (parent)
9867 {
9868 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9869 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9870 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9871 }
9872 }
9873
9875 {
9876
9877
9878
9879
9881
9883 {
9884 if (ScriptInputUserData.CanStoreInputUserData())
9885 {
9886 ScriptInputUserData ctx = new ScriptInputUserData;
9892 ctx.
Write(use_stack_max);
9895
9897 {
9898 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9899 }
9900 }
9901 }
9902 else if (!
GetGame().IsMultiplayer())
9903 {
9905 }
9906 }
9907
9909 {
9911 }
9912
9914 {
9916 }
9917
9919 {
9921 }
9922
9924 {
9925
9926 return false;
9927 }
9928
9930 {
9931 return false;
9932 }
9933
9937 {
9938 return false;
9939 }
9940
9942 {
9943 return "";
9944 }
9945
9947
9949 {
9950 return false;
9951 }
9952
9954 {
9955 return true;
9956 }
9957
9958
9959
9961 {
9962 return true;
9963 }
9964
9966 {
9967 return true;
9968 }
9969
9971 {
9972 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9974 }
9975
9977 {
9979 }
9980
9982 {
9984 if (!is_being_placed)
9986 SetSynchDirty();
9987 }
9988
9989
9991
9993 {
9995 }
9996
9998 {
10000 }
10001
10003 {
10004 return 1;
10005 }
10006
10008 {
10009 return false;
10010 }
10011
10013 {
10015 SetSynchDirty();
10016 }
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10053 {
10054 super.OnMovedInsideCargo(container);
10055
10056 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10057 }
10058
10059 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10060 {
10061 super.EEItemLocationChanged(oldLoc,newLoc);
10062
10063 PlayerBase new_player = null;
10064 PlayerBase old_player = null;
10065
10066 if (newLoc.GetParent())
10067 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10068
10069 if (oldLoc.GetParent())
10070 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10071
10073 {
10074 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10075
10076 if (r_index >= 0)
10077 {
10078 InventoryLocation r_il = new InventoryLocation;
10079 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10080
10081 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10084 {
10085 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10086 }
10088 {
10089 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10090 }
10091
10092 }
10093 }
10094
10096 {
10097 if (new_player)
10098 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10099
10100 if (new_player == old_player)
10101 {
10102
10103 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10104 {
10106 {
10107 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10108 {
10109 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10110 }
10111 }
10112 else
10113 {
10114 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10115 }
10116 }
10117
10118 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10119 {
10120 int type = oldLoc.GetType();
10122 {
10123 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10124 }
10126 {
10127 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10128 }
10129 }
10130 if (!m_OldLocation)
10131 {
10132 m_OldLocation = new InventoryLocation;
10133 }
10134 m_OldLocation.Copy(oldLoc);
10135 }
10136 else
10137 {
10138 if (m_OldLocation)
10139 {
10140 m_OldLocation.Reset();
10141 }
10142 }
10143
10145 }
10146 else
10147 {
10148 if (new_player)
10149 {
10150 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10151 if (res_index >= 0)
10152 {
10153 InventoryLocation il = new InventoryLocation;
10154 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10156 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10159 {
10160 il.
GetParent().GetOnReleaseLock().Invoke(it);
10161 }
10163 {
10165 }
10166
10167 }
10168 }
10170 {
10171
10173 }
10174
10175 if (m_OldLocation)
10176 {
10177 m_OldLocation.Reset();
10178 }
10179 }
10180 }
10181
10182 override void EOnContact(IEntity other, Contact extra)
10183 {
10185 {
10186 int liquidType = -1;
10188 if (impactSpeed > 0.0)
10189 {
10191 #ifndef SERVER
10193 #else
10195 SetSynchDirty();
10196 #endif
10198 }
10199 }
10200
10201 #ifdef SERVER
10202 if (GetCompEM() && GetCompEM().IsPlugged())
10203 {
10204 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10205 GetCompEM().UnplugThis();
10206 }
10207 #endif
10208 }
10209
10211
10213 {
10215 }
10216
10218 {
10219
10220 }
10221
10223 {
10224 super.OnItemLocationChanged(old_owner, new_owner);
10225
10226 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10227 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10228
10229 if (!relatedPlayer && playerNew)
10230 relatedPlayer = playerNew;
10231
10232 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10233 {
10235 if (actionMgr)
10236 {
10237 ActionBase currentAction = actionMgr.GetRunningAction();
10238 if (currentAction)
10240 }
10241 }
10242
10243 Man ownerPlayerOld = null;
10244 Man ownerPlayerNew = null;
10245
10246 if (old_owner)
10247 {
10248 if (old_owner.
IsMan())
10249 {
10250 ownerPlayerOld = Man.Cast(old_owner);
10251 }
10252 else
10253 {
10254 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10255 }
10256 }
10257 else
10258 {
10260 {
10262
10263 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10264 {
10265 GetCompEM().UnplugThis();
10266 }
10267 }
10268 }
10269
10270 if (new_owner)
10271 {
10272 if (new_owner.
IsMan())
10273 {
10274 ownerPlayerNew = Man.Cast(new_owner);
10275 }
10276 else
10277 {
10278 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10279 }
10280 }
10281
10282 if (ownerPlayerOld != ownerPlayerNew)
10283 {
10284 if (ownerPlayerOld)
10285 {
10286 array<EntityAI> subItemsExit = new array<EntityAI>;
10288 for (int i = 0; i < subItemsExit.Count(); i++)
10289 {
10292 }
10293 }
10294
10295 if (ownerPlayerNew)
10296 {
10297 array<EntityAI> subItemsEnter = new array<EntityAI>;
10299 for (int j = 0; j < subItemsEnter.Count(); j++)
10300 {
10303 }
10304 }
10305 }
10306 else if (ownerPlayerNew != null)
10307 {
10308 PlayerBase nplayer;
10309 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10310 {
10311 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10313 for (int k = 0; k < subItemsUpdate.Count(); k++)
10314 {
10316 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10317 }
10318 }
10319 }
10320
10321 if (old_owner)
10322 old_owner.OnChildItemRemoved(this);
10323 if (new_owner)
10324 new_owner.OnChildItemReceived(this);
10325 }
10326
10327
10329 {
10330 super.EEDelete(parent);
10331 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10332 if (player)
10333 {
10335
10336 if (player.IsAlive())
10337 {
10338 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10339 if (r_index >= 0)
10340 {
10341 InventoryLocation r_il = new InventoryLocation;
10342 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10343
10344 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10347 {
10348 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10349 }
10351 {
10352 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10353 }
10354
10355 }
10356
10357 player.RemoveQuickBarEntityShortcut(this);
10358 }
10359 }
10360 }
10361
10363 {
10364 super.EEKilled(killer);
10365
10368 {
10369 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10370 {
10371 if (IsMagazine())
10372 {
10373 if (Magazine.Cast(this).GetAmmoCount() > 0)
10374 {
10376 }
10377 }
10378 else
10379 {
10381 }
10382 }
10383 }
10384 }
10385
10387 {
10388 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10389
10390 super.OnWasAttached(parent, slot_id);
10391
10394
10396 }
10397
10399 {
10400 super.OnWasDetached(parent, slot_id);
10401
10404 }
10405
10407 {
10408 int idx;
10411
10412 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10413 if (inventory_slots.Count() < 1)
10414 {
10415 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10416 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10417 }
10418 else
10419 {
10420 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10421 }
10422
10423 idx = inventory_slots.Find(slot);
10424 if (idx < 0)
10425 return "";
10426
10427 return attach_types.Get(idx);
10428 }
10429
10431 {
10432 int idx = -1;
10433 string slot;
10434
10437
10438 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10439 if (inventory_slots.Count() < 1)
10440 {
10441 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10442 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10443 }
10444 else
10445 {
10446 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10447 if (detach_types.Count() < 1)
10448 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10449 }
10450
10451 for (int i = 0; i < inventory_slots.Count(); i++)
10452 {
10453 slot = inventory_slots.Get(i);
10454 }
10455
10456 if (slot != "")
10457 {
10458 if (detach_types.Count() == 1)
10459 idx = 0;
10460 else
10461 idx = inventory_slots.Find(slot);
10462 }
10463 if (idx < 0)
10464 return "";
10465
10466 return detach_types.Get(idx);
10467 }
10468
10470 {
10471
10473
10474
10475 float min_time = 1;
10476 float max_time = 3;
10477 float delay = Math.RandomFloat(min_time, max_time);
10478
10479 explode_timer.Run(delay, this, "DoAmmoExplosion");
10480 }
10481
10483 {
10484 Magazine magazine = Magazine.Cast(this);
10485 int pop_sounds_count = 6;
10486 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10487
10488
10489 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10490 string sound_name = pop_sounds[ sound_idx ];
10492
10493
10494 magazine.ServerAddAmmoCount(-1);
10495
10496
10497 float min_temp_to_explode = 100;
10498
10499 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10500 {
10502 }
10503 }
10504
10505
10506 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10507 {
10508 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10509
10510 const int CHANCE_DAMAGE_CARGO = 4;
10511 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10512 const int CHANCE_DAMAGE_NOTHING = 2;
10513
10515 {
10516 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10517 int chances;
10518 int rnd;
10519
10520 if (GetInventory().GetCargo())
10521 {
10522 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10523 rnd = Math.RandomInt(0,chances);
10524
10525 if (rnd < CHANCE_DAMAGE_CARGO)
10526 {
10528 }
10529 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10530 {
10532 }
10533 }
10534 else
10535 {
10536 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10537 rnd = Math.RandomInt(0,chances);
10538
10539 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10540 {
10542 }
10543 }
10544 }
10545 }
10546
10548 {
10549 if (GetInventory().GetCargo())
10550 {
10551 int item_count = GetInventory().GetCargo().GetItemCount();
10552 if (item_count > 0)
10553 {
10554 int random_pick = Math.RandomInt(0, item_count);
10556 if (!item.IsExplosive())
10557 {
10558 item.AddHealth("","",damage);
10559 return true;
10560 }
10561 }
10562 }
10563 return false;
10564 }
10565
10567 {
10568 int attachment_count = GetInventory().AttachmentCount();
10569 if (attachment_count > 0)
10570 {
10571 int random_pick = Math.RandomInt(0, attachment_count);
10572 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10573 if (!attachment.IsExplosive())
10574 {
10575 attachment.AddHealth("","",damage);
10576 return true;
10577 }
10578 }
10579 return false;
10580 }
10581
10583 {
10585 }
10586
10588 {
10590 return GetInventory().CanRemoveEntity();
10591
10592 return false;
10593 }
10594
10596 {
10598 return;
10599
10601 {
10602 if (ScriptInputUserData.CanStoreInputUserData())
10603 {
10604 ScriptInputUserData ctx = new ScriptInputUserData;
10609 ctx.
Write(destination_entity);
10611 ctx.
Write(slot_id);
10613 }
10614 }
10615 else if (!
GetGame().IsMultiplayer())
10616 {
10618 }
10619 }
10620
10622 {
10624 return;
10625
10626 float split_quantity_new;
10630 InventoryLocation loc = new InventoryLocation;
10631
10632 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10633 {
10635 split_quantity_new = stack_max;
10636 else
10638
10639 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10640 if (new_item)
10641 {
10642 new_item.SetResultOfSplit(true);
10643 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10645 new_item.SetQuantity(split_quantity_new);
10646 }
10647 }
10648 else if (destination_entity && slot_id == -1)
10649 {
10650 if (quantity > stack_max)
10651 split_quantity_new = stack_max;
10652 else
10653 split_quantity_new = quantity;
10654
10656 {
10659 }
10660
10661 if (new_item)
10662 {
10663 new_item.SetResultOfSplit(true);
10664 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10666 new_item.SetQuantity(split_quantity_new);
10667 }
10668 }
10669 else
10670 {
10671 if (stack_max != 0)
10672 {
10674 {
10676 }
10677
10678 if (split_quantity_new == 0)
10679 {
10680 if (!
GetGame().IsMultiplayer())
10681 player.PhysicalPredictiveDropItem(this);
10682 else
10683 player.ServerDropEntity(this);
10684 return;
10685 }
10686
10688
10689 if (new_item)
10690 {
10691 new_item.SetResultOfSplit(true);
10692 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10694 new_item.SetQuantity(stack_max);
10695 new_item.PlaceOnSurface();
10696 }
10697 }
10698 }
10699 }
10700
10702 {
10704 return;
10705
10706 float split_quantity_new;
10710 InventoryLocation loc = new InventoryLocation;
10711
10712 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10713 {
10715 split_quantity_new = stack_max;
10716 else
10718
10719 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10720 if (new_item)
10721 {
10722 new_item.SetResultOfSplit(true);
10723 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10725 new_item.SetQuantity(split_quantity_new);
10726 }
10727 }
10728 else if (destination_entity && slot_id == -1)
10729 {
10730 if (quantity > stack_max)
10731 split_quantity_new = stack_max;
10732 else
10733 split_quantity_new = quantity;
10734
10736 {
10739 }
10740
10741 if (new_item)
10742 {
10743 new_item.SetResultOfSplit(true);
10744 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10746 new_item.SetQuantity(split_quantity_new);
10747 }
10748 }
10749 else
10750 {
10751 if (stack_max != 0)
10752 {
10754 {
10756 }
10757
10759
10760 if (new_item)
10761 {
10762 new_item.SetResultOfSplit(true);
10763 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10765 new_item.SetQuantity(stack_max);
10766 new_item.PlaceOnSurface();
10767 }
10768 }
10769 }
10770 }
10771
10773 {
10775 return;
10776
10778 {
10779 if (ScriptInputUserData.CanStoreInputUserData())
10780 {
10781 ScriptInputUserData ctx = new ScriptInputUserData;
10786 dst.WriteToContext(ctx);
10788 }
10789 }
10790 else if (!
GetGame().IsMultiplayer())
10791 {
10793 }
10794 }
10795
10797 {
10799 return;
10800
10802 {
10803 if (ScriptInputUserData.CanStoreInputUserData())
10804 {
10805 ScriptInputUserData ctx = new ScriptInputUserData;
10810 ctx.
Write(destination_entity);
10816 }
10817 }
10818 else if (!
GetGame().IsMultiplayer())
10819 {
10821 }
10822 }
10823
10825 {
10827 }
10828
10830 {
10832 return this;
10833
10835 float split_quantity_new;
10837 if (dst.IsValid())
10838 {
10839 int slot_id = dst.GetSlot();
10841
10842 if (quantity > stack_max)
10843 split_quantity_new = stack_max;
10844 else
10845 split_quantity_new = quantity;
10846
10848
10849 if (new_item)
10850 {
10851 new_item.SetResultOfSplit(true);
10852 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10855 }
10856
10857 return new_item;
10858 }
10859
10860 return null;
10861 }
10862
10864 {
10866 return;
10867
10869 float split_quantity_new;
10871 if (destination_entity)
10872 {
10874 if (quantity > stackable)
10875 split_quantity_new = stackable;
10876 else
10877 split_quantity_new = quantity;
10878
10879 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10880 if (new_item)
10881 {
10882 new_item.SetResultOfSplit(true);
10883 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10885 new_item.SetQuantity(split_quantity_new);
10886 }
10887 }
10888 }
10889
10891 {
10893 return;
10894
10896 {
10897 if (ScriptInputUserData.CanStoreInputUserData())
10898 {
10899 ScriptInputUserData ctx = new ScriptInputUserData;
10904 ItemBase destination_entity =
this;
10905 ctx.
Write(destination_entity);
10909 }
10910 }
10911 else if (!
GetGame().IsMultiplayer())
10912 {
10914 }
10915 }
10916
10918 {
10920 return;
10921
10923 float split_quantity_new;
10925 if (player)
10926 {
10928 if (quantity > stackable)
10929 split_quantity_new = stackable;
10930 else
10931 split_quantity_new = quantity;
10932
10933 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10934 new_item =
ItemBase.Cast(in_hands);
10935 if (new_item)
10936 {
10937 new_item.SetResultOfSplit(true);
10938 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10940 new_item.SetQuantity(split_quantity_new);
10941 }
10942 }
10943 }
10944
10946 {
10948 return;
10949
10951 float split_quantity_new = Math.Floor(quantity * 0.5);
10952
10954
10955 if (new_item)
10956 {
10957 if (new_item.GetQuantityMax() < split_quantity_new)
10958 {
10959 split_quantity_new = new_item.GetQuantityMax();
10960 }
10961
10962 new_item.SetResultOfSplit(true);
10963 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10964
10966 {
10969 }
10970 else
10971 {
10974 }
10975 }
10976 }
10977
10979 {
10981 return;
10982
10984 float split_quantity_new = Math.Floor(quantity / 2);
10985
10986 InventoryLocation invloc = new InventoryLocation;
10988
10990 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10991
10992 if (new_item)
10993 {
10994 if (new_item.GetQuantityMax() < split_quantity_new)
10995 {
10996 split_quantity_new = new_item.GetQuantityMax();
10997 }
10999 {
11002 }
11003 else
11004 {
11007 }
11008 }
11009 }
11010
11013 {
11014 SetWeightDirty();
11016
11017 if (parent)
11018 parent.OnAttachmentQuantityChangedEx(this, delta);
11019
11021 {
11023 {
11025 }
11027 {
11028 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11030 }
11031 }
11032
11033 }
11034
11037 {
11038
11039 }
11040
11043 {
11045 }
11046
11048 {
11049 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11050
11052 {
11053 if (newLevel == GameConstants.STATE_RUINED)
11054 {
11056 EntityAI parent = GetHierarchyParent();
11057 if (parent && parent.IsFireplace())
11058 {
11059 CargoBase cargo = GetInventory().GetCargo();
11060 if (cargo)
11061 {
11063 {
11065 }
11066 }
11067 }
11068 }
11069
11071 {
11072
11074 return;
11075 }
11076
11077 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11078 {
11080 }
11081 }
11082 }
11083
11084
11086 {
11087 super.OnRightClick();
11088
11090 {
11092 {
11093 if (ScriptInputUserData.CanStoreInputUserData())
11094 {
11095 vector m4[4];
11097
11098 EntityAI root = GetHierarchyRoot();
11099
11100 InventoryLocation dst = new InventoryLocation;
11102 {
11103 if (root)
11104 {
11105 root.GetTransform(m4);
11107 }
11108 else
11109 GetInventory().GetCurrentInventoryLocation(dst);
11110 }
11111 else
11112 {
11114
11115
11116 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11117 {
11118 if (root)
11119 {
11120 root.GetTransform(m4);
11122 }
11123 else
11124 GetInventory().GetCurrentInventoryLocation(dst);
11125 }
11126 else
11127 {
11128 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11129 }
11130 }
11131
11132 ScriptInputUserData ctx = new ScriptInputUserData;
11140 }
11141 }
11142 else if (!
GetGame().IsMultiplayer())
11143 {
11145 }
11146 }
11147 }
11148
11149 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11150 {
11151
11152 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11153 return false;
11154
11155 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11156 return false;
11157
11158
11160 return false;
11161
11162
11163 Magazine mag = Magazine.Cast(this);
11164 if (mag)
11165 {
11166 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11167 return false;
11168
11169 if (stack_max_limit)
11170 {
11171 Magazine other_mag = Magazine.Cast(other_item);
11172 if (other_item)
11173 {
11174 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11175 return false;
11176 }
11177
11178 }
11179 }
11180 else
11181 {
11182
11184 return false;
11185
11187 return false;
11188 }
11189
11190 PlayerBase player = null;
11191 if (CastTo(player, GetHierarchyRootPlayer()))
11192 {
11193 if (player.GetInventory().HasAttachment(this))
11194 return false;
11195
11196 if (player.IsItemsToDelete())
11197 return false;
11198 }
11199
11200 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11201 return false;
11202
11203 int slotID;
11205 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11206 return false;
11207
11208 return true;
11209 }
11210
11212 {
11214 }
11215
11217 {
11218 return m_IsResultOfSplit;
11219 }
11220
11222 {
11223 m_IsResultOfSplit = value;
11224 }
11225
11227 {
11229 }
11230
11232 {
11233 float other_item_quantity = other_item.GetQuantity();
11234 float this_free_space;
11235
11237
11239
11240 if (other_item_quantity > this_free_space)
11241 {
11242 return this_free_space;
11243 }
11244 else
11245 {
11246 return other_item_quantity;
11247 }
11248 }
11249
11251 {
11253 }
11254
11256 {
11258 return;
11259
11260 if (!IsMagazine() && other_item)
11261 {
11263 if (quantity_used != 0)
11264 {
11265 float hp1 = GetHealth01("","");
11266 float hp2 = other_item.GetHealth01("","");
11267 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11268 hpResult = hpResult / (
GetQuantity() + quantity_used);
11269
11270 hpResult *= GetMaxHealth();
11271 Math.Round(hpResult);
11272 SetHealth("", "Health", hpResult);
11273
11275 other_item.AddQuantity(-quantity_used);
11276 }
11277 }
11279 }
11280
11282 {
11283 #ifdef SERVER
11284 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11285 GetHierarchyParent().IncreaseLifetimeUp();
11286 #endif
11287 };
11288
11290 {
11291 PlayerBase p = PlayerBase.Cast(player);
11292
11293 array<int> recipesIds = p.m_Recipes;
11294 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11295 if (moduleRecipesManager)
11296 {
11297 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11298 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11299 }
11300
11301 for (int i = 0;i < recipesIds.Count(); i++)
11302 {
11303 int key = recipesIds.Get(i);
11304 string recipeName = moduleRecipesManager.GetRecipeName(key);
11306 }
11307 }
11308
11309
11310 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11311 {
11312 super.GetDebugActions(outputList);
11313
11314
11319
11320
11324
11328
11329
11332
11333
11335 {
11338 }
11339
11341
11344
11348 }
11349
11350
11351
11352
11354 {
11355 super.OnAction(action_id, player, ctx);
11356 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11357 {
11358 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11359 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11360 PlayerBase p = PlayerBase.Cast(player);
11361 if (
EActions.RECIPES_RANGE_START < 1000)
11362 {
11363 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11364 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11365 }
11366 }
11367 #ifndef SERVER
11368 else if (action_id ==
EActions.WATCH_PLAYER)
11369 {
11370 PluginDeveloper.SetDeveloperItemClientEx(player);
11371 }
11372 #endif
11374 {
11375 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11376 {
11377 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11378 OnDebugButtonPressServer(id + 1);
11379 }
11380
11381 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11382 {
11383 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11385 }
11386
11387 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11388 {
11389 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11391 }
11392
11393 else if (action_id ==
EActions.ADD_QUANTITY)
11394 {
11395 if (IsMagazine())
11396 {
11397 Magazine mag = Magazine.Cast(this);
11398 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11399 }
11400 else
11401 {
11403 }
11404
11405 if (m_EM)
11406 {
11407 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11408 }
11409
11410 }
11411
11412 else if (action_id ==
EActions.REMOVE_QUANTITY)
11413 {
11414 if (IsMagazine())
11415 {
11416 Magazine mag2 = Magazine.Cast(this);
11417 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11418 }
11419 else
11420 {
11422 }
11423 if (m_EM)
11424 {
11425 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11426 }
11427
11428 }
11429
11430 else if (action_id ==
EActions.SET_QUANTITY_0)
11431 {
11433
11434 if (m_EM)
11435 {
11436 m_EM.SetEnergy(0);
11437 }
11438 }
11439
11440 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11441 {
11443
11444 if (m_EM)
11445 {
11446 m_EM.SetEnergy(m_EM.GetEnergyMax());
11447 }
11448 }
11449
11450 else if (action_id ==
EActions.ADD_HEALTH)
11451 {
11452 AddHealth("","",GetMaxHealth("","Health")/5);
11453 }
11454 else if (action_id ==
EActions.REMOVE_HEALTH)
11455 {
11456 AddHealth("","",-GetMaxHealth("","Health")/5);
11457 }
11458 else if (action_id ==
EActions.DESTROY_HEALTH)
11459 {
11460 SetHealth01("","",0);
11461 }
11462 else if (action_id ==
EActions.WATCH_ITEM)
11463 {
11465 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11466 #ifdef DEVELOPER
11467 SetDebugDeveloper_item(this);
11468 #endif
11469 }
11470
11471 else if (action_id ==
EActions.ADD_TEMPERATURE)
11472 {
11473 AddTemperature(20);
11474
11475 }
11476
11477 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11478 {
11479 AddTemperature(-20);
11480
11481 }
11482
11483 else if (action_id ==
EActions.FLIP_FROZEN)
11484 {
11485 SetFrozen(!GetIsFrozen());
11486
11487 }
11488
11489 else if (action_id ==
EActions.ADD_WETNESS)
11490 {
11492
11493 }
11494
11495 else if (action_id ==
EActions.REMOVE_WETNESS)
11496 {
11498
11499 }
11500
11501 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11502 {
11505
11506
11507 }
11508
11509 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11510 {
11513 }
11514
11515 else if (action_id ==
EActions.MAKE_SPECIAL)
11516 {
11517 auto debugParams = DebugSpawnParams.WithPlayer(player);
11518 OnDebugSpawnEx(debugParams);
11519 }
11520
11521 else if (action_id ==
EActions.DELETE)
11522 {
11523 Delete();
11524 }
11525
11526 }
11527
11528
11529 return false;
11530 }
11531
11532
11533
11534
11538
11541
11542
11543
11545 {
11546 return false;
11547 }
11548
11549
11551 {
11552 return true;
11553 }
11554
11555
11557 {
11558 return true;
11559 }
11560
11561
11562
11564 {
11565 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11567 }
11568
11571 {
11572 return null;
11573 }
11574
11576 {
11577 return false;
11578 }
11579
11581 {
11582 return false;
11583 }
11584
11588
11589
11591 {
11592 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11593 return module_repairing.CanRepair(this, item_repair_kit);
11594 }
11595
11596
11597 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11598 {
11599 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11600 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11601 }
11602
11603
11605 {
11606
11607
11608
11609
11610
11611
11612
11613
11614 return 1;
11615 }
11616
11617
11618
11620 {
11622 }
11623
11624
11625
11627 {
11629 }
11630
11631
11640 {
11641 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11642
11643 if (player)
11644 {
11645 player.MessageStatus(text);
11646 }
11647 }
11648
11649
11658 {
11659 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11660
11661 if (player)
11662 {
11663 player.MessageAction(text);
11664 }
11665 }
11666
11667
11676 {
11677 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11678
11679 if (player)
11680 {
11681 player.MessageFriendly(text);
11682 }
11683 }
11684
11685
11694 {
11695 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11696
11697 if (player)
11698 {
11699 player.MessageImportant(text);
11700 }
11701 }
11702
11704 {
11705 return true;
11706 }
11707
11708
11709 override bool KindOf(
string tag)
11710 {
11711 bool found = false;
11712 string item_name = this.
GetType();
11715
11716 int array_size = item_tag_array.Count();
11717 for (int i = 0; i < array_size; i++)
11718 {
11719 if (item_tag_array.Get(i) == tag)
11720 {
11721 found = true;
11722 break;
11723 }
11724 }
11725 return found;
11726 }
11727
11728
11730 {
11731
11732 super.OnRPC(sender, rpc_type,ctx);
11733
11734
11735 switch (rpc_type)
11736 {
11737 #ifndef SERVER
11738 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11739 Param2<bool, string> p = new Param2<bool, string>(false, "");
11740
11742 return;
11743
11744 bool play = p.param1;
11745 string soundSet = p.param2;
11746
11747 if (play)
11748 {
11750 {
11752 {
11754 }
11755 }
11756 else
11757 {
11759 }
11760 }
11761 else
11762 {
11764 }
11765
11766 break;
11767 #endif
11768
11769 }
11770
11772 {
11774 }
11775 }
11776
11777
11778
11779
11781 {
11782 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11783 return plugin.GetID(
name);
11784 }
11785
11787 {
11788 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11789 return plugin.GetName(id);
11790 }
11791
11794 {
11795
11796
11797 int varFlags;
11798 if (!ctx.
Read(varFlags))
11799 return;
11800
11801 if (varFlags & ItemVariableFlags.FLOAT)
11802 {
11804 }
11805 }
11806
11808 {
11809
11810 super.SerializeNumericalVars(floats_out);
11811
11812
11813
11815 {
11817 }
11818
11820 {
11822 }
11823
11825 {
11827 }
11828
11830 {
11835 }
11836
11838 {
11840 }
11841 }
11842
11844 {
11845
11846 super.DeSerializeNumericalVars(floats);
11847
11848
11849 int index = 0;
11850 int mask = Math.Round(floats.Get(index));
11851
11852 index++;
11853
11855 {
11857 {
11859 }
11860 else
11861 {
11862 float quantity = floats.Get(index);
11863 SetQuantity(quantity,
true,
false,
false,
false);
11864 }
11865 index++;
11866 }
11867
11869 {
11870 float wet = floats.Get(index);
11872 index++;
11873 }
11874
11876 {
11877 int liquidtype = Math.Round(floats.Get(index));
11879 index++;
11880 }
11881
11883 {
11885 index++;
11887 index++;
11889 index++;
11891 index++;
11892 }
11893
11895 {
11896 int cleanness = Math.Round(floats.Get(index));
11898 index++;
11899 }
11900 }
11901
11903 {
11904 super.WriteVarsToCTX(ctx);
11905
11906
11908 {
11910 }
11911
11913 {
11915 }
11916
11918 {
11920 }
11921
11923 {
11924 int r,g,b,a;
11930 }
11931
11933 {
11935 }
11936 }
11937
11939 {
11940 if (!super.ReadVarsFromCTX(ctx,version))
11941 return false;
11942
11943 int intValue;
11944 float value;
11945
11946 if (version < 140)
11947 {
11948 if (!ctx.
Read(intValue))
11949 return false;
11950
11951 m_VariablesMask = intValue;
11952 }
11953
11955 {
11956 if (!ctx.
Read(value))
11957 return false;
11958
11960 {
11962 }
11963 else
11964 {
11966 }
11967 }
11968
11969 if (version < 140)
11970 {
11972 {
11973 if (!ctx.
Read(value))
11974 return false;
11975 SetTemperatureDirect(value);
11976 }
11977 }
11978
11980 {
11981 if (!ctx.
Read(value))
11982 return false;
11984 }
11985
11987 {
11988 if (!ctx.
Read(intValue))
11989 return false;
11991 }
11992
11994 {
11995 int r,g,b,a;
11997 return false;
11999 return false;
12001 return false;
12003 return false;
12004
12006 }
12007
12009 {
12010 if (!ctx.
Read(intValue))
12011 return false;
12013 }
12014
12015 if (version >= 138 && version < 140)
12016 {
12018 {
12019 if (!ctx.
Read(intValue))
12020 return false;
12021 SetFrozen(intValue);
12022 }
12023 }
12024
12025 return true;
12026 }
12027
12028
12030 {
12033 {
12035 }
12036
12037 if (!super.OnStoreLoad(ctx, version))
12038 {
12040 return false;
12041 }
12042
12043 if (version >= 114)
12044 {
12045 bool hasQuickBarIndexSaved;
12046
12047 if (!ctx.
Read(hasQuickBarIndexSaved))
12048 {
12050 return false;
12051 }
12052
12053 if (hasQuickBarIndexSaved)
12054 {
12055 int itmQBIndex;
12056
12057
12058 if (!ctx.
Read(itmQBIndex))
12059 {
12061 return false;
12062 }
12063
12064 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12065 if (itmQBIndex != -1 && parentPlayer)
12066 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12067 }
12068 }
12069 else
12070 {
12071
12072 PlayerBase player;
12073 int itemQBIndex;
12074 if (version ==
int.
MAX)
12075 {
12076 if (!ctx.
Read(itemQBIndex))
12077 {
12079 return false;
12080 }
12081 }
12082 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12083 {
12084
12085 if (!ctx.
Read(itemQBIndex))
12086 {
12088 return false;
12089 }
12090 if (itemQBIndex != -1 && player)
12091 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12092 }
12093 }
12094
12095 if (version < 140)
12096 {
12097
12098 if (!LoadVariables(ctx, version))
12099 {
12101 return false;
12102 }
12103 }
12104
12105
12107 {
12109 return false;
12110 }
12111 if (version >= 132)
12112 {
12114 if (raib)
12115 {
12117 {
12119 return false;
12120 }
12121 }
12122 }
12123
12125 return true;
12126 }
12127
12128
12129
12131 {
12132 super.OnStoreSave(ctx);
12133
12134 PlayerBase player;
12135 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12136 {
12138
12139 int itemQBIndex = -1;
12140 itemQBIndex = player.FindQuickBarEntityIndex(this);
12141 ctx.
Write(itemQBIndex);
12142 }
12143 else
12144 {
12146 }
12147
12149
12151 if (raib)
12152 {
12154 }
12155 }
12156
12157
12159 {
12160 super.AfterStoreLoad();
12161
12163 {
12165 }
12166
12168 {
12171 }
12172 }
12173
12175 {
12176 super.EEOnAfterLoad();
12177
12179 {
12181 }
12182
12185 }
12186
12188 {
12189 return false;
12190 }
12191
12192
12193
12195 {
12197 {
12198 #ifdef PLATFORM_CONSOLE
12199
12201 {
12203 if (menu)
12204 {
12206 }
12207 }
12208 #endif
12209 }
12210
12212 {
12215 }
12216
12218 {
12219 SetWeightDirty();
12221 }
12223 {
12226 }
12227
12229 {
12232 }
12234 {
12237 }
12238
12239 super.OnVariablesSynchronized();
12240 }
12241
12242
12243
12245 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12246 {
12247 if (!IsServerCheck(allow_client))
12248 return false;
12249
12251 return false;
12252
12255
12256 if (value <= (min + 0.001))
12257 value = min;
12258
12259 if (value == min)
12260 {
12261 if (destroy_config)
12262 {
12263 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12264 if (dstr)
12265 {
12267 this.Delete();
12268 return true;
12269 }
12270 }
12271 else if (destroy_forced)
12272 {
12274 this.Delete();
12275 return true;
12276 }
12277
12279 }
12280
12283
12285 {
12287
12288 if (delta)
12290 }
12291
12293
12294 return false;
12295 }
12296
12297
12299 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12300 {
12302 }
12303
12305 {
12308 }
12309
12311 {
12314 }
12315
12318 {
12319 float value_clamped = Math.Clamp(value, 0, 1);
12321 SetQuantity(result, destroy_config, destroy_forced);
12322 }
12323
12324
12327 {
12329 }
12330
12332 {
12334 }
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12346 {
12347 int slot = -1;
12348 if (GetInventory())
12349 {
12350 InventoryLocation il = new InventoryLocation;
12351 GetInventory().GetCurrentInventoryLocation(il);
12353 }
12354
12356 }
12357
12359 {
12360 float quantity_max = 0;
12361
12363 {
12364 if (attSlotID != -1)
12365 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12366
12367 if (quantity_max <= 0)
12369 }
12370
12371 if (quantity_max <= 0)
12373
12374 return quantity_max;
12375 }
12376
12378 {
12380 }
12381
12383 {
12385 }
12386
12387
12389 {
12391 }
12392
12394 {
12396 }
12397
12399 {
12401 }
12402
12403
12405 {
12406
12407 float weightEx = GetWeightEx();
12408 float special = GetInventoryAndCargoWeight();
12409 return weightEx - special;
12410 }
12411
12412
12414 {
12416 }
12417
12419 {
12421 {
12422 #ifdef DEVELOPER
12423 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12424 {
12425 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12427 }
12428 #endif
12429
12430 return GetQuantity() * GetConfigWeightModified();
12431 }
12432 else if (HasEnergyManager())
12433 {
12434 #ifdef DEVELOPER
12435 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12436 {
12437 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12438 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12439 }
12440 #endif
12441 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12442 }
12443 else
12444 {
12445 #ifdef DEVELOPER
12446 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12447 {
12448 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12449 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12450 }
12451 #endif
12452 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12453 }
12454 }
12455
12458 {
12459 int item_count = 0;
12461
12462 if (GetInventory().GetCargo() != NULL)
12463 {
12464 item_count = GetInventory().GetCargo().GetItemCount();
12465 }
12466
12467 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12468 {
12469 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12470 if (item)
12471 item_count += item.GetNumberOfItems();
12472 }
12473 return item_count;
12474 }
12475
12478 {
12479 float weight = 0;
12480 float wetness = 1;
12481 if (include_wetness)
12484 {
12485 weight = wetness * m_ConfigWeight;
12486 }
12488 {
12489 weight = 1;
12490 }
12491 return weight;
12492 }
12493
12494
12495
12497 {
12498 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12499 {
12500 GameInventory inv = GetInventory();
12501 array<EntityAI> items = new array<EntityAI>;
12503 for (int i = 0; i < items.Count(); i++)
12504 {
12506 if (item)
12507 {
12509 }
12510 }
12511 }
12512 }
12513
12514
12515
12516
12518 {
12519 float energy = 0;
12520 if (HasEnergyManager())
12521 {
12522 energy = GetCompEM().GetEnergy();
12523 }
12524 return energy;
12525 }
12526
12527
12529 {
12530 super.OnEnergyConsumed();
12531
12533 }
12534
12536 {
12537 super.OnEnergyAdded();
12538
12540 }
12541
12542
12544 {
12545 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12546 {
12548 {
12549 float energy_0to1 = GetCompEM().GetEnergy0To1();
12551 }
12552 }
12553 }
12554
12555
12557 {
12558 return ConfigGetFloat("heatIsolation");
12559 }
12560
12562 {
12564 }
12565
12567 {
12568 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12569 if (
GetGame().ConfigIsExisting(paramPath))
12571
12572 return 0.0;
12573 }
12574
12576 {
12577 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12578 if (
GetGame().ConfigIsExisting(paramPath))
12580
12581 return 0.0;
12582 }
12583
12584 override void SetWet(
float value,
bool allow_client =
false)
12585 {
12586 if (!IsServerCheck(allow_client))
12587 return;
12588
12591
12593
12594 m_VarWet = Math.Clamp(value, min, max);
12595
12597 {
12600 }
12601 }
12602
12603 override void AddWet(
float value)
12604 {
12606 }
12607
12609 {
12611 }
12612
12614 {
12616 }
12617
12619 {
12621 }
12622
12624 {
12626 }
12627
12629 {
12631 }
12632
12633 override void OnWetChanged(
float newVal,
float oldVal)
12634 {
12637 if (newLevel != oldLevel)
12638 {
12640 }
12641 }
12642
12644 {
12645 SetWeightDirty();
12646 }
12647
12649 {
12650 return GetWetLevelInternal(
m_VarWet);
12651 }
12652
12653
12654
12656 {
12658 }
12659
12661 {
12663 }
12664
12666 {
12668 }
12669
12671 {
12673 }
12674
12675
12676
12678 {
12679 if (ConfigIsExisting("itemModelLength"))
12680 {
12681 return ConfigGetFloat("itemModelLength");
12682 }
12683 return 0;
12684 }
12685
12687 {
12688 if (ConfigIsExisting("itemAttachOffset"))
12689 {
12690 return ConfigGetFloat("itemAttachOffset");
12691 }
12692 return 0;
12693 }
12694
12695 override void SetCleanness(
int value,
bool allow_client =
false)
12696 {
12697 if (!IsServerCheck(allow_client))
12698 return;
12699
12701
12703
12706 }
12707
12709 {
12711 }
12712
12714 {
12715 return true;
12716 }
12717
12718
12719
12720
12722 {
12724 }
12725
12727 {
12729 }
12730
12731
12732
12733
12734 override void SetColor(
int r,
int g,
int b,
int a)
12735 {
12741 }
12743 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12744 {
12749 }
12750
12752 {
12754 }
12755
12758 {
12759 int r,g,b,a;
12761 r = r/255;
12762 g = g/255;
12763 b = b/255;
12764 a = a/255;
12765 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12766 }
12767
12768
12769
12770 override void SetLiquidType(
int value,
bool allow_client =
false)
12771 {
12772 if (!IsServerCheck(allow_client))
12773 return;
12774
12779 }
12780
12782 {
12783 return ConfigGetInt("varLiquidTypeInit");
12784 }
12785
12787 {
12789 }
12790
12792 {
12794 SetFrozen(false);
12795 }
12796
12799 {
12800 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12801 }
12802
12803
12806 {
12807 PlayerBase nplayer;
12808 if (PlayerBase.CastTo(nplayer, player))
12809 {
12811
12812 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12813 }
12814 }
12815
12816
12819 {
12820 PlayerBase nplayer;
12821 if (PlayerBase.CastTo(nplayer,player))
12822 {
12823
12824 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12825
12826 }
12827
12828
12829 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12830
12831
12832 if (HasEnergyManager())
12833 {
12834 GetCompEM().UpdatePlugState();
12835 }
12836 }
12837
12838
12840 {
12841 super.OnPlacementStarted(player);
12842
12844 }
12845
12846 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12847 {
12849 {
12850 m_AdminLog.OnPlacementComplete(player,
this);
12851 }
12852
12853 super.OnPlacementComplete(player, position, orientation);
12854 }
12855
12856
12857
12858
12859
12861 {
12863 {
12864 return true;
12865 }
12866 else
12867 {
12868 return false;
12869 }
12870 }
12871
12872
12874 {
12876 {
12878 }
12879 }
12880
12881
12883 {
12885 }
12886
12888 {
12890 }
12891
12892 override void InsertAgent(
int agent,
float count = 1)
12893 {
12894 if (count < 1)
12895 return;
12896
12898 }
12899
12902 {
12904 }
12905
12906
12908 {
12910 }
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12954 {
12956 return false;
12957 return true;
12958 }
12959
12961 {
12962
12964 }
12965
12966
12969 {
12970 super.CheckForRoofLimited(timeTresholdMS);
12971
12973 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12974 {
12975 m_PreviousRoofTestTime = time;
12976 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12977 }
12978 }
12979
12980
12982 {
12984 {
12985 return 0;
12986 }
12987
12988 if (GetInventory().GetAttachmentSlotsCount() != 0)
12989 {
12990 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12991 if (filter)
12992 return filter.GetProtectionLevel(type, false, system);
12993 else
12994 return 0;
12995 }
12996
12997 string subclassPath, entryName;
12998
12999 switch (type)
13000 {
13002 entryName = "biological";
13003 break;
13005 entryName = "chemical";
13006 break;
13007 default:
13008 entryName = "biological";
13009 break;
13010 }
13011
13012 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13013
13015 }
13016
13017
13018
13021 {
13022 if (!IsMagazine())
13024
13026 }
13027
13028
13029
13030
13031
13036 {
13037 return true;
13038 }
13039
13041 {
13043 }
13044
13045
13046
13047
13048
13050 {
13051 if (parent)
13052 {
13053 if (parent.IsInherited(DayZInfected))
13054 return true;
13055
13056 if (!parent.IsRuined())
13057 return true;
13058 }
13059
13060 return true;
13061 }
13062
13064 {
13065 if (!super.CanPutAsAttachment(parent))
13066 {
13067 return false;
13068 }
13069
13070 if (!IsRuined() && !parent.IsRuined())
13071 {
13072 return true;
13073 }
13074
13075 return false;
13076 }
13077
13079 {
13080
13081
13082
13083
13084 return super.CanReceiveItemIntoCargo(item);
13085 }
13086
13088 {
13089
13090
13091
13092
13093 GameInventory attachmentInv = attachment.GetInventory();
13095 {
13096 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13097 return false;
13098 }
13099
13100 InventoryLocation loc = new InventoryLocation();
13101 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13102 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13103 return false;
13104
13105 return super.CanReceiveAttachment(attachment, slotId);
13106 }
13107
13109 {
13110 if (!super.CanReleaseAttachment(attachment))
13111 return false;
13112
13113 return GetInventory().AreChildrenAccessible();
13114 }
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13137 {
13138 int id = muzzle_owner.GetMuzzleID();
13139 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13140
13141 if (WPOF_array)
13142 {
13143 for (int i = 0; i < WPOF_array.Count(); i++)
13144 {
13145 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13146
13147 if (WPOF)
13148 {
13149 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13150 }
13151 }
13152 }
13153 }
13154
13155
13157 {
13158 int id = muzzle_owner.GetMuzzleID();
13160
13161 if (WPOBE_array)
13162 {
13163 for (int i = 0; i < WPOBE_array.Count(); i++)
13164 {
13165 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13166
13167 if (WPOBE)
13168 {
13169 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13170 }
13171 }
13172 }
13173 }
13174
13175
13177 {
13178 int id = muzzle_owner.GetMuzzleID();
13179 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13180
13181 if (WPOOH_array)
13182 {
13183 for (int i = 0; i < WPOOH_array.Count(); i++)
13184 {
13185 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13186
13187 if (WPOOH)
13188 {
13189 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13190 }
13191 }
13192 }
13193 }
13194
13195
13197 {
13198 int id = muzzle_owner.GetMuzzleID();
13199 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13200
13201 if (WPOOH_array)
13202 {
13203 for (int i = 0; i < WPOOH_array.Count(); i++)
13204 {
13205 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13206
13207 if (WPOOH)
13208 {
13209 WPOOH.OnUpdate(weapon, 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.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13230 }
13231 }
13232 }
13233 }
13234
13235
13236
13238 {
13240 {
13241 return true;
13242 }
13243
13244 return false;
13245 }
13246
13248 {
13250 {
13251 return true;
13252 }
13253
13254 return false;
13255 }
13256
13258 {
13260 {
13261 return true;
13262 }
13263
13264 return false;
13265 }
13266
13268 {
13269 return false;
13270 }
13271
13274 {
13275 return UATimeSpent.DEFAULT_DEPLOY;
13276 }
13277
13278
13279
13280
13282 {
13284 SetSynchDirty();
13285 }
13286
13288 {
13290 }
13291
13292
13294 {
13295 return false;
13296 }
13297
13300 {
13301 string att_type = "None";
13302
13303 if (ConfigIsExisting("soundAttType"))
13304 {
13305 att_type = ConfigGetString("soundAttType");
13306 }
13307
13309 }
13310
13312 {
13314 }
13315
13316
13317
13318
13319
13323
13325 {
13328
13330 }
13331
13332
13334 {
13336 return;
13337
13339
13342
13345
13346 SoundParameters params = new SoundParameters();
13350 }
13351
13352
13354 {
13356 return;
13357
13359 SetSynchDirty();
13360
13363 }
13364
13365
13367 {
13369 return;
13370
13372 SetSynchDirty();
13373
13376 }
13377
13379 {
13381 }
13382
13384 {
13386 }
13387
13390 {
13391 if (!
GetGame().IsDedicatedServer())
13392 {
13393 if (ConfigIsExisting("attachSoundSet"))
13394 {
13395 string cfg_path = "";
13396 string soundset = "";
13397 string type_name =
GetType();
13398
13401 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13402 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13403
13404 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13405 {
13406 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13407 {
13408 if (cfg_slot_array[i] == slot_type)
13409 {
13410 soundset = cfg_soundset_array[i];
13411 break;
13412 }
13413 }
13414 }
13415
13416 if (soundset != "")
13417 {
13418 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13420 }
13421 }
13422 }
13423 }
13424
13426 {
13427
13428 }
13429
13430 void OnApply(PlayerBase player);
13431
13433 {
13434 return 1.0;
13435 };
13436
13438 {
13440 }
13441
13443 {
13445 }
13446
13448
13450 {
13451 SetDynamicPhysicsLifeTime(0.01);
13453 }
13454
13456 {
13457 array<string> zone_names = new array<string>;
13458 GetDamageZones(zone_names);
13459 for (int i = 0; i < zone_names.Count(); i++)
13460 {
13461 SetHealthMax(zone_names.Get(i),"Health");
13462 }
13463 SetHealthMax("","Health");
13464 }
13465
13468 {
13469 float global_health = GetHealth01("","Health");
13470 array<string> zones = new array<string>;
13471 GetDamageZones(zones);
13472
13473 for (int i = 0; i < zones.Count(); i++)
13474 {
13475 SetHealth01(zones.Get(i),"Health",global_health);
13476 }
13477 }
13478
13481 {
13482 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13483 }
13484
13486 {
13487 if (!hasRootAsPlayer)
13488 {
13489 if (refParentIB)
13490 {
13491
13492 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13493 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13494
13495 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13496 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13497
13500 }
13501 else
13502 {
13503
13506 }
13507 }
13508 }
13509
13511 {
13513 {
13514 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13515 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13516 {
13517 float heatPermCoef = 1.0;
13519 while (ent)
13520 {
13521 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13522 ent = ent.GetHierarchyParent();
13523 }
13524
13525 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13526 }
13527 }
13528 }
13529
13531 {
13532
13533 EntityAI parent = GetHierarchyParent();
13534 if (!parent)
13535 {
13536 hasParent = false;
13537 hasRootAsPlayer = false;
13538 }
13539 else
13540 {
13541 hasParent = true;
13542 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13543 refParentIB =
ItemBase.Cast(parent);
13544 }
13545 }
13546
13547 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13548 {
13549
13550 }
13551
13553 {
13554
13555 return false;
13556 }
13557
13559 {
13560
13561
13562 return false;
13563 }
13564
13566 {
13567
13568 return false;
13569 }
13570
13573 {
13574 return !GetIsFrozen() &&
IsOpen();
13575 }
13576
13578 {
13579 bool hasParent = false, hasRootAsPlayer = false;
13581
13582 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13583 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13584
13585 if (wwtu || foodDecay)
13586 {
13590
13591 if (processWetness || processTemperature || processDecay)
13592 {
13594
13595 if (processWetness)
13596 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13597
13598 if (processTemperature)
13600
13601 if (processDecay)
13602 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13603 }
13604 }
13605 }
13606
13609 {
13611 }
13612
13614 {
13617
13618 return super.GetTemperatureFreezeThreshold();
13619 }
13620
13622 {
13625
13626 return super.GetTemperatureThawThreshold();
13627 }
13628
13630 {
13633
13634 return super.GetItemOverheatThreshold();
13635 }
13636
13638 {
13640 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13641
13642 return super.GetTemperatureFreezeTime();
13643 }
13644
13646 {
13648 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13649
13650 return super.GetTemperatureThawTime();
13651 }
13652
13657
13659 {
13660 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13661 }
13662
13664 {
13665 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13666 }
13667
13670 {
13672 }
13673
13675 {
13677 }
13678
13680 {
13682 }
13683
13686 {
13687 return null;
13688 }
13689
13692 {
13693 return false;
13694 }
13695
13697 {
13699 {
13702 if (!trg)
13703 {
13705 explosive = this;
13706 }
13707
13708 explosive.PairRemote(trg);
13710
13711 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13712 trg.SetPersistentPairID(persistentID);
13713 explosive.SetPersistentPairID(persistentID);
13714
13715 return true;
13716 }
13717 return false;
13718 }
13719
13722 {
13723 float ret = 1.0;
13726 ret *= GetHealth01();
13727
13728 return ret;
13729 }
13730
13731 #ifdef DEVELOPER
13732 override void SetDebugItem()
13733 {
13734 super.SetDebugItem();
13735 _itemBase = this;
13736 }
13737
13739 {
13740 string text = super.GetDebugText();
13741
13743 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13744
13745 return text;
13746 }
13747 #endif
13748
13750 {
13751 return true;
13752 }
13753
13755
13757
13759 {
13762 }
13763
13764
13772
13788}
13789
13791{
13793 if (entity)
13794 {
13795 bool is_item = entity.IsInherited(
ItemBase);
13796 if (is_item && full_quantity)
13797 {
13800 }
13801 }
13802 else
13803 {
13805 return NULL;
13806 }
13807 return entity;
13808}
13809
13811{
13812 if (item)
13813 {
13814 if (health > 0)
13815 item.SetHealth("", "", health);
13816
13817 if (item.CanHaveTemperature())
13818 {
13820 if (item.CanFreeze())
13821 item.SetFrozen(false);
13822 }
13823
13824 if (item.HasEnergyManager())
13825 {
13826 if (quantity >= 0)
13827 {
13828 item.GetCompEM().SetEnergy0To1(quantity);
13829 }
13830 else
13831 {
13833 }
13834 }
13835 else if (item.IsMagazine())
13836 {
13837 Magazine mag = Magazine.Cast(item);
13838 if (quantity >= 0)
13839 {
13840 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13841 }
13842 else
13843 {
13845 }
13846
13847 }
13848 else
13849 {
13850 if (quantity >= 0)
13851 {
13852 item.SetQuantityNormalized(quantity, false);
13853 }
13854 else
13855 {
13857 }
13858
13859 }
13860 }
13861}
13862
13863#ifdef DEVELOPER
13865#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.