8852{
8854 {
8855 return true;
8856 }
8857};
8858
8859
8860
8862{
8866
8868
8871
8872
8873
8874
8875
8884
8890
8895
8900
8921 protected bool m_IsResultOfSplit
8922
8924
8929
8930
8931
8933
8937
8938
8939
8941
8944
8945
8946
8952
8953
8961
8964
8965
8967
8968
8970
8971
8976
8977
8982
8983
8985
8986
8988 {
8993
8994 if (!
GetGame().IsDedicatedServer())
8995 {
8997 {
8999
9001 {
9003 }
9004 }
9005
9008 }
9009
9010 m_OldLocation = null;
9011
9013 {
9015 }
9016
9017 if (ConfigIsExisting("headSelectionsToHide"))
9018 {
9021 }
9022
9024 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9025 {
9027 }
9028
9030
9031 m_IsResultOfSplit = false;
9032
9034 }
9035
9037 {
9038 super.InitItemVariables();
9039
9045 m_Count = ConfigGetInt(
"count");
9046
9049
9054
9057
9062
9074
9078
9079
9082 if (ConfigIsExisting("canBeSplit"))
9083 {
9086 }
9087
9089 if (ConfigIsExisting("itemBehaviour"))
9091
9092
9095 RegisterNetSyncVariableInt("m_VarLiquidType");
9096 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9097
9098 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9099 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9100 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9101
9102 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9103 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9104 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9105 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9106
9107 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9108 RegisterNetSyncVariableBool("m_IsTakeable");
9109 RegisterNetSyncVariableBool("m_IsHologram");
9110
9113 {
9116 }
9117
9119
9121 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9123
9124 }
9125
9127 {
9129 }
9130
9132 {
9135 {
9140 }
9141 }
9142
9143 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9144 {
9146 {
9149 }
9150
9152 }
9153
9155 {
9161 }
9162
9164
9166 {
9168
9169 if (!action)
9170 {
9171 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9172 return;
9173 }
9174
9176 if (!ai)
9177 {
9179 return;
9180 }
9181
9183 if (!action_array)
9184 {
9185 action_array = new array<ActionBase_Basic>;
9187 }
9188 if (LogManager.IsActionLogEnable())
9189 {
9190 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9191 }
9192
9193 if (action_array.Find(action) != -1)
9194 {
9195 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9196 }
9197 else
9198 {
9199 action_array.Insert(action);
9200 }
9201 }
9202
9204 {
9206 ActionBase action = player.GetActionManager().GetAction(actionName);
9209
9210 if (action_array)
9211 {
9212 action_array.RemoveItem(action);
9213 }
9214 }
9215
9216
9217
9219 {
9220 ActionOverrideData overrideData = new ActionOverrideData();
9224
9226 if (!actionMap)
9227 {
9230 }
9231
9232 actionMap.Insert(this.
Type(), overrideData);
9233
9234 }
9235
9237
9239
9240
9242 {
9245
9248
9249 string config_to_search = "CfgVehicles";
9250 string muzzle_owner_config;
9251
9253 {
9254 if (IsInherited(Weapon))
9255 config_to_search = "CfgWeapons";
9256
9257 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9258
9259 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9260
9262
9263 if (config_OnFire_subclass_count > 0)
9264 {
9265 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9266
9267 for (int i = 0; i < config_OnFire_subclass_count; i++)
9268 {
9269 string particle_class = "";
9271 string config_OnFire_entry = config_OnFire_class + particle_class;
9272 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9273 WPOF_array.Insert(WPOF);
9274 }
9275
9276
9278 }
9279 }
9280
9282 {
9283 config_to_search = "CfgWeapons";
9284 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9285
9286 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9287
9289
9290 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9291 {
9292 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9293
9294 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9295 {
9296 string particle_class2 = "";
9298 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9299 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9300 WPOBE_array.Insert(WPOBE);
9301 }
9302
9303
9305 }
9306 }
9307 }
9308
9309
9311 {
9314
9316 {
9317 string config_to_search = "CfgVehicles";
9318
9319 if (IsInherited(Weapon))
9320 config_to_search = "CfgWeapons";
9321
9322 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9323 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9324
9325 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9326 {
9327
9329
9331 {
9333 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9335 return;
9336 }
9337
9340
9341
9342
9344 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9345
9346 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9347 {
9348 string particle_class = "";
9350 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9352
9353 if (entry_type == CT_CLASS)
9354 {
9355 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9356 WPOOH_array.Insert(WPOF);
9357 }
9358 }
9359
9360
9362 }
9363 }
9364 }
9365
9367 {
9369 }
9370
9372 {
9374 {
9376
9379
9382
9383 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9384 }
9385 }
9386
9388 {
9390 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9391
9393 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9394
9396 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9397
9399 {
9401 }
9402 }
9403
9405 {
9407 }
9408
9410 {
9413 else
9415
9417 {
9420 }
9421 else
9422 {
9425
9428 }
9429
9431 }
9432
9434 {
9436 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9437 }
9438
9440 {
9442 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9444 }
9445
9447 {
9449 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9450 }
9451
9453 {
9456
9457 OverheatingParticle OP = new OverheatingParticle();
9462
9464 }
9465
9467 {
9470
9471 return -1;
9472 }
9473
9475 {
9477 {
9480
9481 for (int i = count; i > 0; --i)
9482 {
9483 int id = i - 1;
9486
9489
9490 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9491 {
9492 if (p)
9493 {
9496 }
9497 }
9498 }
9499 }
9500 }
9501
9503 {
9505 {
9507 {
9508 int id = i - 1;
9510
9511 if (OP)
9512 {
9514
9515 if (p)
9516 {
9518 }
9519
9520 delete OP;
9521 }
9522 }
9523
9526 }
9527 }
9528
9531 {
9532 return 0.0;
9533 }
9534
9535
9537 {
9538 return 250;
9539 }
9540
9542 {
9543 return 0;
9544 }
9545
9548 {
9550 return true;
9551
9552 return false;
9553 }
9554
9557 {
9560
9562 {
9564 }
9565 else
9566 {
9567
9569 }
9570
9572 }
9573
9580 {
9581 return -1;
9582 }
9583
9584
9585
9586
9588 {
9590 {
9592 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9593
9594 if (r_index >= 0)
9595 {
9596 InventoryLocation r_il = new InventoryLocation;
9597 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9598
9599 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9602 {
9603 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9604 }
9606 {
9607 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9608 }
9609
9610 }
9611
9612 player.GetHumanInventory().ClearUserReservedLocation(this);
9613 }
9614
9617 }
9618
9619
9620
9621
9623 {
9624 return ItemBase.m_DebugActionsMask;
9625 }
9626
9628 {
9629 return ItemBase.m_DebugActionsMask & mask;
9630 }
9631
9633 {
9634 ItemBase.m_DebugActionsMask = mask;
9635 }
9636
9638 {
9639 ItemBase.m_DebugActionsMask |= mask;
9640 }
9641
9643 {
9644 ItemBase.m_DebugActionsMask &= ~mask;
9645 }
9646
9648 {
9650 {
9652 }
9653 else
9654 {
9656 }
9657 }
9658
9659
9661 {
9662 if (GetEconomyProfile())
9663 {
9664 float q_max = GetEconomyProfile().GetQuantityMax();
9665 if (q_max > 0)
9666 {
9667 float q_min = GetEconomyProfile().GetQuantityMin();
9668 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9669
9671 {
9672 ComponentEnergyManager comp = GetCompEM();
9674 {
9676 }
9677 }
9679 {
9681
9682 }
9683
9684 }
9685 }
9686 }
9687
9690 {
9691 EntityAI parent = GetHierarchyParent();
9692
9693 if (parent)
9694 {
9695 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9696 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9697 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9698 }
9699 }
9700
9703 {
9704 EntityAI parent = GetHierarchyParent();
9705
9706 if (parent)
9707 {
9708 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9709 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9710 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9711 }
9712 }
9713
9715 {
9716
9717
9718
9719
9721
9723 {
9724 if (ScriptInputUserData.CanStoreInputUserData())
9725 {
9726 ScriptInputUserData ctx = new ScriptInputUserData;
9732 ctx.
Write(use_stack_max);
9735
9737 {
9738 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9739 }
9740 }
9741 }
9742 else if (!
GetGame().IsMultiplayer())
9743 {
9745 }
9746 }
9747
9749 {
9751 }
9752
9754 {
9756 }
9757
9759 {
9761 }
9762
9764 {
9765
9766 return false;
9767 }
9768
9770 {
9771 return false;
9772 }
9773
9777 {
9778 return false;
9779 }
9780
9782 {
9783 return "";
9784 }
9785
9787
9789 {
9790 return false;
9791 }
9792
9794 {
9795 return true;
9796 }
9797
9798
9799
9801 {
9802 return true;
9803 }
9804
9806 {
9807 return true;
9808 }
9809
9811 {
9812 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9814 }
9815
9817 {
9819 }
9820
9822 {
9824 if (!is_being_placed)
9826 SetSynchDirty();
9827 }
9828
9829
9831
9833 {
9835 }
9836
9838 {
9840 }
9841
9843 {
9844 return 1;
9845 }
9846
9848 {
9849 return false;
9850 }
9851
9853 {
9855 SetSynchDirty();
9856 }
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9893 {
9894 super.OnMovedInsideCargo(container);
9895
9896 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9897 }
9898
9899 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9900 {
9901 super.EEItemLocationChanged(oldLoc,newLoc);
9902
9903 PlayerBase new_player = null;
9904 PlayerBase old_player = null;
9905
9906 if (newLoc.GetParent())
9907 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9908
9909 if (oldLoc.GetParent())
9910 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9911
9913 {
9914 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9915
9916 if (r_index >= 0)
9917 {
9918 InventoryLocation r_il = new InventoryLocation;
9919 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9920
9921 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9924 {
9925 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9926 }
9928 {
9929 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9930 }
9931
9932 }
9933 }
9934
9936 {
9937 if (new_player)
9938 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9939
9940 if (new_player == old_player)
9941 {
9942
9943 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9944 {
9946 {
9947 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9948 {
9949 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9950 }
9951 }
9952 else
9953 {
9954 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9955 }
9956 }
9957
9958 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9959 {
9960 int type = oldLoc.GetType();
9962 {
9963 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9964 }
9966 {
9967 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9968 }
9969 }
9970 if (!m_OldLocation)
9971 {
9972 m_OldLocation = new InventoryLocation;
9973 }
9974 m_OldLocation.Copy(oldLoc);
9975 }
9976 else
9977 {
9978 if (m_OldLocation)
9979 {
9980 m_OldLocation.Reset();
9981 }
9982 }
9983
9985 }
9986 else
9987 {
9988 if (new_player)
9989 {
9990 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9991 if (res_index >= 0)
9992 {
9993 InventoryLocation il = new InventoryLocation;
9994 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9996 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9999 {
10000 il.
GetParent().GetOnReleaseLock().Invoke(it);
10001 }
10003 {
10005 }
10006
10007 }
10008 }
10010 {
10011
10013 }
10014
10015 if (m_OldLocation)
10016 {
10017 m_OldLocation.Reset();
10018 }
10019 }
10020 }
10021
10022 override void EOnContact(IEntity other, Contact extra)
10023 {
10025 {
10026 int liquidType = -1;
10028 if (impactSpeed > 0.0)
10029 {
10031 #ifndef SERVER
10033 #else
10035 SetSynchDirty();
10036 #endif
10038 }
10039 }
10040
10041 #ifdef SERVER
10042 if (GetCompEM() && GetCompEM().IsPlugged())
10043 {
10044 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10045 GetCompEM().UnplugThis();
10046 }
10047 #endif
10048 }
10049
10051
10053 {
10055 }
10056
10058 {
10059
10060 }
10061
10063 {
10064 super.OnItemLocationChanged(old_owner, new_owner);
10065
10066 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10067 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10068
10069 if (!relatedPlayer && playerNew)
10070 relatedPlayer = playerNew;
10071
10072 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10073 {
10075 if (actionMgr)
10076 {
10077 ActionBase currentAction = actionMgr.GetRunningAction();
10078 if (currentAction)
10080 }
10081 }
10082
10083 Man ownerPlayerOld = null;
10084 Man ownerPlayerNew = null;
10085
10086 if (old_owner)
10087 {
10088 if (old_owner.
IsMan())
10089 {
10090 ownerPlayerOld = Man.Cast(old_owner);
10091 }
10092 else
10093 {
10094 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10095 }
10096 }
10097 else
10098 {
10100 {
10102
10103 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10104 {
10105 GetCompEM().UnplugThis();
10106 }
10107 }
10108 }
10109
10110 if (new_owner)
10111 {
10112 if (new_owner.
IsMan())
10113 {
10114 ownerPlayerNew = Man.Cast(new_owner);
10115 }
10116 else
10117 {
10118 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10119 }
10120 }
10121
10122 if (ownerPlayerOld != ownerPlayerNew)
10123 {
10124 if (ownerPlayerOld)
10125 {
10126 array<EntityAI> subItemsExit = new array<EntityAI>;
10128 for (int i = 0; i < subItemsExit.Count(); i++)
10129 {
10132 }
10133 }
10134
10135 if (ownerPlayerNew)
10136 {
10137 array<EntityAI> subItemsEnter = new array<EntityAI>;
10139 for (int j = 0; j < subItemsEnter.Count(); j++)
10140 {
10143 }
10144 }
10145 }
10146 else if (ownerPlayerNew != null)
10147 {
10148 PlayerBase nplayer;
10149 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10150 {
10151 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10153 for (int k = 0; k < subItemsUpdate.Count(); k++)
10154 {
10156 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10157 }
10158 }
10159 }
10160
10161 if (old_owner)
10162 old_owner.OnChildItemRemoved(this);
10163 if (new_owner)
10164 new_owner.OnChildItemReceived(this);
10165 }
10166
10167
10169 {
10170 super.EEDelete(parent);
10171 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10172 if (player)
10173 {
10175
10176 if (player.IsAlive())
10177 {
10178 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10179 if (r_index >= 0)
10180 {
10181 InventoryLocation r_il = new InventoryLocation;
10182 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10183
10184 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10187 {
10188 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10189 }
10191 {
10192 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10193 }
10194
10195 }
10196
10197 player.RemoveQuickBarEntityShortcut(this);
10198 }
10199 }
10200 }
10201
10203 {
10204 super.EEKilled(killer);
10205
10208 {
10209 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10210 {
10211 if (IsMagazine())
10212 {
10213 if (Magazine.Cast(this).GetAmmoCount() > 0)
10214 {
10216 }
10217 }
10218 else
10219 {
10221 }
10222 }
10223 }
10224 }
10225
10227 {
10228 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10229
10230 super.OnWasAttached(parent, slot_id);
10231
10234
10236 }
10237
10239 {
10240 super.OnWasDetached(parent, slot_id);
10241
10244 }
10245
10247 {
10248 int idx;
10251
10252 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10253 if (inventory_slots.Count() < 1)
10254 {
10255 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10256 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10257 }
10258 else
10259 {
10260 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10261 }
10262
10263 idx = inventory_slots.Find(slot);
10264 if (idx < 0)
10265 return "";
10266
10267 return attach_types.Get(idx);
10268 }
10269
10271 {
10272 int idx = -1;
10273 string slot;
10274
10277
10278 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10279 if (inventory_slots.Count() < 1)
10280 {
10281 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10282 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10283 }
10284 else
10285 {
10286 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10287 if (detach_types.Count() < 1)
10288 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10289 }
10290
10291 for (int i = 0; i < inventory_slots.Count(); i++)
10292 {
10293 slot = inventory_slots.Get(i);
10294 }
10295
10296 if (slot != "")
10297 {
10298 if (detach_types.Count() == 1)
10299 idx = 0;
10300 else
10301 idx = inventory_slots.Find(slot);
10302 }
10303 if (idx < 0)
10304 return "";
10305
10306 return detach_types.Get(idx);
10307 }
10308
10310 {
10311
10313
10314
10315 float min_time = 1;
10316 float max_time = 3;
10317 float delay = Math.RandomFloat(min_time, max_time);
10318
10319 explode_timer.Run(delay, this, "DoAmmoExplosion");
10320 }
10321
10323 {
10324 Magazine magazine = Magazine.Cast(this);
10325 int pop_sounds_count = 6;
10326 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10327
10328
10329 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10330 string sound_name = pop_sounds[ sound_idx ];
10332
10333
10334 magazine.ServerAddAmmoCount(-1);
10335
10336
10337 float min_temp_to_explode = 100;
10338
10339 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10340 {
10342 }
10343 }
10344
10345
10346 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10347 {
10348 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10349
10350 const int CHANCE_DAMAGE_CARGO = 4;
10351 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10352 const int CHANCE_DAMAGE_NOTHING = 2;
10353
10355 {
10356 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10357 int chances;
10358 int rnd;
10359
10360 if (GetInventory().GetCargo())
10361 {
10362 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10363 rnd = Math.RandomInt(0,chances);
10364
10365 if (rnd < CHANCE_DAMAGE_CARGO)
10366 {
10368 }
10369 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10370 {
10372 }
10373 }
10374 else
10375 {
10376 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10377 rnd = Math.RandomInt(0,chances);
10378
10379 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10380 {
10382 }
10383 }
10384 }
10385 }
10386
10388 {
10389 if (GetInventory().GetCargo())
10390 {
10391 int item_count = GetInventory().GetCargo().GetItemCount();
10392 if (item_count > 0)
10393 {
10394 int random_pick = Math.RandomInt(0, item_count);
10396 if (!item.IsExplosive())
10397 {
10398 item.AddHealth("","",damage);
10399 return true;
10400 }
10401 }
10402 }
10403 return false;
10404 }
10405
10407 {
10408 int attachment_count = GetInventory().AttachmentCount();
10409 if (attachment_count > 0)
10410 {
10411 int random_pick = Math.RandomInt(0, attachment_count);
10412 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10413 if (!attachment.IsExplosive())
10414 {
10415 attachment.AddHealth("","",damage);
10416 return true;
10417 }
10418 }
10419 return false;
10420 }
10421
10423 {
10425 }
10426
10428 {
10430 return GetInventory().CanRemoveEntity();
10431
10432 return false;
10433 }
10434
10436 {
10438 return;
10439
10441 {
10442 if (ScriptInputUserData.CanStoreInputUserData())
10443 {
10444 ScriptInputUserData ctx = new ScriptInputUserData;
10449 ctx.
Write(destination_entity);
10451 ctx.
Write(slot_id);
10453 }
10454 }
10455 else if (!
GetGame().IsMultiplayer())
10456 {
10458 }
10459 }
10460
10462 {
10464 return;
10465
10466 float split_quantity_new;
10470 InventoryLocation loc = new InventoryLocation;
10471
10472 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10473 {
10475 split_quantity_new = stack_max;
10476 else
10478
10479 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10480 if (new_item)
10481 {
10482 new_item.SetResultOfSplit(true);
10483 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10485 new_item.SetQuantity(split_quantity_new);
10486 }
10487 }
10488 else if (destination_entity && slot_id == -1)
10489 {
10490 if (quantity > stack_max)
10491 split_quantity_new = stack_max;
10492 else
10493 split_quantity_new = quantity;
10494
10496 {
10499 }
10500
10501 if (new_item)
10502 {
10503 new_item.SetResultOfSplit(true);
10504 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10506 new_item.SetQuantity(split_quantity_new);
10507 }
10508 }
10509 else
10510 {
10511 if (stack_max != 0)
10512 {
10514 {
10516 }
10517
10518 if (split_quantity_new == 0)
10519 {
10520 if (!
GetGame().IsMultiplayer())
10521 player.PhysicalPredictiveDropItem(this);
10522 else
10523 player.ServerDropEntity(this);
10524 return;
10525 }
10526
10528
10529 if (new_item)
10530 {
10531 new_item.SetResultOfSplit(true);
10532 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10534 new_item.SetQuantity(stack_max);
10535 new_item.PlaceOnSurface();
10536 }
10537 }
10538 }
10539 }
10540
10542 {
10544 return;
10545
10546 float split_quantity_new;
10550 InventoryLocation loc = new InventoryLocation;
10551
10552 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10553 {
10555 split_quantity_new = stack_max;
10556 else
10558
10559 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10560 if (new_item)
10561 {
10562 new_item.SetResultOfSplit(true);
10563 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10565 new_item.SetQuantity(split_quantity_new);
10566 }
10567 }
10568 else if (destination_entity && slot_id == -1)
10569 {
10570 if (quantity > stack_max)
10571 split_quantity_new = stack_max;
10572 else
10573 split_quantity_new = quantity;
10574
10576 {
10579 }
10580
10581 if (new_item)
10582 {
10583 new_item.SetResultOfSplit(true);
10584 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10586 new_item.SetQuantity(split_quantity_new);
10587 }
10588 }
10589 else
10590 {
10591 if (stack_max != 0)
10592 {
10594 {
10596 }
10597
10599
10600 if (new_item)
10601 {
10602 new_item.SetResultOfSplit(true);
10603 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10605 new_item.SetQuantity(stack_max);
10606 new_item.PlaceOnSurface();
10607 }
10608 }
10609 }
10610 }
10611
10613 {
10615 return;
10616
10618 {
10619 if (ScriptInputUserData.CanStoreInputUserData())
10620 {
10621 ScriptInputUserData ctx = new ScriptInputUserData;
10626 dst.WriteToContext(ctx);
10628 }
10629 }
10630 else if (!
GetGame().IsMultiplayer())
10631 {
10633 }
10634 }
10635
10637 {
10639 return;
10640
10642 {
10643 if (ScriptInputUserData.CanStoreInputUserData())
10644 {
10645 ScriptInputUserData ctx = new ScriptInputUserData;
10650 ctx.
Write(destination_entity);
10656 }
10657 }
10658 else if (!
GetGame().IsMultiplayer())
10659 {
10661 }
10662 }
10663
10665 {
10667 }
10668
10670 {
10672 return this;
10673
10675 float split_quantity_new;
10677 if (dst.IsValid())
10678 {
10679 int slot_id = dst.GetSlot();
10681
10682 if (quantity > stack_max)
10683 split_quantity_new = stack_max;
10684 else
10685 split_quantity_new = quantity;
10686
10688
10689 if (new_item)
10690 {
10691 new_item.SetResultOfSplit(true);
10692 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10695 }
10696
10697 return new_item;
10698 }
10699
10700 return null;
10701 }
10702
10704 {
10706 return;
10707
10709 float split_quantity_new;
10711 if (destination_entity)
10712 {
10714 if (quantity > stackable)
10715 split_quantity_new = stackable;
10716 else
10717 split_quantity_new = quantity;
10718
10719 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10720 if (new_item)
10721 {
10722 new_item.SetResultOfSplit(true);
10723 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10725 new_item.SetQuantity(split_quantity_new);
10726 }
10727 }
10728 }
10729
10731 {
10733 return;
10734
10736 {
10737 if (ScriptInputUserData.CanStoreInputUserData())
10738 {
10739 ScriptInputUserData ctx = new ScriptInputUserData;
10744 ItemBase destination_entity =
this;
10745 ctx.
Write(destination_entity);
10749 }
10750 }
10751 else if (!
GetGame().IsMultiplayer())
10752 {
10754 }
10755 }
10756
10758 {
10760 return;
10761
10763 float split_quantity_new;
10765 if (player)
10766 {
10768 if (quantity > stackable)
10769 split_quantity_new = stackable;
10770 else
10771 split_quantity_new = quantity;
10772
10773 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10774 new_item =
ItemBase.Cast(in_hands);
10775 if (new_item)
10776 {
10777 new_item.SetResultOfSplit(true);
10778 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10780 new_item.SetQuantity(split_quantity_new);
10781 }
10782 }
10783 }
10784
10786 {
10788 return;
10789
10791 float split_quantity_new = Math.Floor(quantity * 0.5);
10792
10794
10795 if (new_item)
10796 {
10797 if (new_item.GetQuantityMax() < split_quantity_new)
10798 {
10799 split_quantity_new = new_item.GetQuantityMax();
10800 }
10801
10802 new_item.SetResultOfSplit(true);
10803 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10804
10806 {
10809 }
10810 else
10811 {
10814 }
10815 }
10816 }
10817
10819 {
10821 return;
10822
10824 float split_quantity_new = Math.Floor(quantity / 2);
10825
10826 InventoryLocation invloc = new InventoryLocation;
10828
10830 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10831
10832 if (new_item)
10833 {
10834 if (new_item.GetQuantityMax() < split_quantity_new)
10835 {
10836 split_quantity_new = new_item.GetQuantityMax();
10837 }
10839 {
10842 }
10843 else
10844 {
10847 }
10848 }
10849 }
10850
10853 {
10854 SetWeightDirty();
10856
10857 if (parent)
10858 parent.OnAttachmentQuantityChangedEx(this, delta);
10859
10861 {
10863 {
10865 }
10867 {
10868 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10870 }
10871 }
10872
10873 }
10874
10877 {
10878
10879 }
10880
10883 {
10885 }
10886
10888 {
10889 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10890
10892 {
10893 if (newLevel == GameConstants.STATE_RUINED)
10894 {
10896 EntityAI parent = GetHierarchyParent();
10897 if (parent && parent.IsFireplace())
10898 {
10899 CargoBase cargo = GetInventory().GetCargo();
10900 if (cargo)
10901 {
10903 {
10905 }
10906 }
10907 }
10908 }
10909
10911 {
10912
10914 return;
10915 }
10916
10917 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10918 {
10920 }
10921 }
10922 }
10923
10924
10926 {
10927 super.OnRightClick();
10928
10930 {
10932 {
10933 if (ScriptInputUserData.CanStoreInputUserData())
10934 {
10935 vector m4[4];
10937
10938 EntityAI root = GetHierarchyRoot();
10939
10940 InventoryLocation dst = new InventoryLocation;
10942 {
10943 if (root)
10944 {
10945 root.GetTransform(m4);
10947 }
10948 else
10949 GetInventory().GetCurrentInventoryLocation(dst);
10950 }
10951 else
10952 {
10954
10955
10956 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10957 {
10958 if (root)
10959 {
10960 root.GetTransform(m4);
10962 }
10963 else
10964 GetInventory().GetCurrentInventoryLocation(dst);
10965 }
10966 else
10967 {
10968 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10969 }
10970 }
10971
10972 ScriptInputUserData ctx = new ScriptInputUserData;
10980 }
10981 }
10982 else if (!
GetGame().IsMultiplayer())
10983 {
10985 }
10986 }
10987 }
10988
10989 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10990 {
10991
10992 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10993 return false;
10994
10995 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10996 return false;
10997
10998
11000 return false;
11001
11002
11003 Magazine mag = Magazine.Cast(this);
11004 if (mag)
11005 {
11006 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11007 return false;
11008
11009 if (stack_max_limit)
11010 {
11011 Magazine other_mag = Magazine.Cast(other_item);
11012 if (other_item)
11013 {
11014 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11015 return false;
11016 }
11017
11018 }
11019 }
11020 else
11021 {
11022
11024 return false;
11025
11027 return false;
11028 }
11029
11030 PlayerBase player = null;
11031 if (CastTo(player, GetHierarchyRootPlayer()))
11032 {
11033 if (player.GetInventory().HasAttachment(this))
11034 return false;
11035
11036 if (player.IsItemsToDelete())
11037 return false;
11038 }
11039
11040 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11041 return false;
11042
11043 int slotID;
11045 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11046 return false;
11047
11048 return true;
11049 }
11050
11052 {
11054 }
11055
11057 {
11058 return m_IsResultOfSplit;
11059 }
11060
11062 {
11063 m_IsResultOfSplit = value;
11064 }
11065
11067 {
11069 }
11070
11072 {
11073 float other_item_quantity = other_item.GetQuantity();
11074 float this_free_space;
11075
11077
11079
11080 if (other_item_quantity > this_free_space)
11081 {
11082 return this_free_space;
11083 }
11084 else
11085 {
11086 return other_item_quantity;
11087 }
11088 }
11089
11091 {
11093 }
11094
11096 {
11098 return;
11099
11100 if (!IsMagazine() && other_item)
11101 {
11103 if (quantity_used != 0)
11104 {
11105 float hp1 = GetHealth01("","");
11106 float hp2 = other_item.GetHealth01("","");
11107 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11108 hpResult = hpResult / (
GetQuantity() + quantity_used);
11109
11110 hpResult *= GetMaxHealth();
11111 Math.Round(hpResult);
11112 SetHealth("", "Health", hpResult);
11113
11115 other_item.AddQuantity(-quantity_used);
11116 }
11117 }
11119 }
11120
11122 {
11123 #ifdef SERVER
11124 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11125 GetHierarchyParent().IncreaseLifetimeUp();
11126 #endif
11127 };
11128
11130 {
11131 PlayerBase p = PlayerBase.Cast(player);
11132
11133 array<int> recipesIds = p.m_Recipes;
11134 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11135 if (moduleRecipesManager)
11136 {
11137 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11138 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11139 }
11140
11141 for (int i = 0;i < recipesIds.Count(); i++)
11142 {
11143 int key = recipesIds.Get(i);
11144 string recipeName = moduleRecipesManager.GetRecipeName(key);
11146 }
11147 }
11148
11149
11150 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11151 {
11152 super.GetDebugActions(outputList);
11153
11154
11159
11160
11164
11168
11169
11172
11173
11175 {
11178 }
11179
11181
11184
11188 }
11189
11190
11191
11192
11194 {
11195 super.OnAction(action_id, player, ctx);
11196 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11197 {
11198 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11199 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11200 PlayerBase p = PlayerBase.Cast(player);
11201 if (
EActions.RECIPES_RANGE_START < 1000)
11202 {
11203 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11204 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11205 }
11206 }
11207 #ifndef SERVER
11208 else if (action_id ==
EActions.WATCH_PLAYER)
11209 {
11210 PluginDeveloper.SetDeveloperItemClientEx(player);
11211 }
11212 #endif
11214 {
11215 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11216 {
11217 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11218 OnDebugButtonPressServer(id + 1);
11219 }
11220
11221 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11222 {
11223 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11225 }
11226
11227 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11228 {
11229 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11231 }
11232
11233 else if (action_id ==
EActions.ADD_QUANTITY)
11234 {
11235 if (IsMagazine())
11236 {
11237 Magazine mag = Magazine.Cast(this);
11238 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11239 }
11240 else
11241 {
11243 }
11244
11245 if (m_EM)
11246 {
11247 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11248 }
11249
11250 }
11251
11252 else if (action_id ==
EActions.REMOVE_QUANTITY)
11253 {
11254 if (IsMagazine())
11255 {
11256 Magazine mag2 = Magazine.Cast(this);
11257 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11258 }
11259 else
11260 {
11262 }
11263 if (m_EM)
11264 {
11265 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11266 }
11267
11268 }
11269
11270 else if (action_id ==
EActions.SET_QUANTITY_0)
11271 {
11273
11274 if (m_EM)
11275 {
11276 m_EM.SetEnergy(0);
11277 }
11278 }
11279
11280 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11281 {
11283
11284 if (m_EM)
11285 {
11286 m_EM.SetEnergy(m_EM.GetEnergyMax());
11287 }
11288 }
11289
11290 else if (action_id ==
EActions.ADD_HEALTH)
11291 {
11292 AddHealth("","",GetMaxHealth("","Health")/5);
11293 }
11294 else if (action_id ==
EActions.REMOVE_HEALTH)
11295 {
11296 AddHealth("","",-GetMaxHealth("","Health")/5);
11297 }
11298 else if (action_id ==
EActions.DESTROY_HEALTH)
11299 {
11300 SetHealth01("","",0);
11301 }
11302 else if (action_id ==
EActions.WATCH_ITEM)
11303 {
11305 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11306 #ifdef DEVELOPER
11307 SetDebugDeveloper_item(this);
11308 #endif
11309 }
11310
11311 else if (action_id ==
EActions.ADD_TEMPERATURE)
11312 {
11313 AddTemperature(20);
11314
11315 }
11316
11317 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11318 {
11319 AddTemperature(-20);
11320
11321 }
11322
11323 else if (action_id ==
EActions.FLIP_FROZEN)
11324 {
11325 SetFrozen(!GetIsFrozen());
11326
11327 }
11328
11329 else if (action_id ==
EActions.ADD_WETNESS)
11330 {
11332
11333 }
11334
11335 else if (action_id ==
EActions.REMOVE_WETNESS)
11336 {
11338
11339 }
11340
11341 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11342 {
11345
11346
11347 }
11348
11349 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11350 {
11353 }
11354
11355 else if (action_id ==
EActions.MAKE_SPECIAL)
11356 {
11357 auto debugParams = DebugSpawnParams.WithPlayer(player);
11358 OnDebugSpawnEx(debugParams);
11359 }
11360
11361 else if (action_id ==
EActions.DELETE)
11362 {
11363 Delete();
11364 }
11365
11366 }
11367
11368
11369 return false;
11370 }
11371
11372
11373
11374
11378
11381
11382
11383
11385 {
11386 return false;
11387 }
11388
11389
11391 {
11392 return true;
11393 }
11394
11395
11397 {
11398 return true;
11399 }
11400
11401
11402
11404 {
11405 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11407 }
11408
11411 {
11412 return null;
11413 }
11414
11416 {
11417 return false;
11418 }
11419
11421 {
11422 return false;
11423 }
11424
11428
11429
11431 {
11432 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11433 return module_repairing.CanRepair(this, item_repair_kit);
11434 }
11435
11436
11437 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11438 {
11439 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11440 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11441 }
11442
11443
11445 {
11446
11447
11448
11449
11450
11451
11452
11453
11454 return 1;
11455 }
11456
11457
11458
11460 {
11462 }
11463
11464
11465
11467 {
11469 }
11470
11471
11480 {
11481 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11482
11483 if (player)
11484 {
11485 player.MessageStatus(text);
11486 }
11487 }
11488
11489
11498 {
11499 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11500
11501 if (player)
11502 {
11503 player.MessageAction(text);
11504 }
11505 }
11506
11507
11516 {
11517 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11518
11519 if (player)
11520 {
11521 player.MessageFriendly(text);
11522 }
11523 }
11524
11525
11534 {
11535 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11536
11537 if (player)
11538 {
11539 player.MessageImportant(text);
11540 }
11541 }
11542
11544 {
11545 return true;
11546 }
11547
11548
11549 override bool KindOf(
string tag)
11550 {
11551 bool found = false;
11552 string item_name = this.
GetType();
11555
11556 int array_size = item_tag_array.Count();
11557 for (int i = 0; i < array_size; i++)
11558 {
11559 if (item_tag_array.Get(i) == tag)
11560 {
11561 found = true;
11562 break;
11563 }
11564 }
11565 return found;
11566 }
11567
11568
11570 {
11571
11572 super.OnRPC(sender, rpc_type,ctx);
11573
11574
11575 switch (rpc_type)
11576 {
11577 #ifndef SERVER
11578 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11579 Param2<bool, string> p = new Param2<bool, string>(false, "");
11580
11582 return;
11583
11584 bool play = p.param1;
11585 string soundSet = p.param2;
11586
11587 if (play)
11588 {
11590 {
11592 {
11594 }
11595 }
11596 else
11597 {
11599 }
11600 }
11601 else
11602 {
11604 }
11605
11606 break;
11607 #endif
11608
11609 }
11610
11612 {
11614 }
11615 }
11616
11617
11618
11619
11621 {
11622 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11623 return plugin.GetID(
name);
11624 }
11625
11627 {
11628 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11629 return plugin.GetName(id);
11630 }
11631
11634 {
11635
11636
11637 int varFlags;
11638 if (!ctx.
Read(varFlags))
11639 return;
11640
11641 if (varFlags & ItemVariableFlags.FLOAT)
11642 {
11644 }
11645 }
11646
11648 {
11649
11650 super.SerializeNumericalVars(floats_out);
11651
11652
11653
11655 {
11657 }
11658
11660 {
11662 }
11663
11665 {
11667 }
11668
11670 {
11675 }
11676
11678 {
11680 }
11681 }
11682
11684 {
11685
11686 super.DeSerializeNumericalVars(floats);
11687
11688
11689 int index = 0;
11690 int mask = Math.Round(floats.Get(index));
11691
11692 index++;
11693
11695 {
11697 {
11699 }
11700 else
11701 {
11702 float quantity = floats.Get(index);
11703 SetQuantity(quantity,
true,
false,
false,
false);
11704 }
11705 index++;
11706 }
11707
11709 {
11710 float wet = floats.Get(index);
11712 index++;
11713 }
11714
11716 {
11717 int liquidtype = Math.Round(floats.Get(index));
11719 index++;
11720 }
11721
11723 {
11725 index++;
11727 index++;
11729 index++;
11731 index++;
11732 }
11733
11735 {
11736 int cleanness = Math.Round(floats.Get(index));
11738 index++;
11739 }
11740 }
11741
11743 {
11744 super.WriteVarsToCTX(ctx);
11745
11746
11748 {
11750 }
11751
11753 {
11755 }
11756
11758 {
11760 }
11761
11763 {
11764 int r,g,b,a;
11770 }
11771
11773 {
11775 }
11776 }
11777
11779 {
11780 if (!super.ReadVarsFromCTX(ctx,version))
11781 return false;
11782
11783 int intValue;
11784 float value;
11785
11786 if (version < 140)
11787 {
11788 if (!ctx.
Read(intValue))
11789 return false;
11790
11791 m_VariablesMask = intValue;
11792 }
11793
11795 {
11796 if (!ctx.
Read(value))
11797 return false;
11798
11800 {
11802 }
11803 else
11804 {
11806 }
11807 }
11808
11809 if (version < 140)
11810 {
11812 {
11813 if (!ctx.
Read(value))
11814 return false;
11815 SetTemperatureDirect(value);
11816 }
11817 }
11818
11820 {
11821 if (!ctx.
Read(value))
11822 return false;
11824 }
11825
11827 {
11828 if (!ctx.
Read(intValue))
11829 return false;
11831 }
11832
11834 {
11835 int r,g,b,a;
11837 return false;
11839 return false;
11841 return false;
11843 return false;
11844
11846 }
11847
11849 {
11850 if (!ctx.
Read(intValue))
11851 return false;
11853 }
11854
11855 if (version >= 138 && version < 140)
11856 {
11858 {
11859 if (!ctx.
Read(intValue))
11860 return false;
11861 SetFrozen(intValue);
11862 }
11863 }
11864
11865 return true;
11866 }
11867
11868
11870 {
11873 {
11875 }
11876
11877 if (!super.OnStoreLoad(ctx, version))
11878 {
11880 return false;
11881 }
11882
11883 if (version >= 114)
11884 {
11885 bool hasQuickBarIndexSaved;
11886
11887 if (!ctx.
Read(hasQuickBarIndexSaved))
11888 {
11890 return false;
11891 }
11892
11893 if (hasQuickBarIndexSaved)
11894 {
11895 int itmQBIndex;
11896
11897
11898 if (!ctx.
Read(itmQBIndex))
11899 {
11901 return false;
11902 }
11903
11904 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11905 if (itmQBIndex != -1 && parentPlayer)
11906 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11907 }
11908 }
11909 else
11910 {
11911
11912 PlayerBase player;
11913 int itemQBIndex;
11914 if (version ==
int.
MAX)
11915 {
11916 if (!ctx.
Read(itemQBIndex))
11917 {
11919 return false;
11920 }
11921 }
11922 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11923 {
11924
11925 if (!ctx.
Read(itemQBIndex))
11926 {
11928 return false;
11929 }
11930 if (itemQBIndex != -1 && player)
11931 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11932 }
11933 }
11934
11935 if (version < 140)
11936 {
11937
11938 if (!LoadVariables(ctx, version))
11939 {
11941 return false;
11942 }
11943 }
11944
11945
11947 {
11949 return false;
11950 }
11951 if (version >= 132)
11952 {
11954 if (raib)
11955 {
11957 {
11959 return false;
11960 }
11961 }
11962 }
11963
11965 return true;
11966 }
11967
11968
11969
11971 {
11972 super.OnStoreSave(ctx);
11973
11974 PlayerBase player;
11975 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11976 {
11978
11979 int itemQBIndex = -1;
11980 itemQBIndex = player.FindQuickBarEntityIndex(this);
11981 ctx.
Write(itemQBIndex);
11982 }
11983 else
11984 {
11986 }
11987
11989
11991 if (raib)
11992 {
11994 }
11995 }
11996
11997
11999 {
12000 super.AfterStoreLoad();
12001
12003 {
12005 }
12006
12008 {
12011 }
12012 }
12013
12015 {
12016 super.EEOnAfterLoad();
12017
12019 {
12021 }
12022
12025 }
12026
12028 {
12029 return false;
12030 }
12031
12032
12033
12035 {
12037 {
12038 #ifdef PLATFORM_CONSOLE
12039
12041 {
12043 if (menu)
12044 {
12046 }
12047 }
12048 #endif
12049 }
12050
12052 {
12055 }
12056
12058 {
12059 SetWeightDirty();
12061 }
12063 {
12066 }
12067
12069 {
12072 }
12074 {
12077 }
12078
12079 super.OnVariablesSynchronized();
12080 }
12081
12082
12083
12085 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12086 {
12087 if (!IsServerCheck(allow_client))
12088 return false;
12089
12091 return false;
12092
12095
12096 if (value <= (min + 0.001))
12097 value = min;
12098
12099 if (value == min)
12100 {
12101 if (destroy_config)
12102 {
12103 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12104 if (dstr)
12105 {
12107 this.Delete();
12108 return true;
12109 }
12110 }
12111 else if (destroy_forced)
12112 {
12114 this.Delete();
12115 return true;
12116 }
12117
12119 }
12120
12123
12125 {
12127
12128 if (delta)
12130 }
12131
12133
12134 return false;
12135 }
12136
12137
12139 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12140 {
12142 }
12143
12145 {
12148 }
12149
12151 {
12154 }
12155
12158 {
12159 float value_clamped = Math.Clamp(value, 0, 1);
12161 SetQuantity(result, destroy_config, destroy_forced);
12162 }
12163
12164
12167 {
12169 }
12170
12172 {
12174 }
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12186 {
12187 int slot = -1;
12188 if (GetInventory())
12189 {
12190 InventoryLocation il = new InventoryLocation;
12191 GetInventory().GetCurrentInventoryLocation(il);
12193 }
12194
12196 }
12197
12199 {
12200 float quantity_max = 0;
12201
12203 {
12204 if (attSlotID != -1)
12205 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12206
12207 if (quantity_max <= 0)
12209 }
12210
12211 if (quantity_max <= 0)
12213
12214 return quantity_max;
12215 }
12216
12218 {
12220 }
12221
12223 {
12225 }
12226
12227
12229 {
12231 }
12232
12234 {
12236 }
12237
12239 {
12241 }
12242
12243
12245 {
12246
12247 float weightEx = GetWeightEx();
12248 float special = GetInventoryAndCargoWeight();
12249 return weightEx - special;
12250 }
12251
12252
12254 {
12256 }
12257
12259 {
12261 {
12262 #ifdef DEVELOPER
12263 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12264 {
12265 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12267 }
12268 #endif
12269
12270 return GetQuantity() * GetConfigWeightModified();
12271 }
12272 else if (HasEnergyManager())
12273 {
12274 #ifdef DEVELOPER
12275 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12276 {
12277 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12278 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12279 }
12280 #endif
12281 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12282 }
12283 else
12284 {
12285 #ifdef DEVELOPER
12286 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12287 {
12288 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12289 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12290 }
12291 #endif
12292 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12293 }
12294 }
12295
12298 {
12299 int item_count = 0;
12301
12302 if (GetInventory().GetCargo() != NULL)
12303 {
12304 item_count = GetInventory().GetCargo().GetItemCount();
12305 }
12306
12307 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12308 {
12309 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12310 if (item)
12311 item_count += item.GetNumberOfItems();
12312 }
12313 return item_count;
12314 }
12315
12318 {
12319 float weight = 0;
12320 float wetness = 1;
12321 if (include_wetness)
12324 {
12325 weight = wetness * m_ConfigWeight;
12326 }
12328 {
12329 weight = 1;
12330 }
12331 return weight;
12332 }
12333
12334
12335
12337 {
12338 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12339 {
12340 GameInventory inv = GetInventory();
12341 array<EntityAI> items = new array<EntityAI>;
12343 for (int i = 0; i < items.Count(); i++)
12344 {
12346 if (item)
12347 {
12349 }
12350 }
12351 }
12352 }
12353
12354
12355
12356
12358 {
12359 float energy = 0;
12360 if (HasEnergyManager())
12361 {
12362 energy = GetCompEM().GetEnergy();
12363 }
12364 return energy;
12365 }
12366
12367
12369 {
12370 super.OnEnergyConsumed();
12371
12373 }
12374
12376 {
12377 super.OnEnergyAdded();
12378
12380 }
12381
12382
12384 {
12385 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12386 {
12388 {
12389 float energy_0to1 = GetCompEM().GetEnergy0To1();
12391 }
12392 }
12393 }
12394
12395
12397 {
12398 return ConfigGetFloat("heatIsolation");
12399 }
12400
12402 {
12404 }
12405
12407 {
12408 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12409 if (
GetGame().ConfigIsExisting(paramPath))
12411
12412 return 0.0;
12413 }
12414
12416 {
12417 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12418 if (
GetGame().ConfigIsExisting(paramPath))
12420
12421 return 0.0;
12422 }
12423
12424 override void SetWet(
float value,
bool allow_client =
false)
12425 {
12426 if (!IsServerCheck(allow_client))
12427 return;
12428
12431
12433
12434 m_VarWet = Math.Clamp(value, min, max);
12435
12437 {
12440 }
12441 }
12442
12443 override void AddWet(
float value)
12444 {
12446 }
12447
12449 {
12451 }
12452
12454 {
12456 }
12457
12459 {
12461 }
12462
12464 {
12466 }
12467
12469 {
12471 }
12472
12473 override void OnWetChanged(
float newVal,
float oldVal)
12474 {
12477 if (newLevel != oldLevel)
12478 {
12480 }
12481 }
12482
12484 {
12485 SetWeightDirty();
12486 }
12487
12489 {
12490 return GetWetLevelInternal(
m_VarWet);
12491 }
12492
12493
12494
12496 {
12498 }
12499
12501 {
12503 }
12504
12506 {
12508 }
12509
12511 {
12513 }
12514
12515
12516
12518 {
12519 if (ConfigIsExisting("itemModelLength"))
12520 {
12521 return ConfigGetFloat("itemModelLength");
12522 }
12523 return 0;
12524 }
12525
12527 {
12528 if (ConfigIsExisting("itemAttachOffset"))
12529 {
12530 return ConfigGetFloat("itemAttachOffset");
12531 }
12532 return 0;
12533 }
12534
12535 override void SetCleanness(
int value,
bool allow_client =
false)
12536 {
12537 if (!IsServerCheck(allow_client))
12538 return;
12539
12541
12543
12546 }
12547
12549 {
12551 }
12552
12554 {
12555 return true;
12556 }
12557
12558
12559
12560
12562 {
12564 }
12565
12567 {
12569 }
12570
12571
12572
12573
12574 override void SetColor(
int r,
int g,
int b,
int a)
12575 {
12581 }
12583 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12584 {
12589 }
12590
12592 {
12594 }
12595
12598 {
12599 int r,g,b,a;
12601 r = r/255;
12602 g = g/255;
12603 b = b/255;
12604 a = a/255;
12605 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12606 }
12607
12608
12609
12610 override void SetLiquidType(
int value,
bool allow_client =
false)
12611 {
12612 if (!IsServerCheck(allow_client))
12613 return;
12614
12619 }
12620
12622 {
12623 return ConfigGetInt("varLiquidTypeInit");
12624 }
12625
12627 {
12629 }
12630
12632 {
12634 SetFrozen(false);
12635 }
12636
12639 {
12640 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12641 }
12642
12643
12646 {
12647 PlayerBase nplayer;
12648 if (PlayerBase.CastTo(nplayer, player))
12649 {
12651
12652 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12653 }
12654 }
12655
12656
12659 {
12660 PlayerBase nplayer;
12661 if (PlayerBase.CastTo(nplayer,player))
12662 {
12663
12664 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12665
12666 }
12667
12668
12669 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12670
12671
12672 if (HasEnergyManager())
12673 {
12674 GetCompEM().UpdatePlugState();
12675 }
12676 }
12677
12678
12680 {
12681 super.OnPlacementStarted(player);
12682
12684 }
12685
12686 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12687 {
12689 {
12690 m_AdminLog.OnPlacementComplete(player,
this);
12691 }
12692
12693 super.OnPlacementComplete(player, position, orientation);
12694 }
12695
12696
12697
12698
12699
12701 {
12703 {
12704 return true;
12705 }
12706 else
12707 {
12708 return false;
12709 }
12710 }
12711
12712
12714 {
12716 {
12718 }
12719 }
12720
12721
12723 {
12725 }
12726
12728 {
12730 }
12731
12732 override void InsertAgent(
int agent,
float count = 1)
12733 {
12734 if (count < 1)
12735 return;
12736
12738 }
12739
12742 {
12744 }
12745
12746
12748 {
12750 }
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
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
12794 {
12796 return false;
12797 return true;
12798 }
12799
12801 {
12802
12804 }
12805
12806
12809 {
12810 super.CheckForRoofLimited(timeTresholdMS);
12811
12813 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12814 {
12815 m_PreviousRoofTestTime = time;
12816 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12817 }
12818 }
12819
12820
12822 {
12824 {
12825 return 0;
12826 }
12827
12828 if (GetInventory().GetAttachmentSlotsCount() != 0)
12829 {
12830 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12831 if (filter)
12832 return filter.GetProtectionLevel(type, false, system);
12833 else
12834 return 0;
12835 }
12836
12837 string subclassPath, entryName;
12838
12839 switch (type)
12840 {
12842 entryName = "biological";
12843 break;
12845 entryName = "chemical";
12846 break;
12847 default:
12848 entryName = "biological";
12849 break;
12850 }
12851
12852 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12853
12855 }
12856
12857
12858
12861 {
12862 if (!IsMagazine())
12864
12866 }
12867
12868
12869
12870
12871
12876 {
12877 return true;
12878 }
12879
12881 {
12883 }
12884
12885
12886
12887
12888
12890 {
12891 if (parent)
12892 {
12893 if (parent.IsInherited(DayZInfected))
12894 return true;
12895
12896 if (!parent.IsRuined())
12897 return true;
12898 }
12899
12900 return true;
12901 }
12902
12904 {
12905 if (!super.CanPutAsAttachment(parent))
12906 {
12907 return false;
12908 }
12909
12910 if (!IsRuined() && !parent.IsRuined())
12911 {
12912 return true;
12913 }
12914
12915 return false;
12916 }
12917
12919 {
12920
12921
12922
12923
12924 return super.CanReceiveItemIntoCargo(item);
12925 }
12926
12928 {
12929
12930
12931
12932
12933 GameInventory attachmentInv = attachment.GetInventory();
12935 {
12936 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12937 return false;
12938 }
12939
12940 InventoryLocation loc = new InventoryLocation();
12941 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12942 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12943 return false;
12944
12945 return super.CanReceiveAttachment(attachment, slotId);
12946 }
12947
12949 {
12950 if (!super.CanReleaseAttachment(attachment))
12951 return false;
12952
12953 return GetInventory().AreChildrenAccessible();
12954 }
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12977 {
12978 int id = muzzle_owner.GetMuzzleID();
12979 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12980
12981 if (WPOF_array)
12982 {
12983 for (int i = 0; i < WPOF_array.Count(); i++)
12984 {
12985 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12986
12987 if (WPOF)
12988 {
12989 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12990 }
12991 }
12992 }
12993 }
12994
12995
12997 {
12998 int id = muzzle_owner.GetMuzzleID();
13000
13001 if (WPOBE_array)
13002 {
13003 for (int i = 0; i < WPOBE_array.Count(); i++)
13004 {
13005 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13006
13007 if (WPOBE)
13008 {
13009 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13010 }
13011 }
13012 }
13013 }
13014
13015
13017 {
13018 int id = muzzle_owner.GetMuzzleID();
13019 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13020
13021 if (WPOOH_array)
13022 {
13023 for (int i = 0; i < WPOOH_array.Count(); i++)
13024 {
13025 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13026
13027 if (WPOOH)
13028 {
13029 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13030 }
13031 }
13032 }
13033 }
13034
13035
13037 {
13038 int id = muzzle_owner.GetMuzzleID();
13039 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13040
13041 if (WPOOH_array)
13042 {
13043 for (int i = 0; i < WPOOH_array.Count(); i++)
13044 {
13045 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13046
13047 if (WPOOH)
13048 {
13049 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13050 }
13051 }
13052 }
13053 }
13054
13055
13057 {
13058 int id = muzzle_owner.GetMuzzleID();
13059 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13060
13061 if (WPOOH_array)
13062 {
13063 for (int i = 0; i < WPOOH_array.Count(); i++)
13064 {
13065 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13066
13067 if (WPOOH)
13068 {
13069 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13070 }
13071 }
13072 }
13073 }
13074
13075
13076
13078 {
13080 {
13081 return true;
13082 }
13083
13084 return false;
13085 }
13086
13088 {
13090 {
13091 return true;
13092 }
13093
13094 return false;
13095 }
13096
13098 {
13100 {
13101 return true;
13102 }
13103
13104 return false;
13105 }
13106
13108 {
13109 return false;
13110 }
13111
13114 {
13115 return UATimeSpent.DEFAULT_DEPLOY;
13116 }
13117
13118
13119
13120
13122 {
13124 SetSynchDirty();
13125 }
13126
13128 {
13130 }
13131
13132
13134 {
13135 return false;
13136 }
13137
13140 {
13141 string att_type = "None";
13142
13143 if (ConfigIsExisting("soundAttType"))
13144 {
13145 att_type = ConfigGetString("soundAttType");
13146 }
13147
13149 }
13150
13152 {
13154 }
13155
13156
13157
13158
13159
13163
13165 {
13168
13170 }
13171
13172
13174 {
13176 return;
13177
13179
13182
13185
13186 SoundParameters params = new SoundParameters();
13190 }
13191
13192
13194 {
13196 return;
13197
13199 SetSynchDirty();
13200
13203 }
13204
13205
13207 {
13209 return;
13210
13212 SetSynchDirty();
13213
13216 }
13217
13219 {
13221 }
13222
13224 {
13226 }
13227
13230 {
13231 if (!
GetGame().IsDedicatedServer())
13232 {
13233 if (ConfigIsExisting("attachSoundSet"))
13234 {
13235 string cfg_path = "";
13236 string soundset = "";
13237 string type_name =
GetType();
13238
13241 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13242 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13243
13244 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13245 {
13246 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13247 {
13248 if (cfg_slot_array[i] == slot_type)
13249 {
13250 soundset = cfg_soundset_array[i];
13251 break;
13252 }
13253 }
13254 }
13255
13256 if (soundset != "")
13257 {
13258 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13260 }
13261 }
13262 }
13263 }
13264
13266 {
13267
13268 }
13269
13270 void OnApply(PlayerBase player);
13271
13273 {
13274 return 1.0;
13275 };
13276
13278 {
13280 }
13281
13283 {
13285 }
13286
13288
13290 {
13291 SetDynamicPhysicsLifeTime(0.01);
13293 }
13294
13296 {
13297 array<string> zone_names = new array<string>;
13298 GetDamageZones(zone_names);
13299 for (int i = 0; i < zone_names.Count(); i++)
13300 {
13301 SetHealthMax(zone_names.Get(i),"Health");
13302 }
13303 SetHealthMax("","Health");
13304 }
13305
13308 {
13309 float global_health = GetHealth01("","Health");
13310 array<string> zones = new array<string>;
13311 GetDamageZones(zones);
13312
13313 for (int i = 0; i < zones.Count(); i++)
13314 {
13315 SetHealth01(zones.Get(i),"Health",global_health);
13316 }
13317 }
13318
13321 {
13322 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13323 }
13324
13326 {
13327 if (!hasRootAsPlayer)
13328 {
13329 if (refParentIB)
13330 {
13331
13332 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13333 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13334
13335 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13336 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13337
13340 }
13341 else
13342 {
13343
13346 }
13347 }
13348 }
13349
13351 {
13353 {
13354 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13355 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13356 {
13357 float heatPermCoef = 1.0;
13359 while (ent)
13360 {
13361 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13362 ent = ent.GetHierarchyParent();
13363 }
13364
13365 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13366 }
13367 }
13368 }
13369
13371 {
13372
13373 EntityAI parent = GetHierarchyParent();
13374 if (!parent)
13375 {
13376 hasParent = false;
13377 hasRootAsPlayer = false;
13378 }
13379 else
13380 {
13381 hasParent = true;
13382 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13383 refParentIB =
ItemBase.Cast(parent);
13384 }
13385 }
13386
13387 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13388 {
13389
13390 }
13391
13393 {
13394
13395 return false;
13396 }
13397
13399 {
13400
13401
13402 return false;
13403 }
13404
13406 {
13407
13408 return false;
13409 }
13410
13413 {
13414 return !GetIsFrozen() &&
IsOpen();
13415 }
13416
13418 {
13419 bool hasParent = false, hasRootAsPlayer = false;
13421
13422 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13423 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13424
13425 if (wwtu || foodDecay)
13426 {
13430
13431 if (processWetness || processTemperature || processDecay)
13432 {
13434
13435 if (processWetness)
13436 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13437
13438 if (processTemperature)
13440
13441 if (processDecay)
13442 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13443 }
13444 }
13445 }
13446
13449 {
13451 }
13452
13454 {
13457
13458 return super.GetTemperatureFreezeThreshold();
13459 }
13460
13462 {
13465
13466 return super.GetTemperatureThawThreshold();
13467 }
13468
13470 {
13473
13474 return super.GetItemOverheatThreshold();
13475 }
13476
13478 {
13480 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13481
13482 return super.GetTemperatureFreezeTime();
13483 }
13484
13486 {
13488 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13489
13490 return super.GetTemperatureThawTime();
13491 }
13492
13497
13499 {
13500 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13501 }
13502
13504 {
13505 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13506 }
13507
13510 {
13512 }
13513
13515 {
13517 }
13518
13520 {
13522 }
13523
13526 {
13527 return null;
13528 }
13529
13532 {
13533 return false;
13534 }
13535
13537 {
13539 {
13542 if (!trg)
13543 {
13545 explosive = this;
13546 }
13547
13548 explosive.PairRemote(trg);
13550
13551 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13552 trg.SetPersistentPairID(persistentID);
13553 explosive.SetPersistentPairID(persistentID);
13554
13555 return true;
13556 }
13557 return false;
13558 }
13559
13562 {
13563 float ret = 1.0;
13566 ret *= GetHealth01();
13567
13568 return ret;
13569 }
13570
13571 #ifdef DEVELOPER
13572 override void SetDebugItem()
13573 {
13574 super.SetDebugItem();
13575 _itemBase = this;
13576 }
13577
13579 {
13580 string text = super.GetDebugText();
13581
13583 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13584
13585 return text;
13586 }
13587 #endif
13588
13590 {
13591 return true;
13592 }
13593
13595
13597
13599 {
13602 }
13603
13604
13612
13628}
13629
13631{
13633 if (entity)
13634 {
13635 bool is_item = entity.IsInherited(
ItemBase);
13636 if (is_item && full_quantity)
13637 {
13640 }
13641 }
13642 else
13643 {
13645 return NULL;
13646 }
13647 return entity;
13648}
13649
13651{
13652 if (item)
13653 {
13654 if (health > 0)
13655 item.SetHealth("", "", health);
13656
13657 if (item.CanHaveTemperature())
13658 {
13660 if (item.CanFreeze())
13661 item.SetFrozen(false);
13662 }
13663
13664 if (item.HasEnergyManager())
13665 {
13666 if (quantity >= 0)
13667 {
13668 item.GetCompEM().SetEnergy0To1(quantity);
13669 }
13670 else
13671 {
13673 }
13674 }
13675 else if (item.IsMagazine())
13676 {
13677 Magazine mag = Magazine.Cast(item);
13678 if (quantity >= 0)
13679 {
13680 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13681 }
13682 else
13683 {
13685 }
13686
13687 }
13688 else
13689 {
13690 if (quantity >= 0)
13691 {
13692 item.SetQuantityNormalized(quantity, false);
13693 }
13694 else
13695 {
13697 }
13698
13699 }
13700 }
13701}
13702
13703#ifdef DEVELOPER
13705#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.