8794{
8796 {
8797 return true;
8798 }
8799};
8800
8801
8802
8804{
8808
8810
8813
8814
8815
8816
8817
8826
8832
8837
8842
8863 protected bool m_IsResultOfSplit
8864
8866
8871
8872
8873
8875
8879
8880
8881
8883
8886
8887
8888
8894
8895
8903
8906
8907
8909
8910
8912
8913
8918
8919
8924
8925
8927
8928
8930 {
8935
8936 if (!
GetGame().IsDedicatedServer())
8937 {
8939 {
8941
8943 {
8945 }
8946 }
8947
8950 }
8951
8952 m_OldLocation = null;
8953
8955 {
8957 }
8958
8959 if (ConfigIsExisting("headSelectionsToHide"))
8960 {
8963 }
8964
8966 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8967 {
8969 }
8970
8972
8973 m_IsResultOfSplit = false;
8974
8976 }
8977
8979 {
8980 super.InitItemVariables();
8981
8987 m_Count = ConfigGetInt(
"count");
8988
8991
8996
8999
9004
9016
9020
9021
9024 if (ConfigIsExisting("canBeSplit"))
9025 {
9028 }
9029
9031 if (ConfigIsExisting("itemBehaviour"))
9033
9034
9037 RegisterNetSyncVariableInt("m_VarLiquidType");
9038 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9039
9040 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9041 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9042 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9043
9044 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9045 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9046 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9047 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9048
9049 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9050 RegisterNetSyncVariableBool("m_IsTakeable");
9051 RegisterNetSyncVariableBool("m_IsHologram");
9052
9055 {
9058 }
9059
9061
9063 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9065
9066 }
9067
9069 {
9071 }
9072
9074 {
9077 {
9082 }
9083 }
9084
9085 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9086 {
9088 {
9091 }
9092
9094 }
9095
9097 {
9103 }
9104
9106
9108 {
9110
9111 if (!action)
9112 {
9113 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9114 return;
9115 }
9116
9118 if (!ai)
9119 {
9121 return;
9122 }
9123
9125 if (!action_array)
9126 {
9127 action_array = new array<ActionBase_Basic>;
9129 }
9130 if (LogManager.IsActionLogEnable())
9131 {
9132 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9133 }
9134
9135 if (action_array.Find(action) != -1)
9136 {
9137 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9138 }
9139 else
9140 {
9141 action_array.Insert(action);
9142 }
9143 }
9144
9146 {
9148 ActionBase action = player.GetActionManager().GetAction(actionName);
9151
9152 if (action_array)
9153 {
9154 action_array.RemoveItem(action);
9155 }
9156 }
9157
9158
9159
9161 {
9162 ActionOverrideData overrideData = new ActionOverrideData();
9166
9168 if (!actionMap)
9169 {
9172 }
9173
9174 actionMap.Insert(this.
Type(), overrideData);
9175
9176 }
9177
9179
9181
9182
9184 {
9187
9190
9191 string config_to_search = "CfgVehicles";
9192 string muzzle_owner_config;
9193
9195 {
9196 if (IsInherited(Weapon))
9197 config_to_search = "CfgWeapons";
9198
9199 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9200
9201 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9202
9204
9205 if (config_OnFire_subclass_count > 0)
9206 {
9207 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9208
9209 for (int i = 0; i < config_OnFire_subclass_count; i++)
9210 {
9211 string particle_class = "";
9213 string config_OnFire_entry = config_OnFire_class + particle_class;
9214 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9215 WPOF_array.Insert(WPOF);
9216 }
9217
9218
9220 }
9221 }
9222
9224 {
9225 config_to_search = "CfgWeapons";
9226 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9227
9228 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9229
9231
9232 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9233 {
9234 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9235
9236 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9237 {
9238 string particle_class2 = "";
9240 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9241 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9242 WPOBE_array.Insert(WPOBE);
9243 }
9244
9245
9247 }
9248 }
9249 }
9250
9251
9253 {
9256
9258 {
9259 string config_to_search = "CfgVehicles";
9260
9261 if (IsInherited(Weapon))
9262 config_to_search = "CfgWeapons";
9263
9264 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9265 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9266
9267 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9268 {
9269
9271
9273 {
9275 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9277 return;
9278 }
9279
9282
9283
9284
9286 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9287
9288 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9289 {
9290 string particle_class = "";
9292 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9294
9295 if (entry_type == CT_CLASS)
9296 {
9297 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9298 WPOOH_array.Insert(WPOF);
9299 }
9300 }
9301
9302
9304 }
9305 }
9306 }
9307
9309 {
9311 }
9312
9314 {
9316 {
9318
9321
9324
9325 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9326 }
9327 }
9328
9330 {
9332 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9333
9335 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9336
9338 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9339
9341 {
9343 }
9344 }
9345
9347 {
9349 }
9350
9352 {
9355 else
9357
9359 {
9362 }
9363 else
9364 {
9367
9370 }
9371
9373 }
9374
9376 {
9378 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9379 }
9380
9382 {
9384 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9386 }
9387
9389 {
9391 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9392 }
9393
9395 {
9398
9399 OverheatingParticle OP = new OverheatingParticle();
9404
9406 }
9407
9409 {
9412
9413 return -1;
9414 }
9415
9417 {
9419 {
9422
9423 for (int i = count; i > 0; --i)
9424 {
9425 int id = i - 1;
9428
9431
9432 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9433 {
9434 if (p)
9435 {
9438 }
9439 }
9440 }
9441 }
9442 }
9443
9445 {
9447 {
9449 {
9450 int id = i - 1;
9452
9453 if (OP)
9454 {
9456
9457 if (p)
9458 {
9460 }
9461
9462 delete OP;
9463 }
9464 }
9465
9468 }
9469 }
9470
9473 {
9474 return 0.0;
9475 }
9476
9477
9479 {
9480 return 250;
9481 }
9482
9484 {
9485 return 0;
9486 }
9487
9490 {
9492 return true;
9493
9494 return false;
9495 }
9496
9499 {
9502
9504 {
9506 }
9507 else
9508 {
9509
9511 }
9512
9514 }
9515
9522 {
9523 return -1;
9524 }
9525
9526
9527
9528
9530 {
9532 {
9534 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9535
9536 if (r_index >= 0)
9537 {
9538 InventoryLocation r_il = new InventoryLocation;
9539 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9540
9541 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9544 {
9545 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9546 }
9548 {
9549 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9550 }
9551
9552 }
9553
9554 player.GetHumanInventory().ClearUserReservedLocation(this);
9555 }
9556
9559 }
9560
9561
9562
9563
9565 {
9566 return ItemBase.m_DebugActionsMask;
9567 }
9568
9570 {
9571 return ItemBase.m_DebugActionsMask & mask;
9572 }
9573
9575 {
9576 ItemBase.m_DebugActionsMask = mask;
9577 }
9578
9580 {
9581 ItemBase.m_DebugActionsMask |= mask;
9582 }
9583
9585 {
9586 ItemBase.m_DebugActionsMask &= ~mask;
9587 }
9588
9590 {
9592 {
9594 }
9595 else
9596 {
9598 }
9599 }
9600
9601
9603 {
9604 if (GetEconomyProfile())
9605 {
9606 float q_max = GetEconomyProfile().GetQuantityMax();
9607 if (q_max > 0)
9608 {
9609 float q_min = GetEconomyProfile().GetQuantityMin();
9610 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9611
9613 {
9614 ComponentEnergyManager comp = GetCompEM();
9616 {
9618 }
9619 }
9621 {
9623
9624 }
9625
9626 }
9627 }
9628 }
9629
9632 {
9633 EntityAI parent = GetHierarchyParent();
9634
9635 if (parent)
9636 {
9637 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9638 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9639 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9640 }
9641 }
9642
9645 {
9646 EntityAI parent = GetHierarchyParent();
9647
9648 if (parent)
9649 {
9650 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9651 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9652 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9653 }
9654 }
9655
9657 {
9658
9659
9660
9661
9663
9665 {
9666 if (ScriptInputUserData.CanStoreInputUserData())
9667 {
9668 ScriptInputUserData ctx = new ScriptInputUserData;
9674 ctx.
Write(use_stack_max);
9677
9679 {
9680 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9681 }
9682 }
9683 }
9684 else if (!
GetGame().IsMultiplayer())
9685 {
9687 }
9688 }
9689
9691 {
9693 }
9694
9696 {
9698 }
9699
9701 {
9703 }
9704
9706 {
9707
9708 return false;
9709 }
9710
9712 {
9713 return false;
9714 }
9715
9719 {
9720 return false;
9721 }
9722
9724 {
9725 return "";
9726 }
9727
9729
9731 {
9732 return false;
9733 }
9734
9736 {
9737 return true;
9738 }
9739
9740
9741
9743 {
9744 return true;
9745 }
9746
9748 {
9749 return true;
9750 }
9751
9753 {
9754 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9756 }
9757
9759 {
9761 }
9762
9764 {
9766 if (!is_being_placed)
9768 SetSynchDirty();
9769 }
9770
9771
9773
9775 {
9777 }
9778
9780 {
9782 }
9783
9785 {
9786 return 1;
9787 }
9788
9790 {
9791 return false;
9792 }
9793
9795 {
9797 SetSynchDirty();
9798 }
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9835 {
9836 super.OnMovedInsideCargo(container);
9837
9838 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9839 }
9840
9841 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9842 {
9843 super.EEItemLocationChanged(oldLoc,newLoc);
9844
9845 PlayerBase new_player = null;
9846 PlayerBase old_player = null;
9847
9848 if (newLoc.GetParent())
9849 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9850
9851 if (oldLoc.GetParent())
9852 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9853
9855 {
9856 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9857
9858 if (r_index >= 0)
9859 {
9860 InventoryLocation r_il = new InventoryLocation;
9861 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9862
9863 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9866 {
9867 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9868 }
9870 {
9871 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9872 }
9873
9874 }
9875 }
9876
9878 {
9879 if (new_player)
9880 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9881
9882 if (new_player == old_player)
9883 {
9884
9885 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9886 {
9888 {
9889 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9890 {
9891 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9892 }
9893 }
9894 else
9895 {
9896 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9897 }
9898 }
9899
9900 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9901 {
9902 int type = oldLoc.GetType();
9904 {
9905 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9906 }
9908 {
9909 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9910 }
9911 }
9912 if (!m_OldLocation)
9913 {
9914 m_OldLocation = new InventoryLocation;
9915 }
9916 m_OldLocation.Copy(oldLoc);
9917 }
9918 else
9919 {
9920 if (m_OldLocation)
9921 {
9922 m_OldLocation.Reset();
9923 }
9924 }
9925
9927 }
9928 else
9929 {
9930 if (new_player)
9931 {
9932 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9933 if (res_index >= 0)
9934 {
9935 InventoryLocation il = new InventoryLocation;
9936 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9938 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9941 {
9942 il.
GetParent().GetOnReleaseLock().Invoke(it);
9943 }
9945 {
9947 }
9948
9949 }
9950 }
9952 {
9953
9955 }
9956
9957 if (m_OldLocation)
9958 {
9959 m_OldLocation.Reset();
9960 }
9961 }
9962 }
9963
9964 override void EOnContact(IEntity other, Contact extra)
9965 {
9967 {
9968 int liquidType = -1;
9970 if (impactSpeed > 0.0)
9971 {
9973 #ifndef SERVER
9975 #else
9977 SetSynchDirty();
9978 #endif
9980 }
9981 }
9982
9983 #ifdef SERVER
9984 if (GetCompEM() && GetCompEM().IsPlugged())
9985 {
9986 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9987 GetCompEM().UnplugThis();
9988 }
9989 #endif
9990 }
9991
9993
9995 {
9997 }
9998
10000 {
10001
10002 }
10003
10005 {
10006 super.OnItemLocationChanged(old_owner, new_owner);
10007
10008 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10009 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10010
10011 if (!relatedPlayer && playerNew)
10012 relatedPlayer = playerNew;
10013
10014 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10015 {
10017 if (actionMgr)
10018 {
10019 ActionBase currentAction = actionMgr.GetRunningAction();
10020 if (currentAction)
10022 }
10023 }
10024
10025 Man ownerPlayerOld = null;
10026 Man ownerPlayerNew = null;
10027
10028 if (old_owner)
10029 {
10030 if (old_owner.
IsMan())
10031 {
10032 ownerPlayerOld = Man.Cast(old_owner);
10033 }
10034 else
10035 {
10036 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10037 }
10038 }
10039 else
10040 {
10042 {
10044
10045 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10046 {
10047 GetCompEM().UnplugThis();
10048 }
10049 }
10050 }
10051
10052 if (new_owner)
10053 {
10054 if (new_owner.
IsMan())
10055 {
10056 ownerPlayerNew = Man.Cast(new_owner);
10057 }
10058 else
10059 {
10060 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10061 }
10062 }
10063
10064 if (ownerPlayerOld != ownerPlayerNew)
10065 {
10066 if (ownerPlayerOld)
10067 {
10068 array<EntityAI> subItemsExit = new array<EntityAI>;
10070 for (int i = 0; i < subItemsExit.Count(); i++)
10071 {
10074 }
10075 }
10076
10077 if (ownerPlayerNew)
10078 {
10079 array<EntityAI> subItemsEnter = new array<EntityAI>;
10081 for (int j = 0; j < subItemsEnter.Count(); j++)
10082 {
10085 }
10086 }
10087 }
10088 else if (ownerPlayerNew != null)
10089 {
10090 PlayerBase nplayer;
10091 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10092 {
10093 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10095 for (int k = 0; k < subItemsUpdate.Count(); k++)
10096 {
10098 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10099 }
10100 }
10101 }
10102
10103 if (old_owner)
10104 old_owner.OnChildItemRemoved(this);
10105 if (new_owner)
10106 new_owner.OnChildItemReceived(this);
10107 }
10108
10109
10111 {
10112 super.EEDelete(parent);
10113 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10114 if (player)
10115 {
10117
10118 if (player.IsAlive())
10119 {
10120 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10121 if (r_index >= 0)
10122 {
10123 InventoryLocation r_il = new InventoryLocation;
10124 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10125
10126 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10129 {
10130 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10131 }
10133 {
10134 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10135 }
10136
10137 }
10138
10139 player.RemoveQuickBarEntityShortcut(this);
10140 }
10141 }
10142 }
10143
10145 {
10146 super.EEKilled(killer);
10147
10150 {
10151 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10152 {
10153 if (IsMagazine())
10154 {
10155 if (Magazine.Cast(this).GetAmmoCount() > 0)
10156 {
10158 }
10159 }
10160 else
10161 {
10163 }
10164 }
10165 }
10166 }
10167
10169 {
10170 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10171
10172 super.OnWasAttached(parent, slot_id);
10173
10176
10178 }
10179
10181 {
10182 super.OnWasDetached(parent, slot_id);
10183
10186 }
10187
10189 {
10190 int idx;
10193
10194 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10195 if (inventory_slots.Count() < 1)
10196 {
10197 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10198 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10199 }
10200 else
10201 {
10202 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10203 }
10204
10205 idx = inventory_slots.Find(slot);
10206 if (idx < 0)
10207 return "";
10208
10209 return attach_types.Get(idx);
10210 }
10211
10213 {
10214 int idx = -1;
10215 string slot;
10216
10219
10220 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10221 if (inventory_slots.Count() < 1)
10222 {
10223 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10224 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10225 }
10226 else
10227 {
10228 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10229 if (detach_types.Count() < 1)
10230 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10231 }
10232
10233 for (int i = 0; i < inventory_slots.Count(); i++)
10234 {
10235 slot = inventory_slots.Get(i);
10236 }
10237
10238 if (slot != "")
10239 {
10240 if (detach_types.Count() == 1)
10241 idx = 0;
10242 else
10243 idx = inventory_slots.Find(slot);
10244 }
10245 if (idx < 0)
10246 return "";
10247
10248 return detach_types.Get(idx);
10249 }
10250
10252 {
10253
10255
10256
10257 float min_time = 1;
10258 float max_time = 3;
10259 float delay = Math.RandomFloat(min_time, max_time);
10260
10261 explode_timer.Run(delay, this, "DoAmmoExplosion");
10262 }
10263
10265 {
10266 Magazine magazine = Magazine.Cast(this);
10267 int pop_sounds_count = 6;
10268 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10269
10270
10271 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10272 string sound_name = pop_sounds[ sound_idx ];
10274
10275
10276 magazine.ServerAddAmmoCount(-1);
10277
10278
10279 float min_temp_to_explode = 100;
10280
10281 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10282 {
10284 }
10285 }
10286
10287
10288 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10289 {
10290 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10291
10292 const int CHANCE_DAMAGE_CARGO = 4;
10293 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10294 const int CHANCE_DAMAGE_NOTHING = 2;
10295
10297 {
10298 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10299 int chances;
10300 int rnd;
10301
10302 if (GetInventory().GetCargo())
10303 {
10304 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10305 rnd = Math.RandomInt(0,chances);
10306
10307 if (rnd < CHANCE_DAMAGE_CARGO)
10308 {
10310 }
10311 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10312 {
10314 }
10315 }
10316 else
10317 {
10318 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10319 rnd = Math.RandomInt(0,chances);
10320
10321 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10322 {
10324 }
10325 }
10326 }
10327 }
10328
10330 {
10331 if (GetInventory().GetCargo())
10332 {
10333 int item_count = GetInventory().GetCargo().GetItemCount();
10334 if (item_count > 0)
10335 {
10336 int random_pick = Math.RandomInt(0, item_count);
10338 if (!item.IsExplosive())
10339 {
10340 item.AddHealth("","",damage);
10341 return true;
10342 }
10343 }
10344 }
10345 return false;
10346 }
10347
10349 {
10350 int attachment_count = GetInventory().AttachmentCount();
10351 if (attachment_count > 0)
10352 {
10353 int random_pick = Math.RandomInt(0, attachment_count);
10354 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10355 if (!attachment.IsExplosive())
10356 {
10357 attachment.AddHealth("","",damage);
10358 return true;
10359 }
10360 }
10361 return false;
10362 }
10363
10365 {
10367 }
10368
10370 {
10372 return GetInventory().CanRemoveEntity();
10373
10374 return false;
10375 }
10376
10378 {
10379
10381 return false;
10382
10383
10385 return false;
10386
10387
10388
10390 if (delta == 0)
10391 return false;
10392
10393
10394 return true;
10395 }
10396
10398 {
10400 {
10401 if (ScriptInputUserData.CanStoreInputUserData())
10402 {
10403 ScriptInputUserData ctx = new ScriptInputUserData;
10408 ctx.
Write(destination_entity);
10410 ctx.
Write(slot_id);
10412 }
10413 }
10414 else if (!
GetGame().IsMultiplayer())
10415 {
10417 }
10418 }
10419
10421 {
10422 float split_quantity_new;
10426 InventoryLocation loc = new InventoryLocation;
10427
10428 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10429 {
10431 split_quantity_new = stack_max;
10432 else
10434
10436 {
10437 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10438 if (new_item)
10439 {
10440 new_item.SetResultOfSplit(true);
10441 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10443 new_item.
SetQuantity(split_quantity_new,
false,
true);
10444 }
10445 }
10446 }
10447 else if (destination_entity && slot_id == -1)
10448 {
10449 if (quantity > stack_max)
10450 split_quantity_new = stack_max;
10451 else
10452 split_quantity_new = quantity;
10453
10455 {
10457 {
10460 }
10461
10462 if (new_item)
10463 {
10464 new_item.SetResultOfSplit(true);
10465 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10467 new_item.
SetQuantity(split_quantity_new,
false,
true);
10468 }
10469 }
10470 }
10471 else
10472 {
10473 if (stack_max != 0)
10474 {
10476 {
10478 }
10479
10480 if (split_quantity_new == 0)
10481 {
10482 if (!
GetGame().IsMultiplayer())
10483 player.PhysicalPredictiveDropItem(this);
10484 else
10485 player.ServerDropEntity(this);
10486 return;
10487 }
10488
10490 {
10492
10493 if (new_item)
10494 {
10495 new_item.SetResultOfSplit(true);
10496 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10499 new_item.PlaceOnSurface();
10500 }
10501 }
10502 }
10503 }
10504 }
10505
10507 {
10508 float split_quantity_new;
10512 InventoryLocation loc = new InventoryLocation;
10513
10514 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10515 {
10517 split_quantity_new = stack_max;
10518 else
10520
10522 {
10523 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10524 if (new_item)
10525 {
10526 new_item.SetResultOfSplit(true);
10527 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10529 new_item.
SetQuantity(split_quantity_new,
false,
true);
10530 }
10531 }
10532 }
10533 else if (destination_entity && slot_id == -1)
10534 {
10535 if (quantity > stack_max)
10536 split_quantity_new = stack_max;
10537 else
10538 split_quantity_new = quantity;
10539
10541 {
10543 {
10546 }
10547
10548 if (new_item)
10549 {
10550 new_item.SetResultOfSplit(true);
10551 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10553 new_item.
SetQuantity(split_quantity_new,
false,
true);
10554 }
10555 }
10556 }
10557 else
10558 {
10559 if (stack_max != 0)
10560 {
10562 {
10564 }
10565
10567 {
10569
10570 if (new_item)
10571 {
10572 new_item.SetResultOfSplit(true);
10573 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10576 new_item.PlaceOnSurface();
10577 }
10578 }
10579 }
10580 }
10581 }
10582
10584 {
10586 {
10587 if (ScriptInputUserData.CanStoreInputUserData())
10588 {
10589 ScriptInputUserData ctx = new ScriptInputUserData;
10594 dst.WriteToContext(ctx);
10596 }
10597 }
10598 else if (!
GetGame().IsMultiplayer())
10599 {
10601 }
10602 }
10603
10605 {
10607 {
10608 if (ScriptInputUserData.CanStoreInputUserData())
10609 {
10610 ScriptInputUserData ctx = new ScriptInputUserData;
10615 ctx.
Write(destination_entity);
10621 }
10622 }
10623 else if (!
GetGame().IsMultiplayer())
10624 {
10626 }
10627 }
10628
10630 {
10632 }
10633
10635 {
10637 float split_quantity_new;
10639 if (dst.IsValid())
10640 {
10641 int slot_id = dst.GetSlot();
10643
10644 if (quantity > stack_max)
10645 split_quantity_new = stack_max;
10646 else
10647 split_quantity_new = quantity;
10648
10650 {
10652
10653 if (new_item)
10654 {
10655 new_item.SetResultOfSplit(true);
10656 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10658 new_item.
SetQuantity(split_quantity_new,
false,
true);
10659 }
10660
10661 return new_item;
10662 }
10663 }
10664
10665 return null;
10666 }
10667
10669 {
10671 float split_quantity_new;
10673 if (destination_entity)
10674 {
10676 if (quantity > stackable)
10677 split_quantity_new = stackable;
10678 else
10679 split_quantity_new = quantity;
10680
10682 {
10683 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10684 if (new_item)
10685 {
10686 new_item.SetResultOfSplit(true);
10687 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10689 new_item.
SetQuantity(split_quantity_new,
false,
true);
10690 }
10691 }
10692 }
10693 }
10694
10696 {
10698 {
10699 if (ScriptInputUserData.CanStoreInputUserData())
10700 {
10701 ScriptInputUserData ctx = new ScriptInputUserData;
10706 ItemBase destination_entity =
this;
10707 ctx.
Write(destination_entity);
10711 }
10712 }
10713 else if (!
GetGame().IsMultiplayer())
10714 {
10716 }
10717 }
10718
10720 {
10722 float split_quantity_new;
10724 if (player)
10725 {
10727 if (quantity > stackable)
10728 split_quantity_new = stackable;
10729 else
10730 split_quantity_new = quantity;
10731
10733 {
10734 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10735 new_item =
ItemBase.Cast(in_hands);
10736 if (new_item)
10737 {
10738 new_item.SetResultOfSplit(true);
10739 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10741 new_item.SetQuantity(split_quantity_new, false, true);
10742 }
10743 }
10744 }
10745 }
10746
10748 {
10750 float split_quantity_new = Math.Floor(quantity * 0.5);
10751
10753 return;
10754
10756
10757 if (new_item)
10758 {
10759 if (new_item.GetQuantityMax() < split_quantity_new)
10760 {
10761 split_quantity_new = new_item.GetQuantityMax();
10762 }
10763
10764 new_item.SetResultOfSplit(true);
10765 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10766
10768 {
10771 }
10772 else
10773 {
10775 new_item.
SetQuantity(split_quantity_new,
false,
true);
10776 }
10777 }
10778 }
10779
10781 {
10783 float split_quantity_new = Math.Floor(quantity / 2);
10784
10786 return;
10787
10788 InventoryLocation invloc = new InventoryLocation;
10790
10792 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10793
10794 if (new_item)
10795 {
10796 if (new_item.GetQuantityMax() < split_quantity_new)
10797 {
10798 split_quantity_new = new_item.GetQuantityMax();
10799 }
10801 {
10804 }
10805 else if (split_quantity_new > 1)
10806 {
10808 new_item.
SetQuantity(split_quantity_new,
false,
true);
10809 }
10810 }
10811 }
10812
10815 {
10816 SetWeightDirty();
10818
10819 if (parent)
10820 parent.OnAttachmentQuantityChangedEx(this, delta);
10821
10823 {
10825 {
10827 }
10829 {
10830 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10832 }
10833 }
10834
10835 }
10836
10839 {
10840
10841 }
10842
10845 {
10847 }
10848
10850 {
10851 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10852
10854 {
10855 if (newLevel == GameConstants.STATE_RUINED)
10856 {
10858 EntityAI parent = GetHierarchyParent();
10859 if (parent && parent.IsFireplace())
10860 {
10861 CargoBase cargo = GetInventory().GetCargo();
10862 if (cargo)
10863 {
10865 {
10867 }
10868 }
10869 }
10870 }
10871
10873 {
10874
10876 return;
10877 }
10878
10879 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10880 {
10882 }
10883 }
10884 }
10885
10886
10888 {
10889 super.OnRightClick();
10890
10892 {
10894 {
10895 if (ScriptInputUserData.CanStoreInputUserData())
10896 {
10897 EntityAI root = GetHierarchyRoot();
10898 Man playerOwner = GetHierarchyRootPlayer();
10899 InventoryLocation dst = new InventoryLocation;
10900
10901
10902 if (!playerOwner && root && root == this)
10903 {
10905 }
10906 else
10907 {
10908
10909 GetInventory().GetCurrentInventoryLocation(dst);
10911 {
10914 {
10916 }
10917 else
10918 {
10920
10921
10922 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10923 {
10925 }
10926 else
10927 {
10928 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10929 }
10930 }
10931 }
10932 }
10933
10934 ScriptInputUserData ctx = new ScriptInputUserData;
10942 }
10943 }
10944 else if (!
GetGame().IsMultiplayer())
10945 {
10947 }
10948 }
10949 }
10950
10952 {
10953 if (root)
10954 {
10955 vector m4[4];
10956 root.GetTransform(m4);
10957 dst.SetGround(this, m4);
10958 }
10959 else
10960 {
10961 GetInventory().GetCurrentInventoryLocation(dst);
10962 }
10963 }
10964
10965 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10966 {
10967
10968 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10969 return false;
10970
10971 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10972 return false;
10973
10974
10976 return false;
10977
10978
10979 Magazine mag = Magazine.Cast(this);
10980 if (mag)
10981 {
10982 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10983 return false;
10984
10985 if (stack_max_limit)
10986 {
10987 Magazine other_mag = Magazine.Cast(other_item);
10988 if (other_item)
10989 {
10990 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10991 return false;
10992 }
10993
10994 }
10995 }
10996 else
10997 {
10998
11000 return false;
11001
11003 return false;
11004 }
11005
11006 PlayerBase player = null;
11007 if (CastTo(player, GetHierarchyRootPlayer()))
11008 {
11009 if (player.GetInventory().HasAttachment(this))
11010 return false;
11011
11012 if (player.IsItemsToDelete())
11013 return false;
11014 }
11015
11016 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11017 return false;
11018
11019 int slotID;
11021 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11022 return false;
11023
11024 return true;
11025 }
11026
11028 {
11030 }
11031
11033 {
11034 return m_IsResultOfSplit;
11035 }
11036
11038 {
11039 m_IsResultOfSplit = value;
11040 }
11041
11043 {
11045 }
11046
11048 {
11049 float other_item_quantity = other_item.GetQuantity();
11050 float this_free_space;
11051
11053
11055
11056 if (other_item_quantity > this_free_space)
11057 {
11058 return this_free_space;
11059 }
11060 else
11061 {
11062 return other_item_quantity;
11063 }
11064 }
11065
11067 {
11069 }
11070
11072 {
11074 return;
11075
11076 if (!IsMagazine() && other_item)
11077 {
11079 if (quantity_used != 0)
11080 {
11081 float hp1 = GetHealth01("","");
11082 float hp2 = other_item.GetHealth01("","");
11083 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11084 hpResult = hpResult / (
GetQuantity() + quantity_used);
11085
11086 hpResult *= GetMaxHealth();
11087 Math.Round(hpResult);
11088 SetHealth("", "Health", hpResult);
11089
11091 other_item.AddQuantity(-quantity_used);
11092 }
11093 }
11095 }
11096
11098 {
11099 #ifdef SERVER
11100 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11101 GetHierarchyParent().IncreaseLifetimeUp();
11102 #endif
11103 };
11104
11106 {
11107 PlayerBase p = PlayerBase.Cast(player);
11108
11109 array<int> recipesIds = p.m_Recipes;
11110 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11111 if (moduleRecipesManager)
11112 {
11113 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11114 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11115 }
11116
11117 for (int i = 0;i < recipesIds.Count(); i++)
11118 {
11119 int key = recipesIds.Get(i);
11120 string recipeName = moduleRecipesManager.GetRecipeName(key);
11122 }
11123 }
11124
11125
11126 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11127 {
11128 super.GetDebugActions(outputList);
11129
11130
11136
11137
11142
11147
11148
11152
11153
11155 {
11159 }
11160
11163
11164
11168
11170
11171 InventoryLocation loc = new InventoryLocation();
11172 GetInventory().GetCurrentInventoryLocation(loc);
11174 {
11175 if (Gizmo_IsSupported())
11178 }
11179
11181 }
11182
11183
11184
11185
11187 {
11188 super.OnAction(action_id, player, ctx);
11189
11191 {
11192 switch (action_id)
11193 {
11196 return true;
11199 return true;
11200 }
11201 }
11202
11204 {
11205 switch (action_id)
11206 {
11208 Delete();
11209 return true;
11210 }
11211 }
11212
11213 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11214 {
11215 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11216 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11217 PlayerBase p = PlayerBase.Cast(player);
11218 if (
EActions.RECIPES_RANGE_START < 1000)
11219 {
11220 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11221 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11222 }
11223 }
11224 #ifndef SERVER
11225 else if (action_id ==
EActions.WATCH_PLAYER)
11226 {
11227 PluginDeveloper.SetDeveloperItemClientEx(player);
11228 }
11229 #endif
11231 {
11232 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11233 {
11234 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11235 OnDebugButtonPressServer(id + 1);
11236 }
11237
11238 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11239 {
11240 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11242 }
11243
11244 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11245 {
11246 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11248 }
11249
11250 else if (action_id ==
EActions.ADD_QUANTITY)
11251 {
11252 if (IsMagazine())
11253 {
11254 Magazine mag = Magazine.Cast(this);
11255 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11256 }
11257 else
11258 {
11260 }
11261
11262 if (m_EM)
11263 {
11264 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11265 }
11266
11267 }
11268
11269 else if (action_id ==
EActions.REMOVE_QUANTITY)
11270 {
11271 if (IsMagazine())
11272 {
11273 Magazine mag2 = Magazine.Cast(this);
11274 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11275 }
11276 else
11277 {
11279 }
11280 if (m_EM)
11281 {
11282 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11283 }
11284
11285 }
11286
11287 else if (action_id ==
EActions.SET_QUANTITY_0)
11288 {
11290
11291 if (m_EM)
11292 {
11293 m_EM.SetEnergy(0);
11294 }
11295 }
11296
11297 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11298 {
11300
11301 if (m_EM)
11302 {
11303 m_EM.SetEnergy(m_EM.GetEnergyMax());
11304 }
11305 }
11306
11307 else if (action_id ==
EActions.ADD_HEALTH)
11308 {
11309 AddHealth("","",GetMaxHealth("","Health")/5);
11310 }
11311 else if (action_id ==
EActions.REMOVE_HEALTH)
11312 {
11313 AddHealth("","",-GetMaxHealth("","Health")/5);
11314 }
11315 else if (action_id ==
EActions.DESTROY_HEALTH)
11316 {
11317 SetHealth01("","",0);
11318 }
11319 else if (action_id ==
EActions.WATCH_ITEM)
11320 {
11322 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11323 #ifdef DEVELOPER
11324 SetDebugDeveloper_item(this);
11325 #endif
11326 }
11327
11328 else if (action_id ==
EActions.ADD_TEMPERATURE)
11329 {
11330 AddTemperature(20);
11331
11332 }
11333
11334 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11335 {
11336 AddTemperature(-20);
11337
11338 }
11339
11340 else if (action_id ==
EActions.FLIP_FROZEN)
11341 {
11342 SetFrozen(!GetIsFrozen());
11343
11344 }
11345
11346 else if (action_id ==
EActions.ADD_WETNESS)
11347 {
11349
11350 }
11351
11352 else if (action_id ==
EActions.REMOVE_WETNESS)
11353 {
11355
11356 }
11357
11358 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11359 {
11362
11363
11364 }
11365
11366 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11367 {
11370 }
11371
11372 else if (action_id ==
EActions.MAKE_SPECIAL)
11373 {
11374 auto debugParams = DebugSpawnParams.WithPlayer(player);
11375 OnDebugSpawnEx(debugParams);
11376 }
11377
11378 }
11379
11380
11381 return false;
11382 }
11383
11384
11385
11386
11390
11393
11394
11395
11397 {
11398 return false;
11399 }
11400
11401
11403 {
11404 return true;
11405 }
11406
11407
11409 {
11410 return true;
11411 }
11412
11413
11414
11416 {
11417 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11419 }
11420
11423 {
11424 return null;
11425 }
11426
11428 {
11429 return false;
11430 }
11431
11433 {
11434 return false;
11435 }
11436
11440
11441
11443 {
11444 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11445 return module_repairing.CanRepair(this, item_repair_kit);
11446 }
11447
11448
11449 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11450 {
11451 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11452 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11453 }
11454
11455
11457 {
11458
11459
11460
11461
11462
11463
11464
11465
11466 return 1;
11467 }
11468
11469
11470
11472 {
11474 }
11475
11476
11477
11479 {
11481 }
11482
11483
11492 {
11493 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11494
11495 if (player)
11496 {
11497 player.MessageStatus(text);
11498 }
11499 }
11500
11501
11510 {
11511 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11512
11513 if (player)
11514 {
11515 player.MessageAction(text);
11516 }
11517 }
11518
11519
11528 {
11529 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11530
11531 if (player)
11532 {
11533 player.MessageFriendly(text);
11534 }
11535 }
11536
11537
11546 {
11547 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11548
11549 if (player)
11550 {
11551 player.MessageImportant(text);
11552 }
11553 }
11554
11556 {
11557 return true;
11558 }
11559
11560
11561 override bool KindOf(
string tag)
11562 {
11563 bool found = false;
11564 string item_name = this.
GetType();
11567
11568 int array_size = item_tag_array.Count();
11569 for (int i = 0; i < array_size; i++)
11570 {
11571 if (item_tag_array.Get(i) == tag)
11572 {
11573 found = true;
11574 break;
11575 }
11576 }
11577 return found;
11578 }
11579
11580
11582 {
11583
11584 super.OnRPC(sender, rpc_type,ctx);
11585
11586
11587 switch (rpc_type)
11588 {
11589 #ifndef SERVER
11590 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11591 Param2<bool, string> p = new Param2<bool, string>(false, "");
11592
11594 return;
11595
11596 bool play = p.param1;
11597 string soundSet = p.param2;
11598
11599 if (play)
11600 {
11602 {
11604 {
11606 }
11607 }
11608 else
11609 {
11611 }
11612 }
11613 else
11614 {
11616 }
11617
11618 break;
11619 #endif
11620
11621 }
11622
11624 {
11626 }
11627 }
11628
11629
11630
11631
11633 {
11634 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11635 return plugin.GetID(
name);
11636 }
11637
11639 {
11640 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11641 return plugin.GetName(id);
11642 }
11643
11646 {
11647
11648
11649 int varFlags;
11650 if (!ctx.
Read(varFlags))
11651 return;
11652
11653 if (varFlags & ItemVariableFlags.FLOAT)
11654 {
11656 }
11657 }
11658
11660 {
11661
11662 super.SerializeNumericalVars(floats_out);
11663
11664
11665
11667 {
11669 }
11670
11672 {
11674 }
11675
11677 {
11679 }
11680
11682 {
11687 }
11688
11690 {
11692 }
11693 }
11694
11696 {
11697
11698 super.DeSerializeNumericalVars(floats);
11699
11700
11701 int index = 0;
11702 int mask = Math.Round(floats.Get(index));
11703
11704 index++;
11705
11707 {
11709 {
11711 }
11712 else
11713 {
11714 float quantity = floats.Get(index);
11715 SetQuantity(quantity,
true,
false,
false,
false);
11716 }
11717 index++;
11718 }
11719
11721 {
11722 float wet = floats.Get(index);
11724 index++;
11725 }
11726
11728 {
11729 int liquidtype = Math.Round(floats.Get(index));
11731 index++;
11732 }
11733
11735 {
11737 index++;
11739 index++;
11741 index++;
11743 index++;
11744 }
11745
11747 {
11748 int cleanness = Math.Round(floats.Get(index));
11750 index++;
11751 }
11752 }
11753
11755 {
11756 super.WriteVarsToCTX(ctx);
11757
11758
11760 {
11762 }
11763
11765 {
11767 }
11768
11770 {
11772 }
11773
11775 {
11776 int r,g,b,a;
11782 }
11783
11785 {
11787 }
11788 }
11789
11791 {
11792 if (!super.ReadVarsFromCTX(ctx,version))
11793 return false;
11794
11795 int intValue;
11796 float value;
11797
11798 if (version < 140)
11799 {
11800 if (!ctx.
Read(intValue))
11801 return false;
11802
11803 m_VariablesMask = intValue;
11804 }
11805
11807 {
11808 if (!ctx.
Read(value))
11809 return false;
11810
11812 {
11814 }
11815 else
11816 {
11818 }
11819 }
11820
11821 if (version < 140)
11822 {
11824 {
11825 if (!ctx.
Read(value))
11826 return false;
11827 SetTemperatureDirect(value);
11828 }
11829 }
11830
11832 {
11833 if (!ctx.
Read(value))
11834 return false;
11836 }
11837
11839 {
11840 if (!ctx.
Read(intValue))
11841 return false;
11843 }
11844
11846 {
11847 int r,g,b,a;
11849 return false;
11851 return false;
11853 return false;
11855 return false;
11856
11858 }
11859
11861 {
11862 if (!ctx.
Read(intValue))
11863 return false;
11865 }
11866
11867 if (version >= 138 && version < 140)
11868 {
11870 {
11871 if (!ctx.
Read(intValue))
11872 return false;
11873 SetFrozen(intValue);
11874 }
11875 }
11876
11877 return true;
11878 }
11879
11880
11882 {
11885 {
11887 }
11888
11889 if (!super.OnStoreLoad(ctx, version))
11890 {
11892 return false;
11893 }
11894
11895 if (version >= 114)
11896 {
11897 bool hasQuickBarIndexSaved;
11898
11899 if (!ctx.
Read(hasQuickBarIndexSaved))
11900 {
11902 return false;
11903 }
11904
11905 if (hasQuickBarIndexSaved)
11906 {
11907 int itmQBIndex;
11908
11909
11910 if (!ctx.
Read(itmQBIndex))
11911 {
11913 return false;
11914 }
11915
11916 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11917 if (itmQBIndex != -1 && parentPlayer)
11918 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11919 }
11920 }
11921 else
11922 {
11923
11924 PlayerBase player;
11925 int itemQBIndex;
11926 if (version ==
int.
MAX)
11927 {
11928 if (!ctx.
Read(itemQBIndex))
11929 {
11931 return false;
11932 }
11933 }
11934 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11935 {
11936
11937 if (!ctx.
Read(itemQBIndex))
11938 {
11940 return false;
11941 }
11942 if (itemQBIndex != -1 && player)
11943 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11944 }
11945 }
11946
11947 if (version < 140)
11948 {
11949
11950 if (!LoadVariables(ctx, version))
11951 {
11953 return false;
11954 }
11955 }
11956
11957
11959 {
11961 return false;
11962 }
11963 if (version >= 132)
11964 {
11966 if (raib)
11967 {
11969 {
11971 return false;
11972 }
11973 }
11974 }
11975
11977 return true;
11978 }
11979
11980
11981
11983 {
11984 super.OnStoreSave(ctx);
11985
11986 PlayerBase player;
11987 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11988 {
11990
11991 int itemQBIndex = -1;
11992 itemQBIndex = player.FindQuickBarEntityIndex(this);
11993 ctx.
Write(itemQBIndex);
11994 }
11995 else
11996 {
11998 }
11999
12001
12003 if (raib)
12004 {
12006 }
12007 }
12008
12009
12011 {
12012 super.AfterStoreLoad();
12013
12015 {
12017 }
12018
12020 {
12023 }
12024 }
12025
12027 {
12028 super.EEOnAfterLoad();
12029
12031 {
12033 }
12034
12037 }
12038
12040 {
12041 return false;
12042 }
12043
12044
12045
12047 {
12049 {
12050 #ifdef PLATFORM_CONSOLE
12051
12053 {
12055 if (menu)
12056 {
12058 }
12059 }
12060 #endif
12061 }
12062
12064 {
12067 }
12068
12070 {
12071 SetWeightDirty();
12073 }
12075 {
12078 }
12079
12081 {
12084 }
12086 {
12089 }
12090
12091 super.OnVariablesSynchronized();
12092 }
12093
12094
12095
12097 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12098 {
12099 if (!IsServerCheck(allow_client))
12100 return false;
12101
12103 return false;
12104
12107
12108 if (value <= (min + 0.001))
12109 value = min;
12110
12111 if (value == min)
12112 {
12113 if (destroy_config)
12114 {
12115 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12116 if (dstr)
12117 {
12119 this.Delete();
12120 return true;
12121 }
12122 }
12123 else if (destroy_forced)
12124 {
12126 this.Delete();
12127 return true;
12128 }
12129
12131 }
12132
12135
12137 {
12139
12140 if (delta)
12142 }
12143
12145
12146 return false;
12147 }
12148
12149
12151 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12152 {
12154 }
12155
12157 {
12160 }
12161
12163 {
12166 }
12167
12169 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12170 {
12171 float value_clamped = Math.Clamp(value, 0, 1);
12173 SetQuantity(result, destroy_config, destroy_forced);
12174 }
12175
12176
12179 {
12181 }
12182
12184 {
12186 }
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12198 {
12199 int slot = -1;
12200 if (GetInventory())
12201 {
12202 InventoryLocation il = new InventoryLocation;
12203 GetInventory().GetCurrentInventoryLocation(il);
12205 }
12206
12208 }
12209
12211 {
12212 float quantity_max = 0;
12213
12215 {
12216 if (attSlotID != -1)
12217 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12218
12219 if (quantity_max <= 0)
12221 }
12222
12223 if (quantity_max <= 0)
12225
12226 return quantity_max;
12227 }
12228
12230 {
12232 }
12233
12235 {
12237 }
12238
12239
12241 {
12243 }
12244
12246 {
12248 }
12249
12251 {
12253 }
12254
12255
12257 {
12258
12259 float weightEx = GetWeightEx();
12260 float special = GetInventoryAndCargoWeight();
12261 return weightEx - special;
12262 }
12263
12264
12266 {
12268 }
12269
12271 {
12273 {
12274 #ifdef DEVELOPER
12275 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12276 {
12277 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12279 }
12280 #endif
12281
12282 return GetQuantity() * GetConfigWeightModified();
12283 }
12284 else if (HasEnergyManager())
12285 {
12286 #ifdef DEVELOPER
12287 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12288 {
12289 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12290 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12291 }
12292 #endif
12293 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12294 }
12295 else
12296 {
12297 #ifdef DEVELOPER
12298 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12299 {
12300 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12301 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12302 }
12303 #endif
12304 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12305 }
12306 }
12307
12310 {
12311 int item_count = 0;
12313
12314 if (GetInventory().GetCargo() != NULL)
12315 {
12316 item_count = GetInventory().GetCargo().GetItemCount();
12317 }
12318
12319 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12320 {
12321 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12322 if (item)
12323 item_count += item.GetNumberOfItems();
12324 }
12325 return item_count;
12326 }
12327
12330 {
12331 float weight = 0;
12332 float wetness = 1;
12333 if (include_wetness)
12336 {
12337 weight = wetness * m_ConfigWeight;
12338 }
12340 {
12341 weight = 1;
12342 }
12343 return weight;
12344 }
12345
12346
12347
12349 {
12350 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12351 {
12352 GameInventory inv = GetInventory();
12353 array<EntityAI> items = new array<EntityAI>;
12355 for (int i = 0; i < items.Count(); i++)
12356 {
12358 if (item)
12359 {
12361 }
12362 }
12363 }
12364 }
12365
12366
12367
12368
12370 {
12371 float energy = 0;
12372 if (HasEnergyManager())
12373 {
12374 energy = GetCompEM().GetEnergy();
12375 }
12376 return energy;
12377 }
12378
12379
12381 {
12382 super.OnEnergyConsumed();
12383
12385 }
12386
12388 {
12389 super.OnEnergyAdded();
12390
12392 }
12393
12394
12396 {
12397 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12398 {
12400 {
12401 float energy_0to1 = GetCompEM().GetEnergy0To1();
12403 }
12404 }
12405 }
12406
12407
12409 {
12410 return ConfigGetFloat("heatIsolation");
12411 }
12412
12414 {
12416 }
12417
12419 {
12420 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12421 if (
GetGame().ConfigIsExisting(paramPath))
12423
12424 return 0.0;
12425 }
12426
12428 {
12429 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12430 if (
GetGame().ConfigIsExisting(paramPath))
12432
12433 return 0.0;
12434 }
12435
12436 override void SetWet(
float value,
bool allow_client =
false)
12437 {
12438 if (!IsServerCheck(allow_client))
12439 return;
12440
12443
12445
12446 m_VarWet = Math.Clamp(value, min, max);
12447
12449 {
12452 }
12453 }
12454
12455 override void AddWet(
float value)
12456 {
12458 }
12459
12461 {
12463 }
12464
12466 {
12468 }
12469
12471 {
12473 }
12474
12476 {
12478 }
12479
12481 {
12483 }
12484
12485 override void OnWetChanged(
float newVal,
float oldVal)
12486 {
12489 if (newLevel != oldLevel)
12490 {
12492 }
12493 }
12494
12496 {
12497 SetWeightDirty();
12498 }
12499
12501 {
12502 return GetWetLevelInternal(
m_VarWet);
12503 }
12504
12505
12506
12508 {
12510 }
12511
12513 {
12515 }
12516
12518 {
12520 }
12521
12523 {
12525 }
12526
12527
12528
12530 {
12531 if (ConfigIsExisting("itemModelLength"))
12532 {
12533 return ConfigGetFloat("itemModelLength");
12534 }
12535 return 0;
12536 }
12537
12539 {
12540 if (ConfigIsExisting("itemAttachOffset"))
12541 {
12542 return ConfigGetFloat("itemAttachOffset");
12543 }
12544 return 0;
12545 }
12546
12547 override void SetCleanness(
int value,
bool allow_client =
false)
12548 {
12549 if (!IsServerCheck(allow_client))
12550 return;
12551
12553
12555
12558 }
12559
12561 {
12563 }
12564
12566 {
12567 return true;
12568 }
12569
12570
12571
12572
12574 {
12576 }
12577
12579 {
12581 }
12582
12583
12584
12585
12586 override void SetColor(
int r,
int g,
int b,
int a)
12587 {
12593 }
12595 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12596 {
12601 }
12602
12604 {
12606 }
12607
12610 {
12611 int r,g,b,a;
12613 r = r/255;
12614 g = g/255;
12615 b = b/255;
12616 a = a/255;
12617 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12618 }
12619
12620
12621
12622 override void SetLiquidType(
int value,
bool allow_client =
false)
12623 {
12624 if (!IsServerCheck(allow_client))
12625 return;
12626
12631 }
12632
12634 {
12635 return ConfigGetInt("varLiquidTypeInit");
12636 }
12637
12639 {
12641 }
12642
12644 {
12646 SetFrozen(false);
12647 }
12648
12651 {
12652 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12653 }
12654
12655
12658 {
12659 PlayerBase nplayer;
12660 if (PlayerBase.CastTo(nplayer, player))
12661 {
12663
12664 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12665 }
12666 }
12667
12668
12671 {
12672 PlayerBase nplayer;
12673 if (PlayerBase.CastTo(nplayer,player))
12674 {
12675
12676 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12677
12678 }
12679
12680
12681 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12682
12683
12684 if (HasEnergyManager())
12685 {
12686 GetCompEM().UpdatePlugState();
12687 }
12688 }
12689
12690
12692 {
12693 super.OnPlacementStarted(player);
12694
12696 }
12697
12698 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12699 {
12701 {
12702 m_AdminLog.OnPlacementComplete(player,
this);
12703 }
12704
12705 super.OnPlacementComplete(player, position, orientation);
12706 }
12707
12708
12709
12710
12711
12713 {
12715 {
12716 return true;
12717 }
12718 else
12719 {
12720 return false;
12721 }
12722 }
12723
12724
12726 {
12728 {
12730 }
12731 }
12732
12733
12735 {
12737 }
12738
12740 {
12742 }
12743
12744 override void InsertAgent(
int agent,
float count = 1)
12745 {
12746 if (count < 1)
12747 return;
12748
12750 }
12751
12754 {
12756 }
12757
12758
12760 {
12762 }
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12806 {
12808 return false;
12809 return true;
12810 }
12811
12813 {
12814
12816 }
12817
12818
12821 {
12822 super.CheckForRoofLimited(timeTresholdMS);
12823
12825 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12826 {
12827 m_PreviousRoofTestTime = time;
12828 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12829 }
12830 }
12831
12832
12834 {
12836 {
12837 return 0;
12838 }
12839
12840 if (GetInventory().GetAttachmentSlotsCount() != 0)
12841 {
12842 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12843 if (filter)
12844 return filter.GetProtectionLevel(type, false, system);
12845 else
12846 return 0;
12847 }
12848
12849 string subclassPath, entryName;
12850
12851 switch (type)
12852 {
12854 entryName = "biological";
12855 break;
12857 entryName = "chemical";
12858 break;
12859 default:
12860 entryName = "biological";
12861 break;
12862 }
12863
12864 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12865
12867 }
12868
12869
12870
12873 {
12874 if (!IsMagazine())
12876
12878 }
12879
12880
12881
12882
12883
12888 {
12889 return true;
12890 }
12891
12893 {
12895 }
12896
12897
12898
12899
12900
12902 {
12903 if (parent)
12904 {
12905 if (parent.IsInherited(DayZInfected))
12906 return true;
12907
12908 if (!parent.IsRuined())
12909 return true;
12910 }
12911
12912 return true;
12913 }
12914
12916 {
12917 if (!super.CanPutAsAttachment(parent))
12918 {
12919 return false;
12920 }
12921
12922 if (!IsRuined() && !parent.IsRuined())
12923 {
12924 return true;
12925 }
12926
12927 return false;
12928 }
12929
12931 {
12932
12933
12934
12935
12936 return super.CanReceiveItemIntoCargo(item);
12937 }
12938
12940 {
12941
12942
12943
12944
12945 GameInventory attachmentInv = attachment.GetInventory();
12947 {
12948 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12949 return false;
12950 }
12951
12952 InventoryLocation loc = new InventoryLocation();
12953 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12954 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12955 return false;
12956
12957 return super.CanReceiveAttachment(attachment, slotId);
12958 }
12959
12961 {
12962 if (!super.CanReleaseAttachment(attachment))
12963 return false;
12964
12965 return GetInventory().AreChildrenAccessible();
12966 }
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12989 {
12990 int id = muzzle_owner.GetMuzzleID();
12991 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12992
12993 if (WPOF_array)
12994 {
12995 for (int i = 0; i < WPOF_array.Count(); i++)
12996 {
12997 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12998
12999 if (WPOF)
13000 {
13001 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13002 }
13003 }
13004 }
13005 }
13006
13007
13009 {
13010 int id = muzzle_owner.GetMuzzleID();
13012
13013 if (WPOBE_array)
13014 {
13015 for (int i = 0; i < WPOBE_array.Count(); i++)
13016 {
13017 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13018
13019 if (WPOBE)
13020 {
13021 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13022 }
13023 }
13024 }
13025 }
13026
13027
13029 {
13030 int id = muzzle_owner.GetMuzzleID();
13031 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13032
13033 if (WPOOH_array)
13034 {
13035 for (int i = 0; i < WPOOH_array.Count(); i++)
13036 {
13037 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13038
13039 if (WPOOH)
13040 {
13041 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13042 }
13043 }
13044 }
13045 }
13046
13047
13049 {
13050 int id = muzzle_owner.GetMuzzleID();
13051 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13052
13053 if (WPOOH_array)
13054 {
13055 for (int i = 0; i < WPOOH_array.Count(); i++)
13056 {
13057 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13058
13059 if (WPOOH)
13060 {
13061 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13062 }
13063 }
13064 }
13065 }
13066
13067
13069 {
13070 int id = muzzle_owner.GetMuzzleID();
13071 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13072
13073 if (WPOOH_array)
13074 {
13075 for (int i = 0; i < WPOOH_array.Count(); i++)
13076 {
13077 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13078
13079 if (WPOOH)
13080 {
13081 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13082 }
13083 }
13084 }
13085 }
13086
13087
13088
13090 {
13092 {
13093 return true;
13094 }
13095
13096 return false;
13097 }
13098
13100 {
13102 {
13103 return true;
13104 }
13105
13106 return false;
13107 }
13108
13110 {
13112 {
13113 return true;
13114 }
13115
13116 return false;
13117 }
13118
13120 {
13121 return false;
13122 }
13123
13126 {
13127 return UATimeSpent.DEFAULT_DEPLOY;
13128 }
13129
13130
13131
13132
13134 {
13136 SetSynchDirty();
13137 }
13138
13140 {
13142 }
13143
13144
13146 {
13147 return false;
13148 }
13149
13152 {
13153 string att_type = "None";
13154
13155 if (ConfigIsExisting("soundAttType"))
13156 {
13157 att_type = ConfigGetString("soundAttType");
13158 }
13159
13161 }
13162
13164 {
13166 }
13167
13168
13169
13170
13171
13177
13179 {
13182
13184 }
13185
13186
13188 {
13190 return;
13191
13193
13196
13199
13200 SoundParameters params = new SoundParameters();
13204 }
13205
13206
13208 {
13210 return;
13211
13213 SetSynchDirty();
13214
13217 }
13218
13219
13221 {
13223 return;
13224
13226 SetSynchDirty();
13227
13230 }
13231
13233 {
13235 }
13236
13238 {
13240 }
13241
13244 {
13245 if (!
GetGame().IsDedicatedServer())
13246 {
13247 if (ConfigIsExisting("attachSoundSet"))
13248 {
13249 string cfg_path = "";
13250 string soundset = "";
13251 string type_name =
GetType();
13252
13255 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13256 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13257
13258 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13259 {
13260 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13261 {
13262 if (cfg_slot_array[i] == slot_type)
13263 {
13264 soundset = cfg_soundset_array[i];
13265 break;
13266 }
13267 }
13268 }
13269
13270 if (soundset != "")
13271 {
13272 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13274 }
13275 }
13276 }
13277 }
13278
13280 {
13281
13282 }
13283
13284 void OnApply(PlayerBase player);
13285
13287 {
13288 return 1.0;
13289 };
13290
13292 {
13294 }
13295
13297 {
13299 }
13300
13302
13304 {
13305 SetDynamicPhysicsLifeTime(0.01);
13307 }
13308
13310 {
13311 array<string> zone_names = new array<string>;
13312 GetDamageZones(zone_names);
13313 for (int i = 0; i < zone_names.Count(); i++)
13314 {
13315 SetHealthMax(zone_names.Get(i),"Health");
13316 }
13317 SetHealthMax("","Health");
13318 }
13319
13322 {
13323 float global_health = GetHealth01("","Health");
13324 array<string> zones = new array<string>;
13325 GetDamageZones(zones);
13326
13327 for (int i = 0; i < zones.Count(); i++)
13328 {
13329 SetHealth01(zones.Get(i),"Health",global_health);
13330 }
13331 }
13332
13335 {
13336 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13337 }
13338
13340 {
13341 if (!hasRootAsPlayer)
13342 {
13343 if (refParentIB)
13344 {
13345
13346 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13347 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13348
13349 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13350 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13351
13354 }
13355 else
13356 {
13357
13360 }
13361 }
13362 }
13363
13365 {
13367 {
13368 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13369 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13370 {
13371 float heatPermCoef = 1.0;
13373 while (ent)
13374 {
13375 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13376 ent = ent.GetHierarchyParent();
13377 }
13378
13379 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13380 }
13381 }
13382 }
13383
13385 {
13386
13387 EntityAI parent = GetHierarchyParent();
13388 if (!parent)
13389 {
13390 hasParent = false;
13391 hasRootAsPlayer = false;
13392 }
13393 else
13394 {
13395 hasParent = true;
13396 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13397 refParentIB =
ItemBase.Cast(parent);
13398 }
13399 }
13400
13401 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13402 {
13403
13404 }
13405
13407 {
13408
13409 return false;
13410 }
13411
13413 {
13414
13415
13416 return false;
13417 }
13418
13420 {
13421
13422 return false;
13423 }
13424
13427 {
13428 return !GetIsFrozen() &&
IsOpen();
13429 }
13430
13432 {
13433 bool hasParent = false, hasRootAsPlayer = false;
13435
13436 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13437 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13438
13439 if (wwtu || foodDecay)
13440 {
13444
13445 if (processWetness || processTemperature || processDecay)
13446 {
13448
13449 if (processWetness)
13450 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13451
13452 if (processTemperature)
13454
13455 if (processDecay)
13456 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13457 }
13458 }
13459 }
13460
13463 {
13465 }
13466
13468 {
13471
13472 return super.GetTemperatureFreezeThreshold();
13473 }
13474
13476 {
13479
13480 return super.GetTemperatureThawThreshold();
13481 }
13482
13484 {
13487
13488 return super.GetItemOverheatThreshold();
13489 }
13490
13492 {
13494 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13495
13496 return super.GetTemperatureFreezeTime();
13497 }
13498
13500 {
13502 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13503
13504 return super.GetTemperatureThawTime();
13505 }
13506
13511
13513 {
13514 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13515 }
13516
13518 {
13519 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13520 }
13521
13524 {
13526 }
13527
13529 {
13531 }
13532
13534 {
13536 }
13537
13540 {
13541 return null;
13542 }
13543
13546 {
13547 return false;
13548 }
13549
13551 {
13553 {
13556 if (!trg)
13557 {
13559 explosive = this;
13560 }
13561
13562 explosive.PairRemote(trg);
13564
13565 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13566 trg.SetPersistentPairID(persistentID);
13567 explosive.SetPersistentPairID(persistentID);
13568
13569 return true;
13570 }
13571 return false;
13572 }
13573
13576 {
13577 float ret = 1.0;
13580 ret *= GetHealth01();
13581
13582 return ret;
13583 }
13584
13585 #ifdef DEVELOPER
13586 override void SetDebugItem()
13587 {
13588 super.SetDebugItem();
13589 _itemBase = this;
13590 }
13591
13593 {
13594 string text = super.GetDebugText();
13595
13597 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13598
13599 return text;
13600 }
13601 #endif
13602
13604 {
13605 return true;
13606 }
13607
13609
13611
13613 {
13616 }
13617
13618
13626
13642}
13643
13645{
13647 if (entity)
13648 {
13649 bool is_item = entity.IsInherited(
ItemBase);
13650 if (is_item && full_quantity)
13651 {
13654 }
13655 }
13656 else
13657 {
13659 return NULL;
13660 }
13661 return entity;
13662}
13663
13665{
13666 if (item)
13667 {
13668 if (health > 0)
13669 item.SetHealth("", "", health);
13670
13671 if (item.CanHaveTemperature())
13672 {
13674 if (item.CanFreeze())
13675 item.SetFrozen(false);
13676 }
13677
13678 if (item.HasEnergyManager())
13679 {
13680 if (quantity >= 0)
13681 {
13682 item.GetCompEM().SetEnergy0To1(quantity);
13683 }
13684 else
13685 {
13687 }
13688 }
13689 else if (item.IsMagazine())
13690 {
13691 Magazine mag = Magazine.Cast(item);
13692 if (quantity >= 0)
13693 {
13694 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13695 }
13696 else
13697 {
13699 }
13700
13701 }
13702 else
13703 {
13704 if (quantity >= 0)
13705 {
13706 item.SetQuantityNormalized(quantity, false);
13707 }
13708 else
13709 {
13711 }
13712
13713 }
13714 }
13715}
13716
13717#ifdef DEVELOPER
13719#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.