8800{
8802 {
8803 return true;
8804 }
8805};
8806
8807
8808
8810{
8814
8816
8819
8820
8821
8822
8823
8832
8838
8843
8848
8869 protected bool m_IsResultOfSplit
8870
8872
8877
8878
8879
8881
8885
8886
8887
8889
8892
8893
8894
8900
8901
8909
8912
8913
8915
8916
8918
8919
8924
8925
8930
8931
8933
8934
8936 {
8941
8942 if (!
GetGame().IsDedicatedServer())
8943 {
8945 {
8947
8949 {
8951 }
8952 }
8953
8956 }
8957
8958 m_OldLocation = null;
8959
8961 {
8963 }
8964
8965 if (ConfigIsExisting("headSelectionsToHide"))
8966 {
8969 }
8970
8972 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8973 {
8975 }
8976
8978
8979 m_IsResultOfSplit = false;
8980
8982 }
8983
8985 {
8986 super.InitItemVariables();
8987
8993 m_Count = ConfigGetInt(
"count");
8994
8997
9002
9005
9010
9022
9026
9027
9030 if (ConfigIsExisting("canBeSplit"))
9031 {
9034 }
9035
9037 if (ConfigIsExisting("itemBehaviour"))
9039
9040
9043 RegisterNetSyncVariableInt("m_VarLiquidType");
9044 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9045
9046 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9047 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9048 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9049
9050 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9051 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9052 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9053 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9054
9055 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9056 RegisterNetSyncVariableBool("m_IsTakeable");
9057 RegisterNetSyncVariableBool("m_IsHologram");
9058
9061 {
9064 }
9065
9067
9069 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9071
9072 }
9073
9075 {
9077 }
9078
9080 {
9083 {
9088 }
9089 }
9090
9091 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9092 {
9094 {
9097 }
9098
9100 }
9101
9103 {
9109 }
9110
9112
9114 {
9116
9117 if (!action)
9118 {
9119 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9120 return;
9121 }
9122
9124 if (!ai)
9125 {
9127 return;
9128 }
9129
9131 if (!action_array)
9132 {
9133 action_array = new array<ActionBase_Basic>;
9135 }
9136 if (LogManager.IsActionLogEnable())
9137 {
9138 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9139 }
9140
9141 if (action_array.Find(action) != -1)
9142 {
9143 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9144 }
9145 else
9146 {
9147 action_array.Insert(action);
9148 }
9149 }
9150
9152 {
9154 ActionBase action = player.GetActionManager().GetAction(actionName);
9157
9158 if (action_array)
9159 {
9160 action_array.RemoveItem(action);
9161 }
9162 }
9163
9164
9165
9167 {
9168 ActionOverrideData overrideData = new ActionOverrideData();
9172
9174 if (!actionMap)
9175 {
9178 }
9179
9180 actionMap.Insert(this.
Type(), overrideData);
9181
9182 }
9183
9185
9187
9188
9190 {
9193
9196
9197 string config_to_search = "CfgVehicles";
9198 string muzzle_owner_config;
9199
9201 {
9202 if (IsInherited(Weapon))
9203 config_to_search = "CfgWeapons";
9204
9205 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9206
9207 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9208
9210
9211 if (config_OnFire_subclass_count > 0)
9212 {
9213 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9214
9215 for (int i = 0; i < config_OnFire_subclass_count; i++)
9216 {
9217 string particle_class = "";
9219 string config_OnFire_entry = config_OnFire_class + particle_class;
9220 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9221 WPOF_array.Insert(WPOF);
9222 }
9223
9224
9226 }
9227 }
9228
9230 {
9231 config_to_search = "CfgWeapons";
9232 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9233
9234 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9235
9237
9238 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9239 {
9240 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9241
9242 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9243 {
9244 string particle_class2 = "";
9246 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9247 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9248 WPOBE_array.Insert(WPOBE);
9249 }
9250
9251
9253 }
9254 }
9255 }
9256
9257
9259 {
9262
9264 {
9265 string config_to_search = "CfgVehicles";
9266
9267 if (IsInherited(Weapon))
9268 config_to_search = "CfgWeapons";
9269
9270 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9271 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9272
9273 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9274 {
9275
9277
9279 {
9281 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9283 return;
9284 }
9285
9288
9289
9290
9292 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9293
9294 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9295 {
9296 string particle_class = "";
9298 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9300
9301 if (entry_type == CT_CLASS)
9302 {
9303 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9304 WPOOH_array.Insert(WPOF);
9305 }
9306 }
9307
9308
9310 }
9311 }
9312 }
9313
9315 {
9317 }
9318
9320 {
9322 {
9324
9327
9330
9331 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9332 }
9333 }
9334
9336 {
9338 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9339
9341 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9342
9344 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9345
9347 {
9349 }
9350 }
9351
9353 {
9355 }
9356
9358 {
9361 else
9363
9365 {
9368 }
9369 else
9370 {
9373
9376 }
9377
9379 }
9380
9382 {
9384 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9385 }
9386
9388 {
9390 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9392 }
9393
9395 {
9397 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9398 }
9399
9401 {
9404
9405 OverheatingParticle OP = new OverheatingParticle();
9410
9412 }
9413
9415 {
9418
9419 return -1;
9420 }
9421
9423 {
9425 {
9428
9429 for (int i = count; i > 0; --i)
9430 {
9431 int id = i - 1;
9434
9437
9438 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9439 {
9440 if (p)
9441 {
9444 }
9445 }
9446 }
9447 }
9448 }
9449
9451 {
9453 {
9455 {
9456 int id = i - 1;
9458
9459 if (OP)
9460 {
9462
9463 if (p)
9464 {
9466 }
9467
9468 delete OP;
9469 }
9470 }
9471
9474 }
9475 }
9476
9479 {
9480 return 0.0;
9481 }
9482
9483
9485 {
9486 return 250;
9487 }
9488
9490 {
9491 return 0;
9492 }
9493
9496 {
9498 return true;
9499
9500 return false;
9501 }
9502
9505 {
9508
9510 {
9512 }
9513 else
9514 {
9515
9517 }
9518
9520 }
9521
9528 {
9529 return -1;
9530 }
9531
9532
9533
9534
9536 {
9538 {
9540 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9541
9542 if (r_index >= 0)
9543 {
9544 InventoryLocation r_il = new InventoryLocation;
9545 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9546
9547 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9550 {
9551 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9552 }
9554 {
9555 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9556 }
9557
9558 }
9559
9560 player.GetHumanInventory().ClearUserReservedLocation(this);
9561 }
9562
9565 }
9566
9567
9568
9569
9571 {
9572 return ItemBase.m_DebugActionsMask;
9573 }
9574
9576 {
9577 return ItemBase.m_DebugActionsMask & mask;
9578 }
9579
9581 {
9582 ItemBase.m_DebugActionsMask = mask;
9583 }
9584
9586 {
9587 ItemBase.m_DebugActionsMask |= mask;
9588 }
9589
9591 {
9592 ItemBase.m_DebugActionsMask &= ~mask;
9593 }
9594
9596 {
9598 {
9600 }
9601 else
9602 {
9604 }
9605 }
9606
9607
9609 {
9610 if (GetEconomyProfile())
9611 {
9612 float q_max = GetEconomyProfile().GetQuantityMax();
9613 if (q_max > 0)
9614 {
9615 float q_min = GetEconomyProfile().GetQuantityMin();
9616 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9617
9619 {
9620 ComponentEnergyManager comp = GetCompEM();
9622 {
9624 }
9625 }
9627 {
9629
9630 }
9631
9632 }
9633 }
9634 }
9635
9638 {
9639 EntityAI parent = GetHierarchyParent();
9640
9641 if (parent)
9642 {
9643 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9644 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9645 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9646 }
9647 }
9648
9651 {
9652 EntityAI parent = GetHierarchyParent();
9653
9654 if (parent)
9655 {
9656 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9657 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9658 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9659 }
9660 }
9661
9663 {
9664
9665
9666
9667
9669
9671 {
9672 if (ScriptInputUserData.CanStoreInputUserData())
9673 {
9674 ScriptInputUserData ctx = new ScriptInputUserData;
9680 ctx.
Write(use_stack_max);
9683
9685 {
9686 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9687 }
9688 }
9689 }
9690 else if (!
GetGame().IsMultiplayer())
9691 {
9693 }
9694 }
9695
9697 {
9699 }
9700
9702 {
9704 }
9705
9707 {
9709 }
9710
9712 {
9713
9714 return false;
9715 }
9716
9718 {
9719 return false;
9720 }
9721
9725 {
9726 return false;
9727 }
9728
9730 {
9731 return "";
9732 }
9733
9735
9737 {
9738 return false;
9739 }
9740
9742 {
9743 return true;
9744 }
9745
9746
9747
9749 {
9750 return true;
9751 }
9752
9754 {
9755 return true;
9756 }
9757
9759 {
9760 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9762 }
9763
9765 {
9767 }
9768
9770 {
9772 if (!is_being_placed)
9774 SetSynchDirty();
9775 }
9776
9777
9779
9781 {
9783 }
9784
9786 {
9788 }
9789
9791 {
9792 return 1;
9793 }
9794
9796 {
9797 return false;
9798 }
9799
9801 {
9803 SetSynchDirty();
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
9834
9835
9836
9837
9838
9839
9841 {
9842 super.OnMovedInsideCargo(container);
9843
9844 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9845 }
9846
9847 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9848 {
9849 super.EEItemLocationChanged(oldLoc,newLoc);
9850
9851 PlayerBase new_player = null;
9852 PlayerBase old_player = null;
9853
9854 if (newLoc.GetParent())
9855 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9856
9857 if (oldLoc.GetParent())
9858 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9859
9861 {
9862 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9863
9864 if (r_index >= 0)
9865 {
9866 InventoryLocation r_il = new InventoryLocation;
9867 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9868
9869 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9872 {
9873 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9874 }
9876 {
9877 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9878 }
9879
9880 }
9881 }
9882
9884 {
9885 if (new_player)
9886 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9887
9888 if (new_player == old_player)
9889 {
9890
9891 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9892 {
9894 {
9895 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9896 {
9897 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9898 }
9899 }
9900 else
9901 {
9902 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9903 }
9904 }
9905
9906 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9907 {
9908 int type = oldLoc.GetType();
9910 {
9911 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9912 }
9914 {
9915 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9916 }
9917 }
9918 if (!m_OldLocation)
9919 {
9920 m_OldLocation = new InventoryLocation;
9921 }
9922 m_OldLocation.Copy(oldLoc);
9923 }
9924 else
9925 {
9926 if (m_OldLocation)
9927 {
9928 m_OldLocation.Reset();
9929 }
9930 }
9931
9933 }
9934 else
9935 {
9936 if (new_player)
9937 {
9938 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9939 if (res_index >= 0)
9940 {
9941 InventoryLocation il = new InventoryLocation;
9942 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9944 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9947 {
9948 il.
GetParent().GetOnReleaseLock().Invoke(it);
9949 }
9951 {
9953 }
9954
9955 }
9956 }
9958 {
9959
9961 }
9962
9963 if (m_OldLocation)
9964 {
9965 m_OldLocation.Reset();
9966 }
9967 }
9968 }
9969
9970 override void EOnContact(IEntity other, Contact extra)
9971 {
9973 {
9974 int liquidType = -1;
9976 if (impactSpeed > 0.0)
9977 {
9979 #ifndef SERVER
9981 #else
9983 SetSynchDirty();
9984 #endif
9986 }
9987 }
9988
9989 #ifdef SERVER
9990 if (GetCompEM() && GetCompEM().IsPlugged())
9991 {
9992 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9993 GetCompEM().UnplugThis();
9994 }
9995 #endif
9996 }
9997
9999
10001 {
10003 }
10004
10006 {
10007
10008 }
10009
10011 {
10012 super.OnItemLocationChanged(old_owner, new_owner);
10013
10014 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10015 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10016
10017 if (!relatedPlayer && playerNew)
10018 relatedPlayer = playerNew;
10019
10020 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10021 {
10023 if (actionMgr)
10024 {
10025 ActionBase currentAction = actionMgr.GetRunningAction();
10026 if (currentAction)
10028 }
10029 }
10030
10031 Man ownerPlayerOld = null;
10032 Man ownerPlayerNew = null;
10033
10034 if (old_owner)
10035 {
10036 if (old_owner.
IsMan())
10037 {
10038 ownerPlayerOld = Man.Cast(old_owner);
10039 }
10040 else
10041 {
10042 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10043 }
10044 }
10045 else
10046 {
10048 {
10050
10051 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10052 {
10053 GetCompEM().UnplugThis();
10054 }
10055 }
10056 }
10057
10058 if (new_owner)
10059 {
10060 if (new_owner.
IsMan())
10061 {
10062 ownerPlayerNew = Man.Cast(new_owner);
10063 }
10064 else
10065 {
10066 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10067 }
10068 }
10069
10070 if (ownerPlayerOld != ownerPlayerNew)
10071 {
10072 if (ownerPlayerOld)
10073 {
10074 array<EntityAI> subItemsExit = new array<EntityAI>;
10076 for (int i = 0; i < subItemsExit.Count(); i++)
10077 {
10080 }
10081 }
10082
10083 if (ownerPlayerNew)
10084 {
10085 array<EntityAI> subItemsEnter = new array<EntityAI>;
10087 for (int j = 0; j < subItemsEnter.Count(); j++)
10088 {
10091 }
10092 }
10093 }
10094 else if (ownerPlayerNew != null)
10095 {
10096 PlayerBase nplayer;
10097 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10098 {
10099 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10101 for (int k = 0; k < subItemsUpdate.Count(); k++)
10102 {
10104 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10105 }
10106 }
10107 }
10108
10109 if (old_owner)
10110 old_owner.OnChildItemRemoved(this);
10111 if (new_owner)
10112 new_owner.OnChildItemReceived(this);
10113 }
10114
10115
10117 {
10118 super.EEDelete(parent);
10119 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10120 if (player)
10121 {
10123
10124 if (player.IsAlive())
10125 {
10126 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10127 if (r_index >= 0)
10128 {
10129 InventoryLocation r_il = new InventoryLocation;
10130 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10131
10132 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10135 {
10136 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10137 }
10139 {
10140 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10141 }
10142
10143 }
10144
10145 player.RemoveQuickBarEntityShortcut(this);
10146 }
10147 }
10148 }
10149
10151 {
10152 super.EEKilled(killer);
10153
10156 {
10157 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10158 {
10159 if (IsMagazine())
10160 {
10161 if (Magazine.Cast(this).GetAmmoCount() > 0)
10162 {
10164 }
10165 }
10166 else
10167 {
10169 }
10170 }
10171 }
10172 }
10173
10175 {
10176 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10177
10178 super.OnWasAttached(parent, slot_id);
10179
10182
10184 }
10185
10187 {
10188 super.OnWasDetached(parent, slot_id);
10189
10192 }
10193
10195 {
10196 int idx;
10199
10200 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10201 if (inventory_slots.Count() < 1)
10202 {
10203 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10204 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10205 }
10206 else
10207 {
10208 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10209 }
10210
10211 idx = inventory_slots.Find(slot);
10212 if (idx < 0)
10213 return "";
10214
10215 return attach_types.Get(idx);
10216 }
10217
10219 {
10220 int idx = -1;
10221 string slot;
10222
10225
10226 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10227 if (inventory_slots.Count() < 1)
10228 {
10229 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10230 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10231 }
10232 else
10233 {
10234 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10235 if (detach_types.Count() < 1)
10236 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10237 }
10238
10239 for (int i = 0; i < inventory_slots.Count(); i++)
10240 {
10241 slot = inventory_slots.Get(i);
10242 }
10243
10244 if (slot != "")
10245 {
10246 if (detach_types.Count() == 1)
10247 idx = 0;
10248 else
10249 idx = inventory_slots.Find(slot);
10250 }
10251 if (idx < 0)
10252 return "";
10253
10254 return detach_types.Get(idx);
10255 }
10256
10258 {
10259
10261
10262
10263 float min_time = 1;
10264 float max_time = 3;
10265 float delay = Math.RandomFloat(min_time, max_time);
10266
10267 explode_timer.Run(delay, this, "DoAmmoExplosion");
10268 }
10269
10271 {
10272 Magazine magazine = Magazine.Cast(this);
10273 int pop_sounds_count = 6;
10274 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10275
10276
10277 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10278 string sound_name = pop_sounds[ sound_idx ];
10280
10281
10282 magazine.ServerAddAmmoCount(-1);
10283
10284
10285 float min_temp_to_explode = 100;
10286
10287 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10288 {
10290 }
10291 }
10292
10293
10294 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10295 {
10296 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10297
10298 const int CHANCE_DAMAGE_CARGO = 4;
10299 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10300 const int CHANCE_DAMAGE_NOTHING = 2;
10301
10303 {
10304 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10305 int chances;
10306 int rnd;
10307
10308 if (GetInventory().GetCargo())
10309 {
10310 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10311 rnd = Math.RandomInt(0,chances);
10312
10313 if (rnd < CHANCE_DAMAGE_CARGO)
10314 {
10316 }
10317 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10318 {
10320 }
10321 }
10322 else
10323 {
10324 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10325 rnd = Math.RandomInt(0,chances);
10326
10327 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10328 {
10330 }
10331 }
10332 }
10333 }
10334
10336 {
10337 if (GetInventory().GetCargo())
10338 {
10339 int item_count = GetInventory().GetCargo().GetItemCount();
10340 if (item_count > 0)
10341 {
10342 int random_pick = Math.RandomInt(0, item_count);
10344 if (!item.IsExplosive())
10345 {
10346 item.AddHealth("","",damage);
10347 return true;
10348 }
10349 }
10350 }
10351 return false;
10352 }
10353
10355 {
10356 int attachment_count = GetInventory().AttachmentCount();
10357 if (attachment_count > 0)
10358 {
10359 int random_pick = Math.RandomInt(0, attachment_count);
10360 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10361 if (!attachment.IsExplosive())
10362 {
10363 attachment.AddHealth("","",damage);
10364 return true;
10365 }
10366 }
10367 return false;
10368 }
10369
10371 {
10373 }
10374
10376 {
10378 return GetInventory().CanRemoveEntity();
10379
10380 return false;
10381 }
10382
10384 {
10386 return;
10387
10389 {
10390 if (ScriptInputUserData.CanStoreInputUserData())
10391 {
10392 ScriptInputUserData ctx = new ScriptInputUserData;
10397 ctx.
Write(destination_entity);
10399 ctx.
Write(slot_id);
10401 }
10402 }
10403 else if (!
GetGame().IsMultiplayer())
10404 {
10406 }
10407 }
10408
10410 {
10412 return;
10413
10414 float split_quantity_new;
10418 InventoryLocation loc = new InventoryLocation;
10419
10420 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10421 {
10423 split_quantity_new = stack_max;
10424 else
10426
10427 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10428 if (new_item)
10429 {
10430 new_item.SetResultOfSplit(true);
10431 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10433 new_item.SetQuantity(split_quantity_new);
10434 }
10435 }
10436 else if (destination_entity && slot_id == -1)
10437 {
10438 if (quantity > stack_max)
10439 split_quantity_new = stack_max;
10440 else
10441 split_quantity_new = quantity;
10442
10444 {
10447 }
10448
10449 if (new_item)
10450 {
10451 new_item.SetResultOfSplit(true);
10452 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10454 new_item.SetQuantity(split_quantity_new);
10455 }
10456 }
10457 else
10458 {
10459 if (stack_max != 0)
10460 {
10462 {
10464 }
10465
10466 if (split_quantity_new == 0)
10467 {
10468 if (!
GetGame().IsMultiplayer())
10469 player.PhysicalPredictiveDropItem(this);
10470 else
10471 player.ServerDropEntity(this);
10472 return;
10473 }
10474
10476
10477 if (new_item)
10478 {
10479 new_item.SetResultOfSplit(true);
10480 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10482 new_item.SetQuantity(stack_max);
10483 new_item.PlaceOnSurface();
10484 }
10485 }
10486 }
10487 }
10488
10490 {
10492 return;
10493
10494 float split_quantity_new;
10498 InventoryLocation loc = new InventoryLocation;
10499
10500 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10501 {
10503 split_quantity_new = stack_max;
10504 else
10506
10507 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10508 if (new_item)
10509 {
10510 new_item.SetResultOfSplit(true);
10511 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10513 new_item.SetQuantity(split_quantity_new);
10514 }
10515 }
10516 else if (destination_entity && slot_id == -1)
10517 {
10518 if (quantity > stack_max)
10519 split_quantity_new = stack_max;
10520 else
10521 split_quantity_new = quantity;
10522
10524 {
10527 }
10528
10529 if (new_item)
10530 {
10531 new_item.SetResultOfSplit(true);
10532 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10534 new_item.SetQuantity(split_quantity_new);
10535 }
10536 }
10537 else
10538 {
10539 if (stack_max != 0)
10540 {
10542 {
10544 }
10545
10547
10548 if (new_item)
10549 {
10550 new_item.SetResultOfSplit(true);
10551 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10553 new_item.SetQuantity(stack_max);
10554 new_item.PlaceOnSurface();
10555 }
10556 }
10557 }
10558 }
10559
10561 {
10563 return;
10564
10566 {
10567 if (ScriptInputUserData.CanStoreInputUserData())
10568 {
10569 ScriptInputUserData ctx = new ScriptInputUserData;
10574 dst.WriteToContext(ctx);
10576 }
10577 }
10578 else if (!
GetGame().IsMultiplayer())
10579 {
10581 }
10582 }
10583
10585 {
10587 return;
10588
10590 {
10591 if (ScriptInputUserData.CanStoreInputUserData())
10592 {
10593 ScriptInputUserData ctx = new ScriptInputUserData;
10598 ctx.
Write(destination_entity);
10604 }
10605 }
10606 else if (!
GetGame().IsMultiplayer())
10607 {
10609 }
10610 }
10611
10613 {
10615 }
10616
10618 {
10620 return this;
10621
10623 float split_quantity_new;
10625 if (dst.IsValid())
10626 {
10627 int slot_id = dst.GetSlot();
10629
10630 if (quantity > stack_max)
10631 split_quantity_new = stack_max;
10632 else
10633 split_quantity_new = quantity;
10634
10636
10637 if (new_item)
10638 {
10639 new_item.SetResultOfSplit(true);
10640 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10643 }
10644
10645 return new_item;
10646 }
10647
10648 return null;
10649 }
10650
10652 {
10654 return;
10655
10657 float split_quantity_new;
10659 if (destination_entity)
10660 {
10662 if (quantity > stackable)
10663 split_quantity_new = stackable;
10664 else
10665 split_quantity_new = quantity;
10666
10667 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10668 if (new_item)
10669 {
10670 new_item.SetResultOfSplit(true);
10671 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10673 new_item.SetQuantity(split_quantity_new);
10674 }
10675 }
10676 }
10677
10679 {
10681 return;
10682
10684 {
10685 if (ScriptInputUserData.CanStoreInputUserData())
10686 {
10687 ScriptInputUserData ctx = new ScriptInputUserData;
10692 ItemBase destination_entity =
this;
10693 ctx.
Write(destination_entity);
10697 }
10698 }
10699 else if (!
GetGame().IsMultiplayer())
10700 {
10702 }
10703 }
10704
10706 {
10708 return;
10709
10711 float split_quantity_new;
10713 if (player)
10714 {
10716 if (quantity > stackable)
10717 split_quantity_new = stackable;
10718 else
10719 split_quantity_new = quantity;
10720
10721 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10722 new_item =
ItemBase.Cast(in_hands);
10723 if (new_item)
10724 {
10725 new_item.SetResultOfSplit(true);
10726 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10728 new_item.SetQuantity(split_quantity_new);
10729 }
10730 }
10731 }
10732
10734 {
10736 return;
10737
10739 float split_quantity_new = Math.Floor(quantity * 0.5);
10740
10742
10743 if (new_item)
10744 {
10745 if (new_item.GetQuantityMax() < split_quantity_new)
10746 {
10747 split_quantity_new = new_item.GetQuantityMax();
10748 }
10749
10750 new_item.SetResultOfSplit(true);
10751 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10752
10754 {
10757 }
10758 else
10759 {
10762 }
10763 }
10764 }
10765
10767 {
10769 return;
10770
10772 float split_quantity_new = Math.Floor(quantity / 2);
10773
10774 InventoryLocation invloc = new InventoryLocation;
10776
10778 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10779
10780 if (new_item)
10781 {
10782 if (new_item.GetQuantityMax() < split_quantity_new)
10783 {
10784 split_quantity_new = new_item.GetQuantityMax();
10785 }
10787 {
10790 }
10791 else
10792 {
10795 }
10796 }
10797 }
10798
10801 {
10802 SetWeightDirty();
10804
10805 if (parent)
10806 parent.OnAttachmentQuantityChangedEx(this, delta);
10807
10809 {
10811 {
10813 }
10815 {
10816 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10818 }
10819 }
10820
10821 }
10822
10825 {
10826
10827 }
10828
10831 {
10833 }
10834
10836 {
10837 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10838
10840 {
10841 if (newLevel == GameConstants.STATE_RUINED)
10842 {
10844 EntityAI parent = GetHierarchyParent();
10845 if (parent && parent.IsFireplace())
10846 {
10847 CargoBase cargo = GetInventory().GetCargo();
10848 if (cargo)
10849 {
10851 {
10853 }
10854 }
10855 }
10856 }
10857
10859 {
10860
10862 return;
10863 }
10864
10865 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10866 {
10868 }
10869 }
10870 }
10871
10872
10874 {
10875 super.OnRightClick();
10876
10878 {
10880 {
10881 if (ScriptInputUserData.CanStoreInputUserData())
10882 {
10883 vector m4[4];
10885
10886 EntityAI root = GetHierarchyRoot();
10887
10888 InventoryLocation dst = new InventoryLocation;
10890 {
10891 if (root)
10892 {
10893 root.GetTransform(m4);
10895 }
10896 else
10897 GetInventory().GetCurrentInventoryLocation(dst);
10898 }
10899 else
10900 {
10902
10903
10904 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10905 {
10906 if (root)
10907 {
10908 root.GetTransform(m4);
10910 }
10911 else
10912 GetInventory().GetCurrentInventoryLocation(dst);
10913 }
10914 else
10915 {
10916 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10917 }
10918 }
10919
10920 ScriptInputUserData ctx = new ScriptInputUserData;
10928 }
10929 }
10930 else if (!
GetGame().IsMultiplayer())
10931 {
10933 }
10934 }
10935 }
10936
10937 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10938 {
10939
10940 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10941 return false;
10942
10943 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10944 return false;
10945
10946
10948 return false;
10949
10950
10951 Magazine mag = Magazine.Cast(this);
10952 if (mag)
10953 {
10954 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10955 return false;
10956
10957 if (stack_max_limit)
10958 {
10959 Magazine other_mag = Magazine.Cast(other_item);
10960 if (other_item)
10961 {
10962 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10963 return false;
10964 }
10965
10966 }
10967 }
10968 else
10969 {
10970
10972 return false;
10973
10975 return false;
10976 }
10977
10978 PlayerBase player = null;
10979 if (CastTo(player, GetHierarchyRootPlayer()))
10980 {
10981 if (player.GetInventory().HasAttachment(this))
10982 return false;
10983
10984 if (player.IsItemsToDelete())
10985 return false;
10986 }
10987
10988 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10989 return false;
10990
10991 int slotID;
10993 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10994 return false;
10995
10996 return true;
10997 }
10998
11000 {
11002 }
11003
11005 {
11006 return m_IsResultOfSplit;
11007 }
11008
11010 {
11011 m_IsResultOfSplit = value;
11012 }
11013
11015 {
11017 }
11018
11020 {
11021 float other_item_quantity = other_item.GetQuantity();
11022 float this_free_space;
11023
11025
11027
11028 if (other_item_quantity > this_free_space)
11029 {
11030 return this_free_space;
11031 }
11032 else
11033 {
11034 return other_item_quantity;
11035 }
11036 }
11037
11039 {
11041 }
11042
11044 {
11046 return;
11047
11048 if (!IsMagazine() && other_item)
11049 {
11051 if (quantity_used != 0)
11052 {
11053 float hp1 = GetHealth01("","");
11054 float hp2 = other_item.GetHealth01("","");
11055 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11056 hpResult = hpResult / (
GetQuantity() + quantity_used);
11057
11058 hpResult *= GetMaxHealth();
11059 Math.Round(hpResult);
11060 SetHealth("", "Health", hpResult);
11061
11063 other_item.AddQuantity(-quantity_used);
11064 }
11065 }
11067 }
11068
11070 {
11071 #ifdef SERVER
11072 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11073 GetHierarchyParent().IncreaseLifetimeUp();
11074 #endif
11075 };
11076
11078 {
11079 PlayerBase p = PlayerBase.Cast(player);
11080
11081 array<int> recipesIds = p.m_Recipes;
11082 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11083 if (moduleRecipesManager)
11084 {
11085 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11086 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11087 }
11088
11089 for (int i = 0;i < recipesIds.Count(); i++)
11090 {
11091 int key = recipesIds.Get(i);
11092 string recipeName = moduleRecipesManager.GetRecipeName(key);
11094 }
11095 }
11096
11097
11098 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11099 {
11100 super.GetDebugActions(outputList);
11101
11102
11107
11108
11112
11116
11117
11120
11121
11123 {
11126 }
11127
11129
11132
11136 }
11137
11138
11139
11140
11142 {
11143 super.OnAction(action_id, player, ctx);
11144 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11145 {
11146 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11147 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11148 PlayerBase p = PlayerBase.Cast(player);
11149 if (
EActions.RECIPES_RANGE_START < 1000)
11150 {
11151 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11152 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11153 }
11154 }
11155 #ifndef SERVER
11156 else if (action_id ==
EActions.WATCH_PLAYER)
11157 {
11158 PluginDeveloper.SetDeveloperItemClientEx(player);
11159 }
11160 #endif
11162 {
11163 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11164 {
11165 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11166 OnDebugButtonPressServer(id + 1);
11167 }
11168
11169 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11170 {
11171 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11173 }
11174
11175 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11176 {
11177 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11179 }
11180
11181 else if (action_id ==
EActions.ADD_QUANTITY)
11182 {
11183 if (IsMagazine())
11184 {
11185 Magazine mag = Magazine.Cast(this);
11186 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11187 }
11188 else
11189 {
11191 }
11192
11193 if (m_EM)
11194 {
11195 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11196 }
11197
11198 }
11199
11200 else if (action_id ==
EActions.REMOVE_QUANTITY)
11201 {
11202 if (IsMagazine())
11203 {
11204 Magazine mag2 = Magazine.Cast(this);
11205 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11206 }
11207 else
11208 {
11210 }
11211 if (m_EM)
11212 {
11213 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11214 }
11215
11216 }
11217
11218 else if (action_id ==
EActions.SET_QUANTITY_0)
11219 {
11221
11222 if (m_EM)
11223 {
11224 m_EM.SetEnergy(0);
11225 }
11226 }
11227
11228 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11229 {
11231
11232 if (m_EM)
11233 {
11234 m_EM.SetEnergy(m_EM.GetEnergyMax());
11235 }
11236 }
11237
11238 else if (action_id ==
EActions.ADD_HEALTH)
11239 {
11240 AddHealth("","",GetMaxHealth("","Health")/5);
11241 }
11242 else if (action_id ==
EActions.REMOVE_HEALTH)
11243 {
11244 AddHealth("","",-GetMaxHealth("","Health")/5);
11245 }
11246 else if (action_id ==
EActions.DESTROY_HEALTH)
11247 {
11248 SetHealth01("","",0);
11249 }
11250 else if (action_id ==
EActions.WATCH_ITEM)
11251 {
11253 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11254 #ifdef DEVELOPER
11255 SetDebugDeveloper_item(this);
11256 #endif
11257 }
11258
11259 else if (action_id ==
EActions.ADD_TEMPERATURE)
11260 {
11261 AddTemperature(20);
11262
11263 }
11264
11265 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11266 {
11267 AddTemperature(-20);
11268
11269 }
11270
11271 else if (action_id ==
EActions.FLIP_FROZEN)
11272 {
11273 SetFrozen(!GetIsFrozen());
11274
11275 }
11276
11277 else if (action_id ==
EActions.ADD_WETNESS)
11278 {
11280
11281 }
11282
11283 else if (action_id ==
EActions.REMOVE_WETNESS)
11284 {
11286
11287 }
11288
11289 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11290 {
11293
11294
11295 }
11296
11297 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11298 {
11301 }
11302
11303 else if (action_id ==
EActions.MAKE_SPECIAL)
11304 {
11305 auto debugParams = DebugSpawnParams.WithPlayer(player);
11306 OnDebugSpawnEx(debugParams);
11307 }
11308
11309 else if (action_id ==
EActions.DELETE)
11310 {
11311 Delete();
11312 }
11313
11314 }
11315
11316
11317 return false;
11318 }
11319
11320
11321
11322
11326
11329
11330
11331
11333 {
11334 return false;
11335 }
11336
11337
11339 {
11340 return true;
11341 }
11342
11343
11345 {
11346 return true;
11347 }
11348
11349
11350
11352 {
11353 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11355 }
11356
11359 {
11360 return null;
11361 }
11362
11364 {
11365 return false;
11366 }
11367
11369 {
11370 return false;
11371 }
11372
11376
11377
11379 {
11380 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11381 return module_repairing.CanRepair(this, item_repair_kit);
11382 }
11383
11384
11385 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11386 {
11387 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11388 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11389 }
11390
11391
11393 {
11394
11395
11396
11397
11398
11399
11400
11401
11402 return 1;
11403 }
11404
11405
11406
11408 {
11410 }
11411
11412
11413
11415 {
11417 }
11418
11419
11428 {
11429 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11430
11431 if (player)
11432 {
11433 player.MessageStatus(text);
11434 }
11435 }
11436
11437
11446 {
11447 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11448
11449 if (player)
11450 {
11451 player.MessageAction(text);
11452 }
11453 }
11454
11455
11464 {
11465 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11466
11467 if (player)
11468 {
11469 player.MessageFriendly(text);
11470 }
11471 }
11472
11473
11482 {
11483 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11484
11485 if (player)
11486 {
11487 player.MessageImportant(text);
11488 }
11489 }
11490
11492 {
11493 return true;
11494 }
11495
11496
11497 override bool KindOf(
string tag)
11498 {
11499 bool found = false;
11500 string item_name = this.
GetType();
11503
11504 int array_size = item_tag_array.Count();
11505 for (int i = 0; i < array_size; i++)
11506 {
11507 if (item_tag_array.Get(i) == tag)
11508 {
11509 found = true;
11510 break;
11511 }
11512 }
11513 return found;
11514 }
11515
11516
11518 {
11519
11520 super.OnRPC(sender, rpc_type,ctx);
11521
11522
11523 switch (rpc_type)
11524 {
11525 #ifndef SERVER
11526 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11527 Param2<bool, string> p = new Param2<bool, string>(false, "");
11528
11530 return;
11531
11532 bool play = p.param1;
11533 string soundSet = p.param2;
11534
11535 if (play)
11536 {
11538 {
11540 {
11542 }
11543 }
11544 else
11545 {
11547 }
11548 }
11549 else
11550 {
11552 }
11553
11554 break;
11555 #endif
11556
11557 }
11558
11560 {
11562 }
11563 }
11564
11565
11566
11567
11569 {
11570 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11571 return plugin.GetID(
name);
11572 }
11573
11575 {
11576 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11577 return plugin.GetName(id);
11578 }
11579
11582 {
11583
11584
11585 int varFlags;
11586 if (!ctx.
Read(varFlags))
11587 return;
11588
11589 if (varFlags & ItemVariableFlags.FLOAT)
11590 {
11592 }
11593 }
11594
11596 {
11597
11598 super.SerializeNumericalVars(floats_out);
11599
11600
11601
11603 {
11605 }
11606
11608 {
11610 }
11611
11613 {
11615 }
11616
11618 {
11623 }
11624
11626 {
11628 }
11629 }
11630
11632 {
11633
11634 super.DeSerializeNumericalVars(floats);
11635
11636
11637 int index = 0;
11638 int mask = Math.Round(floats.Get(index));
11639
11640 index++;
11641
11643 {
11645 {
11647 }
11648 else
11649 {
11650 float quantity = floats.Get(index);
11651 SetQuantity(quantity,
true,
false,
false,
false);
11652 }
11653 index++;
11654 }
11655
11657 {
11658 float wet = floats.Get(index);
11660 index++;
11661 }
11662
11664 {
11665 int liquidtype = Math.Round(floats.Get(index));
11667 index++;
11668 }
11669
11671 {
11673 index++;
11675 index++;
11677 index++;
11679 index++;
11680 }
11681
11683 {
11684 int cleanness = Math.Round(floats.Get(index));
11686 index++;
11687 }
11688 }
11689
11691 {
11692 super.WriteVarsToCTX(ctx);
11693
11694
11696 {
11698 }
11699
11701 {
11703 }
11704
11706 {
11708 }
11709
11711 {
11712 int r,g,b,a;
11718 }
11719
11721 {
11723 }
11724 }
11725
11727 {
11728 if (!super.ReadVarsFromCTX(ctx,version))
11729 return false;
11730
11731 int intValue;
11732 float value;
11733
11734 if (version < 140)
11735 {
11736 if (!ctx.
Read(intValue))
11737 return false;
11738
11739 m_VariablesMask = intValue;
11740 }
11741
11743 {
11744 if (!ctx.
Read(value))
11745 return false;
11746
11748 {
11750 }
11751 else
11752 {
11754 }
11755 }
11756
11757 if (version < 140)
11758 {
11760 {
11761 if (!ctx.
Read(value))
11762 return false;
11763 SetTemperatureDirect(value);
11764 }
11765 }
11766
11768 {
11769 if (!ctx.
Read(value))
11770 return false;
11772 }
11773
11775 {
11776 if (!ctx.
Read(intValue))
11777 return false;
11779 }
11780
11782 {
11783 int r,g,b,a;
11785 return false;
11787 return false;
11789 return false;
11791 return false;
11792
11794 }
11795
11797 {
11798 if (!ctx.
Read(intValue))
11799 return false;
11801 }
11802
11803 if (version >= 138 && version < 140)
11804 {
11806 {
11807 if (!ctx.
Read(intValue))
11808 return false;
11809 SetFrozen(intValue);
11810 }
11811 }
11812
11813 return true;
11814 }
11815
11816
11818 {
11821 {
11823 }
11824
11825 if (!super.OnStoreLoad(ctx, version))
11826 {
11828 return false;
11829 }
11830
11831 if (version >= 114)
11832 {
11833 bool hasQuickBarIndexSaved;
11834
11835 if (!ctx.
Read(hasQuickBarIndexSaved))
11836 {
11838 return false;
11839 }
11840
11841 if (hasQuickBarIndexSaved)
11842 {
11843 int itmQBIndex;
11844
11845
11846 if (!ctx.
Read(itmQBIndex))
11847 {
11849 return false;
11850 }
11851
11852 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11853 if (itmQBIndex != -1 && parentPlayer)
11854 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11855 }
11856 }
11857 else
11858 {
11859
11860 PlayerBase player;
11861 int itemQBIndex;
11862 if (version ==
int.
MAX)
11863 {
11864 if (!ctx.
Read(itemQBIndex))
11865 {
11867 return false;
11868 }
11869 }
11870 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11871 {
11872
11873 if (!ctx.
Read(itemQBIndex))
11874 {
11876 return false;
11877 }
11878 if (itemQBIndex != -1 && player)
11879 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11880 }
11881 }
11882
11883 if (version < 140)
11884 {
11885
11886 if (!LoadVariables(ctx, version))
11887 {
11889 return false;
11890 }
11891 }
11892
11893
11895 {
11897 return false;
11898 }
11899 if (version >= 132)
11900 {
11902 if (raib)
11903 {
11905 {
11907 return false;
11908 }
11909 }
11910 }
11911
11913 return true;
11914 }
11915
11916
11917
11919 {
11920 super.OnStoreSave(ctx);
11921
11922 PlayerBase player;
11923 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11924 {
11926
11927 int itemQBIndex = -1;
11928 itemQBIndex = player.FindQuickBarEntityIndex(this);
11929 ctx.
Write(itemQBIndex);
11930 }
11931 else
11932 {
11934 }
11935
11937
11939 if (raib)
11940 {
11942 }
11943 }
11944
11945
11947 {
11948 super.AfterStoreLoad();
11949
11951 {
11953 }
11954
11956 {
11959 }
11960 }
11961
11963 {
11964 super.EEOnAfterLoad();
11965
11967 {
11969 }
11970
11973 }
11974
11976 {
11977 return false;
11978 }
11979
11980
11981
11983 {
11985 {
11986 #ifdef PLATFORM_CONSOLE
11987
11989 {
11991 if (menu)
11992 {
11994 }
11995 }
11996 #endif
11997 }
11998
12000 {
12003 }
12004
12006 {
12007 SetWeightDirty();
12009 }
12011 {
12014 }
12015
12017 {
12020 }
12022 {
12025 }
12026
12027 super.OnVariablesSynchronized();
12028 }
12029
12030
12031
12033 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12034 {
12035 if (!IsServerCheck(allow_client))
12036 return false;
12037
12039 return false;
12040
12043
12044 if (value <= (min + 0.001))
12045 value = min;
12046
12047 if (value == min)
12048 {
12049 if (destroy_config)
12050 {
12051 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12052 if (dstr)
12053 {
12055 this.Delete();
12056 return true;
12057 }
12058 }
12059 else if (destroy_forced)
12060 {
12062 this.Delete();
12063 return true;
12064 }
12065
12067 }
12068
12071
12073 {
12075
12076 if (delta)
12078 }
12079
12081
12082 return false;
12083 }
12084
12085
12087 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12088 {
12090 }
12091
12093 {
12096 }
12097
12099 {
12102 }
12103
12106 {
12107 float value_clamped = Math.Clamp(value, 0, 1);
12109 SetQuantity(result, destroy_config, destroy_forced);
12110 }
12111
12112
12115 {
12117 }
12118
12120 {
12122 }
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12134 {
12135 int slot = -1;
12136 if (GetInventory())
12137 {
12138 InventoryLocation il = new InventoryLocation;
12139 GetInventory().GetCurrentInventoryLocation(il);
12141 }
12142
12144 }
12145
12147 {
12148 float quantity_max = 0;
12149
12151 {
12152 if (attSlotID != -1)
12153 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12154
12155 if (quantity_max <= 0)
12157 }
12158
12159 if (quantity_max <= 0)
12161
12162 return quantity_max;
12163 }
12164
12166 {
12168 }
12169
12171 {
12173 }
12174
12175
12177 {
12179 }
12180
12182 {
12184 }
12185
12187 {
12189 }
12190
12191
12193 {
12194
12195 float weightEx = GetWeightEx();
12196 float special = GetInventoryAndCargoWeight();
12197 return weightEx - special;
12198 }
12199
12200
12202 {
12204 }
12205
12207 {
12209 {
12210 #ifdef DEVELOPER
12211 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12212 {
12213 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12215 }
12216 #endif
12217
12218 return GetQuantity() * GetConfigWeightModified();
12219 }
12220 else if (HasEnergyManager())
12221 {
12222 #ifdef DEVELOPER
12223 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12224 {
12225 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12226 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12227 }
12228 #endif
12229 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12230 }
12231 else
12232 {
12233 #ifdef DEVELOPER
12234 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12235 {
12236 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12237 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12238 }
12239 #endif
12240 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12241 }
12242 }
12243
12246 {
12247 int item_count = 0;
12249
12250 if (GetInventory().GetCargo() != NULL)
12251 {
12252 item_count = GetInventory().GetCargo().GetItemCount();
12253 }
12254
12255 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12256 {
12257 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12258 if (item)
12259 item_count += item.GetNumberOfItems();
12260 }
12261 return item_count;
12262 }
12263
12266 {
12267 float weight = 0;
12268 float wetness = 1;
12269 if (include_wetness)
12272 {
12273 weight = wetness * m_ConfigWeight;
12274 }
12276 {
12277 weight = 1;
12278 }
12279 return weight;
12280 }
12281
12282
12283
12285 {
12286 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12287 {
12288 GameInventory inv = GetInventory();
12289 array<EntityAI> items = new array<EntityAI>;
12291 for (int i = 0; i < items.Count(); i++)
12292 {
12294 if (item)
12295 {
12297 }
12298 }
12299 }
12300 }
12301
12302
12303
12304
12306 {
12307 float energy = 0;
12308 if (HasEnergyManager())
12309 {
12310 energy = GetCompEM().GetEnergy();
12311 }
12312 return energy;
12313 }
12314
12315
12317 {
12318 super.OnEnergyConsumed();
12319
12321 }
12322
12324 {
12325 super.OnEnergyAdded();
12326
12328 }
12329
12330
12332 {
12333 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12334 {
12336 {
12337 float energy_0to1 = GetCompEM().GetEnergy0To1();
12339 }
12340 }
12341 }
12342
12343
12345 {
12346 return ConfigGetFloat("heatIsolation");
12347 }
12348
12350 {
12352 }
12353
12355 {
12356 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12357 if (
GetGame().ConfigIsExisting(paramPath))
12359
12360 return 0.0;
12361 }
12362
12364 {
12365 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12366 if (
GetGame().ConfigIsExisting(paramPath))
12368
12369 return 0.0;
12370 }
12371
12372 override void SetWet(
float value,
bool allow_client =
false)
12373 {
12374 if (!IsServerCheck(allow_client))
12375 return;
12376
12379
12381
12382 m_VarWet = Math.Clamp(value, min, max);
12383
12385 {
12388 }
12389 }
12390
12391 override void AddWet(
float value)
12392 {
12394 }
12395
12397 {
12399 }
12400
12402 {
12404 }
12405
12407 {
12409 }
12410
12412 {
12414 }
12415
12417 {
12419 }
12420
12421 override void OnWetChanged(
float newVal,
float oldVal)
12422 {
12425 if (newLevel != oldLevel)
12426 {
12428 }
12429 }
12430
12432 {
12433 SetWeightDirty();
12434 }
12435
12437 {
12438 return GetWetLevelInternal(
m_VarWet);
12439 }
12440
12441
12442
12444 {
12446 }
12447
12449 {
12451 }
12452
12454 {
12456 }
12457
12459 {
12461 }
12462
12463
12464
12466 {
12467 if (ConfigIsExisting("itemModelLength"))
12468 {
12469 return ConfigGetFloat("itemModelLength");
12470 }
12471 return 0;
12472 }
12473
12475 {
12476 if (ConfigIsExisting("itemAttachOffset"))
12477 {
12478 return ConfigGetFloat("itemAttachOffset");
12479 }
12480 return 0;
12481 }
12482
12483 override void SetCleanness(
int value,
bool allow_client =
false)
12484 {
12485 if (!IsServerCheck(allow_client))
12486 return;
12487
12489
12491
12494 }
12495
12497 {
12499 }
12500
12502 {
12503 return true;
12504 }
12505
12506
12507
12508
12510 {
12512 }
12513
12515 {
12517 }
12518
12519
12520
12521
12522 override void SetColor(
int r,
int g,
int b,
int a)
12523 {
12529 }
12531 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12532 {
12537 }
12538
12540 {
12542 }
12543
12546 {
12547 int r,g,b,a;
12549 r = r/255;
12550 g = g/255;
12551 b = b/255;
12552 a = a/255;
12553 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12554 }
12555
12556
12557
12558 override void SetLiquidType(
int value,
bool allow_client =
false)
12559 {
12560 if (!IsServerCheck(allow_client))
12561 return;
12562
12567 }
12568
12570 {
12571 return ConfigGetInt("varLiquidTypeInit");
12572 }
12573
12575 {
12577 }
12578
12580 {
12582 SetFrozen(false);
12583 }
12584
12587 {
12588 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12589 }
12590
12591
12594 {
12595 PlayerBase nplayer;
12596 if (PlayerBase.CastTo(nplayer, player))
12597 {
12599
12600 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12601 }
12602 }
12603
12604
12607 {
12608 PlayerBase nplayer;
12609 if (PlayerBase.CastTo(nplayer,player))
12610 {
12611
12612 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12613
12614 }
12615
12616
12617 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12618
12619
12620 if (HasEnergyManager())
12621 {
12622 GetCompEM().UpdatePlugState();
12623 }
12624 }
12625
12626
12628 {
12629 super.OnPlacementStarted(player);
12630
12632 }
12633
12634 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12635 {
12637 {
12638 m_AdminLog.OnPlacementComplete(player,
this);
12639 }
12640
12641 super.OnPlacementComplete(player, position, orientation);
12642 }
12643
12644
12645
12646
12647
12649 {
12651 {
12652 return true;
12653 }
12654 else
12655 {
12656 return false;
12657 }
12658 }
12659
12660
12662 {
12664 {
12666 }
12667 }
12668
12669
12671 {
12673 }
12674
12676 {
12678 }
12679
12680 override void InsertAgent(
int agent,
float count = 1)
12681 {
12682 if (count < 1)
12683 return;
12684
12686 }
12687
12690 {
12692 }
12693
12694
12696 {
12698 }
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12742 {
12744 return false;
12745 return true;
12746 }
12747
12749 {
12750
12752 }
12753
12754
12757 {
12758 super.CheckForRoofLimited(timeTresholdMS);
12759
12761 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12762 {
12763 m_PreviousRoofTestTime = time;
12764 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12765 }
12766 }
12767
12768
12770 {
12772 {
12773 return 0;
12774 }
12775
12776 if (GetInventory().GetAttachmentSlotsCount() != 0)
12777 {
12778 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12779 if (filter)
12780 return filter.GetProtectionLevel(type, false, system);
12781 else
12782 return 0;
12783 }
12784
12785 string subclassPath, entryName;
12786
12787 switch (type)
12788 {
12790 entryName = "biological";
12791 break;
12793 entryName = "chemical";
12794 break;
12795 default:
12796 entryName = "biological";
12797 break;
12798 }
12799
12800 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12801
12803 }
12804
12805
12806
12809 {
12810 if (!IsMagazine())
12812
12814 }
12815
12816
12817
12818
12819
12824 {
12825 return true;
12826 }
12827
12829 {
12831 }
12832
12833
12834
12835
12836
12838 {
12839 if (parent)
12840 {
12841 if (parent.IsInherited(DayZInfected))
12842 return true;
12843
12844 if (!parent.IsRuined())
12845 return true;
12846 }
12847
12848 return true;
12849 }
12850
12852 {
12853 if (!super.CanPutAsAttachment(parent))
12854 {
12855 return false;
12856 }
12857
12858 if (!IsRuined() && !parent.IsRuined())
12859 {
12860 return true;
12861 }
12862
12863 return false;
12864 }
12865
12867 {
12868
12869
12870
12871
12872 return super.CanReceiveItemIntoCargo(item);
12873 }
12874
12876 {
12877
12878
12879
12880
12881 GameInventory attachmentInv = attachment.GetInventory();
12883 {
12884 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12885 return false;
12886 }
12887
12888 InventoryLocation loc = new InventoryLocation();
12889 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12890 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12891 return false;
12892
12893 return super.CanReceiveAttachment(attachment, slotId);
12894 }
12895
12897 {
12898 if (!super.CanReleaseAttachment(attachment))
12899 return false;
12900
12901 return GetInventory().AreChildrenAccessible();
12902 }
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12925 {
12926 int id = muzzle_owner.GetMuzzleID();
12927 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12928
12929 if (WPOF_array)
12930 {
12931 for (int i = 0; i < WPOF_array.Count(); i++)
12932 {
12933 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12934
12935 if (WPOF)
12936 {
12937 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12938 }
12939 }
12940 }
12941 }
12942
12943
12945 {
12946 int id = muzzle_owner.GetMuzzleID();
12948
12949 if (WPOBE_array)
12950 {
12951 for (int i = 0; i < WPOBE_array.Count(); i++)
12952 {
12953 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12954
12955 if (WPOBE)
12956 {
12957 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12958 }
12959 }
12960 }
12961 }
12962
12963
12965 {
12966 int id = muzzle_owner.GetMuzzleID();
12967 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12968
12969 if (WPOOH_array)
12970 {
12971 for (int i = 0; i < WPOOH_array.Count(); i++)
12972 {
12973 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12974
12975 if (WPOOH)
12976 {
12977 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12978 }
12979 }
12980 }
12981 }
12982
12983
12985 {
12986 int id = muzzle_owner.GetMuzzleID();
12987 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12988
12989 if (WPOOH_array)
12990 {
12991 for (int i = 0; i < WPOOH_array.Count(); i++)
12992 {
12993 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12994
12995 if (WPOOH)
12996 {
12997 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12998 }
12999 }
13000 }
13001 }
13002
13003
13005 {
13006 int id = muzzle_owner.GetMuzzleID();
13007 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13008
13009 if (WPOOH_array)
13010 {
13011 for (int i = 0; i < WPOOH_array.Count(); i++)
13012 {
13013 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13014
13015 if (WPOOH)
13016 {
13017 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13018 }
13019 }
13020 }
13021 }
13022
13023
13024
13026 {
13028 {
13029 return true;
13030 }
13031
13032 return false;
13033 }
13034
13036 {
13038 {
13039 return true;
13040 }
13041
13042 return false;
13043 }
13044
13046 {
13048 {
13049 return true;
13050 }
13051
13052 return false;
13053 }
13054
13056 {
13057 return false;
13058 }
13059
13062 {
13063 return UATimeSpent.DEFAULT_DEPLOY;
13064 }
13065
13066
13067
13068
13070 {
13072 SetSynchDirty();
13073 }
13074
13076 {
13078 }
13079
13080
13082 {
13083 return false;
13084 }
13085
13088 {
13089 string att_type = "None";
13090
13091 if (ConfigIsExisting("soundAttType"))
13092 {
13093 att_type = ConfigGetString("soundAttType");
13094 }
13095
13097 }
13098
13100 {
13102 }
13103
13104
13105
13106
13107
13111
13113 {
13116
13118 }
13119
13120
13122 {
13124 return;
13125
13127
13130
13133
13134 SoundParameters params = new SoundParameters();
13138 }
13139
13140
13142 {
13144 return;
13145
13147 SetSynchDirty();
13148
13151 }
13152
13153
13155 {
13157 return;
13158
13160 SetSynchDirty();
13161
13164 }
13165
13167 {
13169 }
13170
13172 {
13174 }
13175
13178 {
13179 if (!
GetGame().IsDedicatedServer())
13180 {
13181 if (ConfigIsExisting("attachSoundSet"))
13182 {
13183 string cfg_path = "";
13184 string soundset = "";
13185 string type_name =
GetType();
13186
13189 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13190 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13191
13192 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13193 {
13194 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13195 {
13196 if (cfg_slot_array[i] == slot_type)
13197 {
13198 soundset = cfg_soundset_array[i];
13199 break;
13200 }
13201 }
13202 }
13203
13204 if (soundset != "")
13205 {
13206 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13208 }
13209 }
13210 }
13211 }
13212
13214 {
13215
13216 }
13217
13218 void OnApply(PlayerBase player);
13219
13221 {
13222 return 1.0;
13223 };
13224
13226 {
13228 }
13229
13231 {
13233 }
13234
13236
13238 {
13239 SetDynamicPhysicsLifeTime(0.01);
13241 }
13242
13244 {
13245 array<string> zone_names = new array<string>;
13246 GetDamageZones(zone_names);
13247 for (int i = 0; i < zone_names.Count(); i++)
13248 {
13249 SetHealthMax(zone_names.Get(i),"Health");
13250 }
13251 SetHealthMax("","Health");
13252 }
13253
13256 {
13257 float global_health = GetHealth01("","Health");
13258 array<string> zones = new array<string>;
13259 GetDamageZones(zones);
13260
13261 for (int i = 0; i < zones.Count(); i++)
13262 {
13263 SetHealth01(zones.Get(i),"Health",global_health);
13264 }
13265 }
13266
13269 {
13270 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13271 }
13272
13274 {
13275 if (!hasRootAsPlayer)
13276 {
13277 if (refParentIB)
13278 {
13279
13280 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13281 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13282
13283 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13284 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13285
13288 }
13289 else
13290 {
13291
13294 }
13295 }
13296 }
13297
13299 {
13301 {
13302 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13303 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13304 {
13305 float heatPermCoef = 1.0;
13307 while (ent)
13308 {
13309 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13310 ent = ent.GetHierarchyParent();
13311 }
13312
13313 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13314 }
13315 }
13316 }
13317
13319 {
13320
13321 EntityAI parent = GetHierarchyParent();
13322 if (!parent)
13323 {
13324 hasParent = false;
13325 hasRootAsPlayer = false;
13326 }
13327 else
13328 {
13329 hasParent = true;
13330 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13331 refParentIB =
ItemBase.Cast(parent);
13332 }
13333 }
13334
13335 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13336 {
13337
13338 }
13339
13341 {
13342
13343 return false;
13344 }
13345
13347 {
13348
13349
13350 return false;
13351 }
13352
13354 {
13355
13356 return false;
13357 }
13358
13361 {
13362 return !GetIsFrozen() &&
IsOpen();
13363 }
13364
13366 {
13367 bool hasParent = false, hasRootAsPlayer = false;
13369
13370 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13371 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13372
13373 if (wwtu || foodDecay)
13374 {
13378
13379 if (processWetness || processTemperature || processDecay)
13380 {
13382
13383 if (processWetness)
13384 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13385
13386 if (processTemperature)
13388
13389 if (processDecay)
13390 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13391 }
13392 }
13393 }
13394
13397 {
13399 }
13400
13402 {
13405
13406 return super.GetTemperatureFreezeThreshold();
13407 }
13408
13410 {
13413
13414 return super.GetTemperatureThawThreshold();
13415 }
13416
13418 {
13421
13422 return super.GetItemOverheatThreshold();
13423 }
13424
13426 {
13428 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13429
13430 return super.GetTemperatureFreezeTime();
13431 }
13432
13434 {
13436 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13437
13438 return super.GetTemperatureThawTime();
13439 }
13440
13445
13447 {
13448 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13449 }
13450
13452 {
13453 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13454 }
13455
13458 {
13460 }
13461
13463 {
13465 }
13466
13468 {
13470 }
13471
13474 {
13475 return null;
13476 }
13477
13480 {
13481 return false;
13482 }
13483
13485 {
13487 {
13490 if (!trg)
13491 {
13493 explosive = this;
13494 }
13495
13496 explosive.PairRemote(trg);
13498
13499 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13500 trg.SetPersistentPairID(persistentID);
13501 explosive.SetPersistentPairID(persistentID);
13502
13503 return true;
13504 }
13505 return false;
13506 }
13507
13510 {
13511 float ret = 1.0;
13514 ret *= GetHealth01();
13515
13516 return ret;
13517 }
13518
13519 #ifdef DEVELOPER
13520 override void SetDebugItem()
13521 {
13522 super.SetDebugItem();
13523 _itemBase = this;
13524 }
13525
13527 {
13528 string text = super.GetDebugText();
13529
13531 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13532
13533 return text;
13534 }
13535 #endif
13536
13538 {
13539 return true;
13540 }
13541
13543
13545
13547 {
13550 }
13551
13552
13560
13576}
13577
13579{
13581 if (entity)
13582 {
13583 bool is_item = entity.IsInherited(
ItemBase);
13584 if (is_item && full_quantity)
13585 {
13588 }
13589 }
13590 else
13591 {
13593 return NULL;
13594 }
13595 return entity;
13596}
13597
13599{
13600 if (item)
13601 {
13602 if (health > 0)
13603 item.SetHealth("", "", health);
13604
13605 if (item.CanHaveTemperature())
13606 {
13608 if (item.CanFreeze())
13609 item.SetFrozen(false);
13610 }
13611
13612 if (item.HasEnergyManager())
13613 {
13614 if (quantity >= 0)
13615 {
13616 item.GetCompEM().SetEnergy0To1(quantity);
13617 }
13618 else
13619 {
13621 }
13622 }
13623 else if (item.IsMagazine())
13624 {
13625 Magazine mag = Magazine.Cast(item);
13626 if (quantity >= 0)
13627 {
13628 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13629 }
13630 else
13631 {
13633 }
13634
13635 }
13636 else
13637 {
13638 if (quantity >= 0)
13639 {
13640 item.SetQuantityNormalized(quantity, false);
13641 }
13642 else
13643 {
13645 }
13646
13647 }
13648 }
13649}
13650
13651#ifdef DEVELOPER
13653#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.