Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,0.15,0.15,1.0,CO)".
8664{
8666 {
8667 return true;
8668 }
8669};
8670
8671
8672
8674{
8678
8680
8683
8684
8685
8686
8687
8696
8702
8707
8712
8733 protected bool m_IsResultOfSplit
8734
8736
8741
8742
8743
8745
8749
8750
8751
8753
8756
8757
8758
8764
8765
8773
8776
8777
8779
8780
8782
8783
8788
8789
8794
8795
8797
8798
8800 {
8805
8806 if (!
GetGame().IsDedicatedServer())
8807 {
8809 {
8811
8813 {
8815 }
8816 }
8817
8820 }
8821
8822 m_OldLocation = null;
8823
8825 {
8827 }
8828
8829 if (ConfigIsExisting("headSelectionsToHide"))
8830 {
8833 }
8834
8836 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8837 {
8839 }
8840
8842
8843 m_IsResultOfSplit = false;
8844
8846 }
8847
8849 {
8850 super.InitItemVariables();
8851
8857 m_Count = ConfigGetInt(
"count");
8858
8861
8866
8869
8874
8886
8890
8891
8894 if (ConfigIsExisting("canBeSplit"))
8895 {
8898 }
8899
8901 if (ConfigIsExisting("itemBehaviour"))
8903
8904
8907 RegisterNetSyncVariableInt("m_VarLiquidType");
8908 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8909
8910 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8911 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8912 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8913
8914 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8915 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8916 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8917 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8918
8919 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8920 RegisterNetSyncVariableBool("m_IsTakeable");
8921 RegisterNetSyncVariableBool("m_IsHologram");
8922
8925 {
8928 }
8929
8931
8933 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8935
8936 }
8937
8939 {
8941 }
8942
8944 {
8947 {
8952 }
8953 }
8954
8955 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8956 {
8958 {
8961 }
8962
8964 }
8965
8967 {
8973 }
8974
8976
8978 {
8980
8981 if (!action)
8982 {
8983 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8984 return;
8985 }
8986
8988 if (!ai)
8989 {
8991 return;
8992 }
8993
8995 if (!action_array)
8996 {
8997 action_array = new array<ActionBase_Basic>;
8999 }
9000 if (LogManager.IsActionLogEnable())
9001 {
9002 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9003 }
9004
9005 if (action_array.Find(action) != -1)
9006 {
9007 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9008 }
9009 else
9010 {
9011 action_array.Insert(action);
9012 }
9013 }
9014
9016 {
9018 ActionBase action = player.GetActionManager().GetAction(actionName);
9021
9022 if (action_array)
9023 {
9024 action_array.RemoveItem(action);
9025 }
9026 }
9027
9028
9029
9031 {
9032 ActionOverrideData overrideData = new ActionOverrideData();
9036
9038 if (!actionMap)
9039 {
9042 }
9043
9044 actionMap.Insert(this.
Type(), overrideData);
9045
9046 }
9047
9049
9051
9052
9054 {
9057
9060
9061 string config_to_search = "CfgVehicles";
9062 string muzzle_owner_config;
9063
9065 {
9066 if (IsInherited(Weapon))
9067 config_to_search = "CfgWeapons";
9068
9069 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9070
9071 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9072
9074
9075 if (config_OnFire_subclass_count > 0)
9076 {
9077 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9078
9079 for (int i = 0; i < config_OnFire_subclass_count; i++)
9080 {
9081 string particle_class = "";
9083 string config_OnFire_entry = config_OnFire_class + particle_class;
9084 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9085 WPOF_array.Insert(WPOF);
9086 }
9087
9088
9090 }
9091 }
9092
9094 {
9095 config_to_search = "CfgWeapons";
9096 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9097
9098 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9099
9101
9102 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9103 {
9104 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9105
9106 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9107 {
9108 string particle_class2 = "";
9110 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9111 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9112 WPOBE_array.Insert(WPOBE);
9113 }
9114
9115
9117 }
9118 }
9119 }
9120
9121
9123 {
9126
9128 {
9129 string config_to_search = "CfgVehicles";
9130
9131 if (IsInherited(Weapon))
9132 config_to_search = "CfgWeapons";
9133
9134 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9135 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9136
9137 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9138 {
9139
9141
9143 {
9145 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9147 return;
9148 }
9149
9152
9153
9154
9156 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9157
9158 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9159 {
9160 string particle_class = "";
9162 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9164
9165 if (entry_type == CT_CLASS)
9166 {
9167 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9168 WPOOH_array.Insert(WPOF);
9169 }
9170 }
9171
9172
9174 }
9175 }
9176 }
9177
9179 {
9181 }
9182
9184 {
9186 {
9188
9191
9194
9195 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9196 }
9197 }
9198
9200 {
9202 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9203
9205 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9206
9208 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9209
9211 {
9213 }
9214 }
9215
9217 {
9219 }
9220
9222 {
9225 else
9227
9229 {
9232 }
9233 else
9234 {
9237
9240 }
9241
9243 }
9244
9246 {
9248 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9249 }
9250
9252 {
9254 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9256 }
9257
9259 {
9261 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9262 }
9263
9265 {
9268
9269 OverheatingParticle OP = new OverheatingParticle();
9274
9276 }
9277
9279 {
9282
9283 return -1;
9284 }
9285
9287 {
9289 {
9292
9293 for (int i = count; i > 0; --i)
9294 {
9295 int id = i - 1;
9298
9301
9302 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9303 {
9304 if (p)
9305 {
9308 }
9309 }
9310 }
9311 }
9312 }
9313
9315 {
9317 {
9319 {
9320 int id = i - 1;
9322
9323 if (OP)
9324 {
9326
9327 if (p)
9328 {
9330 }
9331
9332 delete OP;
9333 }
9334 }
9335
9338 }
9339 }
9340
9343 {
9344 return 0.0;
9345 }
9346
9347
9349 {
9350 return 250;
9351 }
9352
9354 {
9355 return 0;
9356 }
9357
9360 {
9362 return true;
9363
9364 return false;
9365 }
9366
9369 {
9372
9374 {
9376 }
9377 else
9378 {
9379
9381 }
9382
9384 }
9385
9392 {
9393 return -1;
9394 }
9395
9396
9397
9398
9400 {
9402 {
9404 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9405
9406 if (r_index >= 0)
9407 {
9408 InventoryLocation r_il = new InventoryLocation;
9409 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9410
9411 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9414 {
9415 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9416 }
9418 {
9419 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9420 }
9421
9422 }
9423
9424 player.GetHumanInventory().ClearUserReservedLocation(this);
9425 }
9426
9429 }
9430
9431
9432
9433
9435 {
9436 return ItemBase.m_DebugActionsMask;
9437 }
9438
9440 {
9441 return ItemBase.m_DebugActionsMask & mask;
9442 }
9443
9445 {
9446 ItemBase.m_DebugActionsMask = mask;
9447 }
9448
9450 {
9451 ItemBase.m_DebugActionsMask |= mask;
9452 }
9453
9455 {
9456 ItemBase.m_DebugActionsMask &= ~mask;
9457 }
9458
9460 {
9462 {
9464 }
9465 else
9466 {
9468 }
9469 }
9470
9471
9473 {
9474 if (GetEconomyProfile())
9475 {
9476 float q_max = GetEconomyProfile().GetQuantityMax();
9477 if (q_max > 0)
9478 {
9479 float q_min = GetEconomyProfile().GetQuantityMin();
9480 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9481
9483 {
9484 ComponentEnergyManager comp = GetCompEM();
9486 {
9488 }
9489 }
9491 {
9493
9494 }
9495
9496 }
9497 }
9498 }
9499
9502 {
9503 EntityAI parent = GetHierarchyParent();
9504
9505 if (parent)
9506 {
9507 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9508 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9509 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9510 }
9511 }
9512
9515 {
9516 EntityAI parent = GetHierarchyParent();
9517
9518 if (parent)
9519 {
9520 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9521 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9522 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9523 }
9524 }
9525
9527 {
9528
9529
9530
9531
9533
9535 {
9536 if (ScriptInputUserData.CanStoreInputUserData())
9537 {
9538 ScriptInputUserData ctx = new ScriptInputUserData;
9544 ctx.
Write(use_stack_max);
9547
9549 {
9550 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9551 }
9552 }
9553 }
9554 else if (!
GetGame().IsMultiplayer())
9555 {
9557 }
9558 }
9559
9561 {
9563 }
9564
9566 {
9568 }
9569
9571 {
9573 }
9574
9576 {
9577
9578 return false;
9579 }
9580
9582 {
9583 return false;
9584 }
9585
9589 {
9590 return false;
9591 }
9592
9594 {
9595 return "";
9596 }
9597
9599
9601 {
9602 return false;
9603 }
9604
9606 {
9607 return true;
9608 }
9609
9610
9611
9613 {
9614 return true;
9615 }
9616
9618 {
9619 return true;
9620 }
9621
9623 {
9624 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9626 }
9627
9629 {
9631 }
9632
9634 {
9636 if (!is_being_placed)
9638 SetSynchDirty();
9639 }
9640
9641
9643
9645 {
9647 }
9648
9650 {
9652 }
9653
9655 {
9656 return 1;
9657 }
9658
9660 {
9661 return false;
9662 }
9663
9665 {
9667 SetSynchDirty();
9668 }
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9705 {
9706 super.OnMovedInsideCargo(container);
9707
9708 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9709 }
9710
9711 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9712 {
9713 super.EEItemLocationChanged(oldLoc,newLoc);
9714
9715 PlayerBase new_player = null;
9716 PlayerBase old_player = null;
9717
9718 if (newLoc.GetParent())
9719 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9720
9721 if (oldLoc.GetParent())
9722 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9723
9725 {
9726 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9727
9728 if (r_index >= 0)
9729 {
9730 InventoryLocation r_il = new InventoryLocation;
9731 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9732
9733 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9736 {
9737 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9738 }
9740 {
9741 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9742 }
9743
9744 }
9745 }
9746
9748 {
9749 if (new_player)
9750 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9751
9752 if (new_player == old_player)
9753 {
9754
9755 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9756 {
9758 {
9759 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9760 {
9761 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9762 }
9763 }
9764 else
9765 {
9766 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9767 }
9768 }
9769
9770 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9771 {
9772 int type = oldLoc.GetType();
9774 {
9775 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9776 }
9778 {
9779 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9780 }
9781 }
9782 if (!m_OldLocation)
9783 {
9784 m_OldLocation = new InventoryLocation;
9785 }
9786 m_OldLocation.Copy(oldLoc);
9787 }
9788 else
9789 {
9790 if (m_OldLocation)
9791 {
9792 m_OldLocation.Reset();
9793 }
9794 }
9795
9797 }
9798 else
9799 {
9800 if (new_player)
9801 {
9802 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9803 if (res_index >= 0)
9804 {
9805 InventoryLocation il = new InventoryLocation;
9806 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9808 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9811 {
9812 il.
GetParent().GetOnReleaseLock().Invoke(it);
9813 }
9815 {
9817 }
9818
9819 }
9820 }
9822 {
9823
9825 }
9826
9827 if (m_OldLocation)
9828 {
9829 m_OldLocation.Reset();
9830 }
9831 }
9832 }
9833
9834 override void EOnContact(IEntity other, Contact extra)
9835 {
9837 {
9838 int liquidType = -1;
9840 if (impactSpeed > 0.0)
9841 {
9843 #ifndef SERVER
9845 #else
9847 SetSynchDirty();
9848 #endif
9850 }
9851 }
9852
9853 #ifdef SERVER
9854 if (GetCompEM() && GetCompEM().IsPlugged())
9855 {
9856 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9857 GetCompEM().UnplugThis();
9858 }
9859 #endif
9860 }
9861
9863
9865 {
9867 }
9868
9870 {
9871
9872 }
9873
9875 {
9876 super.OnItemLocationChanged(old_owner, new_owner);
9877
9878 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9879 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9880
9881 if (!relatedPlayer && playerNew)
9882 relatedPlayer = playerNew;
9883
9884 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9885 {
9887 if (actionMgr)
9888 {
9889 ActionBase currentAction = actionMgr.GetRunningAction();
9890 if (currentAction)
9892 }
9893 }
9894
9895 Man ownerPlayerOld = null;
9896 Man ownerPlayerNew = null;
9897
9898 if (old_owner)
9899 {
9900 if (old_owner.
IsMan())
9901 {
9902 ownerPlayerOld = Man.Cast(old_owner);
9903 }
9904 else
9905 {
9906 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9907 }
9908 }
9909 else
9910 {
9912 {
9914
9915 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9916 {
9917 GetCompEM().UnplugThis();
9918 }
9919 }
9920 }
9921
9922 if (new_owner)
9923 {
9924 if (new_owner.
IsMan())
9925 {
9926 ownerPlayerNew = Man.Cast(new_owner);
9927 }
9928 else
9929 {
9930 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9931 }
9932 }
9933
9934 if (ownerPlayerOld != ownerPlayerNew)
9935 {
9936 if (ownerPlayerOld)
9937 {
9938 array<EntityAI> subItemsExit = new array<EntityAI>;
9940 for (int i = 0; i < subItemsExit.Count(); i++)
9941 {
9944 }
9945 }
9946
9947 if (ownerPlayerNew)
9948 {
9949 array<EntityAI> subItemsEnter = new array<EntityAI>;
9951 for (int j = 0; j < subItemsEnter.Count(); j++)
9952 {
9955 }
9956 }
9957 }
9958 else if (ownerPlayerNew != null)
9959 {
9960 PlayerBase nplayer;
9961 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9962 {
9963 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9965 for (int k = 0; k < subItemsUpdate.Count(); k++)
9966 {
9968 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9969 }
9970 }
9971 }
9972
9973 if (old_owner)
9974 old_owner.OnChildItemRemoved(this);
9975 if (new_owner)
9976 new_owner.OnChildItemReceived(this);
9977 }
9978
9979
9981 {
9982 super.EEDelete(parent);
9983 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9984 if (player)
9985 {
9987
9988 if (player.IsAlive())
9989 {
9990 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9991 if (r_index >= 0)
9992 {
9993 InventoryLocation r_il = new InventoryLocation;
9994 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9995
9996 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9999 {
10000 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10001 }
10003 {
10004 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10005 }
10006
10007 }
10008
10009 player.RemoveQuickBarEntityShortcut(this);
10010 }
10011 }
10012 }
10013
10015 {
10016 super.EEKilled(killer);
10017
10020 {
10021 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10022 {
10023 if (IsMagazine())
10024 {
10025 if (Magazine.Cast(this).GetAmmoCount() > 0)
10026 {
10028 }
10029 }
10030 else
10031 {
10033 }
10034 }
10035 }
10036 }
10037
10039 {
10040 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10041
10042 super.OnWasAttached(parent, slot_id);
10043
10046
10048 }
10049
10051 {
10052 super.OnWasDetached(parent, slot_id);
10053
10056 }
10057
10059 {
10060 int idx;
10063
10064 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10065 if (inventory_slots.Count() < 1)
10066 {
10067 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10068 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10069 }
10070 else
10071 {
10072 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10073 }
10074
10075 idx = inventory_slots.Find(slot);
10076 if (idx < 0)
10077 return "";
10078
10079 return attach_types.Get(idx);
10080 }
10081
10083 {
10084 int idx = -1;
10085 string slot;
10086
10089
10090 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10091 if (inventory_slots.Count() < 1)
10092 {
10093 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10094 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10095 }
10096 else
10097 {
10098 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10099 if (detach_types.Count() < 1)
10100 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10101 }
10102
10103 for (int i = 0; i < inventory_slots.Count(); i++)
10104 {
10105 slot = inventory_slots.Get(i);
10106 }
10107
10108 if (slot != "")
10109 {
10110 if (detach_types.Count() == 1)
10111 idx = 0;
10112 else
10113 idx = inventory_slots.Find(slot);
10114 }
10115 if (idx < 0)
10116 return "";
10117
10118 return detach_types.Get(idx);
10119 }
10120
10122 {
10123
10125
10126
10127 float min_time = 1;
10128 float max_time = 3;
10129 float delay = Math.RandomFloat(min_time, max_time);
10130
10131 explode_timer.Run(delay, this, "DoAmmoExplosion");
10132 }
10133
10135 {
10136 Magazine magazine = Magazine.Cast(this);
10137 int pop_sounds_count = 6;
10138 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10139
10140
10141 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10142 string sound_name = pop_sounds[ sound_idx ];
10144
10145
10146 magazine.ServerAddAmmoCount(-1);
10147
10148
10149 float min_temp_to_explode = 100;
10150
10151 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10152 {
10154 }
10155 }
10156
10157
10158 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10159 {
10160 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10161
10162 const int CHANCE_DAMAGE_CARGO = 4;
10163 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10164 const int CHANCE_DAMAGE_NOTHING = 2;
10165
10167 {
10168 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10169 int chances;
10170 int rnd;
10171
10172 if (GetInventory().GetCargo())
10173 {
10174 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10175 rnd = Math.RandomInt(0,chances);
10176
10177 if (rnd < CHANCE_DAMAGE_CARGO)
10178 {
10180 }
10181 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10182 {
10184 }
10185 }
10186 else
10187 {
10188 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10189 rnd = Math.RandomInt(0,chances);
10190
10191 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10192 {
10194 }
10195 }
10196 }
10197 }
10198
10200 {
10201 if (GetInventory().GetCargo())
10202 {
10203 int item_count = GetInventory().GetCargo().GetItemCount();
10204 if (item_count > 0)
10205 {
10206 int random_pick = Math.RandomInt(0, item_count);
10208 if (!item.IsExplosive())
10209 {
10210 item.AddHealth("","",damage);
10211 return true;
10212 }
10213 }
10214 }
10215 return false;
10216 }
10217
10219 {
10220 int attachment_count = GetInventory().AttachmentCount();
10221 if (attachment_count > 0)
10222 {
10223 int random_pick = Math.RandomInt(0, attachment_count);
10224 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10225 if (!attachment.IsExplosive())
10226 {
10227 attachment.AddHealth("","",damage);
10228 return true;
10229 }
10230 }
10231 return false;
10232 }
10233
10235 {
10237 }
10238
10240 {
10242 return GetInventory().CanRemoveEntity();
10243
10244 return false;
10245 }
10246
10248 {
10249
10251 return false;
10252
10253
10255 return false;
10256
10257
10258
10260 if (delta == 0)
10261 return false;
10262
10263
10264 return true;
10265 }
10266
10268 {
10270 {
10271 if (ScriptInputUserData.CanStoreInputUserData())
10272 {
10273 ScriptInputUserData ctx = new ScriptInputUserData;
10278 ctx.
Write(destination_entity);
10280 ctx.
Write(slot_id);
10282 }
10283 }
10284 else if (!
GetGame().IsMultiplayer())
10285 {
10287 }
10288 }
10289
10291 {
10292 float split_quantity_new;
10296 InventoryLocation loc = new InventoryLocation;
10297
10298 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10299 {
10301 split_quantity_new = stack_max;
10302 else
10304
10306 {
10307 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10308 if (new_item)
10309 {
10310 new_item.SetResultOfSplit(true);
10311 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10313 new_item.
SetQuantity(split_quantity_new,
false,
true);
10314 }
10315 }
10316 }
10317 else if (destination_entity && slot_id == -1)
10318 {
10319 if (quantity > stack_max)
10320 split_quantity_new = stack_max;
10321 else
10322 split_quantity_new = quantity;
10323
10325 {
10327 {
10330 }
10331
10332 if (new_item)
10333 {
10334 new_item.SetResultOfSplit(true);
10335 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10337 new_item.
SetQuantity(split_quantity_new,
false,
true);
10338 }
10339 }
10340 }
10341 else
10342 {
10343 if (stack_max != 0)
10344 {
10346 {
10348 }
10349
10350 if (split_quantity_new == 0)
10351 {
10352 if (!
GetGame().IsMultiplayer())
10353 player.PhysicalPredictiveDropItem(this);
10354 else
10355 player.ServerDropEntity(this);
10356 return;
10357 }
10358
10360 {
10362
10363 if (new_item)
10364 {
10365 new_item.SetResultOfSplit(true);
10366 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10369 new_item.PlaceOnSurface();
10370 }
10371 }
10372 }
10373 }
10374 }
10375
10377 {
10378 float split_quantity_new;
10382 InventoryLocation loc = new InventoryLocation;
10383
10384 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10385 {
10387 split_quantity_new = stack_max;
10388 else
10390
10392 {
10393 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10394 if (new_item)
10395 {
10396 new_item.SetResultOfSplit(true);
10397 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10399 new_item.
SetQuantity(split_quantity_new,
false,
true);
10400 }
10401 }
10402 }
10403 else if (destination_entity && slot_id == -1)
10404 {
10405 if (quantity > stack_max)
10406 split_quantity_new = stack_max;
10407 else
10408 split_quantity_new = quantity;
10409
10411 {
10413 {
10416 }
10417
10418 if (new_item)
10419 {
10420 new_item.SetResultOfSplit(true);
10421 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10423 new_item.
SetQuantity(split_quantity_new,
false,
true);
10424 }
10425 }
10426 }
10427 else
10428 {
10429 if (stack_max != 0)
10430 {
10432 {
10434 }
10435
10437 {
10439
10440 if (new_item)
10441 {
10442 new_item.SetResultOfSplit(true);
10443 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10446 new_item.PlaceOnSurface();
10447 }
10448 }
10449 }
10450 }
10451 }
10452
10454 {
10456 {
10457 if (ScriptInputUserData.CanStoreInputUserData())
10458 {
10459 ScriptInputUserData ctx = new ScriptInputUserData;
10464 dst.WriteToContext(ctx);
10466 }
10467 }
10468 else if (!
GetGame().IsMultiplayer())
10469 {
10471 }
10472 }
10473
10475 {
10477 {
10478 if (ScriptInputUserData.CanStoreInputUserData())
10479 {
10480 ScriptInputUserData ctx = new ScriptInputUserData;
10485 ctx.
Write(destination_entity);
10491 }
10492 }
10493 else if (!
GetGame().IsMultiplayer())
10494 {
10496 }
10497 }
10498
10500 {
10502 }
10503
10505 {
10507 float split_quantity_new;
10509 if (dst.IsValid())
10510 {
10511 int slot_id = dst.GetSlot();
10513
10514 if (quantity > stack_max)
10515 split_quantity_new = stack_max;
10516 else
10517 split_quantity_new = quantity;
10518
10520 {
10522
10523 if (new_item)
10524 {
10525 new_item.SetResultOfSplit(true);
10526 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10528 new_item.
SetQuantity(split_quantity_new,
false,
true);
10529 }
10530
10531 return new_item;
10532 }
10533 }
10534
10535 return null;
10536 }
10537
10539 {
10541 float split_quantity_new;
10543 if (destination_entity)
10544 {
10546 if (quantity > stackable)
10547 split_quantity_new = stackable;
10548 else
10549 split_quantity_new = quantity;
10550
10552 {
10553 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10554 if (new_item)
10555 {
10556 new_item.SetResultOfSplit(true);
10557 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10559 new_item.
SetQuantity(split_quantity_new,
false,
true);
10560 }
10561 }
10562 }
10563 }
10564
10566 {
10568 {
10569 if (ScriptInputUserData.CanStoreInputUserData())
10570 {
10571 ScriptInputUserData ctx = new ScriptInputUserData;
10576 ItemBase destination_entity =
this;
10577 ctx.
Write(destination_entity);
10581 }
10582 }
10583 else if (!
GetGame().IsMultiplayer())
10584 {
10586 }
10587 }
10588
10590 {
10592 float split_quantity_new;
10594 if (player)
10595 {
10597 if (quantity > stackable)
10598 split_quantity_new = stackable;
10599 else
10600 split_quantity_new = quantity;
10601
10603 {
10604 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10605 new_item =
ItemBase.Cast(in_hands);
10606 if (new_item)
10607 {
10608 new_item.SetResultOfSplit(true);
10609 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10611 new_item.SetQuantity(split_quantity_new, false, true);
10612 }
10613 }
10614 }
10615 }
10616
10618 {
10620 float split_quantity_new = Math.Floor(quantity * 0.5);
10621
10623 return;
10624
10626
10627 if (new_item)
10628 {
10629 if (new_item.GetQuantityMax() < split_quantity_new)
10630 {
10631 split_quantity_new = new_item.GetQuantityMax();
10632 }
10633
10634 new_item.SetResultOfSplit(true);
10635 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10636
10638 {
10641 }
10642 else
10643 {
10645 new_item.
SetQuantity(split_quantity_new,
false,
true);
10646 }
10647 }
10648 }
10649
10651 {
10653 float split_quantity_new = Math.Floor(quantity / 2);
10654
10656 return;
10657
10658 InventoryLocation invloc = new InventoryLocation;
10660
10662 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10663
10664 if (new_item)
10665 {
10666 if (new_item.GetQuantityMax() < split_quantity_new)
10667 {
10668 split_quantity_new = new_item.GetQuantityMax();
10669 }
10671 {
10674 }
10675 else if (split_quantity_new > 1)
10676 {
10678 new_item.
SetQuantity(split_quantity_new,
false,
true);
10679 }
10680 }
10681 }
10682
10685 {
10686 SetWeightDirty();
10688
10689 if (parent)
10690 parent.OnAttachmentQuantityChangedEx(this, delta);
10691
10693 {
10695 {
10697 }
10699 {
10700 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10702 }
10703 }
10704
10705 }
10706
10709 {
10710
10711 }
10712
10715 {
10717 }
10718
10720 {
10721 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10722
10724 {
10725 if (newLevel == GameConstants.STATE_RUINED)
10726 {
10728 EntityAI parent = GetHierarchyParent();
10729 if (parent && parent.IsFireplace())
10730 {
10731 CargoBase cargo = GetInventory().GetCargo();
10732 if (cargo)
10733 {
10735 {
10737 }
10738 }
10739 }
10740 }
10741
10743 {
10744
10746 return;
10747 }
10748
10749 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10750 {
10752 }
10753 }
10754 }
10755
10756
10758 {
10759 super.OnRightClick();
10760
10762 {
10764 {
10765 if (ScriptInputUserData.CanStoreInputUserData())
10766 {
10767 EntityAI root = GetHierarchyRoot();
10768 Man playerOwner = GetHierarchyRootPlayer();
10769 InventoryLocation dst = new InventoryLocation;
10770
10771
10772 if (!playerOwner && root && root == this)
10773 {
10775 }
10776 else
10777 {
10778
10779 GetInventory().GetCurrentInventoryLocation(dst);
10781 {
10784 {
10786 }
10787 else
10788 {
10790
10791
10792 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10793 {
10795 }
10796 else
10797 {
10798 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10799 }
10800 }
10801 }
10802 }
10803
10804 ScriptInputUserData ctx = new ScriptInputUserData;
10812 }
10813 }
10814 else if (!
GetGame().IsMultiplayer())
10815 {
10817 }
10818 }
10819 }
10820
10822 {
10823 if (root)
10824 {
10825 vector m4[4];
10826 root.GetTransform(m4);
10827 dst.SetGround(this, m4);
10828 }
10829 else
10830 {
10831 GetInventory().GetCurrentInventoryLocation(dst);
10832 }
10833 }
10834
10835 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10836 {
10837
10838 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10839 return false;
10840
10841 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10842 return false;
10843
10844
10846 return false;
10847
10848
10849 Magazine mag = Magazine.Cast(this);
10850 if (mag)
10851 {
10852 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10853 return false;
10854
10855 if (stack_max_limit)
10856 {
10857 Magazine other_mag = Magazine.Cast(other_item);
10858 if (other_item)
10859 {
10860 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10861 return false;
10862 }
10863
10864 }
10865 }
10866 else
10867 {
10868
10870 return false;
10871
10873 return false;
10874 }
10875
10876 PlayerBase player = null;
10877 if (CastTo(player, GetHierarchyRootPlayer()))
10878 {
10879 if (player.GetInventory().HasAttachment(this))
10880 return false;
10881
10882 if (player.IsItemsToDelete())
10883 return false;
10884 }
10885
10886 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10887 return false;
10888
10889 int slotID;
10891 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10892 return false;
10893
10894 return true;
10895 }
10896
10898 {
10900 }
10901
10903 {
10904 return m_IsResultOfSplit;
10905 }
10906
10908 {
10909 m_IsResultOfSplit = value;
10910 }
10911
10913 {
10915 }
10916
10918 {
10919 float other_item_quantity = other_item.GetQuantity();
10920 float this_free_space;
10921
10923
10925
10926 if (other_item_quantity > this_free_space)
10927 {
10928 return this_free_space;
10929 }
10930 else
10931 {
10932 return other_item_quantity;
10933 }
10934 }
10935
10937 {
10939 }
10940
10942 {
10944 return;
10945
10946 if (!IsMagazine() && other_item)
10947 {
10949 if (quantity_used != 0)
10950 {
10951 float hp1 = GetHealth01("","");
10952 float hp2 = other_item.GetHealth01("","");
10953 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10954 hpResult = hpResult / (
GetQuantity() + quantity_used);
10955
10956 hpResult *= GetMaxHealth();
10957 Math.Round(hpResult);
10958 SetHealth("", "Health", hpResult);
10959
10961 other_item.AddQuantity(-quantity_used);
10962 }
10963 }
10965 }
10966
10968 {
10969 #ifdef SERVER
10970 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10971 GetHierarchyParent().IncreaseLifetimeUp();
10972 #endif
10973 };
10974
10976 {
10977 PlayerBase p = PlayerBase.Cast(player);
10978
10979 array<int> recipesIds = p.m_Recipes;
10980 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10981 if (moduleRecipesManager)
10982 {
10983 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10984 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10985 }
10986
10987 for (int i = 0;i < recipesIds.Count(); i++)
10988 {
10989 int key = recipesIds.Get(i);
10990 string recipeName = moduleRecipesManager.GetRecipeName(key);
10992 }
10993 }
10994
10995
10996 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10997 {
10998 super.GetDebugActions(outputList);
10999
11000
11006
11007
11012
11017
11018
11022
11023
11025 {
11029 }
11030
11033
11034
11038
11040
11041 InventoryLocation loc = new InventoryLocation();
11042 GetInventory().GetCurrentInventoryLocation(loc);
11044 {
11045 if (Gizmo_IsSupported())
11048 }
11049
11051 }
11052
11053
11054
11055
11057 {
11058 super.OnAction(action_id, player, ctx);
11059
11061 {
11062 switch (action_id)
11063 {
11066 return true;
11069 return true;
11070 }
11071 }
11072
11074 {
11075 switch (action_id)
11076 {
11078 Delete();
11079 return true;
11080 }
11081 }
11082
11083 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11084 {
11085 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11086 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11087 PlayerBase p = PlayerBase.Cast(player);
11088 if (
EActions.RECIPES_RANGE_START < 1000)
11089 {
11090 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11091 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11092 }
11093 }
11094 #ifndef SERVER
11095 else if (action_id ==
EActions.WATCH_PLAYER)
11096 {
11097 PluginDeveloper.SetDeveloperItemClientEx(player);
11098 }
11099 #endif
11101 {
11102 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11103 {
11104 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11105 OnDebugButtonPressServer(id + 1);
11106 }
11107
11108 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11109 {
11110 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11112 }
11113
11114 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11115 {
11116 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11118 }
11119
11120 else if (action_id ==
EActions.ADD_QUANTITY)
11121 {
11122 if (IsMagazine())
11123 {
11124 Magazine mag = Magazine.Cast(this);
11125 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11126 }
11127 else
11128 {
11130 }
11131
11132 if (m_EM)
11133 {
11134 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11135 }
11136
11137 }
11138
11139 else if (action_id ==
EActions.REMOVE_QUANTITY)
11140 {
11141 if (IsMagazine())
11142 {
11143 Magazine mag2 = Magazine.Cast(this);
11144 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11145 }
11146 else
11147 {
11149 }
11150 if (m_EM)
11151 {
11152 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11153 }
11154
11155 }
11156
11157 else if (action_id ==
EActions.SET_QUANTITY_0)
11158 {
11160
11161 if (m_EM)
11162 {
11163 m_EM.SetEnergy(0);
11164 }
11165 }
11166
11167 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11168 {
11170
11171 if (m_EM)
11172 {
11173 m_EM.SetEnergy(m_EM.GetEnergyMax());
11174 }
11175 }
11176
11177 else if (action_id ==
EActions.ADD_HEALTH)
11178 {
11179 AddHealth("","",GetMaxHealth("","Health")/5);
11180 }
11181 else if (action_id ==
EActions.REMOVE_HEALTH)
11182 {
11183 AddHealth("","",-GetMaxHealth("","Health")/5);
11184 }
11185 else if (action_id ==
EActions.DESTROY_HEALTH)
11186 {
11187 SetHealth01("","",0);
11188 }
11189 else if (action_id ==
EActions.WATCH_ITEM)
11190 {
11192 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11193 #ifdef DEVELOPER
11194 SetDebugDeveloper_item(this);
11195 #endif
11196 }
11197
11198 else if (action_id ==
EActions.ADD_TEMPERATURE)
11199 {
11200 AddTemperature(20);
11201
11202 }
11203
11204 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11205 {
11206 AddTemperature(-20);
11207
11208 }
11209
11210 else if (action_id ==
EActions.FLIP_FROZEN)
11211 {
11212 SetFrozen(!GetIsFrozen());
11213
11214 }
11215
11216 else if (action_id ==
EActions.ADD_WETNESS)
11217 {
11219
11220 }
11221
11222 else if (action_id ==
EActions.REMOVE_WETNESS)
11223 {
11225
11226 }
11227
11228 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11229 {
11232
11233
11234 }
11235
11236 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11237 {
11240 }
11241
11242 else if (action_id ==
EActions.MAKE_SPECIAL)
11243 {
11244 auto debugParams = DebugSpawnParams.WithPlayer(player);
11245 OnDebugSpawnEx(debugParams);
11246 }
11247
11248 }
11249
11250
11251 return false;
11252 }
11253
11254
11255
11256
11260
11263
11264
11265
11267 {
11268 return false;
11269 }
11270
11271
11273 {
11274 return true;
11275 }
11276
11277
11279 {
11280 return true;
11281 }
11282
11283
11284
11286 {
11287 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11289 }
11290
11293 {
11294 return null;
11295 }
11296
11298 {
11299 return false;
11300 }
11301
11303 {
11304 return false;
11305 }
11306
11310
11311
11313 {
11314 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11315 return module_repairing.CanRepair(this, item_repair_kit);
11316 }
11317
11318
11319 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11320 {
11321 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11322 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11323 }
11324
11325
11327 {
11328
11329
11330
11331
11332
11333
11334
11335
11336 return 1;
11337 }
11338
11339
11340
11342 {
11344 }
11345
11346
11347
11349 {
11351 }
11352
11353
11362 {
11363 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11364
11365 if (player)
11366 {
11367 player.MessageStatus(text);
11368 }
11369 }
11370
11371
11380 {
11381 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11382
11383 if (player)
11384 {
11385 player.MessageAction(text);
11386 }
11387 }
11388
11389
11398 {
11399 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11400
11401 if (player)
11402 {
11403 player.MessageFriendly(text);
11404 }
11405 }
11406
11407
11416 {
11417 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11418
11419 if (player)
11420 {
11421 player.MessageImportant(text);
11422 }
11423 }
11424
11426 {
11427 return true;
11428 }
11429
11430
11431 override bool KindOf(
string tag)
11432 {
11433 bool found = false;
11434 string item_name = this.
GetType();
11437
11438 int array_size = item_tag_array.Count();
11439 for (int i = 0; i < array_size; i++)
11440 {
11441 if (item_tag_array.Get(i) == tag)
11442 {
11443 found = true;
11444 break;
11445 }
11446 }
11447 return found;
11448 }
11449
11450
11452 {
11453
11454 super.OnRPC(sender, rpc_type,ctx);
11455
11456
11457 switch (rpc_type)
11458 {
11459 #ifndef SERVER
11460 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11461 Param2<bool, string> p = new Param2<bool, string>(false, "");
11462
11464 return;
11465
11466 bool play = p.param1;
11467 string soundSet = p.param2;
11468
11469 if (play)
11470 {
11472 {
11474 {
11476 }
11477 }
11478 else
11479 {
11481 }
11482 }
11483 else
11484 {
11486 }
11487
11488 break;
11489 #endif
11490
11491 }
11492
11494 {
11496 }
11497 }
11498
11499
11500
11501
11503 {
11504 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11505 return plugin.GetID(
name);
11506 }
11507
11509 {
11510 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11511 return plugin.GetName(id);
11512 }
11513
11516 {
11517
11518
11519 int varFlags;
11520 if (!ctx.
Read(varFlags))
11521 return;
11522
11523 if (varFlags & ItemVariableFlags.FLOAT)
11524 {
11526 }
11527 }
11528
11530 {
11531
11532 super.SerializeNumericalVars(floats_out);
11533
11534
11535
11537 {
11539 }
11540
11542 {
11544 }
11545
11547 {
11549 }
11550
11552 {
11557 }
11558
11560 {
11562 }
11563 }
11564
11566 {
11567
11568 super.DeSerializeNumericalVars(floats);
11569
11570
11571 int index = 0;
11572 int mask = Math.Round(floats.Get(index));
11573
11574 index++;
11575
11577 {
11579 {
11581 }
11582 else
11583 {
11584 float quantity = floats.Get(index);
11585 SetQuantity(quantity,
true,
false,
false,
false);
11586 }
11587 index++;
11588 }
11589
11591 {
11592 float wet = floats.Get(index);
11594 index++;
11595 }
11596
11598 {
11599 int liquidtype = Math.Round(floats.Get(index));
11601 index++;
11602 }
11603
11605 {
11607 index++;
11609 index++;
11611 index++;
11613 index++;
11614 }
11615
11617 {
11618 int cleanness = Math.Round(floats.Get(index));
11620 index++;
11621 }
11622 }
11623
11625 {
11626 super.WriteVarsToCTX(ctx);
11627
11628
11630 {
11632 }
11633
11635 {
11637 }
11638
11640 {
11642 }
11643
11645 {
11646 int r,g,b,a;
11652 }
11653
11655 {
11657 }
11658 }
11659
11661 {
11662 if (!super.ReadVarsFromCTX(ctx,version))
11663 return false;
11664
11665 int intValue;
11666 float value;
11667
11668 if (version < 140)
11669 {
11670 if (!ctx.
Read(intValue))
11671 return false;
11672
11673 m_VariablesMask = intValue;
11674 }
11675
11677 {
11678 if (!ctx.
Read(value))
11679 return false;
11680
11682 {
11684 }
11685 else
11686 {
11688 }
11689 }
11690
11691 if (version < 140)
11692 {
11694 {
11695 if (!ctx.
Read(value))
11696 return false;
11697 SetTemperatureDirect(value);
11698 }
11699 }
11700
11702 {
11703 if (!ctx.
Read(value))
11704 return false;
11706 }
11707
11709 {
11710 if (!ctx.
Read(intValue))
11711 return false;
11713 }
11714
11716 {
11717 int r,g,b,a;
11719 return false;
11721 return false;
11723 return false;
11725 return false;
11726
11728 }
11729
11731 {
11732 if (!ctx.
Read(intValue))
11733 return false;
11735 }
11736
11737 if (version >= 138 && version < 140)
11738 {
11740 {
11741 if (!ctx.
Read(intValue))
11742 return false;
11743 SetFrozen(intValue);
11744 }
11745 }
11746
11747 return true;
11748 }
11749
11750
11752 {
11755 {
11757 }
11758
11759 if (!super.OnStoreLoad(ctx, version))
11760 {
11762 return false;
11763 }
11764
11765 if (version >= 114)
11766 {
11767 bool hasQuickBarIndexSaved;
11768
11769 if (!ctx.
Read(hasQuickBarIndexSaved))
11770 {
11772 return false;
11773 }
11774
11775 if (hasQuickBarIndexSaved)
11776 {
11777 int itmQBIndex;
11778
11779
11780 if (!ctx.
Read(itmQBIndex))
11781 {
11783 return false;
11784 }
11785
11786 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11787 if (itmQBIndex != -1 && parentPlayer)
11788 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11789 }
11790 }
11791 else
11792 {
11793
11794 PlayerBase player;
11795 int itemQBIndex;
11796 if (version ==
int.
MAX)
11797 {
11798 if (!ctx.
Read(itemQBIndex))
11799 {
11801 return false;
11802 }
11803 }
11804 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11805 {
11806
11807 if (!ctx.
Read(itemQBIndex))
11808 {
11810 return false;
11811 }
11812 if (itemQBIndex != -1 && player)
11813 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11814 }
11815 }
11816
11817 if (version < 140)
11818 {
11819
11820 if (!LoadVariables(ctx, version))
11821 {
11823 return false;
11824 }
11825 }
11826
11827
11829 {
11831 return false;
11832 }
11833 if (version >= 132)
11834 {
11836 if (raib)
11837 {
11839 {
11841 return false;
11842 }
11843 }
11844 }
11845
11847 return true;
11848 }
11849
11850
11851
11853 {
11854 super.OnStoreSave(ctx);
11855
11856 PlayerBase player;
11857 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11858 {
11860
11861 int itemQBIndex = -1;
11862 itemQBIndex = player.FindQuickBarEntityIndex(this);
11863 ctx.
Write(itemQBIndex);
11864 }
11865 else
11866 {
11868 }
11869
11871
11873 if (raib)
11874 {
11876 }
11877 }
11878
11879
11881 {
11882 super.AfterStoreLoad();
11883
11885 {
11887 }
11888
11890 {
11893 }
11894 }
11895
11897 {
11898 super.EEOnAfterLoad();
11899
11901 {
11903 }
11904
11907 }
11908
11910 {
11911 return false;
11912 }
11913
11914
11915
11917 {
11919 {
11920 #ifdef PLATFORM_CONSOLE
11921
11923 {
11925 if (menu)
11926 {
11928 }
11929 }
11930 #endif
11931 }
11932
11934 {
11937 }
11938
11940 {
11941 SetWeightDirty();
11943 }
11945 {
11948 }
11949
11951 {
11954 }
11956 {
11959 }
11960
11961 super.OnVariablesSynchronized();
11962 }
11963
11964
11965
11967 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11968 {
11969 if (!IsServerCheck(allow_client))
11970 return false;
11971
11973 return false;
11974
11977
11978 if (value <= (min + 0.001))
11979 value = min;
11980
11981 if (value == min)
11982 {
11983 if (destroy_config)
11984 {
11985 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11986 if (dstr)
11987 {
11989 this.Delete();
11990 return true;
11991 }
11992 }
11993 else if (destroy_forced)
11994 {
11996 this.Delete();
11997 return true;
11998 }
11999
12001 }
12002
12005
12007 {
12009
12010 if (delta)
12012 }
12013
12015
12016 return false;
12017 }
12018
12019
12021 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12022 {
12024 }
12025
12027 {
12030 }
12031
12033 {
12036 }
12037
12039 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12040 {
12041 float value_clamped = Math.Clamp(value, 0, 1);
12043 SetQuantity(result, destroy_config, destroy_forced);
12044 }
12045
12046
12049 {
12051 }
12052
12054 {
12056 }
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12068 {
12069 int slot = -1;
12070 if (GetInventory())
12071 {
12072 InventoryLocation il = new InventoryLocation;
12073 GetInventory().GetCurrentInventoryLocation(il);
12075 }
12076
12078 }
12079
12081 {
12082 float quantity_max = 0;
12083
12085 {
12086 if (attSlotID != -1)
12087 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12088
12089 if (quantity_max <= 0)
12091 }
12092
12093 if (quantity_max <= 0)
12095
12096 return quantity_max;
12097 }
12098
12100 {
12102 }
12103
12105 {
12107 }
12108
12109
12111 {
12113 }
12114
12116 {
12118 }
12119
12121 {
12123 }
12124
12125
12127 {
12128
12129 float weightEx = GetWeightEx();
12130 float special = GetInventoryAndCargoWeight();
12131 return weightEx - special;
12132 }
12133
12134
12136 {
12138 }
12139
12141 {
12143 {
12144 #ifdef DEVELOPER
12145 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12146 {
12147 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12149 }
12150 #endif
12151
12152 return GetQuantity() * GetConfigWeightModified();
12153 }
12154 else if (HasEnergyManager())
12155 {
12156 #ifdef DEVELOPER
12157 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12158 {
12159 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12160 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12161 }
12162 #endif
12163 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12164 }
12165 else
12166 {
12167 #ifdef DEVELOPER
12168 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12169 {
12170 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12171 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12172 }
12173 #endif
12174 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12175 }
12176 }
12177
12180 {
12181 int item_count = 0;
12183
12184 if (GetInventory().GetCargo() != NULL)
12185 {
12186 item_count = GetInventory().GetCargo().GetItemCount();
12187 }
12188
12189 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12190 {
12191 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12192 if (item)
12193 item_count += item.GetNumberOfItems();
12194 }
12195 return item_count;
12196 }
12197
12200 {
12201 float weight = 0;
12202 float wetness = 1;
12203 if (include_wetness)
12206 {
12207 weight = wetness * m_ConfigWeight;
12208 }
12210 {
12211 weight = 1;
12212 }
12213 return weight;
12214 }
12215
12216
12217
12219 {
12220 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12221 {
12222 GameInventory inv = GetInventory();
12223 array<EntityAI> items = new array<EntityAI>;
12225 for (int i = 0; i < items.Count(); i++)
12226 {
12228 if (item)
12229 {
12231 }
12232 }
12233 }
12234 }
12235
12236
12237
12238
12240 {
12241 float energy = 0;
12242 if (HasEnergyManager())
12243 {
12244 energy = GetCompEM().GetEnergy();
12245 }
12246 return energy;
12247 }
12248
12249
12251 {
12252 super.OnEnergyConsumed();
12253
12255 }
12256
12258 {
12259 super.OnEnergyAdded();
12260
12262 }
12263
12264
12266 {
12267 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12268 {
12270 {
12271 float energy_0to1 = GetCompEM().GetEnergy0To1();
12273 }
12274 }
12275 }
12276
12277
12279 {
12280 return ConfigGetFloat("heatIsolation");
12281 }
12282
12284 {
12286 }
12287
12289 {
12290 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12291 if (
GetGame().ConfigIsExisting(paramPath))
12293
12294 return 0.0;
12295 }
12296
12298 {
12299 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12300 if (
GetGame().ConfigIsExisting(paramPath))
12302
12303 return 0.0;
12304 }
12305
12306 override void SetWet(
float value,
bool allow_client =
false)
12307 {
12308 if (!IsServerCheck(allow_client))
12309 return;
12310
12313
12315
12316 m_VarWet = Math.Clamp(value, min, max);
12317
12319 {
12322 }
12323 }
12324
12325 override void AddWet(
float value)
12326 {
12328 }
12329
12331 {
12333 }
12334
12336 {
12338 }
12339
12341 {
12343 }
12344
12346 {
12348 }
12349
12351 {
12353 }
12354
12355 override void OnWetChanged(
float newVal,
float oldVal)
12356 {
12359 if (newLevel != oldLevel)
12360 {
12362 }
12363 }
12364
12366 {
12367 SetWeightDirty();
12368 }
12369
12371 {
12372 return GetWetLevelInternal(
m_VarWet);
12373 }
12374
12375
12376
12378 {
12380 }
12381
12383 {
12385 }
12386
12388 {
12390 }
12391
12393 {
12395 }
12396
12397
12398
12400 {
12401 if (ConfigIsExisting("itemModelLength"))
12402 {
12403 return ConfigGetFloat("itemModelLength");
12404 }
12405 return 0;
12406 }
12407
12409 {
12410 if (ConfigIsExisting("itemAttachOffset"))
12411 {
12412 return ConfigGetFloat("itemAttachOffset");
12413 }
12414 return 0;
12415 }
12416
12417 override void SetCleanness(
int value,
bool allow_client =
false)
12418 {
12419 if (!IsServerCheck(allow_client))
12420 return;
12421
12423
12425
12428 }
12429
12431 {
12433 }
12434
12436 {
12437 return true;
12438 }
12439
12440
12441
12442
12444 {
12446 }
12447
12449 {
12451 }
12452
12453
12454
12455
12456 override void SetColor(
int r,
int g,
int b,
int a)
12457 {
12463 }
12465 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12466 {
12471 }
12472
12474 {
12476 }
12477
12480 {
12481 int r,g,b,a;
12483 r = r/255;
12484 g = g/255;
12485 b = b/255;
12486 a = a/255;
12487 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12488 }
12489
12490
12491
12492 override void SetLiquidType(
int value,
bool allow_client =
false)
12493 {
12494 if (!IsServerCheck(allow_client))
12495 return;
12496
12501 }
12502
12504 {
12505 return ConfigGetInt("varLiquidTypeInit");
12506 }
12507
12509 {
12511 }
12512
12514 {
12516 SetFrozen(false);
12517 }
12518
12521 {
12522 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12523 }
12524
12525
12528 {
12529 PlayerBase nplayer;
12530 if (PlayerBase.CastTo(nplayer, player))
12531 {
12533
12534 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12535 }
12536 }
12537
12538
12541 {
12542 PlayerBase nplayer;
12543 if (PlayerBase.CastTo(nplayer,player))
12544 {
12545
12546 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12547
12548 }
12549
12550
12551 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12552
12553
12554 if (HasEnergyManager())
12555 {
12556 GetCompEM().UpdatePlugState();
12557 }
12558 }
12559
12560
12562 {
12563 super.OnPlacementStarted(player);
12564
12566 }
12567
12568 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12569 {
12571 {
12572 m_AdminLog.OnPlacementComplete(player,
this);
12573 }
12574
12575 super.OnPlacementComplete(player, position, orientation);
12576 }
12577
12578
12579
12580
12581
12583 {
12585 {
12586 return true;
12587 }
12588 else
12589 {
12590 return false;
12591 }
12592 }
12593
12594
12596 {
12598 {
12600 }
12601 }
12602
12603
12605 {
12607 }
12608
12610 {
12612 }
12613
12614 override void InsertAgent(
int agent,
float count = 1)
12615 {
12616 if (count < 1)
12617 return;
12618
12620 }
12621
12624 {
12626 }
12627
12628
12630 {
12632 }
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12676 {
12678 return false;
12679 return true;
12680 }
12681
12683 {
12684
12686 }
12687
12688
12691 {
12692 super.CheckForRoofLimited(timeTresholdMS);
12693
12695 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12696 {
12697 m_PreviousRoofTestTime = time;
12698 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12699 }
12700 }
12701
12702
12704 {
12706 {
12707 return 0;
12708 }
12709
12710 if (GetInventory().GetAttachmentSlotsCount() != 0)
12711 {
12712 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12713 if (filter)
12714 return filter.GetProtectionLevel(type, false, system);
12715 else
12716 return 0;
12717 }
12718
12719 string subclassPath, entryName;
12720
12721 switch (type)
12722 {
12724 entryName = "biological";
12725 break;
12727 entryName = "chemical";
12728 break;
12729 default:
12730 entryName = "biological";
12731 break;
12732 }
12733
12734 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12735
12737 }
12738
12739
12740
12743 {
12744 if (!IsMagazine())
12746
12748 }
12749
12750
12751
12752
12753
12758 {
12759 return true;
12760 }
12761
12763 {
12765 }
12766
12767
12768
12769
12770
12772 {
12773 if (parent)
12774 {
12775 if (parent.IsInherited(DayZInfected))
12776 return true;
12777
12778 if (!parent.IsRuined())
12779 return true;
12780 }
12781
12782 return true;
12783 }
12784
12786 {
12787 if (!super.CanPutAsAttachment(parent))
12788 {
12789 return false;
12790 }
12791
12792 if (!IsRuined() && !parent.IsRuined())
12793 {
12794 return true;
12795 }
12796
12797 return false;
12798 }
12799
12801 {
12802
12803
12804
12805
12806 return super.CanReceiveItemIntoCargo(item);
12807 }
12808
12810 {
12811
12812
12813
12814
12815 GameInventory attachmentInv = attachment.GetInventory();
12817 {
12818 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12819 return false;
12820 }
12821
12822 InventoryLocation loc = new InventoryLocation();
12823 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12824 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12825 return false;
12826
12827 return super.CanReceiveAttachment(attachment, slotId);
12828 }
12829
12831 {
12832 if (!super.CanReleaseAttachment(attachment))
12833 return false;
12834
12835 return GetInventory().AreChildrenAccessible();
12836 }
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12859 {
12860 int id = muzzle_owner.GetMuzzleID();
12861 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12862
12863 if (WPOF_array)
12864 {
12865 for (int i = 0; i < WPOF_array.Count(); i++)
12866 {
12867 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12868
12869 if (WPOF)
12870 {
12871 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12872 }
12873 }
12874 }
12875 }
12876
12877
12879 {
12880 int id = muzzle_owner.GetMuzzleID();
12882
12883 if (WPOBE_array)
12884 {
12885 for (int i = 0; i < WPOBE_array.Count(); i++)
12886 {
12887 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12888
12889 if (WPOBE)
12890 {
12891 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12892 }
12893 }
12894 }
12895 }
12896
12897
12899 {
12900 int id = muzzle_owner.GetMuzzleID();
12901 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12902
12903 if (WPOOH_array)
12904 {
12905 for (int i = 0; i < WPOOH_array.Count(); i++)
12906 {
12907 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12908
12909 if (WPOOH)
12910 {
12911 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12912 }
12913 }
12914 }
12915 }
12916
12917
12919 {
12920 int id = muzzle_owner.GetMuzzleID();
12921 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12922
12923 if (WPOOH_array)
12924 {
12925 for (int i = 0; i < WPOOH_array.Count(); i++)
12926 {
12927 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12928
12929 if (WPOOH)
12930 {
12931 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12932 }
12933 }
12934 }
12935 }
12936
12937
12939 {
12940 int id = muzzle_owner.GetMuzzleID();
12941 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12942
12943 if (WPOOH_array)
12944 {
12945 for (int i = 0; i < WPOOH_array.Count(); i++)
12946 {
12947 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12948
12949 if (WPOOH)
12950 {
12951 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12952 }
12953 }
12954 }
12955 }
12956
12957
12958
12960 {
12962 {
12963 return true;
12964 }
12965
12966 return false;
12967 }
12968
12970 {
12972 {
12973 return true;
12974 }
12975
12976 return false;
12977 }
12978
12980 {
12982 {
12983 return true;
12984 }
12985
12986 return false;
12987 }
12988
12990 {
12991 return false;
12992 }
12993
12996 {
12997 return UATimeSpent.DEFAULT_DEPLOY;
12998 }
12999
13000
13001
13002
13004 {
13006 SetSynchDirty();
13007 }
13008
13010 {
13012 }
13013
13014
13016 {
13017 return false;
13018 }
13019
13022 {
13023 string att_type = "None";
13024
13025 if (ConfigIsExisting("soundAttType"))
13026 {
13027 att_type = ConfigGetString("soundAttType");
13028 }
13029
13031 }
13032
13034 {
13036 }
13037
13038
13039
13040
13041
13047
13049 {
13052
13054 }
13055
13056
13058 {
13060 return;
13061
13063
13066
13069
13070 SoundParameters params = new SoundParameters();
13074 }
13075
13076
13078 {
13080 return;
13081
13083 SetSynchDirty();
13084
13087 }
13088
13089
13091 {
13093 return;
13094
13096 SetSynchDirty();
13097
13100 }
13101
13103 {
13105 }
13106
13108 {
13110 }
13111
13114 {
13115 if (!
GetGame().IsDedicatedServer())
13116 {
13117 if (ConfigIsExisting("attachSoundSet"))
13118 {
13119 string cfg_path = "";
13120 string soundset = "";
13121 string type_name =
GetType();
13122
13125 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13126 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13127
13128 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13129 {
13130 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13131 {
13132 if (cfg_slot_array[i] == slot_type)
13133 {
13134 soundset = cfg_soundset_array[i];
13135 break;
13136 }
13137 }
13138 }
13139
13140 if (soundset != "")
13141 {
13142 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13144 }
13145 }
13146 }
13147 }
13148
13150 {
13151
13152 }
13153
13154 void OnApply(PlayerBase player);
13155
13157 {
13158 return 1.0;
13159 };
13160
13162 {
13164 }
13165
13167 {
13169 }
13170
13172
13174 {
13175 SetDynamicPhysicsLifeTime(0.01);
13177 }
13178
13180 {
13181 array<string> zone_names = new array<string>;
13182 GetDamageZones(zone_names);
13183 for (int i = 0; i < zone_names.Count(); i++)
13184 {
13185 SetHealthMax(zone_names.Get(i),"Health");
13186 }
13187 SetHealthMax("","Health");
13188 }
13189
13192 {
13193 float global_health = GetHealth01("","Health");
13194 array<string> zones = new array<string>;
13195 GetDamageZones(zones);
13196
13197 for (int i = 0; i < zones.Count(); i++)
13198 {
13199 SetHealth01(zones.Get(i),"Health",global_health);
13200 }
13201 }
13202
13205 {
13206 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13207 }
13208
13210 {
13211 if (!hasRootAsPlayer)
13212 {
13213 if (refParentIB)
13214 {
13215
13216 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13217 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13218
13219 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13220 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13221
13224 }
13225 else
13226 {
13227
13230 }
13231 }
13232 }
13233
13235 {
13237 {
13238 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13239 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13240 {
13241 float heatPermCoef = 1.0;
13243 while (ent)
13244 {
13245 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13246 ent = ent.GetHierarchyParent();
13247 }
13248
13249 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13250 }
13251 }
13252 }
13253
13255 {
13256
13257 EntityAI parent = GetHierarchyParent();
13258 if (!parent)
13259 {
13260 hasParent = false;
13261 hasRootAsPlayer = false;
13262 }
13263 else
13264 {
13265 hasParent = true;
13266 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13267 refParentIB =
ItemBase.Cast(parent);
13268 }
13269 }
13270
13271 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13272 {
13273
13274 }
13275
13277 {
13278
13279 return false;
13280 }
13281
13283 {
13284
13285
13286 return false;
13287 }
13288
13290 {
13291
13292 return false;
13293 }
13294
13297 {
13298 return !GetIsFrozen() &&
IsOpen();
13299 }
13300
13302 {
13303 bool hasParent = false, hasRootAsPlayer = false;
13305
13306 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13307 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13308
13309 if (wwtu || foodDecay)
13310 {
13314
13315 if (processWetness || processTemperature || processDecay)
13316 {
13318
13319 if (processWetness)
13320 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13321
13322 if (processTemperature)
13324
13325 if (processDecay)
13326 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13327 }
13328 }
13329 }
13330
13333 {
13335 }
13336
13338 {
13341
13342 return super.GetTemperatureFreezeThreshold();
13343 }
13344
13346 {
13349
13350 return super.GetTemperatureThawThreshold();
13351 }
13352
13354 {
13357
13358 return super.GetItemOverheatThreshold();
13359 }
13360
13362 {
13364 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13365
13366 return super.GetTemperatureFreezeTime();
13367 }
13368
13370 {
13372 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13373
13374 return super.GetTemperatureThawTime();
13375 }
13376
13381
13383 {
13384 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13385 }
13386
13388 {
13389 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13390 }
13391
13394 {
13396 }
13397
13399 {
13401 }
13402
13404 {
13406 }
13407
13410 {
13411 return null;
13412 }
13413
13416 {
13417 return false;
13418 }
13419
13421 {
13423 {
13426 if (!trg)
13427 {
13429 explosive = this;
13430 }
13431
13432 explosive.PairRemote(trg);
13434
13435 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13436 trg.SetPersistentPairID(persistentID);
13437 explosive.SetPersistentPairID(persistentID);
13438
13439 return true;
13440 }
13441 return false;
13442 }
13443
13446 {
13447 float ret = 1.0;
13450 ret *= GetHealth01();
13451
13452 return ret;
13453 }
13454
13455 #ifdef DEVELOPER
13456 override void SetDebugItem()
13457 {
13458 super.SetDebugItem();
13459 _itemBase = this;
13460 }
13461
13463 {
13464 string text = super.GetDebugText();
13465
13467 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13468
13469 return text;
13470 }
13471 #endif
13472
13474 {
13475 return true;
13476 }
13477
13479
13481
13483 {
13486 }
13487
13488
13496
13512}
13513
13515{
13517 if (entity)
13518 {
13519 bool is_item = entity.IsInherited(
ItemBase);
13520 if (is_item && full_quantity)
13521 {
13524 }
13525 }
13526 else
13527 {
13529 return NULL;
13530 }
13531 return entity;
13532}
13533
13535{
13536 if (item)
13537 {
13538 if (health > 0)
13539 item.SetHealth("", "", health);
13540
13541 if (item.CanHaveTemperature())
13542 {
13544 if (item.CanFreeze())
13545 item.SetFrozen(false);
13546 }
13547
13548 if (item.HasEnergyManager())
13549 {
13550 if (quantity >= 0)
13551 {
13552 item.GetCompEM().SetEnergy0To1(quantity);
13553 }
13554 else
13555 {
13557 }
13558 }
13559 else if (item.IsMagazine())
13560 {
13561 Magazine mag = Magazine.Cast(item);
13562 if (quantity >= 0)
13563 {
13564 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13565 }
13566 else
13567 {
13569 }
13570
13571 }
13572 else
13573 {
13574 if (quantity >= 0)
13575 {
13576 item.SetQuantityNormalized(quantity, false);
13577 }
13578 else
13579 {
13581 }
13582
13583 }
13584 }
13585}
13586
13587#ifdef DEVELOPER
13589#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.