8652{
8654 {
8655 return true;
8656 }
8657};
8658
8659
8660
8662{
8666
8668
8671
8672
8673
8674
8675
8684
8690
8695
8700
8721 protected bool m_IsResultOfSplit
8722
8724
8729
8730
8731
8733
8737
8738
8739
8741
8744
8745
8746
8752
8753
8761
8764
8765
8767
8768
8770
8771
8776
8777
8782
8783
8785
8786
8788 {
8793
8794 if (!
GetGame().IsDedicatedServer())
8795 {
8797 {
8799
8801 {
8803 }
8804 }
8805
8808 }
8809
8810 m_OldLocation = null;
8811
8813 {
8815 }
8816
8817 if (ConfigIsExisting("headSelectionsToHide"))
8818 {
8821 }
8822
8824 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8825 {
8827 }
8828
8830
8831 m_IsResultOfSplit = false;
8832
8834 }
8835
8837 {
8838 super.InitItemVariables();
8839
8845 m_Count = ConfigGetInt(
"count");
8846
8849
8854
8857
8862
8874
8878
8879
8882 if (ConfigIsExisting("canBeSplit"))
8883 {
8886 }
8887
8889 if (ConfigIsExisting("itemBehaviour"))
8891
8892
8895 RegisterNetSyncVariableInt("m_VarLiquidType");
8896 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8897
8898 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8899 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8900 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8901
8902 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8903 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8904 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8905 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8906
8907 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8908 RegisterNetSyncVariableBool("m_IsTakeable");
8909 RegisterNetSyncVariableBool("m_IsHologram");
8910
8913 {
8916 }
8917
8919
8921 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8923
8924 }
8925
8927 {
8929 }
8930
8932 {
8935 {
8940 }
8941 }
8942
8943 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8944 {
8946 {
8949 }
8950
8952 }
8953
8955 {
8961 }
8962
8964
8966 {
8968
8969 if (!action)
8970 {
8971 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8972 return;
8973 }
8974
8976 if (!ai)
8977 {
8979 return;
8980 }
8981
8983 if (!action_array)
8984 {
8985 action_array = new array<ActionBase_Basic>;
8987 }
8988 if (LogManager.IsActionLogEnable())
8989 {
8990 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8991 }
8992
8993 if (action_array.Find(action) != -1)
8994 {
8995 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8996 }
8997 else
8998 {
8999 action_array.Insert(action);
9000 }
9001 }
9002
9004 {
9006 ActionBase action = player.GetActionManager().GetAction(actionName);
9009
9010 if (action_array)
9011 {
9012 action_array.RemoveItem(action);
9013 }
9014 }
9015
9016
9017
9019 {
9020 ActionOverrideData overrideData = new ActionOverrideData();
9024
9026 if (!actionMap)
9027 {
9030 }
9031
9032 actionMap.Insert(this.
Type(), overrideData);
9033
9034 }
9035
9037
9039
9040
9042 {
9045
9048
9049 string config_to_search = "CfgVehicles";
9050 string muzzle_owner_config;
9051
9053 {
9054 if (IsInherited(Weapon))
9055 config_to_search = "CfgWeapons";
9056
9057 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9058
9059 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9060
9062
9063 if (config_OnFire_subclass_count > 0)
9064 {
9065 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9066
9067 for (int i = 0; i < config_OnFire_subclass_count; i++)
9068 {
9069 string particle_class = "";
9071 string config_OnFire_entry = config_OnFire_class + particle_class;
9072 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9073 WPOF_array.Insert(WPOF);
9074 }
9075
9076
9078 }
9079 }
9080
9082 {
9083 config_to_search = "CfgWeapons";
9084 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9085
9086 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9087
9089
9090 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9091 {
9092 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9093
9094 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9095 {
9096 string particle_class2 = "";
9098 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9099 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9100 WPOBE_array.Insert(WPOBE);
9101 }
9102
9103
9105 }
9106 }
9107 }
9108
9109
9111 {
9114
9116 {
9117 string config_to_search = "CfgVehicles";
9118
9119 if (IsInherited(Weapon))
9120 config_to_search = "CfgWeapons";
9121
9122 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9123 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9124
9125 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9126 {
9127
9129
9131 {
9133 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9135 return;
9136 }
9137
9140
9141
9142
9144 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9145
9146 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9147 {
9148 string particle_class = "";
9150 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9152
9153 if (entry_type == CT_CLASS)
9154 {
9155 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9156 WPOOH_array.Insert(WPOF);
9157 }
9158 }
9159
9160
9162 }
9163 }
9164 }
9165
9167 {
9169 }
9170
9172 {
9174 {
9176
9179
9182
9183 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9184 }
9185 }
9186
9188 {
9190 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9191
9193 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9194
9196 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9197
9199 {
9201 }
9202 }
9203
9205 {
9207 }
9208
9210 {
9213 else
9215
9217 {
9220 }
9221 else
9222 {
9225
9228 }
9229
9231 }
9232
9234 {
9236 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9237 }
9238
9240 {
9242 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9244 }
9245
9247 {
9249 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9250 }
9251
9253 {
9256
9257 OverheatingParticle OP = new OverheatingParticle();
9262
9264 }
9265
9267 {
9270
9271 return -1;
9272 }
9273
9275 {
9277 {
9280
9281 for (int i = count; i > 0; --i)
9282 {
9283 int id = i - 1;
9286
9289
9290 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9291 {
9292 if (p)
9293 {
9296 }
9297 }
9298 }
9299 }
9300 }
9301
9303 {
9305 {
9307 {
9308 int id = i - 1;
9310
9311 if (OP)
9312 {
9314
9315 if (p)
9316 {
9318 }
9319
9320 delete OP;
9321 }
9322 }
9323
9326 }
9327 }
9328
9331 {
9332 return 0.0;
9333 }
9334
9335
9337 {
9338 return 250;
9339 }
9340
9342 {
9343 return 0;
9344 }
9345
9348 {
9350 return true;
9351
9352 return false;
9353 }
9354
9357 {
9360
9362 {
9364 }
9365 else
9366 {
9367
9369 }
9370
9372 }
9373
9380 {
9381 return -1;
9382 }
9383
9384
9385
9386
9388 {
9390 {
9392 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9393
9394 if (r_index >= 0)
9395 {
9396 InventoryLocation r_il = new InventoryLocation;
9397 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9398
9399 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9402 {
9403 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9404 }
9406 {
9407 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9408 }
9409
9410 }
9411
9412 player.GetHumanInventory().ClearUserReservedLocation(this);
9413 }
9414
9417 }
9418
9419
9420
9421
9423 {
9424 return ItemBase.m_DebugActionsMask;
9425 }
9426
9428 {
9429 return ItemBase.m_DebugActionsMask & mask;
9430 }
9431
9433 {
9434 ItemBase.m_DebugActionsMask = mask;
9435 }
9436
9438 {
9439 ItemBase.m_DebugActionsMask |= mask;
9440 }
9441
9443 {
9444 ItemBase.m_DebugActionsMask &= ~mask;
9445 }
9446
9448 {
9450 {
9452 }
9453 else
9454 {
9456 }
9457 }
9458
9459
9461 {
9462 if (GetEconomyProfile())
9463 {
9464 float q_max = GetEconomyProfile().GetQuantityMax();
9465 if (q_max > 0)
9466 {
9467 float q_min = GetEconomyProfile().GetQuantityMin();
9468 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9469
9471 {
9472 ComponentEnergyManager comp = GetCompEM();
9474 {
9476 }
9477 }
9479 {
9481
9482 }
9483
9484 }
9485 }
9486 }
9487
9490 {
9491 EntityAI parent = GetHierarchyParent();
9492
9493 if (parent)
9494 {
9495 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9496 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9497 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9498 }
9499 }
9500
9503 {
9504 EntityAI parent = GetHierarchyParent();
9505
9506 if (parent)
9507 {
9508 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9509 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9510 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9511 }
9512 }
9513
9515 {
9516
9517
9518
9519
9521
9523 {
9524 if (ScriptInputUserData.CanStoreInputUserData())
9525 {
9526 ScriptInputUserData ctx = new ScriptInputUserData;
9532 ctx.
Write(use_stack_max);
9535
9537 {
9538 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9539 }
9540 }
9541 }
9542 else if (!
GetGame().IsMultiplayer())
9543 {
9545 }
9546 }
9547
9549 {
9551 }
9552
9554 {
9556 }
9557
9559 {
9561 }
9562
9564 {
9565
9566 return false;
9567 }
9568
9570 {
9571 return false;
9572 }
9573
9577 {
9578 return false;
9579 }
9580
9582 {
9583 return "";
9584 }
9585
9587
9589 {
9590 return false;
9591 }
9592
9594 {
9595 return true;
9596 }
9597
9598
9599
9601 {
9602 return true;
9603 }
9604
9606 {
9607 return true;
9608 }
9609
9611 {
9612 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9614 }
9615
9617 {
9619 }
9620
9622 {
9624 if (!is_being_placed)
9626 SetSynchDirty();
9627 }
9628
9629
9631
9633 {
9635 }
9636
9638 {
9640 }
9641
9643 {
9644 return 1;
9645 }
9646
9648 {
9649 return false;
9650 }
9651
9653 {
9655 SetSynchDirty();
9656 }
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9693 {
9694 super.OnMovedInsideCargo(container);
9695
9696 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9697 }
9698
9699 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9700 {
9701 super.EEItemLocationChanged(oldLoc,newLoc);
9702
9703 PlayerBase new_player = null;
9704 PlayerBase old_player = null;
9705
9706 if (newLoc.GetParent())
9707 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9708
9709 if (oldLoc.GetParent())
9710 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9711
9713 {
9714 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9715
9716 if (r_index >= 0)
9717 {
9718 InventoryLocation r_il = new InventoryLocation;
9719 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9720
9721 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9724 {
9725 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9726 }
9728 {
9729 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9730 }
9731
9732 }
9733 }
9734
9736 {
9737 if (new_player)
9738 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9739
9740 if (new_player == old_player)
9741 {
9742
9743 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9744 {
9746 {
9747 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9748 {
9749 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9750 }
9751 }
9752 else
9753 {
9754 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9755 }
9756 }
9757
9758 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9759 {
9760 int type = oldLoc.GetType();
9762 {
9763 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9764 }
9766 {
9767 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9768 }
9769 }
9770 if (!m_OldLocation)
9771 {
9772 m_OldLocation = new InventoryLocation;
9773 }
9774 m_OldLocation.Copy(oldLoc);
9775 }
9776 else
9777 {
9778 if (m_OldLocation)
9779 {
9780 m_OldLocation.Reset();
9781 }
9782 }
9783
9785 }
9786 else
9787 {
9788 if (new_player)
9789 {
9790 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9791 if (res_index >= 0)
9792 {
9793 InventoryLocation il = new InventoryLocation;
9794 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9796 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9799 {
9800 il.
GetParent().GetOnReleaseLock().Invoke(it);
9801 }
9803 {
9805 }
9806
9807 }
9808 }
9810 {
9811
9813 }
9814
9815 if (m_OldLocation)
9816 {
9817 m_OldLocation.Reset();
9818 }
9819 }
9820 }
9821
9822 override void EOnContact(IEntity other, Contact extra)
9823 {
9825 {
9826 int liquidType = -1;
9828 if (impactSpeed > 0.0)
9829 {
9831 #ifndef SERVER
9833 #else
9835 SetSynchDirty();
9836 #endif
9838 }
9839 }
9840
9841 #ifdef SERVER
9842 if (GetCompEM() && GetCompEM().IsPlugged())
9843 {
9844 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9845 GetCompEM().UnplugThis();
9846 }
9847 #endif
9848 }
9849
9851
9853 {
9855 }
9856
9858 {
9859
9860 }
9861
9863 {
9864 super.OnItemLocationChanged(old_owner, new_owner);
9865
9866 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9867 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9868
9869 if (!relatedPlayer && playerNew)
9870 relatedPlayer = playerNew;
9871
9872 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9873 {
9875 if (actionMgr)
9876 {
9877 ActionBase currentAction = actionMgr.GetRunningAction();
9878 if (currentAction)
9880 }
9881 }
9882
9883 Man ownerPlayerOld = null;
9884 Man ownerPlayerNew = null;
9885
9886 if (old_owner)
9887 {
9888 if (old_owner.
IsMan())
9889 {
9890 ownerPlayerOld = Man.Cast(old_owner);
9891 }
9892 else
9893 {
9894 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9895 }
9896 }
9897 else
9898 {
9900 {
9902
9903 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9904 {
9905 GetCompEM().UnplugThis();
9906 }
9907 }
9908 }
9909
9910 if (new_owner)
9911 {
9912 if (new_owner.
IsMan())
9913 {
9914 ownerPlayerNew = Man.Cast(new_owner);
9915 }
9916 else
9917 {
9918 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9919 }
9920 }
9921
9922 if (ownerPlayerOld != ownerPlayerNew)
9923 {
9924 if (ownerPlayerOld)
9925 {
9926 array<EntityAI> subItemsExit = new array<EntityAI>;
9928 for (int i = 0; i < subItemsExit.Count(); i++)
9929 {
9932 }
9933 }
9934
9935 if (ownerPlayerNew)
9936 {
9937 array<EntityAI> subItemsEnter = new array<EntityAI>;
9939 for (int j = 0; j < subItemsEnter.Count(); j++)
9940 {
9943 }
9944 }
9945 }
9946 else if (ownerPlayerNew != null)
9947 {
9948 PlayerBase nplayer;
9949 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9950 {
9951 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9953 for (int k = 0; k < subItemsUpdate.Count(); k++)
9954 {
9956 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9957 }
9958 }
9959 }
9960
9961 if (old_owner)
9962 old_owner.OnChildItemRemoved(this);
9963 if (new_owner)
9964 new_owner.OnChildItemReceived(this);
9965 }
9966
9967
9969 {
9970 super.EEDelete(parent);
9971 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9972 if (player)
9973 {
9975
9976 if (player.IsAlive())
9977 {
9978 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9979 if (r_index >= 0)
9980 {
9981 InventoryLocation r_il = new InventoryLocation;
9982 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9983
9984 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9987 {
9988 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9989 }
9991 {
9992 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9993 }
9994
9995 }
9996
9997 player.RemoveQuickBarEntityShortcut(this);
9998 }
9999 }
10000 }
10001
10003 {
10004 super.EEKilled(killer);
10005
10008 {
10009 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10010 {
10011 if (IsMagazine())
10012 {
10013 if (Magazine.Cast(this).GetAmmoCount() > 0)
10014 {
10016 }
10017 }
10018 else
10019 {
10021 }
10022 }
10023 }
10024 }
10025
10027 {
10028 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10029
10030 super.OnWasAttached(parent, slot_id);
10031
10034
10036 }
10037
10039 {
10040 super.OnWasDetached(parent, slot_id);
10041
10044 }
10045
10047 {
10048 int idx;
10051
10052 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10053 if (inventory_slots.Count() < 1)
10054 {
10055 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10056 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10057 }
10058 else
10059 {
10060 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10061 }
10062
10063 idx = inventory_slots.Find(slot);
10064 if (idx < 0)
10065 return "";
10066
10067 return attach_types.Get(idx);
10068 }
10069
10071 {
10072 int idx = -1;
10073 string slot;
10074
10077
10078 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10079 if (inventory_slots.Count() < 1)
10080 {
10081 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10082 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10083 }
10084 else
10085 {
10086 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10087 if (detach_types.Count() < 1)
10088 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10089 }
10090
10091 for (int i = 0; i < inventory_slots.Count(); i++)
10092 {
10093 slot = inventory_slots.Get(i);
10094 }
10095
10096 if (slot != "")
10097 {
10098 if (detach_types.Count() == 1)
10099 idx = 0;
10100 else
10101 idx = inventory_slots.Find(slot);
10102 }
10103 if (idx < 0)
10104 return "";
10105
10106 return detach_types.Get(idx);
10107 }
10108
10110 {
10111
10113
10114
10115 float min_time = 1;
10116 float max_time = 3;
10117 float delay = Math.RandomFloat(min_time, max_time);
10118
10119 explode_timer.Run(delay, this, "DoAmmoExplosion");
10120 }
10121
10123 {
10124 Magazine magazine = Magazine.Cast(this);
10125 int pop_sounds_count = 6;
10126 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10127
10128
10129 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10130 string sound_name = pop_sounds[ sound_idx ];
10132
10133
10134 magazine.ServerAddAmmoCount(-1);
10135
10136
10137 float min_temp_to_explode = 100;
10138
10139 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10140 {
10142 }
10143 }
10144
10145
10146 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10147 {
10148 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10149
10150 const int CHANCE_DAMAGE_CARGO = 4;
10151 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10152 const int CHANCE_DAMAGE_NOTHING = 2;
10153
10155 {
10156 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10157 int chances;
10158 int rnd;
10159
10160 if (GetInventory().GetCargo())
10161 {
10162 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10163 rnd = Math.RandomInt(0,chances);
10164
10165 if (rnd < CHANCE_DAMAGE_CARGO)
10166 {
10168 }
10169 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10170 {
10172 }
10173 }
10174 else
10175 {
10176 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10177 rnd = Math.RandomInt(0,chances);
10178
10179 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10180 {
10182 }
10183 }
10184 }
10185 }
10186
10188 {
10189 if (GetInventory().GetCargo())
10190 {
10191 int item_count = GetInventory().GetCargo().GetItemCount();
10192 if (item_count > 0)
10193 {
10194 int random_pick = Math.RandomInt(0, item_count);
10196 if (!item.IsExplosive())
10197 {
10198 item.AddHealth("","",damage);
10199 return true;
10200 }
10201 }
10202 }
10203 return false;
10204 }
10205
10207 {
10208 int attachment_count = GetInventory().AttachmentCount();
10209 if (attachment_count > 0)
10210 {
10211 int random_pick = Math.RandomInt(0, attachment_count);
10212 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10213 if (!attachment.IsExplosive())
10214 {
10215 attachment.AddHealth("","",damage);
10216 return true;
10217 }
10218 }
10219 return false;
10220 }
10221
10223 {
10225 }
10226
10228 {
10230 return GetInventory().CanRemoveEntity();
10231
10232 return false;
10233 }
10234
10236 {
10238 return;
10239
10241 {
10242 if (ScriptInputUserData.CanStoreInputUserData())
10243 {
10244 ScriptInputUserData ctx = new ScriptInputUserData;
10249 ctx.
Write(destination_entity);
10251 ctx.
Write(slot_id);
10253 }
10254 }
10255 else if (!
GetGame().IsMultiplayer())
10256 {
10258 }
10259 }
10260
10262 {
10264 return;
10265
10266 float split_quantity_new;
10270 InventoryLocation loc = new InventoryLocation;
10271
10272 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10273 {
10275 split_quantity_new = stack_max;
10276 else
10278
10279 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10280 if (new_item)
10281 {
10282 new_item.SetResultOfSplit(true);
10283 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10285 new_item.SetQuantity(split_quantity_new);
10286 }
10287 }
10288 else if (destination_entity && slot_id == -1)
10289 {
10290 if (quantity > stack_max)
10291 split_quantity_new = stack_max;
10292 else
10293 split_quantity_new = quantity;
10294
10296 {
10299 }
10300
10301 if (new_item)
10302 {
10303 new_item.SetResultOfSplit(true);
10304 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10306 new_item.SetQuantity(split_quantity_new);
10307 }
10308 }
10309 else
10310 {
10311 if (stack_max != 0)
10312 {
10314 {
10316 }
10317
10318 if (split_quantity_new == 0)
10319 {
10320 if (!
GetGame().IsMultiplayer())
10321 player.PhysicalPredictiveDropItem(this);
10322 else
10323 player.ServerDropEntity(this);
10324 return;
10325 }
10326
10328
10329 if (new_item)
10330 {
10331 new_item.SetResultOfSplit(true);
10332 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10334 new_item.SetQuantity(stack_max);
10335 new_item.PlaceOnSurface();
10336 }
10337 }
10338 }
10339 }
10340
10342 {
10344 return;
10345
10346 float split_quantity_new;
10350 InventoryLocation loc = new InventoryLocation;
10351
10352 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10353 {
10355 split_quantity_new = stack_max;
10356 else
10358
10359 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10360 if (new_item)
10361 {
10362 new_item.SetResultOfSplit(true);
10363 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10365 new_item.SetQuantity(split_quantity_new);
10366 }
10367 }
10368 else if (destination_entity && slot_id == -1)
10369 {
10370 if (quantity > stack_max)
10371 split_quantity_new = stack_max;
10372 else
10373 split_quantity_new = quantity;
10374
10376 {
10379 }
10380
10381 if (new_item)
10382 {
10383 new_item.SetResultOfSplit(true);
10384 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10386 new_item.SetQuantity(split_quantity_new);
10387 }
10388 }
10389 else
10390 {
10391 if (stack_max != 0)
10392 {
10394 {
10396 }
10397
10399
10400 if (new_item)
10401 {
10402 new_item.SetResultOfSplit(true);
10403 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10405 new_item.SetQuantity(stack_max);
10406 new_item.PlaceOnSurface();
10407 }
10408 }
10409 }
10410 }
10411
10413 {
10415 return;
10416
10418 {
10419 if (ScriptInputUserData.CanStoreInputUserData())
10420 {
10421 ScriptInputUserData ctx = new ScriptInputUserData;
10426 dst.WriteToContext(ctx);
10428 }
10429 }
10430 else if (!
GetGame().IsMultiplayer())
10431 {
10433 }
10434 }
10435
10437 {
10439 return;
10440
10442 {
10443 if (ScriptInputUserData.CanStoreInputUserData())
10444 {
10445 ScriptInputUserData ctx = new ScriptInputUserData;
10450 ctx.
Write(destination_entity);
10456 }
10457 }
10458 else if (!
GetGame().IsMultiplayer())
10459 {
10461 }
10462 }
10463
10465 {
10467 }
10468
10470 {
10472 return this;
10473
10475 float split_quantity_new;
10477 if (dst.IsValid())
10478 {
10479 int slot_id = dst.GetSlot();
10481
10482 if (quantity > stack_max)
10483 split_quantity_new = stack_max;
10484 else
10485 split_quantity_new = quantity;
10486
10488
10489 if (new_item)
10490 {
10491 new_item.SetResultOfSplit(true);
10492 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10495 }
10496
10497 return new_item;
10498 }
10499
10500 return null;
10501 }
10502
10504 {
10506 return;
10507
10509 float split_quantity_new;
10511 if (destination_entity)
10512 {
10514 if (quantity > stackable)
10515 split_quantity_new = stackable;
10516 else
10517 split_quantity_new = quantity;
10518
10519 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10520 if (new_item)
10521 {
10522 new_item.SetResultOfSplit(true);
10523 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10525 new_item.SetQuantity(split_quantity_new);
10526 }
10527 }
10528 }
10529
10531 {
10533 return;
10534
10536 {
10537 if (ScriptInputUserData.CanStoreInputUserData())
10538 {
10539 ScriptInputUserData ctx = new ScriptInputUserData;
10544 ItemBase destination_entity =
this;
10545 ctx.
Write(destination_entity);
10549 }
10550 }
10551 else if (!
GetGame().IsMultiplayer())
10552 {
10554 }
10555 }
10556
10558 {
10560 return;
10561
10563 float split_quantity_new;
10565 if (player)
10566 {
10568 if (quantity > stackable)
10569 split_quantity_new = stackable;
10570 else
10571 split_quantity_new = quantity;
10572
10573 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10574 new_item =
ItemBase.Cast(in_hands);
10575 if (new_item)
10576 {
10577 new_item.SetResultOfSplit(true);
10578 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10580 new_item.SetQuantity(split_quantity_new);
10581 }
10582 }
10583 }
10584
10586 {
10588 return;
10589
10591 float split_quantity_new = Math.Floor(quantity * 0.5);
10592
10594
10595 if (new_item)
10596 {
10597 if (new_item.GetQuantityMax() < split_quantity_new)
10598 {
10599 split_quantity_new = new_item.GetQuantityMax();
10600 }
10601
10602 new_item.SetResultOfSplit(true);
10603 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10604
10606 {
10609 }
10610 else
10611 {
10614 }
10615 }
10616 }
10617
10619 {
10621 return;
10622
10624 float split_quantity_new = Math.Floor(quantity / 2);
10625
10626 InventoryLocation invloc = new InventoryLocation;
10628
10630 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10631
10632 if (new_item)
10633 {
10634 if (new_item.GetQuantityMax() < split_quantity_new)
10635 {
10636 split_quantity_new = new_item.GetQuantityMax();
10637 }
10639 {
10642 }
10643 else
10644 {
10647 }
10648 }
10649 }
10650
10653 {
10654 SetWeightDirty();
10656
10657 if (parent)
10658 parent.OnAttachmentQuantityChangedEx(this, delta);
10659
10661 {
10663 {
10665 }
10667 {
10668 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10670 }
10671 }
10672
10673 }
10674
10677 {
10678
10679 }
10680
10683 {
10685 }
10686
10688 {
10689 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10690
10692 {
10693 if (newLevel == GameConstants.STATE_RUINED)
10694 {
10696 EntityAI parent = GetHierarchyParent();
10697 if (parent && parent.IsFireplace())
10698 {
10699 CargoBase cargo = GetInventory().GetCargo();
10700 if (cargo)
10701 {
10703 {
10705 }
10706 }
10707 }
10708 }
10709
10711 {
10712
10714 return;
10715 }
10716
10717 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10718 {
10720 }
10721 }
10722 }
10723
10724
10726 {
10727 super.OnRightClick();
10728
10730 {
10732 {
10733 if (ScriptInputUserData.CanStoreInputUserData())
10734 {
10735 vector m4[4];
10737
10738 EntityAI root = GetHierarchyRoot();
10739
10740 InventoryLocation dst = new InventoryLocation;
10742 {
10743 if (root)
10744 {
10745 root.GetTransform(m4);
10747 }
10748 else
10749 GetInventory().GetCurrentInventoryLocation(dst);
10750 }
10751 else
10752 {
10754
10755
10756 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10757 {
10758 if (root)
10759 {
10760 root.GetTransform(m4);
10762 }
10763 else
10764 GetInventory().GetCurrentInventoryLocation(dst);
10765 }
10766 else
10767 {
10768 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10769 }
10770 }
10771
10772 ScriptInputUserData ctx = new ScriptInputUserData;
10780 }
10781 }
10782 else if (!
GetGame().IsMultiplayer())
10783 {
10785 }
10786 }
10787 }
10788
10789 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10790 {
10791
10792 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10793 return false;
10794
10795 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10796 return false;
10797
10798
10800 return false;
10801
10802
10803 Magazine mag = Magazine.Cast(this);
10804 if (mag)
10805 {
10806 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10807 return false;
10808
10809 if (stack_max_limit)
10810 {
10811 Magazine other_mag = Magazine.Cast(other_item);
10812 if (other_item)
10813 {
10814 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10815 return false;
10816 }
10817
10818 }
10819 }
10820 else
10821 {
10822
10824 return false;
10825
10827 return false;
10828 }
10829
10830 PlayerBase player = null;
10831 if (CastTo(player, GetHierarchyRootPlayer()))
10832 {
10833 if (player.GetInventory().HasAttachment(this))
10834 return false;
10835
10836 if (player.IsItemsToDelete())
10837 return false;
10838 }
10839
10840 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10841 return false;
10842
10843 int slotID;
10845 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10846 return false;
10847
10848 return true;
10849 }
10850
10852 {
10854 }
10855
10857 {
10858 return m_IsResultOfSplit;
10859 }
10860
10862 {
10863 m_IsResultOfSplit = value;
10864 }
10865
10867 {
10869 }
10870
10872 {
10873 float other_item_quantity = other_item.GetQuantity();
10874 float this_free_space;
10875
10877
10879
10880 if (other_item_quantity > this_free_space)
10881 {
10882 return this_free_space;
10883 }
10884 else
10885 {
10886 return other_item_quantity;
10887 }
10888 }
10889
10891 {
10893 }
10894
10896 {
10898 return;
10899
10900 if (!IsMagazine() && other_item)
10901 {
10903 if (quantity_used != 0)
10904 {
10905 float hp1 = GetHealth01("","");
10906 float hp2 = other_item.GetHealth01("","");
10907 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10908 hpResult = hpResult / (
GetQuantity() + quantity_used);
10909
10910 hpResult *= GetMaxHealth();
10911 Math.Round(hpResult);
10912 SetHealth("", "Health", hpResult);
10913
10915 other_item.AddQuantity(-quantity_used);
10916 }
10917 }
10919 }
10920
10922 {
10923 #ifdef SERVER
10924 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10925 GetHierarchyParent().IncreaseLifetimeUp();
10926 #endif
10927 };
10928
10930 {
10931 PlayerBase p = PlayerBase.Cast(player);
10932
10933 array<int> recipesIds = p.m_Recipes;
10934 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10935 if (moduleRecipesManager)
10936 {
10937 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10938 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10939 }
10940
10941 for (int i = 0;i < recipesIds.Count(); i++)
10942 {
10943 int key = recipesIds.Get(i);
10944 string recipeName = moduleRecipesManager.GetRecipeName(key);
10946 }
10947 }
10948
10949
10950 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10951 {
10952 super.GetDebugActions(outputList);
10953
10954
10959
10960
10964
10968
10969
10972
10973
10975 {
10978 }
10979
10981
10984
10988 }
10989
10990
10991
10992
10994 {
10995 super.OnAction(action_id, player, ctx);
10996 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10997 {
10998 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10999 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11000 PlayerBase p = PlayerBase.Cast(player);
11001 if (
EActions.RECIPES_RANGE_START < 1000)
11002 {
11003 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11004 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11005 }
11006 }
11007 #ifndef SERVER
11008 else if (action_id ==
EActions.WATCH_PLAYER)
11009 {
11010 PluginDeveloper.SetDeveloperItemClientEx(player);
11011 }
11012 #endif
11014 {
11015 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11016 {
11017 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11018 OnDebugButtonPressServer(id + 1);
11019 }
11020
11021 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11022 {
11023 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11025 }
11026
11027 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11028 {
11029 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11031 }
11032
11033 else if (action_id ==
EActions.ADD_QUANTITY)
11034 {
11035 if (IsMagazine())
11036 {
11037 Magazine mag = Magazine.Cast(this);
11038 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11039 }
11040 else
11041 {
11043 }
11044
11045 if (m_EM)
11046 {
11047 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11048 }
11049
11050 }
11051
11052 else if (action_id ==
EActions.REMOVE_QUANTITY)
11053 {
11054 if (IsMagazine())
11055 {
11056 Magazine mag2 = Magazine.Cast(this);
11057 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11058 }
11059 else
11060 {
11062 }
11063 if (m_EM)
11064 {
11065 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11066 }
11067
11068 }
11069
11070 else if (action_id ==
EActions.SET_QUANTITY_0)
11071 {
11073
11074 if (m_EM)
11075 {
11076 m_EM.SetEnergy(0);
11077 }
11078 }
11079
11080 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11081 {
11083
11084 if (m_EM)
11085 {
11086 m_EM.SetEnergy(m_EM.GetEnergyMax());
11087 }
11088 }
11089
11090 else if (action_id ==
EActions.ADD_HEALTH)
11091 {
11092 AddHealth("","",GetMaxHealth("","Health")/5);
11093 }
11094 else if (action_id ==
EActions.REMOVE_HEALTH)
11095 {
11096 AddHealth("","",-GetMaxHealth("","Health")/5);
11097 }
11098 else if (action_id ==
EActions.DESTROY_HEALTH)
11099 {
11100 SetHealth01("","",0);
11101 }
11102 else if (action_id ==
EActions.WATCH_ITEM)
11103 {
11105 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11106 #ifdef DEVELOPER
11107 SetDebugDeveloper_item(this);
11108 #endif
11109 }
11110
11111 else if (action_id ==
EActions.ADD_TEMPERATURE)
11112 {
11113 AddTemperature(20);
11114
11115 }
11116
11117 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11118 {
11119 AddTemperature(-20);
11120
11121 }
11122
11123 else if (action_id ==
EActions.FLIP_FROZEN)
11124 {
11125 SetFrozen(!GetIsFrozen());
11126
11127 }
11128
11129 else if (action_id ==
EActions.ADD_WETNESS)
11130 {
11132
11133 }
11134
11135 else if (action_id ==
EActions.REMOVE_WETNESS)
11136 {
11138
11139 }
11140
11141 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11142 {
11145
11146
11147 }
11148
11149 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11150 {
11153 }
11154
11155 else if (action_id ==
EActions.MAKE_SPECIAL)
11156 {
11157 auto debugParams = DebugSpawnParams.WithPlayer(player);
11158 OnDebugSpawnEx(debugParams);
11159 }
11160
11161 else if (action_id ==
EActions.DELETE)
11162 {
11163 Delete();
11164 }
11165
11166 }
11167
11168
11169 return false;
11170 }
11171
11172
11173
11174
11178
11181
11182
11183
11185 {
11186 return false;
11187 }
11188
11189
11191 {
11192 return true;
11193 }
11194
11195
11197 {
11198 return true;
11199 }
11200
11201
11202
11204 {
11205 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11207 }
11208
11211 {
11212 return null;
11213 }
11214
11216 {
11217 return false;
11218 }
11219
11221 {
11222 return false;
11223 }
11224
11228
11229
11231 {
11232 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11233 return module_repairing.CanRepair(this, item_repair_kit);
11234 }
11235
11236
11237 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11238 {
11239 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11240 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11241 }
11242
11243
11245 {
11246
11247
11248
11249
11250
11251
11252
11253
11254 return 1;
11255 }
11256
11257
11258
11260 {
11262 }
11263
11264
11265
11267 {
11269 }
11270
11271
11280 {
11281 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11282
11283 if (player)
11284 {
11285 player.MessageStatus(text);
11286 }
11287 }
11288
11289
11298 {
11299 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11300
11301 if (player)
11302 {
11303 player.MessageAction(text);
11304 }
11305 }
11306
11307
11316 {
11317 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11318
11319 if (player)
11320 {
11321 player.MessageFriendly(text);
11322 }
11323 }
11324
11325
11334 {
11335 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11336
11337 if (player)
11338 {
11339 player.MessageImportant(text);
11340 }
11341 }
11342
11344 {
11345 return true;
11346 }
11347
11348
11349 override bool KindOf(
string tag)
11350 {
11351 bool found = false;
11352 string item_name = this.
GetType();
11355
11356 int array_size = item_tag_array.Count();
11357 for (int i = 0; i < array_size; i++)
11358 {
11359 if (item_tag_array.Get(i) == tag)
11360 {
11361 found = true;
11362 break;
11363 }
11364 }
11365 return found;
11366 }
11367
11368
11370 {
11371
11372 super.OnRPC(sender, rpc_type,ctx);
11373
11374
11375 switch (rpc_type)
11376 {
11377 #ifndef SERVER
11378 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11379 Param2<bool, string> p = new Param2<bool, string>(false, "");
11380
11382 return;
11383
11384 bool play = p.param1;
11385 string soundSet = p.param2;
11386
11387 if (play)
11388 {
11390 {
11392 {
11394 }
11395 }
11396 else
11397 {
11399 }
11400 }
11401 else
11402 {
11404 }
11405
11406 break;
11407 #endif
11408
11409 }
11410
11412 {
11414 }
11415 }
11416
11417
11418
11419
11421 {
11422 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11423 return plugin.GetID(
name);
11424 }
11425
11427 {
11428 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11429 return plugin.GetName(id);
11430 }
11431
11434 {
11435
11436
11437 int varFlags;
11438 if (!ctx.
Read(varFlags))
11439 return;
11440
11441 if (varFlags & ItemVariableFlags.FLOAT)
11442 {
11444 }
11445 }
11446
11448 {
11449
11450 super.SerializeNumericalVars(floats_out);
11451
11452
11453
11455 {
11457 }
11458
11460 {
11462 }
11463
11465 {
11467 }
11468
11470 {
11475 }
11476
11478 {
11480 }
11481 }
11482
11484 {
11485
11486 super.DeSerializeNumericalVars(floats);
11487
11488
11489 int index = 0;
11490 int mask = Math.Round(floats.Get(index));
11491
11492 index++;
11493
11495 {
11497 {
11499 }
11500 else
11501 {
11502 float quantity = floats.Get(index);
11503 SetQuantity(quantity,
true,
false,
false,
false);
11504 }
11505 index++;
11506 }
11507
11509 {
11510 float wet = floats.Get(index);
11512 index++;
11513 }
11514
11516 {
11517 int liquidtype = Math.Round(floats.Get(index));
11519 index++;
11520 }
11521
11523 {
11525 index++;
11527 index++;
11529 index++;
11531 index++;
11532 }
11533
11535 {
11536 int cleanness = Math.Round(floats.Get(index));
11538 index++;
11539 }
11540 }
11541
11543 {
11544 super.WriteVarsToCTX(ctx);
11545
11546
11548 {
11550 }
11551
11553 {
11555 }
11556
11558 {
11560 }
11561
11563 {
11564 int r,g,b,a;
11570 }
11571
11573 {
11575 }
11576 }
11577
11579 {
11580 if (!super.ReadVarsFromCTX(ctx,version))
11581 return false;
11582
11583 int intValue;
11584 float value;
11585
11586 if (version < 140)
11587 {
11588 if (!ctx.
Read(intValue))
11589 return false;
11590
11591 m_VariablesMask = intValue;
11592 }
11593
11595 {
11596 if (!ctx.
Read(value))
11597 return false;
11598
11600 {
11602 }
11603 else
11604 {
11606 }
11607 }
11608
11609 if (version < 140)
11610 {
11612 {
11613 if (!ctx.
Read(value))
11614 return false;
11615 SetTemperatureDirect(value);
11616 }
11617 }
11618
11620 {
11621 if (!ctx.
Read(value))
11622 return false;
11624 }
11625
11627 {
11628 if (!ctx.
Read(intValue))
11629 return false;
11631 }
11632
11634 {
11635 int r,g,b,a;
11637 return false;
11639 return false;
11641 return false;
11643 return false;
11644
11646 }
11647
11649 {
11650 if (!ctx.
Read(intValue))
11651 return false;
11653 }
11654
11655 if (version >= 138 && version < 140)
11656 {
11658 {
11659 if (!ctx.
Read(intValue))
11660 return false;
11661 SetFrozen(intValue);
11662 }
11663 }
11664
11665 return true;
11666 }
11667
11668
11670 {
11673 {
11675 }
11676
11677 if (!super.OnStoreLoad(ctx, version))
11678 {
11680 return false;
11681 }
11682
11683 if (version >= 114)
11684 {
11685 bool hasQuickBarIndexSaved;
11686
11687 if (!ctx.
Read(hasQuickBarIndexSaved))
11688 {
11690 return false;
11691 }
11692
11693 if (hasQuickBarIndexSaved)
11694 {
11695 int itmQBIndex;
11696
11697
11698 if (!ctx.
Read(itmQBIndex))
11699 {
11701 return false;
11702 }
11703
11704 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11705 if (itmQBIndex != -1 && parentPlayer)
11706 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11707 }
11708 }
11709 else
11710 {
11711
11712 PlayerBase player;
11713 int itemQBIndex;
11714 if (version ==
int.
MAX)
11715 {
11716 if (!ctx.
Read(itemQBIndex))
11717 {
11719 return false;
11720 }
11721 }
11722 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11723 {
11724
11725 if (!ctx.
Read(itemQBIndex))
11726 {
11728 return false;
11729 }
11730 if (itemQBIndex != -1 && player)
11731 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11732 }
11733 }
11734
11735 if (version < 140)
11736 {
11737
11738 if (!LoadVariables(ctx, version))
11739 {
11741 return false;
11742 }
11743 }
11744
11745
11747 {
11749 return false;
11750 }
11751 if (version >= 132)
11752 {
11754 if (raib)
11755 {
11757 {
11759 return false;
11760 }
11761 }
11762 }
11763
11765 return true;
11766 }
11767
11768
11769
11771 {
11772 super.OnStoreSave(ctx);
11773
11774 PlayerBase player;
11775 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11776 {
11778
11779 int itemQBIndex = -1;
11780 itemQBIndex = player.FindQuickBarEntityIndex(this);
11781 ctx.
Write(itemQBIndex);
11782 }
11783 else
11784 {
11786 }
11787
11789
11791 if (raib)
11792 {
11794 }
11795 }
11796
11797
11799 {
11800 super.AfterStoreLoad();
11801
11803 {
11805 }
11806
11808 {
11811 }
11812 }
11813
11815 {
11816 super.EEOnAfterLoad();
11817
11819 {
11821 }
11822
11825 }
11826
11828 {
11829 return false;
11830 }
11831
11832
11833
11835 {
11837 {
11838 #ifdef PLATFORM_CONSOLE
11839
11841 {
11843 if (menu)
11844 {
11846 }
11847 }
11848 #endif
11849 }
11850
11852 {
11855 }
11856
11858 {
11859 SetWeightDirty();
11861 }
11863 {
11866 }
11867
11869 {
11872 }
11874 {
11877 }
11878
11879 super.OnVariablesSynchronized();
11880 }
11881
11882
11883
11885 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11886 {
11887 if (!IsServerCheck(allow_client))
11888 return false;
11889
11891 return false;
11892
11895
11896 if (value <= (min + 0.001))
11897 value = min;
11898
11899 if (value == min)
11900 {
11901 if (destroy_config)
11902 {
11903 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11904 if (dstr)
11905 {
11907 this.Delete();
11908 return true;
11909 }
11910 }
11911 else if (destroy_forced)
11912 {
11914 this.Delete();
11915 return true;
11916 }
11917
11919 }
11920
11923
11925 {
11927
11928 if (delta)
11930 }
11931
11933
11934 return false;
11935 }
11936
11937
11939 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11940 {
11942 }
11943
11945 {
11948 }
11949
11951 {
11954 }
11955
11958 {
11959 float value_clamped = Math.Clamp(value, 0, 1);
11961 SetQuantity(result, destroy_config, destroy_forced);
11962 }
11963
11964
11967 {
11969 }
11970
11972 {
11974 }
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11986 {
11987 int slot = -1;
11988 if (GetInventory())
11989 {
11990 InventoryLocation il = new InventoryLocation;
11991 GetInventory().GetCurrentInventoryLocation(il);
11993 }
11994
11996 }
11997
11999 {
12000 float quantity_max = 0;
12001
12003 {
12004 if (attSlotID != -1)
12005 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12006
12007 if (quantity_max <= 0)
12009 }
12010
12011 if (quantity_max <= 0)
12013
12014 return quantity_max;
12015 }
12016
12018 {
12020 }
12021
12023 {
12025 }
12026
12027
12029 {
12031 }
12032
12034 {
12036 }
12037
12039 {
12041 }
12042
12043
12045 {
12046
12047 float weightEx = GetWeightEx();
12048 float special = GetInventoryAndCargoWeight();
12049 return weightEx - special;
12050 }
12051
12052
12054 {
12056 }
12057
12059 {
12061 {
12062 #ifdef DEVELOPER
12063 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12064 {
12065 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12067 }
12068 #endif
12069
12070 return GetQuantity() * GetConfigWeightModified();
12071 }
12072 else if (HasEnergyManager())
12073 {
12074 #ifdef DEVELOPER
12075 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12076 {
12077 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12078 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12079 }
12080 #endif
12081 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12082 }
12083 else
12084 {
12085 #ifdef DEVELOPER
12086 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12087 {
12088 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12089 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12090 }
12091 #endif
12092 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12093 }
12094 }
12095
12098 {
12099 int item_count = 0;
12101
12102 if (GetInventory().GetCargo() != NULL)
12103 {
12104 item_count = GetInventory().GetCargo().GetItemCount();
12105 }
12106
12107 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12108 {
12109 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12110 if (item)
12111 item_count += item.GetNumberOfItems();
12112 }
12113 return item_count;
12114 }
12115
12118 {
12119 float weight = 0;
12120 float wetness = 1;
12121 if (include_wetness)
12124 {
12125 weight = wetness * m_ConfigWeight;
12126 }
12128 {
12129 weight = 1;
12130 }
12131 return weight;
12132 }
12133
12134
12135
12137 {
12138 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12139 {
12140 GameInventory inv = GetInventory();
12141 array<EntityAI> items = new array<EntityAI>;
12143 for (int i = 0; i < items.Count(); i++)
12144 {
12146 if (item)
12147 {
12149 }
12150 }
12151 }
12152 }
12153
12154
12155
12156
12158 {
12159 float energy = 0;
12160 if (HasEnergyManager())
12161 {
12162 energy = GetCompEM().GetEnergy();
12163 }
12164 return energy;
12165 }
12166
12167
12169 {
12170 super.OnEnergyConsumed();
12171
12173 }
12174
12176 {
12177 super.OnEnergyAdded();
12178
12180 }
12181
12182
12184 {
12185 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12186 {
12188 {
12189 float energy_0to1 = GetCompEM().GetEnergy0To1();
12191 }
12192 }
12193 }
12194
12195
12197 {
12198 return ConfigGetFloat("heatIsolation");
12199 }
12200
12202 {
12204 }
12205
12207 {
12208 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12209 if (
GetGame().ConfigIsExisting(paramPath))
12211
12212 return 0.0;
12213 }
12214
12216 {
12217 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12218 if (
GetGame().ConfigIsExisting(paramPath))
12220
12221 return 0.0;
12222 }
12223
12224 override void SetWet(
float value,
bool allow_client =
false)
12225 {
12226 if (!IsServerCheck(allow_client))
12227 return;
12228
12231
12233
12234 m_VarWet = Math.Clamp(value, min, max);
12235
12237 {
12240 }
12241 }
12242
12243 override void AddWet(
float value)
12244 {
12246 }
12247
12249 {
12251 }
12252
12254 {
12256 }
12257
12259 {
12261 }
12262
12264 {
12266 }
12267
12269 {
12271 }
12272
12273 override void OnWetChanged(
float newVal,
float oldVal)
12274 {
12277 if (newLevel != oldLevel)
12278 {
12280 }
12281 }
12282
12284 {
12285 SetWeightDirty();
12286 }
12287
12289 {
12290 return GetWetLevelInternal(
m_VarWet);
12291 }
12292
12293
12294
12296 {
12298 }
12299
12301 {
12303 }
12304
12306 {
12308 }
12309
12311 {
12313 }
12314
12315
12316
12318 {
12319 if (ConfigIsExisting("itemModelLength"))
12320 {
12321 return ConfigGetFloat("itemModelLength");
12322 }
12323 return 0;
12324 }
12325
12327 {
12328 if (ConfigIsExisting("itemAttachOffset"))
12329 {
12330 return ConfigGetFloat("itemAttachOffset");
12331 }
12332 return 0;
12333 }
12334
12335 override void SetCleanness(
int value,
bool allow_client =
false)
12336 {
12337 if (!IsServerCheck(allow_client))
12338 return;
12339
12341
12343
12346 }
12347
12349 {
12351 }
12352
12354 {
12355 return true;
12356 }
12357
12358
12359
12360
12362 {
12364 }
12365
12367 {
12369 }
12370
12371
12372
12373
12374 override void SetColor(
int r,
int g,
int b,
int a)
12375 {
12381 }
12383 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12384 {
12389 }
12390
12392 {
12394 }
12395
12398 {
12399 int r,g,b,a;
12401 r = r/255;
12402 g = g/255;
12403 b = b/255;
12404 a = a/255;
12405 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12406 }
12407
12408
12409
12410 override void SetLiquidType(
int value,
bool allow_client =
false)
12411 {
12412 if (!IsServerCheck(allow_client))
12413 return;
12414
12419 }
12420
12422 {
12423 return ConfigGetInt("varLiquidTypeInit");
12424 }
12425
12427 {
12429 }
12430
12432 {
12434 SetFrozen(false);
12435 }
12436
12439 {
12440 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12441 }
12442
12443
12446 {
12447 PlayerBase nplayer;
12448 if (PlayerBase.CastTo(nplayer, player))
12449 {
12451
12452 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12453 }
12454 }
12455
12456
12459 {
12460 PlayerBase nplayer;
12461 if (PlayerBase.CastTo(nplayer,player))
12462 {
12463
12464 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12465
12466 }
12467
12468
12469 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12470
12471
12472 if (HasEnergyManager())
12473 {
12474 GetCompEM().UpdatePlugState();
12475 }
12476 }
12477
12478
12480 {
12481 super.OnPlacementStarted(player);
12482
12484 }
12485
12486 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12487 {
12489 {
12490 m_AdminLog.OnPlacementComplete(player,
this);
12491 }
12492
12493 super.OnPlacementComplete(player, position, orientation);
12494 }
12495
12496
12497
12498
12499
12501 {
12503 {
12504 return true;
12505 }
12506 else
12507 {
12508 return false;
12509 }
12510 }
12511
12512
12514 {
12516 {
12518 }
12519 }
12520
12521
12523 {
12525 }
12526
12528 {
12530 }
12531
12532 override void InsertAgent(
int agent,
float count = 1)
12533 {
12534 if (count < 1)
12535 return;
12536
12538 }
12539
12542 {
12544 }
12545
12546
12548 {
12550 }
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12594 {
12596 return false;
12597 return true;
12598 }
12599
12601 {
12602
12604 }
12605
12606
12609 {
12610 super.CheckForRoofLimited(timeTresholdMS);
12611
12613 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12614 {
12615 m_PreviousRoofTestTime = time;
12616 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12617 }
12618 }
12619
12620
12622 {
12624 {
12625 return 0;
12626 }
12627
12628 if (GetInventory().GetAttachmentSlotsCount() != 0)
12629 {
12630 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12631 if (filter)
12632 return filter.GetProtectionLevel(type, false, system);
12633 else
12634 return 0;
12635 }
12636
12637 string subclassPath, entryName;
12638
12639 switch (type)
12640 {
12642 entryName = "biological";
12643 break;
12645 entryName = "chemical";
12646 break;
12647 default:
12648 entryName = "biological";
12649 break;
12650 }
12651
12652 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12653
12655 }
12656
12657
12658
12661 {
12662 if (!IsMagazine())
12664
12666 }
12667
12668
12669
12670
12671
12676 {
12677 return true;
12678 }
12679
12681 {
12683 }
12684
12685
12686
12687
12688
12690 {
12691 if (parent)
12692 {
12693 if (parent.IsInherited(DayZInfected))
12694 return true;
12695
12696 if (!parent.IsRuined())
12697 return true;
12698 }
12699
12700 return true;
12701 }
12702
12704 {
12705 if (!super.CanPutAsAttachment(parent))
12706 {
12707 return false;
12708 }
12709
12710 if (!IsRuined() && !parent.IsRuined())
12711 {
12712 return true;
12713 }
12714
12715 return false;
12716 }
12717
12719 {
12720
12721
12722
12723
12724 return super.CanReceiveItemIntoCargo(item);
12725 }
12726
12728 {
12729
12730
12731
12732
12733 GameInventory attachmentInv = attachment.GetInventory();
12735 {
12736 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12737 return false;
12738 }
12739
12740 InventoryLocation loc = new InventoryLocation();
12741 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12742 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12743 return false;
12744
12745 return super.CanReceiveAttachment(attachment, slotId);
12746 }
12747
12749 {
12750 if (!super.CanReleaseAttachment(attachment))
12751 return false;
12752
12753 return GetInventory().AreChildrenAccessible();
12754 }
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12777 {
12778 int id = muzzle_owner.GetMuzzleID();
12779 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12780
12781 if (WPOF_array)
12782 {
12783 for (int i = 0; i < WPOF_array.Count(); i++)
12784 {
12785 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12786
12787 if (WPOF)
12788 {
12789 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12790 }
12791 }
12792 }
12793 }
12794
12795
12797 {
12798 int id = muzzle_owner.GetMuzzleID();
12800
12801 if (WPOBE_array)
12802 {
12803 for (int i = 0; i < WPOBE_array.Count(); i++)
12804 {
12805 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12806
12807 if (WPOBE)
12808 {
12809 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12810 }
12811 }
12812 }
12813 }
12814
12815
12817 {
12818 int id = muzzle_owner.GetMuzzleID();
12819 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12820
12821 if (WPOOH_array)
12822 {
12823 for (int i = 0; i < WPOOH_array.Count(); i++)
12824 {
12825 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12826
12827 if (WPOOH)
12828 {
12829 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12830 }
12831 }
12832 }
12833 }
12834
12835
12837 {
12838 int id = muzzle_owner.GetMuzzleID();
12839 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12840
12841 if (WPOOH_array)
12842 {
12843 for (int i = 0; i < WPOOH_array.Count(); i++)
12844 {
12845 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12846
12847 if (WPOOH)
12848 {
12849 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12850 }
12851 }
12852 }
12853 }
12854
12855
12857 {
12858 int id = muzzle_owner.GetMuzzleID();
12859 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12860
12861 if (WPOOH_array)
12862 {
12863 for (int i = 0; i < WPOOH_array.Count(); i++)
12864 {
12865 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12866
12867 if (WPOOH)
12868 {
12869 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12870 }
12871 }
12872 }
12873 }
12874
12875
12876
12878 {
12880 {
12881 return true;
12882 }
12883
12884 return false;
12885 }
12886
12888 {
12890 {
12891 return true;
12892 }
12893
12894 return false;
12895 }
12896
12898 {
12900 {
12901 return true;
12902 }
12903
12904 return false;
12905 }
12906
12908 {
12909 return false;
12910 }
12911
12914 {
12915 return UATimeSpent.DEFAULT_DEPLOY;
12916 }
12917
12918
12919
12920
12922 {
12924 SetSynchDirty();
12925 }
12926
12928 {
12930 }
12931
12932
12934 {
12935 return false;
12936 }
12937
12940 {
12941 string att_type = "None";
12942
12943 if (ConfigIsExisting("soundAttType"))
12944 {
12945 att_type = ConfigGetString("soundAttType");
12946 }
12947
12949 }
12950
12952 {
12954 }
12955
12956
12957
12958
12959
12963
12965 {
12968
12970 }
12971
12972
12974 {
12976 return;
12977
12979
12982
12985
12986 SoundParameters params = new SoundParameters();
12990 }
12991
12992
12994 {
12996 return;
12997
12999 SetSynchDirty();
13000
13003 }
13004
13005
13007 {
13009 return;
13010
13012 SetSynchDirty();
13013
13016 }
13017
13019 {
13021 }
13022
13024 {
13026 }
13027
13030 {
13031 if (!
GetGame().IsDedicatedServer())
13032 {
13033 if (ConfigIsExisting("attachSoundSet"))
13034 {
13035 string cfg_path = "";
13036 string soundset = "";
13037 string type_name =
GetType();
13038
13041 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13042 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13043
13044 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13045 {
13046 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13047 {
13048 if (cfg_slot_array[i] == slot_type)
13049 {
13050 soundset = cfg_soundset_array[i];
13051 break;
13052 }
13053 }
13054 }
13055
13056 if (soundset != "")
13057 {
13058 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13060 }
13061 }
13062 }
13063 }
13064
13066 {
13067
13068 }
13069
13070 void OnApply(PlayerBase player);
13071
13073 {
13074 return 1.0;
13075 };
13076
13078 {
13080 }
13081
13083 {
13085 }
13086
13088
13090 {
13091 SetDynamicPhysicsLifeTime(0.01);
13093 }
13094
13096 {
13097 array<string> zone_names = new array<string>;
13098 GetDamageZones(zone_names);
13099 for (int i = 0; i < zone_names.Count(); i++)
13100 {
13101 SetHealthMax(zone_names.Get(i),"Health");
13102 }
13103 SetHealthMax("","Health");
13104 }
13105
13108 {
13109 float global_health = GetHealth01("","Health");
13110 array<string> zones = new array<string>;
13111 GetDamageZones(zones);
13112
13113 for (int i = 0; i < zones.Count(); i++)
13114 {
13115 SetHealth01(zones.Get(i),"Health",global_health);
13116 }
13117 }
13118
13121 {
13122 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13123 }
13124
13126 {
13127 if (!hasRootAsPlayer)
13128 {
13129 if (refParentIB)
13130 {
13131
13132 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13133 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13134
13135 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13136 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13137
13140 }
13141 else
13142 {
13143
13146 }
13147 }
13148 }
13149
13151 {
13153 {
13154 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13155 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13156 {
13157 float heatPermCoef = 1.0;
13159 while (ent)
13160 {
13161 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13162 ent = ent.GetHierarchyParent();
13163 }
13164
13165 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13166 }
13167 }
13168 }
13169
13171 {
13172
13173 EntityAI parent = GetHierarchyParent();
13174 if (!parent)
13175 {
13176 hasParent = false;
13177 hasRootAsPlayer = false;
13178 }
13179 else
13180 {
13181 hasParent = true;
13182 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13183 refParentIB =
ItemBase.Cast(parent);
13184 }
13185 }
13186
13187 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13188 {
13189
13190 }
13191
13193 {
13194
13195 return false;
13196 }
13197
13199 {
13200
13201
13202 return false;
13203 }
13204
13206 {
13207
13208 return false;
13209 }
13210
13213 {
13214 return !GetIsFrozen() &&
IsOpen();
13215 }
13216
13218 {
13219 bool hasParent = false, hasRootAsPlayer = false;
13221
13222 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13223 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13224
13225 if (wwtu || foodDecay)
13226 {
13230
13231 if (processWetness || processTemperature || processDecay)
13232 {
13234
13235 if (processWetness)
13236 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13237
13238 if (processTemperature)
13240
13241 if (processDecay)
13242 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13243 }
13244 }
13245 }
13246
13249 {
13251 }
13252
13254 {
13257
13258 return super.GetTemperatureFreezeThreshold();
13259 }
13260
13262 {
13265
13266 return super.GetTemperatureThawThreshold();
13267 }
13268
13270 {
13273
13274 return super.GetItemOverheatThreshold();
13275 }
13276
13278 {
13280 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13281
13282 return super.GetTemperatureFreezeTime();
13283 }
13284
13286 {
13288 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13289
13290 return super.GetTemperatureThawTime();
13291 }
13292
13297
13299 {
13300 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13301 }
13302
13304 {
13305 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13306 }
13307
13310 {
13312 }
13313
13315 {
13317 }
13318
13320 {
13322 }
13323
13326 {
13327 return null;
13328 }
13329
13332 {
13333 return false;
13334 }
13335
13337 {
13339 {
13342 if (!trg)
13343 {
13345 explosive = this;
13346 }
13347
13348 explosive.PairRemote(trg);
13350
13351 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13352 trg.SetPersistentPairID(persistentID);
13353 explosive.SetPersistentPairID(persistentID);
13354
13355 return true;
13356 }
13357 return false;
13358 }
13359
13362 {
13363 float ret = 1.0;
13366 ret *= GetHealth01();
13367
13368 return ret;
13369 }
13370
13371 #ifdef DEVELOPER
13372 override void SetDebugItem()
13373 {
13374 super.SetDebugItem();
13375 _itemBase = this;
13376 }
13377
13379 {
13380 string text = super.GetDebugText();
13381
13383 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13384
13385 return text;
13386 }
13387 #endif
13388
13390 {
13391 return true;
13392 }
13393
13395
13397
13399 {
13402 }
13403
13404
13412
13428}
13429
13431{
13433 if (entity)
13434 {
13435 bool is_item = entity.IsInherited(
ItemBase);
13436 if (is_item && full_quantity)
13437 {
13440 }
13441 }
13442 else
13443 {
13445 return NULL;
13446 }
13447 return entity;
13448}
13449
13451{
13452 if (item)
13453 {
13454 if (health > 0)
13455 item.SetHealth("", "", health);
13456
13457 if (item.CanHaveTemperature())
13458 {
13460 if (item.CanFreeze())
13461 item.SetFrozen(false);
13462 }
13463
13464 if (item.HasEnergyManager())
13465 {
13466 if (quantity >= 0)
13467 {
13468 item.GetCompEM().SetEnergy0To1(quantity);
13469 }
13470 else
13471 {
13473 }
13474 }
13475 else if (item.IsMagazine())
13476 {
13477 Magazine mag = Magazine.Cast(item);
13478 if (quantity >= 0)
13479 {
13480 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13481 }
13482 else
13483 {
13485 }
13486
13487 }
13488 else
13489 {
13490 if (quantity >= 0)
13491 {
13492 item.SetQuantityNormalized(quantity, false);
13493 }
13494 else
13495 {
13497 }
13498
13499 }
13500 }
13501}
13502
13503#ifdef DEVELOPER
13505#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.