8956{
8958 {
8959 return true;
8960 }
8961};
8962
8963
8964
8966{
8970
8972
8975
8976
8977
8978
8979
8988
8994
8999
9004
9025 protected bool m_IsResultOfSplit
9026
9028
9033
9034
9035
9037
9041
9042
9043
9045
9048
9049
9050
9056
9057
9065
9068
9069
9071
9072
9074
9075
9080
9081
9086
9087
9089
9090
9092 {
9097
9098 if (!
GetGame().IsDedicatedServer())
9099 {
9101 {
9103
9105 {
9107 }
9108 }
9109
9112 }
9113
9114 m_OldLocation = null;
9115
9117 {
9119 }
9120
9121 if (ConfigIsExisting("headSelectionsToHide"))
9122 {
9125 }
9126
9128 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9129 {
9131 }
9132
9134
9135 m_IsResultOfSplit = false;
9136
9138 }
9139
9141 {
9142 super.InitItemVariables();
9143
9149 m_Count = ConfigGetInt(
"count");
9150
9153
9158
9161
9166
9178
9182
9183
9186 if (ConfigIsExisting("canBeSplit"))
9187 {
9190 }
9191
9193 if (ConfigIsExisting("itemBehaviour"))
9195
9196
9199 RegisterNetSyncVariableInt("m_VarLiquidType");
9200 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9201
9202 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9203 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9204 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9205
9206 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9207 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9208 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9209 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9210
9211 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9212 RegisterNetSyncVariableBool("m_IsTakeable");
9213 RegisterNetSyncVariableBool("m_IsHologram");
9214
9217 {
9220 }
9221
9223
9225 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9227
9228 }
9229
9231 {
9233 }
9234
9236 {
9239 {
9244 }
9245 }
9246
9247 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9248 {
9250 {
9253 }
9254
9256 }
9257
9259 {
9265 }
9266
9268
9270 {
9272
9273 if (!action)
9274 {
9275 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9276 return;
9277 }
9278
9280 if (!ai)
9281 {
9283 return;
9284 }
9285
9287 if (!action_array)
9288 {
9289 action_array = new array<ActionBase_Basic>;
9291 }
9292 if (LogManager.IsActionLogEnable())
9293 {
9294 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9295 }
9296
9297 if (action_array.Find(action) != -1)
9298 {
9299 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9300 }
9301 else
9302 {
9303 action_array.Insert(action);
9304 }
9305 }
9306
9308 {
9310 ActionBase action = player.GetActionManager().GetAction(actionName);
9313
9314 if (action_array)
9315 {
9316 action_array.RemoveItem(action);
9317 }
9318 }
9319
9320
9321
9323 {
9324 ActionOverrideData overrideData = new ActionOverrideData();
9328
9330 if (!actionMap)
9331 {
9334 }
9335
9336 actionMap.Insert(this.
Type(), overrideData);
9337
9338 }
9339
9341
9343
9344
9346 {
9349
9352
9353 string config_to_search = "CfgVehicles";
9354 string muzzle_owner_config;
9355
9357 {
9358 if (IsInherited(Weapon))
9359 config_to_search = "CfgWeapons";
9360
9361 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9362
9363 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9364
9366
9367 if (config_OnFire_subclass_count > 0)
9368 {
9369 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9370
9371 for (int i = 0; i < config_OnFire_subclass_count; i++)
9372 {
9373 string particle_class = "";
9375 string config_OnFire_entry = config_OnFire_class + particle_class;
9376 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9377 WPOF_array.Insert(WPOF);
9378 }
9379
9380
9382 }
9383 }
9384
9386 {
9387 config_to_search = "CfgWeapons";
9388 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9389
9390 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9391
9393
9394 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9395 {
9396 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9397
9398 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9399 {
9400 string particle_class2 = "";
9402 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9403 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9404 WPOBE_array.Insert(WPOBE);
9405 }
9406
9407
9409 }
9410 }
9411 }
9412
9413
9415 {
9418
9420 {
9421 string config_to_search = "CfgVehicles";
9422
9423 if (IsInherited(Weapon))
9424 config_to_search = "CfgWeapons";
9425
9426 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9427 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9428
9429 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9430 {
9431
9433
9435 {
9437 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9439 return;
9440 }
9441
9444
9445
9446
9448 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9449
9450 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9451 {
9452 string particle_class = "";
9454 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9456
9457 if (entry_type == CT_CLASS)
9458 {
9459 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9460 WPOOH_array.Insert(WPOF);
9461 }
9462 }
9463
9464
9466 }
9467 }
9468 }
9469
9471 {
9473 }
9474
9476 {
9478 {
9480
9483
9486
9487 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9488 }
9489 }
9490
9492 {
9494 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9495
9497 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9498
9500 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9501
9503 {
9505 }
9506 }
9507
9509 {
9511 }
9512
9514 {
9517 else
9519
9521 {
9524 }
9525 else
9526 {
9529
9532 }
9533
9535 }
9536
9538 {
9540 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9541 }
9542
9544 {
9546 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9548 }
9549
9551 {
9553 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9554 }
9555
9557 {
9560
9561 OverheatingParticle OP = new OverheatingParticle();
9566
9568 }
9569
9571 {
9574
9575 return -1;
9576 }
9577
9579 {
9581 {
9584
9585 for (int i = count; i > 0; --i)
9586 {
9587 int id = i - 1;
9590
9593
9594 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9595 {
9596 if (p)
9597 {
9600 }
9601 }
9602 }
9603 }
9604 }
9605
9607 {
9609 {
9611 {
9612 int id = i - 1;
9614
9615 if (OP)
9616 {
9618
9619 if (p)
9620 {
9622 }
9623
9624 delete OP;
9625 }
9626 }
9627
9630 }
9631 }
9632
9635 {
9636 return 0.0;
9637 }
9638
9639
9641 {
9642 return 250;
9643 }
9644
9646 {
9647 return 0;
9648 }
9649
9652 {
9654 return true;
9655
9656 return false;
9657 }
9658
9661 {
9664
9666 {
9668 }
9669 else
9670 {
9671
9673 }
9674
9676 }
9677
9684 {
9685 return -1;
9686 }
9687
9688
9689
9690
9692 {
9694 {
9696 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9697
9698 if (r_index >= 0)
9699 {
9700 InventoryLocation r_il = new InventoryLocation;
9701 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9702
9703 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9706 {
9707 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9708 }
9710 {
9711 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9712 }
9713
9714 }
9715
9716 player.GetHumanInventory().ClearUserReservedLocation(this);
9717 }
9718
9721 }
9722
9723
9724
9725
9727 {
9728 return ItemBase.m_DebugActionsMask;
9729 }
9730
9732 {
9733 return ItemBase.m_DebugActionsMask & mask;
9734 }
9735
9737 {
9738 ItemBase.m_DebugActionsMask = mask;
9739 }
9740
9742 {
9743 ItemBase.m_DebugActionsMask |= mask;
9744 }
9745
9747 {
9748 ItemBase.m_DebugActionsMask &= ~mask;
9749 }
9750
9752 {
9754 {
9756 }
9757 else
9758 {
9760 }
9761 }
9762
9763
9765 {
9766 if (GetEconomyProfile())
9767 {
9768 float q_max = GetEconomyProfile().GetQuantityMax();
9769 if (q_max > 0)
9770 {
9771 float q_min = GetEconomyProfile().GetQuantityMin();
9772 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9773
9775 {
9776 ComponentEnergyManager comp = GetCompEM();
9778 {
9780 }
9781 }
9783 {
9785
9786 }
9787
9788 }
9789 }
9790 }
9791
9794 {
9795 EntityAI parent = GetHierarchyParent();
9796
9797 if (parent)
9798 {
9799 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9800 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9801 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9802 }
9803 }
9804
9807 {
9808 EntityAI parent = GetHierarchyParent();
9809
9810 if (parent)
9811 {
9812 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9813 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9814 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9815 }
9816 }
9817
9819 {
9820
9821
9822
9823
9825
9827 {
9828 if (ScriptInputUserData.CanStoreInputUserData())
9829 {
9830 ScriptInputUserData ctx = new ScriptInputUserData;
9836 ctx.
Write(use_stack_max);
9839
9841 {
9842 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9843 }
9844 }
9845 }
9846 else if (!
GetGame().IsMultiplayer())
9847 {
9849 }
9850 }
9851
9853 {
9855 }
9856
9858 {
9860 }
9861
9863 {
9865 }
9866
9868 {
9869
9870 return false;
9871 }
9872
9874 {
9875 return false;
9876 }
9877
9881 {
9882 return false;
9883 }
9884
9886 {
9887 return "";
9888 }
9889
9891
9893 {
9894 return false;
9895 }
9896
9898 {
9899 return true;
9900 }
9901
9902
9903
9905 {
9906 return true;
9907 }
9908
9910 {
9911 return true;
9912 }
9913
9915 {
9916 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9918 }
9919
9921 {
9923 }
9924
9926 {
9928 if (!is_being_placed)
9930 SetSynchDirty();
9931 }
9932
9933
9935
9937 {
9939 }
9940
9942 {
9944 }
9945
9947 {
9948 return 1;
9949 }
9950
9952 {
9953 return false;
9954 }
9955
9957 {
9959 SetSynchDirty();
9960 }
9961
9962
9963
9964
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
9997 {
9998 super.OnMovedInsideCargo(container);
9999
10000 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10001 }
10002
10003 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10004 {
10005 super.EEItemLocationChanged(oldLoc,newLoc);
10006
10007 PlayerBase new_player = null;
10008 PlayerBase old_player = null;
10009
10010 if (newLoc.GetParent())
10011 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10012
10013 if (oldLoc.GetParent())
10014 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10015
10017 {
10018 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10019
10020 if (r_index >= 0)
10021 {
10022 InventoryLocation r_il = new InventoryLocation;
10023 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10024
10025 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10028 {
10029 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10030 }
10032 {
10033 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10034 }
10035
10036 }
10037 }
10038
10040 {
10041 if (new_player)
10042 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10043
10044 if (new_player == old_player)
10045 {
10046
10047 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10048 {
10050 {
10051 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10052 {
10053 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10054 }
10055 }
10056 else
10057 {
10058 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10059 }
10060 }
10061
10062 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10063 {
10064 int type = oldLoc.GetType();
10066 {
10067 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10068 }
10070 {
10071 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10072 }
10073 }
10074 if (!m_OldLocation)
10075 {
10076 m_OldLocation = new InventoryLocation;
10077 }
10078 m_OldLocation.Copy(oldLoc);
10079 }
10080 else
10081 {
10082 if (m_OldLocation)
10083 {
10084 m_OldLocation.Reset();
10085 }
10086 }
10087
10089 }
10090 else
10091 {
10092 if (new_player)
10093 {
10094 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10095 if (res_index >= 0)
10096 {
10097 InventoryLocation il = new InventoryLocation;
10098 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10100 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10103 {
10104 il.
GetParent().GetOnReleaseLock().Invoke(it);
10105 }
10107 {
10109 }
10110
10111 }
10112 }
10114 {
10115
10117 }
10118
10119 if (m_OldLocation)
10120 {
10121 m_OldLocation.Reset();
10122 }
10123 }
10124 }
10125
10126 override void EOnContact(IEntity other, Contact extra)
10127 {
10129 {
10130 int liquidType = -1;
10132 if (impactSpeed > 0.0)
10133 {
10135 #ifndef SERVER
10137 #else
10139 SetSynchDirty();
10140 #endif
10142 }
10143 }
10144
10145 #ifdef SERVER
10146 if (GetCompEM() && GetCompEM().IsPlugged())
10147 {
10148 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10149 GetCompEM().UnplugThis();
10150 }
10151 #endif
10152 }
10153
10155
10157 {
10159 }
10160
10162 {
10163
10164 }
10165
10167 {
10168 super.OnItemLocationChanged(old_owner, new_owner);
10169
10170 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10171 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10172
10173 if (!relatedPlayer && playerNew)
10174 relatedPlayer = playerNew;
10175
10176 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10177 {
10179 if (actionMgr)
10180 {
10181 ActionBase currentAction = actionMgr.GetRunningAction();
10182 if (currentAction)
10184 }
10185 }
10186
10187 Man ownerPlayerOld = null;
10188 Man ownerPlayerNew = null;
10189
10190 if (old_owner)
10191 {
10192 if (old_owner.
IsMan())
10193 {
10194 ownerPlayerOld = Man.Cast(old_owner);
10195 }
10196 else
10197 {
10198 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10199 }
10200 }
10201 else
10202 {
10204 {
10206
10207 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10208 {
10209 GetCompEM().UnplugThis();
10210 }
10211 }
10212 }
10213
10214 if (new_owner)
10215 {
10216 if (new_owner.
IsMan())
10217 {
10218 ownerPlayerNew = Man.Cast(new_owner);
10219 }
10220 else
10221 {
10222 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10223 }
10224 }
10225
10226 if (ownerPlayerOld != ownerPlayerNew)
10227 {
10228 if (ownerPlayerOld)
10229 {
10230 array<EntityAI> subItemsExit = new array<EntityAI>;
10232 for (int i = 0; i < subItemsExit.Count(); i++)
10233 {
10236 }
10237 }
10238
10239 if (ownerPlayerNew)
10240 {
10241 array<EntityAI> subItemsEnter = new array<EntityAI>;
10243 for (int j = 0; j < subItemsEnter.Count(); j++)
10244 {
10247 }
10248 }
10249 }
10250 else if (ownerPlayerNew != null)
10251 {
10252 PlayerBase nplayer;
10253 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10254 {
10255 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10257 for (int k = 0; k < subItemsUpdate.Count(); k++)
10258 {
10260 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10261 }
10262 }
10263 }
10264
10265 if (old_owner)
10266 old_owner.OnChildItemRemoved(this);
10267 if (new_owner)
10268 new_owner.OnChildItemReceived(this);
10269 }
10270
10271
10273 {
10274 super.EEDelete(parent);
10275 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10276 if (player)
10277 {
10279
10280 if (player.IsAlive())
10281 {
10282 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10283 if (r_index >= 0)
10284 {
10285 InventoryLocation r_il = new InventoryLocation;
10286 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10287
10288 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10291 {
10292 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10293 }
10295 {
10296 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10297 }
10298
10299 }
10300
10301 player.RemoveQuickBarEntityShortcut(this);
10302 }
10303 }
10304 }
10305
10307 {
10308 super.EEKilled(killer);
10309
10312 {
10313 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10314 {
10315 if (IsMagazine())
10316 {
10317 if (Magazine.Cast(this).GetAmmoCount() > 0)
10318 {
10320 }
10321 }
10322 else
10323 {
10325 }
10326 }
10327 }
10328 }
10329
10331 {
10332 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10333
10334 super.OnWasAttached(parent, slot_id);
10335
10338
10340 }
10341
10343 {
10344 super.OnWasDetached(parent, slot_id);
10345
10348 }
10349
10351 {
10352 int idx;
10355
10356 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10357 if (inventory_slots.Count() < 1)
10358 {
10359 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10360 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10361 }
10362 else
10363 {
10364 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10365 }
10366
10367 idx = inventory_slots.Find(slot);
10368 if (idx < 0)
10369 return "";
10370
10371 return attach_types.Get(idx);
10372 }
10373
10375 {
10376 int idx = -1;
10377 string slot;
10378
10381
10382 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10383 if (inventory_slots.Count() < 1)
10384 {
10385 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10386 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10387 }
10388 else
10389 {
10390 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10391 if (detach_types.Count() < 1)
10392 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10393 }
10394
10395 for (int i = 0; i < inventory_slots.Count(); i++)
10396 {
10397 slot = inventory_slots.Get(i);
10398 }
10399
10400 if (slot != "")
10401 {
10402 if (detach_types.Count() == 1)
10403 idx = 0;
10404 else
10405 idx = inventory_slots.Find(slot);
10406 }
10407 if (idx < 0)
10408 return "";
10409
10410 return detach_types.Get(idx);
10411 }
10412
10414 {
10415
10417
10418
10419 float min_time = 1;
10420 float max_time = 3;
10421 float delay = Math.RandomFloat(min_time, max_time);
10422
10423 explode_timer.Run(delay, this, "DoAmmoExplosion");
10424 }
10425
10427 {
10428 Magazine magazine = Magazine.Cast(this);
10429 int pop_sounds_count = 6;
10430 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10431
10432
10433 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10434 string sound_name = pop_sounds[ sound_idx ];
10436
10437
10438 magazine.ServerAddAmmoCount(-1);
10439
10440
10441 float min_temp_to_explode = 100;
10442
10443 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10444 {
10446 }
10447 }
10448
10449
10450 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10451 {
10452 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10453
10454 const int CHANCE_DAMAGE_CARGO = 4;
10455 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10456 const int CHANCE_DAMAGE_NOTHING = 2;
10457
10459 {
10460 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10461 int chances;
10462 int rnd;
10463
10464 if (GetInventory().GetCargo())
10465 {
10466 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10467 rnd = Math.RandomInt(0,chances);
10468
10469 if (rnd < CHANCE_DAMAGE_CARGO)
10470 {
10472 }
10473 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10474 {
10476 }
10477 }
10478 else
10479 {
10480 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10481 rnd = Math.RandomInt(0,chances);
10482
10483 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10484 {
10486 }
10487 }
10488 }
10489 }
10490
10492 {
10493 if (GetInventory().GetCargo())
10494 {
10495 int item_count = GetInventory().GetCargo().GetItemCount();
10496 if (item_count > 0)
10497 {
10498 int random_pick = Math.RandomInt(0, item_count);
10500 if (!item.IsExplosive())
10501 {
10502 item.AddHealth("","",damage);
10503 return true;
10504 }
10505 }
10506 }
10507 return false;
10508 }
10509
10511 {
10512 int attachment_count = GetInventory().AttachmentCount();
10513 if (attachment_count > 0)
10514 {
10515 int random_pick = Math.RandomInt(0, attachment_count);
10516 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10517 if (!attachment.IsExplosive())
10518 {
10519 attachment.AddHealth("","",damage);
10520 return true;
10521 }
10522 }
10523 return false;
10524 }
10525
10527 {
10529 }
10530
10532 {
10534 return GetInventory().CanRemoveEntity();
10535
10536 return false;
10537 }
10538
10540 {
10541
10543 return false;
10544
10545
10547 return false;
10548
10549
10550
10552 if (delta == 0)
10553 return false;
10554
10555
10556 return true;
10557 }
10558
10560 {
10562 {
10563 if (ScriptInputUserData.CanStoreInputUserData())
10564 {
10565 ScriptInputUserData ctx = new ScriptInputUserData;
10570 ctx.
Write(destination_entity);
10572 ctx.
Write(slot_id);
10574 }
10575 }
10576 else if (!
GetGame().IsMultiplayer())
10577 {
10579 }
10580 }
10581
10583 {
10584 float split_quantity_new;
10588 InventoryLocation loc = new InventoryLocation;
10589
10590 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10591 {
10593 split_quantity_new = stack_max;
10594 else
10596
10598 {
10599 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10600 if (new_item)
10601 {
10602 new_item.SetResultOfSplit(true);
10603 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10605 new_item.
SetQuantity(split_quantity_new,
false,
true);
10606 }
10607 }
10608 }
10609 else if (destination_entity && slot_id == -1)
10610 {
10611 if (quantity > stack_max)
10612 split_quantity_new = stack_max;
10613 else
10614 split_quantity_new = quantity;
10615
10617 {
10619 {
10622 }
10623
10624 if (new_item)
10625 {
10626 new_item.SetResultOfSplit(true);
10627 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10629 new_item.
SetQuantity(split_quantity_new,
false,
true);
10630 }
10631 }
10632 }
10633 else
10634 {
10635 if (stack_max != 0)
10636 {
10638 {
10640 }
10641
10642 if (split_quantity_new == 0)
10643 {
10644 if (!
GetGame().IsMultiplayer())
10645 player.PhysicalPredictiveDropItem(this);
10646 else
10647 player.ServerDropEntity(this);
10648 return;
10649 }
10650
10652 {
10654
10655 if (new_item)
10656 {
10657 new_item.SetResultOfSplit(true);
10658 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10661 new_item.PlaceOnSurface();
10662 }
10663 }
10664 }
10665 }
10666 }
10667
10669 {
10670 float split_quantity_new;
10674 InventoryLocation loc = new InventoryLocation;
10675
10676 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10677 {
10679 split_quantity_new = stack_max;
10680 else
10682
10684 {
10685 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10686 if (new_item)
10687 {
10688 new_item.SetResultOfSplit(true);
10689 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10691 new_item.
SetQuantity(split_quantity_new,
false,
true);
10692 }
10693 }
10694 }
10695 else if (destination_entity && slot_id == -1)
10696 {
10697 if (quantity > stack_max)
10698 split_quantity_new = stack_max;
10699 else
10700 split_quantity_new = quantity;
10701
10703 {
10705 {
10708 }
10709
10710 if (new_item)
10711 {
10712 new_item.SetResultOfSplit(true);
10713 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10715 new_item.
SetQuantity(split_quantity_new,
false,
true);
10716 }
10717 }
10718 }
10719 else
10720 {
10721 if (stack_max != 0)
10722 {
10724 {
10726 }
10727
10729 {
10731
10732 if (new_item)
10733 {
10734 new_item.SetResultOfSplit(true);
10735 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10738 new_item.PlaceOnSurface();
10739 }
10740 }
10741 }
10742 }
10743 }
10744
10746 {
10748 {
10749 if (ScriptInputUserData.CanStoreInputUserData())
10750 {
10751 ScriptInputUserData ctx = new ScriptInputUserData;
10756 dst.WriteToContext(ctx);
10758 }
10759 }
10760 else if (!
GetGame().IsMultiplayer())
10761 {
10763 }
10764 }
10765
10767 {
10769 {
10770 if (ScriptInputUserData.CanStoreInputUserData())
10771 {
10772 ScriptInputUserData ctx = new ScriptInputUserData;
10777 ctx.
Write(destination_entity);
10783 }
10784 }
10785 else if (!
GetGame().IsMultiplayer())
10786 {
10788 }
10789 }
10790
10792 {
10794 }
10795
10797 {
10799 float split_quantity_new;
10801 if (dst.IsValid())
10802 {
10803 int slot_id = dst.GetSlot();
10805
10806 if (quantity > stack_max)
10807 split_quantity_new = stack_max;
10808 else
10809 split_quantity_new = quantity;
10810
10812 {
10814
10815 if (new_item)
10816 {
10817 new_item.SetResultOfSplit(true);
10818 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10820 new_item.
SetQuantity(split_quantity_new,
false,
true);
10821 }
10822
10823 return new_item;
10824 }
10825 }
10826
10827 return null;
10828 }
10829
10831 {
10833 float split_quantity_new;
10835 if (destination_entity)
10836 {
10838 if (quantity > stackable)
10839 split_quantity_new = stackable;
10840 else
10841 split_quantity_new = quantity;
10842
10844 {
10845 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10846 if (new_item)
10847 {
10848 new_item.SetResultOfSplit(true);
10849 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10851 new_item.
SetQuantity(split_quantity_new,
false,
true);
10852 }
10853 }
10854 }
10855 }
10856
10858 {
10860 {
10861 if (ScriptInputUserData.CanStoreInputUserData())
10862 {
10863 ScriptInputUserData ctx = new ScriptInputUserData;
10868 ItemBase destination_entity =
this;
10869 ctx.
Write(destination_entity);
10873 }
10874 }
10875 else if (!
GetGame().IsMultiplayer())
10876 {
10878 }
10879 }
10880
10882 {
10884 float split_quantity_new;
10886 if (player)
10887 {
10889 if (quantity > stackable)
10890 split_quantity_new = stackable;
10891 else
10892 split_quantity_new = quantity;
10893
10895 {
10896 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10897 new_item =
ItemBase.Cast(in_hands);
10898 if (new_item)
10899 {
10900 new_item.SetResultOfSplit(true);
10901 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10903 new_item.SetQuantity(split_quantity_new, false, true);
10904 }
10905 }
10906 }
10907 }
10908
10910 {
10912 float split_quantity_new = Math.Floor(quantity * 0.5);
10913
10915 return;
10916
10918
10919 if (new_item)
10920 {
10921 if (new_item.GetQuantityMax() < split_quantity_new)
10922 {
10923 split_quantity_new = new_item.GetQuantityMax();
10924 }
10925
10926 new_item.SetResultOfSplit(true);
10927 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10928
10930 {
10933 }
10934 else
10935 {
10937 new_item.
SetQuantity(split_quantity_new,
false,
true);
10938 }
10939 }
10940 }
10941
10943 {
10945 float split_quantity_new = Math.Floor(quantity / 2);
10946
10948 return;
10949
10950 InventoryLocation invloc = new InventoryLocation;
10952
10954 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10955
10956 if (new_item)
10957 {
10958 if (new_item.GetQuantityMax() < split_quantity_new)
10959 {
10960 split_quantity_new = new_item.GetQuantityMax();
10961 }
10963 {
10966 }
10967 else if (split_quantity_new > 1)
10968 {
10970 new_item.
SetQuantity(split_quantity_new,
false,
true);
10971 }
10972 }
10973 }
10974
10977 {
10978 SetWeightDirty();
10980
10981 if (parent)
10982 parent.OnAttachmentQuantityChangedEx(this, delta);
10983
10985 {
10987 {
10989 }
10991 {
10992 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10994 }
10995 }
10996
10997 }
10998
11001 {
11002
11003 }
11004
11007 {
11009 }
11010
11012 {
11013 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11014
11016 {
11017 if (newLevel == GameConstants.STATE_RUINED)
11018 {
11020 EntityAI parent = GetHierarchyParent();
11021 if (parent && parent.IsFireplace())
11022 {
11023 CargoBase cargo = GetInventory().GetCargo();
11024 if (cargo)
11025 {
11027 {
11029 }
11030 }
11031 }
11032 }
11033
11035 {
11036
11038 return;
11039 }
11040
11041 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11042 {
11044 }
11045 }
11046 }
11047
11048
11050 {
11051 super.OnRightClick();
11052
11054 {
11056 {
11057 if (ScriptInputUserData.CanStoreInputUserData())
11058 {
11059 EntityAI root = GetHierarchyRoot();
11060 Man playerOwner = GetHierarchyRootPlayer();
11061 InventoryLocation dst = new InventoryLocation;
11062
11063
11064 if (!playerOwner && root && root == this)
11065 {
11067 }
11068 else
11069 {
11070
11071 GetInventory().GetCurrentInventoryLocation(dst);
11073 {
11076 {
11078 }
11079 else
11080 {
11082
11083
11084 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11085 {
11087 }
11088 else
11089 {
11090 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11091 }
11092 }
11093 }
11094 }
11095
11096 ScriptInputUserData ctx = new ScriptInputUserData;
11104 }
11105 }
11106 else if (!
GetGame().IsMultiplayer())
11107 {
11109 }
11110 }
11111 }
11112
11114 {
11115 if (root)
11116 {
11117 vector m4[4];
11118 root.GetTransform(m4);
11119 dst.SetGround(this, m4);
11120 }
11121 else
11122 {
11123 GetInventory().GetCurrentInventoryLocation(dst);
11124 }
11125 }
11126
11127 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11128 {
11129
11130 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11131 return false;
11132
11133 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11134 return false;
11135
11136
11138 return false;
11139
11140
11141 Magazine mag = Magazine.Cast(this);
11142 if (mag)
11143 {
11144 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11145 return false;
11146
11147 if (stack_max_limit)
11148 {
11149 Magazine other_mag = Magazine.Cast(other_item);
11150 if (other_item)
11151 {
11152 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11153 return false;
11154 }
11155
11156 }
11157 }
11158 else
11159 {
11160
11162 return false;
11163
11165 return false;
11166 }
11167
11168 PlayerBase player = null;
11169 if (CastTo(player, GetHierarchyRootPlayer()))
11170 {
11171 if (player.GetInventory().HasAttachment(this))
11172 return false;
11173
11174 if (player.IsItemsToDelete())
11175 return false;
11176 }
11177
11178 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11179 return false;
11180
11181 int slotID;
11183 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11184 return false;
11185
11186 return true;
11187 }
11188
11190 {
11192 }
11193
11195 {
11196 return m_IsResultOfSplit;
11197 }
11198
11200 {
11201 m_IsResultOfSplit = value;
11202 }
11203
11205 {
11207 }
11208
11210 {
11211 float other_item_quantity = other_item.GetQuantity();
11212 float this_free_space;
11213
11215
11217
11218 if (other_item_quantity > this_free_space)
11219 {
11220 return this_free_space;
11221 }
11222 else
11223 {
11224 return other_item_quantity;
11225 }
11226 }
11227
11229 {
11231 }
11232
11234 {
11236 return;
11237
11238 if (!IsMagazine() && other_item)
11239 {
11241 if (quantity_used != 0)
11242 {
11243 float hp1 = GetHealth01("","");
11244 float hp2 = other_item.GetHealth01("","");
11245 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11246 hpResult = hpResult / (
GetQuantity() + quantity_used);
11247
11248 hpResult *= GetMaxHealth();
11249 Math.Round(hpResult);
11250 SetHealth("", "Health", hpResult);
11251
11253 other_item.AddQuantity(-quantity_used);
11254 }
11255 }
11257 }
11258
11260 {
11261 #ifdef SERVER
11262 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11263 GetHierarchyParent().IncreaseLifetimeUp();
11264 #endif
11265 };
11266
11268 {
11269 PlayerBase p = PlayerBase.Cast(player);
11270
11271 array<int> recipesIds = p.m_Recipes;
11272 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11273 if (moduleRecipesManager)
11274 {
11275 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11276 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11277 }
11278
11279 for (int i = 0;i < recipesIds.Count(); i++)
11280 {
11281 int key = recipesIds.Get(i);
11282 string recipeName = moduleRecipesManager.GetRecipeName(key);
11284 }
11285 }
11286
11287
11288 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11289 {
11290 super.GetDebugActions(outputList);
11291
11292
11298
11299
11304
11309
11310
11314
11315
11317 {
11321 }
11322
11325
11326
11330
11332
11333 InventoryLocation loc = new InventoryLocation();
11334 GetInventory().GetCurrentInventoryLocation(loc);
11336 {
11337 if (Gizmo_IsSupported())
11340 }
11341
11343 }
11344
11345
11346
11347
11349 {
11350 super.OnAction(action_id, player, ctx);
11351
11353 {
11354 switch (action_id)
11355 {
11358 return true;
11361 return true;
11362 }
11363 }
11364
11366 {
11367 switch (action_id)
11368 {
11370 Delete();
11371 return true;
11372 }
11373 }
11374
11375 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11376 {
11377 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11378 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11379 PlayerBase p = PlayerBase.Cast(player);
11380 if (
EActions.RECIPES_RANGE_START < 1000)
11381 {
11382 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11383 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11384 }
11385 }
11386 #ifndef SERVER
11387 else if (action_id ==
EActions.WATCH_PLAYER)
11388 {
11389 PluginDeveloper.SetDeveloperItemClientEx(player);
11390 }
11391 #endif
11393 {
11394 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11395 {
11396 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11397 OnDebugButtonPressServer(id + 1);
11398 }
11399
11400 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11401 {
11402 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11404 }
11405
11406 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11407 {
11408 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11410 }
11411
11412 else if (action_id ==
EActions.ADD_QUANTITY)
11413 {
11414 if (IsMagazine())
11415 {
11416 Magazine mag = Magazine.Cast(this);
11417 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11418 }
11419 else
11420 {
11422 }
11423
11424 if (m_EM)
11425 {
11426 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11427 }
11428
11429 }
11430
11431 else if (action_id ==
EActions.REMOVE_QUANTITY)
11432 {
11433 if (IsMagazine())
11434 {
11435 Magazine mag2 = Magazine.Cast(this);
11436 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11437 }
11438 else
11439 {
11441 }
11442 if (m_EM)
11443 {
11444 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11445 }
11446
11447 }
11448
11449 else if (action_id ==
EActions.SET_QUANTITY_0)
11450 {
11452
11453 if (m_EM)
11454 {
11455 m_EM.SetEnergy(0);
11456 }
11457 }
11458
11459 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11460 {
11462
11463 if (m_EM)
11464 {
11465 m_EM.SetEnergy(m_EM.GetEnergyMax());
11466 }
11467 }
11468
11469 else if (action_id ==
EActions.ADD_HEALTH)
11470 {
11471 AddHealth("","",GetMaxHealth("","Health")/5);
11472 }
11473 else if (action_id ==
EActions.REMOVE_HEALTH)
11474 {
11475 AddHealth("","",-GetMaxHealth("","Health")/5);
11476 }
11477 else if (action_id ==
EActions.DESTROY_HEALTH)
11478 {
11479 SetHealth01("","",0);
11480 }
11481 else if (action_id ==
EActions.WATCH_ITEM)
11482 {
11484 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11485 #ifdef DEVELOPER
11486 SetDebugDeveloper_item(this);
11487 #endif
11488 }
11489
11490 else if (action_id ==
EActions.ADD_TEMPERATURE)
11491 {
11492 AddTemperature(20);
11493
11494 }
11495
11496 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11497 {
11498 AddTemperature(-20);
11499
11500 }
11501
11502 else if (action_id ==
EActions.FLIP_FROZEN)
11503 {
11504 SetFrozen(!GetIsFrozen());
11505
11506 }
11507
11508 else if (action_id ==
EActions.ADD_WETNESS)
11509 {
11511
11512 }
11513
11514 else if (action_id ==
EActions.REMOVE_WETNESS)
11515 {
11517
11518 }
11519
11520 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11521 {
11524
11525
11526 }
11527
11528 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11529 {
11532 }
11533
11534 else if (action_id ==
EActions.MAKE_SPECIAL)
11535 {
11536 auto debugParams = DebugSpawnParams.WithPlayer(player);
11537 OnDebugSpawnEx(debugParams);
11538 }
11539
11540 }
11541
11542
11543 return false;
11544 }
11545
11546
11547
11548
11552
11555
11556
11557
11559 {
11560 return false;
11561 }
11562
11563
11565 {
11566 return true;
11567 }
11568
11569
11571 {
11572 return true;
11573 }
11574
11575
11576
11578 {
11579 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11581 }
11582
11585 {
11586 return null;
11587 }
11588
11590 {
11591 return false;
11592 }
11593
11595 {
11596 return false;
11597 }
11598
11602
11603
11605 {
11606 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11607 return module_repairing.CanRepair(this, item_repair_kit);
11608 }
11609
11610
11611 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11612 {
11613 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11614 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11615 }
11616
11617
11619 {
11620
11621
11622
11623
11624
11625
11626
11627
11628 return 1;
11629 }
11630
11631
11632
11634 {
11636 }
11637
11638
11639
11641 {
11643 }
11644
11645
11654 {
11655 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11656
11657 if (player)
11658 {
11659 player.MessageStatus(text);
11660 }
11661 }
11662
11663
11672 {
11673 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11674
11675 if (player)
11676 {
11677 player.MessageAction(text);
11678 }
11679 }
11680
11681
11690 {
11691 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11692
11693 if (player)
11694 {
11695 player.MessageFriendly(text);
11696 }
11697 }
11698
11699
11708 {
11709 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11710
11711 if (player)
11712 {
11713 player.MessageImportant(text);
11714 }
11715 }
11716
11718 {
11719 return true;
11720 }
11721
11722
11723 override bool KindOf(
string tag)
11724 {
11725 bool found = false;
11726 string item_name = this.
GetType();
11729
11730 int array_size = item_tag_array.Count();
11731 for (int i = 0; i < array_size; i++)
11732 {
11733 if (item_tag_array.Get(i) == tag)
11734 {
11735 found = true;
11736 break;
11737 }
11738 }
11739 return found;
11740 }
11741
11742
11744 {
11745
11746 super.OnRPC(sender, rpc_type,ctx);
11747
11748
11749 switch (rpc_type)
11750 {
11751 #ifndef SERVER
11752 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11753 Param2<bool, string> p = new Param2<bool, string>(false, "");
11754
11756 return;
11757
11758 bool play = p.param1;
11759 string soundSet = p.param2;
11760
11761 if (play)
11762 {
11764 {
11766 {
11768 }
11769 }
11770 else
11771 {
11773 }
11774 }
11775 else
11776 {
11778 }
11779
11780 break;
11781 #endif
11782
11783 }
11784
11786 {
11788 }
11789 }
11790
11791
11792
11793
11795 {
11796 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11797 return plugin.GetID(
name);
11798 }
11799
11801 {
11802 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11803 return plugin.GetName(id);
11804 }
11805
11808 {
11809
11810
11811 int varFlags;
11812 if (!ctx.
Read(varFlags))
11813 return;
11814
11815 if (varFlags & ItemVariableFlags.FLOAT)
11816 {
11818 }
11819 }
11820
11822 {
11823
11824 super.SerializeNumericalVars(floats_out);
11825
11826
11827
11829 {
11831 }
11832
11834 {
11836 }
11837
11839 {
11841 }
11842
11844 {
11849 }
11850
11852 {
11854 }
11855 }
11856
11858 {
11859
11860 super.DeSerializeNumericalVars(floats);
11861
11862
11863 int index = 0;
11864 int mask = Math.Round(floats.Get(index));
11865
11866 index++;
11867
11869 {
11871 {
11873 }
11874 else
11875 {
11876 float quantity = floats.Get(index);
11877 SetQuantity(quantity,
true,
false,
false,
false);
11878 }
11879 index++;
11880 }
11881
11883 {
11884 float wet = floats.Get(index);
11886 index++;
11887 }
11888
11890 {
11891 int liquidtype = Math.Round(floats.Get(index));
11893 index++;
11894 }
11895
11897 {
11899 index++;
11901 index++;
11903 index++;
11905 index++;
11906 }
11907
11909 {
11910 int cleanness = Math.Round(floats.Get(index));
11912 index++;
11913 }
11914 }
11915
11917 {
11918 super.WriteVarsToCTX(ctx);
11919
11920
11922 {
11924 }
11925
11927 {
11929 }
11930
11932 {
11934 }
11935
11937 {
11938 int r,g,b,a;
11944 }
11945
11947 {
11949 }
11950 }
11951
11953 {
11954 if (!super.ReadVarsFromCTX(ctx,version))
11955 return false;
11956
11957 int intValue;
11958 float value;
11959
11960 if (version < 140)
11961 {
11962 if (!ctx.
Read(intValue))
11963 return false;
11964
11965 m_VariablesMask = intValue;
11966 }
11967
11969 {
11970 if (!ctx.
Read(value))
11971 return false;
11972
11974 {
11976 }
11977 else
11978 {
11980 }
11981 }
11982
11983 if (version < 140)
11984 {
11986 {
11987 if (!ctx.
Read(value))
11988 return false;
11989 SetTemperatureDirect(value);
11990 }
11991 }
11992
11994 {
11995 if (!ctx.
Read(value))
11996 return false;
11998 }
11999
12001 {
12002 if (!ctx.
Read(intValue))
12003 return false;
12005 }
12006
12008 {
12009 int r,g,b,a;
12011 return false;
12013 return false;
12015 return false;
12017 return false;
12018
12020 }
12021
12023 {
12024 if (!ctx.
Read(intValue))
12025 return false;
12027 }
12028
12029 if (version >= 138 && version < 140)
12030 {
12032 {
12033 if (!ctx.
Read(intValue))
12034 return false;
12035 SetFrozen(intValue);
12036 }
12037 }
12038
12039 return true;
12040 }
12041
12042
12044 {
12047 {
12049 }
12050
12051 if (!super.OnStoreLoad(ctx, version))
12052 {
12054 return false;
12055 }
12056
12057 if (version >= 114)
12058 {
12059 bool hasQuickBarIndexSaved;
12060
12061 if (!ctx.
Read(hasQuickBarIndexSaved))
12062 {
12064 return false;
12065 }
12066
12067 if (hasQuickBarIndexSaved)
12068 {
12069 int itmQBIndex;
12070
12071
12072 if (!ctx.
Read(itmQBIndex))
12073 {
12075 return false;
12076 }
12077
12078 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12079 if (itmQBIndex != -1 && parentPlayer)
12080 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12081 }
12082 }
12083 else
12084 {
12085
12086 PlayerBase player;
12087 int itemQBIndex;
12088 if (version ==
int.
MAX)
12089 {
12090 if (!ctx.
Read(itemQBIndex))
12091 {
12093 return false;
12094 }
12095 }
12096 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12097 {
12098
12099 if (!ctx.
Read(itemQBIndex))
12100 {
12102 return false;
12103 }
12104 if (itemQBIndex != -1 && player)
12105 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12106 }
12107 }
12108
12109 if (version < 140)
12110 {
12111
12112 if (!LoadVariables(ctx, version))
12113 {
12115 return false;
12116 }
12117 }
12118
12119
12121 {
12123 return false;
12124 }
12125 if (version >= 132)
12126 {
12128 if (raib)
12129 {
12131 {
12133 return false;
12134 }
12135 }
12136 }
12137
12139 return true;
12140 }
12141
12142
12143
12145 {
12146 super.OnStoreSave(ctx);
12147
12148 PlayerBase player;
12149 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12150 {
12152
12153 int itemQBIndex = -1;
12154 itemQBIndex = player.FindQuickBarEntityIndex(this);
12155 ctx.
Write(itemQBIndex);
12156 }
12157 else
12158 {
12160 }
12161
12163
12165 if (raib)
12166 {
12168 }
12169 }
12170
12171
12173 {
12174 super.AfterStoreLoad();
12175
12177 {
12179 }
12180
12182 {
12185 }
12186 }
12187
12189 {
12190 super.EEOnAfterLoad();
12191
12193 {
12195 }
12196
12199 }
12200
12202 {
12203 return false;
12204 }
12205
12206
12207
12209 {
12211 {
12212 #ifdef PLATFORM_CONSOLE
12213
12215 {
12217 if (menu)
12218 {
12220 }
12221 }
12222 #endif
12223 }
12224
12226 {
12229 }
12230
12232 {
12233 SetWeightDirty();
12235 }
12237 {
12240 }
12241
12243 {
12246 }
12248 {
12251 }
12252
12253 super.OnVariablesSynchronized();
12254 }
12255
12256
12257
12259 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12260 {
12261 if (!IsServerCheck(allow_client))
12262 return false;
12263
12265 return false;
12266
12269
12270 if (value <= (min + 0.001))
12271 value = min;
12272
12273 if (value == min)
12274 {
12275 if (destroy_config)
12276 {
12277 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12278 if (dstr)
12279 {
12281 this.Delete();
12282 return true;
12283 }
12284 }
12285 else if (destroy_forced)
12286 {
12288 this.Delete();
12289 return true;
12290 }
12291
12293 }
12294
12297
12299 {
12301
12302 if (delta)
12304 }
12305
12307
12308 return false;
12309 }
12310
12311
12313 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12314 {
12316 }
12317
12319 {
12322 }
12323
12325 {
12328 }
12329
12331 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12332 {
12333 float value_clamped = Math.Clamp(value, 0, 1);
12335 SetQuantity(result, destroy_config, destroy_forced);
12336 }
12337
12338
12341 {
12343 }
12344
12346 {
12348 }
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12360 {
12361 int slot = -1;
12362 if (GetInventory())
12363 {
12364 InventoryLocation il = new InventoryLocation;
12365 GetInventory().GetCurrentInventoryLocation(il);
12367 }
12368
12370 }
12371
12373 {
12374 float quantity_max = 0;
12375
12377 {
12378 if (attSlotID != -1)
12379 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12380
12381 if (quantity_max <= 0)
12383 }
12384
12385 if (quantity_max <= 0)
12387
12388 return quantity_max;
12389 }
12390
12392 {
12394 }
12395
12397 {
12399 }
12400
12401
12403 {
12405 }
12406
12408 {
12410 }
12411
12413 {
12415 }
12416
12417
12419 {
12420
12421 float weightEx = GetWeightEx();
12422 float special = GetInventoryAndCargoWeight();
12423 return weightEx - special;
12424 }
12425
12426
12428 {
12430 }
12431
12433 {
12435 {
12436 #ifdef DEVELOPER
12437 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12438 {
12439 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12441 }
12442 #endif
12443
12444 return GetQuantity() * GetConfigWeightModified();
12445 }
12446 else if (HasEnergyManager())
12447 {
12448 #ifdef DEVELOPER
12449 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12450 {
12451 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12452 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12453 }
12454 #endif
12455 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12456 }
12457 else
12458 {
12459 #ifdef DEVELOPER
12460 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12461 {
12462 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12463 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12464 }
12465 #endif
12466 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12467 }
12468 }
12469
12472 {
12473 int item_count = 0;
12475
12476 if (GetInventory().GetCargo() != NULL)
12477 {
12478 item_count = GetInventory().GetCargo().GetItemCount();
12479 }
12480
12481 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12482 {
12483 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12484 if (item)
12485 item_count += item.GetNumberOfItems();
12486 }
12487 return item_count;
12488 }
12489
12492 {
12493 float weight = 0;
12494 float wetness = 1;
12495 if (include_wetness)
12498 {
12499 weight = wetness * m_ConfigWeight;
12500 }
12502 {
12503 weight = 1;
12504 }
12505 return weight;
12506 }
12507
12508
12509
12511 {
12512 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12513 {
12514 GameInventory inv = GetInventory();
12515 array<EntityAI> items = new array<EntityAI>;
12517 for (int i = 0; i < items.Count(); i++)
12518 {
12520 if (item)
12521 {
12523 }
12524 }
12525 }
12526 }
12527
12528
12529
12530
12532 {
12533 float energy = 0;
12534 if (HasEnergyManager())
12535 {
12536 energy = GetCompEM().GetEnergy();
12537 }
12538 return energy;
12539 }
12540
12541
12543 {
12544 super.OnEnergyConsumed();
12545
12547 }
12548
12550 {
12551 super.OnEnergyAdded();
12552
12554 }
12555
12556
12558 {
12559 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12560 {
12562 {
12563 float energy_0to1 = GetCompEM().GetEnergy0To1();
12565 }
12566 }
12567 }
12568
12569
12571 {
12572 return ConfigGetFloat("heatIsolation");
12573 }
12574
12576 {
12578 }
12579
12581 {
12582 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12583 if (
GetGame().ConfigIsExisting(paramPath))
12585
12586 return 0.0;
12587 }
12588
12590 {
12591 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12592 if (
GetGame().ConfigIsExisting(paramPath))
12594
12595 return 0.0;
12596 }
12597
12598 override void SetWet(
float value,
bool allow_client =
false)
12599 {
12600 if (!IsServerCheck(allow_client))
12601 return;
12602
12605
12607
12608 m_VarWet = Math.Clamp(value, min, max);
12609
12611 {
12614 }
12615 }
12616
12617 override void AddWet(
float value)
12618 {
12620 }
12621
12623 {
12625 }
12626
12628 {
12630 }
12631
12633 {
12635 }
12636
12638 {
12640 }
12641
12643 {
12645 }
12646
12647 override void OnWetChanged(
float newVal,
float oldVal)
12648 {
12651 if (newLevel != oldLevel)
12652 {
12654 }
12655 }
12656
12658 {
12659 SetWeightDirty();
12660 }
12661
12663 {
12664 return GetWetLevelInternal(
m_VarWet);
12665 }
12666
12667
12668
12670 {
12672 }
12673
12675 {
12677 }
12678
12680 {
12682 }
12683
12685 {
12687 }
12688
12689
12690
12692 {
12693 if (ConfigIsExisting("itemModelLength"))
12694 {
12695 return ConfigGetFloat("itemModelLength");
12696 }
12697 return 0;
12698 }
12699
12701 {
12702 if (ConfigIsExisting("itemAttachOffset"))
12703 {
12704 return ConfigGetFloat("itemAttachOffset");
12705 }
12706 return 0;
12707 }
12708
12709 override void SetCleanness(
int value,
bool allow_client =
false)
12710 {
12711 if (!IsServerCheck(allow_client))
12712 return;
12713
12715
12717
12720 }
12721
12723 {
12725 }
12726
12728 {
12729 return true;
12730 }
12731
12732
12733
12734
12736 {
12738 }
12739
12741 {
12743 }
12744
12745
12746
12747
12748 override void SetColor(
int r,
int g,
int b,
int a)
12749 {
12755 }
12757 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12758 {
12763 }
12764
12766 {
12768 }
12769
12772 {
12773 int r,g,b,a;
12775 r = r/255;
12776 g = g/255;
12777 b = b/255;
12778 a = a/255;
12779 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12780 }
12781
12782
12783
12784 override void SetLiquidType(
int value,
bool allow_client =
false)
12785 {
12786 if (!IsServerCheck(allow_client))
12787 return;
12788
12793 }
12794
12796 {
12797 return ConfigGetInt("varLiquidTypeInit");
12798 }
12799
12801 {
12803 }
12804
12806 {
12808 SetFrozen(false);
12809 }
12810
12813 {
12814 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12815 }
12816
12817
12820 {
12821 PlayerBase nplayer;
12822 if (PlayerBase.CastTo(nplayer, player))
12823 {
12825
12826 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12827 }
12828 }
12829
12830
12833 {
12834 PlayerBase nplayer;
12835 if (PlayerBase.CastTo(nplayer,player))
12836 {
12837
12838 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12839
12840 }
12841
12842
12843 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12844
12845
12846 if (HasEnergyManager())
12847 {
12848 GetCompEM().UpdatePlugState();
12849 }
12850 }
12851
12852
12854 {
12855 super.OnPlacementStarted(player);
12856
12858 }
12859
12860 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12861 {
12863 {
12864 m_AdminLog.OnPlacementComplete(player,
this);
12865 }
12866
12867 super.OnPlacementComplete(player, position, orientation);
12868 }
12869
12870
12871
12872
12873
12875 {
12877 {
12878 return true;
12879 }
12880 else
12881 {
12882 return false;
12883 }
12884 }
12885
12886
12888 {
12890 {
12892 }
12893 }
12894
12895
12897 {
12899 }
12900
12902 {
12904 }
12905
12906 override void InsertAgent(
int agent,
float count = 1)
12907 {
12908 if (count < 1)
12909 return;
12910
12912 }
12913
12916 {
12918 }
12919
12920
12922 {
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
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12968 {
12970 return false;
12971 return true;
12972 }
12973
12975 {
12976
12978 }
12979
12980
12983 {
12984 super.CheckForRoofLimited(timeTresholdMS);
12985
12987 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12988 {
12989 m_PreviousRoofTestTime = time;
12990 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12991 }
12992 }
12993
12994
12996 {
12998 {
12999 return 0;
13000 }
13001
13002 if (GetInventory().GetAttachmentSlotsCount() != 0)
13003 {
13004 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13005 if (filter)
13006 return filter.GetProtectionLevel(type, false, system);
13007 else
13008 return 0;
13009 }
13010
13011 string subclassPath, entryName;
13012
13013 switch (type)
13014 {
13016 entryName = "biological";
13017 break;
13019 entryName = "chemical";
13020 break;
13021 default:
13022 entryName = "biological";
13023 break;
13024 }
13025
13026 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13027
13029 }
13030
13031
13032
13035 {
13036 if (!IsMagazine())
13038
13040 }
13041
13042
13043
13044
13045
13050 {
13051 return true;
13052 }
13053
13055 {
13057 }
13058
13059
13060
13061
13062
13064 {
13065 if (parent)
13066 {
13067 if (parent.IsInherited(DayZInfected))
13068 return true;
13069
13070 if (!parent.IsRuined())
13071 return true;
13072 }
13073
13074 return true;
13075 }
13076
13078 {
13079 if (!super.CanPutAsAttachment(parent))
13080 {
13081 return false;
13082 }
13083
13084 if (!IsRuined() && !parent.IsRuined())
13085 {
13086 return true;
13087 }
13088
13089 return false;
13090 }
13091
13093 {
13094
13095
13096
13097
13098 return super.CanReceiveItemIntoCargo(item);
13099 }
13100
13102 {
13103
13104
13105
13106
13107 GameInventory attachmentInv = attachment.GetInventory();
13109 {
13110 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13111 return false;
13112 }
13113
13114 InventoryLocation loc = new InventoryLocation();
13115 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13116 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13117 return false;
13118
13119 return super.CanReceiveAttachment(attachment, slotId);
13120 }
13121
13123 {
13124 if (!super.CanReleaseAttachment(attachment))
13125 return false;
13126
13127 return GetInventory().AreChildrenAccessible();
13128 }
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13151 {
13152 int id = muzzle_owner.GetMuzzleID();
13153 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13154
13155 if (WPOF_array)
13156 {
13157 for (int i = 0; i < WPOF_array.Count(); i++)
13158 {
13159 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13160
13161 if (WPOF)
13162 {
13163 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13164 }
13165 }
13166 }
13167 }
13168
13169
13171 {
13172 int id = muzzle_owner.GetMuzzleID();
13174
13175 if (WPOBE_array)
13176 {
13177 for (int i = 0; i < WPOBE_array.Count(); i++)
13178 {
13179 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13180
13181 if (WPOBE)
13182 {
13183 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13184 }
13185 }
13186 }
13187 }
13188
13189
13191 {
13192 int id = muzzle_owner.GetMuzzleID();
13193 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13194
13195 if (WPOOH_array)
13196 {
13197 for (int i = 0; i < WPOOH_array.Count(); i++)
13198 {
13199 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13200
13201 if (WPOOH)
13202 {
13203 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13204 }
13205 }
13206 }
13207 }
13208
13209
13211 {
13212 int id = muzzle_owner.GetMuzzleID();
13213 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13214
13215 if (WPOOH_array)
13216 {
13217 for (int i = 0; i < WPOOH_array.Count(); i++)
13218 {
13219 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13220
13221 if (WPOOH)
13222 {
13223 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13224 }
13225 }
13226 }
13227 }
13228
13229
13231 {
13232 int id = muzzle_owner.GetMuzzleID();
13233 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13234
13235 if (WPOOH_array)
13236 {
13237 for (int i = 0; i < WPOOH_array.Count(); i++)
13238 {
13239 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13240
13241 if (WPOOH)
13242 {
13243 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13244 }
13245 }
13246 }
13247 }
13248
13249
13250
13252 {
13254 {
13255 return true;
13256 }
13257
13258 return false;
13259 }
13260
13262 {
13264 {
13265 return true;
13266 }
13267
13268 return false;
13269 }
13270
13272 {
13274 {
13275 return true;
13276 }
13277
13278 return false;
13279 }
13280
13282 {
13283 return false;
13284 }
13285
13288 {
13289 return UATimeSpent.DEFAULT_DEPLOY;
13290 }
13291
13292
13293
13294
13296 {
13298 SetSynchDirty();
13299 }
13300
13302 {
13304 }
13305
13306
13308 {
13309 return false;
13310 }
13311
13314 {
13315 string att_type = "None";
13316
13317 if (ConfigIsExisting("soundAttType"))
13318 {
13319 att_type = ConfigGetString("soundAttType");
13320 }
13321
13323 }
13324
13326 {
13328 }
13329
13330
13331
13332
13333
13339
13341 {
13344
13346 }
13347
13348
13350 {
13352 return;
13353
13355
13358
13361
13362 SoundParameters params = new SoundParameters();
13366 }
13367
13368
13370 {
13372 return;
13373
13375 SetSynchDirty();
13376
13379 }
13380
13381
13383 {
13385 return;
13386
13388 SetSynchDirty();
13389
13392 }
13393
13395 {
13397 }
13398
13400 {
13402 }
13403
13406 {
13407 if (!
GetGame().IsDedicatedServer())
13408 {
13409 if (ConfigIsExisting("attachSoundSet"))
13410 {
13411 string cfg_path = "";
13412 string soundset = "";
13413 string type_name =
GetType();
13414
13417 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13418 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13419
13420 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13421 {
13422 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13423 {
13424 if (cfg_slot_array[i] == slot_type)
13425 {
13426 soundset = cfg_soundset_array[i];
13427 break;
13428 }
13429 }
13430 }
13431
13432 if (soundset != "")
13433 {
13434 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13436 }
13437 }
13438 }
13439 }
13440
13442 {
13443
13444 }
13445
13446 void OnApply(PlayerBase player);
13447
13449 {
13450 return 1.0;
13451 };
13452
13454 {
13456 }
13457
13459 {
13461 }
13462
13464
13466 {
13467 SetDynamicPhysicsLifeTime(0.01);
13469 }
13470
13472 {
13473 array<string> zone_names = new array<string>;
13474 GetDamageZones(zone_names);
13475 for (int i = 0; i < zone_names.Count(); i++)
13476 {
13477 SetHealthMax(zone_names.Get(i),"Health");
13478 }
13479 SetHealthMax("","Health");
13480 }
13481
13484 {
13485 float global_health = GetHealth01("","Health");
13486 array<string> zones = new array<string>;
13487 GetDamageZones(zones);
13488
13489 for (int i = 0; i < zones.Count(); i++)
13490 {
13491 SetHealth01(zones.Get(i),"Health",global_health);
13492 }
13493 }
13494
13497 {
13498 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13499 }
13500
13502 {
13503 if (!hasRootAsPlayer)
13504 {
13505 if (refParentIB)
13506 {
13507
13508 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13509 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13510
13511 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13512 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13513
13516 }
13517 else
13518 {
13519
13522 }
13523 }
13524 }
13525
13527 {
13529 {
13530 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13531 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13532 {
13533 float heatPermCoef = 1.0;
13535 while (ent)
13536 {
13537 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13538 ent = ent.GetHierarchyParent();
13539 }
13540
13541 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13542 }
13543 }
13544 }
13545
13547 {
13548
13549 EntityAI parent = GetHierarchyParent();
13550 if (!parent)
13551 {
13552 hasParent = false;
13553 hasRootAsPlayer = false;
13554 }
13555 else
13556 {
13557 hasParent = true;
13558 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13559 refParentIB =
ItemBase.Cast(parent);
13560 }
13561 }
13562
13563 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13564 {
13565
13566 }
13567
13569 {
13570
13571 return false;
13572 }
13573
13575 {
13576
13577
13578 return false;
13579 }
13580
13582 {
13583
13584 return false;
13585 }
13586
13589 {
13590 return !GetIsFrozen() &&
IsOpen();
13591 }
13592
13594 {
13595 bool hasParent = false, hasRootAsPlayer = false;
13597
13598 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13599 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13600
13601 if (wwtu || foodDecay)
13602 {
13606
13607 if (processWetness || processTemperature || processDecay)
13608 {
13610
13611 if (processWetness)
13612 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13613
13614 if (processTemperature)
13616
13617 if (processDecay)
13618 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13619 }
13620 }
13621 }
13622
13625 {
13627 }
13628
13630 {
13633
13634 return super.GetTemperatureFreezeThreshold();
13635 }
13636
13638 {
13641
13642 return super.GetTemperatureThawThreshold();
13643 }
13644
13646 {
13649
13650 return super.GetItemOverheatThreshold();
13651 }
13652
13654 {
13656 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13657
13658 return super.GetTemperatureFreezeTime();
13659 }
13660
13662 {
13664 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13665
13666 return super.GetTemperatureThawTime();
13667 }
13668
13673
13675 {
13676 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13677 }
13678
13680 {
13681 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13682 }
13683
13686 {
13688 }
13689
13691 {
13693 }
13694
13696 {
13698 }
13699
13702 {
13703 return null;
13704 }
13705
13708 {
13709 return false;
13710 }
13711
13713 {
13715 {
13718 if (!trg)
13719 {
13721 explosive = this;
13722 }
13723
13724 explosive.PairRemote(trg);
13726
13727 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13728 trg.SetPersistentPairID(persistentID);
13729 explosive.SetPersistentPairID(persistentID);
13730
13731 return true;
13732 }
13733 return false;
13734 }
13735
13738 {
13739 float ret = 1.0;
13742 ret *= GetHealth01();
13743
13744 return ret;
13745 }
13746
13747 #ifdef DEVELOPER
13748 override void SetDebugItem()
13749 {
13750 super.SetDebugItem();
13751 _itemBase = this;
13752 }
13753
13755 {
13756 string text = super.GetDebugText();
13757
13759 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13760
13761 return text;
13762 }
13763 #endif
13764
13766 {
13767 return true;
13768 }
13769
13771
13773
13775 {
13778 }
13779
13780
13788
13804}
13805
13807{
13809 if (entity)
13810 {
13811 bool is_item = entity.IsInherited(
ItemBase);
13812 if (is_item && full_quantity)
13813 {
13816 }
13817 }
13818 else
13819 {
13821 return NULL;
13822 }
13823 return entity;
13824}
13825
13827{
13828 if (item)
13829 {
13830 if (health > 0)
13831 item.SetHealth("", "", health);
13832
13833 if (item.CanHaveTemperature())
13834 {
13836 if (item.CanFreeze())
13837 item.SetFrozen(false);
13838 }
13839
13840 if (item.HasEnergyManager())
13841 {
13842 if (quantity >= 0)
13843 {
13844 item.GetCompEM().SetEnergy0To1(quantity);
13845 }
13846 else
13847 {
13849 }
13850 }
13851 else if (item.IsMagazine())
13852 {
13853 Magazine mag = Magazine.Cast(item);
13854 if (quantity >= 0)
13855 {
13856 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13857 }
13858 else
13859 {
13861 }
13862
13863 }
13864 else
13865 {
13866 if (quantity >= 0)
13867 {
13868 item.SetQuantityNormalized(quantity, false);
13869 }
13870 else
13871 {
13873 }
13874
13875 }
13876 }
13877}
13878
13879#ifdef DEVELOPER
13881#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
Open
Implementations only.
override void EEOnCECreate()
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 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)
bool ShouldSplitQuantity(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)
override 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...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
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()
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)
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 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 void GizmoSelectObject(Object object)
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 native void GizmoSelectPhysics(Physics physics)
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
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 string GetFoldSoundset()
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 string GetLoopFoldSoundset()
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.