8961{
8963 {
8964 return true;
8965 }
8966};
8967
8968
8969
8971{
8975
8977
8980
8981
8982
8983
8984
8993
8999
9004
9009
9030 protected bool m_IsResultOfSplit
9031
9033
9038
9039
9040
9042
9046
9047
9048
9050
9053
9054
9055
9061
9062
9070
9073
9074
9076
9077
9079
9080
9085
9086
9091
9092
9094
9095
9097 {
9102
9103 if (!
GetGame().IsDedicatedServer())
9104 {
9106 {
9108
9110 {
9112 }
9113 }
9114
9117 }
9118
9119 m_OldLocation = null;
9120
9122 {
9124 }
9125
9126 if (ConfigIsExisting("headSelectionsToHide"))
9127 {
9130 }
9131
9133 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9134 {
9136 }
9137
9139
9140 m_IsResultOfSplit = false;
9141
9143 }
9144
9146 {
9147 super.InitItemVariables();
9148
9154 m_Count = ConfigGetInt(
"count");
9155
9158
9163
9166
9171
9183
9187
9188
9191 if (ConfigIsExisting("canBeSplit"))
9192 {
9195 }
9196
9198 if (ConfigIsExisting("itemBehaviour"))
9200
9201
9204 RegisterNetSyncVariableInt("m_VarLiquidType");
9205 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9206
9207 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9208 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9209 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9210
9211 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9212 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9213 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9214 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9215
9216 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9217 RegisterNetSyncVariableBool("m_IsTakeable");
9218 RegisterNetSyncVariableBool("m_IsHologram");
9219
9222 {
9225 }
9226
9228
9230 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9232
9233 }
9234
9236 {
9238 }
9239
9241 {
9244 {
9249 }
9250 }
9251
9252 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9253 {
9255 {
9258 }
9259
9261 }
9262
9264 {
9270 }
9271
9273
9275 {
9277
9278 if (!action)
9279 {
9280 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9281 return;
9282 }
9283
9285 if (!ai)
9286 {
9288 return;
9289 }
9290
9292 if (!action_array)
9293 {
9294 action_array = new array<ActionBase_Basic>;
9296 }
9297 if (LogManager.IsActionLogEnable())
9298 {
9299 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9300 }
9301
9302 if (action_array.Find(action) != -1)
9303 {
9304 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9305 }
9306 else
9307 {
9308 action_array.Insert(action);
9309 }
9310 }
9311
9313 {
9315 ActionBase action = player.GetActionManager().GetAction(actionName);
9318
9319 if (action_array)
9320 {
9321 action_array.RemoveItem(action);
9322 }
9323 }
9324
9325
9326
9328 {
9329 ActionOverrideData overrideData = new ActionOverrideData();
9333
9335 if (!actionMap)
9336 {
9339 }
9340
9341 actionMap.Insert(this.
Type(), overrideData);
9342
9343 }
9344
9346
9348
9349
9351 {
9354
9357
9358 string config_to_search = "CfgVehicles";
9359 string muzzle_owner_config;
9360
9362 {
9363 if (IsInherited(Weapon))
9364 config_to_search = "CfgWeapons";
9365
9366 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9367
9368 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9369
9371
9372 if (config_OnFire_subclass_count > 0)
9373 {
9374 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9375
9376 for (int i = 0; i < config_OnFire_subclass_count; i++)
9377 {
9378 string particle_class = "";
9380 string config_OnFire_entry = config_OnFire_class + particle_class;
9381 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9382 WPOF_array.Insert(WPOF);
9383 }
9384
9385
9387 }
9388 }
9389
9391 {
9392 config_to_search = "CfgWeapons";
9393 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9394
9395 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9396
9398
9399 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9400 {
9401 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9402
9403 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9404 {
9405 string particle_class2 = "";
9407 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9408 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9409 WPOBE_array.Insert(WPOBE);
9410 }
9411
9412
9414 }
9415 }
9416 }
9417
9418
9420 {
9423
9425 {
9426 string config_to_search = "CfgVehicles";
9427
9428 if (IsInherited(Weapon))
9429 config_to_search = "CfgWeapons";
9430
9431 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9432 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9433
9434 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9435 {
9436
9438
9440 {
9442 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9444 return;
9445 }
9446
9449
9450
9451
9453 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9454
9455 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9456 {
9457 string particle_class = "";
9459 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9461
9462 if (entry_type == CT_CLASS)
9463 {
9464 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9465 WPOOH_array.Insert(WPOF);
9466 }
9467 }
9468
9469
9471 }
9472 }
9473 }
9474
9476 {
9478 }
9479
9481 {
9483 {
9485
9488
9491
9492 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9493 }
9494 }
9495
9497 {
9499 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9500
9502 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9503
9505 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9506
9508 {
9510 }
9511 }
9512
9514 {
9516 }
9517
9519 {
9522 else
9524
9526 {
9529 }
9530 else
9531 {
9534
9537 }
9538
9540 }
9541
9543 {
9545 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9546 }
9547
9549 {
9551 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9553 }
9554
9556 {
9558 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9559 }
9560
9562 {
9565
9566 OverheatingParticle OP = new OverheatingParticle();
9571
9573 }
9574
9576 {
9579
9580 return -1;
9581 }
9582
9584 {
9586 {
9589
9590 for (int i = count; i > 0; --i)
9591 {
9592 int id = i - 1;
9595
9598
9599 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9600 {
9601 if (p)
9602 {
9605 }
9606 }
9607 }
9608 }
9609 }
9610
9612 {
9614 {
9616 {
9617 int id = i - 1;
9619
9620 if (OP)
9621 {
9623
9624 if (p)
9625 {
9627 }
9628
9629 delete OP;
9630 }
9631 }
9632
9635 }
9636 }
9637
9640 {
9641 return 0.0;
9642 }
9643
9644
9646 {
9647 return 250;
9648 }
9649
9651 {
9652 return 0;
9653 }
9654
9657 {
9659 return true;
9660
9661 return false;
9662 }
9663
9666 {
9669
9671 {
9673 }
9674 else
9675 {
9676
9678 }
9679
9681 }
9682
9689 {
9690 return -1;
9691 }
9692
9693
9694
9695
9697 {
9699 {
9701 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9702
9703 if (r_index >= 0)
9704 {
9705 InventoryLocation r_il = new InventoryLocation;
9706 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9707
9708 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9711 {
9712 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9713 }
9715 {
9716 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9717 }
9718
9719 }
9720
9721 player.GetHumanInventory().ClearUserReservedLocation(this);
9722 }
9723
9726 }
9727
9728
9729
9730
9732 {
9733 return ItemBase.m_DebugActionsMask;
9734 }
9735
9737 {
9738 return ItemBase.m_DebugActionsMask & mask;
9739 }
9740
9742 {
9743 ItemBase.m_DebugActionsMask = mask;
9744 }
9745
9747 {
9748 ItemBase.m_DebugActionsMask |= mask;
9749 }
9750
9752 {
9753 ItemBase.m_DebugActionsMask &= ~mask;
9754 }
9755
9757 {
9759 {
9761 }
9762 else
9763 {
9765 }
9766 }
9767
9768
9770 {
9771 if (GetEconomyProfile())
9772 {
9773 float q_max = GetEconomyProfile().GetQuantityMax();
9774 if (q_max > 0)
9775 {
9776 float q_min = GetEconomyProfile().GetQuantityMin();
9777 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9778
9780 {
9781 ComponentEnergyManager comp = GetCompEM();
9783 {
9785 }
9786 }
9788 {
9790
9791 }
9792
9793 }
9794 }
9795 }
9796
9799 {
9800 EntityAI parent = GetHierarchyParent();
9801
9802 if (parent)
9803 {
9804 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9805 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9806 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9807 }
9808 }
9809
9812 {
9813 EntityAI parent = GetHierarchyParent();
9814
9815 if (parent)
9816 {
9817 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9818 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9819 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9820 }
9821 }
9822
9824 {
9825
9826
9827
9828
9830
9832 {
9833 if (ScriptInputUserData.CanStoreInputUserData())
9834 {
9835 ScriptInputUserData ctx = new ScriptInputUserData;
9841 ctx.
Write(use_stack_max);
9844
9846 {
9847 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9848 }
9849 }
9850 }
9851 else if (!
GetGame().IsMultiplayer())
9852 {
9854 }
9855 }
9856
9858 {
9860 }
9861
9863 {
9865 }
9866
9868 {
9870 }
9871
9873 {
9874
9875 return false;
9876 }
9877
9879 {
9880 return false;
9881 }
9882
9886 {
9887 return false;
9888 }
9889
9891 {
9892 return "";
9893 }
9894
9896
9898 {
9899 return false;
9900 }
9901
9903 {
9904 return true;
9905 }
9906
9907
9908
9910 {
9911 return true;
9912 }
9913
9915 {
9916 return true;
9917 }
9918
9920 {
9921 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9923 }
9924
9926 {
9928 }
9929
9931 {
9933 if (!is_being_placed)
9935 SetSynchDirty();
9936 }
9937
9938
9940
9942 {
9944 }
9945
9947 {
9949 }
9950
9952 {
9953 return 1;
9954 }
9955
9957 {
9958 return false;
9959 }
9960
9962 {
9964 SetSynchDirty();
9965 }
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10002 {
10003 super.OnMovedInsideCargo(container);
10004
10005 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10006 }
10007
10008 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10009 {
10010 super.EEItemLocationChanged(oldLoc,newLoc);
10011
10012 PlayerBase new_player = null;
10013 PlayerBase old_player = null;
10014
10015 if (newLoc.GetParent())
10016 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10017
10018 if (oldLoc.GetParent())
10019 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10020
10022 {
10023 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10024
10025 if (r_index >= 0)
10026 {
10027 InventoryLocation r_il = new InventoryLocation;
10028 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10029
10030 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10033 {
10034 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10035 }
10037 {
10038 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10039 }
10040
10041 }
10042 }
10043
10045 {
10046 if (new_player)
10047 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10048
10049 if (new_player == old_player)
10050 {
10051
10052 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10053 {
10055 {
10056 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10057 {
10058 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10059 }
10060 }
10061 else
10062 {
10063 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10064 }
10065 }
10066
10067 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10068 {
10069 int type = oldLoc.GetType();
10071 {
10072 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10073 }
10075 {
10076 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10077 }
10078 }
10079 if (!m_OldLocation)
10080 {
10081 m_OldLocation = new InventoryLocation;
10082 }
10083 m_OldLocation.Copy(oldLoc);
10084 }
10085 else
10086 {
10087 if (m_OldLocation)
10088 {
10089 m_OldLocation.Reset();
10090 }
10091 }
10092
10094 }
10095 else
10096 {
10097 if (new_player)
10098 {
10099 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10100 if (res_index >= 0)
10101 {
10102 InventoryLocation il = new InventoryLocation;
10103 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10105 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10108 {
10109 il.
GetParent().GetOnReleaseLock().Invoke(it);
10110 }
10112 {
10114 }
10115
10116 }
10117 }
10119 {
10120
10122 }
10123
10124 if (m_OldLocation)
10125 {
10126 m_OldLocation.Reset();
10127 }
10128 }
10129 }
10130
10131 override void EOnContact(IEntity other, Contact extra)
10132 {
10134 {
10135 int liquidType = -1;
10137 if (impactSpeed > 0.0)
10138 {
10140 #ifndef SERVER
10142 #else
10144 SetSynchDirty();
10145 #endif
10147 }
10148 }
10149
10150 #ifdef SERVER
10151 if (GetCompEM() && GetCompEM().IsPlugged())
10152 {
10153 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10154 GetCompEM().UnplugThis();
10155 }
10156 #endif
10157 }
10158
10160
10162 {
10164 }
10165
10167 {
10168
10169 }
10170
10172 {
10173 super.OnItemLocationChanged(old_owner, new_owner);
10174
10175 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10176 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10177
10178 if (!relatedPlayer && playerNew)
10179 relatedPlayer = playerNew;
10180
10181 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10182 {
10184 if (actionMgr)
10185 {
10186 ActionBase currentAction = actionMgr.GetRunningAction();
10187 if (currentAction)
10189 }
10190 }
10191
10192 Man ownerPlayerOld = null;
10193 Man ownerPlayerNew = null;
10194
10195 if (old_owner)
10196 {
10197 if (old_owner.
IsMan())
10198 {
10199 ownerPlayerOld = Man.Cast(old_owner);
10200 }
10201 else
10202 {
10203 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10204 }
10205 }
10206 else
10207 {
10209 {
10211
10212 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10213 {
10214 GetCompEM().UnplugThis();
10215 }
10216 }
10217 }
10218
10219 if (new_owner)
10220 {
10221 if (new_owner.
IsMan())
10222 {
10223 ownerPlayerNew = Man.Cast(new_owner);
10224 }
10225 else
10226 {
10227 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10228 }
10229 }
10230
10231 if (ownerPlayerOld != ownerPlayerNew)
10232 {
10233 if (ownerPlayerOld)
10234 {
10235 array<EntityAI> subItemsExit = new array<EntityAI>;
10237 for (int i = 0; i < subItemsExit.Count(); i++)
10238 {
10241 }
10242 }
10243
10244 if (ownerPlayerNew)
10245 {
10246 array<EntityAI> subItemsEnter = new array<EntityAI>;
10248 for (int j = 0; j < subItemsEnter.Count(); j++)
10249 {
10252 }
10253 }
10254 }
10255 else if (ownerPlayerNew != null)
10256 {
10257 PlayerBase nplayer;
10258 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10259 {
10260 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10262 for (int k = 0; k < subItemsUpdate.Count(); k++)
10263 {
10265 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10266 }
10267 }
10268 }
10269
10270 if (old_owner)
10271 old_owner.OnChildItemRemoved(this);
10272 if (new_owner)
10273 new_owner.OnChildItemReceived(this);
10274 }
10275
10276
10278 {
10279 super.EEDelete(parent);
10280 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10281 if (player)
10282 {
10284
10285 if (player.IsAlive())
10286 {
10287 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10288 if (r_index >= 0)
10289 {
10290 InventoryLocation r_il = new InventoryLocation;
10291 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10292
10293 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10296 {
10297 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10298 }
10300 {
10301 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10302 }
10303
10304 }
10305
10306 player.RemoveQuickBarEntityShortcut(this);
10307 }
10308 }
10309 }
10310
10312 {
10313 super.EEKilled(killer);
10314
10317 {
10318 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10319 {
10320 if (IsMagazine())
10321 {
10322 if (Magazine.Cast(this).GetAmmoCount() > 0)
10323 {
10325 }
10326 }
10327 else
10328 {
10330 }
10331 }
10332 }
10333 }
10334
10336 {
10337 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10338
10339 super.OnWasAttached(parent, slot_id);
10340
10343
10345 }
10346
10348 {
10349 super.OnWasDetached(parent, slot_id);
10350
10353 }
10354
10356 {
10357 int idx;
10360
10361 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10362 if (inventory_slots.Count() < 1)
10363 {
10364 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10365 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10366 }
10367 else
10368 {
10369 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10370 }
10371
10372 idx = inventory_slots.Find(slot);
10373 if (idx < 0)
10374 return "";
10375
10376 return attach_types.Get(idx);
10377 }
10378
10380 {
10381 int idx = -1;
10382 string slot;
10383
10386
10387 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10388 if (inventory_slots.Count() < 1)
10389 {
10390 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10391 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10392 }
10393 else
10394 {
10395 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10396 if (detach_types.Count() < 1)
10397 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10398 }
10399
10400 for (int i = 0; i < inventory_slots.Count(); i++)
10401 {
10402 slot = inventory_slots.Get(i);
10403 }
10404
10405 if (slot != "")
10406 {
10407 if (detach_types.Count() == 1)
10408 idx = 0;
10409 else
10410 idx = inventory_slots.Find(slot);
10411 }
10412 if (idx < 0)
10413 return "";
10414
10415 return detach_types.Get(idx);
10416 }
10417
10419 {
10420
10422
10423
10424 float min_time = 1;
10425 float max_time = 3;
10426 float delay = Math.RandomFloat(min_time, max_time);
10427
10428 explode_timer.Run(delay, this, "DoAmmoExplosion");
10429 }
10430
10432 {
10433 Magazine magazine = Magazine.Cast(this);
10434 int pop_sounds_count = 6;
10435 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10436
10437
10438 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10439 string sound_name = pop_sounds[ sound_idx ];
10441
10442
10443 magazine.ServerAddAmmoCount(-1);
10444
10445
10446 float min_temp_to_explode = 100;
10447
10448 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10449 {
10451 }
10452 }
10453
10454
10455 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10456 {
10457 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10458
10459 const int CHANCE_DAMAGE_CARGO = 4;
10460 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10461 const int CHANCE_DAMAGE_NOTHING = 2;
10462
10464 {
10465 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10466 int chances;
10467 int rnd;
10468
10469 if (GetInventory().GetCargo())
10470 {
10471 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10472 rnd = Math.RandomInt(0,chances);
10473
10474 if (rnd < CHANCE_DAMAGE_CARGO)
10475 {
10477 }
10478 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10479 {
10481 }
10482 }
10483 else
10484 {
10485 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10486 rnd = Math.RandomInt(0,chances);
10487
10488 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10489 {
10491 }
10492 }
10493 }
10494 }
10495
10497 {
10498 if (GetInventory().GetCargo())
10499 {
10500 int item_count = GetInventory().GetCargo().GetItemCount();
10501 if (item_count > 0)
10502 {
10503 int random_pick = Math.RandomInt(0, item_count);
10505 if (!item.IsExplosive())
10506 {
10507 item.AddHealth("","",damage);
10508 return true;
10509 }
10510 }
10511 }
10512 return false;
10513 }
10514
10516 {
10517 int attachment_count = GetInventory().AttachmentCount();
10518 if (attachment_count > 0)
10519 {
10520 int random_pick = Math.RandomInt(0, attachment_count);
10521 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10522 if (!attachment.IsExplosive())
10523 {
10524 attachment.AddHealth("","",damage);
10525 return true;
10526 }
10527 }
10528 return false;
10529 }
10530
10532 {
10534 }
10535
10537 {
10539 return GetInventory().CanRemoveEntity();
10540
10541 return false;
10542 }
10543
10545 {
10547 return;
10548
10550 {
10551 if (ScriptInputUserData.CanStoreInputUserData())
10552 {
10553 ScriptInputUserData ctx = new ScriptInputUserData;
10558 ctx.
Write(destination_entity);
10560 ctx.
Write(slot_id);
10562 }
10563 }
10564 else if (!
GetGame().IsMultiplayer())
10565 {
10567 }
10568 }
10569
10571 {
10573 return;
10574
10575 float split_quantity_new;
10579 InventoryLocation loc = new InventoryLocation;
10580
10581 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10582 {
10584 split_quantity_new = stack_max;
10585 else
10587
10588 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10589 if (new_item)
10590 {
10591 new_item.SetResultOfSplit(true);
10592 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10594 new_item.SetQuantity(split_quantity_new);
10595 }
10596 }
10597 else if (destination_entity && slot_id == -1)
10598 {
10599 if (quantity > stack_max)
10600 split_quantity_new = stack_max;
10601 else
10602 split_quantity_new = quantity;
10603
10605 {
10608 }
10609
10610 if (new_item)
10611 {
10612 new_item.SetResultOfSplit(true);
10613 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10615 new_item.SetQuantity(split_quantity_new);
10616 }
10617 }
10618 else
10619 {
10620 if (stack_max != 0)
10621 {
10623 {
10625 }
10626
10627 if (split_quantity_new == 0)
10628 {
10629 if (!
GetGame().IsMultiplayer())
10630 player.PhysicalPredictiveDropItem(this);
10631 else
10632 player.ServerDropEntity(this);
10633 return;
10634 }
10635
10637
10638 if (new_item)
10639 {
10640 new_item.SetResultOfSplit(true);
10641 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10643 new_item.SetQuantity(stack_max);
10644 new_item.PlaceOnSurface();
10645 }
10646 }
10647 }
10648 }
10649
10651 {
10653 return;
10654
10655 float split_quantity_new;
10659 InventoryLocation loc = new InventoryLocation;
10660
10661 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10662 {
10664 split_quantity_new = stack_max;
10665 else
10667
10668 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10669 if (new_item)
10670 {
10671 new_item.SetResultOfSplit(true);
10672 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10674 new_item.SetQuantity(split_quantity_new);
10675 }
10676 }
10677 else if (destination_entity && slot_id == -1)
10678 {
10679 if (quantity > stack_max)
10680 split_quantity_new = stack_max;
10681 else
10682 split_quantity_new = quantity;
10683
10685 {
10688 }
10689
10690 if (new_item)
10691 {
10692 new_item.SetResultOfSplit(true);
10693 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10695 new_item.SetQuantity(split_quantity_new);
10696 }
10697 }
10698 else
10699 {
10700 if (stack_max != 0)
10701 {
10703 {
10705 }
10706
10708
10709 if (new_item)
10710 {
10711 new_item.SetResultOfSplit(true);
10712 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10714 new_item.SetQuantity(stack_max);
10715 new_item.PlaceOnSurface();
10716 }
10717 }
10718 }
10719 }
10720
10722 {
10724 return;
10725
10727 {
10728 if (ScriptInputUserData.CanStoreInputUserData())
10729 {
10730 ScriptInputUserData ctx = new ScriptInputUserData;
10735 dst.WriteToContext(ctx);
10737 }
10738 }
10739 else if (!
GetGame().IsMultiplayer())
10740 {
10742 }
10743 }
10744
10746 {
10748 return;
10749
10751 {
10752 if (ScriptInputUserData.CanStoreInputUserData())
10753 {
10754 ScriptInputUserData ctx = new ScriptInputUserData;
10759 ctx.
Write(destination_entity);
10765 }
10766 }
10767 else if (!
GetGame().IsMultiplayer())
10768 {
10770 }
10771 }
10772
10774 {
10776 }
10777
10779 {
10781 return this;
10782
10784 float split_quantity_new;
10786 if (dst.IsValid())
10787 {
10788 int slot_id = dst.GetSlot();
10790
10791 if (quantity > stack_max)
10792 split_quantity_new = stack_max;
10793 else
10794 split_quantity_new = quantity;
10795
10797
10798 if (new_item)
10799 {
10800 new_item.SetResultOfSplit(true);
10801 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10804 }
10805
10806 return new_item;
10807 }
10808
10809 return null;
10810 }
10811
10813 {
10815 return;
10816
10818 float split_quantity_new;
10820 if (destination_entity)
10821 {
10823 if (quantity > stackable)
10824 split_quantity_new = stackable;
10825 else
10826 split_quantity_new = quantity;
10827
10828 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10829 if (new_item)
10830 {
10831 new_item.SetResultOfSplit(true);
10832 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10834 new_item.SetQuantity(split_quantity_new);
10835 }
10836 }
10837 }
10838
10840 {
10842 return;
10843
10845 {
10846 if (ScriptInputUserData.CanStoreInputUserData())
10847 {
10848 ScriptInputUserData ctx = new ScriptInputUserData;
10853 ItemBase destination_entity =
this;
10854 ctx.
Write(destination_entity);
10858 }
10859 }
10860 else if (!
GetGame().IsMultiplayer())
10861 {
10863 }
10864 }
10865
10867 {
10869 return;
10870
10872 float split_quantity_new;
10874 if (player)
10875 {
10877 if (quantity > stackable)
10878 split_quantity_new = stackable;
10879 else
10880 split_quantity_new = quantity;
10881
10882 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10883 new_item =
ItemBase.Cast(in_hands);
10884 if (new_item)
10885 {
10886 new_item.SetResultOfSplit(true);
10887 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10889 new_item.SetQuantity(split_quantity_new);
10890 }
10891 }
10892 }
10893
10895 {
10897 return;
10898
10900 float split_quantity_new = Math.Floor(quantity * 0.5);
10901
10903
10904 if (new_item)
10905 {
10906 if (new_item.GetQuantityMax() < split_quantity_new)
10907 {
10908 split_quantity_new = new_item.GetQuantityMax();
10909 }
10910
10911 new_item.SetResultOfSplit(true);
10912 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10913
10915 {
10918 }
10919 else
10920 {
10923 }
10924 }
10925 }
10926
10928 {
10930 return;
10931
10933 float split_quantity_new = Math.Floor(quantity / 2);
10934
10935 InventoryLocation invloc = new InventoryLocation;
10937
10939 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10940
10941 if (new_item)
10942 {
10943 if (new_item.GetQuantityMax() < split_quantity_new)
10944 {
10945 split_quantity_new = new_item.GetQuantityMax();
10946 }
10948 {
10951 }
10952 else
10953 {
10956 }
10957 }
10958 }
10959
10962 {
10963 SetWeightDirty();
10965
10966 if (parent)
10967 parent.OnAttachmentQuantityChangedEx(this, delta);
10968
10970 {
10972 {
10974 }
10976 {
10977 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10979 }
10980 }
10981
10982 }
10983
10986 {
10987
10988 }
10989
10992 {
10994 }
10995
10997 {
10998 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10999
11001 {
11002 if (newLevel == GameConstants.STATE_RUINED)
11003 {
11005 EntityAI parent = GetHierarchyParent();
11006 if (parent && parent.IsFireplace())
11007 {
11008 CargoBase cargo = GetInventory().GetCargo();
11009 if (cargo)
11010 {
11012 {
11014 }
11015 }
11016 }
11017 }
11018
11020 {
11021
11023 return;
11024 }
11025
11026 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11027 {
11029 }
11030 }
11031 }
11032
11033
11035 {
11036 super.OnRightClick();
11037
11039 {
11041 {
11042 if (ScriptInputUserData.CanStoreInputUserData())
11043 {
11044 vector m4[4];
11046
11047 EntityAI root = GetHierarchyRoot();
11048
11049 InventoryLocation dst = new InventoryLocation;
11051 {
11052 if (root)
11053 {
11054 root.GetTransform(m4);
11056 }
11057 else
11058 GetInventory().GetCurrentInventoryLocation(dst);
11059 }
11060 else
11061 {
11063
11064
11065 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11066 {
11067 if (root)
11068 {
11069 root.GetTransform(m4);
11071 }
11072 else
11073 GetInventory().GetCurrentInventoryLocation(dst);
11074 }
11075 else
11076 {
11077 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11078 }
11079 }
11080
11081 ScriptInputUserData ctx = new ScriptInputUserData;
11089 }
11090 }
11091 else if (!
GetGame().IsMultiplayer())
11092 {
11094 }
11095 }
11096 }
11097
11098 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11099 {
11100
11101 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11102 return false;
11103
11104 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11105 return false;
11106
11107
11109 return false;
11110
11111
11112 Magazine mag = Magazine.Cast(this);
11113 if (mag)
11114 {
11115 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11116 return false;
11117
11118 if (stack_max_limit)
11119 {
11120 Magazine other_mag = Magazine.Cast(other_item);
11121 if (other_item)
11122 {
11123 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11124 return false;
11125 }
11126
11127 }
11128 }
11129 else
11130 {
11131
11133 return false;
11134
11136 return false;
11137 }
11138
11139 PlayerBase player = null;
11140 if (CastTo(player, GetHierarchyRootPlayer()))
11141 {
11142 if (player.GetInventory().HasAttachment(this))
11143 return false;
11144
11145 if (player.IsItemsToDelete())
11146 return false;
11147 }
11148
11149 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11150 return false;
11151
11152 int slotID;
11154 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11155 return false;
11156
11157 return true;
11158 }
11159
11161 {
11163 }
11164
11166 {
11167 return m_IsResultOfSplit;
11168 }
11169
11171 {
11172 m_IsResultOfSplit = value;
11173 }
11174
11176 {
11178 }
11179
11181 {
11182 float other_item_quantity = other_item.GetQuantity();
11183 float this_free_space;
11184
11186
11188
11189 if (other_item_quantity > this_free_space)
11190 {
11191 return this_free_space;
11192 }
11193 else
11194 {
11195 return other_item_quantity;
11196 }
11197 }
11198
11200 {
11202 }
11203
11205 {
11207 return;
11208
11209 if (!IsMagazine() && other_item)
11210 {
11212 if (quantity_used != 0)
11213 {
11214 float hp1 = GetHealth01("","");
11215 float hp2 = other_item.GetHealth01("","");
11216 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11217 hpResult = hpResult / (
GetQuantity() + quantity_used);
11218
11219 hpResult *= GetMaxHealth();
11220 Math.Round(hpResult);
11221 SetHealth("", "Health", hpResult);
11222
11224 other_item.AddQuantity(-quantity_used);
11225 }
11226 }
11228 }
11229
11231 {
11232 #ifdef SERVER
11233 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11234 GetHierarchyParent().IncreaseLifetimeUp();
11235 #endif
11236 };
11237
11239 {
11240 PlayerBase p = PlayerBase.Cast(player);
11241
11242 array<int> recipesIds = p.m_Recipes;
11243 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11244 if (moduleRecipesManager)
11245 {
11246 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11247 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11248 }
11249
11250 for (int i = 0;i < recipesIds.Count(); i++)
11251 {
11252 int key = recipesIds.Get(i);
11253 string recipeName = moduleRecipesManager.GetRecipeName(key);
11255 }
11256 }
11257
11258
11259 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11260 {
11261 super.GetDebugActions(outputList);
11262
11263
11268
11269
11273
11277
11278
11281
11282
11284 {
11287 }
11288
11290
11293
11297 }
11298
11299
11300
11301
11303 {
11304 super.OnAction(action_id, player, ctx);
11305 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11306 {
11307 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11308 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11309 PlayerBase p = PlayerBase.Cast(player);
11310 if (
EActions.RECIPES_RANGE_START < 1000)
11311 {
11312 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11313 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11314 }
11315 }
11316 #ifndef SERVER
11317 else if (action_id ==
EActions.WATCH_PLAYER)
11318 {
11319 PluginDeveloper.SetDeveloperItemClientEx(player);
11320 }
11321 #endif
11323 {
11324 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11325 {
11326 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11327 OnDebugButtonPressServer(id + 1);
11328 }
11329
11330 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11331 {
11332 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11334 }
11335
11336 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11337 {
11338 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11340 }
11341
11342 else if (action_id ==
EActions.ADD_QUANTITY)
11343 {
11344 if (IsMagazine())
11345 {
11346 Magazine mag = Magazine.Cast(this);
11347 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11348 }
11349 else
11350 {
11352 }
11353
11354 if (m_EM)
11355 {
11356 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11357 }
11358
11359 }
11360
11361 else if (action_id ==
EActions.REMOVE_QUANTITY)
11362 {
11363 if (IsMagazine())
11364 {
11365 Magazine mag2 = Magazine.Cast(this);
11366 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11367 }
11368 else
11369 {
11371 }
11372 if (m_EM)
11373 {
11374 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11375 }
11376
11377 }
11378
11379 else if (action_id ==
EActions.SET_QUANTITY_0)
11380 {
11382
11383 if (m_EM)
11384 {
11385 m_EM.SetEnergy(0);
11386 }
11387 }
11388
11389 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11390 {
11392
11393 if (m_EM)
11394 {
11395 m_EM.SetEnergy(m_EM.GetEnergyMax());
11396 }
11397 }
11398
11399 else if (action_id ==
EActions.ADD_HEALTH)
11400 {
11401 AddHealth("","",GetMaxHealth("","Health")/5);
11402 }
11403 else if (action_id ==
EActions.REMOVE_HEALTH)
11404 {
11405 AddHealth("","",-GetMaxHealth("","Health")/5);
11406 }
11407 else if (action_id ==
EActions.DESTROY_HEALTH)
11408 {
11409 SetHealth01("","",0);
11410 }
11411 else if (action_id ==
EActions.WATCH_ITEM)
11412 {
11414 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11415 #ifdef DEVELOPER
11416 SetDebugDeveloper_item(this);
11417 #endif
11418 }
11419
11420 else if (action_id ==
EActions.ADD_TEMPERATURE)
11421 {
11422 AddTemperature(20);
11423
11424 }
11425
11426 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11427 {
11428 AddTemperature(-20);
11429
11430 }
11431
11432 else if (action_id ==
EActions.FLIP_FROZEN)
11433 {
11434 SetFrozen(!GetIsFrozen());
11435
11436 }
11437
11438 else if (action_id ==
EActions.ADD_WETNESS)
11439 {
11441
11442 }
11443
11444 else if (action_id ==
EActions.REMOVE_WETNESS)
11445 {
11447
11448 }
11449
11450 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11451 {
11454
11455
11456 }
11457
11458 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11459 {
11462 }
11463
11464 else if (action_id ==
EActions.MAKE_SPECIAL)
11465 {
11466 auto debugParams = DebugSpawnParams.WithPlayer(player);
11467 OnDebugSpawnEx(debugParams);
11468 }
11469
11470 else if (action_id ==
EActions.DELETE)
11471 {
11472 Delete();
11473 }
11474
11475 }
11476
11477
11478 return false;
11479 }
11480
11481
11482
11483
11487
11490
11491
11492
11494 {
11495 return false;
11496 }
11497
11498
11500 {
11501 return true;
11502 }
11503
11504
11506 {
11507 return true;
11508 }
11509
11510
11511
11513 {
11514 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11516 }
11517
11520 {
11521 return null;
11522 }
11523
11525 {
11526 return false;
11527 }
11528
11530 {
11531 return false;
11532 }
11533
11537
11538
11540 {
11541 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11542 return module_repairing.CanRepair(this, item_repair_kit);
11543 }
11544
11545
11546 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11547 {
11548 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11549 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11550 }
11551
11552
11554 {
11555
11556
11557
11558
11559
11560
11561
11562
11563 return 1;
11564 }
11565
11566
11567
11569 {
11571 }
11572
11573
11574
11576 {
11578 }
11579
11580
11589 {
11590 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11591
11592 if (player)
11593 {
11594 player.MessageStatus(text);
11595 }
11596 }
11597
11598
11607 {
11608 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11609
11610 if (player)
11611 {
11612 player.MessageAction(text);
11613 }
11614 }
11615
11616
11625 {
11626 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11627
11628 if (player)
11629 {
11630 player.MessageFriendly(text);
11631 }
11632 }
11633
11634
11643 {
11644 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11645
11646 if (player)
11647 {
11648 player.MessageImportant(text);
11649 }
11650 }
11651
11653 {
11654 return true;
11655 }
11656
11657
11658 override bool KindOf(
string tag)
11659 {
11660 bool found = false;
11661 string item_name = this.
GetType();
11664
11665 int array_size = item_tag_array.Count();
11666 for (int i = 0; i < array_size; i++)
11667 {
11668 if (item_tag_array.Get(i) == tag)
11669 {
11670 found = true;
11671 break;
11672 }
11673 }
11674 return found;
11675 }
11676
11677
11679 {
11680
11681 super.OnRPC(sender, rpc_type,ctx);
11682
11683
11684 switch (rpc_type)
11685 {
11686 #ifndef SERVER
11687 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11688 Param2<bool, string> p = new Param2<bool, string>(false, "");
11689
11691 return;
11692
11693 bool play = p.param1;
11694 string soundSet = p.param2;
11695
11696 if (play)
11697 {
11699 {
11701 {
11703 }
11704 }
11705 else
11706 {
11708 }
11709 }
11710 else
11711 {
11713 }
11714
11715 break;
11716 #endif
11717
11718 }
11719
11721 {
11723 }
11724 }
11725
11726
11727
11728
11730 {
11731 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11732 return plugin.GetID(
name);
11733 }
11734
11736 {
11737 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11738 return plugin.GetName(id);
11739 }
11740
11743 {
11744
11745
11746 int varFlags;
11747 if (!ctx.
Read(varFlags))
11748 return;
11749
11750 if (varFlags & ItemVariableFlags.FLOAT)
11751 {
11753 }
11754 }
11755
11757 {
11758
11759 super.SerializeNumericalVars(floats_out);
11760
11761
11762
11764 {
11766 }
11767
11769 {
11771 }
11772
11774 {
11776 }
11777
11779 {
11784 }
11785
11787 {
11789 }
11790 }
11791
11793 {
11794
11795 super.DeSerializeNumericalVars(floats);
11796
11797
11798 int index = 0;
11799 int mask = Math.Round(floats.Get(index));
11800
11801 index++;
11802
11804 {
11806 {
11808 }
11809 else
11810 {
11811 float quantity = floats.Get(index);
11812 SetQuantity(quantity,
true,
false,
false,
false);
11813 }
11814 index++;
11815 }
11816
11818 {
11819 float wet = floats.Get(index);
11821 index++;
11822 }
11823
11825 {
11826 int liquidtype = Math.Round(floats.Get(index));
11828 index++;
11829 }
11830
11832 {
11834 index++;
11836 index++;
11838 index++;
11840 index++;
11841 }
11842
11844 {
11845 int cleanness = Math.Round(floats.Get(index));
11847 index++;
11848 }
11849 }
11850
11852 {
11853 super.WriteVarsToCTX(ctx);
11854
11855
11857 {
11859 }
11860
11862 {
11864 }
11865
11867 {
11869 }
11870
11872 {
11873 int r,g,b,a;
11879 }
11880
11882 {
11884 }
11885 }
11886
11888 {
11889 if (!super.ReadVarsFromCTX(ctx,version))
11890 return false;
11891
11892 int intValue;
11893 float value;
11894
11895 if (version < 140)
11896 {
11897 if (!ctx.
Read(intValue))
11898 return false;
11899
11900 m_VariablesMask = intValue;
11901 }
11902
11904 {
11905 if (!ctx.
Read(value))
11906 return false;
11907
11909 {
11911 }
11912 else
11913 {
11915 }
11916 }
11917
11918 if (version < 140)
11919 {
11921 {
11922 if (!ctx.
Read(value))
11923 return false;
11924 SetTemperatureDirect(value);
11925 }
11926 }
11927
11929 {
11930 if (!ctx.
Read(value))
11931 return false;
11933 }
11934
11936 {
11937 if (!ctx.
Read(intValue))
11938 return false;
11940 }
11941
11943 {
11944 int r,g,b,a;
11946 return false;
11948 return false;
11950 return false;
11952 return false;
11953
11955 }
11956
11958 {
11959 if (!ctx.
Read(intValue))
11960 return false;
11962 }
11963
11964 if (version >= 138 && version < 140)
11965 {
11967 {
11968 if (!ctx.
Read(intValue))
11969 return false;
11970 SetFrozen(intValue);
11971 }
11972 }
11973
11974 return true;
11975 }
11976
11977
11979 {
11982 {
11984 }
11985
11986 if (!super.OnStoreLoad(ctx, version))
11987 {
11989 return false;
11990 }
11991
11992 if (version >= 114)
11993 {
11994 bool hasQuickBarIndexSaved;
11995
11996 if (!ctx.
Read(hasQuickBarIndexSaved))
11997 {
11999 return false;
12000 }
12001
12002 if (hasQuickBarIndexSaved)
12003 {
12004 int itmQBIndex;
12005
12006
12007 if (!ctx.
Read(itmQBIndex))
12008 {
12010 return false;
12011 }
12012
12013 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12014 if (itmQBIndex != -1 && parentPlayer)
12015 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12016 }
12017 }
12018 else
12019 {
12020
12021 PlayerBase player;
12022 int itemQBIndex;
12023 if (version ==
int.
MAX)
12024 {
12025 if (!ctx.
Read(itemQBIndex))
12026 {
12028 return false;
12029 }
12030 }
12031 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12032 {
12033
12034 if (!ctx.
Read(itemQBIndex))
12035 {
12037 return false;
12038 }
12039 if (itemQBIndex != -1 && player)
12040 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12041 }
12042 }
12043
12044 if (version < 140)
12045 {
12046
12047 if (!LoadVariables(ctx, version))
12048 {
12050 return false;
12051 }
12052 }
12053
12054
12056 {
12058 return false;
12059 }
12060 if (version >= 132)
12061 {
12063 if (raib)
12064 {
12066 {
12068 return false;
12069 }
12070 }
12071 }
12072
12074 return true;
12075 }
12076
12077
12078
12080 {
12081 super.OnStoreSave(ctx);
12082
12083 PlayerBase player;
12084 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12085 {
12087
12088 int itemQBIndex = -1;
12089 itemQBIndex = player.FindQuickBarEntityIndex(this);
12090 ctx.
Write(itemQBIndex);
12091 }
12092 else
12093 {
12095 }
12096
12098
12100 if (raib)
12101 {
12103 }
12104 }
12105
12106
12108 {
12109 super.AfterStoreLoad();
12110
12112 {
12114 }
12115
12117 {
12120 }
12121 }
12122
12124 {
12125 super.EEOnAfterLoad();
12126
12128 {
12130 }
12131
12134 }
12135
12137 {
12138 return false;
12139 }
12140
12141
12142
12144 {
12146 {
12147 #ifdef PLATFORM_CONSOLE
12148
12150 {
12152 if (menu)
12153 {
12155 }
12156 }
12157 #endif
12158 }
12159
12161 {
12164 }
12165
12167 {
12168 SetWeightDirty();
12170 }
12172 {
12175 }
12176
12178 {
12181 }
12183 {
12186 }
12187
12188 super.OnVariablesSynchronized();
12189 }
12190
12191
12192
12194 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12195 {
12196 if (!IsServerCheck(allow_client))
12197 return false;
12198
12200 return false;
12201
12204
12205 if (value <= (min + 0.001))
12206 value = min;
12207
12208 if (value == min)
12209 {
12210 if (destroy_config)
12211 {
12212 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12213 if (dstr)
12214 {
12216 this.Delete();
12217 return true;
12218 }
12219 }
12220 else if (destroy_forced)
12221 {
12223 this.Delete();
12224 return true;
12225 }
12226
12228 }
12229
12232
12234 {
12236
12237 if (delta)
12239 }
12240
12242
12243 return false;
12244 }
12245
12246
12248 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12249 {
12251 }
12252
12254 {
12257 }
12258
12260 {
12263 }
12264
12267 {
12268 float value_clamped = Math.Clamp(value, 0, 1);
12270 SetQuantity(result, destroy_config, destroy_forced);
12271 }
12272
12273
12276 {
12278 }
12279
12281 {
12283 }
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12295 {
12296 int slot = -1;
12297 if (GetInventory())
12298 {
12299 InventoryLocation il = new InventoryLocation;
12300 GetInventory().GetCurrentInventoryLocation(il);
12302 }
12303
12305 }
12306
12308 {
12309 float quantity_max = 0;
12310
12312 {
12313 if (attSlotID != -1)
12314 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12315
12316 if (quantity_max <= 0)
12318 }
12319
12320 if (quantity_max <= 0)
12322
12323 return quantity_max;
12324 }
12325
12327 {
12329 }
12330
12332 {
12334 }
12335
12336
12338 {
12340 }
12341
12343 {
12345 }
12346
12348 {
12350 }
12351
12352
12354 {
12355
12356 float weightEx = GetWeightEx();
12357 float special = GetInventoryAndCargoWeight();
12358 return weightEx - special;
12359 }
12360
12361
12363 {
12365 }
12366
12368 {
12370 {
12371 #ifdef DEVELOPER
12372 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12373 {
12374 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12376 }
12377 #endif
12378
12379 return GetQuantity() * GetConfigWeightModified();
12380 }
12381 else if (HasEnergyManager())
12382 {
12383 #ifdef DEVELOPER
12384 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12385 {
12386 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12387 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12388 }
12389 #endif
12390 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12391 }
12392 else
12393 {
12394 #ifdef DEVELOPER
12395 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12396 {
12397 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12398 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12399 }
12400 #endif
12401 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12402 }
12403 }
12404
12407 {
12408 int item_count = 0;
12410
12411 if (GetInventory().GetCargo() != NULL)
12412 {
12413 item_count = GetInventory().GetCargo().GetItemCount();
12414 }
12415
12416 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12417 {
12418 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12419 if (item)
12420 item_count += item.GetNumberOfItems();
12421 }
12422 return item_count;
12423 }
12424
12427 {
12428 float weight = 0;
12429 float wetness = 1;
12430 if (include_wetness)
12433 {
12434 weight = wetness * m_ConfigWeight;
12435 }
12437 {
12438 weight = 1;
12439 }
12440 return weight;
12441 }
12442
12443
12444
12446 {
12447 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12448 {
12449 GameInventory inv = GetInventory();
12450 array<EntityAI> items = new array<EntityAI>;
12452 for (int i = 0; i < items.Count(); i++)
12453 {
12455 if (item)
12456 {
12458 }
12459 }
12460 }
12461 }
12462
12463
12464
12465
12467 {
12468 float energy = 0;
12469 if (HasEnergyManager())
12470 {
12471 energy = GetCompEM().GetEnergy();
12472 }
12473 return energy;
12474 }
12475
12476
12478 {
12479 super.OnEnergyConsumed();
12480
12482 }
12483
12485 {
12486 super.OnEnergyAdded();
12487
12489 }
12490
12491
12493 {
12494 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12495 {
12497 {
12498 float energy_0to1 = GetCompEM().GetEnergy0To1();
12500 }
12501 }
12502 }
12503
12504
12506 {
12507 return ConfigGetFloat("heatIsolation");
12508 }
12509
12511 {
12513 }
12514
12516 {
12517 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12518 if (
GetGame().ConfigIsExisting(paramPath))
12520
12521 return 0.0;
12522 }
12523
12525 {
12526 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12527 if (
GetGame().ConfigIsExisting(paramPath))
12529
12530 return 0.0;
12531 }
12532
12533 override void SetWet(
float value,
bool allow_client =
false)
12534 {
12535 if (!IsServerCheck(allow_client))
12536 return;
12537
12540
12542
12543 m_VarWet = Math.Clamp(value, min, max);
12544
12546 {
12549 }
12550 }
12551
12552 override void AddWet(
float value)
12553 {
12555 }
12556
12558 {
12560 }
12561
12563 {
12565 }
12566
12568 {
12570 }
12571
12573 {
12575 }
12576
12578 {
12580 }
12581
12582 override void OnWetChanged(
float newVal,
float oldVal)
12583 {
12586 if (newLevel != oldLevel)
12587 {
12589 }
12590 }
12591
12593 {
12594 SetWeightDirty();
12595 }
12596
12598 {
12599 return GetWetLevelInternal(
m_VarWet);
12600 }
12601
12602
12603
12605 {
12607 }
12608
12610 {
12612 }
12613
12615 {
12617 }
12618
12620 {
12622 }
12623
12624
12625
12627 {
12628 if (ConfigIsExisting("itemModelLength"))
12629 {
12630 return ConfigGetFloat("itemModelLength");
12631 }
12632 return 0;
12633 }
12634
12636 {
12637 if (ConfigIsExisting("itemAttachOffset"))
12638 {
12639 return ConfigGetFloat("itemAttachOffset");
12640 }
12641 return 0;
12642 }
12643
12644 override void SetCleanness(
int value,
bool allow_client =
false)
12645 {
12646 if (!IsServerCheck(allow_client))
12647 return;
12648
12650
12652
12655 }
12656
12658 {
12660 }
12661
12663 {
12664 return true;
12665 }
12666
12667
12668
12669
12671 {
12673 }
12674
12676 {
12678 }
12679
12680
12681
12682
12683 override void SetColor(
int r,
int g,
int b,
int a)
12684 {
12690 }
12692 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12693 {
12698 }
12699
12701 {
12703 }
12704
12707 {
12708 int r,g,b,a;
12710 r = r/255;
12711 g = g/255;
12712 b = b/255;
12713 a = a/255;
12714 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12715 }
12716
12717
12718
12719 override void SetLiquidType(
int value,
bool allow_client =
false)
12720 {
12721 if (!IsServerCheck(allow_client))
12722 return;
12723
12728 }
12729
12731 {
12732 return ConfigGetInt("varLiquidTypeInit");
12733 }
12734
12736 {
12738 }
12739
12741 {
12743 SetFrozen(false);
12744 }
12745
12748 {
12749 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12750 }
12751
12752
12755 {
12756 PlayerBase nplayer;
12757 if (PlayerBase.CastTo(nplayer, player))
12758 {
12760
12761 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12762 }
12763 }
12764
12765
12768 {
12769 PlayerBase nplayer;
12770 if (PlayerBase.CastTo(nplayer,player))
12771 {
12772
12773 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12774
12775 }
12776
12777
12778 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12779
12780
12781 if (HasEnergyManager())
12782 {
12783 GetCompEM().UpdatePlugState();
12784 }
12785 }
12786
12787
12789 {
12790 super.OnPlacementStarted(player);
12791
12793 }
12794
12795 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12796 {
12798 {
12799 m_AdminLog.OnPlacementComplete(player,
this);
12800 }
12801
12802 super.OnPlacementComplete(player, position, orientation);
12803 }
12804
12805
12806
12807
12808
12810 {
12812 {
12813 return true;
12814 }
12815 else
12816 {
12817 return false;
12818 }
12819 }
12820
12821
12823 {
12825 {
12827 }
12828 }
12829
12830
12832 {
12834 }
12835
12837 {
12839 }
12840
12841 override void InsertAgent(
int agent,
float count = 1)
12842 {
12843 if (count < 1)
12844 return;
12845
12847 }
12848
12851 {
12853 }
12854
12855
12857 {
12859 }
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12903 {
12905 return false;
12906 return true;
12907 }
12908
12910 {
12911
12913 }
12914
12915
12918 {
12919 super.CheckForRoofLimited(timeTresholdMS);
12920
12922 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12923 {
12924 m_PreviousRoofTestTime = time;
12925 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12926 }
12927 }
12928
12929
12931 {
12933 {
12934 return 0;
12935 }
12936
12937 if (GetInventory().GetAttachmentSlotsCount() != 0)
12938 {
12939 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12940 if (filter)
12941 return filter.GetProtectionLevel(type, false, system);
12942 else
12943 return 0;
12944 }
12945
12946 string subclassPath, entryName;
12947
12948 switch (type)
12949 {
12951 entryName = "biological";
12952 break;
12954 entryName = "chemical";
12955 break;
12956 default:
12957 entryName = "biological";
12958 break;
12959 }
12960
12961 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12962
12964 }
12965
12966
12967
12970 {
12971 if (!IsMagazine())
12973
12975 }
12976
12977
12978
12979
12980
12985 {
12986 return true;
12987 }
12988
12990 {
12992 }
12993
12994
12995
12996
12997
12999 {
13000 if (parent)
13001 {
13002 if (parent.IsInherited(DayZInfected))
13003 return true;
13004
13005 if (!parent.IsRuined())
13006 return true;
13007 }
13008
13009 return true;
13010 }
13011
13013 {
13014 if (!super.CanPutAsAttachment(parent))
13015 {
13016 return false;
13017 }
13018
13019 if (!IsRuined() && !parent.IsRuined())
13020 {
13021 return true;
13022 }
13023
13024 return false;
13025 }
13026
13028 {
13029
13030
13031
13032
13033 return super.CanReceiveItemIntoCargo(item);
13034 }
13035
13037 {
13038
13039
13040
13041
13042 GameInventory attachmentInv = attachment.GetInventory();
13044 {
13045 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13046 return false;
13047 }
13048
13049 InventoryLocation loc = new InventoryLocation();
13050 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13051 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13052 return false;
13053
13054 return super.CanReceiveAttachment(attachment, slotId);
13055 }
13056
13058 {
13059 if (!super.CanReleaseAttachment(attachment))
13060 return false;
13061
13062 return GetInventory().AreChildrenAccessible();
13063 }
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13086 {
13087 int id = muzzle_owner.GetMuzzleID();
13088 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13089
13090 if (WPOF_array)
13091 {
13092 for (int i = 0; i < WPOF_array.Count(); i++)
13093 {
13094 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13095
13096 if (WPOF)
13097 {
13098 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13099 }
13100 }
13101 }
13102 }
13103
13104
13106 {
13107 int id = muzzle_owner.GetMuzzleID();
13109
13110 if (WPOBE_array)
13111 {
13112 for (int i = 0; i < WPOBE_array.Count(); i++)
13113 {
13114 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13115
13116 if (WPOBE)
13117 {
13118 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13119 }
13120 }
13121 }
13122 }
13123
13124
13126 {
13127 int id = muzzle_owner.GetMuzzleID();
13128 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13129
13130 if (WPOOH_array)
13131 {
13132 for (int i = 0; i < WPOOH_array.Count(); i++)
13133 {
13134 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13135
13136 if (WPOOH)
13137 {
13138 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13139 }
13140 }
13141 }
13142 }
13143
13144
13146 {
13147 int id = muzzle_owner.GetMuzzleID();
13148 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13149
13150 if (WPOOH_array)
13151 {
13152 for (int i = 0; i < WPOOH_array.Count(); i++)
13153 {
13154 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13155
13156 if (WPOOH)
13157 {
13158 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13159 }
13160 }
13161 }
13162 }
13163
13164
13166 {
13167 int id = muzzle_owner.GetMuzzleID();
13168 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13169
13170 if (WPOOH_array)
13171 {
13172 for (int i = 0; i < WPOOH_array.Count(); i++)
13173 {
13174 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13175
13176 if (WPOOH)
13177 {
13178 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13179 }
13180 }
13181 }
13182 }
13183
13184
13185
13187 {
13189 {
13190 return true;
13191 }
13192
13193 return false;
13194 }
13195
13197 {
13199 {
13200 return true;
13201 }
13202
13203 return false;
13204 }
13205
13207 {
13209 {
13210 return true;
13211 }
13212
13213 return false;
13214 }
13215
13217 {
13218 return false;
13219 }
13220
13223 {
13224 return UATimeSpent.DEFAULT_DEPLOY;
13225 }
13226
13227
13228
13229
13231 {
13233 SetSynchDirty();
13234 }
13235
13237 {
13239 }
13240
13241
13243 {
13244 return false;
13245 }
13246
13249 {
13250 string att_type = "None";
13251
13252 if (ConfigIsExisting("soundAttType"))
13253 {
13254 att_type = ConfigGetString("soundAttType");
13255 }
13256
13258 }
13259
13261 {
13263 }
13264
13265
13266
13267
13268
13272
13274 {
13277
13279 }
13280
13281
13283 {
13285 return;
13286
13288
13291
13294
13295 SoundParameters params = new SoundParameters();
13299 }
13300
13301
13303 {
13305 return;
13306
13308 SetSynchDirty();
13309
13312 }
13313
13314
13316 {
13318 return;
13319
13321 SetSynchDirty();
13322
13325 }
13326
13328 {
13330 }
13331
13333 {
13335 }
13336
13339 {
13340 if (!
GetGame().IsDedicatedServer())
13341 {
13342 if (ConfigIsExisting("attachSoundSet"))
13343 {
13344 string cfg_path = "";
13345 string soundset = "";
13346 string type_name =
GetType();
13347
13350 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13351 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13352
13353 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13354 {
13355 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13356 {
13357 if (cfg_slot_array[i] == slot_type)
13358 {
13359 soundset = cfg_soundset_array[i];
13360 break;
13361 }
13362 }
13363 }
13364
13365 if (soundset != "")
13366 {
13367 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13369 }
13370 }
13371 }
13372 }
13373
13375 {
13376
13377 }
13378
13379 void OnApply(PlayerBase player);
13380
13382 {
13383 return 1.0;
13384 };
13385
13387 {
13389 }
13390
13392 {
13394 }
13395
13397
13399 {
13400 SetDynamicPhysicsLifeTime(0.01);
13402 }
13403
13405 {
13406 array<string> zone_names = new array<string>;
13407 GetDamageZones(zone_names);
13408 for (int i = 0; i < zone_names.Count(); i++)
13409 {
13410 SetHealthMax(zone_names.Get(i),"Health");
13411 }
13412 SetHealthMax("","Health");
13413 }
13414
13417 {
13418 float global_health = GetHealth01("","Health");
13419 array<string> zones = new array<string>;
13420 GetDamageZones(zones);
13421
13422 for (int i = 0; i < zones.Count(); i++)
13423 {
13424 SetHealth01(zones.Get(i),"Health",global_health);
13425 }
13426 }
13427
13430 {
13431 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13432 }
13433
13435 {
13436 if (!hasRootAsPlayer)
13437 {
13438 if (refParentIB)
13439 {
13440
13441 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13442 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13443
13444 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13445 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13446
13449 }
13450 else
13451 {
13452
13455 }
13456 }
13457 }
13458
13460 {
13462 {
13463 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13464 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13465 {
13466 float heatPermCoef = 1.0;
13468 while (ent)
13469 {
13470 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13471 ent = ent.GetHierarchyParent();
13472 }
13473
13474 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13475 }
13476 }
13477 }
13478
13480 {
13481
13482 EntityAI parent = GetHierarchyParent();
13483 if (!parent)
13484 {
13485 hasParent = false;
13486 hasRootAsPlayer = false;
13487 }
13488 else
13489 {
13490 hasParent = true;
13491 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13492 refParentIB =
ItemBase.Cast(parent);
13493 }
13494 }
13495
13496 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13497 {
13498
13499 }
13500
13502 {
13503
13504 return false;
13505 }
13506
13508 {
13509
13510
13511 return false;
13512 }
13513
13515 {
13516
13517 return false;
13518 }
13519
13522 {
13523 return !GetIsFrozen() &&
IsOpen();
13524 }
13525
13527 {
13528 bool hasParent = false, hasRootAsPlayer = false;
13530
13531 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13532 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13533
13534 if (wwtu || foodDecay)
13535 {
13539
13540 if (processWetness || processTemperature || processDecay)
13541 {
13543
13544 if (processWetness)
13545 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13546
13547 if (processTemperature)
13549
13550 if (processDecay)
13551 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13552 }
13553 }
13554 }
13555
13558 {
13560 }
13561
13563 {
13566
13567 return super.GetTemperatureFreezeThreshold();
13568 }
13569
13571 {
13574
13575 return super.GetTemperatureThawThreshold();
13576 }
13577
13579 {
13582
13583 return super.GetItemOverheatThreshold();
13584 }
13585
13587 {
13589 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13590
13591 return super.GetTemperatureFreezeTime();
13592 }
13593
13595 {
13597 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13598
13599 return super.GetTemperatureThawTime();
13600 }
13601
13606
13608 {
13609 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13610 }
13611
13613 {
13614 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13615 }
13616
13619 {
13621 }
13622
13624 {
13626 }
13627
13629 {
13631 }
13632
13635 {
13636 return null;
13637 }
13638
13641 {
13642 return false;
13643 }
13644
13646 {
13648 {
13651 if (!trg)
13652 {
13654 explosive = this;
13655 }
13656
13657 explosive.PairRemote(trg);
13659
13660 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13661 trg.SetPersistentPairID(persistentID);
13662 explosive.SetPersistentPairID(persistentID);
13663
13664 return true;
13665 }
13666 return false;
13667 }
13668
13671 {
13672 float ret = 1.0;
13675 ret *= GetHealth01();
13676
13677 return ret;
13678 }
13679
13680 #ifdef DEVELOPER
13681 override void SetDebugItem()
13682 {
13683 super.SetDebugItem();
13684 _itemBase = this;
13685 }
13686
13688 {
13689 string text = super.GetDebugText();
13690
13692 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13693
13694 return text;
13695 }
13696 #endif
13697
13699 {
13700 return true;
13701 }
13702
13704
13706
13708 {
13711 }
13712
13713
13721
13737}
13738
13740{
13742 if (entity)
13743 {
13744 bool is_item = entity.IsInherited(
ItemBase);
13745 if (is_item && full_quantity)
13746 {
13749 }
13750 }
13751 else
13752 {
13754 return NULL;
13755 }
13756 return entity;
13757}
13758
13760{
13761 if (item)
13762 {
13763 if (health > 0)
13764 item.SetHealth("", "", health);
13765
13766 if (item.CanHaveTemperature())
13767 {
13769 if (item.CanFreeze())
13770 item.SetFrozen(false);
13771 }
13772
13773 if (item.HasEnergyManager())
13774 {
13775 if (quantity >= 0)
13776 {
13777 item.GetCompEM().SetEnergy0To1(quantity);
13778 }
13779 else
13780 {
13782 }
13783 }
13784 else if (item.IsMagazine())
13785 {
13786 Magazine mag = Magazine.Cast(item);
13787 if (quantity >= 0)
13788 {
13789 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13790 }
13791 else
13792 {
13794 }
13795
13796 }
13797 else
13798 {
13799 if (quantity >= 0)
13800 {
13801 item.SetQuantityNormalized(quantity, false);
13802 }
13803 else
13804 {
13806 }
13807
13808 }
13809 }
13810}
13811
13812#ifdef DEVELOPER
13814#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.