8860{
8862 {
8863 return true;
8864 }
8865};
8866
8867
8868
8870{
8874
8876
8879
8880
8881
8882
8883
8892
8898
8903
8908
8929 protected bool m_IsResultOfSplit
8930
8932
8937
8938
8939
8941
8945
8946
8947
8949
8952
8953
8954
8960
8961
8969
8972
8973
8975
8976
8978
8979
8984
8985
8990
8991
8993
8994
8996 {
9001
9002 if (!
GetGame().IsDedicatedServer())
9003 {
9005 {
9007
9009 {
9011 }
9012 }
9013
9016 }
9017
9018 m_OldLocation = null;
9019
9021 {
9023 }
9024
9025 if (ConfigIsExisting("headSelectionsToHide"))
9026 {
9029 }
9030
9032 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9033 {
9035 }
9036
9038
9039 m_IsResultOfSplit = false;
9040
9042 }
9043
9045 {
9046 super.InitItemVariables();
9047
9053 m_Count = ConfigGetInt(
"count");
9054
9057
9062
9065
9070
9082
9086
9087
9090 if (ConfigIsExisting("canBeSplit"))
9091 {
9094 }
9095
9097 if (ConfigIsExisting("itemBehaviour"))
9099
9100
9103 RegisterNetSyncVariableInt("m_VarLiquidType");
9104 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9105
9106 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9107 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9108 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9109
9110 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9111 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9112 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9113 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9114
9115 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9116 RegisterNetSyncVariableBool("m_IsTakeable");
9117 RegisterNetSyncVariableBool("m_IsHologram");
9118
9121 {
9124 }
9125
9127
9129 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9131
9132 }
9133
9135 {
9137 }
9138
9140 {
9143 {
9148 }
9149 }
9150
9151 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9152 {
9154 {
9157 }
9158
9160 }
9161
9163 {
9169 }
9170
9172
9174 {
9176
9177 if (!action)
9178 {
9179 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9180 return;
9181 }
9182
9184 if (!ai)
9185 {
9187 return;
9188 }
9189
9191 if (!action_array)
9192 {
9193 action_array = new array<ActionBase_Basic>;
9195 }
9196 if (LogManager.IsActionLogEnable())
9197 {
9198 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9199 }
9200
9201 if (action_array.Find(action) != -1)
9202 {
9203 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9204 }
9205 else
9206 {
9207 action_array.Insert(action);
9208 }
9209 }
9210
9212 {
9214 ActionBase action = player.GetActionManager().GetAction(actionName);
9217
9218 if (action_array)
9219 {
9220 action_array.RemoveItem(action);
9221 }
9222 }
9223
9224
9225
9227 {
9228 ActionOverrideData overrideData = new ActionOverrideData();
9232
9234 if (!actionMap)
9235 {
9238 }
9239
9240 actionMap.Insert(this.
Type(), overrideData);
9241
9242 }
9243
9245
9247
9248
9250 {
9253
9256
9257 string config_to_search = "CfgVehicles";
9258 string muzzle_owner_config;
9259
9261 {
9262 if (IsInherited(Weapon))
9263 config_to_search = "CfgWeapons";
9264
9265 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9266
9267 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9268
9270
9271 if (config_OnFire_subclass_count > 0)
9272 {
9273 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9274
9275 for (int i = 0; i < config_OnFire_subclass_count; i++)
9276 {
9277 string particle_class = "";
9279 string config_OnFire_entry = config_OnFire_class + particle_class;
9280 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9281 WPOF_array.Insert(WPOF);
9282 }
9283
9284
9286 }
9287 }
9288
9290 {
9291 config_to_search = "CfgWeapons";
9292 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9293
9294 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9295
9297
9298 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9299 {
9300 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9301
9302 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9303 {
9304 string particle_class2 = "";
9306 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9307 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9308 WPOBE_array.Insert(WPOBE);
9309 }
9310
9311
9313 }
9314 }
9315 }
9316
9317
9319 {
9322
9324 {
9325 string config_to_search = "CfgVehicles";
9326
9327 if (IsInherited(Weapon))
9328 config_to_search = "CfgWeapons";
9329
9330 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9331 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9332
9333 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9334 {
9335
9337
9339 {
9341 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9343 return;
9344 }
9345
9348
9349
9350
9352 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9353
9354 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9355 {
9356 string particle_class = "";
9358 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9360
9361 if (entry_type == CT_CLASS)
9362 {
9363 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9364 WPOOH_array.Insert(WPOF);
9365 }
9366 }
9367
9368
9370 }
9371 }
9372 }
9373
9375 {
9377 }
9378
9380 {
9382 {
9384
9387
9390
9391 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9392 }
9393 }
9394
9396 {
9398 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9399
9401 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9402
9404 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9405
9407 {
9409 }
9410 }
9411
9413 {
9415 }
9416
9418 {
9421 else
9423
9425 {
9428 }
9429 else
9430 {
9433
9436 }
9437
9439 }
9440
9442 {
9444 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9445 }
9446
9448 {
9450 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9452 }
9453
9455 {
9457 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9458 }
9459
9461 {
9464
9465 OverheatingParticle OP = new OverheatingParticle();
9470
9472 }
9473
9475 {
9478
9479 return -1;
9480 }
9481
9483 {
9485 {
9488
9489 for (int i = count; i > 0; --i)
9490 {
9491 int id = i - 1;
9494
9497
9498 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9499 {
9500 if (p)
9501 {
9504 }
9505 }
9506 }
9507 }
9508 }
9509
9511 {
9513 {
9515 {
9516 int id = i - 1;
9518
9519 if (OP)
9520 {
9522
9523 if (p)
9524 {
9526 }
9527
9528 delete OP;
9529 }
9530 }
9531
9534 }
9535 }
9536
9539 {
9540 return 0.0;
9541 }
9542
9543
9545 {
9546 return 250;
9547 }
9548
9550 {
9551 return 0;
9552 }
9553
9556 {
9558 return true;
9559
9560 return false;
9561 }
9562
9565 {
9568
9570 {
9572 }
9573 else
9574 {
9575
9577 }
9578
9580 }
9581
9588 {
9589 return -1;
9590 }
9591
9592
9593
9594
9596 {
9598 {
9600 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9601
9602 if (r_index >= 0)
9603 {
9604 InventoryLocation r_il = new InventoryLocation;
9605 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9606
9607 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9610 {
9611 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9612 }
9614 {
9615 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9616 }
9617
9618 }
9619
9620 player.GetHumanInventory().ClearUserReservedLocation(this);
9621 }
9622
9625 }
9626
9627
9628
9629
9631 {
9632 return ItemBase.m_DebugActionsMask;
9633 }
9634
9636 {
9637 return ItemBase.m_DebugActionsMask & mask;
9638 }
9639
9641 {
9642 ItemBase.m_DebugActionsMask = mask;
9643 }
9644
9646 {
9647 ItemBase.m_DebugActionsMask |= mask;
9648 }
9649
9651 {
9652 ItemBase.m_DebugActionsMask &= ~mask;
9653 }
9654
9656 {
9658 {
9660 }
9661 else
9662 {
9664 }
9665 }
9666
9667
9669 {
9670 if (GetEconomyProfile())
9671 {
9672 float q_max = GetEconomyProfile().GetQuantityMax();
9673 if (q_max > 0)
9674 {
9675 float q_min = GetEconomyProfile().GetQuantityMin();
9676 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9677
9679 {
9680 ComponentEnergyManager comp = GetCompEM();
9682 {
9684 }
9685 }
9687 {
9689
9690 }
9691
9692 }
9693 }
9694 }
9695
9698 {
9699 EntityAI parent = GetHierarchyParent();
9700
9701 if (parent)
9702 {
9703 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9704 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9705 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9706 }
9707 }
9708
9711 {
9712 EntityAI parent = GetHierarchyParent();
9713
9714 if (parent)
9715 {
9716 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9717 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9718 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9719 }
9720 }
9721
9723 {
9724
9725
9726
9727
9729
9731 {
9732 if (ScriptInputUserData.CanStoreInputUserData())
9733 {
9734 ScriptInputUserData ctx = new ScriptInputUserData;
9740 ctx.
Write(use_stack_max);
9743
9745 {
9746 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9747 }
9748 }
9749 }
9750 else if (!
GetGame().IsMultiplayer())
9751 {
9753 }
9754 }
9755
9757 {
9759 }
9760
9762 {
9764 }
9765
9767 {
9769 }
9770
9772 {
9773
9774 return false;
9775 }
9776
9778 {
9779 return false;
9780 }
9781
9785 {
9786 return false;
9787 }
9788
9790 {
9791 return "";
9792 }
9793
9795
9797 {
9798 return false;
9799 }
9800
9802 {
9803 return true;
9804 }
9805
9806
9807
9809 {
9810 return true;
9811 }
9812
9814 {
9815 return true;
9816 }
9817
9819 {
9820 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9822 }
9823
9825 {
9827 }
9828
9830 {
9832 if (!is_being_placed)
9834 SetSynchDirty();
9835 }
9836
9837
9839
9841 {
9843 }
9844
9846 {
9848 }
9849
9851 {
9852 return 1;
9853 }
9854
9856 {
9857 return false;
9858 }
9859
9861 {
9863 SetSynchDirty();
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
9892
9893
9894
9895
9896
9897
9898
9899
9901 {
9902 super.OnMovedInsideCargo(container);
9903
9904 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9905 }
9906
9907 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9908 {
9909 super.EEItemLocationChanged(oldLoc,newLoc);
9910
9911 PlayerBase new_player = null;
9912 PlayerBase old_player = null;
9913
9914 if (newLoc.GetParent())
9915 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9916
9917 if (oldLoc.GetParent())
9918 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9919
9921 {
9922 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9923
9924 if (r_index >= 0)
9925 {
9926 InventoryLocation r_il = new InventoryLocation;
9927 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9928
9929 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9932 {
9933 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9934 }
9936 {
9937 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9938 }
9939
9940 }
9941 }
9942
9944 {
9945 if (new_player)
9946 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9947
9948 if (new_player == old_player)
9949 {
9950
9951 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9952 {
9954 {
9955 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9956 {
9957 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9958 }
9959 }
9960 else
9961 {
9962 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9963 }
9964 }
9965
9966 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9967 {
9968 int type = oldLoc.GetType();
9970 {
9971 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9972 }
9974 {
9975 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9976 }
9977 }
9978 if (!m_OldLocation)
9979 {
9980 m_OldLocation = new InventoryLocation;
9981 }
9982 m_OldLocation.Copy(oldLoc);
9983 }
9984 else
9985 {
9986 if (m_OldLocation)
9987 {
9988 m_OldLocation.Reset();
9989 }
9990 }
9991
9993 }
9994 else
9995 {
9996 if (new_player)
9997 {
9998 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9999 if (res_index >= 0)
10000 {
10001 InventoryLocation il = new InventoryLocation;
10002 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10004 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10007 {
10008 il.
GetParent().GetOnReleaseLock().Invoke(it);
10009 }
10011 {
10013 }
10014
10015 }
10016 }
10018 {
10019
10021 }
10022
10023 if (m_OldLocation)
10024 {
10025 m_OldLocation.Reset();
10026 }
10027 }
10028 }
10029
10030 override void EOnContact(IEntity other, Contact extra)
10031 {
10033 {
10034 int liquidType = -1;
10036 if (impactSpeed > 0.0)
10037 {
10039 #ifndef SERVER
10041 #else
10043 SetSynchDirty();
10044 #endif
10046 }
10047 }
10048
10049 #ifdef SERVER
10050 if (GetCompEM() && GetCompEM().IsPlugged())
10051 {
10052 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10053 GetCompEM().UnplugThis();
10054 }
10055 #endif
10056 }
10057
10059
10061 {
10063 }
10064
10066 {
10067
10068 }
10069
10071 {
10072 super.OnItemLocationChanged(old_owner, new_owner);
10073
10074 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10075 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10076
10077 if (!relatedPlayer && playerNew)
10078 relatedPlayer = playerNew;
10079
10080 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10081 {
10083 if (actionMgr)
10084 {
10085 ActionBase currentAction = actionMgr.GetRunningAction();
10086 if (currentAction)
10088 }
10089 }
10090
10091 Man ownerPlayerOld = null;
10092 Man ownerPlayerNew = null;
10093
10094 if (old_owner)
10095 {
10096 if (old_owner.
IsMan())
10097 {
10098 ownerPlayerOld = Man.Cast(old_owner);
10099 }
10100 else
10101 {
10102 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10103 }
10104 }
10105 else
10106 {
10108 {
10110
10111 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10112 {
10113 GetCompEM().UnplugThis();
10114 }
10115 }
10116 }
10117
10118 if (new_owner)
10119 {
10120 if (new_owner.
IsMan())
10121 {
10122 ownerPlayerNew = Man.Cast(new_owner);
10123 }
10124 else
10125 {
10126 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10127 }
10128 }
10129
10130 if (ownerPlayerOld != ownerPlayerNew)
10131 {
10132 if (ownerPlayerOld)
10133 {
10134 array<EntityAI> subItemsExit = new array<EntityAI>;
10136 for (int i = 0; i < subItemsExit.Count(); i++)
10137 {
10140 }
10141 }
10142
10143 if (ownerPlayerNew)
10144 {
10145 array<EntityAI> subItemsEnter = new array<EntityAI>;
10147 for (int j = 0; j < subItemsEnter.Count(); j++)
10148 {
10151 }
10152 }
10153 }
10154 else if (ownerPlayerNew != null)
10155 {
10156 PlayerBase nplayer;
10157 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10158 {
10159 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10161 for (int k = 0; k < subItemsUpdate.Count(); k++)
10162 {
10164 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10165 }
10166 }
10167 }
10168
10169 if (old_owner)
10170 old_owner.OnChildItemRemoved(this);
10171 if (new_owner)
10172 new_owner.OnChildItemReceived(this);
10173 }
10174
10175
10177 {
10178 super.EEDelete(parent);
10179 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10180 if (player)
10181 {
10183
10184 if (player.IsAlive())
10185 {
10186 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10187 if (r_index >= 0)
10188 {
10189 InventoryLocation r_il = new InventoryLocation;
10190 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10191
10192 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10195 {
10196 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10197 }
10199 {
10200 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10201 }
10202
10203 }
10204
10205 player.RemoveQuickBarEntityShortcut(this);
10206 }
10207 }
10208 }
10209
10211 {
10212 super.EEKilled(killer);
10213
10216 {
10217 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10218 {
10219 if (IsMagazine())
10220 {
10221 if (Magazine.Cast(this).GetAmmoCount() > 0)
10222 {
10224 }
10225 }
10226 else
10227 {
10229 }
10230 }
10231 }
10232 }
10233
10235 {
10236 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10237
10238 super.OnWasAttached(parent, slot_id);
10239
10242
10244 }
10245
10247 {
10248 super.OnWasDetached(parent, slot_id);
10249
10252 }
10253
10255 {
10256 int idx;
10259
10260 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10261 if (inventory_slots.Count() < 1)
10262 {
10263 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10264 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10265 }
10266 else
10267 {
10268 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10269 }
10270
10271 idx = inventory_slots.Find(slot);
10272 if (idx < 0)
10273 return "";
10274
10275 return attach_types.Get(idx);
10276 }
10277
10279 {
10280 int idx = -1;
10281 string slot;
10282
10285
10286 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10287 if (inventory_slots.Count() < 1)
10288 {
10289 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10290 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10291 }
10292 else
10293 {
10294 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10295 if (detach_types.Count() < 1)
10296 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10297 }
10298
10299 for (int i = 0; i < inventory_slots.Count(); i++)
10300 {
10301 slot = inventory_slots.Get(i);
10302 }
10303
10304 if (slot != "")
10305 {
10306 if (detach_types.Count() == 1)
10307 idx = 0;
10308 else
10309 idx = inventory_slots.Find(slot);
10310 }
10311 if (idx < 0)
10312 return "";
10313
10314 return detach_types.Get(idx);
10315 }
10316
10318 {
10319
10321
10322
10323 float min_time = 1;
10324 float max_time = 3;
10325 float delay = Math.RandomFloat(min_time, max_time);
10326
10327 explode_timer.Run(delay, this, "DoAmmoExplosion");
10328 }
10329
10331 {
10332 Magazine magazine = Magazine.Cast(this);
10333 int pop_sounds_count = 6;
10334 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10335
10336
10337 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10338 string sound_name = pop_sounds[ sound_idx ];
10340
10341
10342 magazine.ServerAddAmmoCount(-1);
10343
10344
10345 float min_temp_to_explode = 100;
10346
10347 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10348 {
10350 }
10351 }
10352
10353
10354 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10355 {
10356 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10357
10358 const int CHANCE_DAMAGE_CARGO = 4;
10359 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10360 const int CHANCE_DAMAGE_NOTHING = 2;
10361
10363 {
10364 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10365 int chances;
10366 int rnd;
10367
10368 if (GetInventory().GetCargo())
10369 {
10370 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10371 rnd = Math.RandomInt(0,chances);
10372
10373 if (rnd < CHANCE_DAMAGE_CARGO)
10374 {
10376 }
10377 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10378 {
10380 }
10381 }
10382 else
10383 {
10384 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10385 rnd = Math.RandomInt(0,chances);
10386
10387 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10388 {
10390 }
10391 }
10392 }
10393 }
10394
10396 {
10397 if (GetInventory().GetCargo())
10398 {
10399 int item_count = GetInventory().GetCargo().GetItemCount();
10400 if (item_count > 0)
10401 {
10402 int random_pick = Math.RandomInt(0, item_count);
10404 if (!item.IsExplosive())
10405 {
10406 item.AddHealth("","",damage);
10407 return true;
10408 }
10409 }
10410 }
10411 return false;
10412 }
10413
10415 {
10416 int attachment_count = GetInventory().AttachmentCount();
10417 if (attachment_count > 0)
10418 {
10419 int random_pick = Math.RandomInt(0, attachment_count);
10420 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10421 if (!attachment.IsExplosive())
10422 {
10423 attachment.AddHealth("","",damage);
10424 return true;
10425 }
10426 }
10427 return false;
10428 }
10429
10431 {
10433 }
10434
10436 {
10438 return GetInventory().CanRemoveEntity();
10439
10440 return false;
10441 }
10442
10444 {
10445
10447 return false;
10448
10449
10451 return false;
10452
10453
10454
10456 if (delta == 0)
10457 return false;
10458
10459
10460 return true;
10461 }
10462
10464 {
10466 {
10467 if (ScriptInputUserData.CanStoreInputUserData())
10468 {
10469 ScriptInputUserData ctx = new ScriptInputUserData;
10474 ctx.
Write(destination_entity);
10476 ctx.
Write(slot_id);
10478 }
10479 }
10480 else if (!
GetGame().IsMultiplayer())
10481 {
10483 }
10484 }
10485
10487 {
10488 float split_quantity_new;
10492 InventoryLocation loc = new InventoryLocation;
10493
10494 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10495 {
10497 split_quantity_new = stack_max;
10498 else
10500
10502 {
10503 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10504 if (new_item)
10505 {
10506 new_item.SetResultOfSplit(true);
10507 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10509 new_item.
SetQuantity(split_quantity_new,
false,
true);
10510 }
10511 }
10512 }
10513 else if (destination_entity && slot_id == -1)
10514 {
10515 if (quantity > stack_max)
10516 split_quantity_new = stack_max;
10517 else
10518 split_quantity_new = quantity;
10519
10521 {
10523 {
10526 }
10527
10528 if (new_item)
10529 {
10530 new_item.SetResultOfSplit(true);
10531 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10533 new_item.
SetQuantity(split_quantity_new,
false,
true);
10534 }
10535 }
10536 }
10537 else
10538 {
10539 if (stack_max != 0)
10540 {
10542 {
10544 }
10545
10546 if (split_quantity_new == 0)
10547 {
10548 if (!
GetGame().IsMultiplayer())
10549 player.PhysicalPredictiveDropItem(this);
10550 else
10551 player.ServerDropEntity(this);
10552 return;
10553 }
10554
10556 {
10558
10559 if (new_item)
10560 {
10561 new_item.SetResultOfSplit(true);
10562 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10565 new_item.PlaceOnSurface();
10566 }
10567 }
10568 }
10569 }
10570 }
10571
10573 {
10574 float split_quantity_new;
10578 InventoryLocation loc = new InventoryLocation;
10579
10580 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10581 {
10583 split_quantity_new = stack_max;
10584 else
10586
10588 {
10589 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10590 if (new_item)
10591 {
10592 new_item.SetResultOfSplit(true);
10593 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10595 new_item.
SetQuantity(split_quantity_new,
false,
true);
10596 }
10597 }
10598 }
10599 else if (destination_entity && slot_id == -1)
10600 {
10601 if (quantity > stack_max)
10602 split_quantity_new = stack_max;
10603 else
10604 split_quantity_new = quantity;
10605
10607 {
10609 {
10612 }
10613
10614 if (new_item)
10615 {
10616 new_item.SetResultOfSplit(true);
10617 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10619 new_item.
SetQuantity(split_quantity_new,
false,
true);
10620 }
10621 }
10622 }
10623 else
10624 {
10625 if (stack_max != 0)
10626 {
10628 {
10630 }
10631
10633 {
10635
10636 if (new_item)
10637 {
10638 new_item.SetResultOfSplit(true);
10639 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10642 new_item.PlaceOnSurface();
10643 }
10644 }
10645 }
10646 }
10647 }
10648
10650 {
10652 {
10653 if (ScriptInputUserData.CanStoreInputUserData())
10654 {
10655 ScriptInputUserData ctx = new ScriptInputUserData;
10660 dst.WriteToContext(ctx);
10662 }
10663 }
10664 else if (!
GetGame().IsMultiplayer())
10665 {
10667 }
10668 }
10669
10671 {
10673 {
10674 if (ScriptInputUserData.CanStoreInputUserData())
10675 {
10676 ScriptInputUserData ctx = new ScriptInputUserData;
10681 ctx.
Write(destination_entity);
10687 }
10688 }
10689 else if (!
GetGame().IsMultiplayer())
10690 {
10692 }
10693 }
10694
10696 {
10698 }
10699
10701 {
10703 float split_quantity_new;
10705 if (dst.IsValid())
10706 {
10707 int slot_id = dst.GetSlot();
10709
10710 if (quantity > stack_max)
10711 split_quantity_new = stack_max;
10712 else
10713 split_quantity_new = quantity;
10714
10716 {
10718
10719 if (new_item)
10720 {
10721 new_item.SetResultOfSplit(true);
10722 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10724 new_item.
SetQuantity(split_quantity_new,
false,
true);
10725 }
10726
10727 return new_item;
10728 }
10729 }
10730
10731 return null;
10732 }
10733
10735 {
10737 float split_quantity_new;
10739 if (destination_entity)
10740 {
10742 if (quantity > stackable)
10743 split_quantity_new = stackable;
10744 else
10745 split_quantity_new = quantity;
10746
10748 {
10749 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10750 if (new_item)
10751 {
10752 new_item.SetResultOfSplit(true);
10753 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10755 new_item.
SetQuantity(split_quantity_new,
false,
true);
10756 }
10757 }
10758 }
10759 }
10760
10762 {
10764 {
10765 if (ScriptInputUserData.CanStoreInputUserData())
10766 {
10767 ScriptInputUserData ctx = new ScriptInputUserData;
10772 ItemBase destination_entity =
this;
10773 ctx.
Write(destination_entity);
10777 }
10778 }
10779 else if (!
GetGame().IsMultiplayer())
10780 {
10782 }
10783 }
10784
10786 {
10788 float split_quantity_new;
10790 if (player)
10791 {
10793 if (quantity > stackable)
10794 split_quantity_new = stackable;
10795 else
10796 split_quantity_new = quantity;
10797
10799 {
10800 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10801 new_item =
ItemBase.Cast(in_hands);
10802 if (new_item)
10803 {
10804 new_item.SetResultOfSplit(true);
10805 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10807 new_item.SetQuantity(split_quantity_new, false, true);
10808 }
10809 }
10810 }
10811 }
10812
10814 {
10816 float split_quantity_new = Math.Floor(quantity * 0.5);
10817
10819 return;
10820
10822
10823 if (new_item)
10824 {
10825 if (new_item.GetQuantityMax() < split_quantity_new)
10826 {
10827 split_quantity_new = new_item.GetQuantityMax();
10828 }
10829
10830 new_item.SetResultOfSplit(true);
10831 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10832
10834 {
10837 }
10838 else
10839 {
10841 new_item.
SetQuantity(split_quantity_new,
false,
true);
10842 }
10843 }
10844 }
10845
10847 {
10849 float split_quantity_new = Math.Floor(quantity / 2);
10850
10852 return;
10853
10854 InventoryLocation invloc = new InventoryLocation;
10856
10858 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10859
10860 if (new_item)
10861 {
10862 if (new_item.GetQuantityMax() < split_quantity_new)
10863 {
10864 split_quantity_new = new_item.GetQuantityMax();
10865 }
10867 {
10870 }
10871 else if (split_quantity_new > 1)
10872 {
10874 new_item.
SetQuantity(split_quantity_new,
false,
true);
10875 }
10876 }
10877 }
10878
10881 {
10882 SetWeightDirty();
10884
10885 if (parent)
10886 parent.OnAttachmentQuantityChangedEx(this, delta);
10887
10889 {
10891 {
10893 }
10895 {
10896 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10898 }
10899 }
10900
10901 }
10902
10905 {
10906
10907 }
10908
10911 {
10913 }
10914
10916 {
10917 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10918
10920 {
10921 if (newLevel == GameConstants.STATE_RUINED)
10922 {
10924 EntityAI parent = GetHierarchyParent();
10925 if (parent && parent.IsFireplace())
10926 {
10927 CargoBase cargo = GetInventory().GetCargo();
10928 if (cargo)
10929 {
10931 {
10933 }
10934 }
10935 }
10936 }
10937
10939 {
10940
10942 return;
10943 }
10944
10945 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10946 {
10948 }
10949 }
10950 }
10951
10952
10954 {
10955 super.OnRightClick();
10956
10958 {
10960 {
10961 if (ScriptInputUserData.CanStoreInputUserData())
10962 {
10963 EntityAI root = GetHierarchyRoot();
10964 Man playerOwner = GetHierarchyRootPlayer();
10965 InventoryLocation dst = new InventoryLocation;
10966
10967
10968 if (!playerOwner && root && root == this)
10969 {
10971 }
10972 else
10973 {
10974
10975 GetInventory().GetCurrentInventoryLocation(dst);
10977 {
10980 {
10982 }
10983 else
10984 {
10986
10987
10988 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10989 {
10991 }
10992 else
10993 {
10994 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10995 }
10996 }
10997 }
10998 }
10999
11000 ScriptInputUserData ctx = new ScriptInputUserData;
11008 }
11009 }
11010 else if (!
GetGame().IsMultiplayer())
11011 {
11013 }
11014 }
11015 }
11016
11018 {
11019 if (root)
11020 {
11021 vector m4[4];
11022 root.GetTransform(m4);
11023 dst.SetGround(this, m4);
11024 }
11025 else
11026 {
11027 GetInventory().GetCurrentInventoryLocation(dst);
11028 }
11029 }
11030
11031 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11032 {
11033
11034 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11035 return false;
11036
11037 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11038 return false;
11039
11040
11042 return false;
11043
11044
11045 Magazine mag = Magazine.Cast(this);
11046 if (mag)
11047 {
11048 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11049 return false;
11050
11051 if (stack_max_limit)
11052 {
11053 Magazine other_mag = Magazine.Cast(other_item);
11054 if (other_item)
11055 {
11056 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11057 return false;
11058 }
11059
11060 }
11061 }
11062 else
11063 {
11064
11066 return false;
11067
11069 return false;
11070 }
11071
11072 PlayerBase player = null;
11073 if (CastTo(player, GetHierarchyRootPlayer()))
11074 {
11075 if (player.GetInventory().HasAttachment(this))
11076 return false;
11077
11078 if (player.IsItemsToDelete())
11079 return false;
11080 }
11081
11082 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11083 return false;
11084
11085 int slotID;
11087 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11088 return false;
11089
11090 return true;
11091 }
11092
11094 {
11096 }
11097
11099 {
11100 return m_IsResultOfSplit;
11101 }
11102
11104 {
11105 m_IsResultOfSplit = value;
11106 }
11107
11109 {
11111 }
11112
11114 {
11115 float other_item_quantity = other_item.GetQuantity();
11116 float this_free_space;
11117
11119
11121
11122 if (other_item_quantity > this_free_space)
11123 {
11124 return this_free_space;
11125 }
11126 else
11127 {
11128 return other_item_quantity;
11129 }
11130 }
11131
11133 {
11135 }
11136
11138 {
11140 return;
11141
11142 if (!IsMagazine() && other_item)
11143 {
11145 if (quantity_used != 0)
11146 {
11147 float hp1 = GetHealth01("","");
11148 float hp2 = other_item.GetHealth01("","");
11149 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11150 hpResult = hpResult / (
GetQuantity() + quantity_used);
11151
11152 hpResult *= GetMaxHealth();
11153 Math.Round(hpResult);
11154 SetHealth("", "Health", hpResult);
11155
11157 other_item.AddQuantity(-quantity_used);
11158 }
11159 }
11161 }
11162
11164 {
11165 #ifdef SERVER
11166 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11167 GetHierarchyParent().IncreaseLifetimeUp();
11168 #endif
11169 };
11170
11172 {
11173 PlayerBase p = PlayerBase.Cast(player);
11174
11175 array<int> recipesIds = p.m_Recipes;
11176 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11177 if (moduleRecipesManager)
11178 {
11179 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11180 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11181 }
11182
11183 for (int i = 0;i < recipesIds.Count(); i++)
11184 {
11185 int key = recipesIds.Get(i);
11186 string recipeName = moduleRecipesManager.GetRecipeName(key);
11188 }
11189 }
11190
11191
11192 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11193 {
11194 super.GetDebugActions(outputList);
11195
11196
11202
11203
11208
11213
11214
11218
11219
11221 {
11225 }
11226
11229
11230
11234
11236
11237 InventoryLocation loc = new InventoryLocation();
11238 GetInventory().GetCurrentInventoryLocation(loc);
11240 {
11241 if (Gizmo_IsSupported())
11244 }
11245
11247 }
11248
11249
11250
11251
11253 {
11254 super.OnAction(action_id, player, ctx);
11255
11257 {
11258 switch (action_id)
11259 {
11262 return true;
11265 return true;
11266 }
11267 }
11268
11270 {
11271 switch (action_id)
11272 {
11274 Delete();
11275 return true;
11276 }
11277 }
11278
11279 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11280 {
11281 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11282 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11283 PlayerBase p = PlayerBase.Cast(player);
11284 if (
EActions.RECIPES_RANGE_START < 1000)
11285 {
11286 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11287 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11288 }
11289 }
11290 #ifndef SERVER
11291 else if (action_id ==
EActions.WATCH_PLAYER)
11292 {
11293 PluginDeveloper.SetDeveloperItemClientEx(player);
11294 }
11295 #endif
11297 {
11298 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11299 {
11300 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11301 OnDebugButtonPressServer(id + 1);
11302 }
11303
11304 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11305 {
11306 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11308 }
11309
11310 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11311 {
11312 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11314 }
11315
11316 else if (action_id ==
EActions.ADD_QUANTITY)
11317 {
11318 if (IsMagazine())
11319 {
11320 Magazine mag = Magazine.Cast(this);
11321 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11322 }
11323 else
11324 {
11326 }
11327
11328 if (m_EM)
11329 {
11330 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11331 }
11332
11333 }
11334
11335 else if (action_id ==
EActions.REMOVE_QUANTITY)
11336 {
11337 if (IsMagazine())
11338 {
11339 Magazine mag2 = Magazine.Cast(this);
11340 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11341 }
11342 else
11343 {
11345 }
11346 if (m_EM)
11347 {
11348 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11349 }
11350
11351 }
11352
11353 else if (action_id ==
EActions.SET_QUANTITY_0)
11354 {
11356
11357 if (m_EM)
11358 {
11359 m_EM.SetEnergy(0);
11360 }
11361 }
11362
11363 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11364 {
11366
11367 if (m_EM)
11368 {
11369 m_EM.SetEnergy(m_EM.GetEnergyMax());
11370 }
11371 }
11372
11373 else if (action_id ==
EActions.ADD_HEALTH)
11374 {
11375 AddHealth("","",GetMaxHealth("","Health")/5);
11376 }
11377 else if (action_id ==
EActions.REMOVE_HEALTH)
11378 {
11379 AddHealth("","",-GetMaxHealth("","Health")/5);
11380 }
11381 else if (action_id ==
EActions.DESTROY_HEALTH)
11382 {
11383 SetHealth01("","",0);
11384 }
11385 else if (action_id ==
EActions.WATCH_ITEM)
11386 {
11388 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11389 #ifdef DEVELOPER
11390 SetDebugDeveloper_item(this);
11391 #endif
11392 }
11393
11394 else if (action_id ==
EActions.ADD_TEMPERATURE)
11395 {
11396 AddTemperature(20);
11397
11398 }
11399
11400 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11401 {
11402 AddTemperature(-20);
11403
11404 }
11405
11406 else if (action_id ==
EActions.FLIP_FROZEN)
11407 {
11408 SetFrozen(!GetIsFrozen());
11409
11410 }
11411
11412 else if (action_id ==
EActions.ADD_WETNESS)
11413 {
11415
11416 }
11417
11418 else if (action_id ==
EActions.REMOVE_WETNESS)
11419 {
11421
11422 }
11423
11424 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11425 {
11428
11429
11430 }
11431
11432 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11433 {
11436 }
11437
11438 else if (action_id ==
EActions.MAKE_SPECIAL)
11439 {
11440 auto debugParams = DebugSpawnParams.WithPlayer(player);
11441 OnDebugSpawnEx(debugParams);
11442 }
11443
11444 }
11445
11446
11447 return false;
11448 }
11449
11450
11451
11452
11456
11459
11460
11461
11463 {
11464 return false;
11465 }
11466
11467
11469 {
11470 return true;
11471 }
11472
11473
11475 {
11476 return true;
11477 }
11478
11479
11480
11482 {
11483 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11485 }
11486
11489 {
11490 return null;
11491 }
11492
11494 {
11495 return false;
11496 }
11497
11499 {
11500 return false;
11501 }
11502
11506
11507
11509 {
11510 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11511 return module_repairing.CanRepair(this, item_repair_kit);
11512 }
11513
11514
11515 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11516 {
11517 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11518 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11519 }
11520
11521
11523 {
11524
11525
11526
11527
11528
11529
11530
11531
11532 return 1;
11533 }
11534
11535
11536
11538 {
11540 }
11541
11542
11543
11545 {
11547 }
11548
11549
11558 {
11559 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11560
11561 if (player)
11562 {
11563 player.MessageStatus(text);
11564 }
11565 }
11566
11567
11576 {
11577 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11578
11579 if (player)
11580 {
11581 player.MessageAction(text);
11582 }
11583 }
11584
11585
11594 {
11595 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11596
11597 if (player)
11598 {
11599 player.MessageFriendly(text);
11600 }
11601 }
11602
11603
11612 {
11613 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11614
11615 if (player)
11616 {
11617 player.MessageImportant(text);
11618 }
11619 }
11620
11622 {
11623 return true;
11624 }
11625
11626
11627 override bool KindOf(
string tag)
11628 {
11629 bool found = false;
11630 string item_name = this.
GetType();
11633
11634 int array_size = item_tag_array.Count();
11635 for (int i = 0; i < array_size; i++)
11636 {
11637 if (item_tag_array.Get(i) == tag)
11638 {
11639 found = true;
11640 break;
11641 }
11642 }
11643 return found;
11644 }
11645
11646
11648 {
11649
11650 super.OnRPC(sender, rpc_type,ctx);
11651
11652
11653 switch (rpc_type)
11654 {
11655 #ifndef SERVER
11656 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11657 Param2<bool, string> p = new Param2<bool, string>(false, "");
11658
11660 return;
11661
11662 bool play = p.param1;
11663 string soundSet = p.param2;
11664
11665 if (play)
11666 {
11668 {
11670 {
11672 }
11673 }
11674 else
11675 {
11677 }
11678 }
11679 else
11680 {
11682 }
11683
11684 break;
11685 #endif
11686
11687 }
11688
11690 {
11692 }
11693 }
11694
11695
11696
11697
11699 {
11700 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11701 return plugin.GetID(
name);
11702 }
11703
11705 {
11706 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11707 return plugin.GetName(id);
11708 }
11709
11712 {
11713
11714
11715 int varFlags;
11716 if (!ctx.
Read(varFlags))
11717 return;
11718
11719 if (varFlags & ItemVariableFlags.FLOAT)
11720 {
11722 }
11723 }
11724
11726 {
11727
11728 super.SerializeNumericalVars(floats_out);
11729
11730
11731
11733 {
11735 }
11736
11738 {
11740 }
11741
11743 {
11745 }
11746
11748 {
11753 }
11754
11756 {
11758 }
11759 }
11760
11762 {
11763
11764 super.DeSerializeNumericalVars(floats);
11765
11766
11767 int index = 0;
11768 int mask = Math.Round(floats.Get(index));
11769
11770 index++;
11771
11773 {
11775 {
11777 }
11778 else
11779 {
11780 float quantity = floats.Get(index);
11781 SetQuantity(quantity,
true,
false,
false,
false);
11782 }
11783 index++;
11784 }
11785
11787 {
11788 float wet = floats.Get(index);
11790 index++;
11791 }
11792
11794 {
11795 int liquidtype = Math.Round(floats.Get(index));
11797 index++;
11798 }
11799
11801 {
11803 index++;
11805 index++;
11807 index++;
11809 index++;
11810 }
11811
11813 {
11814 int cleanness = Math.Round(floats.Get(index));
11816 index++;
11817 }
11818 }
11819
11821 {
11822 super.WriteVarsToCTX(ctx);
11823
11824
11826 {
11828 }
11829
11831 {
11833 }
11834
11836 {
11838 }
11839
11841 {
11842 int r,g,b,a;
11848 }
11849
11851 {
11853 }
11854 }
11855
11857 {
11858 if (!super.ReadVarsFromCTX(ctx,version))
11859 return false;
11860
11861 int intValue;
11862 float value;
11863
11864 if (version < 140)
11865 {
11866 if (!ctx.
Read(intValue))
11867 return false;
11868
11869 m_VariablesMask = intValue;
11870 }
11871
11873 {
11874 if (!ctx.
Read(value))
11875 return false;
11876
11878 {
11880 }
11881 else
11882 {
11884 }
11885 }
11886
11887 if (version < 140)
11888 {
11890 {
11891 if (!ctx.
Read(value))
11892 return false;
11893 SetTemperatureDirect(value);
11894 }
11895 }
11896
11898 {
11899 if (!ctx.
Read(value))
11900 return false;
11902 }
11903
11905 {
11906 if (!ctx.
Read(intValue))
11907 return false;
11909 }
11910
11912 {
11913 int r,g,b,a;
11915 return false;
11917 return false;
11919 return false;
11921 return false;
11922
11924 }
11925
11927 {
11928 if (!ctx.
Read(intValue))
11929 return false;
11931 }
11932
11933 if (version >= 138 && version < 140)
11934 {
11936 {
11937 if (!ctx.
Read(intValue))
11938 return false;
11939 SetFrozen(intValue);
11940 }
11941 }
11942
11943 return true;
11944 }
11945
11946
11948 {
11951 {
11953 }
11954
11955 if (!super.OnStoreLoad(ctx, version))
11956 {
11958 return false;
11959 }
11960
11961 if (version >= 114)
11962 {
11963 bool hasQuickBarIndexSaved;
11964
11965 if (!ctx.
Read(hasQuickBarIndexSaved))
11966 {
11968 return false;
11969 }
11970
11971 if (hasQuickBarIndexSaved)
11972 {
11973 int itmQBIndex;
11974
11975
11976 if (!ctx.
Read(itmQBIndex))
11977 {
11979 return false;
11980 }
11981
11982 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11983 if (itmQBIndex != -1 && parentPlayer)
11984 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11985 }
11986 }
11987 else
11988 {
11989
11990 PlayerBase player;
11991 int itemQBIndex;
11992 if (version ==
int.
MAX)
11993 {
11994 if (!ctx.
Read(itemQBIndex))
11995 {
11997 return false;
11998 }
11999 }
12000 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12001 {
12002
12003 if (!ctx.
Read(itemQBIndex))
12004 {
12006 return false;
12007 }
12008 if (itemQBIndex != -1 && player)
12009 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12010 }
12011 }
12012
12013 if (version < 140)
12014 {
12015
12016 if (!LoadVariables(ctx, version))
12017 {
12019 return false;
12020 }
12021 }
12022
12023
12025 {
12027 return false;
12028 }
12029 if (version >= 132)
12030 {
12032 if (raib)
12033 {
12035 {
12037 return false;
12038 }
12039 }
12040 }
12041
12043 return true;
12044 }
12045
12046
12047
12049 {
12050 super.OnStoreSave(ctx);
12051
12052 PlayerBase player;
12053 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12054 {
12056
12057 int itemQBIndex = -1;
12058 itemQBIndex = player.FindQuickBarEntityIndex(this);
12059 ctx.
Write(itemQBIndex);
12060 }
12061 else
12062 {
12064 }
12065
12067
12069 if (raib)
12070 {
12072 }
12073 }
12074
12075
12077 {
12078 super.AfterStoreLoad();
12079
12081 {
12083 }
12084
12086 {
12089 }
12090 }
12091
12093 {
12094 super.EEOnAfterLoad();
12095
12097 {
12099 }
12100
12103 }
12104
12106 {
12107 return false;
12108 }
12109
12110
12111
12113 {
12115 {
12116 #ifdef PLATFORM_CONSOLE
12117
12119 {
12121 if (menu)
12122 {
12124 }
12125 }
12126 #endif
12127 }
12128
12130 {
12133 }
12134
12136 {
12137 SetWeightDirty();
12139 }
12141 {
12144 }
12145
12147 {
12150 }
12152 {
12155 }
12156
12157 super.OnVariablesSynchronized();
12158 }
12159
12160
12161
12163 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12164 {
12165 if (!IsServerCheck(allow_client))
12166 return false;
12167
12169 return false;
12170
12173
12174 if (value <= (min + 0.001))
12175 value = min;
12176
12177 if (value == min)
12178 {
12179 if (destroy_config)
12180 {
12181 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12182 if (dstr)
12183 {
12185 this.Delete();
12186 return true;
12187 }
12188 }
12189 else if (destroy_forced)
12190 {
12192 this.Delete();
12193 return true;
12194 }
12195
12197 }
12198
12201
12203 {
12205
12206 if (delta)
12208 }
12209
12211
12212 return false;
12213 }
12214
12215
12217 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12218 {
12220 }
12221
12223 {
12226 }
12227
12229 {
12232 }
12233
12235 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12236 {
12237 float value_clamped = Math.Clamp(value, 0, 1);
12239 SetQuantity(result, destroy_config, destroy_forced);
12240 }
12241
12242
12245 {
12247 }
12248
12250 {
12252 }
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12264 {
12265 int slot = -1;
12266 if (GetInventory())
12267 {
12268 InventoryLocation il = new InventoryLocation;
12269 GetInventory().GetCurrentInventoryLocation(il);
12271 }
12272
12274 }
12275
12277 {
12278 float quantity_max = 0;
12279
12281 {
12282 if (attSlotID != -1)
12283 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12284
12285 if (quantity_max <= 0)
12287 }
12288
12289 if (quantity_max <= 0)
12291
12292 return quantity_max;
12293 }
12294
12296 {
12298 }
12299
12301 {
12303 }
12304
12305
12307 {
12309 }
12310
12312 {
12314 }
12315
12317 {
12319 }
12320
12321
12323 {
12324
12325 float weightEx = GetWeightEx();
12326 float special = GetInventoryAndCargoWeight();
12327 return weightEx - special;
12328 }
12329
12330
12332 {
12334 }
12335
12337 {
12339 {
12340 #ifdef DEVELOPER
12341 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12342 {
12343 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12345 }
12346 #endif
12347
12348 return GetQuantity() * GetConfigWeightModified();
12349 }
12350 else if (HasEnergyManager())
12351 {
12352 #ifdef DEVELOPER
12353 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12354 {
12355 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12356 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12357 }
12358 #endif
12359 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12360 }
12361 else
12362 {
12363 #ifdef DEVELOPER
12364 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12365 {
12366 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12367 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12368 }
12369 #endif
12370 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12371 }
12372 }
12373
12376 {
12377 int item_count = 0;
12379
12380 if (GetInventory().GetCargo() != NULL)
12381 {
12382 item_count = GetInventory().GetCargo().GetItemCount();
12383 }
12384
12385 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12386 {
12387 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12388 if (item)
12389 item_count += item.GetNumberOfItems();
12390 }
12391 return item_count;
12392 }
12393
12396 {
12397 float weight = 0;
12398 float wetness = 1;
12399 if (include_wetness)
12402 {
12403 weight = wetness * m_ConfigWeight;
12404 }
12406 {
12407 weight = 1;
12408 }
12409 return weight;
12410 }
12411
12412
12413
12415 {
12416 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12417 {
12418 GameInventory inv = GetInventory();
12419 array<EntityAI> items = new array<EntityAI>;
12421 for (int i = 0; i < items.Count(); i++)
12422 {
12424 if (item)
12425 {
12427 }
12428 }
12429 }
12430 }
12431
12432
12433
12434
12436 {
12437 float energy = 0;
12438 if (HasEnergyManager())
12439 {
12440 energy = GetCompEM().GetEnergy();
12441 }
12442 return energy;
12443 }
12444
12445
12447 {
12448 super.OnEnergyConsumed();
12449
12451 }
12452
12454 {
12455 super.OnEnergyAdded();
12456
12458 }
12459
12460
12462 {
12463 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12464 {
12466 {
12467 float energy_0to1 = GetCompEM().GetEnergy0To1();
12469 }
12470 }
12471 }
12472
12473
12475 {
12476 return ConfigGetFloat("heatIsolation");
12477 }
12478
12480 {
12482 }
12483
12485 {
12486 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12487 if (
GetGame().ConfigIsExisting(paramPath))
12489
12490 return 0.0;
12491 }
12492
12494 {
12495 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12496 if (
GetGame().ConfigIsExisting(paramPath))
12498
12499 return 0.0;
12500 }
12501
12502 override void SetWet(
float value,
bool allow_client =
false)
12503 {
12504 if (!IsServerCheck(allow_client))
12505 return;
12506
12509
12511
12512 m_VarWet = Math.Clamp(value, min, max);
12513
12515 {
12518 }
12519 }
12520
12521 override void AddWet(
float value)
12522 {
12524 }
12525
12527 {
12529 }
12530
12532 {
12534 }
12535
12537 {
12539 }
12540
12542 {
12544 }
12545
12547 {
12549 }
12550
12551 override void OnWetChanged(
float newVal,
float oldVal)
12552 {
12555 if (newLevel != oldLevel)
12556 {
12558 }
12559 }
12560
12562 {
12563 SetWeightDirty();
12564 }
12565
12567 {
12568 return GetWetLevelInternal(
m_VarWet);
12569 }
12570
12571
12572
12574 {
12576 }
12577
12579 {
12581 }
12582
12584 {
12586 }
12587
12589 {
12591 }
12592
12593
12594
12596 {
12597 if (ConfigIsExisting("itemModelLength"))
12598 {
12599 return ConfigGetFloat("itemModelLength");
12600 }
12601 return 0;
12602 }
12603
12605 {
12606 if (ConfigIsExisting("itemAttachOffset"))
12607 {
12608 return ConfigGetFloat("itemAttachOffset");
12609 }
12610 return 0;
12611 }
12612
12613 override void SetCleanness(
int value,
bool allow_client =
false)
12614 {
12615 if (!IsServerCheck(allow_client))
12616 return;
12617
12619
12621
12624 }
12625
12627 {
12629 }
12630
12632 {
12633 return true;
12634 }
12635
12636
12637
12638
12640 {
12642 }
12643
12645 {
12647 }
12648
12649
12650
12651
12652 override void SetColor(
int r,
int g,
int b,
int a)
12653 {
12659 }
12661 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12662 {
12667 }
12668
12670 {
12672 }
12673
12676 {
12677 int r,g,b,a;
12679 r = r/255;
12680 g = g/255;
12681 b = b/255;
12682 a = a/255;
12683 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12684 }
12685
12686
12687
12688 override void SetLiquidType(
int value,
bool allow_client =
false)
12689 {
12690 if (!IsServerCheck(allow_client))
12691 return;
12692
12697 }
12698
12700 {
12701 return ConfigGetInt("varLiquidTypeInit");
12702 }
12703
12705 {
12707 }
12708
12710 {
12712 SetFrozen(false);
12713 }
12714
12717 {
12718 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12719 }
12720
12721
12724 {
12725 PlayerBase nplayer;
12726 if (PlayerBase.CastTo(nplayer, player))
12727 {
12729
12730 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12731 }
12732 }
12733
12734
12737 {
12738 PlayerBase nplayer;
12739 if (PlayerBase.CastTo(nplayer,player))
12740 {
12741
12742 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12743
12744 }
12745
12746
12747 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12748
12749
12750 if (HasEnergyManager())
12751 {
12752 GetCompEM().UpdatePlugState();
12753 }
12754 }
12755
12756
12758 {
12759 super.OnPlacementStarted(player);
12760
12762 }
12763
12764 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12765 {
12767 {
12768 m_AdminLog.OnPlacementComplete(player,
this);
12769 }
12770
12771 super.OnPlacementComplete(player, position, orientation);
12772 }
12773
12774
12775
12776
12777
12779 {
12781 {
12782 return true;
12783 }
12784 else
12785 {
12786 return false;
12787 }
12788 }
12789
12790
12792 {
12794 {
12796 }
12797 }
12798
12799
12801 {
12803 }
12804
12806 {
12808 }
12809
12810 override void InsertAgent(
int agent,
float count = 1)
12811 {
12812 if (count < 1)
12813 return;
12814
12816 }
12817
12820 {
12822 }
12823
12824
12826 {
12828 }
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12872 {
12874 return false;
12875 return true;
12876 }
12877
12879 {
12880
12882 }
12883
12884
12887 {
12888 super.CheckForRoofLimited(timeTresholdMS);
12889
12891 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12892 {
12893 m_PreviousRoofTestTime = time;
12894 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12895 }
12896 }
12897
12898
12900 {
12902 {
12903 return 0;
12904 }
12905
12906 if (GetInventory().GetAttachmentSlotsCount() != 0)
12907 {
12908 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12909 if (filter)
12910 return filter.GetProtectionLevel(type, false, system);
12911 else
12912 return 0;
12913 }
12914
12915 string subclassPath, entryName;
12916
12917 switch (type)
12918 {
12920 entryName = "biological";
12921 break;
12923 entryName = "chemical";
12924 break;
12925 default:
12926 entryName = "biological";
12927 break;
12928 }
12929
12930 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12931
12933 }
12934
12935
12936
12939 {
12940 if (!IsMagazine())
12942
12944 }
12945
12946
12947
12948
12949
12954 {
12955 return true;
12956 }
12957
12959 {
12961 }
12962
12963
12964
12965
12966
12968 {
12969 if (parent)
12970 {
12971 if (parent.IsInherited(DayZInfected))
12972 return true;
12973
12974 if (!parent.IsRuined())
12975 return true;
12976 }
12977
12978 return true;
12979 }
12980
12982 {
12983 if (!super.CanPutAsAttachment(parent))
12984 {
12985 return false;
12986 }
12987
12988 if (!IsRuined() && !parent.IsRuined())
12989 {
12990 return true;
12991 }
12992
12993 return false;
12994 }
12995
12997 {
12998
12999
13000
13001
13002 return super.CanReceiveItemIntoCargo(item);
13003 }
13004
13006 {
13007
13008
13009
13010
13011 GameInventory attachmentInv = attachment.GetInventory();
13013 {
13014 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13015 return false;
13016 }
13017
13018 InventoryLocation loc = new InventoryLocation();
13019 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13020 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13021 return false;
13022
13023 return super.CanReceiveAttachment(attachment, slotId);
13024 }
13025
13027 {
13028 if (!super.CanReleaseAttachment(attachment))
13029 return false;
13030
13031 return GetInventory().AreChildrenAccessible();
13032 }
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13055 {
13056 int id = muzzle_owner.GetMuzzleID();
13057 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13058
13059 if (WPOF_array)
13060 {
13061 for (int i = 0; i < WPOF_array.Count(); i++)
13062 {
13063 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13064
13065 if (WPOF)
13066 {
13067 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13068 }
13069 }
13070 }
13071 }
13072
13073
13075 {
13076 int id = muzzle_owner.GetMuzzleID();
13078
13079 if (WPOBE_array)
13080 {
13081 for (int i = 0; i < WPOBE_array.Count(); i++)
13082 {
13083 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13084
13085 if (WPOBE)
13086 {
13087 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13088 }
13089 }
13090 }
13091 }
13092
13093
13095 {
13096 int id = muzzle_owner.GetMuzzleID();
13097 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13098
13099 if (WPOOH_array)
13100 {
13101 for (int i = 0; i < WPOOH_array.Count(); i++)
13102 {
13103 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13104
13105 if (WPOOH)
13106 {
13107 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13108 }
13109 }
13110 }
13111 }
13112
13113
13115 {
13116 int id = muzzle_owner.GetMuzzleID();
13117 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13118
13119 if (WPOOH_array)
13120 {
13121 for (int i = 0; i < WPOOH_array.Count(); i++)
13122 {
13123 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13124
13125 if (WPOOH)
13126 {
13127 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13128 }
13129 }
13130 }
13131 }
13132
13133
13135 {
13136 int id = muzzle_owner.GetMuzzleID();
13137 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13138
13139 if (WPOOH_array)
13140 {
13141 for (int i = 0; i < WPOOH_array.Count(); i++)
13142 {
13143 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13144
13145 if (WPOOH)
13146 {
13147 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13148 }
13149 }
13150 }
13151 }
13152
13153
13154
13156 {
13158 {
13159 return true;
13160 }
13161
13162 return false;
13163 }
13164
13166 {
13168 {
13169 return true;
13170 }
13171
13172 return false;
13173 }
13174
13176 {
13178 {
13179 return true;
13180 }
13181
13182 return false;
13183 }
13184
13186 {
13187 return false;
13188 }
13189
13192 {
13193 return UATimeSpent.DEFAULT_DEPLOY;
13194 }
13195
13196
13197
13198
13200 {
13202 SetSynchDirty();
13203 }
13204
13206 {
13208 }
13209
13210
13212 {
13213 return false;
13214 }
13215
13218 {
13219 string att_type = "None";
13220
13221 if (ConfigIsExisting("soundAttType"))
13222 {
13223 att_type = ConfigGetString("soundAttType");
13224 }
13225
13227 }
13228
13230 {
13232 }
13233
13234
13235
13236
13237
13243
13245 {
13248
13250 }
13251
13252
13254 {
13256 return;
13257
13259
13262
13265
13266 SoundParameters params = new SoundParameters();
13270 }
13271
13272
13274 {
13276 return;
13277
13279 SetSynchDirty();
13280
13283 }
13284
13285
13287 {
13289 return;
13290
13292 SetSynchDirty();
13293
13296 }
13297
13299 {
13301 }
13302
13304 {
13306 }
13307
13310 {
13311 if (!
GetGame().IsDedicatedServer())
13312 {
13313 if (ConfigIsExisting("attachSoundSet"))
13314 {
13315 string cfg_path = "";
13316 string soundset = "";
13317 string type_name =
GetType();
13318
13321 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13322 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13323
13324 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13325 {
13326 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13327 {
13328 if (cfg_slot_array[i] == slot_type)
13329 {
13330 soundset = cfg_soundset_array[i];
13331 break;
13332 }
13333 }
13334 }
13335
13336 if (soundset != "")
13337 {
13338 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13340 }
13341 }
13342 }
13343 }
13344
13346 {
13347
13348 }
13349
13350 void OnApply(PlayerBase player);
13351
13353 {
13354 return 1.0;
13355 };
13356
13358 {
13360 }
13361
13363 {
13365 }
13366
13368
13370 {
13371 SetDynamicPhysicsLifeTime(0.01);
13373 }
13374
13376 {
13377 array<string> zone_names = new array<string>;
13378 GetDamageZones(zone_names);
13379 for (int i = 0; i < zone_names.Count(); i++)
13380 {
13381 SetHealthMax(zone_names.Get(i),"Health");
13382 }
13383 SetHealthMax("","Health");
13384 }
13385
13388 {
13389 float global_health = GetHealth01("","Health");
13390 array<string> zones = new array<string>;
13391 GetDamageZones(zones);
13392
13393 for (int i = 0; i < zones.Count(); i++)
13394 {
13395 SetHealth01(zones.Get(i),"Health",global_health);
13396 }
13397 }
13398
13401 {
13402 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13403 }
13404
13406 {
13407 if (!hasRootAsPlayer)
13408 {
13409 if (refParentIB)
13410 {
13411
13412 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13413 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13414
13415 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13416 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13417
13420 }
13421 else
13422 {
13423
13426 }
13427 }
13428 }
13429
13431 {
13433 {
13434 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13435 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13436 {
13437 float heatPermCoef = 1.0;
13439 while (ent)
13440 {
13441 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13442 ent = ent.GetHierarchyParent();
13443 }
13444
13445 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13446 }
13447 }
13448 }
13449
13451 {
13452
13453 EntityAI parent = GetHierarchyParent();
13454 if (!parent)
13455 {
13456 hasParent = false;
13457 hasRootAsPlayer = false;
13458 }
13459 else
13460 {
13461 hasParent = true;
13462 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13463 refParentIB =
ItemBase.Cast(parent);
13464 }
13465 }
13466
13467 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13468 {
13469
13470 }
13471
13473 {
13474
13475 return false;
13476 }
13477
13479 {
13480
13481
13482 return false;
13483 }
13484
13486 {
13487
13488 return false;
13489 }
13490
13493 {
13494 return !GetIsFrozen() &&
IsOpen();
13495 }
13496
13498 {
13499 bool hasParent = false, hasRootAsPlayer = false;
13501
13502 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13503 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13504
13505 if (wwtu || foodDecay)
13506 {
13510
13511 if (processWetness || processTemperature || processDecay)
13512 {
13514
13515 if (processWetness)
13516 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13517
13518 if (processTemperature)
13520
13521 if (processDecay)
13522 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13523 }
13524 }
13525 }
13526
13529 {
13531 }
13532
13534 {
13537
13538 return super.GetTemperatureFreezeThreshold();
13539 }
13540
13542 {
13545
13546 return super.GetTemperatureThawThreshold();
13547 }
13548
13550 {
13553
13554 return super.GetItemOverheatThreshold();
13555 }
13556
13558 {
13560 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13561
13562 return super.GetTemperatureFreezeTime();
13563 }
13564
13566 {
13568 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13569
13570 return super.GetTemperatureThawTime();
13571 }
13572
13577
13579 {
13580 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13581 }
13582
13584 {
13585 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13586 }
13587
13590 {
13592 }
13593
13595 {
13597 }
13598
13600 {
13602 }
13603
13606 {
13607 return null;
13608 }
13609
13612 {
13613 return false;
13614 }
13615
13617 {
13619 {
13622 if (!trg)
13623 {
13625 explosive = this;
13626 }
13627
13628 explosive.PairRemote(trg);
13630
13631 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13632 trg.SetPersistentPairID(persistentID);
13633 explosive.SetPersistentPairID(persistentID);
13634
13635 return true;
13636 }
13637 return false;
13638 }
13639
13642 {
13643 float ret = 1.0;
13646 ret *= GetHealth01();
13647
13648 return ret;
13649 }
13650
13651 #ifdef DEVELOPER
13652 override void SetDebugItem()
13653 {
13654 super.SetDebugItem();
13655 _itemBase = this;
13656 }
13657
13659 {
13660 string text = super.GetDebugText();
13661
13663 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13664
13665 return text;
13666 }
13667 #endif
13668
13670 {
13671 return true;
13672 }
13673
13675
13677
13679 {
13682 }
13683
13684
13692
13708}
13709
13711{
13713 if (entity)
13714 {
13715 bool is_item = entity.IsInherited(
ItemBase);
13716 if (is_item && full_quantity)
13717 {
13720 }
13721 }
13722 else
13723 {
13725 return NULL;
13726 }
13727 return entity;
13728}
13729
13731{
13732 if (item)
13733 {
13734 if (health > 0)
13735 item.SetHealth("", "", health);
13736
13737 if (item.CanHaveTemperature())
13738 {
13740 if (item.CanFreeze())
13741 item.SetFrozen(false);
13742 }
13743
13744 if (item.HasEnergyManager())
13745 {
13746 if (quantity >= 0)
13747 {
13748 item.GetCompEM().SetEnergy0To1(quantity);
13749 }
13750 else
13751 {
13753 }
13754 }
13755 else if (item.IsMagazine())
13756 {
13757 Magazine mag = Magazine.Cast(item);
13758 if (quantity >= 0)
13759 {
13760 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13761 }
13762 else
13763 {
13765 }
13766
13767 }
13768 else
13769 {
13770 if (quantity >= 0)
13771 {
13772 item.SetQuantityNormalized(quantity, false);
13773 }
13774 else
13775 {
13777 }
13778
13779 }
13780 }
13781}
13782
13783#ifdef DEVELOPER
13785#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.