8873{
8875 {
8876 return true;
8877 }
8878};
8879
8880
8881
8883{
8887
8889
8892
8893
8894
8895
8896
8905
8911
8916
8921
8942 protected bool m_IsResultOfSplit
8943
8945
8950
8951
8952
8954
8958
8959
8960
8962
8965
8966
8967
8973
8974
8982
8985
8986
8988
8989
8991
8992
8997
8998
9003
9004
9006
9007
9009 {
9014
9015 if (!
GetGame().IsDedicatedServer())
9016 {
9018 {
9020
9022 {
9024 }
9025 }
9026
9029 }
9030
9031 m_OldLocation = null;
9032
9034 {
9036 }
9037
9038 if (ConfigIsExisting("headSelectionsToHide"))
9039 {
9042 }
9043
9045 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9046 {
9048 }
9049
9051
9052 m_IsResultOfSplit = false;
9053
9055 }
9056
9058 {
9059 super.InitItemVariables();
9060
9066 m_Count = ConfigGetInt(
"count");
9067
9070
9075
9078
9083
9095
9099
9100
9103 if (ConfigIsExisting("canBeSplit"))
9104 {
9107 }
9108
9110 if (ConfigIsExisting("itemBehaviour"))
9112
9113
9116 RegisterNetSyncVariableInt("m_VarLiquidType");
9117 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9118
9119 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9120 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9121 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9122
9123 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9124 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9125 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9126 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9127
9128 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9129 RegisterNetSyncVariableBool("m_IsTakeable");
9130 RegisterNetSyncVariableBool("m_IsHologram");
9131
9134 {
9137 }
9138
9140
9142 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9144
9145 }
9146
9148 {
9150 }
9151
9153 {
9156 {
9161 }
9162 }
9163
9164 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9165 {
9167 {
9170 }
9171
9173 }
9174
9176 {
9182 }
9183
9185
9187 {
9189
9190 if (!action)
9191 {
9192 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9193 return;
9194 }
9195
9197 if (!ai)
9198 {
9200 return;
9201 }
9202
9204 if (!action_array)
9205 {
9206 action_array = new array<ActionBase_Basic>;
9208 }
9209 if (LogManager.IsActionLogEnable())
9210 {
9211 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9212 }
9213
9214 if (action_array.Find(action) != -1)
9215 {
9216 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9217 }
9218 else
9219 {
9220 action_array.Insert(action);
9221 }
9222 }
9223
9225 {
9227 ActionBase action = player.GetActionManager().GetAction(actionName);
9230
9231 if (action_array)
9232 {
9233 action_array.RemoveItem(action);
9234 }
9235 }
9236
9237
9238
9240 {
9241 ActionOverrideData overrideData = new ActionOverrideData();
9245
9247 if (!actionMap)
9248 {
9251 }
9252
9253 actionMap.Insert(this.
Type(), overrideData);
9254
9255 }
9256
9258
9260
9261
9263 {
9266
9269
9270 string config_to_search = "CfgVehicles";
9271 string muzzle_owner_config;
9272
9274 {
9275 if (IsInherited(Weapon))
9276 config_to_search = "CfgWeapons";
9277
9278 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9279
9280 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9281
9283
9284 if (config_OnFire_subclass_count > 0)
9285 {
9286 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9287
9288 for (int i = 0; i < config_OnFire_subclass_count; i++)
9289 {
9290 string particle_class = "";
9292 string config_OnFire_entry = config_OnFire_class + particle_class;
9293 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9294 WPOF_array.Insert(WPOF);
9295 }
9296
9297
9299 }
9300 }
9301
9303 {
9304 config_to_search = "CfgWeapons";
9305 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9306
9307 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9308
9310
9311 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9312 {
9313 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9314
9315 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9316 {
9317 string particle_class2 = "";
9319 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9320 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9321 WPOBE_array.Insert(WPOBE);
9322 }
9323
9324
9326 }
9327 }
9328 }
9329
9330
9332 {
9335
9337 {
9338 string config_to_search = "CfgVehicles";
9339
9340 if (IsInherited(Weapon))
9341 config_to_search = "CfgWeapons";
9342
9343 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9344 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9345
9346 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9347 {
9348
9350
9352 {
9354 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9356 return;
9357 }
9358
9361
9362
9363
9365 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9366
9367 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9368 {
9369 string particle_class = "";
9371 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9373
9374 if (entry_type == CT_CLASS)
9375 {
9376 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9377 WPOOH_array.Insert(WPOF);
9378 }
9379 }
9380
9381
9383 }
9384 }
9385 }
9386
9388 {
9390 }
9391
9393 {
9395 {
9397
9400
9403
9404 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9405 }
9406 }
9407
9409 {
9411 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9412
9414 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9415
9417 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9418
9420 {
9422 }
9423 }
9424
9426 {
9428 }
9429
9431 {
9434 else
9436
9438 {
9441 }
9442 else
9443 {
9446
9449 }
9450
9452 }
9453
9455 {
9457 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9458 }
9459
9461 {
9463 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9465 }
9466
9468 {
9470 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9471 }
9472
9474 {
9477
9478 OverheatingParticle OP = new OverheatingParticle();
9483
9485 }
9486
9488 {
9491
9492 return -1;
9493 }
9494
9496 {
9498 {
9501
9502 for (int i = count; i > 0; --i)
9503 {
9504 int id = i - 1;
9507
9510
9511 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9512 {
9513 if (p)
9514 {
9517 }
9518 }
9519 }
9520 }
9521 }
9522
9524 {
9526 {
9528 {
9529 int id = i - 1;
9531
9532 if (OP)
9533 {
9535
9536 if (p)
9537 {
9539 }
9540
9541 delete OP;
9542 }
9543 }
9544
9547 }
9548 }
9549
9552 {
9553 return 0.0;
9554 }
9555
9556
9558 {
9559 return 250;
9560 }
9561
9563 {
9564 return 0;
9565 }
9566
9569 {
9571 return true;
9572
9573 return false;
9574 }
9575
9578 {
9581
9583 {
9585 }
9586 else
9587 {
9588
9590 }
9591
9593 }
9594
9601 {
9602 return -1;
9603 }
9604
9605
9606
9607
9609 {
9611 {
9613 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9614
9615 if (r_index >= 0)
9616 {
9617 InventoryLocation r_il = new InventoryLocation;
9618 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9619
9620 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9623 {
9624 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9625 }
9627 {
9628 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9629 }
9630
9631 }
9632
9633 player.GetHumanInventory().ClearUserReservedLocation(this);
9634 }
9635
9638 }
9639
9640
9641
9642
9644 {
9645 return ItemBase.m_DebugActionsMask;
9646 }
9647
9649 {
9650 return ItemBase.m_DebugActionsMask & mask;
9651 }
9652
9654 {
9655 ItemBase.m_DebugActionsMask = mask;
9656 }
9657
9659 {
9660 ItemBase.m_DebugActionsMask |= mask;
9661 }
9662
9664 {
9665 ItemBase.m_DebugActionsMask &= ~mask;
9666 }
9667
9669 {
9671 {
9673 }
9674 else
9675 {
9677 }
9678 }
9679
9680
9682 {
9683 if (GetEconomyProfile())
9684 {
9685 float q_max = GetEconomyProfile().GetQuantityMax();
9686 if (q_max > 0)
9687 {
9688 float q_min = GetEconomyProfile().GetQuantityMin();
9689 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9690
9692 {
9693 ComponentEnergyManager comp = GetCompEM();
9695 {
9697 }
9698 }
9700 {
9702
9703 }
9704
9705 }
9706 }
9707 }
9708
9711 {
9712 EntityAI parent = GetHierarchyParent();
9713
9714 if (parent)
9715 {
9716 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9717 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9718 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9719 }
9720 }
9721
9724 {
9725 EntityAI parent = GetHierarchyParent();
9726
9727 if (parent)
9728 {
9729 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9730 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9731 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9732 }
9733 }
9734
9736 {
9737
9738
9739
9740
9742
9744 {
9745 if (ScriptInputUserData.CanStoreInputUserData())
9746 {
9747 ScriptInputUserData ctx = new ScriptInputUserData;
9753 ctx.
Write(use_stack_max);
9756
9758 {
9759 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9760 }
9761 }
9762 }
9763 else if (!
GetGame().IsMultiplayer())
9764 {
9766 }
9767 }
9768
9770 {
9772 }
9773
9775 {
9777 }
9778
9780 {
9782 }
9783
9785 {
9786
9787 return false;
9788 }
9789
9791 {
9792 return false;
9793 }
9794
9798 {
9799 return false;
9800 }
9801
9803 {
9804 return "";
9805 }
9806
9808
9810 {
9811 return false;
9812 }
9813
9815 {
9816 return true;
9817 }
9818
9819
9820
9822 {
9823 return true;
9824 }
9825
9827 {
9828 return true;
9829 }
9830
9832 {
9833 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9835 }
9836
9838 {
9840 }
9841
9843 {
9845 if (!is_being_placed)
9847 SetSynchDirty();
9848 }
9849
9850
9852
9854 {
9856 }
9857
9859 {
9861 }
9862
9864 {
9865 return 1;
9866 }
9867
9869 {
9870 return false;
9871 }
9872
9874 {
9876 SetSynchDirty();
9877 }
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9914 {
9915 super.OnMovedInsideCargo(container);
9916
9917 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9918 }
9919
9920 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9921 {
9922 super.EEItemLocationChanged(oldLoc,newLoc);
9923
9924 PlayerBase new_player = null;
9925 PlayerBase old_player = null;
9926
9927 if (newLoc.GetParent())
9928 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9929
9930 if (oldLoc.GetParent())
9931 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9932
9934 {
9935 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9936
9937 if (r_index >= 0)
9938 {
9939 InventoryLocation r_il = new InventoryLocation;
9940 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9941
9942 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9945 {
9946 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9947 }
9949 {
9950 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9951 }
9952
9953 }
9954 }
9955
9957 {
9958 if (new_player)
9959 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9960
9961 if (new_player == old_player)
9962 {
9963
9964 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9965 {
9967 {
9968 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9969 {
9970 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9971 }
9972 }
9973 else
9974 {
9975 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9976 }
9977 }
9978
9979 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9980 {
9981 int type = oldLoc.GetType();
9983 {
9984 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9985 }
9987 {
9988 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9989 }
9990 }
9991 if (!m_OldLocation)
9992 {
9993 m_OldLocation = new InventoryLocation;
9994 }
9995 m_OldLocation.Copy(oldLoc);
9996 }
9997 else
9998 {
9999 if (m_OldLocation)
10000 {
10001 m_OldLocation.Reset();
10002 }
10003 }
10004
10006 }
10007 else
10008 {
10009 if (new_player)
10010 {
10011 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10012 if (res_index >= 0)
10013 {
10014 InventoryLocation il = new InventoryLocation;
10015 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10017 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10020 {
10021 il.
GetParent().GetOnReleaseLock().Invoke(it);
10022 }
10024 {
10026 }
10027
10028 }
10029 }
10031 {
10032
10034 }
10035
10036 if (m_OldLocation)
10037 {
10038 m_OldLocation.Reset();
10039 }
10040 }
10041 }
10042
10043 override void EOnContact(IEntity other, Contact extra)
10044 {
10046 {
10047 int liquidType = -1;
10049 if (impactSpeed > 0.0)
10050 {
10052 #ifndef SERVER
10054 #else
10056 SetSynchDirty();
10057 #endif
10059 }
10060 }
10061
10062 #ifdef SERVER
10063 if (GetCompEM() && GetCompEM().IsPlugged())
10064 {
10065 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10066 GetCompEM().UnplugThis();
10067 }
10068 #endif
10069 }
10070
10072
10074 {
10076 }
10077
10079 {
10080
10081 }
10082
10084 {
10085 super.OnItemLocationChanged(old_owner, new_owner);
10086
10087 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10088 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10089
10090 if (!relatedPlayer && playerNew)
10091 relatedPlayer = playerNew;
10092
10093 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10094 {
10096 if (actionMgr)
10097 {
10098 ActionBase currentAction = actionMgr.GetRunningAction();
10099 if (currentAction)
10101 }
10102 }
10103
10104 Man ownerPlayerOld = null;
10105 Man ownerPlayerNew = null;
10106
10107 if (old_owner)
10108 {
10109 if (old_owner.
IsMan())
10110 {
10111 ownerPlayerOld = Man.Cast(old_owner);
10112 }
10113 else
10114 {
10115 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10116 }
10117 }
10118 else
10119 {
10121 {
10123
10124 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10125 {
10126 GetCompEM().UnplugThis();
10127 }
10128 }
10129 }
10130
10131 if (new_owner)
10132 {
10133 if (new_owner.
IsMan())
10134 {
10135 ownerPlayerNew = Man.Cast(new_owner);
10136 }
10137 else
10138 {
10139 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10140 }
10141 }
10142
10143 if (ownerPlayerOld != ownerPlayerNew)
10144 {
10145 if (ownerPlayerOld)
10146 {
10147 array<EntityAI> subItemsExit = new array<EntityAI>;
10149 for (int i = 0; i < subItemsExit.Count(); i++)
10150 {
10153 }
10154 }
10155
10156 if (ownerPlayerNew)
10157 {
10158 array<EntityAI> subItemsEnter = new array<EntityAI>;
10160 for (int j = 0; j < subItemsEnter.Count(); j++)
10161 {
10164 }
10165 }
10166 }
10167 else if (ownerPlayerNew != null)
10168 {
10169 PlayerBase nplayer;
10170 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10171 {
10172 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10174 for (int k = 0; k < subItemsUpdate.Count(); k++)
10175 {
10177 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10178 }
10179 }
10180 }
10181
10182 if (old_owner)
10183 old_owner.OnChildItemRemoved(this);
10184 if (new_owner)
10185 new_owner.OnChildItemReceived(this);
10186 }
10187
10188
10190 {
10191 super.EEDelete(parent);
10192 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10193 if (player)
10194 {
10196
10197 if (player.IsAlive())
10198 {
10199 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10200 if (r_index >= 0)
10201 {
10202 InventoryLocation r_il = new InventoryLocation;
10203 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10204
10205 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10208 {
10209 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10210 }
10212 {
10213 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10214 }
10215
10216 }
10217
10218 player.RemoveQuickBarEntityShortcut(this);
10219 }
10220 }
10221 }
10222
10224 {
10225 super.EEKilled(killer);
10226
10229 {
10230 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10231 {
10232 if (IsMagazine())
10233 {
10234 if (Magazine.Cast(this).GetAmmoCount() > 0)
10235 {
10237 }
10238 }
10239 else
10240 {
10242 }
10243 }
10244 }
10245 }
10246
10248 {
10249 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10250
10251 super.OnWasAttached(parent, slot_id);
10252
10255
10257 }
10258
10260 {
10261 super.OnWasDetached(parent, slot_id);
10262
10265 }
10266
10268 {
10269 int idx;
10272
10273 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10274 if (inventory_slots.Count() < 1)
10275 {
10276 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10277 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10278 }
10279 else
10280 {
10281 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10282 }
10283
10284 idx = inventory_slots.Find(slot);
10285 if (idx < 0)
10286 return "";
10287
10288 return attach_types.Get(idx);
10289 }
10290
10292 {
10293 int idx = -1;
10294 string slot;
10295
10298
10299 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10300 if (inventory_slots.Count() < 1)
10301 {
10302 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10303 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10304 }
10305 else
10306 {
10307 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10308 if (detach_types.Count() < 1)
10309 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10310 }
10311
10312 for (int i = 0; i < inventory_slots.Count(); i++)
10313 {
10314 slot = inventory_slots.Get(i);
10315 }
10316
10317 if (slot != "")
10318 {
10319 if (detach_types.Count() == 1)
10320 idx = 0;
10321 else
10322 idx = inventory_slots.Find(slot);
10323 }
10324 if (idx < 0)
10325 return "";
10326
10327 return detach_types.Get(idx);
10328 }
10329
10331 {
10332
10334
10335
10336 float min_time = 1;
10337 float max_time = 3;
10338 float delay = Math.RandomFloat(min_time, max_time);
10339
10340 explode_timer.Run(delay, this, "DoAmmoExplosion");
10341 }
10342
10344 {
10345 Magazine magazine = Magazine.Cast(this);
10346 int pop_sounds_count = 6;
10347 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10348
10349
10350 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10351 string sound_name = pop_sounds[ sound_idx ];
10353
10354
10355 magazine.ServerAddAmmoCount(-1);
10356
10357
10358 float min_temp_to_explode = 100;
10359
10360 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10361 {
10363 }
10364 }
10365
10366
10367 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10368 {
10369 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10370
10371 const int CHANCE_DAMAGE_CARGO = 4;
10372 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10373 const int CHANCE_DAMAGE_NOTHING = 2;
10374
10376 {
10377 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10378 int chances;
10379 int rnd;
10380
10381 if (GetInventory().GetCargo())
10382 {
10383 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10384 rnd = Math.RandomInt(0,chances);
10385
10386 if (rnd < CHANCE_DAMAGE_CARGO)
10387 {
10389 }
10390 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10391 {
10393 }
10394 }
10395 else
10396 {
10397 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10398 rnd = Math.RandomInt(0,chances);
10399
10400 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10401 {
10403 }
10404 }
10405 }
10406 }
10407
10409 {
10410 if (GetInventory().GetCargo())
10411 {
10412 int item_count = GetInventory().GetCargo().GetItemCount();
10413 if (item_count > 0)
10414 {
10415 int random_pick = Math.RandomInt(0, item_count);
10417 if (!item.IsExplosive())
10418 {
10419 item.AddHealth("","",damage);
10420 return true;
10421 }
10422 }
10423 }
10424 return false;
10425 }
10426
10428 {
10429 int attachment_count = GetInventory().AttachmentCount();
10430 if (attachment_count > 0)
10431 {
10432 int random_pick = Math.RandomInt(0, attachment_count);
10433 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10434 if (!attachment.IsExplosive())
10435 {
10436 attachment.AddHealth("","",damage);
10437 return true;
10438 }
10439 }
10440 return false;
10441 }
10442
10444 {
10446 }
10447
10449 {
10451 return GetInventory().CanRemoveEntity();
10452
10453 return false;
10454 }
10455
10457 {
10459 return;
10460
10462 {
10463 if (ScriptInputUserData.CanStoreInputUserData())
10464 {
10465 ScriptInputUserData ctx = new ScriptInputUserData;
10470 ctx.
Write(destination_entity);
10472 ctx.
Write(slot_id);
10474 }
10475 }
10476 else if (!
GetGame().IsMultiplayer())
10477 {
10479 }
10480 }
10481
10483 {
10485 return;
10486
10487 float split_quantity_new;
10491 InventoryLocation loc = new InventoryLocation;
10492
10493 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10494 {
10496 split_quantity_new = stack_max;
10497 else
10499
10500 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10501 if (new_item)
10502 {
10503 new_item.SetResultOfSplit(true);
10504 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10506 new_item.SetQuantity(split_quantity_new);
10507 }
10508 }
10509 else if (destination_entity && slot_id == -1)
10510 {
10511 if (quantity > stack_max)
10512 split_quantity_new = stack_max;
10513 else
10514 split_quantity_new = quantity;
10515
10517 {
10520 }
10521
10522 if (new_item)
10523 {
10524 new_item.SetResultOfSplit(true);
10525 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10527 new_item.SetQuantity(split_quantity_new);
10528 }
10529 }
10530 else
10531 {
10532 if (stack_max != 0)
10533 {
10535 {
10537 }
10538
10539 if (split_quantity_new == 0)
10540 {
10541 if (!
GetGame().IsMultiplayer())
10542 player.PhysicalPredictiveDropItem(this);
10543 else
10544 player.ServerDropEntity(this);
10545 return;
10546 }
10547
10549
10550 if (new_item)
10551 {
10552 new_item.SetResultOfSplit(true);
10553 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10555 new_item.SetQuantity(stack_max);
10556 new_item.PlaceOnSurface();
10557 }
10558 }
10559 }
10560 }
10561
10563 {
10565 return;
10566
10567 float split_quantity_new;
10571 InventoryLocation loc = new InventoryLocation;
10572
10573 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10574 {
10576 split_quantity_new = stack_max;
10577 else
10579
10580 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10581 if (new_item)
10582 {
10583 new_item.SetResultOfSplit(true);
10584 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10586 new_item.SetQuantity(split_quantity_new);
10587 }
10588 }
10589 else if (destination_entity && slot_id == -1)
10590 {
10591 if (quantity > stack_max)
10592 split_quantity_new = stack_max;
10593 else
10594 split_quantity_new = quantity;
10595
10597 {
10600 }
10601
10602 if (new_item)
10603 {
10604 new_item.SetResultOfSplit(true);
10605 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10607 new_item.SetQuantity(split_quantity_new);
10608 }
10609 }
10610 else
10611 {
10612 if (stack_max != 0)
10613 {
10615 {
10617 }
10618
10620
10621 if (new_item)
10622 {
10623 new_item.SetResultOfSplit(true);
10624 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10626 new_item.SetQuantity(stack_max);
10627 new_item.PlaceOnSurface();
10628 }
10629 }
10630 }
10631 }
10632
10634 {
10636 return;
10637
10639 {
10640 if (ScriptInputUserData.CanStoreInputUserData())
10641 {
10642 ScriptInputUserData ctx = new ScriptInputUserData;
10647 dst.WriteToContext(ctx);
10649 }
10650 }
10651 else if (!
GetGame().IsMultiplayer())
10652 {
10654 }
10655 }
10656
10658 {
10660 return;
10661
10663 {
10664 if (ScriptInputUserData.CanStoreInputUserData())
10665 {
10666 ScriptInputUserData ctx = new ScriptInputUserData;
10671 ctx.
Write(destination_entity);
10677 }
10678 }
10679 else if (!
GetGame().IsMultiplayer())
10680 {
10682 }
10683 }
10684
10686 {
10688 }
10689
10691 {
10693 return this;
10694
10696 float split_quantity_new;
10698 if (dst.IsValid())
10699 {
10700 int slot_id = dst.GetSlot();
10702
10703 if (quantity > stack_max)
10704 split_quantity_new = stack_max;
10705 else
10706 split_quantity_new = quantity;
10707
10709
10710 if (new_item)
10711 {
10712 new_item.SetResultOfSplit(true);
10713 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10716 }
10717
10718 return new_item;
10719 }
10720
10721 return null;
10722 }
10723
10725 {
10727 return;
10728
10730 float split_quantity_new;
10732 if (destination_entity)
10733 {
10735 if (quantity > stackable)
10736 split_quantity_new = stackable;
10737 else
10738 split_quantity_new = quantity;
10739
10740 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10741 if (new_item)
10742 {
10743 new_item.SetResultOfSplit(true);
10744 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10746 new_item.SetQuantity(split_quantity_new);
10747 }
10748 }
10749 }
10750
10752 {
10754 return;
10755
10757 {
10758 if (ScriptInputUserData.CanStoreInputUserData())
10759 {
10760 ScriptInputUserData ctx = new ScriptInputUserData;
10765 ItemBase destination_entity =
this;
10766 ctx.
Write(destination_entity);
10770 }
10771 }
10772 else if (!
GetGame().IsMultiplayer())
10773 {
10775 }
10776 }
10777
10779 {
10781 return;
10782
10784 float split_quantity_new;
10786 if (player)
10787 {
10789 if (quantity > stackable)
10790 split_quantity_new = stackable;
10791 else
10792 split_quantity_new = quantity;
10793
10794 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10795 new_item =
ItemBase.Cast(in_hands);
10796 if (new_item)
10797 {
10798 new_item.SetResultOfSplit(true);
10799 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10801 new_item.SetQuantity(split_quantity_new);
10802 }
10803 }
10804 }
10805
10807 {
10809 return;
10810
10812 float split_quantity_new = Math.Floor(quantity * 0.5);
10813
10815
10816 if (new_item)
10817 {
10818 if (new_item.GetQuantityMax() < split_quantity_new)
10819 {
10820 split_quantity_new = new_item.GetQuantityMax();
10821 }
10822
10823 new_item.SetResultOfSplit(true);
10824 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10825
10827 {
10830 }
10831 else
10832 {
10835 }
10836 }
10837 }
10838
10840 {
10842 return;
10843
10845 float split_quantity_new = Math.Floor(quantity / 2);
10846
10847 InventoryLocation invloc = new InventoryLocation;
10849
10851 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10852
10853 if (new_item)
10854 {
10855 if (new_item.GetQuantityMax() < split_quantity_new)
10856 {
10857 split_quantity_new = new_item.GetQuantityMax();
10858 }
10860 {
10863 }
10864 else
10865 {
10868 }
10869 }
10870 }
10871
10874 {
10875 SetWeightDirty();
10877
10878 if (parent)
10879 parent.OnAttachmentQuantityChangedEx(this, delta);
10880
10882 {
10884 {
10886 }
10888 {
10889 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10891 }
10892 }
10893
10894 }
10895
10898 {
10899
10900 }
10901
10904 {
10906 }
10907
10909 {
10910 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10911
10913 {
10914 if (newLevel == GameConstants.STATE_RUINED)
10915 {
10917 EntityAI parent = GetHierarchyParent();
10918 if (parent && parent.IsFireplace())
10919 {
10920 CargoBase cargo = GetInventory().GetCargo();
10921 if (cargo)
10922 {
10924 {
10926 }
10927 }
10928 }
10929 }
10930
10932 {
10933
10935 return;
10936 }
10937
10938 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10939 {
10941 }
10942 }
10943 }
10944
10945
10947 {
10948 super.OnRightClick();
10949
10951 {
10953 {
10954 if (ScriptInputUserData.CanStoreInputUserData())
10955 {
10956 vector m4[4];
10958
10959 EntityAI root = GetHierarchyRoot();
10960
10961 InventoryLocation dst = new InventoryLocation;
10963 {
10964 if (root)
10965 {
10966 root.GetTransform(m4);
10968 }
10969 else
10970 GetInventory().GetCurrentInventoryLocation(dst);
10971 }
10972 else
10973 {
10975
10976
10977 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10978 {
10979 if (root)
10980 {
10981 root.GetTransform(m4);
10983 }
10984 else
10985 GetInventory().GetCurrentInventoryLocation(dst);
10986 }
10987 else
10988 {
10989 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10990 }
10991 }
10992
10993 ScriptInputUserData ctx = new ScriptInputUserData;
11001 }
11002 }
11003 else if (!
GetGame().IsMultiplayer())
11004 {
11006 }
11007 }
11008 }
11009
11010 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11011 {
11012
11013 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11014 return false;
11015
11016 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11017 return false;
11018
11019
11021 return false;
11022
11023
11024 Magazine mag = Magazine.Cast(this);
11025 if (mag)
11026 {
11027 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11028 return false;
11029
11030 if (stack_max_limit)
11031 {
11032 Magazine other_mag = Magazine.Cast(other_item);
11033 if (other_item)
11034 {
11035 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11036 return false;
11037 }
11038
11039 }
11040 }
11041 else
11042 {
11043
11045 return false;
11046
11048 return false;
11049 }
11050
11051 PlayerBase player = null;
11052 if (CastTo(player, GetHierarchyRootPlayer()))
11053 {
11054 if (player.GetInventory().HasAttachment(this))
11055 return false;
11056
11057 if (player.IsItemsToDelete())
11058 return false;
11059 }
11060
11061 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11062 return false;
11063
11064 int slotID;
11066 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11067 return false;
11068
11069 return true;
11070 }
11071
11073 {
11075 }
11076
11078 {
11079 return m_IsResultOfSplit;
11080 }
11081
11083 {
11084 m_IsResultOfSplit = value;
11085 }
11086
11088 {
11090 }
11091
11093 {
11094 float other_item_quantity = other_item.GetQuantity();
11095 float this_free_space;
11096
11098
11100
11101 if (other_item_quantity > this_free_space)
11102 {
11103 return this_free_space;
11104 }
11105 else
11106 {
11107 return other_item_quantity;
11108 }
11109 }
11110
11112 {
11114 }
11115
11117 {
11119 return;
11120
11121 if (!IsMagazine() && other_item)
11122 {
11124 if (quantity_used != 0)
11125 {
11126 float hp1 = GetHealth01("","");
11127 float hp2 = other_item.GetHealth01("","");
11128 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11129 hpResult = hpResult / (
GetQuantity() + quantity_used);
11130
11131 hpResult *= GetMaxHealth();
11132 Math.Round(hpResult);
11133 SetHealth("", "Health", hpResult);
11134
11136 other_item.AddQuantity(-quantity_used);
11137 }
11138 }
11140 }
11141
11143 {
11144 #ifdef SERVER
11145 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11146 GetHierarchyParent().IncreaseLifetimeUp();
11147 #endif
11148 };
11149
11151 {
11152 PlayerBase p = PlayerBase.Cast(player);
11153
11154 array<int> recipesIds = p.m_Recipes;
11155 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11156 if (moduleRecipesManager)
11157 {
11158 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11159 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11160 }
11161
11162 for (int i = 0;i < recipesIds.Count(); i++)
11163 {
11164 int key = recipesIds.Get(i);
11165 string recipeName = moduleRecipesManager.GetRecipeName(key);
11167 }
11168 }
11169
11170
11171 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11172 {
11173 super.GetDebugActions(outputList);
11174
11175
11180
11181
11185
11189
11190
11193
11194
11196 {
11199 }
11200
11202
11205
11209 }
11210
11211
11212
11213
11215 {
11216 super.OnAction(action_id, player, ctx);
11217 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11218 {
11219 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11220 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11221 PlayerBase p = PlayerBase.Cast(player);
11222 if (
EActions.RECIPES_RANGE_START < 1000)
11223 {
11224 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11225 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11226 }
11227 }
11228 #ifndef SERVER
11229 else if (action_id ==
EActions.WATCH_PLAYER)
11230 {
11231 PluginDeveloper.SetDeveloperItemClientEx(player);
11232 }
11233 #endif
11235 {
11236 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11237 {
11238 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11239 OnDebugButtonPressServer(id + 1);
11240 }
11241
11242 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11243 {
11244 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11246 }
11247
11248 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11249 {
11250 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11252 }
11253
11254 else if (action_id ==
EActions.ADD_QUANTITY)
11255 {
11256 if (IsMagazine())
11257 {
11258 Magazine mag = Magazine.Cast(this);
11259 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11260 }
11261 else
11262 {
11264 }
11265
11266 if (m_EM)
11267 {
11268 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11269 }
11270
11271 }
11272
11273 else if (action_id ==
EActions.REMOVE_QUANTITY)
11274 {
11275 if (IsMagazine())
11276 {
11277 Magazine mag2 = Magazine.Cast(this);
11278 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11279 }
11280 else
11281 {
11283 }
11284 if (m_EM)
11285 {
11286 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11287 }
11288
11289 }
11290
11291 else if (action_id ==
EActions.SET_QUANTITY_0)
11292 {
11294
11295 if (m_EM)
11296 {
11297 m_EM.SetEnergy(0);
11298 }
11299 }
11300
11301 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11302 {
11304
11305 if (m_EM)
11306 {
11307 m_EM.SetEnergy(m_EM.GetEnergyMax());
11308 }
11309 }
11310
11311 else if (action_id ==
EActions.ADD_HEALTH)
11312 {
11313 AddHealth("","",GetMaxHealth("","Health")/5);
11314 }
11315 else if (action_id ==
EActions.REMOVE_HEALTH)
11316 {
11317 AddHealth("","",-GetMaxHealth("","Health")/5);
11318 }
11319 else if (action_id ==
EActions.DESTROY_HEALTH)
11320 {
11321 SetHealth01("","",0);
11322 }
11323 else if (action_id ==
EActions.WATCH_ITEM)
11324 {
11326 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11327 #ifdef DEVELOPER
11328 SetDebugDeveloper_item(this);
11329 #endif
11330 }
11331
11332 else if (action_id ==
EActions.ADD_TEMPERATURE)
11333 {
11334 AddTemperature(20);
11335
11336 }
11337
11338 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11339 {
11340 AddTemperature(-20);
11341
11342 }
11343
11344 else if (action_id ==
EActions.FLIP_FROZEN)
11345 {
11346 SetFrozen(!GetIsFrozen());
11347
11348 }
11349
11350 else if (action_id ==
EActions.ADD_WETNESS)
11351 {
11353
11354 }
11355
11356 else if (action_id ==
EActions.REMOVE_WETNESS)
11357 {
11359
11360 }
11361
11362 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11363 {
11366
11367
11368 }
11369
11370 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11371 {
11374 }
11375
11376 else if (action_id ==
EActions.MAKE_SPECIAL)
11377 {
11378 auto debugParams = DebugSpawnParams.WithPlayer(player);
11379 OnDebugSpawnEx(debugParams);
11380 }
11381
11382 else if (action_id ==
EActions.DELETE)
11383 {
11384 Delete();
11385 }
11386
11387 }
11388
11389
11390 return false;
11391 }
11392
11393
11394
11395
11399
11402
11403
11404
11406 {
11407 return false;
11408 }
11409
11410
11412 {
11413 return true;
11414 }
11415
11416
11418 {
11419 return true;
11420 }
11421
11422
11423
11425 {
11426 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11428 }
11429
11432 {
11433 return null;
11434 }
11435
11437 {
11438 return false;
11439 }
11440
11442 {
11443 return false;
11444 }
11445
11449
11450
11452 {
11453 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11454 return module_repairing.CanRepair(this, item_repair_kit);
11455 }
11456
11457
11458 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11459 {
11460 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11461 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11462 }
11463
11464
11466 {
11467
11468
11469
11470
11471
11472
11473
11474
11475 return 1;
11476 }
11477
11478
11479
11481 {
11483 }
11484
11485
11486
11488 {
11490 }
11491
11492
11501 {
11502 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11503
11504 if (player)
11505 {
11506 player.MessageStatus(text);
11507 }
11508 }
11509
11510
11519 {
11520 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11521
11522 if (player)
11523 {
11524 player.MessageAction(text);
11525 }
11526 }
11527
11528
11537 {
11538 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11539
11540 if (player)
11541 {
11542 player.MessageFriendly(text);
11543 }
11544 }
11545
11546
11555 {
11556 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11557
11558 if (player)
11559 {
11560 player.MessageImportant(text);
11561 }
11562 }
11563
11565 {
11566 return true;
11567 }
11568
11569
11570 override bool KindOf(
string tag)
11571 {
11572 bool found = false;
11573 string item_name = this.
GetType();
11576
11577 int array_size = item_tag_array.Count();
11578 for (int i = 0; i < array_size; i++)
11579 {
11580 if (item_tag_array.Get(i) == tag)
11581 {
11582 found = true;
11583 break;
11584 }
11585 }
11586 return found;
11587 }
11588
11589
11591 {
11592
11593 super.OnRPC(sender, rpc_type,ctx);
11594
11595
11596 switch (rpc_type)
11597 {
11598 #ifndef SERVER
11599 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11600 Param2<bool, string> p = new Param2<bool, string>(false, "");
11601
11603 return;
11604
11605 bool play = p.param1;
11606 string soundSet = p.param2;
11607
11608 if (play)
11609 {
11611 {
11613 {
11615 }
11616 }
11617 else
11618 {
11620 }
11621 }
11622 else
11623 {
11625 }
11626
11627 break;
11628 #endif
11629
11630 }
11631
11633 {
11635 }
11636 }
11637
11638
11639
11640
11642 {
11643 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11644 return plugin.GetID(
name);
11645 }
11646
11648 {
11649 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11650 return plugin.GetName(id);
11651 }
11652
11655 {
11656
11657
11658 int varFlags;
11659 if (!ctx.
Read(varFlags))
11660 return;
11661
11662 if (varFlags & ItemVariableFlags.FLOAT)
11663 {
11665 }
11666 }
11667
11669 {
11670
11671 super.SerializeNumericalVars(floats_out);
11672
11673
11674
11676 {
11678 }
11679
11681 {
11683 }
11684
11686 {
11688 }
11689
11691 {
11696 }
11697
11699 {
11701 }
11702 }
11703
11705 {
11706
11707 super.DeSerializeNumericalVars(floats);
11708
11709
11710 int index = 0;
11711 int mask = Math.Round(floats.Get(index));
11712
11713 index++;
11714
11716 {
11718 {
11720 }
11721 else
11722 {
11723 float quantity = floats.Get(index);
11724 SetQuantity(quantity,
true,
false,
false,
false);
11725 }
11726 index++;
11727 }
11728
11730 {
11731 float wet = floats.Get(index);
11733 index++;
11734 }
11735
11737 {
11738 int liquidtype = Math.Round(floats.Get(index));
11740 index++;
11741 }
11742
11744 {
11746 index++;
11748 index++;
11750 index++;
11752 index++;
11753 }
11754
11756 {
11757 int cleanness = Math.Round(floats.Get(index));
11759 index++;
11760 }
11761 }
11762
11764 {
11765 super.WriteVarsToCTX(ctx);
11766
11767
11769 {
11771 }
11772
11774 {
11776 }
11777
11779 {
11781 }
11782
11784 {
11785 int r,g,b,a;
11791 }
11792
11794 {
11796 }
11797 }
11798
11800 {
11801 if (!super.ReadVarsFromCTX(ctx,version))
11802 return false;
11803
11804 int intValue;
11805 float value;
11806
11807 if (version < 140)
11808 {
11809 if (!ctx.
Read(intValue))
11810 return false;
11811
11812 m_VariablesMask = intValue;
11813 }
11814
11816 {
11817 if (!ctx.
Read(value))
11818 return false;
11819
11821 {
11823 }
11824 else
11825 {
11827 }
11828 }
11829
11830 if (version < 140)
11831 {
11833 {
11834 if (!ctx.
Read(value))
11835 return false;
11836 SetTemperatureDirect(value);
11837 }
11838 }
11839
11841 {
11842 if (!ctx.
Read(value))
11843 return false;
11845 }
11846
11848 {
11849 if (!ctx.
Read(intValue))
11850 return false;
11852 }
11853
11855 {
11856 int r,g,b,a;
11858 return false;
11860 return false;
11862 return false;
11864 return false;
11865
11867 }
11868
11870 {
11871 if (!ctx.
Read(intValue))
11872 return false;
11874 }
11875
11876 if (version >= 138 && version < 140)
11877 {
11879 {
11880 if (!ctx.
Read(intValue))
11881 return false;
11882 SetFrozen(intValue);
11883 }
11884 }
11885
11886 return true;
11887 }
11888
11889
11891 {
11894 {
11896 }
11897
11898 if (!super.OnStoreLoad(ctx, version))
11899 {
11901 return false;
11902 }
11903
11904 if (version >= 114)
11905 {
11906 bool hasQuickBarIndexSaved;
11907
11908 if (!ctx.
Read(hasQuickBarIndexSaved))
11909 {
11911 return false;
11912 }
11913
11914 if (hasQuickBarIndexSaved)
11915 {
11916 int itmQBIndex;
11917
11918
11919 if (!ctx.
Read(itmQBIndex))
11920 {
11922 return false;
11923 }
11924
11925 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11926 if (itmQBIndex != -1 && parentPlayer)
11927 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11928 }
11929 }
11930 else
11931 {
11932
11933 PlayerBase player;
11934 int itemQBIndex;
11935 if (version ==
int.
MAX)
11936 {
11937 if (!ctx.
Read(itemQBIndex))
11938 {
11940 return false;
11941 }
11942 }
11943 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11944 {
11945
11946 if (!ctx.
Read(itemQBIndex))
11947 {
11949 return false;
11950 }
11951 if (itemQBIndex != -1 && player)
11952 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11953 }
11954 }
11955
11956 if (version < 140)
11957 {
11958
11959 if (!LoadVariables(ctx, version))
11960 {
11962 return false;
11963 }
11964 }
11965
11966
11968 {
11970 return false;
11971 }
11972 if (version >= 132)
11973 {
11975 if (raib)
11976 {
11978 {
11980 return false;
11981 }
11982 }
11983 }
11984
11986 return true;
11987 }
11988
11989
11990
11992 {
11993 super.OnStoreSave(ctx);
11994
11995 PlayerBase player;
11996 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11997 {
11999
12000 int itemQBIndex = -1;
12001 itemQBIndex = player.FindQuickBarEntityIndex(this);
12002 ctx.
Write(itemQBIndex);
12003 }
12004 else
12005 {
12007 }
12008
12010
12012 if (raib)
12013 {
12015 }
12016 }
12017
12018
12020 {
12021 super.AfterStoreLoad();
12022
12024 {
12026 }
12027
12029 {
12032 }
12033 }
12034
12036 {
12037 super.EEOnAfterLoad();
12038
12040 {
12042 }
12043
12046 }
12047
12049 {
12050 return false;
12051 }
12052
12053
12054
12056 {
12058 {
12059 #ifdef PLATFORM_CONSOLE
12060
12062 {
12064 if (menu)
12065 {
12067 }
12068 }
12069 #endif
12070 }
12071
12073 {
12076 }
12077
12079 {
12080 SetWeightDirty();
12082 }
12084 {
12087 }
12088
12090 {
12093 }
12095 {
12098 }
12099
12100 super.OnVariablesSynchronized();
12101 }
12102
12103
12104
12106 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12107 {
12108 if (!IsServerCheck(allow_client))
12109 return false;
12110
12112 return false;
12113
12116
12117 if (value <= (min + 0.001))
12118 value = min;
12119
12120 if (value == min)
12121 {
12122 if (destroy_config)
12123 {
12124 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12125 if (dstr)
12126 {
12128 this.Delete();
12129 return true;
12130 }
12131 }
12132 else if (destroy_forced)
12133 {
12135 this.Delete();
12136 return true;
12137 }
12138
12140 }
12141
12144
12146 {
12148
12149 if (delta)
12151 }
12152
12154
12155 return false;
12156 }
12157
12158
12160 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12161 {
12163 }
12164
12166 {
12169 }
12170
12172 {
12175 }
12176
12179 {
12180 float value_clamped = Math.Clamp(value, 0, 1);
12182 SetQuantity(result, destroy_config, destroy_forced);
12183 }
12184
12185
12188 {
12190 }
12191
12193 {
12195 }
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12207 {
12208 int slot = -1;
12209 if (GetInventory())
12210 {
12211 InventoryLocation il = new InventoryLocation;
12212 GetInventory().GetCurrentInventoryLocation(il);
12214 }
12215
12217 }
12218
12220 {
12221 float quantity_max = 0;
12222
12224 {
12225 if (attSlotID != -1)
12226 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12227
12228 if (quantity_max <= 0)
12230 }
12231
12232 if (quantity_max <= 0)
12234
12235 return quantity_max;
12236 }
12237
12239 {
12241 }
12242
12244 {
12246 }
12247
12248
12250 {
12252 }
12253
12255 {
12257 }
12258
12260 {
12262 }
12263
12264
12266 {
12267
12268 float weightEx = GetWeightEx();
12269 float special = GetInventoryAndCargoWeight();
12270 return weightEx - special;
12271 }
12272
12273
12275 {
12277 }
12278
12280 {
12282 {
12283 #ifdef DEVELOPER
12284 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12285 {
12286 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12288 }
12289 #endif
12290
12291 return GetQuantity() * GetConfigWeightModified();
12292 }
12293 else if (HasEnergyManager())
12294 {
12295 #ifdef DEVELOPER
12296 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12297 {
12298 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12299 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12300 }
12301 #endif
12302 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12303 }
12304 else
12305 {
12306 #ifdef DEVELOPER
12307 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12308 {
12309 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12310 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12311 }
12312 #endif
12313 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12314 }
12315 }
12316
12319 {
12320 int item_count = 0;
12322
12323 if (GetInventory().GetCargo() != NULL)
12324 {
12325 item_count = GetInventory().GetCargo().GetItemCount();
12326 }
12327
12328 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12329 {
12330 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12331 if (item)
12332 item_count += item.GetNumberOfItems();
12333 }
12334 return item_count;
12335 }
12336
12339 {
12340 float weight = 0;
12341 float wetness = 1;
12342 if (include_wetness)
12345 {
12346 weight = wetness * m_ConfigWeight;
12347 }
12349 {
12350 weight = 1;
12351 }
12352 return weight;
12353 }
12354
12355
12356
12358 {
12359 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12360 {
12361 GameInventory inv = GetInventory();
12362 array<EntityAI> items = new array<EntityAI>;
12364 for (int i = 0; i < items.Count(); i++)
12365 {
12367 if (item)
12368 {
12370 }
12371 }
12372 }
12373 }
12374
12375
12376
12377
12379 {
12380 float energy = 0;
12381 if (HasEnergyManager())
12382 {
12383 energy = GetCompEM().GetEnergy();
12384 }
12385 return energy;
12386 }
12387
12388
12390 {
12391 super.OnEnergyConsumed();
12392
12394 }
12395
12397 {
12398 super.OnEnergyAdded();
12399
12401 }
12402
12403
12405 {
12406 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12407 {
12409 {
12410 float energy_0to1 = GetCompEM().GetEnergy0To1();
12412 }
12413 }
12414 }
12415
12416
12418 {
12419 return ConfigGetFloat("heatIsolation");
12420 }
12421
12423 {
12425 }
12426
12428 {
12429 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12430 if (
GetGame().ConfigIsExisting(paramPath))
12432
12433 return 0.0;
12434 }
12435
12437 {
12438 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12439 if (
GetGame().ConfigIsExisting(paramPath))
12441
12442 return 0.0;
12443 }
12444
12445 override void SetWet(
float value,
bool allow_client =
false)
12446 {
12447 if (!IsServerCheck(allow_client))
12448 return;
12449
12452
12454
12455 m_VarWet = Math.Clamp(value, min, max);
12456
12458 {
12461 }
12462 }
12463
12464 override void AddWet(
float value)
12465 {
12467 }
12468
12470 {
12472 }
12473
12475 {
12477 }
12478
12480 {
12482 }
12483
12485 {
12487 }
12488
12490 {
12492 }
12493
12494 override void OnWetChanged(
float newVal,
float oldVal)
12495 {
12498 if (newLevel != oldLevel)
12499 {
12501 }
12502 }
12503
12505 {
12506 SetWeightDirty();
12507 }
12508
12510 {
12511 return GetWetLevelInternal(
m_VarWet);
12512 }
12513
12514
12515
12517 {
12519 }
12520
12522 {
12524 }
12525
12527 {
12529 }
12530
12532 {
12534 }
12535
12536
12537
12539 {
12540 if (ConfigIsExisting("itemModelLength"))
12541 {
12542 return ConfigGetFloat("itemModelLength");
12543 }
12544 return 0;
12545 }
12546
12548 {
12549 if (ConfigIsExisting("itemAttachOffset"))
12550 {
12551 return ConfigGetFloat("itemAttachOffset");
12552 }
12553 return 0;
12554 }
12555
12556 override void SetCleanness(
int value,
bool allow_client =
false)
12557 {
12558 if (!IsServerCheck(allow_client))
12559 return;
12560
12562
12564
12567 }
12568
12570 {
12572 }
12573
12575 {
12576 return true;
12577 }
12578
12579
12580
12581
12583 {
12585 }
12586
12588 {
12590 }
12591
12592
12593
12594
12595 override void SetColor(
int r,
int g,
int b,
int a)
12596 {
12602 }
12604 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12605 {
12610 }
12611
12613 {
12615 }
12616
12619 {
12620 int r,g,b,a;
12622 r = r/255;
12623 g = g/255;
12624 b = b/255;
12625 a = a/255;
12626 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12627 }
12628
12629
12630
12631 override void SetLiquidType(
int value,
bool allow_client =
false)
12632 {
12633 if (!IsServerCheck(allow_client))
12634 return;
12635
12640 }
12641
12643 {
12644 return ConfigGetInt("varLiquidTypeInit");
12645 }
12646
12648 {
12650 }
12651
12653 {
12655 SetFrozen(false);
12656 }
12657
12660 {
12661 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12662 }
12663
12664
12667 {
12668 PlayerBase nplayer;
12669 if (PlayerBase.CastTo(nplayer, player))
12670 {
12672
12673 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12674 }
12675 }
12676
12677
12680 {
12681 PlayerBase nplayer;
12682 if (PlayerBase.CastTo(nplayer,player))
12683 {
12684
12685 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12686
12687 }
12688
12689
12690 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12691
12692
12693 if (HasEnergyManager())
12694 {
12695 GetCompEM().UpdatePlugState();
12696 }
12697 }
12698
12699
12701 {
12702 super.OnPlacementStarted(player);
12703
12705 }
12706
12707 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12708 {
12710 {
12711 m_AdminLog.OnPlacementComplete(player,
this);
12712 }
12713
12714 super.OnPlacementComplete(player, position, orientation);
12715 }
12716
12717
12718
12719
12720
12722 {
12724 {
12725 return true;
12726 }
12727 else
12728 {
12729 return false;
12730 }
12731 }
12732
12733
12735 {
12737 {
12739 }
12740 }
12741
12742
12744 {
12746 }
12747
12749 {
12751 }
12752
12753 override void InsertAgent(
int agent,
float count = 1)
12754 {
12755 if (count < 1)
12756 return;
12757
12759 }
12760
12763 {
12765 }
12766
12767
12769 {
12771 }
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12815 {
12817 return false;
12818 return true;
12819 }
12820
12822 {
12823
12825 }
12826
12827
12830 {
12831 super.CheckForRoofLimited(timeTresholdMS);
12832
12834 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12835 {
12836 m_PreviousRoofTestTime = time;
12837 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12838 }
12839 }
12840
12841
12843 {
12845 {
12846 return 0;
12847 }
12848
12849 if (GetInventory().GetAttachmentSlotsCount() != 0)
12850 {
12851 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12852 if (filter)
12853 return filter.GetProtectionLevel(type, false, system);
12854 else
12855 return 0;
12856 }
12857
12858 string subclassPath, entryName;
12859
12860 switch (type)
12861 {
12863 entryName = "biological";
12864 break;
12866 entryName = "chemical";
12867 break;
12868 default:
12869 entryName = "biological";
12870 break;
12871 }
12872
12873 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12874
12876 }
12877
12878
12879
12882 {
12883 if (!IsMagazine())
12885
12887 }
12888
12889
12890
12891
12892
12897 {
12898 return true;
12899 }
12900
12902 {
12904 }
12905
12906
12907
12908
12909
12911 {
12912 if (parent)
12913 {
12914 if (parent.IsInherited(DayZInfected))
12915 return true;
12916
12917 if (!parent.IsRuined())
12918 return true;
12919 }
12920
12921 return true;
12922 }
12923
12925 {
12926 if (!super.CanPutAsAttachment(parent))
12927 {
12928 return false;
12929 }
12930
12931 if (!IsRuined() && !parent.IsRuined())
12932 {
12933 return true;
12934 }
12935
12936 return false;
12937 }
12938
12940 {
12941
12942
12943
12944
12945 return super.CanReceiveItemIntoCargo(item);
12946 }
12947
12949 {
12950
12951
12952
12953
12954 GameInventory attachmentInv = attachment.GetInventory();
12956 {
12957 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12958 return false;
12959 }
12960
12961 InventoryLocation loc = new InventoryLocation();
12962 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12963 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12964 return false;
12965
12966 return super.CanReceiveAttachment(attachment, slotId);
12967 }
12968
12970 {
12971 if (!super.CanReleaseAttachment(attachment))
12972 return false;
12973
12974 return GetInventory().AreChildrenAccessible();
12975 }
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12998 {
12999 int id = muzzle_owner.GetMuzzleID();
13000 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13001
13002 if (WPOF_array)
13003 {
13004 for (int i = 0; i < WPOF_array.Count(); i++)
13005 {
13006 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13007
13008 if (WPOF)
13009 {
13010 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13011 }
13012 }
13013 }
13014 }
13015
13016
13018 {
13019 int id = muzzle_owner.GetMuzzleID();
13021
13022 if (WPOBE_array)
13023 {
13024 for (int i = 0; i < WPOBE_array.Count(); i++)
13025 {
13026 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13027
13028 if (WPOBE)
13029 {
13030 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13031 }
13032 }
13033 }
13034 }
13035
13036
13038 {
13039 int id = muzzle_owner.GetMuzzleID();
13040 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13041
13042 if (WPOOH_array)
13043 {
13044 for (int i = 0; i < WPOOH_array.Count(); i++)
13045 {
13046 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13047
13048 if (WPOOH)
13049 {
13050 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13051 }
13052 }
13053 }
13054 }
13055
13056
13058 {
13059 int id = muzzle_owner.GetMuzzleID();
13060 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13061
13062 if (WPOOH_array)
13063 {
13064 for (int i = 0; i < WPOOH_array.Count(); i++)
13065 {
13066 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13067
13068 if (WPOOH)
13069 {
13070 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13071 }
13072 }
13073 }
13074 }
13075
13076
13078 {
13079 int id = muzzle_owner.GetMuzzleID();
13080 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13081
13082 if (WPOOH_array)
13083 {
13084 for (int i = 0; i < WPOOH_array.Count(); i++)
13085 {
13086 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13087
13088 if (WPOOH)
13089 {
13090 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13091 }
13092 }
13093 }
13094 }
13095
13096
13097
13099 {
13101 {
13102 return true;
13103 }
13104
13105 return false;
13106 }
13107
13109 {
13111 {
13112 return true;
13113 }
13114
13115 return false;
13116 }
13117
13119 {
13121 {
13122 return true;
13123 }
13124
13125 return false;
13126 }
13127
13129 {
13130 return false;
13131 }
13132
13135 {
13136 return UATimeSpent.DEFAULT_DEPLOY;
13137 }
13138
13139
13140
13141
13143 {
13145 SetSynchDirty();
13146 }
13147
13149 {
13151 }
13152
13153
13155 {
13156 return false;
13157 }
13158
13161 {
13162 string att_type = "None";
13163
13164 if (ConfigIsExisting("soundAttType"))
13165 {
13166 att_type = ConfigGetString("soundAttType");
13167 }
13168
13170 }
13171
13173 {
13175 }
13176
13177
13178
13179
13180
13184
13186 {
13189
13191 }
13192
13193
13195 {
13197 return;
13198
13200
13203
13206
13207 SoundParameters params = new SoundParameters();
13211 }
13212
13213
13215 {
13217 return;
13218
13220 SetSynchDirty();
13221
13224 }
13225
13226
13228 {
13230 return;
13231
13233 SetSynchDirty();
13234
13237 }
13238
13240 {
13242 }
13243
13245 {
13247 }
13248
13251 {
13252 if (!
GetGame().IsDedicatedServer())
13253 {
13254 if (ConfigIsExisting("attachSoundSet"))
13255 {
13256 string cfg_path = "";
13257 string soundset = "";
13258 string type_name =
GetType();
13259
13262 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13263 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13264
13265 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13266 {
13267 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13268 {
13269 if (cfg_slot_array[i] == slot_type)
13270 {
13271 soundset = cfg_soundset_array[i];
13272 break;
13273 }
13274 }
13275 }
13276
13277 if (soundset != "")
13278 {
13279 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13281 }
13282 }
13283 }
13284 }
13285
13287 {
13288
13289 }
13290
13291 void OnApply(PlayerBase player);
13292
13294 {
13295 return 1.0;
13296 };
13297
13299 {
13301 }
13302
13304 {
13306 }
13307
13309
13311 {
13312 SetDynamicPhysicsLifeTime(0.01);
13314 }
13315
13317 {
13318 array<string> zone_names = new array<string>;
13319 GetDamageZones(zone_names);
13320 for (int i = 0; i < zone_names.Count(); i++)
13321 {
13322 SetHealthMax(zone_names.Get(i),"Health");
13323 }
13324 SetHealthMax("","Health");
13325 }
13326
13329 {
13330 float global_health = GetHealth01("","Health");
13331 array<string> zones = new array<string>;
13332 GetDamageZones(zones);
13333
13334 for (int i = 0; i < zones.Count(); i++)
13335 {
13336 SetHealth01(zones.Get(i),"Health",global_health);
13337 }
13338 }
13339
13342 {
13343 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13344 }
13345
13347 {
13348 if (!hasRootAsPlayer)
13349 {
13350 if (refParentIB)
13351 {
13352
13353 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13354 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13355
13356 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13357 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13358
13361 }
13362 else
13363 {
13364
13367 }
13368 }
13369 }
13370
13372 {
13374 {
13375 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13376 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13377 {
13378 float heatPermCoef = 1.0;
13380 while (ent)
13381 {
13382 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13383 ent = ent.GetHierarchyParent();
13384 }
13385
13386 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13387 }
13388 }
13389 }
13390
13392 {
13393
13394 EntityAI parent = GetHierarchyParent();
13395 if (!parent)
13396 {
13397 hasParent = false;
13398 hasRootAsPlayer = false;
13399 }
13400 else
13401 {
13402 hasParent = true;
13403 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13404 refParentIB =
ItemBase.Cast(parent);
13405 }
13406 }
13407
13408 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13409 {
13410
13411 }
13412
13414 {
13415
13416 return false;
13417 }
13418
13420 {
13421
13422
13423 return false;
13424 }
13425
13427 {
13428
13429 return false;
13430 }
13431
13434 {
13435 return !GetIsFrozen() &&
IsOpen();
13436 }
13437
13439 {
13440 bool hasParent = false, hasRootAsPlayer = false;
13442
13443 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13444 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13445
13446 if (wwtu || foodDecay)
13447 {
13451
13452 if (processWetness || processTemperature || processDecay)
13453 {
13455
13456 if (processWetness)
13457 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13458
13459 if (processTemperature)
13461
13462 if (processDecay)
13463 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13464 }
13465 }
13466 }
13467
13470 {
13472 }
13473
13475 {
13478
13479 return super.GetTemperatureFreezeThreshold();
13480 }
13481
13483 {
13486
13487 return super.GetTemperatureThawThreshold();
13488 }
13489
13491 {
13494
13495 return super.GetItemOverheatThreshold();
13496 }
13497
13499 {
13501 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13502
13503 return super.GetTemperatureFreezeTime();
13504 }
13505
13507 {
13509 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13510
13511 return super.GetTemperatureThawTime();
13512 }
13513
13518
13520 {
13521 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13522 }
13523
13525 {
13526 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13527 }
13528
13531 {
13533 }
13534
13536 {
13538 }
13539
13541 {
13543 }
13544
13547 {
13548 return null;
13549 }
13550
13553 {
13554 return false;
13555 }
13556
13558 {
13560 {
13563 if (!trg)
13564 {
13566 explosive = this;
13567 }
13568
13569 explosive.PairRemote(trg);
13571
13572 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13573 trg.SetPersistentPairID(persistentID);
13574 explosive.SetPersistentPairID(persistentID);
13575
13576 return true;
13577 }
13578 return false;
13579 }
13580
13583 {
13584 float ret = 1.0;
13587 ret *= GetHealth01();
13588
13589 return ret;
13590 }
13591
13592 #ifdef DEVELOPER
13593 override void SetDebugItem()
13594 {
13595 super.SetDebugItem();
13596 _itemBase = this;
13597 }
13598
13600 {
13601 string text = super.GetDebugText();
13602
13604 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13605
13606 return text;
13607 }
13608 #endif
13609
13611 {
13612 return true;
13613 }
13614
13616
13618
13620 {
13623 }
13624
13625
13633
13649}
13650
13652{
13654 if (entity)
13655 {
13656 bool is_item = entity.IsInherited(
ItemBase);
13657 if (is_item && full_quantity)
13658 {
13661 }
13662 }
13663 else
13664 {
13666 return NULL;
13667 }
13668 return entity;
13669}
13670
13672{
13673 if (item)
13674 {
13675 if (health > 0)
13676 item.SetHealth("", "", health);
13677
13678 if (item.CanHaveTemperature())
13679 {
13681 if (item.CanFreeze())
13682 item.SetFrozen(false);
13683 }
13684
13685 if (item.HasEnergyManager())
13686 {
13687 if (quantity >= 0)
13688 {
13689 item.GetCompEM().SetEnergy0To1(quantity);
13690 }
13691 else
13692 {
13694 }
13695 }
13696 else if (item.IsMagazine())
13697 {
13698 Magazine mag = Magazine.Cast(item);
13699 if (quantity >= 0)
13700 {
13701 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13702 }
13703 else
13704 {
13706 }
13707
13708 }
13709 else
13710 {
13711 if (quantity >= 0)
13712 {
13713 item.SetQuantityNormalized(quantity, false);
13714 }
13715 else
13716 {
13718 }
13719
13720 }
13721 }
13722}
13723
13724#ifdef DEVELOPER
13726#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.