8901{
8903 {
8904 return true;
8905 }
8906};
8907
8908
8909
8911{
8915
8917
8920
8921
8922
8923
8924
8933
8939
8944
8949
8970 protected bool m_IsResultOfSplit
8971
8973
8978
8979
8980
8982
8986
8987
8988
8990
8993
8994
8995
9001
9002
9010
9013
9014
9016
9017
9019
9020
9025
9026
9031
9032
9034
9035
9037 {
9042
9043 if (!
GetGame().IsDedicatedServer())
9044 {
9046 {
9048
9050 {
9052 }
9053 }
9054
9057 }
9058
9059 m_OldLocation = null;
9060
9062 {
9064 }
9065
9066 if (ConfigIsExisting("headSelectionsToHide"))
9067 {
9070 }
9071
9073 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9074 {
9076 }
9077
9079
9080 m_IsResultOfSplit = false;
9081
9083 }
9084
9086 {
9087 super.InitItemVariables();
9088
9094 m_Count = ConfigGetInt(
"count");
9095
9098
9103
9106
9111
9123
9127
9128
9131 if (ConfigIsExisting("canBeSplit"))
9132 {
9135 }
9136
9138 if (ConfigIsExisting("itemBehaviour"))
9140
9141
9144 RegisterNetSyncVariableInt("m_VarLiquidType");
9145 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9146
9147 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9148 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9149 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9150
9151 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9152 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9153 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9154 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9155
9156 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9157 RegisterNetSyncVariableBool("m_IsTakeable");
9158 RegisterNetSyncVariableBool("m_IsHologram");
9159
9162 {
9165 }
9166
9168
9170 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9172
9173 }
9174
9176 {
9178 }
9179
9181 {
9184 {
9189 }
9190 }
9191
9192 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9193 {
9195 {
9198 }
9199
9201 }
9202
9204 {
9210 }
9211
9213
9215 {
9217
9218 if (!action)
9219 {
9220 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9221 return;
9222 }
9223
9225 if (!ai)
9226 {
9228 return;
9229 }
9230
9232 if (!action_array)
9233 {
9234 action_array = new array<ActionBase_Basic>;
9236 }
9237 if (LogManager.IsActionLogEnable())
9238 {
9239 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9240 }
9241
9242 if (action_array.Find(action) != -1)
9243 {
9244 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9245 }
9246 else
9247 {
9248 action_array.Insert(action);
9249 }
9250 }
9251
9253 {
9255 ActionBase action = player.GetActionManager().GetAction(actionName);
9258
9259 if (action_array)
9260 {
9261 action_array.RemoveItem(action);
9262 }
9263 }
9264
9265
9266
9268 {
9269 ActionOverrideData overrideData = new ActionOverrideData();
9273
9275 if (!actionMap)
9276 {
9279 }
9280
9281 actionMap.Insert(this.
Type(), overrideData);
9282
9283 }
9284
9286
9288
9289
9291 {
9294
9297
9298 string config_to_search = "CfgVehicles";
9299 string muzzle_owner_config;
9300
9302 {
9303 if (IsInherited(Weapon))
9304 config_to_search = "CfgWeapons";
9305
9306 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9307
9308 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9309
9311
9312 if (config_OnFire_subclass_count > 0)
9313 {
9314 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9315
9316 for (int i = 0; i < config_OnFire_subclass_count; i++)
9317 {
9318 string particle_class = "";
9320 string config_OnFire_entry = config_OnFire_class + particle_class;
9321 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9322 WPOF_array.Insert(WPOF);
9323 }
9324
9325
9327 }
9328 }
9329
9331 {
9332 config_to_search = "CfgWeapons";
9333 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9334
9335 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9336
9338
9339 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9340 {
9341 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9342
9343 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9344 {
9345 string particle_class2 = "";
9347 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9348 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9349 WPOBE_array.Insert(WPOBE);
9350 }
9351
9352
9354 }
9355 }
9356 }
9357
9358
9360 {
9363
9365 {
9366 string config_to_search = "CfgVehicles";
9367
9368 if (IsInherited(Weapon))
9369 config_to_search = "CfgWeapons";
9370
9371 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9372 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9373
9374 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9375 {
9376
9378
9380 {
9382 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9384 return;
9385 }
9386
9389
9390
9391
9393 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9394
9395 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9396 {
9397 string particle_class = "";
9399 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9401
9402 if (entry_type == CT_CLASS)
9403 {
9404 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9405 WPOOH_array.Insert(WPOF);
9406 }
9407 }
9408
9409
9411 }
9412 }
9413 }
9414
9416 {
9418 }
9419
9421 {
9423 {
9425
9428
9431
9432 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9433 }
9434 }
9435
9437 {
9439 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9440
9442 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9443
9445 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9446
9448 {
9450 }
9451 }
9452
9454 {
9456 }
9457
9459 {
9462 else
9464
9466 {
9469 }
9470 else
9471 {
9474
9477 }
9478
9480 }
9481
9483 {
9485 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9486 }
9487
9489 {
9491 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9493 }
9494
9496 {
9498 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9499 }
9500
9502 {
9505
9506 OverheatingParticle OP = new OverheatingParticle();
9511
9513 }
9514
9516 {
9519
9520 return -1;
9521 }
9522
9524 {
9526 {
9529
9530 for (int i = count; i > 0; --i)
9531 {
9532 int id = i - 1;
9535
9538
9539 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9540 {
9541 if (p)
9542 {
9545 }
9546 }
9547 }
9548 }
9549 }
9550
9552 {
9554 {
9556 {
9557 int id = i - 1;
9559
9560 if (OP)
9561 {
9563
9564 if (p)
9565 {
9567 }
9568
9569 delete OP;
9570 }
9571 }
9572
9575 }
9576 }
9577
9580 {
9581 return 0.0;
9582 }
9583
9584
9586 {
9587 return 250;
9588 }
9589
9591 {
9592 return 0;
9593 }
9594
9597 {
9599 return true;
9600
9601 return false;
9602 }
9603
9606 {
9609
9611 {
9613 }
9614 else
9615 {
9616
9618 }
9619
9621 }
9622
9629 {
9630 return -1;
9631 }
9632
9633
9634
9635
9637 {
9639 {
9641 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9642
9643 if (r_index >= 0)
9644 {
9645 InventoryLocation r_il = new InventoryLocation;
9646 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9647
9648 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9651 {
9652 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9653 }
9655 {
9656 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9657 }
9658
9659 }
9660
9661 player.GetHumanInventory().ClearUserReservedLocation(this);
9662 }
9663
9666 }
9667
9668
9669
9670
9672 {
9673 return ItemBase.m_DebugActionsMask;
9674 }
9675
9677 {
9678 return ItemBase.m_DebugActionsMask & mask;
9679 }
9680
9682 {
9683 ItemBase.m_DebugActionsMask = mask;
9684 }
9685
9687 {
9688 ItemBase.m_DebugActionsMask |= mask;
9689 }
9690
9692 {
9693 ItemBase.m_DebugActionsMask &= ~mask;
9694 }
9695
9697 {
9699 {
9701 }
9702 else
9703 {
9705 }
9706 }
9707
9708
9710 {
9711 if (GetEconomyProfile())
9712 {
9713 float q_max = GetEconomyProfile().GetQuantityMax();
9714 if (q_max > 0)
9715 {
9716 float q_min = GetEconomyProfile().GetQuantityMin();
9717 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9718
9720 {
9721 ComponentEnergyManager comp = GetCompEM();
9723 {
9725 }
9726 }
9728 {
9730
9731 }
9732
9733 }
9734 }
9735 }
9736
9739 {
9740 EntityAI parent = GetHierarchyParent();
9741
9742 if (parent)
9743 {
9744 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9745 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9746 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9747 }
9748 }
9749
9752 {
9753 EntityAI parent = GetHierarchyParent();
9754
9755 if (parent)
9756 {
9757 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9758 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9759 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9760 }
9761 }
9762
9764 {
9765
9766
9767
9768
9770
9772 {
9773 if (ScriptInputUserData.CanStoreInputUserData())
9774 {
9775 ScriptInputUserData ctx = new ScriptInputUserData;
9781 ctx.
Write(use_stack_max);
9784
9786 {
9787 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9788 }
9789 }
9790 }
9791 else if (!
GetGame().IsMultiplayer())
9792 {
9794 }
9795 }
9796
9798 {
9800 }
9801
9803 {
9805 }
9806
9808 {
9810 }
9811
9813 {
9814
9815 return false;
9816 }
9817
9819 {
9820 return false;
9821 }
9822
9826 {
9827 return false;
9828 }
9829
9831 {
9832 return "";
9833 }
9834
9836
9838 {
9839 return false;
9840 }
9841
9843 {
9844 return true;
9845 }
9846
9847
9848
9850 {
9851 return true;
9852 }
9853
9855 {
9856 return true;
9857 }
9858
9860 {
9861 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9863 }
9864
9866 {
9868 }
9869
9871 {
9873 if (!is_being_placed)
9875 SetSynchDirty();
9876 }
9877
9878
9880
9882 {
9884 }
9885
9887 {
9889 }
9890
9892 {
9893 return 1;
9894 }
9895
9897 {
9898 return false;
9899 }
9900
9902 {
9904 SetSynchDirty();
9905 }
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9942 {
9943 super.OnMovedInsideCargo(container);
9944
9945 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9946 }
9947
9948 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9949 {
9950 super.EEItemLocationChanged(oldLoc,newLoc);
9951
9952 PlayerBase new_player = null;
9953 PlayerBase old_player = null;
9954
9955 if (newLoc.GetParent())
9956 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9957
9958 if (oldLoc.GetParent())
9959 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9960
9962 {
9963 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9964
9965 if (r_index >= 0)
9966 {
9967 InventoryLocation r_il = new InventoryLocation;
9968 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9969
9970 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9973 {
9974 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9975 }
9977 {
9978 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9979 }
9980
9981 }
9982 }
9983
9985 {
9986 if (new_player)
9987 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9988
9989 if (new_player == old_player)
9990 {
9991
9992 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9993 {
9995 {
9996 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9997 {
9998 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9999 }
10000 }
10001 else
10002 {
10003 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10004 }
10005 }
10006
10007 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10008 {
10009 int type = oldLoc.GetType();
10011 {
10012 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10013 }
10015 {
10016 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10017 }
10018 }
10019 if (!m_OldLocation)
10020 {
10021 m_OldLocation = new InventoryLocation;
10022 }
10023 m_OldLocation.Copy(oldLoc);
10024 }
10025 else
10026 {
10027 if (m_OldLocation)
10028 {
10029 m_OldLocation.Reset();
10030 }
10031 }
10032
10034 }
10035 else
10036 {
10037 if (new_player)
10038 {
10039 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10040 if (res_index >= 0)
10041 {
10042 InventoryLocation il = new InventoryLocation;
10043 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10045 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10048 {
10049 il.
GetParent().GetOnReleaseLock().Invoke(it);
10050 }
10052 {
10054 }
10055
10056 }
10057 }
10059 {
10060
10062 }
10063
10064 if (m_OldLocation)
10065 {
10066 m_OldLocation.Reset();
10067 }
10068 }
10069 }
10070
10071 override void EOnContact(IEntity other, Contact extra)
10072 {
10074 {
10075 int liquidType = -1;
10077 if (impactSpeed > 0.0)
10078 {
10080 #ifndef SERVER
10082 #else
10084 SetSynchDirty();
10085 #endif
10087 }
10088 }
10089
10090 #ifdef SERVER
10091 if (GetCompEM() && GetCompEM().IsPlugged())
10092 {
10093 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10094 GetCompEM().UnplugThis();
10095 }
10096 #endif
10097 }
10098
10100
10102 {
10104 }
10105
10107 {
10108
10109 }
10110
10112 {
10113 super.OnItemLocationChanged(old_owner, new_owner);
10114
10115 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10116 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10117
10118 if (!relatedPlayer && playerNew)
10119 relatedPlayer = playerNew;
10120
10121 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10122 {
10124 if (actionMgr)
10125 {
10126 ActionBase currentAction = actionMgr.GetRunningAction();
10127 if (currentAction)
10129 }
10130 }
10131
10132 Man ownerPlayerOld = null;
10133 Man ownerPlayerNew = null;
10134
10135 if (old_owner)
10136 {
10137 if (old_owner.
IsMan())
10138 {
10139 ownerPlayerOld = Man.Cast(old_owner);
10140 }
10141 else
10142 {
10143 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10144 }
10145 }
10146 else
10147 {
10149 {
10151
10152 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10153 {
10154 GetCompEM().UnplugThis();
10155 }
10156 }
10157 }
10158
10159 if (new_owner)
10160 {
10161 if (new_owner.
IsMan())
10162 {
10163 ownerPlayerNew = Man.Cast(new_owner);
10164 }
10165 else
10166 {
10167 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10168 }
10169 }
10170
10171 if (ownerPlayerOld != ownerPlayerNew)
10172 {
10173 if (ownerPlayerOld)
10174 {
10175 array<EntityAI> subItemsExit = new array<EntityAI>;
10177 for (int i = 0; i < subItemsExit.Count(); i++)
10178 {
10181 }
10182 }
10183
10184 if (ownerPlayerNew)
10185 {
10186 array<EntityAI> subItemsEnter = new array<EntityAI>;
10188 for (int j = 0; j < subItemsEnter.Count(); j++)
10189 {
10192 }
10193 }
10194 }
10195 else if (ownerPlayerNew != null)
10196 {
10197 PlayerBase nplayer;
10198 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10199 {
10200 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10202 for (int k = 0; k < subItemsUpdate.Count(); k++)
10203 {
10205 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10206 }
10207 }
10208 }
10209
10210 if (old_owner)
10211 old_owner.OnChildItemRemoved(this);
10212 if (new_owner)
10213 new_owner.OnChildItemReceived(this);
10214 }
10215
10216
10218 {
10219 super.EEDelete(parent);
10220 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10221 if (player)
10222 {
10224
10225 if (player.IsAlive())
10226 {
10227 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10228 if (r_index >= 0)
10229 {
10230 InventoryLocation r_il = new InventoryLocation;
10231 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10232
10233 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10236 {
10237 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10238 }
10240 {
10241 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10242 }
10243
10244 }
10245
10246 player.RemoveQuickBarEntityShortcut(this);
10247 }
10248 }
10249 }
10250
10252 {
10253 super.EEKilled(killer);
10254
10257 {
10258 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10259 {
10260 if (IsMagazine())
10261 {
10262 if (Magazine.Cast(this).GetAmmoCount() > 0)
10263 {
10265 }
10266 }
10267 else
10268 {
10270 }
10271 }
10272 }
10273 }
10274
10276 {
10277 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10278
10279 super.OnWasAttached(parent, slot_id);
10280
10283
10285 }
10286
10288 {
10289 super.OnWasDetached(parent, slot_id);
10290
10293 }
10294
10296 {
10297 int idx;
10300
10301 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10302 if (inventory_slots.Count() < 1)
10303 {
10304 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10305 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10306 }
10307 else
10308 {
10309 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10310 }
10311
10312 idx = inventory_slots.Find(slot);
10313 if (idx < 0)
10314 return "";
10315
10316 return attach_types.Get(idx);
10317 }
10318
10320 {
10321 int idx = -1;
10322 string slot;
10323
10326
10327 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10328 if (inventory_slots.Count() < 1)
10329 {
10330 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10331 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10332 }
10333 else
10334 {
10335 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10336 if (detach_types.Count() < 1)
10337 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10338 }
10339
10340 for (int i = 0; i < inventory_slots.Count(); i++)
10341 {
10342 slot = inventory_slots.Get(i);
10343 }
10344
10345 if (slot != "")
10346 {
10347 if (detach_types.Count() == 1)
10348 idx = 0;
10349 else
10350 idx = inventory_slots.Find(slot);
10351 }
10352 if (idx < 0)
10353 return "";
10354
10355 return detach_types.Get(idx);
10356 }
10357
10359 {
10360
10362
10363
10364 float min_time = 1;
10365 float max_time = 3;
10366 float delay = Math.RandomFloat(min_time, max_time);
10367
10368 explode_timer.Run(delay, this, "DoAmmoExplosion");
10369 }
10370
10372 {
10373 Magazine magazine = Magazine.Cast(this);
10374 int pop_sounds_count = 6;
10375 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10376
10377
10378 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10379 string sound_name = pop_sounds[ sound_idx ];
10381
10382
10383 magazine.ServerAddAmmoCount(-1);
10384
10385
10386 float min_temp_to_explode = 100;
10387
10388 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10389 {
10391 }
10392 }
10393
10394
10395 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10396 {
10397 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10398
10399 const int CHANCE_DAMAGE_CARGO = 4;
10400 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10401 const int CHANCE_DAMAGE_NOTHING = 2;
10402
10404 {
10405 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10406 int chances;
10407 int rnd;
10408
10409 if (GetInventory().GetCargo())
10410 {
10411 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10412 rnd = Math.RandomInt(0,chances);
10413
10414 if (rnd < CHANCE_DAMAGE_CARGO)
10415 {
10417 }
10418 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10419 {
10421 }
10422 }
10423 else
10424 {
10425 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10426 rnd = Math.RandomInt(0,chances);
10427
10428 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10429 {
10431 }
10432 }
10433 }
10434 }
10435
10437 {
10438 if (GetInventory().GetCargo())
10439 {
10440 int item_count = GetInventory().GetCargo().GetItemCount();
10441 if (item_count > 0)
10442 {
10443 int random_pick = Math.RandomInt(0, item_count);
10445 if (!item.IsExplosive())
10446 {
10447 item.AddHealth("","",damage);
10448 return true;
10449 }
10450 }
10451 }
10452 return false;
10453 }
10454
10456 {
10457 int attachment_count = GetInventory().AttachmentCount();
10458 if (attachment_count > 0)
10459 {
10460 int random_pick = Math.RandomInt(0, attachment_count);
10461 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10462 if (!attachment.IsExplosive())
10463 {
10464 attachment.AddHealth("","",damage);
10465 return true;
10466 }
10467 }
10468 return false;
10469 }
10470
10472 {
10474 }
10475
10477 {
10479 return GetInventory().CanRemoveEntity();
10480
10481 return false;
10482 }
10483
10485 {
10487 return;
10488
10490 {
10491 if (ScriptInputUserData.CanStoreInputUserData())
10492 {
10493 ScriptInputUserData ctx = new ScriptInputUserData;
10498 ctx.
Write(destination_entity);
10500 ctx.
Write(slot_id);
10502 }
10503 }
10504 else if (!
GetGame().IsMultiplayer())
10505 {
10507 }
10508 }
10509
10511 {
10513 return;
10514
10515 float split_quantity_new;
10519 InventoryLocation loc = new InventoryLocation;
10520
10521 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10522 {
10524 split_quantity_new = stack_max;
10525 else
10527
10528 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10529 if (new_item)
10530 {
10531 new_item.SetResultOfSplit(true);
10532 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10534 new_item.SetQuantity(split_quantity_new);
10535 }
10536 }
10537 else if (destination_entity && slot_id == -1)
10538 {
10539 if (quantity > stack_max)
10540 split_quantity_new = stack_max;
10541 else
10542 split_quantity_new = quantity;
10543
10545 {
10548 }
10549
10550 if (new_item)
10551 {
10552 new_item.SetResultOfSplit(true);
10553 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10555 new_item.SetQuantity(split_quantity_new);
10556 }
10557 }
10558 else
10559 {
10560 if (stack_max != 0)
10561 {
10563 {
10565 }
10566
10567 if (split_quantity_new == 0)
10568 {
10569 if (!
GetGame().IsMultiplayer())
10570 player.PhysicalPredictiveDropItem(this);
10571 else
10572 player.ServerDropEntity(this);
10573 return;
10574 }
10575
10577
10578 if (new_item)
10579 {
10580 new_item.SetResultOfSplit(true);
10581 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10583 new_item.SetQuantity(stack_max);
10584 new_item.PlaceOnSurface();
10585 }
10586 }
10587 }
10588 }
10589
10591 {
10593 return;
10594
10595 float split_quantity_new;
10599 InventoryLocation loc = new InventoryLocation;
10600
10601 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10602 {
10604 split_quantity_new = stack_max;
10605 else
10607
10608 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10609 if (new_item)
10610 {
10611 new_item.SetResultOfSplit(true);
10612 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10614 new_item.SetQuantity(split_quantity_new);
10615 }
10616 }
10617 else if (destination_entity && slot_id == -1)
10618 {
10619 if (quantity > stack_max)
10620 split_quantity_new = stack_max;
10621 else
10622 split_quantity_new = quantity;
10623
10625 {
10628 }
10629
10630 if (new_item)
10631 {
10632 new_item.SetResultOfSplit(true);
10633 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10635 new_item.SetQuantity(split_quantity_new);
10636 }
10637 }
10638 else
10639 {
10640 if (stack_max != 0)
10641 {
10643 {
10645 }
10646
10648
10649 if (new_item)
10650 {
10651 new_item.SetResultOfSplit(true);
10652 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10654 new_item.SetQuantity(stack_max);
10655 new_item.PlaceOnSurface();
10656 }
10657 }
10658 }
10659 }
10660
10662 {
10664 return;
10665
10667 {
10668 if (ScriptInputUserData.CanStoreInputUserData())
10669 {
10670 ScriptInputUserData ctx = new ScriptInputUserData;
10675 dst.WriteToContext(ctx);
10677 }
10678 }
10679 else if (!
GetGame().IsMultiplayer())
10680 {
10682 }
10683 }
10684
10686 {
10688 return;
10689
10691 {
10692 if (ScriptInputUserData.CanStoreInputUserData())
10693 {
10694 ScriptInputUserData ctx = new ScriptInputUserData;
10699 ctx.
Write(destination_entity);
10705 }
10706 }
10707 else if (!
GetGame().IsMultiplayer())
10708 {
10710 }
10711 }
10712
10714 {
10716 }
10717
10719 {
10721 return this;
10722
10724 float split_quantity_new;
10726 if (dst.IsValid())
10727 {
10728 int slot_id = dst.GetSlot();
10730
10731 if (quantity > stack_max)
10732 split_quantity_new = stack_max;
10733 else
10734 split_quantity_new = quantity;
10735
10737
10738 if (new_item)
10739 {
10740 new_item.SetResultOfSplit(true);
10741 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10744 }
10745
10746 return new_item;
10747 }
10748
10749 return null;
10750 }
10751
10753 {
10755 return;
10756
10758 float split_quantity_new;
10760 if (destination_entity)
10761 {
10763 if (quantity > stackable)
10764 split_quantity_new = stackable;
10765 else
10766 split_quantity_new = quantity;
10767
10768 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10769 if (new_item)
10770 {
10771 new_item.SetResultOfSplit(true);
10772 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10774 new_item.SetQuantity(split_quantity_new);
10775 }
10776 }
10777 }
10778
10780 {
10782 return;
10783
10785 {
10786 if (ScriptInputUserData.CanStoreInputUserData())
10787 {
10788 ScriptInputUserData ctx = new ScriptInputUserData;
10793 ItemBase destination_entity =
this;
10794 ctx.
Write(destination_entity);
10798 }
10799 }
10800 else if (!
GetGame().IsMultiplayer())
10801 {
10803 }
10804 }
10805
10807 {
10809 return;
10810
10812 float split_quantity_new;
10814 if (player)
10815 {
10817 if (quantity > stackable)
10818 split_quantity_new = stackable;
10819 else
10820 split_quantity_new = quantity;
10821
10822 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10823 new_item =
ItemBase.Cast(in_hands);
10824 if (new_item)
10825 {
10826 new_item.SetResultOfSplit(true);
10827 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10829 new_item.SetQuantity(split_quantity_new);
10830 }
10831 }
10832 }
10833
10835 {
10837 return;
10838
10840 float split_quantity_new = Math.Floor(quantity * 0.5);
10841
10843
10844 if (new_item)
10845 {
10846 if (new_item.GetQuantityMax() < split_quantity_new)
10847 {
10848 split_quantity_new = new_item.GetQuantityMax();
10849 }
10850
10851 new_item.SetResultOfSplit(true);
10852 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10853
10855 {
10858 }
10859 else
10860 {
10863 }
10864 }
10865 }
10866
10868 {
10870 return;
10871
10873 float split_quantity_new = Math.Floor(quantity / 2);
10874
10875 InventoryLocation invloc = new InventoryLocation;
10877
10879 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10880
10881 if (new_item)
10882 {
10883 if (new_item.GetQuantityMax() < split_quantity_new)
10884 {
10885 split_quantity_new = new_item.GetQuantityMax();
10886 }
10888 {
10891 }
10892 else
10893 {
10896 }
10897 }
10898 }
10899
10902 {
10903 SetWeightDirty();
10905
10906 if (parent)
10907 parent.OnAttachmentQuantityChangedEx(this, delta);
10908
10910 {
10912 {
10914 }
10916 {
10917 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10919 }
10920 }
10921
10922 }
10923
10926 {
10927
10928 }
10929
10932 {
10934 }
10935
10937 {
10938 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10939
10941 {
10942 if (newLevel == GameConstants.STATE_RUINED)
10943 {
10945 EntityAI parent = GetHierarchyParent();
10946 if (parent && parent.IsFireplace())
10947 {
10948 CargoBase cargo = GetInventory().GetCargo();
10949 if (cargo)
10950 {
10952 {
10954 }
10955 }
10956 }
10957 }
10958
10960 {
10961
10963 return;
10964 }
10965
10966 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10967 {
10969 }
10970 }
10971 }
10972
10973
10975 {
10976 super.OnRightClick();
10977
10979 {
10981 {
10982 if (ScriptInputUserData.CanStoreInputUserData())
10983 {
10984 vector m4[4];
10986
10987 EntityAI root = GetHierarchyRoot();
10988
10989 InventoryLocation dst = new InventoryLocation;
10991 {
10992 if (root)
10993 {
10994 root.GetTransform(m4);
10996 }
10997 else
10998 GetInventory().GetCurrentInventoryLocation(dst);
10999 }
11000 else
11001 {
11003
11004
11005 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11006 {
11007 if (root)
11008 {
11009 root.GetTransform(m4);
11011 }
11012 else
11013 GetInventory().GetCurrentInventoryLocation(dst);
11014 }
11015 else
11016 {
11017 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11018 }
11019 }
11020
11021 ScriptInputUserData ctx = new ScriptInputUserData;
11029 }
11030 }
11031 else if (!
GetGame().IsMultiplayer())
11032 {
11034 }
11035 }
11036 }
11037
11038 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11039 {
11040
11041 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11042 return false;
11043
11044 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11045 return false;
11046
11047
11049 return false;
11050
11051
11052 Magazine mag = Magazine.Cast(this);
11053 if (mag)
11054 {
11055 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11056 return false;
11057
11058 if (stack_max_limit)
11059 {
11060 Magazine other_mag = Magazine.Cast(other_item);
11061 if (other_item)
11062 {
11063 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11064 return false;
11065 }
11066
11067 }
11068 }
11069 else
11070 {
11071
11073 return false;
11074
11076 return false;
11077 }
11078
11079 PlayerBase player = null;
11080 if (CastTo(player, GetHierarchyRootPlayer()))
11081 {
11082 if (player.GetInventory().HasAttachment(this))
11083 return false;
11084
11085 if (player.IsItemsToDelete())
11086 return false;
11087 }
11088
11089 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11090 return false;
11091
11092 int slotID;
11094 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11095 return false;
11096
11097 return true;
11098 }
11099
11101 {
11103 }
11104
11106 {
11107 return m_IsResultOfSplit;
11108 }
11109
11111 {
11112 m_IsResultOfSplit = value;
11113 }
11114
11116 {
11118 }
11119
11121 {
11122 float other_item_quantity = other_item.GetQuantity();
11123 float this_free_space;
11124
11126
11128
11129 if (other_item_quantity > this_free_space)
11130 {
11131 return this_free_space;
11132 }
11133 else
11134 {
11135 return other_item_quantity;
11136 }
11137 }
11138
11140 {
11142 }
11143
11145 {
11147 return;
11148
11149 if (!IsMagazine() && other_item)
11150 {
11152 if (quantity_used != 0)
11153 {
11154 float hp1 = GetHealth01("","");
11155 float hp2 = other_item.GetHealth01("","");
11156 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11157 hpResult = hpResult / (
GetQuantity() + quantity_used);
11158
11159 hpResult *= GetMaxHealth();
11160 Math.Round(hpResult);
11161 SetHealth("", "Health", hpResult);
11162
11164 other_item.AddQuantity(-quantity_used);
11165 }
11166 }
11168 }
11169
11171 {
11172 #ifdef SERVER
11173 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11174 GetHierarchyParent().IncreaseLifetimeUp();
11175 #endif
11176 };
11177
11179 {
11180 PlayerBase p = PlayerBase.Cast(player);
11181
11182 array<int> recipesIds = p.m_Recipes;
11183 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11184 if (moduleRecipesManager)
11185 {
11186 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11187 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11188 }
11189
11190 for (int i = 0;i < recipesIds.Count(); i++)
11191 {
11192 int key = recipesIds.Get(i);
11193 string recipeName = moduleRecipesManager.GetRecipeName(key);
11195 }
11196 }
11197
11198
11199 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11200 {
11201 super.GetDebugActions(outputList);
11202
11203
11208
11209
11213
11217
11218
11221
11222
11224 {
11227 }
11228
11230
11233
11237 }
11238
11239
11240
11241
11243 {
11244 super.OnAction(action_id, player, ctx);
11245 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11246 {
11247 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11248 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11249 PlayerBase p = PlayerBase.Cast(player);
11250 if (
EActions.RECIPES_RANGE_START < 1000)
11251 {
11252 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11253 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11254 }
11255 }
11256 #ifndef SERVER
11257 else if (action_id ==
EActions.WATCH_PLAYER)
11258 {
11259 PluginDeveloper.SetDeveloperItemClientEx(player);
11260 }
11261 #endif
11263 {
11264 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11265 {
11266 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11267 OnDebugButtonPressServer(id + 1);
11268 }
11269
11270 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11271 {
11272 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11274 }
11275
11276 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11277 {
11278 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11280 }
11281
11282 else if (action_id ==
EActions.ADD_QUANTITY)
11283 {
11284 if (IsMagazine())
11285 {
11286 Magazine mag = Magazine.Cast(this);
11287 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11288 }
11289 else
11290 {
11292 }
11293
11294 if (m_EM)
11295 {
11296 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11297 }
11298
11299 }
11300
11301 else if (action_id ==
EActions.REMOVE_QUANTITY)
11302 {
11303 if (IsMagazine())
11304 {
11305 Magazine mag2 = Magazine.Cast(this);
11306 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11307 }
11308 else
11309 {
11311 }
11312 if (m_EM)
11313 {
11314 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11315 }
11316
11317 }
11318
11319 else if (action_id ==
EActions.SET_QUANTITY_0)
11320 {
11322
11323 if (m_EM)
11324 {
11325 m_EM.SetEnergy(0);
11326 }
11327 }
11328
11329 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11330 {
11332
11333 if (m_EM)
11334 {
11335 m_EM.SetEnergy(m_EM.GetEnergyMax());
11336 }
11337 }
11338
11339 else if (action_id ==
EActions.ADD_HEALTH)
11340 {
11341 AddHealth("","",GetMaxHealth("","Health")/5);
11342 }
11343 else if (action_id ==
EActions.REMOVE_HEALTH)
11344 {
11345 AddHealth("","",-GetMaxHealth("","Health")/5);
11346 }
11347 else if (action_id ==
EActions.DESTROY_HEALTH)
11348 {
11349 SetHealth01("","",0);
11350 }
11351 else if (action_id ==
EActions.WATCH_ITEM)
11352 {
11354 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11355 #ifdef DEVELOPER
11356 SetDebugDeveloper_item(this);
11357 #endif
11358 }
11359
11360 else if (action_id ==
EActions.ADD_TEMPERATURE)
11361 {
11362 AddTemperature(20);
11363
11364 }
11365
11366 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11367 {
11368 AddTemperature(-20);
11369
11370 }
11371
11372 else if (action_id ==
EActions.FLIP_FROZEN)
11373 {
11374 SetFrozen(!GetIsFrozen());
11375
11376 }
11377
11378 else if (action_id ==
EActions.ADD_WETNESS)
11379 {
11381
11382 }
11383
11384 else if (action_id ==
EActions.REMOVE_WETNESS)
11385 {
11387
11388 }
11389
11390 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11391 {
11394
11395
11396 }
11397
11398 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11399 {
11402 }
11403
11404 else if (action_id ==
EActions.MAKE_SPECIAL)
11405 {
11406 auto debugParams = DebugSpawnParams.WithPlayer(player);
11407 OnDebugSpawnEx(debugParams);
11408 }
11409
11410 else if (action_id ==
EActions.DELETE)
11411 {
11412 Delete();
11413 }
11414
11415 }
11416
11417
11418 return false;
11419 }
11420
11421
11422
11423
11427
11430
11431
11432
11434 {
11435 return false;
11436 }
11437
11438
11440 {
11441 return true;
11442 }
11443
11444
11446 {
11447 return true;
11448 }
11449
11450
11451
11453 {
11454 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11456 }
11457
11460 {
11461 return null;
11462 }
11463
11465 {
11466 return false;
11467 }
11468
11470 {
11471 return false;
11472 }
11473
11477
11478
11480 {
11481 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11482 return module_repairing.CanRepair(this, item_repair_kit);
11483 }
11484
11485
11486 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11487 {
11488 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11489 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11490 }
11491
11492
11494 {
11495
11496
11497
11498
11499
11500
11501
11502
11503 return 1;
11504 }
11505
11506
11507
11509 {
11511 }
11512
11513
11514
11516 {
11518 }
11519
11520
11529 {
11530 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11531
11532 if (player)
11533 {
11534 player.MessageStatus(text);
11535 }
11536 }
11537
11538
11547 {
11548 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11549
11550 if (player)
11551 {
11552 player.MessageAction(text);
11553 }
11554 }
11555
11556
11565 {
11566 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11567
11568 if (player)
11569 {
11570 player.MessageFriendly(text);
11571 }
11572 }
11573
11574
11583 {
11584 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11585
11586 if (player)
11587 {
11588 player.MessageImportant(text);
11589 }
11590 }
11591
11593 {
11594 return true;
11595 }
11596
11597
11598 override bool KindOf(
string tag)
11599 {
11600 bool found = false;
11601 string item_name = this.
GetType();
11604
11605 int array_size = item_tag_array.Count();
11606 for (int i = 0; i < array_size; i++)
11607 {
11608 if (item_tag_array.Get(i) == tag)
11609 {
11610 found = true;
11611 break;
11612 }
11613 }
11614 return found;
11615 }
11616
11617
11619 {
11620
11621 super.OnRPC(sender, rpc_type,ctx);
11622
11623
11624 switch (rpc_type)
11625 {
11626 #ifndef SERVER
11627 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11628 Param2<bool, string> p = new Param2<bool, string>(false, "");
11629
11631 return;
11632
11633 bool play = p.param1;
11634 string soundSet = p.param2;
11635
11636 if (play)
11637 {
11639 {
11641 {
11643 }
11644 }
11645 else
11646 {
11648 }
11649 }
11650 else
11651 {
11653 }
11654
11655 break;
11656 #endif
11657
11658 }
11659
11661 {
11663 }
11664 }
11665
11666
11667
11668
11670 {
11671 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11672 return plugin.GetID(
name);
11673 }
11674
11676 {
11677 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11678 return plugin.GetName(id);
11679 }
11680
11683 {
11684
11685
11686 int varFlags;
11687 if (!ctx.
Read(varFlags))
11688 return;
11689
11690 if (varFlags & ItemVariableFlags.FLOAT)
11691 {
11693 }
11694 }
11695
11697 {
11698
11699 super.SerializeNumericalVars(floats_out);
11700
11701
11702
11704 {
11706 }
11707
11709 {
11711 }
11712
11714 {
11716 }
11717
11719 {
11724 }
11725
11727 {
11729 }
11730 }
11731
11733 {
11734
11735 super.DeSerializeNumericalVars(floats);
11736
11737
11738 int index = 0;
11739 int mask = Math.Round(floats.Get(index));
11740
11741 index++;
11742
11744 {
11746 {
11748 }
11749 else
11750 {
11751 float quantity = floats.Get(index);
11752 SetQuantity(quantity,
true,
false,
false,
false);
11753 }
11754 index++;
11755 }
11756
11758 {
11759 float wet = floats.Get(index);
11761 index++;
11762 }
11763
11765 {
11766 int liquidtype = Math.Round(floats.Get(index));
11768 index++;
11769 }
11770
11772 {
11774 index++;
11776 index++;
11778 index++;
11780 index++;
11781 }
11782
11784 {
11785 int cleanness = Math.Round(floats.Get(index));
11787 index++;
11788 }
11789 }
11790
11792 {
11793 super.WriteVarsToCTX(ctx);
11794
11795
11797 {
11799 }
11800
11802 {
11804 }
11805
11807 {
11809 }
11810
11812 {
11813 int r,g,b,a;
11819 }
11820
11822 {
11824 }
11825 }
11826
11828 {
11829 if (!super.ReadVarsFromCTX(ctx,version))
11830 return false;
11831
11832 int intValue;
11833 float value;
11834
11835 if (version < 140)
11836 {
11837 if (!ctx.
Read(intValue))
11838 return false;
11839
11840 m_VariablesMask = intValue;
11841 }
11842
11844 {
11845 if (!ctx.
Read(value))
11846 return false;
11847
11849 {
11851 }
11852 else
11853 {
11855 }
11856 }
11857
11858 if (version < 140)
11859 {
11861 {
11862 if (!ctx.
Read(value))
11863 return false;
11864 SetTemperatureDirect(value);
11865 }
11866 }
11867
11869 {
11870 if (!ctx.
Read(value))
11871 return false;
11873 }
11874
11876 {
11877 if (!ctx.
Read(intValue))
11878 return false;
11880 }
11881
11883 {
11884 int r,g,b,a;
11886 return false;
11888 return false;
11890 return false;
11892 return false;
11893
11895 }
11896
11898 {
11899 if (!ctx.
Read(intValue))
11900 return false;
11902 }
11903
11904 if (version >= 138 && version < 140)
11905 {
11907 {
11908 if (!ctx.
Read(intValue))
11909 return false;
11910 SetFrozen(intValue);
11911 }
11912 }
11913
11914 return true;
11915 }
11916
11917
11919 {
11922 {
11924 }
11925
11926 if (!super.OnStoreLoad(ctx, version))
11927 {
11929 return false;
11930 }
11931
11932 if (version >= 114)
11933 {
11934 bool hasQuickBarIndexSaved;
11935
11936 if (!ctx.
Read(hasQuickBarIndexSaved))
11937 {
11939 return false;
11940 }
11941
11942 if (hasQuickBarIndexSaved)
11943 {
11944 int itmQBIndex;
11945
11946
11947 if (!ctx.
Read(itmQBIndex))
11948 {
11950 return false;
11951 }
11952
11953 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11954 if (itmQBIndex != -1 && parentPlayer)
11955 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11956 }
11957 }
11958 else
11959 {
11960
11961 PlayerBase player;
11962 int itemQBIndex;
11963 if (version ==
int.
MAX)
11964 {
11965 if (!ctx.
Read(itemQBIndex))
11966 {
11968 return false;
11969 }
11970 }
11971 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11972 {
11973
11974 if (!ctx.
Read(itemQBIndex))
11975 {
11977 return false;
11978 }
11979 if (itemQBIndex != -1 && player)
11980 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11981 }
11982 }
11983
11984 if (version < 140)
11985 {
11986
11987 if (!LoadVariables(ctx, version))
11988 {
11990 return false;
11991 }
11992 }
11993
11994
11996 {
11998 return false;
11999 }
12000 if (version >= 132)
12001 {
12003 if (raib)
12004 {
12006 {
12008 return false;
12009 }
12010 }
12011 }
12012
12014 return true;
12015 }
12016
12017
12018
12020 {
12021 super.OnStoreSave(ctx);
12022
12023 PlayerBase player;
12024 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12025 {
12027
12028 int itemQBIndex = -1;
12029 itemQBIndex = player.FindQuickBarEntityIndex(this);
12030 ctx.
Write(itemQBIndex);
12031 }
12032 else
12033 {
12035 }
12036
12038
12040 if (raib)
12041 {
12043 }
12044 }
12045
12046
12048 {
12049 super.AfterStoreLoad();
12050
12052 {
12054 }
12055
12057 {
12060 }
12061 }
12062
12064 {
12065 super.EEOnAfterLoad();
12066
12068 {
12070 }
12071
12074 }
12075
12077 {
12078 return false;
12079 }
12080
12081
12082
12084 {
12086 {
12087 #ifdef PLATFORM_CONSOLE
12088
12090 {
12092 if (menu)
12093 {
12095 }
12096 }
12097 #endif
12098 }
12099
12101 {
12104 }
12105
12107 {
12108 SetWeightDirty();
12110 }
12112 {
12115 }
12116
12118 {
12121 }
12123 {
12126 }
12127
12128 super.OnVariablesSynchronized();
12129 }
12130
12131
12132
12134 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12135 {
12136 if (!IsServerCheck(allow_client))
12137 return false;
12138
12140 return false;
12141
12144
12145 if (value <= (min + 0.001))
12146 value = min;
12147
12148 if (value == min)
12149 {
12150 if (destroy_config)
12151 {
12152 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12153 if (dstr)
12154 {
12156 this.Delete();
12157 return true;
12158 }
12159 }
12160 else if (destroy_forced)
12161 {
12163 this.Delete();
12164 return true;
12165 }
12166
12168 }
12169
12172
12174 {
12176
12177 if (delta)
12179 }
12180
12182
12183 return false;
12184 }
12185
12186
12188 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12189 {
12191 }
12192
12194 {
12197 }
12198
12200 {
12203 }
12204
12207 {
12208 float value_clamped = Math.Clamp(value, 0, 1);
12210 SetQuantity(result, destroy_config, destroy_forced);
12211 }
12212
12213
12216 {
12218 }
12219
12221 {
12223 }
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12235 {
12236 int slot = -1;
12237 if (GetInventory())
12238 {
12239 InventoryLocation il = new InventoryLocation;
12240 GetInventory().GetCurrentInventoryLocation(il);
12242 }
12243
12245 }
12246
12248 {
12249 float quantity_max = 0;
12250
12252 {
12253 if (attSlotID != -1)
12254 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12255
12256 if (quantity_max <= 0)
12258 }
12259
12260 if (quantity_max <= 0)
12262
12263 return quantity_max;
12264 }
12265
12267 {
12269 }
12270
12272 {
12274 }
12275
12276
12278 {
12280 }
12281
12283 {
12285 }
12286
12288 {
12290 }
12291
12292
12294 {
12295
12296 float weightEx = GetWeightEx();
12297 float special = GetInventoryAndCargoWeight();
12298 return weightEx - special;
12299 }
12300
12301
12303 {
12305 }
12306
12308 {
12310 {
12311 #ifdef DEVELOPER
12312 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12313 {
12314 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12316 }
12317 #endif
12318
12319 return GetQuantity() * GetConfigWeightModified();
12320 }
12321 else if (HasEnergyManager())
12322 {
12323 #ifdef DEVELOPER
12324 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12325 {
12326 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12327 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12328 }
12329 #endif
12330 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12331 }
12332 else
12333 {
12334 #ifdef DEVELOPER
12335 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12336 {
12337 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12338 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12339 }
12340 #endif
12341 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12342 }
12343 }
12344
12347 {
12348 int item_count = 0;
12350
12351 if (GetInventory().GetCargo() != NULL)
12352 {
12353 item_count = GetInventory().GetCargo().GetItemCount();
12354 }
12355
12356 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12357 {
12358 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12359 if (item)
12360 item_count += item.GetNumberOfItems();
12361 }
12362 return item_count;
12363 }
12364
12367 {
12368 float weight = 0;
12369 float wetness = 1;
12370 if (include_wetness)
12373 {
12374 weight = wetness * m_ConfigWeight;
12375 }
12377 {
12378 weight = 1;
12379 }
12380 return weight;
12381 }
12382
12383
12384
12386 {
12387 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12388 {
12389 GameInventory inv = GetInventory();
12390 array<EntityAI> items = new array<EntityAI>;
12392 for (int i = 0; i < items.Count(); i++)
12393 {
12395 if (item)
12396 {
12398 }
12399 }
12400 }
12401 }
12402
12403
12404
12405
12407 {
12408 float energy = 0;
12409 if (HasEnergyManager())
12410 {
12411 energy = GetCompEM().GetEnergy();
12412 }
12413 return energy;
12414 }
12415
12416
12418 {
12419 super.OnEnergyConsumed();
12420
12422 }
12423
12425 {
12426 super.OnEnergyAdded();
12427
12429 }
12430
12431
12433 {
12434 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12435 {
12437 {
12438 float energy_0to1 = GetCompEM().GetEnergy0To1();
12440 }
12441 }
12442 }
12443
12444
12446 {
12447 return ConfigGetFloat("heatIsolation");
12448 }
12449
12451 {
12453 }
12454
12456 {
12457 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12458 if (
GetGame().ConfigIsExisting(paramPath))
12460
12461 return 0.0;
12462 }
12463
12465 {
12466 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12467 if (
GetGame().ConfigIsExisting(paramPath))
12469
12470 return 0.0;
12471 }
12472
12473 override void SetWet(
float value,
bool allow_client =
false)
12474 {
12475 if (!IsServerCheck(allow_client))
12476 return;
12477
12480
12482
12483 m_VarWet = Math.Clamp(value, min, max);
12484
12486 {
12489 }
12490 }
12491
12492 override void AddWet(
float value)
12493 {
12495 }
12496
12498 {
12500 }
12501
12503 {
12505 }
12506
12508 {
12510 }
12511
12513 {
12515 }
12516
12518 {
12520 }
12521
12522 override void OnWetChanged(
float newVal,
float oldVal)
12523 {
12526 if (newLevel != oldLevel)
12527 {
12529 }
12530 }
12531
12533 {
12534 SetWeightDirty();
12535 }
12536
12538 {
12539 return GetWetLevelInternal(
m_VarWet);
12540 }
12541
12542
12543
12545 {
12547 }
12548
12550 {
12552 }
12553
12555 {
12557 }
12558
12560 {
12562 }
12563
12564
12565
12567 {
12568 if (ConfigIsExisting("itemModelLength"))
12569 {
12570 return ConfigGetFloat("itemModelLength");
12571 }
12572 return 0;
12573 }
12574
12576 {
12577 if (ConfigIsExisting("itemAttachOffset"))
12578 {
12579 return ConfigGetFloat("itemAttachOffset");
12580 }
12581 return 0;
12582 }
12583
12584 override void SetCleanness(
int value,
bool allow_client =
false)
12585 {
12586 if (!IsServerCheck(allow_client))
12587 return;
12588
12590
12592
12595 }
12596
12598 {
12600 }
12601
12603 {
12604 return true;
12605 }
12606
12607
12608
12609
12611 {
12613 }
12614
12616 {
12618 }
12619
12620
12621
12622
12623 override void SetColor(
int r,
int g,
int b,
int a)
12624 {
12630 }
12632 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12633 {
12638 }
12639
12641 {
12643 }
12644
12647 {
12648 int r,g,b,a;
12650 r = r/255;
12651 g = g/255;
12652 b = b/255;
12653 a = a/255;
12654 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12655 }
12656
12657
12658
12659 override void SetLiquidType(
int value,
bool allow_client =
false)
12660 {
12661 if (!IsServerCheck(allow_client))
12662 return;
12663
12668 }
12669
12671 {
12672 return ConfigGetInt("varLiquidTypeInit");
12673 }
12674
12676 {
12678 }
12679
12681 {
12683 SetFrozen(false);
12684 }
12685
12688 {
12689 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12690 }
12691
12692
12695 {
12696 PlayerBase nplayer;
12697 if (PlayerBase.CastTo(nplayer, player))
12698 {
12700
12701 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12702 }
12703 }
12704
12705
12708 {
12709 PlayerBase nplayer;
12710 if (PlayerBase.CastTo(nplayer,player))
12711 {
12712
12713 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12714
12715 }
12716
12717
12718 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12719
12720
12721 if (HasEnergyManager())
12722 {
12723 GetCompEM().UpdatePlugState();
12724 }
12725 }
12726
12727
12729 {
12730 super.OnPlacementStarted(player);
12731
12733 }
12734
12735 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12736 {
12738 {
12739 m_AdminLog.OnPlacementComplete(player,
this);
12740 }
12741
12742 super.OnPlacementComplete(player, position, orientation);
12743 }
12744
12745
12746
12747
12748
12750 {
12752 {
12753 return true;
12754 }
12755 else
12756 {
12757 return false;
12758 }
12759 }
12760
12761
12763 {
12765 {
12767 }
12768 }
12769
12770
12772 {
12774 }
12775
12777 {
12779 }
12780
12781 override void InsertAgent(
int agent,
float count = 1)
12782 {
12783 if (count < 1)
12784 return;
12785
12787 }
12788
12791 {
12793 }
12794
12795
12797 {
12799 }
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12843 {
12845 return false;
12846 return true;
12847 }
12848
12850 {
12851
12853 }
12854
12855
12858 {
12859 super.CheckForRoofLimited(timeTresholdMS);
12860
12862 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12863 {
12864 m_PreviousRoofTestTime = time;
12865 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12866 }
12867 }
12868
12869
12871 {
12873 {
12874 return 0;
12875 }
12876
12877 if (GetInventory().GetAttachmentSlotsCount() != 0)
12878 {
12879 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12880 if (filter)
12881 return filter.GetProtectionLevel(type, false, system);
12882 else
12883 return 0;
12884 }
12885
12886 string subclassPath, entryName;
12887
12888 switch (type)
12889 {
12891 entryName = "biological";
12892 break;
12894 entryName = "chemical";
12895 break;
12896 default:
12897 entryName = "biological";
12898 break;
12899 }
12900
12901 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12902
12904 }
12905
12906
12907
12910 {
12911 if (!IsMagazine())
12913
12915 }
12916
12917
12918
12919
12920
12925 {
12926 return true;
12927 }
12928
12930 {
12932 }
12933
12934
12935
12936
12937
12939 {
12940 if (parent)
12941 {
12942 if (parent.IsInherited(DayZInfected))
12943 return true;
12944
12945 if (!parent.IsRuined())
12946 return true;
12947 }
12948
12949 return true;
12950 }
12951
12953 {
12954 if (!super.CanPutAsAttachment(parent))
12955 {
12956 return false;
12957 }
12958
12959 if (!IsRuined() && !parent.IsRuined())
12960 {
12961 return true;
12962 }
12963
12964 return false;
12965 }
12966
12968 {
12969
12970
12971
12972
12973 return super.CanReceiveItemIntoCargo(item);
12974 }
12975
12977 {
12978
12979
12980
12981
12982 GameInventory attachmentInv = attachment.GetInventory();
12984 {
12985 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12986 return false;
12987 }
12988
12989 InventoryLocation loc = new InventoryLocation();
12990 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12991 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12992 return false;
12993
12994 return super.CanReceiveAttachment(attachment, slotId);
12995 }
12996
12998 {
12999 if (!super.CanReleaseAttachment(attachment))
13000 return false;
13001
13002 return GetInventory().AreChildrenAccessible();
13003 }
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13026 {
13027 int id = muzzle_owner.GetMuzzleID();
13028 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13029
13030 if (WPOF_array)
13031 {
13032 for (int i = 0; i < WPOF_array.Count(); i++)
13033 {
13034 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13035
13036 if (WPOF)
13037 {
13038 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13039 }
13040 }
13041 }
13042 }
13043
13044
13046 {
13047 int id = muzzle_owner.GetMuzzleID();
13049
13050 if (WPOBE_array)
13051 {
13052 for (int i = 0; i < WPOBE_array.Count(); i++)
13053 {
13054 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13055
13056 if (WPOBE)
13057 {
13058 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13059 }
13060 }
13061 }
13062 }
13063
13064
13066 {
13067 int id = muzzle_owner.GetMuzzleID();
13068 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13069
13070 if (WPOOH_array)
13071 {
13072 for (int i = 0; i < WPOOH_array.Count(); i++)
13073 {
13074 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13075
13076 if (WPOOH)
13077 {
13078 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13079 }
13080 }
13081 }
13082 }
13083
13084
13086 {
13087 int id = muzzle_owner.GetMuzzleID();
13088 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13089
13090 if (WPOOH_array)
13091 {
13092 for (int i = 0; i < WPOOH_array.Count(); i++)
13093 {
13094 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13095
13096 if (WPOOH)
13097 {
13098 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13099 }
13100 }
13101 }
13102 }
13103
13104
13106 {
13107 int id = muzzle_owner.GetMuzzleID();
13108 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13109
13110 if (WPOOH_array)
13111 {
13112 for (int i = 0; i < WPOOH_array.Count(); i++)
13113 {
13114 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13115
13116 if (WPOOH)
13117 {
13118 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13119 }
13120 }
13121 }
13122 }
13123
13124
13125
13127 {
13129 {
13130 return true;
13131 }
13132
13133 return false;
13134 }
13135
13137 {
13139 {
13140 return true;
13141 }
13142
13143 return false;
13144 }
13145
13147 {
13149 {
13150 return true;
13151 }
13152
13153 return false;
13154 }
13155
13157 {
13158 return false;
13159 }
13160
13163 {
13164 return UATimeSpent.DEFAULT_DEPLOY;
13165 }
13166
13167
13168
13169
13171 {
13173 SetSynchDirty();
13174 }
13175
13177 {
13179 }
13180
13181
13183 {
13184 return false;
13185 }
13186
13189 {
13190 string att_type = "None";
13191
13192 if (ConfigIsExisting("soundAttType"))
13193 {
13194 att_type = ConfigGetString("soundAttType");
13195 }
13196
13198 }
13199
13201 {
13203 }
13204
13205
13206
13207
13208
13212
13214 {
13217
13219 }
13220
13221
13223 {
13225 return;
13226
13228
13231
13234
13235 SoundParameters params = new SoundParameters();
13239 }
13240
13241
13243 {
13245 return;
13246
13248 SetSynchDirty();
13249
13252 }
13253
13254
13256 {
13258 return;
13259
13261 SetSynchDirty();
13262
13265 }
13266
13268 {
13270 }
13271
13273 {
13275 }
13276
13279 {
13280 if (!
GetGame().IsDedicatedServer())
13281 {
13282 if (ConfigIsExisting("attachSoundSet"))
13283 {
13284 string cfg_path = "";
13285 string soundset = "";
13286 string type_name =
GetType();
13287
13290 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13291 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13292
13293 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13294 {
13295 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13296 {
13297 if (cfg_slot_array[i] == slot_type)
13298 {
13299 soundset = cfg_soundset_array[i];
13300 break;
13301 }
13302 }
13303 }
13304
13305 if (soundset != "")
13306 {
13307 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13309 }
13310 }
13311 }
13312 }
13313
13315 {
13316
13317 }
13318
13319 void OnApply(PlayerBase player);
13320
13322 {
13323 return 1.0;
13324 };
13325
13327 {
13329 }
13330
13332 {
13334 }
13335
13337
13339 {
13340 SetDynamicPhysicsLifeTime(0.01);
13342 }
13343
13345 {
13346 array<string> zone_names = new array<string>;
13347 GetDamageZones(zone_names);
13348 for (int i = 0; i < zone_names.Count(); i++)
13349 {
13350 SetHealthMax(zone_names.Get(i),"Health");
13351 }
13352 SetHealthMax("","Health");
13353 }
13354
13357 {
13358 float global_health = GetHealth01("","Health");
13359 array<string> zones = new array<string>;
13360 GetDamageZones(zones);
13361
13362 for (int i = 0; i < zones.Count(); i++)
13363 {
13364 SetHealth01(zones.Get(i),"Health",global_health);
13365 }
13366 }
13367
13370 {
13371 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13372 }
13373
13375 {
13376 if (!hasRootAsPlayer)
13377 {
13378 if (refParentIB)
13379 {
13380
13381 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13382 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13383
13384 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13385 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13386
13389 }
13390 else
13391 {
13392
13395 }
13396 }
13397 }
13398
13400 {
13402 {
13403 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13404 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13405 {
13406 float heatPermCoef = 1.0;
13408 while (ent)
13409 {
13410 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13411 ent = ent.GetHierarchyParent();
13412 }
13413
13414 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13415 }
13416 }
13417 }
13418
13420 {
13421
13422 EntityAI parent = GetHierarchyParent();
13423 if (!parent)
13424 {
13425 hasParent = false;
13426 hasRootAsPlayer = false;
13427 }
13428 else
13429 {
13430 hasParent = true;
13431 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13432 refParentIB =
ItemBase.Cast(parent);
13433 }
13434 }
13435
13436 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13437 {
13438
13439 }
13440
13442 {
13443
13444 return false;
13445 }
13446
13448 {
13449
13450
13451 return false;
13452 }
13453
13455 {
13456
13457 return false;
13458 }
13459
13462 {
13463 return !GetIsFrozen() &&
IsOpen();
13464 }
13465
13467 {
13468 bool hasParent = false, hasRootAsPlayer = false;
13470
13471 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13472 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13473
13474 if (wwtu || foodDecay)
13475 {
13479
13480 if (processWetness || processTemperature || processDecay)
13481 {
13483
13484 if (processWetness)
13485 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13486
13487 if (processTemperature)
13489
13490 if (processDecay)
13491 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13492 }
13493 }
13494 }
13495
13498 {
13500 }
13501
13503 {
13506
13507 return super.GetTemperatureFreezeThreshold();
13508 }
13509
13511 {
13514
13515 return super.GetTemperatureThawThreshold();
13516 }
13517
13519 {
13522
13523 return super.GetItemOverheatThreshold();
13524 }
13525
13527 {
13529 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13530
13531 return super.GetTemperatureFreezeTime();
13532 }
13533
13535 {
13537 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13538
13539 return super.GetTemperatureThawTime();
13540 }
13541
13546
13548 {
13549 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13550 }
13551
13553 {
13554 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13555 }
13556
13559 {
13561 }
13562
13564 {
13566 }
13567
13569 {
13571 }
13572
13575 {
13576 return null;
13577 }
13578
13581 {
13582 return false;
13583 }
13584
13586 {
13588 {
13591 if (!trg)
13592 {
13594 explosive = this;
13595 }
13596
13597 explosive.PairRemote(trg);
13599
13600 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13601 trg.SetPersistentPairID(persistentID);
13602 explosive.SetPersistentPairID(persistentID);
13603
13604 return true;
13605 }
13606 return false;
13607 }
13608
13611 {
13612 float ret = 1.0;
13615 ret *= GetHealth01();
13616
13617 return ret;
13618 }
13619
13620 #ifdef DEVELOPER
13621 override void SetDebugItem()
13622 {
13623 super.SetDebugItem();
13624 _itemBase = this;
13625 }
13626
13628 {
13629 string text = super.GetDebugText();
13630
13632 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13633
13634 return text;
13635 }
13636 #endif
13637
13639 {
13640 return true;
13641 }
13642
13644
13646
13648 {
13651 }
13652
13653
13661
13677}
13678
13680{
13682 if (entity)
13683 {
13684 bool is_item = entity.IsInherited(
ItemBase);
13685 if (is_item && full_quantity)
13686 {
13689 }
13690 }
13691 else
13692 {
13694 return NULL;
13695 }
13696 return entity;
13697}
13698
13700{
13701 if (item)
13702 {
13703 if (health > 0)
13704 item.SetHealth("", "", health);
13705
13706 if (item.CanHaveTemperature())
13707 {
13709 if (item.CanFreeze())
13710 item.SetFrozen(false);
13711 }
13712
13713 if (item.HasEnergyManager())
13714 {
13715 if (quantity >= 0)
13716 {
13717 item.GetCompEM().SetEnergy0To1(quantity);
13718 }
13719 else
13720 {
13722 }
13723 }
13724 else if (item.IsMagazine())
13725 {
13726 Magazine mag = Magazine.Cast(item);
13727 if (quantity >= 0)
13728 {
13729 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13730 }
13731 else
13732 {
13734 }
13735
13736 }
13737 else
13738 {
13739 if (quantity >= 0)
13740 {
13741 item.SetQuantityNormalized(quantity, false);
13742 }
13743 else
13744 {
13746 }
13747
13748 }
13749 }
13750}
13751
13752#ifdef DEVELOPER
13754#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.