8867{
8869 {
8870 return true;
8871 }
8872};
8873
8874
8875
8877{
8881
8883
8886
8887
8888
8889
8890
8899
8905
8910
8915
8936 protected bool m_IsResultOfSplit
8937
8939
8944
8945
8946
8948
8952
8953
8954
8956
8959
8960
8961
8967
8968
8976
8979
8980
8982
8983
8985
8986
8991
8992
8997
8998
9000
9001
9003 {
9008
9009 if (!
GetGame().IsDedicatedServer())
9010 {
9012 {
9014
9016 {
9018 }
9019 }
9020
9023 }
9024
9025 m_OldLocation = null;
9026
9028 {
9030 }
9031
9032 if (ConfigIsExisting("headSelectionsToHide"))
9033 {
9036 }
9037
9039 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9040 {
9042 }
9043
9045
9046 m_IsResultOfSplit = false;
9047
9049 }
9050
9052 {
9053 super.InitItemVariables();
9054
9060 m_Count = ConfigGetInt(
"count");
9061
9064
9069
9072
9077
9089
9093
9094
9097 if (ConfigIsExisting("canBeSplit"))
9098 {
9101 }
9102
9104 if (ConfigIsExisting("itemBehaviour"))
9106
9107
9110 RegisterNetSyncVariableInt("m_VarLiquidType");
9111 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9112
9113 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9114 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9115 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9116
9117 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9118 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9119 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9120 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9121
9122 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9123 RegisterNetSyncVariableBool("m_IsTakeable");
9124 RegisterNetSyncVariableBool("m_IsHologram");
9125
9128 {
9131 }
9132
9134
9136 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9138
9139 }
9140
9142 {
9144 }
9145
9147 {
9150 {
9155 }
9156 }
9157
9158 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9159 {
9161 {
9164 }
9165
9167 }
9168
9170 {
9176 }
9177
9179
9181 {
9183
9184 if (!action)
9185 {
9186 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9187 return;
9188 }
9189
9191 if (!ai)
9192 {
9194 return;
9195 }
9196
9198 if (!action_array)
9199 {
9200 action_array = new array<ActionBase_Basic>;
9202 }
9203 if (LogManager.IsActionLogEnable())
9204 {
9205 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9206 }
9207
9208 if (action_array.Find(action) != -1)
9209 {
9210 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9211 }
9212 else
9213 {
9214 action_array.Insert(action);
9215 }
9216 }
9217
9219 {
9221 ActionBase action = player.GetActionManager().GetAction(actionName);
9224
9225 if (action_array)
9226 {
9227 action_array.RemoveItem(action);
9228 }
9229 }
9230
9231
9232
9234 {
9235 ActionOverrideData overrideData = new ActionOverrideData();
9239
9241 if (!actionMap)
9242 {
9245 }
9246
9247 actionMap.Insert(this.
Type(), overrideData);
9248
9249 }
9250
9252
9254
9255
9257 {
9260
9263
9264 string config_to_search = "CfgVehicles";
9265 string muzzle_owner_config;
9266
9268 {
9269 if (IsInherited(Weapon))
9270 config_to_search = "CfgWeapons";
9271
9272 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9273
9274 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9275
9277
9278 if (config_OnFire_subclass_count > 0)
9279 {
9280 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9281
9282 for (int i = 0; i < config_OnFire_subclass_count; i++)
9283 {
9284 string particle_class = "";
9286 string config_OnFire_entry = config_OnFire_class + particle_class;
9287 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9288 WPOF_array.Insert(WPOF);
9289 }
9290
9291
9293 }
9294 }
9295
9297 {
9298 config_to_search = "CfgWeapons";
9299 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9300
9301 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9302
9304
9305 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9306 {
9307 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9308
9309 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9310 {
9311 string particle_class2 = "";
9313 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9314 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9315 WPOBE_array.Insert(WPOBE);
9316 }
9317
9318
9320 }
9321 }
9322 }
9323
9324
9326 {
9329
9331 {
9332 string config_to_search = "CfgVehicles";
9333
9334 if (IsInherited(Weapon))
9335 config_to_search = "CfgWeapons";
9336
9337 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9338 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9339
9340 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9341 {
9342
9344
9346 {
9348 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9350 return;
9351 }
9352
9355
9356
9357
9359 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9360
9361 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9362 {
9363 string particle_class = "";
9365 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9367
9368 if (entry_type == CT_CLASS)
9369 {
9370 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9371 WPOOH_array.Insert(WPOF);
9372 }
9373 }
9374
9375
9377 }
9378 }
9379 }
9380
9382 {
9384 }
9385
9387 {
9389 {
9391
9394
9397
9398 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9399 }
9400 }
9401
9403 {
9405 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9406
9408 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9409
9411 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9412
9414 {
9416 }
9417 }
9418
9420 {
9422 }
9423
9425 {
9428 else
9430
9432 {
9435 }
9436 else
9437 {
9440
9443 }
9444
9446 }
9447
9449 {
9451 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9452 }
9453
9455 {
9457 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9459 }
9460
9462 {
9464 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9465 }
9466
9468 {
9471
9472 OverheatingParticle OP = new OverheatingParticle();
9477
9479 }
9480
9482 {
9485
9486 return -1;
9487 }
9488
9490 {
9492 {
9495
9496 for (int i = count; i > 0; --i)
9497 {
9498 int id = i - 1;
9501
9504
9505 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9506 {
9507 if (p)
9508 {
9511 }
9512 }
9513 }
9514 }
9515 }
9516
9518 {
9520 {
9522 {
9523 int id = i - 1;
9525
9526 if (OP)
9527 {
9529
9530 if (p)
9531 {
9533 }
9534
9535 delete OP;
9536 }
9537 }
9538
9541 }
9542 }
9543
9546 {
9547 return 0.0;
9548 }
9549
9550
9552 {
9553 return 250;
9554 }
9555
9557 {
9558 return 0;
9559 }
9560
9563 {
9565 return true;
9566
9567 return false;
9568 }
9569
9572 {
9575
9577 {
9579 }
9580 else
9581 {
9582
9584 }
9585
9587 }
9588
9595 {
9596 return -1;
9597 }
9598
9599
9600
9601
9603 {
9605 {
9607 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9608
9609 if (r_index >= 0)
9610 {
9611 InventoryLocation r_il = new InventoryLocation;
9612 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9613
9614 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9617 {
9618 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9619 }
9621 {
9622 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9623 }
9624
9625 }
9626
9627 player.GetHumanInventory().ClearUserReservedLocation(this);
9628 }
9629
9632 }
9633
9634
9635
9636
9638 {
9639 return ItemBase.m_DebugActionsMask;
9640 }
9641
9643 {
9644 return ItemBase.m_DebugActionsMask & mask;
9645 }
9646
9648 {
9649 ItemBase.m_DebugActionsMask = mask;
9650 }
9651
9653 {
9654 ItemBase.m_DebugActionsMask |= mask;
9655 }
9656
9658 {
9659 ItemBase.m_DebugActionsMask &= ~mask;
9660 }
9661
9663 {
9665 {
9667 }
9668 else
9669 {
9671 }
9672 }
9673
9674
9676 {
9677 if (GetEconomyProfile())
9678 {
9679 float q_max = GetEconomyProfile().GetQuantityMax();
9680 if (q_max > 0)
9681 {
9682 float q_min = GetEconomyProfile().GetQuantityMin();
9683 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9684
9686 {
9687 ComponentEnergyManager comp = GetCompEM();
9689 {
9691 }
9692 }
9694 {
9696
9697 }
9698
9699 }
9700 }
9701 }
9702
9705 {
9706 EntityAI parent = GetHierarchyParent();
9707
9708 if (parent)
9709 {
9710 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9711 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9712 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9713 }
9714 }
9715
9718 {
9719 EntityAI parent = GetHierarchyParent();
9720
9721 if (parent)
9722 {
9723 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9724 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9725 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9726 }
9727 }
9728
9730 {
9731
9732
9733
9734
9736
9738 {
9739 if (ScriptInputUserData.CanStoreInputUserData())
9740 {
9741 ScriptInputUserData ctx = new ScriptInputUserData;
9747 ctx.
Write(use_stack_max);
9750
9752 {
9753 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9754 }
9755 }
9756 }
9757 else if (!
GetGame().IsMultiplayer())
9758 {
9760 }
9761 }
9762
9764 {
9766 }
9767
9769 {
9771 }
9772
9774 {
9776 }
9777
9779 {
9780
9781 return false;
9782 }
9783
9785 {
9786 return false;
9787 }
9788
9792 {
9793 return false;
9794 }
9795
9797 {
9798 return "";
9799 }
9800
9802
9804 {
9805 return false;
9806 }
9807
9809 {
9810 return true;
9811 }
9812
9813
9814
9816 {
9817 return true;
9818 }
9819
9821 {
9822 return true;
9823 }
9824
9826 {
9827 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9829 }
9830
9832 {
9834 }
9835
9837 {
9839 if (!is_being_placed)
9841 SetSynchDirty();
9842 }
9843
9844
9846
9848 {
9850 }
9851
9853 {
9855 }
9856
9858 {
9859 return 1;
9860 }
9861
9863 {
9864 return false;
9865 }
9866
9868 {
9870 SetSynchDirty();
9871 }
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9908 {
9909 super.OnMovedInsideCargo(container);
9910
9911 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9912 }
9913
9914 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9915 {
9916 super.EEItemLocationChanged(oldLoc,newLoc);
9917
9918 PlayerBase new_player = null;
9919 PlayerBase old_player = null;
9920
9921 if (newLoc.GetParent())
9922 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9923
9924 if (oldLoc.GetParent())
9925 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9926
9928 {
9929 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9930
9931 if (r_index >= 0)
9932 {
9933 InventoryLocation r_il = new InventoryLocation;
9934 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9935
9936 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9939 {
9940 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9941 }
9943 {
9944 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9945 }
9946
9947 }
9948 }
9949
9951 {
9952 if (new_player)
9953 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9954
9955 if (new_player == old_player)
9956 {
9957
9958 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9959 {
9961 {
9962 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9963 {
9964 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9965 }
9966 }
9967 else
9968 {
9969 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9970 }
9971 }
9972
9973 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9974 {
9975 int type = oldLoc.GetType();
9977 {
9978 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9979 }
9981 {
9982 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9983 }
9984 }
9985 if (!m_OldLocation)
9986 {
9987 m_OldLocation = new InventoryLocation;
9988 }
9989 m_OldLocation.Copy(oldLoc);
9990 }
9991 else
9992 {
9993 if (m_OldLocation)
9994 {
9995 m_OldLocation.Reset();
9996 }
9997 }
9998
10000 }
10001 else
10002 {
10003 if (new_player)
10004 {
10005 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10006 if (res_index >= 0)
10007 {
10008 InventoryLocation il = new InventoryLocation;
10009 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10011 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10014 {
10015 il.
GetParent().GetOnReleaseLock().Invoke(it);
10016 }
10018 {
10020 }
10021
10022 }
10023 }
10025 {
10026
10028 }
10029
10030 if (m_OldLocation)
10031 {
10032 m_OldLocation.Reset();
10033 }
10034 }
10035 }
10036
10037 override void EOnContact(IEntity other, Contact extra)
10038 {
10040 {
10041 int liquidType = -1;
10043 if (impactSpeed > 0.0)
10044 {
10046 #ifndef SERVER
10048 #else
10050 SetSynchDirty();
10051 #endif
10053 }
10054 }
10055
10056 #ifdef SERVER
10057 if (GetCompEM() && GetCompEM().IsPlugged())
10058 {
10059 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10060 GetCompEM().UnplugThis();
10061 }
10062 #endif
10063 }
10064
10066
10068 {
10070 }
10071
10073 {
10074
10075 }
10076
10078 {
10079 super.OnItemLocationChanged(old_owner, new_owner);
10080
10081 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10082 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10083
10084 if (!relatedPlayer && playerNew)
10085 relatedPlayer = playerNew;
10086
10087 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10088 {
10090 if (actionMgr)
10091 {
10092 ActionBase currentAction = actionMgr.GetRunningAction();
10093 if (currentAction)
10095 }
10096 }
10097
10098 Man ownerPlayerOld = null;
10099 Man ownerPlayerNew = null;
10100
10101 if (old_owner)
10102 {
10103 if (old_owner.
IsMan())
10104 {
10105 ownerPlayerOld = Man.Cast(old_owner);
10106 }
10107 else
10108 {
10109 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10110 }
10111 }
10112 else
10113 {
10115 {
10117
10118 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10119 {
10120 GetCompEM().UnplugThis();
10121 }
10122 }
10123 }
10124
10125 if (new_owner)
10126 {
10127 if (new_owner.
IsMan())
10128 {
10129 ownerPlayerNew = Man.Cast(new_owner);
10130 }
10131 else
10132 {
10133 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10134 }
10135 }
10136
10137 if (ownerPlayerOld != ownerPlayerNew)
10138 {
10139 if (ownerPlayerOld)
10140 {
10141 array<EntityAI> subItemsExit = new array<EntityAI>;
10143 for (int i = 0; i < subItemsExit.Count(); i++)
10144 {
10147 }
10148 }
10149
10150 if (ownerPlayerNew)
10151 {
10152 array<EntityAI> subItemsEnter = new array<EntityAI>;
10154 for (int j = 0; j < subItemsEnter.Count(); j++)
10155 {
10158 }
10159 }
10160 }
10161 else if (ownerPlayerNew != null)
10162 {
10163 PlayerBase nplayer;
10164 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10165 {
10166 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10168 for (int k = 0; k < subItemsUpdate.Count(); k++)
10169 {
10171 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10172 }
10173 }
10174 }
10175
10176 if (old_owner)
10177 old_owner.OnChildItemRemoved(this);
10178 if (new_owner)
10179 new_owner.OnChildItemReceived(this);
10180 }
10181
10182
10184 {
10185 super.EEDelete(parent);
10186 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10187 if (player)
10188 {
10190
10191 if (player.IsAlive())
10192 {
10193 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10194 if (r_index >= 0)
10195 {
10196 InventoryLocation r_il = new InventoryLocation;
10197 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10198
10199 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10202 {
10203 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10204 }
10206 {
10207 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10208 }
10209
10210 }
10211
10212 player.RemoveQuickBarEntityShortcut(this);
10213 }
10214 }
10215 }
10216
10218 {
10219 super.EEKilled(killer);
10220
10223 {
10224 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10225 {
10226 if (IsMagazine())
10227 {
10228 if (Magazine.Cast(this).GetAmmoCount() > 0)
10229 {
10231 }
10232 }
10233 else
10234 {
10236 }
10237 }
10238 }
10239 }
10240
10242 {
10243 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10244
10245 super.OnWasAttached(parent, slot_id);
10246
10249
10251 }
10252
10254 {
10255 super.OnWasDetached(parent, slot_id);
10256
10259 }
10260
10262 {
10263 int idx;
10266
10267 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10268 if (inventory_slots.Count() < 1)
10269 {
10270 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10271 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10272 }
10273 else
10274 {
10275 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10276 }
10277
10278 idx = inventory_slots.Find(slot);
10279 if (idx < 0)
10280 return "";
10281
10282 return attach_types.Get(idx);
10283 }
10284
10286 {
10287 int idx = -1;
10288 string slot;
10289
10292
10293 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10294 if (inventory_slots.Count() < 1)
10295 {
10296 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10297 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10298 }
10299 else
10300 {
10301 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10302 if (detach_types.Count() < 1)
10303 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10304 }
10305
10306 for (int i = 0; i < inventory_slots.Count(); i++)
10307 {
10308 slot = inventory_slots.Get(i);
10309 }
10310
10311 if (slot != "")
10312 {
10313 if (detach_types.Count() == 1)
10314 idx = 0;
10315 else
10316 idx = inventory_slots.Find(slot);
10317 }
10318 if (idx < 0)
10319 return "";
10320
10321 return detach_types.Get(idx);
10322 }
10323
10325 {
10326
10328
10329
10330 float min_time = 1;
10331 float max_time = 3;
10332 float delay = Math.RandomFloat(min_time, max_time);
10333
10334 explode_timer.Run(delay, this, "DoAmmoExplosion");
10335 }
10336
10338 {
10339 Magazine magazine = Magazine.Cast(this);
10340 int pop_sounds_count = 6;
10341 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10342
10343
10344 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10345 string sound_name = pop_sounds[ sound_idx ];
10347
10348
10349 magazine.ServerAddAmmoCount(-1);
10350
10351
10352 float min_temp_to_explode = 100;
10353
10354 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10355 {
10357 }
10358 }
10359
10360
10361 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10362 {
10363 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10364
10365 const int CHANCE_DAMAGE_CARGO = 4;
10366 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10367 const int CHANCE_DAMAGE_NOTHING = 2;
10368
10370 {
10371 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10372 int chances;
10373 int rnd;
10374
10375 if (GetInventory().GetCargo())
10376 {
10377 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10378 rnd = Math.RandomInt(0,chances);
10379
10380 if (rnd < CHANCE_DAMAGE_CARGO)
10381 {
10383 }
10384 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10385 {
10387 }
10388 }
10389 else
10390 {
10391 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10392 rnd = Math.RandomInt(0,chances);
10393
10394 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10395 {
10397 }
10398 }
10399 }
10400 }
10401
10403 {
10404 if (GetInventory().GetCargo())
10405 {
10406 int item_count = GetInventory().GetCargo().GetItemCount();
10407 if (item_count > 0)
10408 {
10409 int random_pick = Math.RandomInt(0, item_count);
10411 if (!item.IsExplosive())
10412 {
10413 item.AddHealth("","",damage);
10414 return true;
10415 }
10416 }
10417 }
10418 return false;
10419 }
10420
10422 {
10423 int attachment_count = GetInventory().AttachmentCount();
10424 if (attachment_count > 0)
10425 {
10426 int random_pick = Math.RandomInt(0, attachment_count);
10427 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10428 if (!attachment.IsExplosive())
10429 {
10430 attachment.AddHealth("","",damage);
10431 return true;
10432 }
10433 }
10434 return false;
10435 }
10436
10438 {
10440 }
10441
10443 {
10445 return GetInventory().CanRemoveEntity();
10446
10447 return false;
10448 }
10449
10451 {
10452
10454 return false;
10455
10456
10458 return false;
10459
10460
10461
10463 if (delta == 0)
10464 return false;
10465
10466
10467 return true;
10468 }
10469
10471 {
10473 {
10474 if (ScriptInputUserData.CanStoreInputUserData())
10475 {
10476 ScriptInputUserData ctx = new ScriptInputUserData;
10481 ctx.
Write(destination_entity);
10483 ctx.
Write(slot_id);
10485 }
10486 }
10487 else if (!
GetGame().IsMultiplayer())
10488 {
10490 }
10491 }
10492
10494 {
10495 float split_quantity_new;
10499 InventoryLocation loc = new InventoryLocation;
10500
10501 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10502 {
10504 split_quantity_new = stack_max;
10505 else
10507
10509 {
10510 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10511 if (new_item)
10512 {
10513 new_item.SetResultOfSplit(true);
10514 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10516 new_item.
SetQuantity(split_quantity_new,
false,
true);
10517 }
10518 }
10519 }
10520 else if (destination_entity && slot_id == -1)
10521 {
10522 if (quantity > stack_max)
10523 split_quantity_new = stack_max;
10524 else
10525 split_quantity_new = quantity;
10526
10528 {
10530 {
10533 }
10534
10535 if (new_item)
10536 {
10537 new_item.SetResultOfSplit(true);
10538 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10540 new_item.
SetQuantity(split_quantity_new,
false,
true);
10541 }
10542 }
10543 }
10544 else
10545 {
10546 if (stack_max != 0)
10547 {
10549 {
10551 }
10552
10553 if (split_quantity_new == 0)
10554 {
10555 if (!
GetGame().IsMultiplayer())
10556 player.PhysicalPredictiveDropItem(this);
10557 else
10558 player.ServerDropEntity(this);
10559 return;
10560 }
10561
10563 {
10565
10566 if (new_item)
10567 {
10568 new_item.SetResultOfSplit(true);
10569 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10572 new_item.PlaceOnSurface();
10573 }
10574 }
10575 }
10576 }
10577 }
10578
10580 {
10581 float split_quantity_new;
10585 InventoryLocation loc = new InventoryLocation;
10586
10587 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10588 {
10590 split_quantity_new = stack_max;
10591 else
10593
10595 {
10596 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10597 if (new_item)
10598 {
10599 new_item.SetResultOfSplit(true);
10600 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10602 new_item.
SetQuantity(split_quantity_new,
false,
true);
10603 }
10604 }
10605 }
10606 else if (destination_entity && slot_id == -1)
10607 {
10608 if (quantity > stack_max)
10609 split_quantity_new = stack_max;
10610 else
10611 split_quantity_new = quantity;
10612
10614 {
10616 {
10619 }
10620
10621 if (new_item)
10622 {
10623 new_item.SetResultOfSplit(true);
10624 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10626 new_item.
SetQuantity(split_quantity_new,
false,
true);
10627 }
10628 }
10629 }
10630 else
10631 {
10632 if (stack_max != 0)
10633 {
10635 {
10637 }
10638
10640 {
10642
10643 if (new_item)
10644 {
10645 new_item.SetResultOfSplit(true);
10646 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10649 new_item.PlaceOnSurface();
10650 }
10651 }
10652 }
10653 }
10654 }
10655
10657 {
10659 {
10660 if (ScriptInputUserData.CanStoreInputUserData())
10661 {
10662 ScriptInputUserData ctx = new ScriptInputUserData;
10667 dst.WriteToContext(ctx);
10669 }
10670 }
10671 else if (!
GetGame().IsMultiplayer())
10672 {
10674 }
10675 }
10676
10678 {
10680 {
10681 if (ScriptInputUserData.CanStoreInputUserData())
10682 {
10683 ScriptInputUserData ctx = new ScriptInputUserData;
10688 ctx.
Write(destination_entity);
10694 }
10695 }
10696 else if (!
GetGame().IsMultiplayer())
10697 {
10699 }
10700 }
10701
10703 {
10705 }
10706
10708 {
10710 float split_quantity_new;
10712 if (dst.IsValid())
10713 {
10714 int slot_id = dst.GetSlot();
10716
10717 if (quantity > stack_max)
10718 split_quantity_new = stack_max;
10719 else
10720 split_quantity_new = quantity;
10721
10723 {
10725
10726 if (new_item)
10727 {
10728 new_item.SetResultOfSplit(true);
10729 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10731 new_item.
SetQuantity(split_quantity_new,
false,
true);
10732 }
10733
10734 return new_item;
10735 }
10736 }
10737
10738 return null;
10739 }
10740
10742 {
10744 float split_quantity_new;
10746 if (destination_entity)
10747 {
10749 if (quantity > stackable)
10750 split_quantity_new = stackable;
10751 else
10752 split_quantity_new = quantity;
10753
10755 {
10756 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10757 if (new_item)
10758 {
10759 new_item.SetResultOfSplit(true);
10760 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10762 new_item.
SetQuantity(split_quantity_new,
false,
true);
10763 }
10764 }
10765 }
10766 }
10767
10769 {
10771 {
10772 if (ScriptInputUserData.CanStoreInputUserData())
10773 {
10774 ScriptInputUserData ctx = new ScriptInputUserData;
10779 ItemBase destination_entity =
this;
10780 ctx.
Write(destination_entity);
10784 }
10785 }
10786 else if (!
GetGame().IsMultiplayer())
10787 {
10789 }
10790 }
10791
10793 {
10795 float split_quantity_new;
10797 if (player)
10798 {
10800 if (quantity > stackable)
10801 split_quantity_new = stackable;
10802 else
10803 split_quantity_new = quantity;
10804
10806 {
10807 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10808 new_item =
ItemBase.Cast(in_hands);
10809 if (new_item)
10810 {
10811 new_item.SetResultOfSplit(true);
10812 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10814 new_item.SetQuantity(split_quantity_new, false, true);
10815 }
10816 }
10817 }
10818 }
10819
10821 {
10823 float split_quantity_new = Math.Floor(quantity * 0.5);
10824
10826 return;
10827
10829
10830 if (new_item)
10831 {
10832 if (new_item.GetQuantityMax() < split_quantity_new)
10833 {
10834 split_quantity_new = new_item.GetQuantityMax();
10835 }
10836
10837 new_item.SetResultOfSplit(true);
10838 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10839
10841 {
10844 }
10845 else
10846 {
10848 new_item.
SetQuantity(split_quantity_new,
false,
true);
10849 }
10850 }
10851 }
10852
10854 {
10856 float split_quantity_new = Math.Floor(quantity / 2);
10857
10859 return;
10860
10861 InventoryLocation invloc = new InventoryLocation;
10863
10865 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10866
10867 if (new_item)
10868 {
10869 if (new_item.GetQuantityMax() < split_quantity_new)
10870 {
10871 split_quantity_new = new_item.GetQuantityMax();
10872 }
10874 {
10877 }
10878 else if (split_quantity_new > 1)
10879 {
10881 new_item.
SetQuantity(split_quantity_new,
false,
true);
10882 }
10883 }
10884 }
10885
10888 {
10889 SetWeightDirty();
10891
10892 if (parent)
10893 parent.OnAttachmentQuantityChangedEx(this, delta);
10894
10896 {
10898 {
10900 }
10902 {
10903 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10905 }
10906 }
10907
10908 }
10909
10912 {
10913
10914 }
10915
10918 {
10920 }
10921
10923 {
10924 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10925
10927 {
10928 if (newLevel == GameConstants.STATE_RUINED)
10929 {
10931 EntityAI parent = GetHierarchyParent();
10932 if (parent && parent.IsFireplace())
10933 {
10934 CargoBase cargo = GetInventory().GetCargo();
10935 if (cargo)
10936 {
10938 {
10940 }
10941 }
10942 }
10943 }
10944
10946 {
10947
10949 return;
10950 }
10951
10952 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10953 {
10955 }
10956 }
10957 }
10958
10959
10961 {
10962 super.OnRightClick();
10963
10965 {
10967 {
10968 if (ScriptInputUserData.CanStoreInputUserData())
10969 {
10970 EntityAI root = GetHierarchyRoot();
10971 Man playerOwner = GetHierarchyRootPlayer();
10972 InventoryLocation dst = new InventoryLocation;
10973
10974
10975 if (!playerOwner && root && root == this)
10976 {
10978 }
10979 else
10980 {
10981
10982 GetInventory().GetCurrentInventoryLocation(dst);
10984 {
10987 {
10989 }
10990 else
10991 {
10993
10994
10995 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10996 {
10998 }
10999 else
11000 {
11001 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11002 }
11003 }
11004 }
11005 }
11006
11007 ScriptInputUserData ctx = new ScriptInputUserData;
11015 }
11016 }
11017 else if (!
GetGame().IsMultiplayer())
11018 {
11020 }
11021 }
11022 }
11023
11025 {
11026 if (root)
11027 {
11028 vector m4[4];
11029 root.GetTransform(m4);
11030 dst.SetGround(this, m4);
11031 }
11032 else
11033 {
11034 GetInventory().GetCurrentInventoryLocation(dst);
11035 }
11036 }
11037
11038 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11039 {
11040
11041 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11042 return false;
11043
11044 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11045 return false;
11046
11047
11049 return false;
11050
11051
11052 Magazine mag = Magazine.Cast(this);
11053 if (mag)
11054 {
11055 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11056 return false;
11057
11058 if (stack_max_limit)
11059 {
11060 Magazine other_mag = Magazine.Cast(other_item);
11061 if (other_item)
11062 {
11063 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11064 return false;
11065 }
11066
11067 }
11068 }
11069 else
11070 {
11071
11073 return false;
11074
11076 return false;
11077 }
11078
11079 PlayerBase player = null;
11080 if (CastTo(player, GetHierarchyRootPlayer()))
11081 {
11082 if (player.GetInventory().HasAttachment(this))
11083 return false;
11084
11085 if (player.IsItemsToDelete())
11086 return false;
11087 }
11088
11089 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11090 return false;
11091
11092 int slotID;
11094 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11095 return false;
11096
11097 return true;
11098 }
11099
11101 {
11103 }
11104
11106 {
11107 return m_IsResultOfSplit;
11108 }
11109
11111 {
11112 m_IsResultOfSplit = value;
11113 }
11114
11116 {
11118 }
11119
11121 {
11122 float other_item_quantity = other_item.GetQuantity();
11123 float this_free_space;
11124
11126
11128
11129 if (other_item_quantity > this_free_space)
11130 {
11131 return this_free_space;
11132 }
11133 else
11134 {
11135 return other_item_quantity;
11136 }
11137 }
11138
11140 {
11142 }
11143
11145 {
11147 return;
11148
11149 if (!IsMagazine() && other_item)
11150 {
11152 if (quantity_used != 0)
11153 {
11154 float hp1 = GetHealth01("","");
11155 float hp2 = other_item.GetHealth01("","");
11156 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11157 hpResult = hpResult / (
GetQuantity() + quantity_used);
11158
11159 hpResult *= GetMaxHealth();
11160 Math.Round(hpResult);
11161 SetHealth("", "Health", hpResult);
11162
11164 other_item.AddQuantity(-quantity_used);
11165 }
11166 }
11168 }
11169
11171 {
11172 #ifdef SERVER
11173 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11174 GetHierarchyParent().IncreaseLifetimeUp();
11175 #endif
11176 };
11177
11179 {
11180 PlayerBase p = PlayerBase.Cast(player);
11181
11182 array<int> recipesIds = p.m_Recipes;
11183 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11184 if (moduleRecipesManager)
11185 {
11186 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11187 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11188 }
11189
11190 for (int i = 0;i < recipesIds.Count(); i++)
11191 {
11192 int key = recipesIds.Get(i);
11193 string recipeName = moduleRecipesManager.GetRecipeName(key);
11195 }
11196 }
11197
11198
11199 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11200 {
11201 super.GetDebugActions(outputList);
11202
11203
11209
11210
11215
11220
11221
11225
11226
11228 {
11232 }
11233
11236
11237
11241
11243
11244 InventoryLocation loc = new InventoryLocation();
11245 GetInventory().GetCurrentInventoryLocation(loc);
11247 {
11248 if (Gizmo_IsSupported())
11251 }
11252
11254 }
11255
11256
11257
11258
11260 {
11261 super.OnAction(action_id, player, ctx);
11262
11264 {
11265 switch (action_id)
11266 {
11269 return true;
11272 return true;
11273 }
11274 }
11275
11277 {
11278 switch (action_id)
11279 {
11281 Delete();
11282 return true;
11283 }
11284 }
11285
11286 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11287 {
11288 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11289 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11290 PlayerBase p = PlayerBase.Cast(player);
11291 if (
EActions.RECIPES_RANGE_START < 1000)
11292 {
11293 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11294 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11295 }
11296 }
11297 #ifndef SERVER
11298 else if (action_id ==
EActions.WATCH_PLAYER)
11299 {
11300 PluginDeveloper.SetDeveloperItemClientEx(player);
11301 }
11302 #endif
11304 {
11305 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11306 {
11307 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11308 OnDebugButtonPressServer(id + 1);
11309 }
11310
11311 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11312 {
11313 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11315 }
11316
11317 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11318 {
11319 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11321 }
11322
11323 else if (action_id ==
EActions.ADD_QUANTITY)
11324 {
11325 if (IsMagazine())
11326 {
11327 Magazine mag = Magazine.Cast(this);
11328 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11329 }
11330 else
11331 {
11333 }
11334
11335 if (m_EM)
11336 {
11337 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11338 }
11339
11340 }
11341
11342 else if (action_id ==
EActions.REMOVE_QUANTITY)
11343 {
11344 if (IsMagazine())
11345 {
11346 Magazine mag2 = Magazine.Cast(this);
11347 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11348 }
11349 else
11350 {
11352 }
11353 if (m_EM)
11354 {
11355 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11356 }
11357
11358 }
11359
11360 else if (action_id ==
EActions.SET_QUANTITY_0)
11361 {
11363
11364 if (m_EM)
11365 {
11366 m_EM.SetEnergy(0);
11367 }
11368 }
11369
11370 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11371 {
11373
11374 if (m_EM)
11375 {
11376 m_EM.SetEnergy(m_EM.GetEnergyMax());
11377 }
11378 }
11379
11380 else if (action_id ==
EActions.ADD_HEALTH)
11381 {
11382 AddHealth("","",GetMaxHealth("","Health")/5);
11383 }
11384 else if (action_id ==
EActions.REMOVE_HEALTH)
11385 {
11386 AddHealth("","",-GetMaxHealth("","Health")/5);
11387 }
11388 else if (action_id ==
EActions.DESTROY_HEALTH)
11389 {
11390 SetHealth01("","",0);
11391 }
11392 else if (action_id ==
EActions.WATCH_ITEM)
11393 {
11395 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11396 #ifdef DEVELOPER
11397 SetDebugDeveloper_item(this);
11398 #endif
11399 }
11400
11401 else if (action_id ==
EActions.ADD_TEMPERATURE)
11402 {
11403 AddTemperature(20);
11404
11405 }
11406
11407 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11408 {
11409 AddTemperature(-20);
11410
11411 }
11412
11413 else if (action_id ==
EActions.FLIP_FROZEN)
11414 {
11415 SetFrozen(!GetIsFrozen());
11416
11417 }
11418
11419 else if (action_id ==
EActions.ADD_WETNESS)
11420 {
11422
11423 }
11424
11425 else if (action_id ==
EActions.REMOVE_WETNESS)
11426 {
11428
11429 }
11430
11431 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11432 {
11435
11436
11437 }
11438
11439 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11440 {
11443 }
11444
11445 else if (action_id ==
EActions.MAKE_SPECIAL)
11446 {
11447 auto debugParams = DebugSpawnParams.WithPlayer(player);
11448 OnDebugSpawnEx(debugParams);
11449 }
11450
11451 }
11452
11453
11454 return false;
11455 }
11456
11457
11458
11459
11463
11466
11467
11468
11470 {
11471 return false;
11472 }
11473
11474
11476 {
11477 return true;
11478 }
11479
11480
11482 {
11483 return true;
11484 }
11485
11486
11487
11489 {
11490 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11492 }
11493
11496 {
11497 return null;
11498 }
11499
11501 {
11502 return false;
11503 }
11504
11506 {
11507 return false;
11508 }
11509
11513
11514
11516 {
11517 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11518 return module_repairing.CanRepair(this, item_repair_kit);
11519 }
11520
11521
11522 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11523 {
11524 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11525 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11526 }
11527
11528
11530 {
11531
11532
11533
11534
11535
11536
11537
11538
11539 return 1;
11540 }
11541
11542
11543
11545 {
11547 }
11548
11549
11550
11552 {
11554 }
11555
11556
11565 {
11566 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11567
11568 if (player)
11569 {
11570 player.MessageStatus(text);
11571 }
11572 }
11573
11574
11583 {
11584 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11585
11586 if (player)
11587 {
11588 player.MessageAction(text);
11589 }
11590 }
11591
11592
11601 {
11602 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11603
11604 if (player)
11605 {
11606 player.MessageFriendly(text);
11607 }
11608 }
11609
11610
11619 {
11620 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11621
11622 if (player)
11623 {
11624 player.MessageImportant(text);
11625 }
11626 }
11627
11629 {
11630 return true;
11631 }
11632
11633
11634 override bool KindOf(
string tag)
11635 {
11636 bool found = false;
11637 string item_name = this.
GetType();
11640
11641 int array_size = item_tag_array.Count();
11642 for (int i = 0; i < array_size; i++)
11643 {
11644 if (item_tag_array.Get(i) == tag)
11645 {
11646 found = true;
11647 break;
11648 }
11649 }
11650 return found;
11651 }
11652
11653
11655 {
11656
11657 super.OnRPC(sender, rpc_type,ctx);
11658
11659
11660 switch (rpc_type)
11661 {
11662 #ifndef SERVER
11663 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11664 Param2<bool, string> p = new Param2<bool, string>(false, "");
11665
11667 return;
11668
11669 bool play = p.param1;
11670 string soundSet = p.param2;
11671
11672 if (play)
11673 {
11675 {
11677 {
11679 }
11680 }
11681 else
11682 {
11684 }
11685 }
11686 else
11687 {
11689 }
11690
11691 break;
11692 #endif
11693
11694 }
11695
11697 {
11699 }
11700 }
11701
11702
11703
11704
11706 {
11707 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11708 return plugin.GetID(
name);
11709 }
11710
11712 {
11713 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11714 return plugin.GetName(id);
11715 }
11716
11719 {
11720
11721
11722 int varFlags;
11723 if (!ctx.
Read(varFlags))
11724 return;
11725
11726 if (varFlags & ItemVariableFlags.FLOAT)
11727 {
11729 }
11730 }
11731
11733 {
11734
11735 super.SerializeNumericalVars(floats_out);
11736
11737
11738
11740 {
11742 }
11743
11745 {
11747 }
11748
11750 {
11752 }
11753
11755 {
11760 }
11761
11763 {
11765 }
11766 }
11767
11769 {
11770
11771 super.DeSerializeNumericalVars(floats);
11772
11773
11774 int index = 0;
11775 int mask = Math.Round(floats.Get(index));
11776
11777 index++;
11778
11780 {
11782 {
11784 }
11785 else
11786 {
11787 float quantity = floats.Get(index);
11788 SetQuantity(quantity,
true,
false,
false,
false);
11789 }
11790 index++;
11791 }
11792
11794 {
11795 float wet = floats.Get(index);
11797 index++;
11798 }
11799
11801 {
11802 int liquidtype = Math.Round(floats.Get(index));
11804 index++;
11805 }
11806
11808 {
11810 index++;
11812 index++;
11814 index++;
11816 index++;
11817 }
11818
11820 {
11821 int cleanness = Math.Round(floats.Get(index));
11823 index++;
11824 }
11825 }
11826
11828 {
11829 super.WriteVarsToCTX(ctx);
11830
11831
11833 {
11835 }
11836
11838 {
11840 }
11841
11843 {
11845 }
11846
11848 {
11849 int r,g,b,a;
11855 }
11856
11858 {
11860 }
11861 }
11862
11864 {
11865 if (!super.ReadVarsFromCTX(ctx,version))
11866 return false;
11867
11868 int intValue;
11869 float value;
11870
11871 if (version < 140)
11872 {
11873 if (!ctx.
Read(intValue))
11874 return false;
11875
11876 m_VariablesMask = intValue;
11877 }
11878
11880 {
11881 if (!ctx.
Read(value))
11882 return false;
11883
11885 {
11887 }
11888 else
11889 {
11891 }
11892 }
11893
11894 if (version < 140)
11895 {
11897 {
11898 if (!ctx.
Read(value))
11899 return false;
11900 SetTemperatureDirect(value);
11901 }
11902 }
11903
11905 {
11906 if (!ctx.
Read(value))
11907 return false;
11909 }
11910
11912 {
11913 if (!ctx.
Read(intValue))
11914 return false;
11916 }
11917
11919 {
11920 int r,g,b,a;
11922 return false;
11924 return false;
11926 return false;
11928 return false;
11929
11931 }
11932
11934 {
11935 if (!ctx.
Read(intValue))
11936 return false;
11938 }
11939
11940 if (version >= 138 && version < 140)
11941 {
11943 {
11944 if (!ctx.
Read(intValue))
11945 return false;
11946 SetFrozen(intValue);
11947 }
11948 }
11949
11950 return true;
11951 }
11952
11953
11955 {
11958 {
11960 }
11961
11962 if (!super.OnStoreLoad(ctx, version))
11963 {
11965 return false;
11966 }
11967
11968 if (version >= 114)
11969 {
11970 bool hasQuickBarIndexSaved;
11971
11972 if (!ctx.
Read(hasQuickBarIndexSaved))
11973 {
11975 return false;
11976 }
11977
11978 if (hasQuickBarIndexSaved)
11979 {
11980 int itmQBIndex;
11981
11982
11983 if (!ctx.
Read(itmQBIndex))
11984 {
11986 return false;
11987 }
11988
11989 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11990 if (itmQBIndex != -1 && parentPlayer)
11991 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11992 }
11993 }
11994 else
11995 {
11996
11997 PlayerBase player;
11998 int itemQBIndex;
11999 if (version ==
int.
MAX)
12000 {
12001 if (!ctx.
Read(itemQBIndex))
12002 {
12004 return false;
12005 }
12006 }
12007 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12008 {
12009
12010 if (!ctx.
Read(itemQBIndex))
12011 {
12013 return false;
12014 }
12015 if (itemQBIndex != -1 && player)
12016 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12017 }
12018 }
12019
12020 if (version < 140)
12021 {
12022
12023 if (!LoadVariables(ctx, version))
12024 {
12026 return false;
12027 }
12028 }
12029
12030
12032 {
12034 return false;
12035 }
12036 if (version >= 132)
12037 {
12039 if (raib)
12040 {
12042 {
12044 return false;
12045 }
12046 }
12047 }
12048
12050 return true;
12051 }
12052
12053
12054
12056 {
12057 super.OnStoreSave(ctx);
12058
12059 PlayerBase player;
12060 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12061 {
12063
12064 int itemQBIndex = -1;
12065 itemQBIndex = player.FindQuickBarEntityIndex(this);
12066 ctx.
Write(itemQBIndex);
12067 }
12068 else
12069 {
12071 }
12072
12074
12076 if (raib)
12077 {
12079 }
12080 }
12081
12082
12084 {
12085 super.AfterStoreLoad();
12086
12088 {
12090 }
12091
12093 {
12096 }
12097 }
12098
12100 {
12101 super.EEOnAfterLoad();
12102
12104 {
12106 }
12107
12110 }
12111
12113 {
12114 return false;
12115 }
12116
12117
12118
12120 {
12122 {
12123 #ifdef PLATFORM_CONSOLE
12124
12126 {
12128 if (menu)
12129 {
12131 }
12132 }
12133 #endif
12134 }
12135
12137 {
12140 }
12141
12143 {
12144 SetWeightDirty();
12146 }
12148 {
12151 }
12152
12154 {
12157 }
12159 {
12162 }
12163
12164 super.OnVariablesSynchronized();
12165 }
12166
12167
12168
12170 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12171 {
12172 if (!IsServerCheck(allow_client))
12173 return false;
12174
12176 return false;
12177
12180
12181 if (value <= (min + 0.001))
12182 value = min;
12183
12184 if (value == min)
12185 {
12186 if (destroy_config)
12187 {
12188 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12189 if (dstr)
12190 {
12192 this.Delete();
12193 return true;
12194 }
12195 }
12196 else if (destroy_forced)
12197 {
12199 this.Delete();
12200 return true;
12201 }
12202
12204 }
12205
12208
12210 {
12212
12213 if (delta)
12215 }
12216
12218
12219 return false;
12220 }
12221
12222
12224 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12225 {
12227 }
12228
12230 {
12233 }
12234
12236 {
12239 }
12240
12242 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12243 {
12244 float value_clamped = Math.Clamp(value, 0, 1);
12246 SetQuantity(result, destroy_config, destroy_forced);
12247 }
12248
12249
12252 {
12254 }
12255
12257 {
12259 }
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12271 {
12272 int slot = -1;
12273 if (GetInventory())
12274 {
12275 InventoryLocation il = new InventoryLocation;
12276 GetInventory().GetCurrentInventoryLocation(il);
12278 }
12279
12281 }
12282
12284 {
12285 float quantity_max = 0;
12286
12288 {
12289 if (attSlotID != -1)
12290 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12291
12292 if (quantity_max <= 0)
12294 }
12295
12296 if (quantity_max <= 0)
12298
12299 return quantity_max;
12300 }
12301
12303 {
12305 }
12306
12308 {
12310 }
12311
12312
12314 {
12316 }
12317
12319 {
12321 }
12322
12324 {
12326 }
12327
12328
12330 {
12331
12332 float weightEx = GetWeightEx();
12333 float special = GetInventoryAndCargoWeight();
12334 return weightEx - special;
12335 }
12336
12337
12339 {
12341 }
12342
12344 {
12346 {
12347 #ifdef DEVELOPER
12348 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12349 {
12350 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12352 }
12353 #endif
12354
12355 return GetQuantity() * GetConfigWeightModified();
12356 }
12357 else if (HasEnergyManager())
12358 {
12359 #ifdef DEVELOPER
12360 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12361 {
12362 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12363 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12364 }
12365 #endif
12366 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12367 }
12368 else
12369 {
12370 #ifdef DEVELOPER
12371 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12372 {
12373 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12374 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12375 }
12376 #endif
12377 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12378 }
12379 }
12380
12383 {
12384 int item_count = 0;
12386
12387 if (GetInventory().GetCargo() != NULL)
12388 {
12389 item_count = GetInventory().GetCargo().GetItemCount();
12390 }
12391
12392 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12393 {
12394 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12395 if (item)
12396 item_count += item.GetNumberOfItems();
12397 }
12398 return item_count;
12399 }
12400
12403 {
12404 float weight = 0;
12405 float wetness = 1;
12406 if (include_wetness)
12409 {
12410 weight = wetness * m_ConfigWeight;
12411 }
12413 {
12414 weight = 1;
12415 }
12416 return weight;
12417 }
12418
12419
12420
12422 {
12423 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12424 {
12425 GameInventory inv = GetInventory();
12426 array<EntityAI> items = new array<EntityAI>;
12428 for (int i = 0; i < items.Count(); i++)
12429 {
12431 if (item)
12432 {
12434 }
12435 }
12436 }
12437 }
12438
12439
12440
12441
12443 {
12444 float energy = 0;
12445 if (HasEnergyManager())
12446 {
12447 energy = GetCompEM().GetEnergy();
12448 }
12449 return energy;
12450 }
12451
12452
12454 {
12455 super.OnEnergyConsumed();
12456
12458 }
12459
12461 {
12462 super.OnEnergyAdded();
12463
12465 }
12466
12467
12469 {
12470 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12471 {
12473 {
12474 float energy_0to1 = GetCompEM().GetEnergy0To1();
12476 }
12477 }
12478 }
12479
12480
12482 {
12483 return ConfigGetFloat("heatIsolation");
12484 }
12485
12487 {
12489 }
12490
12492 {
12493 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12494 if (
GetGame().ConfigIsExisting(paramPath))
12496
12497 return 0.0;
12498 }
12499
12501 {
12502 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12503 if (
GetGame().ConfigIsExisting(paramPath))
12505
12506 return 0.0;
12507 }
12508
12509 override void SetWet(
float value,
bool allow_client =
false)
12510 {
12511 if (!IsServerCheck(allow_client))
12512 return;
12513
12516
12518
12519 m_VarWet = Math.Clamp(value, min, max);
12520
12522 {
12525 }
12526 }
12527
12528 override void AddWet(
float value)
12529 {
12531 }
12532
12534 {
12536 }
12537
12539 {
12541 }
12542
12544 {
12546 }
12547
12549 {
12551 }
12552
12554 {
12556 }
12557
12558 override void OnWetChanged(
float newVal,
float oldVal)
12559 {
12562 if (newLevel != oldLevel)
12563 {
12565 }
12566 }
12567
12569 {
12570 SetWeightDirty();
12571 }
12572
12574 {
12575 return GetWetLevelInternal(
m_VarWet);
12576 }
12577
12578
12579
12581 {
12583 }
12584
12586 {
12588 }
12589
12591 {
12593 }
12594
12596 {
12598 }
12599
12600
12601
12603 {
12604 if (ConfigIsExisting("itemModelLength"))
12605 {
12606 return ConfigGetFloat("itemModelLength");
12607 }
12608 return 0;
12609 }
12610
12612 {
12613 if (ConfigIsExisting("itemAttachOffset"))
12614 {
12615 return ConfigGetFloat("itemAttachOffset");
12616 }
12617 return 0;
12618 }
12619
12620 override void SetCleanness(
int value,
bool allow_client =
false)
12621 {
12622 if (!IsServerCheck(allow_client))
12623 return;
12624
12626
12628
12631 }
12632
12634 {
12636 }
12637
12639 {
12640 return true;
12641 }
12642
12643
12644
12645
12647 {
12649 }
12650
12652 {
12654 }
12655
12656
12657
12658
12659 override void SetColor(
int r,
int g,
int b,
int a)
12660 {
12666 }
12668 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12669 {
12674 }
12675
12677 {
12679 }
12680
12683 {
12684 int r,g,b,a;
12686 r = r/255;
12687 g = g/255;
12688 b = b/255;
12689 a = a/255;
12690 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12691 }
12692
12693
12694
12695 override void SetLiquidType(
int value,
bool allow_client =
false)
12696 {
12697 if (!IsServerCheck(allow_client))
12698 return;
12699
12704 }
12705
12707 {
12708 return ConfigGetInt("varLiquidTypeInit");
12709 }
12710
12712 {
12714 }
12715
12717 {
12719 SetFrozen(false);
12720 }
12721
12724 {
12725 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12726 }
12727
12728
12731 {
12732 PlayerBase nplayer;
12733 if (PlayerBase.CastTo(nplayer, player))
12734 {
12736
12737 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12738 }
12739 }
12740
12741
12744 {
12745 PlayerBase nplayer;
12746 if (PlayerBase.CastTo(nplayer,player))
12747 {
12748
12749 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12750
12751 }
12752
12753
12754 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12755
12756
12757 if (HasEnergyManager())
12758 {
12759 GetCompEM().UpdatePlugState();
12760 }
12761 }
12762
12763
12765 {
12766 super.OnPlacementStarted(player);
12767
12769 }
12770
12771 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12772 {
12774 {
12775 m_AdminLog.OnPlacementComplete(player,
this);
12776 }
12777
12778 super.OnPlacementComplete(player, position, orientation);
12779 }
12780
12781
12782
12783
12784
12786 {
12788 {
12789 return true;
12790 }
12791 else
12792 {
12793 return false;
12794 }
12795 }
12796
12797
12799 {
12801 {
12803 }
12804 }
12805
12806
12808 {
12810 }
12811
12813 {
12815 }
12816
12817 override void InsertAgent(
int agent,
float count = 1)
12818 {
12819 if (count < 1)
12820 return;
12821
12823 }
12824
12827 {
12829 }
12830
12831
12833 {
12835 }
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12879 {
12881 return false;
12882 return true;
12883 }
12884
12886 {
12887
12889 }
12890
12891
12894 {
12895 super.CheckForRoofLimited(timeTresholdMS);
12896
12898 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12899 {
12900 m_PreviousRoofTestTime = time;
12901 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12902 }
12903 }
12904
12905
12907 {
12909 {
12910 return 0;
12911 }
12912
12913 if (GetInventory().GetAttachmentSlotsCount() != 0)
12914 {
12915 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12916 if (filter)
12917 return filter.GetProtectionLevel(type, false, system);
12918 else
12919 return 0;
12920 }
12921
12922 string subclassPath, entryName;
12923
12924 switch (type)
12925 {
12927 entryName = "biological";
12928 break;
12930 entryName = "chemical";
12931 break;
12932 default:
12933 entryName = "biological";
12934 break;
12935 }
12936
12937 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12938
12940 }
12941
12942
12943
12946 {
12947 if (!IsMagazine())
12949
12951 }
12952
12953
12954
12955
12956
12961 {
12962 return true;
12963 }
12964
12966 {
12968 }
12969
12970
12971
12972
12973
12975 {
12976 if (parent)
12977 {
12978 if (parent.IsInherited(DayZInfected))
12979 return true;
12980
12981 if (!parent.IsRuined())
12982 return true;
12983 }
12984
12985 return true;
12986 }
12987
12989 {
12990 if (!super.CanPutAsAttachment(parent))
12991 {
12992 return false;
12993 }
12994
12995 if (!IsRuined() && !parent.IsRuined())
12996 {
12997 return true;
12998 }
12999
13000 return false;
13001 }
13002
13004 {
13005
13006
13007
13008
13009 return super.CanReceiveItemIntoCargo(item);
13010 }
13011
13013 {
13014
13015
13016
13017
13018 GameInventory attachmentInv = attachment.GetInventory();
13020 {
13021 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13022 return false;
13023 }
13024
13025 InventoryLocation loc = new InventoryLocation();
13026 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13027 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13028 return false;
13029
13030 return super.CanReceiveAttachment(attachment, slotId);
13031 }
13032
13034 {
13035 if (!super.CanReleaseAttachment(attachment))
13036 return false;
13037
13038 return GetInventory().AreChildrenAccessible();
13039 }
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13062 {
13063 int id = muzzle_owner.GetMuzzleID();
13064 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13065
13066 if (WPOF_array)
13067 {
13068 for (int i = 0; i < WPOF_array.Count(); i++)
13069 {
13070 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13071
13072 if (WPOF)
13073 {
13074 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13075 }
13076 }
13077 }
13078 }
13079
13080
13082 {
13083 int id = muzzle_owner.GetMuzzleID();
13085
13086 if (WPOBE_array)
13087 {
13088 for (int i = 0; i < WPOBE_array.Count(); i++)
13089 {
13090 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13091
13092 if (WPOBE)
13093 {
13094 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13095 }
13096 }
13097 }
13098 }
13099
13100
13102 {
13103 int id = muzzle_owner.GetMuzzleID();
13104 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13105
13106 if (WPOOH_array)
13107 {
13108 for (int i = 0; i < WPOOH_array.Count(); i++)
13109 {
13110 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13111
13112 if (WPOOH)
13113 {
13114 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13115 }
13116 }
13117 }
13118 }
13119
13120
13122 {
13123 int id = muzzle_owner.GetMuzzleID();
13124 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13125
13126 if (WPOOH_array)
13127 {
13128 for (int i = 0; i < WPOOH_array.Count(); i++)
13129 {
13130 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13131
13132 if (WPOOH)
13133 {
13134 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13135 }
13136 }
13137 }
13138 }
13139
13140
13142 {
13143 int id = muzzle_owner.GetMuzzleID();
13144 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13145
13146 if (WPOOH_array)
13147 {
13148 for (int i = 0; i < WPOOH_array.Count(); i++)
13149 {
13150 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13151
13152 if (WPOOH)
13153 {
13154 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13155 }
13156 }
13157 }
13158 }
13159
13160
13161
13163 {
13165 {
13166 return true;
13167 }
13168
13169 return false;
13170 }
13171
13173 {
13175 {
13176 return true;
13177 }
13178
13179 return false;
13180 }
13181
13183 {
13185 {
13186 return true;
13187 }
13188
13189 return false;
13190 }
13191
13193 {
13194 return false;
13195 }
13196
13199 {
13200 return UATimeSpent.DEFAULT_DEPLOY;
13201 }
13202
13203
13204
13205
13207 {
13209 SetSynchDirty();
13210 }
13211
13213 {
13215 }
13216
13217
13219 {
13220 return false;
13221 }
13222
13225 {
13226 string att_type = "None";
13227
13228 if (ConfigIsExisting("soundAttType"))
13229 {
13230 att_type = ConfigGetString("soundAttType");
13231 }
13232
13234 }
13235
13237 {
13239 }
13240
13241
13242
13243
13244
13250
13252 {
13255
13257 }
13258
13259
13261 {
13263 return;
13264
13266
13269
13272
13273 SoundParameters params = new SoundParameters();
13277 }
13278
13279
13281 {
13283 return;
13284
13286 SetSynchDirty();
13287
13290 }
13291
13292
13294 {
13296 return;
13297
13299 SetSynchDirty();
13300
13303 }
13304
13306 {
13308 }
13309
13311 {
13313 }
13314
13317 {
13318 if (!
GetGame().IsDedicatedServer())
13319 {
13320 if (ConfigIsExisting("attachSoundSet"))
13321 {
13322 string cfg_path = "";
13323 string soundset = "";
13324 string type_name =
GetType();
13325
13328 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13329 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13330
13331 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13332 {
13333 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13334 {
13335 if (cfg_slot_array[i] == slot_type)
13336 {
13337 soundset = cfg_soundset_array[i];
13338 break;
13339 }
13340 }
13341 }
13342
13343 if (soundset != "")
13344 {
13345 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13347 }
13348 }
13349 }
13350 }
13351
13353 {
13354
13355 }
13356
13357 void OnApply(PlayerBase player);
13358
13360 {
13361 return 1.0;
13362 };
13363
13365 {
13367 }
13368
13370 {
13372 }
13373
13375
13377 {
13378 SetDynamicPhysicsLifeTime(0.01);
13380 }
13381
13383 {
13384 array<string> zone_names = new array<string>;
13385 GetDamageZones(zone_names);
13386 for (int i = 0; i < zone_names.Count(); i++)
13387 {
13388 SetHealthMax(zone_names.Get(i),"Health");
13389 }
13390 SetHealthMax("","Health");
13391 }
13392
13395 {
13396 float global_health = GetHealth01("","Health");
13397 array<string> zones = new array<string>;
13398 GetDamageZones(zones);
13399
13400 for (int i = 0; i < zones.Count(); i++)
13401 {
13402 SetHealth01(zones.Get(i),"Health",global_health);
13403 }
13404 }
13405
13408 {
13409 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13410 }
13411
13413 {
13414 if (!hasRootAsPlayer)
13415 {
13416 if (refParentIB)
13417 {
13418
13419 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13420 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13421
13422 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13423 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13424
13427 }
13428 else
13429 {
13430
13433 }
13434 }
13435 }
13436
13438 {
13440 {
13441 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13442 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13443 {
13444 float heatPermCoef = 1.0;
13446 while (ent)
13447 {
13448 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13449 ent = ent.GetHierarchyParent();
13450 }
13451
13452 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13453 }
13454 }
13455 }
13456
13458 {
13459
13460 EntityAI parent = GetHierarchyParent();
13461 if (!parent)
13462 {
13463 hasParent = false;
13464 hasRootAsPlayer = false;
13465 }
13466 else
13467 {
13468 hasParent = true;
13469 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13470 refParentIB =
ItemBase.Cast(parent);
13471 }
13472 }
13473
13474 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13475 {
13476
13477 }
13478
13480 {
13481
13482 return false;
13483 }
13484
13486 {
13487
13488
13489 return false;
13490 }
13491
13493 {
13494
13495 return false;
13496 }
13497
13500 {
13501 return !GetIsFrozen() &&
IsOpen();
13502 }
13503
13505 {
13506 bool hasParent = false, hasRootAsPlayer = false;
13508
13509 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13510 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13511
13512 if (wwtu || foodDecay)
13513 {
13517
13518 if (processWetness || processTemperature || processDecay)
13519 {
13521
13522 if (processWetness)
13523 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13524
13525 if (processTemperature)
13527
13528 if (processDecay)
13529 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13530 }
13531 }
13532 }
13533
13536 {
13538 }
13539
13541 {
13544
13545 return super.GetTemperatureFreezeThreshold();
13546 }
13547
13549 {
13552
13553 return super.GetTemperatureThawThreshold();
13554 }
13555
13557 {
13560
13561 return super.GetItemOverheatThreshold();
13562 }
13563
13565 {
13567 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13568
13569 return super.GetTemperatureFreezeTime();
13570 }
13571
13573 {
13575 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13576
13577 return super.GetTemperatureThawTime();
13578 }
13579
13584
13586 {
13587 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13588 }
13589
13591 {
13592 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13593 }
13594
13597 {
13599 }
13600
13602 {
13604 }
13605
13607 {
13609 }
13610
13613 {
13614 return null;
13615 }
13616
13619 {
13620 return false;
13621 }
13622
13624 {
13626 {
13629 if (!trg)
13630 {
13632 explosive = this;
13633 }
13634
13635 explosive.PairRemote(trg);
13637
13638 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13639 trg.SetPersistentPairID(persistentID);
13640 explosive.SetPersistentPairID(persistentID);
13641
13642 return true;
13643 }
13644 return false;
13645 }
13646
13649 {
13650 float ret = 1.0;
13653 ret *= GetHealth01();
13654
13655 return ret;
13656 }
13657
13658 #ifdef DEVELOPER
13659 override void SetDebugItem()
13660 {
13661 super.SetDebugItem();
13662 _itemBase = this;
13663 }
13664
13666 {
13667 string text = super.GetDebugText();
13668
13670 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13671
13672 return text;
13673 }
13674 #endif
13675
13677 {
13678 return true;
13679 }
13680
13682
13684
13686 {
13689 }
13690
13691
13699
13715}
13716
13718{
13720 if (entity)
13721 {
13722 bool is_item = entity.IsInherited(
ItemBase);
13723 if (is_item && full_quantity)
13724 {
13727 }
13728 }
13729 else
13730 {
13732 return NULL;
13733 }
13734 return entity;
13735}
13736
13738{
13739 if (item)
13740 {
13741 if (health > 0)
13742 item.SetHealth("", "", health);
13743
13744 if (item.CanHaveTemperature())
13745 {
13747 if (item.CanFreeze())
13748 item.SetFrozen(false);
13749 }
13750
13751 if (item.HasEnergyManager())
13752 {
13753 if (quantity >= 0)
13754 {
13755 item.GetCompEM().SetEnergy0To1(quantity);
13756 }
13757 else
13758 {
13760 }
13761 }
13762 else if (item.IsMagazine())
13763 {
13764 Magazine mag = Magazine.Cast(item);
13765 if (quantity >= 0)
13766 {
13767 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13768 }
13769 else
13770 {
13772 }
13773
13774 }
13775 else
13776 {
13777 if (quantity >= 0)
13778 {
13779 item.SetQuantityNormalized(quantity, false);
13780 }
13781 else
13782 {
13784 }
13785
13786 }
13787 }
13788}
13789
13790#ifdef DEVELOPER
13792#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.