8615{
8617 {
8618 return true;
8619 }
8620};
8621
8622
8623
8625{
8629
8631
8634
8635
8636
8637
8638
8647
8653
8658
8663
8684 protected bool m_IsResultOfSplit
8685
8687
8692
8693
8694
8696
8700
8701
8702
8704
8707
8708
8709
8715
8716
8724
8727
8728
8730
8731
8733
8734
8739
8740
8745
8746
8748
8749
8751 {
8756
8757 if (!
GetGame().IsDedicatedServer())
8758 {
8760 {
8762
8764 {
8766 }
8767 }
8768
8771 }
8772
8773 m_OldLocation = null;
8774
8776 {
8778 }
8779
8780 if (ConfigIsExisting("headSelectionsToHide"))
8781 {
8784 }
8785
8787 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8788 {
8790 }
8791
8793
8794 m_IsResultOfSplit = false;
8795
8797 }
8798
8800 {
8801 super.InitItemVariables();
8802
8808 m_Count = ConfigGetInt(
"count");
8809
8812
8817
8820
8825
8837
8841
8842
8845 if (ConfigIsExisting("canBeSplit"))
8846 {
8849 }
8850
8852 if (ConfigIsExisting("itemBehaviour"))
8854
8855
8858 RegisterNetSyncVariableInt("m_VarLiquidType");
8859 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8860
8861 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8862 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8863 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8864
8865 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8866 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8867 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8868 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8869
8870 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8871 RegisterNetSyncVariableBool("m_IsTakeable");
8872 RegisterNetSyncVariableBool("m_IsHologram");
8873
8876 {
8879 }
8880
8882
8884 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8886
8887 }
8888
8890 {
8892 }
8893
8895 {
8898 {
8903 }
8904 }
8905
8906 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8907 {
8909 {
8912 }
8913
8915 }
8916
8918 {
8924 }
8925
8927
8929 {
8931
8932 if (!action)
8933 {
8934 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8935 return;
8936 }
8937
8939 if (!ai)
8940 {
8942 return;
8943 }
8944
8946 if (!action_array)
8947 {
8948 action_array = new array<ActionBase_Basic>;
8950 }
8951 if (LogManager.IsActionLogEnable())
8952 {
8953 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8954 }
8955
8956 if (action_array.Find(action) != -1)
8957 {
8958 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8959 }
8960 else
8961 {
8962 action_array.Insert(action);
8963 }
8964 }
8965
8967 {
8969 ActionBase action = player.GetActionManager().GetAction(actionName);
8972
8973 if (action_array)
8974 {
8975 action_array.RemoveItem(action);
8976 }
8977 }
8978
8979
8980
8982 {
8983 ActionOverrideData overrideData = new ActionOverrideData();
8987
8989 if (!actionMap)
8990 {
8993 }
8994
8995 actionMap.Insert(this.
Type(), overrideData);
8996
8997 }
8998
9000
9002
9003
9005 {
9008
9011
9012 string config_to_search = "CfgVehicles";
9013 string muzzle_owner_config;
9014
9016 {
9017 if (IsInherited(Weapon))
9018 config_to_search = "CfgWeapons";
9019
9020 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9021
9022 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9023
9025
9026 if (config_OnFire_subclass_count > 0)
9027 {
9028 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9029
9030 for (int i = 0; i < config_OnFire_subclass_count; i++)
9031 {
9032 string particle_class = "";
9034 string config_OnFire_entry = config_OnFire_class + particle_class;
9035 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9036 WPOF_array.Insert(WPOF);
9037 }
9038
9039
9041 }
9042 }
9043
9045 {
9046 config_to_search = "CfgWeapons";
9047 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9048
9049 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9050
9052
9053 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9054 {
9055 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9056
9057 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9058 {
9059 string particle_class2 = "";
9061 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9062 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9063 WPOBE_array.Insert(WPOBE);
9064 }
9065
9066
9068 }
9069 }
9070 }
9071
9072
9074 {
9077
9079 {
9080 string config_to_search = "CfgVehicles";
9081
9082 if (IsInherited(Weapon))
9083 config_to_search = "CfgWeapons";
9084
9085 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9086 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9087
9088 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9089 {
9090
9092
9094 {
9096 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9098 return;
9099 }
9100
9103
9104
9105
9107 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9108
9109 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9110 {
9111 string particle_class = "";
9113 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9115
9116 if (entry_type == CT_CLASS)
9117 {
9118 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9119 WPOOH_array.Insert(WPOF);
9120 }
9121 }
9122
9123
9125 }
9126 }
9127 }
9128
9130 {
9132 }
9133
9135 {
9137 {
9139
9142
9145
9146 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9147 }
9148 }
9149
9151 {
9153 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9154
9156 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9157
9159 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9160
9162 {
9164 }
9165 }
9166
9168 {
9170 }
9171
9173 {
9176 else
9178
9180 {
9183 }
9184 else
9185 {
9188
9191 }
9192
9194 }
9195
9197 {
9199 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9200 }
9201
9203 {
9205 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9207 }
9208
9210 {
9212 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9213 }
9214
9216 {
9219
9220 OverheatingParticle OP = new OverheatingParticle();
9225
9227 }
9228
9230 {
9233
9234 return -1;
9235 }
9236
9238 {
9240 {
9243
9244 for (int i = count; i > 0; --i)
9245 {
9246 int id = i - 1;
9249
9252
9253 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9254 {
9255 if (p)
9256 {
9259 }
9260 }
9261 }
9262 }
9263 }
9264
9266 {
9268 {
9270 {
9271 int id = i - 1;
9273
9274 if (OP)
9275 {
9277
9278 if (p)
9279 {
9281 }
9282
9283 delete OP;
9284 }
9285 }
9286
9289 }
9290 }
9291
9294 {
9295 return 0.0;
9296 }
9297
9298
9300 {
9301 return 250;
9302 }
9303
9305 {
9306 return 0;
9307 }
9308
9311 {
9313 return true;
9314
9315 return false;
9316 }
9317
9320 {
9323
9325 {
9327 }
9328 else
9329 {
9330
9332 }
9333
9335 }
9336
9343 {
9344 return -1;
9345 }
9346
9347
9348
9349
9351 {
9353 {
9355 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9356
9357 if (r_index >= 0)
9358 {
9359 InventoryLocation r_il = new InventoryLocation;
9360 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9361
9362 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9365 {
9366 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9367 }
9369 {
9370 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9371 }
9372
9373 }
9374
9375 player.GetHumanInventory().ClearUserReservedLocation(this);
9376 }
9377
9380 }
9381
9382
9383
9384
9386 {
9387 return ItemBase.m_DebugActionsMask;
9388 }
9389
9391 {
9392 return ItemBase.m_DebugActionsMask & mask;
9393 }
9394
9396 {
9397 ItemBase.m_DebugActionsMask = mask;
9398 }
9399
9401 {
9402 ItemBase.m_DebugActionsMask |= mask;
9403 }
9404
9406 {
9407 ItemBase.m_DebugActionsMask &= ~mask;
9408 }
9409
9411 {
9413 {
9415 }
9416 else
9417 {
9419 }
9420 }
9421
9422
9424 {
9425 if (GetEconomyProfile())
9426 {
9427 float q_max = GetEconomyProfile().GetQuantityMax();
9428 if (q_max > 0)
9429 {
9430 float q_min = GetEconomyProfile().GetQuantityMin();
9431 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9432
9434 {
9435 ComponentEnergyManager comp = GetCompEM();
9437 {
9439 }
9440 }
9442 {
9444
9445 }
9446
9447 }
9448 }
9449 }
9450
9453 {
9454 EntityAI parent = GetHierarchyParent();
9455
9456 if (parent)
9457 {
9458 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9459 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9460 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9461 }
9462 }
9463
9466 {
9467 EntityAI parent = GetHierarchyParent();
9468
9469 if (parent)
9470 {
9471 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9472 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9473 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9474 }
9475 }
9476
9478 {
9479
9480
9481
9482
9484
9486 {
9487 if (ScriptInputUserData.CanStoreInputUserData())
9488 {
9489 ScriptInputUserData ctx = new ScriptInputUserData;
9495 ctx.
Write(use_stack_max);
9498
9500 {
9501 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9502 }
9503 }
9504 }
9505 else if (!
GetGame().IsMultiplayer())
9506 {
9508 }
9509 }
9510
9512 {
9514 }
9515
9517 {
9519 }
9520
9522 {
9524 }
9525
9527 {
9528
9529 return false;
9530 }
9531
9533 {
9534 return false;
9535 }
9536
9540 {
9541 return false;
9542 }
9543
9545 {
9546 return "";
9547 }
9548
9550
9552 {
9553 return false;
9554 }
9555
9557 {
9558 return true;
9559 }
9560
9561
9562
9564 {
9565 return true;
9566 }
9567
9569 {
9570 return true;
9571 }
9572
9574 {
9575 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9577 }
9578
9580 {
9582 }
9583
9585 {
9587 if (!is_being_placed)
9589 SetSynchDirty();
9590 }
9591
9592
9594
9596 {
9598 }
9599
9601 {
9603 }
9604
9606 {
9607 return 1;
9608 }
9609
9611 {
9612 return false;
9613 }
9614
9616 {
9618 SetSynchDirty();
9619 }
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9656 {
9657 super.OnMovedInsideCargo(container);
9658
9659 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9660 }
9661
9662 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9663 {
9664 super.EEItemLocationChanged(oldLoc,newLoc);
9665
9666 PlayerBase new_player = null;
9667 PlayerBase old_player = null;
9668
9669 if (newLoc.GetParent())
9670 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9671
9672 if (oldLoc.GetParent())
9673 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9674
9676 {
9677 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9678
9679 if (r_index >= 0)
9680 {
9681 InventoryLocation r_il = new InventoryLocation;
9682 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9683
9684 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9687 {
9688 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9689 }
9691 {
9692 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9693 }
9694
9695 }
9696 }
9697
9699 {
9700 if (new_player)
9701 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9702
9703 if (new_player == old_player)
9704 {
9705
9706 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9707 {
9709 {
9710 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9711 {
9712 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9713 }
9714 }
9715 else
9716 {
9717 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9718 }
9719 }
9720
9721 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9722 {
9723 int type = oldLoc.GetType();
9725 {
9726 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9727 }
9729 {
9730 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9731 }
9732 }
9733 if (!m_OldLocation)
9734 {
9735 m_OldLocation = new InventoryLocation;
9736 }
9737 m_OldLocation.Copy(oldLoc);
9738 }
9739 else
9740 {
9741 if (m_OldLocation)
9742 {
9743 m_OldLocation.Reset();
9744 }
9745 }
9746
9748 }
9749 else
9750 {
9751 if (new_player)
9752 {
9753 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9754 if (res_index >= 0)
9755 {
9756 InventoryLocation il = new InventoryLocation;
9757 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9759 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9762 {
9763 il.
GetParent().GetOnReleaseLock().Invoke(it);
9764 }
9766 {
9768 }
9769
9770 }
9771 }
9773 {
9774
9776 }
9777
9778 if (m_OldLocation)
9779 {
9780 m_OldLocation.Reset();
9781 }
9782 }
9783 }
9784
9785 override void EOnContact(IEntity other, Contact extra)
9786 {
9788 {
9789 int liquidType = -1;
9791 if (impactSpeed > 0.0)
9792 {
9794 #ifndef SERVER
9796 #else
9798 SetSynchDirty();
9799 #endif
9801 }
9802 }
9803
9804 #ifdef SERVER
9805 if (GetCompEM() && GetCompEM().IsPlugged())
9806 {
9807 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9808 GetCompEM().UnplugThis();
9809 }
9810 #endif
9811 }
9812
9814
9816 {
9818 }
9819
9821 {
9822
9823 }
9824
9826 {
9827 super.OnItemLocationChanged(old_owner, new_owner);
9828
9829 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9830 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9831
9832 if (!relatedPlayer && playerNew)
9833 relatedPlayer = playerNew;
9834
9835 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9836 {
9838 if (actionMgr)
9839 {
9840 ActionBase currentAction = actionMgr.GetRunningAction();
9841 if (currentAction)
9843 }
9844 }
9845
9846 Man ownerPlayerOld = null;
9847 Man ownerPlayerNew = null;
9848
9849 if (old_owner)
9850 {
9851 if (old_owner.
IsMan())
9852 {
9853 ownerPlayerOld = Man.Cast(old_owner);
9854 }
9855 else
9856 {
9857 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9858 }
9859 }
9860 else
9861 {
9863 {
9865
9866 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9867 {
9868 GetCompEM().UnplugThis();
9869 }
9870 }
9871 }
9872
9873 if (new_owner)
9874 {
9875 if (new_owner.
IsMan())
9876 {
9877 ownerPlayerNew = Man.Cast(new_owner);
9878 }
9879 else
9880 {
9881 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9882 }
9883 }
9884
9885 if (ownerPlayerOld != ownerPlayerNew)
9886 {
9887 if (ownerPlayerOld)
9888 {
9889 array<EntityAI> subItemsExit = new array<EntityAI>;
9891 for (int i = 0; i < subItemsExit.Count(); i++)
9892 {
9895 }
9896 }
9897
9898 if (ownerPlayerNew)
9899 {
9900 array<EntityAI> subItemsEnter = new array<EntityAI>;
9902 for (int j = 0; j < subItemsEnter.Count(); j++)
9903 {
9906 }
9907 }
9908 }
9909 else if (ownerPlayerNew != null)
9910 {
9911 PlayerBase nplayer;
9912 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9913 {
9914 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9916 for (int k = 0; k < subItemsUpdate.Count(); k++)
9917 {
9919 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9920 }
9921 }
9922 }
9923
9924 if (old_owner)
9925 old_owner.OnChildItemRemoved(this);
9926 if (new_owner)
9927 new_owner.OnChildItemReceived(this);
9928 }
9929
9930
9932 {
9933 super.EEDelete(parent);
9934 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9935 if (player)
9936 {
9938
9939 if (player.IsAlive())
9940 {
9941 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9942 if (r_index >= 0)
9943 {
9944 InventoryLocation r_il = new InventoryLocation;
9945 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9946
9947 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9950 {
9951 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9952 }
9954 {
9955 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9956 }
9957
9958 }
9959
9960 player.RemoveQuickBarEntityShortcut(this);
9961 }
9962 }
9963 }
9964
9966 {
9967 super.EEKilled(killer);
9968
9971 {
9972 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9973 {
9974 if (IsMagazine())
9975 {
9976 if (Magazine.Cast(this).GetAmmoCount() > 0)
9977 {
9979 }
9980 }
9981 else
9982 {
9984 }
9985 }
9986 }
9987 }
9988
9990 {
9991 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9992
9993 super.OnWasAttached(parent, slot_id);
9994
9997
9999 }
10000
10002 {
10003 super.OnWasDetached(parent, slot_id);
10004
10007 }
10008
10010 {
10011 int idx;
10014
10015 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10016 if (inventory_slots.Count() < 1)
10017 {
10018 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10019 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10020 }
10021 else
10022 {
10023 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10024 }
10025
10026 idx = inventory_slots.Find(slot);
10027 if (idx < 0)
10028 return "";
10029
10030 return attach_types.Get(idx);
10031 }
10032
10034 {
10035 int idx = -1;
10036 string slot;
10037
10040
10041 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10042 if (inventory_slots.Count() < 1)
10043 {
10044 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10045 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10046 }
10047 else
10048 {
10049 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10050 if (detach_types.Count() < 1)
10051 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10052 }
10053
10054 for (int i = 0; i < inventory_slots.Count(); i++)
10055 {
10056 slot = inventory_slots.Get(i);
10057 }
10058
10059 if (slot != "")
10060 {
10061 if (detach_types.Count() == 1)
10062 idx = 0;
10063 else
10064 idx = inventory_slots.Find(slot);
10065 }
10066 if (idx < 0)
10067 return "";
10068
10069 return detach_types.Get(idx);
10070 }
10071
10073 {
10074
10076
10077
10078 float min_time = 1;
10079 float max_time = 3;
10080 float delay = Math.RandomFloat(min_time, max_time);
10081
10082 explode_timer.Run(delay, this, "DoAmmoExplosion");
10083 }
10084
10086 {
10087 Magazine magazine = Magazine.Cast(this);
10088 int pop_sounds_count = 6;
10089 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10090
10091
10092 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10093 string sound_name = pop_sounds[ sound_idx ];
10095
10096
10097 magazine.ServerAddAmmoCount(-1);
10098
10099
10100 float min_temp_to_explode = 100;
10101
10102 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10103 {
10105 }
10106 }
10107
10108
10109 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10110 {
10111 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10112
10113 const int CHANCE_DAMAGE_CARGO = 4;
10114 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10115 const int CHANCE_DAMAGE_NOTHING = 2;
10116
10118 {
10119 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10120 int chances;
10121 int rnd;
10122
10123 if (GetInventory().GetCargo())
10124 {
10125 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10126 rnd = Math.RandomInt(0,chances);
10127
10128 if (rnd < CHANCE_DAMAGE_CARGO)
10129 {
10131 }
10132 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10133 {
10135 }
10136 }
10137 else
10138 {
10139 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10140 rnd = Math.RandomInt(0,chances);
10141
10142 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10143 {
10145 }
10146 }
10147 }
10148 }
10149
10151 {
10152 if (GetInventory().GetCargo())
10153 {
10154 int item_count = GetInventory().GetCargo().GetItemCount();
10155 if (item_count > 0)
10156 {
10157 int random_pick = Math.RandomInt(0, item_count);
10159 if (!item.IsExplosive())
10160 {
10161 item.AddHealth("","",damage);
10162 return true;
10163 }
10164 }
10165 }
10166 return false;
10167 }
10168
10170 {
10171 int attachment_count = GetInventory().AttachmentCount();
10172 if (attachment_count > 0)
10173 {
10174 int random_pick = Math.RandomInt(0, attachment_count);
10175 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10176 if (!attachment.IsExplosive())
10177 {
10178 attachment.AddHealth("","",damage);
10179 return true;
10180 }
10181 }
10182 return false;
10183 }
10184
10186 {
10188 }
10189
10191 {
10193 return GetInventory().CanRemoveEntity();
10194
10195 return false;
10196 }
10197
10199 {
10200
10202 return false;
10203
10204
10206 return false;
10207
10208
10209
10211 if (delta == 0)
10212 return false;
10213
10214
10215 return true;
10216 }
10217
10219 {
10221 {
10222 if (ScriptInputUserData.CanStoreInputUserData())
10223 {
10224 ScriptInputUserData ctx = new ScriptInputUserData;
10229 ctx.
Write(destination_entity);
10231 ctx.
Write(slot_id);
10233 }
10234 }
10235 else if (!
GetGame().IsMultiplayer())
10236 {
10238 }
10239 }
10240
10242 {
10243 float split_quantity_new;
10247 InventoryLocation loc = new InventoryLocation;
10248
10249 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10250 {
10252 split_quantity_new = stack_max;
10253 else
10255
10257 {
10258 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10259 if (new_item)
10260 {
10261 new_item.SetResultOfSplit(true);
10262 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10264 new_item.
SetQuantity(split_quantity_new,
false,
true);
10265 }
10266 }
10267 }
10268 else if (destination_entity && slot_id == -1)
10269 {
10270 if (quantity > stack_max)
10271 split_quantity_new = stack_max;
10272 else
10273 split_quantity_new = quantity;
10274
10276 {
10278 {
10281 }
10282
10283 if (new_item)
10284 {
10285 new_item.SetResultOfSplit(true);
10286 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10288 new_item.
SetQuantity(split_quantity_new,
false,
true);
10289 }
10290 }
10291 }
10292 else
10293 {
10294 if (stack_max != 0)
10295 {
10297 {
10299 }
10300
10301 if (split_quantity_new == 0)
10302 {
10303 if (!
GetGame().IsMultiplayer())
10304 player.PhysicalPredictiveDropItem(this);
10305 else
10306 player.ServerDropEntity(this);
10307 return;
10308 }
10309
10311 {
10313
10314 if (new_item)
10315 {
10316 new_item.SetResultOfSplit(true);
10317 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10320 new_item.PlaceOnSurface();
10321 }
10322 }
10323 }
10324 }
10325 }
10326
10328 {
10329 float split_quantity_new;
10333 InventoryLocation loc = new InventoryLocation;
10334
10335 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10336 {
10338 split_quantity_new = stack_max;
10339 else
10341
10343 {
10344 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10345 if (new_item)
10346 {
10347 new_item.SetResultOfSplit(true);
10348 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10350 new_item.
SetQuantity(split_quantity_new,
false,
true);
10351 }
10352 }
10353 }
10354 else if (destination_entity && slot_id == -1)
10355 {
10356 if (quantity > stack_max)
10357 split_quantity_new = stack_max;
10358 else
10359 split_quantity_new = quantity;
10360
10362 {
10364 {
10367 }
10368
10369 if (new_item)
10370 {
10371 new_item.SetResultOfSplit(true);
10372 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10374 new_item.
SetQuantity(split_quantity_new,
false,
true);
10375 }
10376 }
10377 }
10378 else
10379 {
10380 if (stack_max != 0)
10381 {
10383 {
10385 }
10386
10388 {
10390
10391 if (new_item)
10392 {
10393 new_item.SetResultOfSplit(true);
10394 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10397 new_item.PlaceOnSurface();
10398 }
10399 }
10400 }
10401 }
10402 }
10403
10405 {
10407 {
10408 if (ScriptInputUserData.CanStoreInputUserData())
10409 {
10410 ScriptInputUserData ctx = new ScriptInputUserData;
10415 dst.WriteToContext(ctx);
10417 }
10418 }
10419 else if (!
GetGame().IsMultiplayer())
10420 {
10422 }
10423 }
10424
10426 {
10428 {
10429 if (ScriptInputUserData.CanStoreInputUserData())
10430 {
10431 ScriptInputUserData ctx = new ScriptInputUserData;
10436 ctx.
Write(destination_entity);
10442 }
10443 }
10444 else if (!
GetGame().IsMultiplayer())
10445 {
10447 }
10448 }
10449
10451 {
10453 }
10454
10456 {
10458 float split_quantity_new;
10460 if (dst.IsValid())
10461 {
10462 int slot_id = dst.GetSlot();
10464
10465 if (quantity > stack_max)
10466 split_quantity_new = stack_max;
10467 else
10468 split_quantity_new = quantity;
10469
10471 {
10473
10474 if (new_item)
10475 {
10476 new_item.SetResultOfSplit(true);
10477 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10479 new_item.
SetQuantity(split_quantity_new,
false,
true);
10480 }
10481
10482 return new_item;
10483 }
10484 }
10485
10486 return null;
10487 }
10488
10490 {
10492 float split_quantity_new;
10494 if (destination_entity)
10495 {
10497 if (quantity > stackable)
10498 split_quantity_new = stackable;
10499 else
10500 split_quantity_new = quantity;
10501
10503 {
10504 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10505 if (new_item)
10506 {
10507 new_item.SetResultOfSplit(true);
10508 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10510 new_item.
SetQuantity(split_quantity_new,
false,
true);
10511 }
10512 }
10513 }
10514 }
10515
10517 {
10519 {
10520 if (ScriptInputUserData.CanStoreInputUserData())
10521 {
10522 ScriptInputUserData ctx = new ScriptInputUserData;
10527 ItemBase destination_entity =
this;
10528 ctx.
Write(destination_entity);
10532 }
10533 }
10534 else if (!
GetGame().IsMultiplayer())
10535 {
10537 }
10538 }
10539
10541 {
10543 float split_quantity_new;
10545 if (player)
10546 {
10548 if (quantity > stackable)
10549 split_quantity_new = stackable;
10550 else
10551 split_quantity_new = quantity;
10552
10554 {
10555 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10556 new_item =
ItemBase.Cast(in_hands);
10557 if (new_item)
10558 {
10559 new_item.SetResultOfSplit(true);
10560 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10562 new_item.SetQuantity(split_quantity_new, false, true);
10563 }
10564 }
10565 }
10566 }
10567
10569 {
10571 float split_quantity_new = Math.Floor(quantity * 0.5);
10572
10574 return;
10575
10577
10578 if (new_item)
10579 {
10580 if (new_item.GetQuantityMax() < split_quantity_new)
10581 {
10582 split_quantity_new = new_item.GetQuantityMax();
10583 }
10584
10585 new_item.SetResultOfSplit(true);
10586 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10587
10589 {
10592 }
10593 else
10594 {
10596 new_item.
SetQuantity(split_quantity_new,
false,
true);
10597 }
10598 }
10599 }
10600
10602 {
10604 float split_quantity_new = Math.Floor(quantity / 2);
10605
10607 return;
10608
10609 InventoryLocation invloc = new InventoryLocation;
10611
10613 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10614
10615 if (new_item)
10616 {
10617 if (new_item.GetQuantityMax() < split_quantity_new)
10618 {
10619 split_quantity_new = new_item.GetQuantityMax();
10620 }
10622 {
10625 }
10626 else if (split_quantity_new > 1)
10627 {
10629 new_item.
SetQuantity(split_quantity_new,
false,
true);
10630 }
10631 }
10632 }
10633
10636 {
10637 SetWeightDirty();
10639
10640 if (parent)
10641 parent.OnAttachmentQuantityChangedEx(this, delta);
10642
10644 {
10646 {
10648 }
10650 {
10651 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10653 }
10654 }
10655
10656 }
10657
10660 {
10661
10662 }
10663
10666 {
10668 }
10669
10671 {
10672 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10673
10675 {
10676 if (newLevel == GameConstants.STATE_RUINED)
10677 {
10679 EntityAI parent = GetHierarchyParent();
10680 if (parent && parent.IsFireplace())
10681 {
10682 CargoBase cargo = GetInventory().GetCargo();
10683 if (cargo)
10684 {
10686 {
10688 }
10689 }
10690 }
10691 }
10692
10694 {
10695
10697 return;
10698 }
10699
10700 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10701 {
10703 }
10704 }
10705 }
10706
10707
10709 {
10710 super.OnRightClick();
10711
10713 {
10715 {
10716 if (ScriptInputUserData.CanStoreInputUserData())
10717 {
10718 EntityAI root = GetHierarchyRoot();
10719 Man playerOwner = GetHierarchyRootPlayer();
10720 InventoryLocation dst = new InventoryLocation;
10721
10722
10723 if (!playerOwner && root && root == this)
10724 {
10726 }
10727 else
10728 {
10729
10730 GetInventory().GetCurrentInventoryLocation(dst);
10732 {
10735 {
10737 }
10738 else
10739 {
10741
10742
10743 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10744 {
10746 }
10747 else
10748 {
10749 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10750 }
10751 }
10752 }
10753 }
10754
10755 ScriptInputUserData ctx = new ScriptInputUserData;
10763 }
10764 }
10765 else if (!
GetGame().IsMultiplayer())
10766 {
10768 }
10769 }
10770 }
10771
10773 {
10774 if (root)
10775 {
10776 vector m4[4];
10777 root.GetTransform(m4);
10778 dst.SetGround(this, m4);
10779 }
10780 else
10781 {
10782 GetInventory().GetCurrentInventoryLocation(dst);
10783 }
10784 }
10785
10786 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10787 {
10788
10789 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10790 return false;
10791
10792 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10793 return false;
10794
10795
10797 return false;
10798
10799
10800 Magazine mag = Magazine.Cast(this);
10801 if (mag)
10802 {
10803 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10804 return false;
10805
10806 if (stack_max_limit)
10807 {
10808 Magazine other_mag = Magazine.Cast(other_item);
10809 if (other_item)
10810 {
10811 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10812 return false;
10813 }
10814
10815 }
10816 }
10817 else
10818 {
10819
10821 return false;
10822
10824 return false;
10825 }
10826
10827 PlayerBase player = null;
10828 if (CastTo(player, GetHierarchyRootPlayer()))
10829 {
10830 if (player.GetInventory().HasAttachment(this))
10831 return false;
10832
10833 if (player.IsItemsToDelete())
10834 return false;
10835 }
10836
10837 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10838 return false;
10839
10840 int slotID;
10842 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10843 return false;
10844
10845 return true;
10846 }
10847
10849 {
10851 }
10852
10854 {
10855 return m_IsResultOfSplit;
10856 }
10857
10859 {
10860 m_IsResultOfSplit = value;
10861 }
10862
10864 {
10866 }
10867
10869 {
10870 float other_item_quantity = other_item.GetQuantity();
10871 float this_free_space;
10872
10874
10876
10877 if (other_item_quantity > this_free_space)
10878 {
10879 return this_free_space;
10880 }
10881 else
10882 {
10883 return other_item_quantity;
10884 }
10885 }
10886
10888 {
10890 }
10891
10893 {
10895 return;
10896
10897 if (!IsMagazine() && other_item)
10898 {
10900 if (quantity_used != 0)
10901 {
10902 float hp1 = GetHealth01("","");
10903 float hp2 = other_item.GetHealth01("","");
10904 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10905 hpResult = hpResult / (
GetQuantity() + quantity_used);
10906
10907 hpResult *= GetMaxHealth();
10908 Math.Round(hpResult);
10909 SetHealth("", "Health", hpResult);
10910
10912 other_item.AddQuantity(-quantity_used);
10913 }
10914 }
10916 }
10917
10919 {
10920 #ifdef SERVER
10921 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10922 GetHierarchyParent().IncreaseLifetimeUp();
10923 #endif
10924 };
10925
10927 {
10928 PlayerBase p = PlayerBase.Cast(player);
10929
10930 array<int> recipesIds = p.m_Recipes;
10931 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10932 if (moduleRecipesManager)
10933 {
10934 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10935 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10936 }
10937
10938 for (int i = 0;i < recipesIds.Count(); i++)
10939 {
10940 int key = recipesIds.Get(i);
10941 string recipeName = moduleRecipesManager.GetRecipeName(key);
10943 }
10944 }
10945
10946
10947 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10948 {
10949 super.GetDebugActions(outputList);
10950
10951
10957
10958
10963
10968
10969
10973
10974
10976 {
10980 }
10981
10984
10985
10989
10991
10992 InventoryLocation loc = new InventoryLocation();
10993 GetInventory().GetCurrentInventoryLocation(loc);
10995 {
10996 if (Gizmo_IsSupported())
10999 }
11000
11002 }
11003
11004
11005
11006
11008 {
11009 super.OnAction(action_id, player, ctx);
11010
11012 {
11013 switch (action_id)
11014 {
11017 return true;
11020 return true;
11021 }
11022 }
11023
11025 {
11026 switch (action_id)
11027 {
11029 Delete();
11030 return true;
11031 }
11032 }
11033
11034 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11035 {
11036 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11037 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11038 PlayerBase p = PlayerBase.Cast(player);
11039 if (
EActions.RECIPES_RANGE_START < 1000)
11040 {
11041 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11042 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11043 }
11044 }
11045 #ifndef SERVER
11046 else if (action_id ==
EActions.WATCH_PLAYER)
11047 {
11048 PluginDeveloper.SetDeveloperItemClientEx(player);
11049 }
11050 #endif
11052 {
11053 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11054 {
11055 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11056 OnDebugButtonPressServer(id + 1);
11057 }
11058
11059 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11060 {
11061 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11063 }
11064
11065 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11066 {
11067 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11069 }
11070
11071 else if (action_id ==
EActions.ADD_QUANTITY)
11072 {
11073 if (IsMagazine())
11074 {
11075 Magazine mag = Magazine.Cast(this);
11076 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11077 }
11078 else
11079 {
11081 }
11082
11083 if (m_EM)
11084 {
11085 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11086 }
11087
11088 }
11089
11090 else if (action_id ==
EActions.REMOVE_QUANTITY)
11091 {
11092 if (IsMagazine())
11093 {
11094 Magazine mag2 = Magazine.Cast(this);
11095 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11096 }
11097 else
11098 {
11100 }
11101 if (m_EM)
11102 {
11103 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11104 }
11105
11106 }
11107
11108 else if (action_id ==
EActions.SET_QUANTITY_0)
11109 {
11111
11112 if (m_EM)
11113 {
11114 m_EM.SetEnergy(0);
11115 }
11116 }
11117
11118 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11119 {
11121
11122 if (m_EM)
11123 {
11124 m_EM.SetEnergy(m_EM.GetEnergyMax());
11125 }
11126 }
11127
11128 else if (action_id ==
EActions.ADD_HEALTH)
11129 {
11130 AddHealth("","",GetMaxHealth("","Health")/5);
11131 }
11132 else if (action_id ==
EActions.REMOVE_HEALTH)
11133 {
11134 AddHealth("","",-GetMaxHealth("","Health")/5);
11135 }
11136 else if (action_id ==
EActions.DESTROY_HEALTH)
11137 {
11138 SetHealth01("","",0);
11139 }
11140 else if (action_id ==
EActions.WATCH_ITEM)
11141 {
11143 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11144 #ifdef DEVELOPER
11145 SetDebugDeveloper_item(this);
11146 #endif
11147 }
11148
11149 else if (action_id ==
EActions.ADD_TEMPERATURE)
11150 {
11151 AddTemperature(20);
11152
11153 }
11154
11155 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11156 {
11157 AddTemperature(-20);
11158
11159 }
11160
11161 else if (action_id ==
EActions.FLIP_FROZEN)
11162 {
11163 SetFrozen(!GetIsFrozen());
11164
11165 }
11166
11167 else if (action_id ==
EActions.ADD_WETNESS)
11168 {
11170
11171 }
11172
11173 else if (action_id ==
EActions.REMOVE_WETNESS)
11174 {
11176
11177 }
11178
11179 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11180 {
11183
11184
11185 }
11186
11187 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11188 {
11191 }
11192
11193 else if (action_id ==
EActions.MAKE_SPECIAL)
11194 {
11195 auto debugParams = DebugSpawnParams.WithPlayer(player);
11196 OnDebugSpawnEx(debugParams);
11197 }
11198
11199 }
11200
11201
11202 return false;
11203 }
11204
11205
11206
11207
11211
11214
11215
11216
11218 {
11219 return false;
11220 }
11221
11222
11224 {
11225 return true;
11226 }
11227
11228
11230 {
11231 return true;
11232 }
11233
11234
11235
11237 {
11238 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11240 }
11241
11244 {
11245 return null;
11246 }
11247
11249 {
11250 return false;
11251 }
11252
11254 {
11255 return false;
11256 }
11257
11261
11262
11264 {
11265 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11266 return module_repairing.CanRepair(this, item_repair_kit);
11267 }
11268
11269
11270 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11271 {
11272 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11273 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11274 }
11275
11276
11278 {
11279
11280
11281
11282
11283
11284
11285
11286
11287 return 1;
11288 }
11289
11290
11291
11293 {
11295 }
11296
11297
11298
11300 {
11302 }
11303
11304
11313 {
11314 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11315
11316 if (player)
11317 {
11318 player.MessageStatus(text);
11319 }
11320 }
11321
11322
11331 {
11332 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11333
11334 if (player)
11335 {
11336 player.MessageAction(text);
11337 }
11338 }
11339
11340
11349 {
11350 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11351
11352 if (player)
11353 {
11354 player.MessageFriendly(text);
11355 }
11356 }
11357
11358
11367 {
11368 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11369
11370 if (player)
11371 {
11372 player.MessageImportant(text);
11373 }
11374 }
11375
11377 {
11378 return true;
11379 }
11380
11381
11382 override bool KindOf(
string tag)
11383 {
11384 bool found = false;
11385 string item_name = this.
GetType();
11388
11389 int array_size = item_tag_array.Count();
11390 for (int i = 0; i < array_size; i++)
11391 {
11392 if (item_tag_array.Get(i) == tag)
11393 {
11394 found = true;
11395 break;
11396 }
11397 }
11398 return found;
11399 }
11400
11401
11403 {
11404
11405 super.OnRPC(sender, rpc_type,ctx);
11406
11407
11408 switch (rpc_type)
11409 {
11410 #ifndef SERVER
11411 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11412 Param2<bool, string> p = new Param2<bool, string>(false, "");
11413
11415 return;
11416
11417 bool play = p.param1;
11418 string soundSet = p.param2;
11419
11420 if (play)
11421 {
11423 {
11425 {
11427 }
11428 }
11429 else
11430 {
11432 }
11433 }
11434 else
11435 {
11437 }
11438
11439 break;
11440 #endif
11441
11442 }
11443
11445 {
11447 }
11448 }
11449
11450
11451
11452
11454 {
11455 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11456 return plugin.GetID(
name);
11457 }
11458
11460 {
11461 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11462 return plugin.GetName(id);
11463 }
11464
11467 {
11468
11469
11470 int varFlags;
11471 if (!ctx.
Read(varFlags))
11472 return;
11473
11474 if (varFlags & ItemVariableFlags.FLOAT)
11475 {
11477 }
11478 }
11479
11481 {
11482
11483 super.SerializeNumericalVars(floats_out);
11484
11485
11486
11488 {
11490 }
11491
11493 {
11495 }
11496
11498 {
11500 }
11501
11503 {
11508 }
11509
11511 {
11513 }
11514 }
11515
11517 {
11518
11519 super.DeSerializeNumericalVars(floats);
11520
11521
11522 int index = 0;
11523 int mask = Math.Round(floats.Get(index));
11524
11525 index++;
11526
11528 {
11530 {
11532 }
11533 else
11534 {
11535 float quantity = floats.Get(index);
11536 SetQuantity(quantity,
true,
false,
false,
false);
11537 }
11538 index++;
11539 }
11540
11542 {
11543 float wet = floats.Get(index);
11545 index++;
11546 }
11547
11549 {
11550 int liquidtype = Math.Round(floats.Get(index));
11552 index++;
11553 }
11554
11556 {
11558 index++;
11560 index++;
11562 index++;
11564 index++;
11565 }
11566
11568 {
11569 int cleanness = Math.Round(floats.Get(index));
11571 index++;
11572 }
11573 }
11574
11576 {
11577 super.WriteVarsToCTX(ctx);
11578
11579
11581 {
11583 }
11584
11586 {
11588 }
11589
11591 {
11593 }
11594
11596 {
11597 int r,g,b,a;
11603 }
11604
11606 {
11608 }
11609 }
11610
11612 {
11613 if (!super.ReadVarsFromCTX(ctx,version))
11614 return false;
11615
11616 int intValue;
11617 float value;
11618
11619 if (version < 140)
11620 {
11621 if (!ctx.
Read(intValue))
11622 return false;
11623
11624 m_VariablesMask = intValue;
11625 }
11626
11628 {
11629 if (!ctx.
Read(value))
11630 return false;
11631
11633 {
11635 }
11636 else
11637 {
11639 }
11640 }
11641
11642 if (version < 140)
11643 {
11645 {
11646 if (!ctx.
Read(value))
11647 return false;
11648 SetTemperatureDirect(value);
11649 }
11650 }
11651
11653 {
11654 if (!ctx.
Read(value))
11655 return false;
11657 }
11658
11660 {
11661 if (!ctx.
Read(intValue))
11662 return false;
11664 }
11665
11667 {
11668 int r,g,b,a;
11670 return false;
11672 return false;
11674 return false;
11676 return false;
11677
11679 }
11680
11682 {
11683 if (!ctx.
Read(intValue))
11684 return false;
11686 }
11687
11688 if (version >= 138 && version < 140)
11689 {
11691 {
11692 if (!ctx.
Read(intValue))
11693 return false;
11694 SetFrozen(intValue);
11695 }
11696 }
11697
11698 return true;
11699 }
11700
11701
11703 {
11706 {
11708 }
11709
11710 if (!super.OnStoreLoad(ctx, version))
11711 {
11713 return false;
11714 }
11715
11716 if (version >= 114)
11717 {
11718 bool hasQuickBarIndexSaved;
11719
11720 if (!ctx.
Read(hasQuickBarIndexSaved))
11721 {
11723 return false;
11724 }
11725
11726 if (hasQuickBarIndexSaved)
11727 {
11728 int itmQBIndex;
11729
11730
11731 if (!ctx.
Read(itmQBIndex))
11732 {
11734 return false;
11735 }
11736
11737 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11738 if (itmQBIndex != -1 && parentPlayer)
11739 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11740 }
11741 }
11742 else
11743 {
11744
11745 PlayerBase player;
11746 int itemQBIndex;
11747 if (version ==
int.
MAX)
11748 {
11749 if (!ctx.
Read(itemQBIndex))
11750 {
11752 return false;
11753 }
11754 }
11755 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11756 {
11757
11758 if (!ctx.
Read(itemQBIndex))
11759 {
11761 return false;
11762 }
11763 if (itemQBIndex != -1 && player)
11764 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11765 }
11766 }
11767
11768 if (version < 140)
11769 {
11770
11771 if (!LoadVariables(ctx, version))
11772 {
11774 return false;
11775 }
11776 }
11777
11778
11780 {
11782 return false;
11783 }
11784 if (version >= 132)
11785 {
11787 if (raib)
11788 {
11790 {
11792 return false;
11793 }
11794 }
11795 }
11796
11798 return true;
11799 }
11800
11801
11802
11804 {
11805 super.OnStoreSave(ctx);
11806
11807 PlayerBase player;
11808 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11809 {
11811
11812 int itemQBIndex = -1;
11813 itemQBIndex = player.FindQuickBarEntityIndex(this);
11814 ctx.
Write(itemQBIndex);
11815 }
11816 else
11817 {
11819 }
11820
11822
11824 if (raib)
11825 {
11827 }
11828 }
11829
11830
11832 {
11833 super.AfterStoreLoad();
11834
11836 {
11838 }
11839
11841 {
11844 }
11845 }
11846
11848 {
11849 super.EEOnAfterLoad();
11850
11852 {
11854 }
11855
11858 }
11859
11861 {
11862 return false;
11863 }
11864
11865
11866
11868 {
11870 {
11871 #ifdef PLATFORM_CONSOLE
11872
11874 {
11876 if (menu)
11877 {
11879 }
11880 }
11881 #endif
11882 }
11883
11885 {
11888 }
11889
11891 {
11892 SetWeightDirty();
11894 }
11896 {
11899 }
11900
11902 {
11905 }
11907 {
11910 }
11911
11912 super.OnVariablesSynchronized();
11913 }
11914
11915
11916
11918 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11919 {
11920 if (!IsServerCheck(allow_client))
11921 return false;
11922
11924 return false;
11925
11928
11929 if (value <= (min + 0.001))
11930 value = min;
11931
11932 if (value == min)
11933 {
11934 if (destroy_config)
11935 {
11936 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11937 if (dstr)
11938 {
11940 this.Delete();
11941 return true;
11942 }
11943 }
11944 else if (destroy_forced)
11945 {
11947 this.Delete();
11948 return true;
11949 }
11950
11952 }
11953
11956
11958 {
11960
11961 if (delta)
11963 }
11964
11966
11967 return false;
11968 }
11969
11970
11972 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11973 {
11975 }
11976
11978 {
11981 }
11982
11984 {
11987 }
11988
11990 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11991 {
11992 float value_clamped = Math.Clamp(value, 0, 1);
11994 SetQuantity(result, destroy_config, destroy_forced);
11995 }
11996
11997
12000 {
12002 }
12003
12005 {
12007 }
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12019 {
12020 int slot = -1;
12021 if (GetInventory())
12022 {
12023 InventoryLocation il = new InventoryLocation;
12024 GetInventory().GetCurrentInventoryLocation(il);
12026 }
12027
12029 }
12030
12032 {
12033 float quantity_max = 0;
12034
12036 {
12037 if (attSlotID != -1)
12038 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12039
12040 if (quantity_max <= 0)
12042 }
12043
12044 if (quantity_max <= 0)
12046
12047 return quantity_max;
12048 }
12049
12051 {
12053 }
12054
12056 {
12058 }
12059
12060
12062 {
12064 }
12065
12067 {
12069 }
12070
12072 {
12074 }
12075
12076
12078 {
12079
12080 float weightEx = GetWeightEx();
12081 float special = GetInventoryAndCargoWeight();
12082 return weightEx - special;
12083 }
12084
12085
12087 {
12089 }
12090
12092 {
12094 {
12095 #ifdef DEVELOPER
12096 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12097 {
12098 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12100 }
12101 #endif
12102
12103 return GetQuantity() * GetConfigWeightModified();
12104 }
12105 else if (HasEnergyManager())
12106 {
12107 #ifdef DEVELOPER
12108 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12109 {
12110 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12111 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12112 }
12113 #endif
12114 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12115 }
12116 else
12117 {
12118 #ifdef DEVELOPER
12119 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12120 {
12121 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12122 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12123 }
12124 #endif
12125 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12126 }
12127 }
12128
12131 {
12132 int item_count = 0;
12134
12135 if (GetInventory().GetCargo() != NULL)
12136 {
12137 item_count = GetInventory().GetCargo().GetItemCount();
12138 }
12139
12140 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12141 {
12142 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12143 if (item)
12144 item_count += item.GetNumberOfItems();
12145 }
12146 return item_count;
12147 }
12148
12151 {
12152 float weight = 0;
12153 float wetness = 1;
12154 if (include_wetness)
12157 {
12158 weight = wetness * m_ConfigWeight;
12159 }
12161 {
12162 weight = 1;
12163 }
12164 return weight;
12165 }
12166
12167
12168
12170 {
12171 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12172 {
12173 GameInventory inv = GetInventory();
12174 array<EntityAI> items = new array<EntityAI>;
12176 for (int i = 0; i < items.Count(); i++)
12177 {
12179 if (item)
12180 {
12182 }
12183 }
12184 }
12185 }
12186
12187
12188
12189
12191 {
12192 float energy = 0;
12193 if (HasEnergyManager())
12194 {
12195 energy = GetCompEM().GetEnergy();
12196 }
12197 return energy;
12198 }
12199
12200
12202 {
12203 super.OnEnergyConsumed();
12204
12206 }
12207
12209 {
12210 super.OnEnergyAdded();
12211
12213 }
12214
12215
12217 {
12218 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12219 {
12221 {
12222 float energy_0to1 = GetCompEM().GetEnergy0To1();
12224 }
12225 }
12226 }
12227
12228
12230 {
12231 return ConfigGetFloat("heatIsolation");
12232 }
12233
12235 {
12237 }
12238
12240 {
12241 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12242 if (
GetGame().ConfigIsExisting(paramPath))
12244
12245 return 0.0;
12246 }
12247
12249 {
12250 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12251 if (
GetGame().ConfigIsExisting(paramPath))
12253
12254 return 0.0;
12255 }
12256
12257 override void SetWet(
float value,
bool allow_client =
false)
12258 {
12259 if (!IsServerCheck(allow_client))
12260 return;
12261
12264
12266
12267 m_VarWet = Math.Clamp(value, min, max);
12268
12270 {
12273 }
12274 }
12275
12276 override void AddWet(
float value)
12277 {
12279 }
12280
12282 {
12284 }
12285
12287 {
12289 }
12290
12292 {
12294 }
12295
12297 {
12299 }
12300
12302 {
12304 }
12305
12306 override void OnWetChanged(
float newVal,
float oldVal)
12307 {
12310 if (newLevel != oldLevel)
12311 {
12313 }
12314 }
12315
12317 {
12318 SetWeightDirty();
12319 }
12320
12322 {
12323 return GetWetLevelInternal(
m_VarWet);
12324 }
12325
12326
12327
12329 {
12331 }
12332
12334 {
12336 }
12337
12339 {
12341 }
12342
12344 {
12346 }
12347
12348
12349
12351 {
12352 if (ConfigIsExisting("itemModelLength"))
12353 {
12354 return ConfigGetFloat("itemModelLength");
12355 }
12356 return 0;
12357 }
12358
12360 {
12361 if (ConfigIsExisting("itemAttachOffset"))
12362 {
12363 return ConfigGetFloat("itemAttachOffset");
12364 }
12365 return 0;
12366 }
12367
12368 override void SetCleanness(
int value,
bool allow_client =
false)
12369 {
12370 if (!IsServerCheck(allow_client))
12371 return;
12372
12374
12376
12379 }
12380
12382 {
12384 }
12385
12387 {
12388 return true;
12389 }
12390
12391
12392
12393
12395 {
12397 }
12398
12400 {
12402 }
12403
12404
12405
12406
12407 override void SetColor(
int r,
int g,
int b,
int a)
12408 {
12414 }
12416 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12417 {
12422 }
12423
12425 {
12427 }
12428
12431 {
12432 int r,g,b,a;
12434 r = r/255;
12435 g = g/255;
12436 b = b/255;
12437 a = a/255;
12438 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12439 }
12440
12441
12442
12443 override void SetLiquidType(
int value,
bool allow_client =
false)
12444 {
12445 if (!IsServerCheck(allow_client))
12446 return;
12447
12452 }
12453
12455 {
12456 return ConfigGetInt("varLiquidTypeInit");
12457 }
12458
12460 {
12462 }
12463
12465 {
12467 SetFrozen(false);
12468 }
12469
12472 {
12473 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12474 }
12475
12476
12479 {
12480 PlayerBase nplayer;
12481 if (PlayerBase.CastTo(nplayer, player))
12482 {
12484
12485 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12486 }
12487 }
12488
12489
12492 {
12493 PlayerBase nplayer;
12494 if (PlayerBase.CastTo(nplayer,player))
12495 {
12496
12497 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12498
12499 }
12500
12501
12502 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12503
12504
12505 if (HasEnergyManager())
12506 {
12507 GetCompEM().UpdatePlugState();
12508 }
12509 }
12510
12511
12513 {
12514 super.OnPlacementStarted(player);
12515
12517 }
12518
12519 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12520 {
12522 {
12523 m_AdminLog.OnPlacementComplete(player,
this);
12524 }
12525
12526 super.OnPlacementComplete(player, position, orientation);
12527 }
12528
12529
12530
12531
12532
12534 {
12536 {
12537 return true;
12538 }
12539 else
12540 {
12541 return false;
12542 }
12543 }
12544
12545
12547 {
12549 {
12551 }
12552 }
12553
12554
12556 {
12558 }
12559
12561 {
12563 }
12564
12565 override void InsertAgent(
int agent,
float count = 1)
12566 {
12567 if (count < 1)
12568 return;
12569
12571 }
12572
12575 {
12577 }
12578
12579
12581 {
12583 }
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12627 {
12629 return false;
12630 return true;
12631 }
12632
12634 {
12635
12637 }
12638
12639
12642 {
12643 super.CheckForRoofLimited(timeTresholdMS);
12644
12646 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12647 {
12648 m_PreviousRoofTestTime = time;
12649 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12650 }
12651 }
12652
12653
12655 {
12657 {
12658 return 0;
12659 }
12660
12661 if (GetInventory().GetAttachmentSlotsCount() != 0)
12662 {
12663 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12664 if (filter)
12665 return filter.GetProtectionLevel(type, false, system);
12666 else
12667 return 0;
12668 }
12669
12670 string subclassPath, entryName;
12671
12672 switch (type)
12673 {
12675 entryName = "biological";
12676 break;
12678 entryName = "chemical";
12679 break;
12680 default:
12681 entryName = "biological";
12682 break;
12683 }
12684
12685 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12686
12688 }
12689
12690
12691
12694 {
12695 if (!IsMagazine())
12697
12699 }
12700
12701
12702
12703
12704
12709 {
12710 return true;
12711 }
12712
12714 {
12716 }
12717
12718
12719
12720
12721
12723 {
12724 if (parent)
12725 {
12726 if (parent.IsInherited(DayZInfected))
12727 return true;
12728
12729 if (!parent.IsRuined())
12730 return true;
12731 }
12732
12733 return true;
12734 }
12735
12737 {
12738 if (!super.CanPutAsAttachment(parent))
12739 {
12740 return false;
12741 }
12742
12743 if (!IsRuined() && !parent.IsRuined())
12744 {
12745 return true;
12746 }
12747
12748 return false;
12749 }
12750
12752 {
12753
12754
12755
12756
12757 return super.CanReceiveItemIntoCargo(item);
12758 }
12759
12761 {
12762
12763
12764
12765
12766 GameInventory attachmentInv = attachment.GetInventory();
12768 {
12769 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12770 return false;
12771 }
12772
12773 InventoryLocation loc = new InventoryLocation();
12774 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12775 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12776 return false;
12777
12778 return super.CanReceiveAttachment(attachment, slotId);
12779 }
12780
12782 {
12783 if (!super.CanReleaseAttachment(attachment))
12784 return false;
12785
12786 return GetInventory().AreChildrenAccessible();
12787 }
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12810 {
12811 int id = muzzle_owner.GetMuzzleID();
12812 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12813
12814 if (WPOF_array)
12815 {
12816 for (int i = 0; i < WPOF_array.Count(); i++)
12817 {
12818 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12819
12820 if (WPOF)
12821 {
12822 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12823 }
12824 }
12825 }
12826 }
12827
12828
12830 {
12831 int id = muzzle_owner.GetMuzzleID();
12833
12834 if (WPOBE_array)
12835 {
12836 for (int i = 0; i < WPOBE_array.Count(); i++)
12837 {
12838 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12839
12840 if (WPOBE)
12841 {
12842 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12843 }
12844 }
12845 }
12846 }
12847
12848
12850 {
12851 int id = muzzle_owner.GetMuzzleID();
12852 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12853
12854 if (WPOOH_array)
12855 {
12856 for (int i = 0; i < WPOOH_array.Count(); i++)
12857 {
12858 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12859
12860 if (WPOOH)
12861 {
12862 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12863 }
12864 }
12865 }
12866 }
12867
12868
12870 {
12871 int id = muzzle_owner.GetMuzzleID();
12872 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12873
12874 if (WPOOH_array)
12875 {
12876 for (int i = 0; i < WPOOH_array.Count(); i++)
12877 {
12878 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12879
12880 if (WPOOH)
12881 {
12882 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12883 }
12884 }
12885 }
12886 }
12887
12888
12890 {
12891 int id = muzzle_owner.GetMuzzleID();
12892 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12893
12894 if (WPOOH_array)
12895 {
12896 for (int i = 0; i < WPOOH_array.Count(); i++)
12897 {
12898 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12899
12900 if (WPOOH)
12901 {
12902 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12903 }
12904 }
12905 }
12906 }
12907
12908
12909
12911 {
12913 {
12914 return true;
12915 }
12916
12917 return false;
12918 }
12919
12921 {
12923 {
12924 return true;
12925 }
12926
12927 return false;
12928 }
12929
12931 {
12933 {
12934 return true;
12935 }
12936
12937 return false;
12938 }
12939
12941 {
12942 return false;
12943 }
12944
12947 {
12948 return UATimeSpent.DEFAULT_DEPLOY;
12949 }
12950
12951
12952
12953
12955 {
12957 SetSynchDirty();
12958 }
12959
12961 {
12963 }
12964
12965
12967 {
12968 return false;
12969 }
12970
12973 {
12974 string att_type = "None";
12975
12976 if (ConfigIsExisting("soundAttType"))
12977 {
12978 att_type = ConfigGetString("soundAttType");
12979 }
12980
12982 }
12983
12985 {
12987 }
12988
12989
12990
12991
12992
12998
13000 {
13003
13005 }
13006
13007
13009 {
13011 return;
13012
13014
13017
13020
13021 SoundParameters params = new SoundParameters();
13025 }
13026
13027
13029 {
13031 return;
13032
13034 SetSynchDirty();
13035
13038 }
13039
13040
13042 {
13044 return;
13045
13047 SetSynchDirty();
13048
13051 }
13052
13054 {
13056 }
13057
13059 {
13061 }
13062
13065 {
13066 if (!
GetGame().IsDedicatedServer())
13067 {
13068 if (ConfigIsExisting("attachSoundSet"))
13069 {
13070 string cfg_path = "";
13071 string soundset = "";
13072 string type_name =
GetType();
13073
13076 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13077 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13078
13079 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13080 {
13081 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13082 {
13083 if (cfg_slot_array[i] == slot_type)
13084 {
13085 soundset = cfg_soundset_array[i];
13086 break;
13087 }
13088 }
13089 }
13090
13091 if (soundset != "")
13092 {
13093 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13095 }
13096 }
13097 }
13098 }
13099
13101 {
13102
13103 }
13104
13105 void OnApply(PlayerBase player);
13106
13108 {
13109 return 1.0;
13110 };
13111
13113 {
13115 }
13116
13118 {
13120 }
13121
13123
13125 {
13126 SetDynamicPhysicsLifeTime(0.01);
13128 }
13129
13131 {
13132 array<string> zone_names = new array<string>;
13133 GetDamageZones(zone_names);
13134 for (int i = 0; i < zone_names.Count(); i++)
13135 {
13136 SetHealthMax(zone_names.Get(i),"Health");
13137 }
13138 SetHealthMax("","Health");
13139 }
13140
13143 {
13144 float global_health = GetHealth01("","Health");
13145 array<string> zones = new array<string>;
13146 GetDamageZones(zones);
13147
13148 for (int i = 0; i < zones.Count(); i++)
13149 {
13150 SetHealth01(zones.Get(i),"Health",global_health);
13151 }
13152 }
13153
13156 {
13157 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13158 }
13159
13161 {
13162 if (!hasRootAsPlayer)
13163 {
13164 if (refParentIB)
13165 {
13166
13167 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13168 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13169
13170 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13171 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13172
13175 }
13176 else
13177 {
13178
13181 }
13182 }
13183 }
13184
13186 {
13188 {
13189 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13190 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13191 {
13192 float heatPermCoef = 1.0;
13194 while (ent)
13195 {
13196 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13197 ent = ent.GetHierarchyParent();
13198 }
13199
13200 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13201 }
13202 }
13203 }
13204
13206 {
13207
13208 EntityAI parent = GetHierarchyParent();
13209 if (!parent)
13210 {
13211 hasParent = false;
13212 hasRootAsPlayer = false;
13213 }
13214 else
13215 {
13216 hasParent = true;
13217 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13218 refParentIB =
ItemBase.Cast(parent);
13219 }
13220 }
13221
13222 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13223 {
13224
13225 }
13226
13228 {
13229
13230 return false;
13231 }
13232
13234 {
13235
13236
13237 return false;
13238 }
13239
13241 {
13242
13243 return false;
13244 }
13245
13248 {
13249 return !GetIsFrozen() &&
IsOpen();
13250 }
13251
13253 {
13254 bool hasParent = false, hasRootAsPlayer = false;
13256
13257 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13258 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13259
13260 if (wwtu || foodDecay)
13261 {
13265
13266 if (processWetness || processTemperature || processDecay)
13267 {
13269
13270 if (processWetness)
13271 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13272
13273 if (processTemperature)
13275
13276 if (processDecay)
13277 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13278 }
13279 }
13280 }
13281
13284 {
13286 }
13287
13289 {
13292
13293 return super.GetTemperatureFreezeThreshold();
13294 }
13295
13297 {
13300
13301 return super.GetTemperatureThawThreshold();
13302 }
13303
13305 {
13308
13309 return super.GetItemOverheatThreshold();
13310 }
13311
13313 {
13315 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13316
13317 return super.GetTemperatureFreezeTime();
13318 }
13319
13321 {
13323 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13324
13325 return super.GetTemperatureThawTime();
13326 }
13327
13332
13334 {
13335 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13336 }
13337
13339 {
13340 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13341 }
13342
13345 {
13347 }
13348
13350 {
13352 }
13353
13355 {
13357 }
13358
13361 {
13362 return null;
13363 }
13364
13367 {
13368 return false;
13369 }
13370
13372 {
13374 {
13377 if (!trg)
13378 {
13380 explosive = this;
13381 }
13382
13383 explosive.PairRemote(trg);
13385
13386 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13387 trg.SetPersistentPairID(persistentID);
13388 explosive.SetPersistentPairID(persistentID);
13389
13390 return true;
13391 }
13392 return false;
13393 }
13394
13397 {
13398 float ret = 1.0;
13401 ret *= GetHealth01();
13402
13403 return ret;
13404 }
13405
13406 #ifdef DEVELOPER
13407 override void SetDebugItem()
13408 {
13409 super.SetDebugItem();
13410 _itemBase = this;
13411 }
13412
13414 {
13415 string text = super.GetDebugText();
13416
13418 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13419
13420 return text;
13421 }
13422 #endif
13423
13425 {
13426 return true;
13427 }
13428
13430
13432
13434 {
13437 }
13438
13439
13447
13463}
13464
13466{
13468 if (entity)
13469 {
13470 bool is_item = entity.IsInherited(
ItemBase);
13471 if (is_item && full_quantity)
13472 {
13475 }
13476 }
13477 else
13478 {
13480 return NULL;
13481 }
13482 return entity;
13483}
13484
13486{
13487 if (item)
13488 {
13489 if (health > 0)
13490 item.SetHealth("", "", health);
13491
13492 if (item.CanHaveTemperature())
13493 {
13495 if (item.CanFreeze())
13496 item.SetFrozen(false);
13497 }
13498
13499 if (item.HasEnergyManager())
13500 {
13501 if (quantity >= 0)
13502 {
13503 item.GetCompEM().SetEnergy0To1(quantity);
13504 }
13505 else
13506 {
13508 }
13509 }
13510 else if (item.IsMagazine())
13511 {
13512 Magazine mag = Magazine.Cast(item);
13513 if (quantity >= 0)
13514 {
13515 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13516 }
13517 else
13518 {
13520 }
13521
13522 }
13523 else
13524 {
13525 if (quantity >= 0)
13526 {
13527 item.SetQuantityNormalized(quantity, false);
13528 }
13529 else
13530 {
13532 }
13533
13534 }
13535 }
13536}
13537
13538#ifdef DEVELOPER
13540#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.