8888{
8890 {
8891 return true;
8892 }
8893};
8894
8895
8896
8898{
8902
8904
8907
8908
8909
8910
8911
8920
8926
8931
8936
8957 protected bool m_IsResultOfSplit
8958
8960
8965
8966
8967
8969
8973
8974
8975
8977
8980
8981
8982
8988
8989
8997
9000
9001
9003
9004
9006
9007
9012
9013
9018
9019
9021
9022
9024 {
9029
9030 if (!
GetGame().IsDedicatedServer())
9031 {
9033 {
9035
9037 {
9039 }
9040 }
9041
9044 }
9045
9046 m_OldLocation = null;
9047
9049 {
9051 }
9052
9053 if (ConfigIsExisting("headSelectionsToHide"))
9054 {
9057 }
9058
9060 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9061 {
9063 }
9064
9066
9067 m_IsResultOfSplit = false;
9068
9070 }
9071
9073 {
9074 super.InitItemVariables();
9075
9081 m_Count = ConfigGetInt(
"count");
9082
9085
9090
9093
9098
9110
9114
9115
9118 if (ConfigIsExisting("canBeSplit"))
9119 {
9122 }
9123
9125 if (ConfigIsExisting("itemBehaviour"))
9127
9128
9131 RegisterNetSyncVariableInt("m_VarLiquidType");
9132 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9133
9134 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9135 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9136 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9137
9138 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9139 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9140 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9141 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9142
9143 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9144 RegisterNetSyncVariableBool("m_IsTakeable");
9145 RegisterNetSyncVariableBool("m_IsHologram");
9146
9149 {
9152 }
9153
9155
9157 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9159
9160 }
9161
9163 {
9165 }
9166
9168 {
9171 {
9176 }
9177 }
9178
9179 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9180 {
9182 {
9185 }
9186
9188 }
9189
9191 {
9197 }
9198
9200
9202 {
9204
9205 if (!action)
9206 {
9207 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9208 return;
9209 }
9210
9212 if (!ai)
9213 {
9215 return;
9216 }
9217
9219 if (!action_array)
9220 {
9221 action_array = new array<ActionBase_Basic>;
9223 }
9224 if (LogManager.IsActionLogEnable())
9225 {
9226 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9227 }
9228
9229 if (action_array.Find(action) != -1)
9230 {
9231 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9232 }
9233 else
9234 {
9235 action_array.Insert(action);
9236 }
9237 }
9238
9240 {
9242 ActionBase action = player.GetActionManager().GetAction(actionName);
9245
9246 if (action_array)
9247 {
9248 action_array.RemoveItem(action);
9249 }
9250 }
9251
9252
9253
9255 {
9256 ActionOverrideData overrideData = new ActionOverrideData();
9260
9262 if (!actionMap)
9263 {
9266 }
9267
9268 actionMap.Insert(this.
Type(), overrideData);
9269
9270 }
9271
9273
9275
9276
9278 {
9281
9284
9285 string config_to_search = "CfgVehicles";
9286 string muzzle_owner_config;
9287
9289 {
9290 if (IsInherited(Weapon))
9291 config_to_search = "CfgWeapons";
9292
9293 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9294
9295 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9296
9298
9299 if (config_OnFire_subclass_count > 0)
9300 {
9301 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9302
9303 for (int i = 0; i < config_OnFire_subclass_count; i++)
9304 {
9305 string particle_class = "";
9307 string config_OnFire_entry = config_OnFire_class + particle_class;
9308 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9309 WPOF_array.Insert(WPOF);
9310 }
9311
9312
9314 }
9315 }
9316
9318 {
9319 config_to_search = "CfgWeapons";
9320 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9321
9322 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9323
9325
9326 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9327 {
9328 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9329
9330 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9331 {
9332 string particle_class2 = "";
9334 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9335 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9336 WPOBE_array.Insert(WPOBE);
9337 }
9338
9339
9341 }
9342 }
9343 }
9344
9345
9347 {
9350
9352 {
9353 string config_to_search = "CfgVehicles";
9354
9355 if (IsInherited(Weapon))
9356 config_to_search = "CfgWeapons";
9357
9358 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9359 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9360
9361 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9362 {
9363
9365
9367 {
9369 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9371 return;
9372 }
9373
9376
9377
9378
9380 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9381
9382 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9383 {
9384 string particle_class = "";
9386 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9388
9389 if (entry_type == CT_CLASS)
9390 {
9391 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9392 WPOOH_array.Insert(WPOF);
9393 }
9394 }
9395
9396
9398 }
9399 }
9400 }
9401
9403 {
9405 }
9406
9408 {
9410 {
9412
9415
9418
9419 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9420 }
9421 }
9422
9424 {
9426 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9427
9429 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9430
9432 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9433
9435 {
9437 }
9438 }
9439
9441 {
9443 }
9444
9446 {
9449 else
9451
9453 {
9456 }
9457 else
9458 {
9461
9464 }
9465
9467 }
9468
9470 {
9472 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9473 }
9474
9476 {
9478 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9480 }
9481
9483 {
9485 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9486 }
9487
9489 {
9492
9493 OverheatingParticle OP = new OverheatingParticle();
9498
9500 }
9501
9503 {
9506
9507 return -1;
9508 }
9509
9511 {
9513 {
9516
9517 for (int i = count; i > 0; --i)
9518 {
9519 int id = i - 1;
9522
9525
9526 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9527 {
9528 if (p)
9529 {
9532 }
9533 }
9534 }
9535 }
9536 }
9537
9539 {
9541 {
9543 {
9544 int id = i - 1;
9546
9547 if (OP)
9548 {
9550
9551 if (p)
9552 {
9554 }
9555
9556 delete OP;
9557 }
9558 }
9559
9562 }
9563 }
9564
9567 {
9568 return 0.0;
9569 }
9570
9571
9573 {
9574 return 250;
9575 }
9576
9578 {
9579 return 0;
9580 }
9581
9584 {
9586 return true;
9587
9588 return false;
9589 }
9590
9593 {
9596
9598 {
9600 }
9601 else
9602 {
9603
9605 }
9606
9608 }
9609
9616 {
9617 return -1;
9618 }
9619
9620
9621
9622
9624 {
9626 {
9628 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9629
9630 if (r_index >= 0)
9631 {
9632 InventoryLocation r_il = new InventoryLocation;
9633 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9634
9635 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9638 {
9639 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9640 }
9642 {
9643 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9644 }
9645
9646 }
9647
9648 player.GetHumanInventory().ClearUserReservedLocation(this);
9649 }
9650
9653 }
9654
9655
9656
9657
9659 {
9660 return ItemBase.m_DebugActionsMask;
9661 }
9662
9664 {
9665 return ItemBase.m_DebugActionsMask & mask;
9666 }
9667
9669 {
9670 ItemBase.m_DebugActionsMask = mask;
9671 }
9672
9674 {
9675 ItemBase.m_DebugActionsMask |= mask;
9676 }
9677
9679 {
9680 ItemBase.m_DebugActionsMask &= ~mask;
9681 }
9682
9684 {
9686 {
9688 }
9689 else
9690 {
9692 }
9693 }
9694
9695
9697 {
9698 if (GetEconomyProfile())
9699 {
9700 float q_max = GetEconomyProfile().GetQuantityMax();
9701 if (q_max > 0)
9702 {
9703 float q_min = GetEconomyProfile().GetQuantityMin();
9704 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9705
9707 {
9708 ComponentEnergyManager comp = GetCompEM();
9710 {
9712 }
9713 }
9715 {
9717
9718 }
9719
9720 }
9721 }
9722 }
9723
9726 {
9727 EntityAI parent = GetHierarchyParent();
9728
9729 if (parent)
9730 {
9731 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9732 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9733 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9734 }
9735 }
9736
9739 {
9740 EntityAI parent = GetHierarchyParent();
9741
9742 if (parent)
9743 {
9744 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9745 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9746 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9747 }
9748 }
9749
9751 {
9752
9753
9754
9755
9757
9759 {
9760 if (ScriptInputUserData.CanStoreInputUserData())
9761 {
9762 ScriptInputUserData ctx = new ScriptInputUserData;
9768 ctx.
Write(use_stack_max);
9771
9773 {
9774 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9775 }
9776 }
9777 }
9778 else if (!
GetGame().IsMultiplayer())
9779 {
9781 }
9782 }
9783
9785 {
9787 }
9788
9790 {
9792 }
9793
9795 {
9797 }
9798
9800 {
9801
9802 return false;
9803 }
9804
9806 {
9807 return false;
9808 }
9809
9813 {
9814 return false;
9815 }
9816
9818 {
9819 return "";
9820 }
9821
9823
9825 {
9826 return false;
9827 }
9828
9830 {
9831 return true;
9832 }
9833
9834
9835
9837 {
9838 return true;
9839 }
9840
9842 {
9843 return true;
9844 }
9845
9847 {
9848 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9850 }
9851
9853 {
9855 }
9856
9858 {
9860 if (!is_being_placed)
9862 SetSynchDirty();
9863 }
9864
9865
9867
9869 {
9871 }
9872
9874 {
9876 }
9877
9879 {
9880 return 1;
9881 }
9882
9884 {
9885 return false;
9886 }
9887
9889 {
9891 SetSynchDirty();
9892 }
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9929 {
9930 super.OnMovedInsideCargo(container);
9931
9932 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9933 }
9934
9935 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9936 {
9937 super.EEItemLocationChanged(oldLoc,newLoc);
9938
9939 PlayerBase new_player = null;
9940 PlayerBase old_player = null;
9941
9942 if (newLoc.GetParent())
9943 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9944
9945 if (oldLoc.GetParent())
9946 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9947
9949 {
9950 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9951
9952 if (r_index >= 0)
9953 {
9954 InventoryLocation r_il = new InventoryLocation;
9955 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9956
9957 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9960 {
9961 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9962 }
9964 {
9965 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9966 }
9967
9968 }
9969 }
9970
9972 {
9973 if (new_player)
9974 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9975
9976 if (new_player == old_player)
9977 {
9978
9979 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9980 {
9982 {
9983 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9984 {
9985 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9986 }
9987 }
9988 else
9989 {
9990 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9991 }
9992 }
9993
9994 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9995 {
9996 int type = oldLoc.GetType();
9998 {
9999 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10000 }
10002 {
10003 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10004 }
10005 }
10006 if (!m_OldLocation)
10007 {
10008 m_OldLocation = new InventoryLocation;
10009 }
10010 m_OldLocation.Copy(oldLoc);
10011 }
10012 else
10013 {
10014 if (m_OldLocation)
10015 {
10016 m_OldLocation.Reset();
10017 }
10018 }
10019
10021 }
10022 else
10023 {
10024 if (new_player)
10025 {
10026 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10027 if (res_index >= 0)
10028 {
10029 InventoryLocation il = new InventoryLocation;
10030 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10032 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10035 {
10036 il.
GetParent().GetOnReleaseLock().Invoke(it);
10037 }
10039 {
10041 }
10042
10043 }
10044 }
10046 {
10047
10049 }
10050
10051 if (m_OldLocation)
10052 {
10053 m_OldLocation.Reset();
10054 }
10055 }
10056 }
10057
10058 override void EOnContact(IEntity other, Contact extra)
10059 {
10061 {
10062 int liquidType = -1;
10064 if (impactSpeed > 0.0)
10065 {
10067 #ifndef SERVER
10069 #else
10071 SetSynchDirty();
10072 #endif
10074 }
10075 }
10076
10077 #ifdef SERVER
10078 if (GetCompEM() && GetCompEM().IsPlugged())
10079 {
10080 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10081 GetCompEM().UnplugThis();
10082 }
10083 #endif
10084 }
10085
10087
10089 {
10091 }
10092
10094 {
10095
10096 }
10097
10099 {
10100 super.OnItemLocationChanged(old_owner, new_owner);
10101
10102 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10103 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10104
10105 if (!relatedPlayer && playerNew)
10106 relatedPlayer = playerNew;
10107
10108 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10109 {
10111 if (actionMgr)
10112 {
10113 ActionBase currentAction = actionMgr.GetRunningAction();
10114 if (currentAction)
10116 }
10117 }
10118
10119 Man ownerPlayerOld = null;
10120 Man ownerPlayerNew = null;
10121
10122 if (old_owner)
10123 {
10124 if (old_owner.
IsMan())
10125 {
10126 ownerPlayerOld = Man.Cast(old_owner);
10127 }
10128 else
10129 {
10130 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10131 }
10132 }
10133 else
10134 {
10136 {
10138
10139 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10140 {
10141 GetCompEM().UnplugThis();
10142 }
10143 }
10144 }
10145
10146 if (new_owner)
10147 {
10148 if (new_owner.
IsMan())
10149 {
10150 ownerPlayerNew = Man.Cast(new_owner);
10151 }
10152 else
10153 {
10154 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10155 }
10156 }
10157
10158 if (ownerPlayerOld != ownerPlayerNew)
10159 {
10160 if (ownerPlayerOld)
10161 {
10162 array<EntityAI> subItemsExit = new array<EntityAI>;
10164 for (int i = 0; i < subItemsExit.Count(); i++)
10165 {
10168 }
10169 }
10170
10171 if (ownerPlayerNew)
10172 {
10173 array<EntityAI> subItemsEnter = new array<EntityAI>;
10175 for (int j = 0; j < subItemsEnter.Count(); j++)
10176 {
10179 }
10180 }
10181 }
10182 else if (ownerPlayerNew != null)
10183 {
10184 PlayerBase nplayer;
10185 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10186 {
10187 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10189 for (int k = 0; k < subItemsUpdate.Count(); k++)
10190 {
10192 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10193 }
10194 }
10195 }
10196
10197 if (old_owner)
10198 old_owner.OnChildItemRemoved(this);
10199 if (new_owner)
10200 new_owner.OnChildItemReceived(this);
10201 }
10202
10203
10205 {
10206 super.EEDelete(parent);
10207 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10208 if (player)
10209 {
10211
10212 if (player.IsAlive())
10213 {
10214 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10215 if (r_index >= 0)
10216 {
10217 InventoryLocation r_il = new InventoryLocation;
10218 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10219
10220 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10223 {
10224 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10225 }
10227 {
10228 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10229 }
10230
10231 }
10232
10233 player.RemoveQuickBarEntityShortcut(this);
10234 }
10235 }
10236 }
10237
10239 {
10240 super.EEKilled(killer);
10241
10244 {
10245 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10246 {
10247 if (IsMagazine())
10248 {
10249 if (Magazine.Cast(this).GetAmmoCount() > 0)
10250 {
10252 }
10253 }
10254 else
10255 {
10257 }
10258 }
10259 }
10260 }
10261
10263 {
10264 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10265
10266 super.OnWasAttached(parent, slot_id);
10267
10270
10272 }
10273
10275 {
10276 super.OnWasDetached(parent, slot_id);
10277
10280 }
10281
10283 {
10284 int idx;
10287
10288 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10289 if (inventory_slots.Count() < 1)
10290 {
10291 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10292 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10293 }
10294 else
10295 {
10296 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10297 }
10298
10299 idx = inventory_slots.Find(slot);
10300 if (idx < 0)
10301 return "";
10302
10303 return attach_types.Get(idx);
10304 }
10305
10307 {
10308 int idx = -1;
10309 string slot;
10310
10313
10314 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10315 if (inventory_slots.Count() < 1)
10316 {
10317 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10318 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10319 }
10320 else
10321 {
10322 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10323 if (detach_types.Count() < 1)
10324 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10325 }
10326
10327 for (int i = 0; i < inventory_slots.Count(); i++)
10328 {
10329 slot = inventory_slots.Get(i);
10330 }
10331
10332 if (slot != "")
10333 {
10334 if (detach_types.Count() == 1)
10335 idx = 0;
10336 else
10337 idx = inventory_slots.Find(slot);
10338 }
10339 if (idx < 0)
10340 return "";
10341
10342 return detach_types.Get(idx);
10343 }
10344
10346 {
10347
10349
10350
10351 float min_time = 1;
10352 float max_time = 3;
10353 float delay = Math.RandomFloat(min_time, max_time);
10354
10355 explode_timer.Run(delay, this, "DoAmmoExplosion");
10356 }
10357
10359 {
10360 Magazine magazine = Magazine.Cast(this);
10361 int pop_sounds_count = 6;
10362 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10363
10364
10365 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10366 string sound_name = pop_sounds[ sound_idx ];
10368
10369
10370 magazine.ServerAddAmmoCount(-1);
10371
10372
10373 float min_temp_to_explode = 100;
10374
10375 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10376 {
10378 }
10379 }
10380
10381
10382 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10383 {
10384 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10385
10386 const int CHANCE_DAMAGE_CARGO = 4;
10387 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10388 const int CHANCE_DAMAGE_NOTHING = 2;
10389
10391 {
10392 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10393 int chances;
10394 int rnd;
10395
10396 if (GetInventory().GetCargo())
10397 {
10398 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10399 rnd = Math.RandomInt(0,chances);
10400
10401 if (rnd < CHANCE_DAMAGE_CARGO)
10402 {
10404 }
10405 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10406 {
10408 }
10409 }
10410 else
10411 {
10412 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10413 rnd = Math.RandomInt(0,chances);
10414
10415 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10416 {
10418 }
10419 }
10420 }
10421 }
10422
10424 {
10425 if (GetInventory().GetCargo())
10426 {
10427 int item_count = GetInventory().GetCargo().GetItemCount();
10428 if (item_count > 0)
10429 {
10430 int random_pick = Math.RandomInt(0, item_count);
10432 if (!item.IsExplosive())
10433 {
10434 item.AddHealth("","",damage);
10435 return true;
10436 }
10437 }
10438 }
10439 return false;
10440 }
10441
10443 {
10444 int attachment_count = GetInventory().AttachmentCount();
10445 if (attachment_count > 0)
10446 {
10447 int random_pick = Math.RandomInt(0, attachment_count);
10448 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10449 if (!attachment.IsExplosive())
10450 {
10451 attachment.AddHealth("","",damage);
10452 return true;
10453 }
10454 }
10455 return false;
10456 }
10457
10459 {
10461 }
10462
10464 {
10466 return GetInventory().CanRemoveEntity();
10467
10468 return false;
10469 }
10470
10472 {
10473
10475 return false;
10476
10477
10479 return false;
10480
10481
10482
10484 if (delta == 0)
10485 return false;
10486
10487
10488 return true;
10489 }
10490
10492 {
10494 {
10495 if (ScriptInputUserData.CanStoreInputUserData())
10496 {
10497 ScriptInputUserData ctx = new ScriptInputUserData;
10502 ctx.
Write(destination_entity);
10504 ctx.
Write(slot_id);
10506 }
10507 }
10508 else if (!
GetGame().IsMultiplayer())
10509 {
10511 }
10512 }
10513
10515 {
10516 float split_quantity_new;
10520 InventoryLocation loc = new InventoryLocation;
10521
10522 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10523 {
10525 split_quantity_new = stack_max;
10526 else
10528
10530 {
10531 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10532 if (new_item)
10533 {
10534 new_item.SetResultOfSplit(true);
10535 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10537 new_item.
SetQuantity(split_quantity_new,
false,
true);
10538 }
10539 }
10540 }
10541 else if (destination_entity && slot_id == -1)
10542 {
10543 if (quantity > stack_max)
10544 split_quantity_new = stack_max;
10545 else
10546 split_quantity_new = quantity;
10547
10549 {
10551 {
10554 }
10555
10556 if (new_item)
10557 {
10558 new_item.SetResultOfSplit(true);
10559 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10561 new_item.
SetQuantity(split_quantity_new,
false,
true);
10562 }
10563 }
10564 }
10565 else
10566 {
10567 if (stack_max != 0)
10568 {
10570 {
10572 }
10573
10574 if (split_quantity_new == 0)
10575 {
10576 if (!
GetGame().IsMultiplayer())
10577 player.PhysicalPredictiveDropItem(this);
10578 else
10579 player.ServerDropEntity(this);
10580 return;
10581 }
10582
10584 {
10586
10587 if (new_item)
10588 {
10589 new_item.SetResultOfSplit(true);
10590 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10593 new_item.PlaceOnSurface();
10594 }
10595 }
10596 }
10597 }
10598 }
10599
10601 {
10602 float split_quantity_new;
10606 InventoryLocation loc = new InventoryLocation;
10607
10608 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10609 {
10611 split_quantity_new = stack_max;
10612 else
10614
10616 {
10617 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10618 if (new_item)
10619 {
10620 new_item.SetResultOfSplit(true);
10621 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10623 new_item.
SetQuantity(split_quantity_new,
false,
true);
10624 }
10625 }
10626 }
10627 else if (destination_entity && slot_id == -1)
10628 {
10629 if (quantity > stack_max)
10630 split_quantity_new = stack_max;
10631 else
10632 split_quantity_new = quantity;
10633
10635 {
10637 {
10640 }
10641
10642 if (new_item)
10643 {
10644 new_item.SetResultOfSplit(true);
10645 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10647 new_item.
SetQuantity(split_quantity_new,
false,
true);
10648 }
10649 }
10650 }
10651 else
10652 {
10653 if (stack_max != 0)
10654 {
10656 {
10658 }
10659
10661 {
10663
10664 if (new_item)
10665 {
10666 new_item.SetResultOfSplit(true);
10667 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10670 new_item.PlaceOnSurface();
10671 }
10672 }
10673 }
10674 }
10675 }
10676
10678 {
10680 {
10681 if (ScriptInputUserData.CanStoreInputUserData())
10682 {
10683 ScriptInputUserData ctx = new ScriptInputUserData;
10688 dst.WriteToContext(ctx);
10690 }
10691 }
10692 else if (!
GetGame().IsMultiplayer())
10693 {
10695 }
10696 }
10697
10699 {
10701 {
10702 if (ScriptInputUserData.CanStoreInputUserData())
10703 {
10704 ScriptInputUserData ctx = new ScriptInputUserData;
10709 ctx.
Write(destination_entity);
10715 }
10716 }
10717 else if (!
GetGame().IsMultiplayer())
10718 {
10720 }
10721 }
10722
10724 {
10726 }
10727
10729 {
10731 float split_quantity_new;
10733 if (dst.IsValid())
10734 {
10735 int slot_id = dst.GetSlot();
10737
10738 if (quantity > stack_max)
10739 split_quantity_new = stack_max;
10740 else
10741 split_quantity_new = quantity;
10742
10744 {
10746
10747 if (new_item)
10748 {
10749 new_item.SetResultOfSplit(true);
10750 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10752 new_item.
SetQuantity(split_quantity_new,
false,
true);
10753 }
10754
10755 return new_item;
10756 }
10757 }
10758
10759 return null;
10760 }
10761
10763 {
10765 float split_quantity_new;
10767 if (destination_entity)
10768 {
10770 if (quantity > stackable)
10771 split_quantity_new = stackable;
10772 else
10773 split_quantity_new = quantity;
10774
10776 {
10777 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10778 if (new_item)
10779 {
10780 new_item.SetResultOfSplit(true);
10781 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10783 new_item.
SetQuantity(split_quantity_new,
false,
true);
10784 }
10785 }
10786 }
10787 }
10788
10790 {
10792 {
10793 if (ScriptInputUserData.CanStoreInputUserData())
10794 {
10795 ScriptInputUserData ctx = new ScriptInputUserData;
10800 ItemBase destination_entity =
this;
10801 ctx.
Write(destination_entity);
10805 }
10806 }
10807 else if (!
GetGame().IsMultiplayer())
10808 {
10810 }
10811 }
10812
10814 {
10816 float split_quantity_new;
10818 if (player)
10819 {
10821 if (quantity > stackable)
10822 split_quantity_new = stackable;
10823 else
10824 split_quantity_new = quantity;
10825
10827 {
10828 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10829 new_item =
ItemBase.Cast(in_hands);
10830 if (new_item)
10831 {
10832 new_item.SetResultOfSplit(true);
10833 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10835 new_item.SetQuantity(split_quantity_new, false, true);
10836 }
10837 }
10838 }
10839 }
10840
10842 {
10844 float split_quantity_new = Math.Floor(quantity * 0.5);
10845
10847 return;
10848
10850
10851 if (new_item)
10852 {
10853 if (new_item.GetQuantityMax() < split_quantity_new)
10854 {
10855 split_quantity_new = new_item.GetQuantityMax();
10856 }
10857
10858 new_item.SetResultOfSplit(true);
10859 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10860
10862 {
10865 }
10866 else
10867 {
10869 new_item.
SetQuantity(split_quantity_new,
false,
true);
10870 }
10871 }
10872 }
10873
10875 {
10877 float split_quantity_new = Math.Floor(quantity / 2);
10878
10880 return;
10881
10882 InventoryLocation invloc = new InventoryLocation;
10884
10886 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10887
10888 if (new_item)
10889 {
10890 if (new_item.GetQuantityMax() < split_quantity_new)
10891 {
10892 split_quantity_new = new_item.GetQuantityMax();
10893 }
10895 {
10898 }
10899 else if (split_quantity_new > 1)
10900 {
10902 new_item.
SetQuantity(split_quantity_new,
false,
true);
10903 }
10904 }
10905 }
10906
10909 {
10910 SetWeightDirty();
10912
10913 if (parent)
10914 parent.OnAttachmentQuantityChangedEx(this, delta);
10915
10917 {
10919 {
10921 }
10923 {
10924 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10926 }
10927 }
10928
10929 }
10930
10933 {
10934
10935 }
10936
10939 {
10941 }
10942
10944 {
10945 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10946
10948 {
10949 if (newLevel == GameConstants.STATE_RUINED)
10950 {
10952 EntityAI parent = GetHierarchyParent();
10953 if (parent && parent.IsFireplace())
10954 {
10955 CargoBase cargo = GetInventory().GetCargo();
10956 if (cargo)
10957 {
10959 {
10961 }
10962 }
10963 }
10964 }
10965
10967 {
10968
10970 return;
10971 }
10972
10973 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10974 {
10976 }
10977 }
10978 }
10979
10980
10982 {
10983 super.OnRightClick();
10984
10986 {
10988 {
10989 if (ScriptInputUserData.CanStoreInputUserData())
10990 {
10991 EntityAI root = GetHierarchyRoot();
10992 Man playerOwner = GetHierarchyRootPlayer();
10993 InventoryLocation dst = new InventoryLocation;
10994
10995
10996 if (!playerOwner && root && root == this)
10997 {
10999 }
11000 else
11001 {
11002
11003 GetInventory().GetCurrentInventoryLocation(dst);
11005 {
11008 {
11010 }
11011 else
11012 {
11014
11015
11016 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11017 {
11019 }
11020 else
11021 {
11022 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11023 }
11024 }
11025 }
11026 }
11027
11028 ScriptInputUserData ctx = new ScriptInputUserData;
11036 }
11037 }
11038 else if (!
GetGame().IsMultiplayer())
11039 {
11041 }
11042 }
11043 }
11044
11046 {
11047 if (root)
11048 {
11049 vector m4[4];
11050 root.GetTransform(m4);
11051 dst.SetGround(this, m4);
11052 }
11053 else
11054 {
11055 GetInventory().GetCurrentInventoryLocation(dst);
11056 }
11057 }
11058
11059 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11060 {
11061
11062 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11063 return false;
11064
11065 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11066 return false;
11067
11068
11070 return false;
11071
11072
11073 Magazine mag = Magazine.Cast(this);
11074 if (mag)
11075 {
11076 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11077 return false;
11078
11079 if (stack_max_limit)
11080 {
11081 Magazine other_mag = Magazine.Cast(other_item);
11082 if (other_item)
11083 {
11084 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11085 return false;
11086 }
11087
11088 }
11089 }
11090 else
11091 {
11092
11094 return false;
11095
11097 return false;
11098 }
11099
11100 PlayerBase player = null;
11101 if (CastTo(player, GetHierarchyRootPlayer()))
11102 {
11103 if (player.GetInventory().HasAttachment(this))
11104 return false;
11105
11106 if (player.IsItemsToDelete())
11107 return false;
11108 }
11109
11110 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11111 return false;
11112
11113 int slotID;
11115 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11116 return false;
11117
11118 return true;
11119 }
11120
11122 {
11124 }
11125
11127 {
11128 return m_IsResultOfSplit;
11129 }
11130
11132 {
11133 m_IsResultOfSplit = value;
11134 }
11135
11137 {
11139 }
11140
11142 {
11143 float other_item_quantity = other_item.GetQuantity();
11144 float this_free_space;
11145
11147
11149
11150 if (other_item_quantity > this_free_space)
11151 {
11152 return this_free_space;
11153 }
11154 else
11155 {
11156 return other_item_quantity;
11157 }
11158 }
11159
11161 {
11163 }
11164
11166 {
11168 return;
11169
11170 if (!IsMagazine() && other_item)
11171 {
11173 if (quantity_used != 0)
11174 {
11175 float hp1 = GetHealth01("","");
11176 float hp2 = other_item.GetHealth01("","");
11177 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11178 hpResult = hpResult / (
GetQuantity() + quantity_used);
11179
11180 hpResult *= GetMaxHealth();
11181 Math.Round(hpResult);
11182 SetHealth("", "Health", hpResult);
11183
11185 other_item.AddQuantity(-quantity_used);
11186 }
11187 }
11189 }
11190
11192 {
11193 #ifdef SERVER
11194 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11195 GetHierarchyParent().IncreaseLifetimeUp();
11196 #endif
11197 };
11198
11200 {
11201 PlayerBase p = PlayerBase.Cast(player);
11202
11203 array<int> recipesIds = p.m_Recipes;
11204 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11205 if (moduleRecipesManager)
11206 {
11207 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11208 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11209 }
11210
11211 for (int i = 0;i < recipesIds.Count(); i++)
11212 {
11213 int key = recipesIds.Get(i);
11214 string recipeName = moduleRecipesManager.GetRecipeName(key);
11216 }
11217 }
11218
11219
11220 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11221 {
11222 super.GetDebugActions(outputList);
11223
11224
11230
11231
11236
11241
11242
11246
11247
11249 {
11253 }
11254
11257
11258
11262
11264
11265 InventoryLocation loc = new InventoryLocation();
11266 GetInventory().GetCurrentInventoryLocation(loc);
11268 {
11269 if (Gizmo_IsSupported())
11272 }
11273
11275 }
11276
11277
11278
11279
11281 {
11282 super.OnAction(action_id, player, ctx);
11283
11285 {
11286 switch (action_id)
11287 {
11290 return true;
11293 return true;
11294 }
11295 }
11296
11298 {
11299 switch (action_id)
11300 {
11302 Delete();
11303 return true;
11304 }
11305 }
11306
11307 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11308 {
11309 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11310 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11311 PlayerBase p = PlayerBase.Cast(player);
11312 if (
EActions.RECIPES_RANGE_START < 1000)
11313 {
11314 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11315 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11316 }
11317 }
11318 #ifndef SERVER
11319 else if (action_id ==
EActions.WATCH_PLAYER)
11320 {
11321 PluginDeveloper.SetDeveloperItemClientEx(player);
11322 }
11323 #endif
11325 {
11326 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11327 {
11328 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11329 OnDebugButtonPressServer(id + 1);
11330 }
11331
11332 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11333 {
11334 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11336 }
11337
11338 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11339 {
11340 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11342 }
11343
11344 else if (action_id ==
EActions.ADD_QUANTITY)
11345 {
11346 if (IsMagazine())
11347 {
11348 Magazine mag = Magazine.Cast(this);
11349 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11350 }
11351 else
11352 {
11354 }
11355
11356 if (m_EM)
11357 {
11358 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11359 }
11360
11361 }
11362
11363 else if (action_id ==
EActions.REMOVE_QUANTITY)
11364 {
11365 if (IsMagazine())
11366 {
11367 Magazine mag2 = Magazine.Cast(this);
11368 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11369 }
11370 else
11371 {
11373 }
11374 if (m_EM)
11375 {
11376 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11377 }
11378
11379 }
11380
11381 else if (action_id ==
EActions.SET_QUANTITY_0)
11382 {
11384
11385 if (m_EM)
11386 {
11387 m_EM.SetEnergy(0);
11388 }
11389 }
11390
11391 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11392 {
11394
11395 if (m_EM)
11396 {
11397 m_EM.SetEnergy(m_EM.GetEnergyMax());
11398 }
11399 }
11400
11401 else if (action_id ==
EActions.ADD_HEALTH)
11402 {
11403 AddHealth("","",GetMaxHealth("","Health")/5);
11404 }
11405 else if (action_id ==
EActions.REMOVE_HEALTH)
11406 {
11407 AddHealth("","",-GetMaxHealth("","Health")/5);
11408 }
11409 else if (action_id ==
EActions.DESTROY_HEALTH)
11410 {
11411 SetHealth01("","",0);
11412 }
11413 else if (action_id ==
EActions.WATCH_ITEM)
11414 {
11416 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11417 #ifdef DEVELOPER
11418 SetDebugDeveloper_item(this);
11419 #endif
11420 }
11421
11422 else if (action_id ==
EActions.ADD_TEMPERATURE)
11423 {
11424 AddTemperature(20);
11425
11426 }
11427
11428 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11429 {
11430 AddTemperature(-20);
11431
11432 }
11433
11434 else if (action_id ==
EActions.FLIP_FROZEN)
11435 {
11436 SetFrozen(!GetIsFrozen());
11437
11438 }
11439
11440 else if (action_id ==
EActions.ADD_WETNESS)
11441 {
11443
11444 }
11445
11446 else if (action_id ==
EActions.REMOVE_WETNESS)
11447 {
11449
11450 }
11451
11452 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11453 {
11456
11457
11458 }
11459
11460 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11461 {
11464 }
11465
11466 else if (action_id ==
EActions.MAKE_SPECIAL)
11467 {
11468 auto debugParams = DebugSpawnParams.WithPlayer(player);
11469 OnDebugSpawnEx(debugParams);
11470 }
11471
11472 }
11473
11474
11475 return false;
11476 }
11477
11478
11479
11480
11484
11487
11488
11489
11491 {
11492 return false;
11493 }
11494
11495
11497 {
11498 return true;
11499 }
11500
11501
11503 {
11504 return true;
11505 }
11506
11507
11508
11510 {
11511 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11513 }
11514
11517 {
11518 return null;
11519 }
11520
11522 {
11523 return false;
11524 }
11525
11527 {
11528 return false;
11529 }
11530
11534
11535
11537 {
11538 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11539 return module_repairing.CanRepair(this, item_repair_kit);
11540 }
11541
11542
11543 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11544 {
11545 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11546 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11547 }
11548
11549
11551 {
11552
11553
11554
11555
11556
11557
11558
11559
11560 return 1;
11561 }
11562
11563
11564
11566 {
11568 }
11569
11570
11571
11573 {
11575 }
11576
11577
11586 {
11587 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11588
11589 if (player)
11590 {
11591 player.MessageStatus(text);
11592 }
11593 }
11594
11595
11604 {
11605 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11606
11607 if (player)
11608 {
11609 player.MessageAction(text);
11610 }
11611 }
11612
11613
11622 {
11623 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11624
11625 if (player)
11626 {
11627 player.MessageFriendly(text);
11628 }
11629 }
11630
11631
11640 {
11641 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11642
11643 if (player)
11644 {
11645 player.MessageImportant(text);
11646 }
11647 }
11648
11650 {
11651 return true;
11652 }
11653
11654
11655 override bool KindOf(
string tag)
11656 {
11657 bool found = false;
11658 string item_name = this.
GetType();
11661
11662 int array_size = item_tag_array.Count();
11663 for (int i = 0; i < array_size; i++)
11664 {
11665 if (item_tag_array.Get(i) == tag)
11666 {
11667 found = true;
11668 break;
11669 }
11670 }
11671 return found;
11672 }
11673
11674
11676 {
11677
11678 super.OnRPC(sender, rpc_type,ctx);
11679
11680
11681 switch (rpc_type)
11682 {
11683 #ifndef SERVER
11684 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11685 Param2<bool, string> p = new Param2<bool, string>(false, "");
11686
11688 return;
11689
11690 bool play = p.param1;
11691 string soundSet = p.param2;
11692
11693 if (play)
11694 {
11696 {
11698 {
11700 }
11701 }
11702 else
11703 {
11705 }
11706 }
11707 else
11708 {
11710 }
11711
11712 break;
11713 #endif
11714
11715 }
11716
11718 {
11720 }
11721 }
11722
11723
11724
11725
11727 {
11728 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11729 return plugin.GetID(
name);
11730 }
11731
11733 {
11734 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11735 return plugin.GetName(id);
11736 }
11737
11740 {
11741
11742
11743 int varFlags;
11744 if (!ctx.
Read(varFlags))
11745 return;
11746
11747 if (varFlags & ItemVariableFlags.FLOAT)
11748 {
11750 }
11751 }
11752
11754 {
11755
11756 super.SerializeNumericalVars(floats_out);
11757
11758
11759
11761 {
11763 }
11764
11766 {
11768 }
11769
11771 {
11773 }
11774
11776 {
11781 }
11782
11784 {
11786 }
11787 }
11788
11790 {
11791
11792 super.DeSerializeNumericalVars(floats);
11793
11794
11795 int index = 0;
11796 int mask = Math.Round(floats.Get(index));
11797
11798 index++;
11799
11801 {
11803 {
11805 }
11806 else
11807 {
11808 float quantity = floats.Get(index);
11809 SetQuantity(quantity,
true,
false,
false,
false);
11810 }
11811 index++;
11812 }
11813
11815 {
11816 float wet = floats.Get(index);
11818 index++;
11819 }
11820
11822 {
11823 int liquidtype = Math.Round(floats.Get(index));
11825 index++;
11826 }
11827
11829 {
11831 index++;
11833 index++;
11835 index++;
11837 index++;
11838 }
11839
11841 {
11842 int cleanness = Math.Round(floats.Get(index));
11844 index++;
11845 }
11846 }
11847
11849 {
11850 super.WriteVarsToCTX(ctx);
11851
11852
11854 {
11856 }
11857
11859 {
11861 }
11862
11864 {
11866 }
11867
11869 {
11870 int r,g,b,a;
11876 }
11877
11879 {
11881 }
11882 }
11883
11885 {
11886 if (!super.ReadVarsFromCTX(ctx,version))
11887 return false;
11888
11889 int intValue;
11890 float value;
11891
11892 if (version < 140)
11893 {
11894 if (!ctx.
Read(intValue))
11895 return false;
11896
11897 m_VariablesMask = intValue;
11898 }
11899
11901 {
11902 if (!ctx.
Read(value))
11903 return false;
11904
11906 {
11908 }
11909 else
11910 {
11912 }
11913 }
11914
11915 if (version < 140)
11916 {
11918 {
11919 if (!ctx.
Read(value))
11920 return false;
11921 SetTemperatureDirect(value);
11922 }
11923 }
11924
11926 {
11927 if (!ctx.
Read(value))
11928 return false;
11930 }
11931
11933 {
11934 if (!ctx.
Read(intValue))
11935 return false;
11937 }
11938
11940 {
11941 int r,g,b,a;
11943 return false;
11945 return false;
11947 return false;
11949 return false;
11950
11952 }
11953
11955 {
11956 if (!ctx.
Read(intValue))
11957 return false;
11959 }
11960
11961 if (version >= 138 && version < 140)
11962 {
11964 {
11965 if (!ctx.
Read(intValue))
11966 return false;
11967 SetFrozen(intValue);
11968 }
11969 }
11970
11971 return true;
11972 }
11973
11974
11976 {
11979 {
11981 }
11982
11983 if (!super.OnStoreLoad(ctx, version))
11984 {
11986 return false;
11987 }
11988
11989 if (version >= 114)
11990 {
11991 bool hasQuickBarIndexSaved;
11992
11993 if (!ctx.
Read(hasQuickBarIndexSaved))
11994 {
11996 return false;
11997 }
11998
11999 if (hasQuickBarIndexSaved)
12000 {
12001 int itmQBIndex;
12002
12003
12004 if (!ctx.
Read(itmQBIndex))
12005 {
12007 return false;
12008 }
12009
12010 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12011 if (itmQBIndex != -1 && parentPlayer)
12012 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12013 }
12014 }
12015 else
12016 {
12017
12018 PlayerBase player;
12019 int itemQBIndex;
12020 if (version ==
int.
MAX)
12021 {
12022 if (!ctx.
Read(itemQBIndex))
12023 {
12025 return false;
12026 }
12027 }
12028 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12029 {
12030
12031 if (!ctx.
Read(itemQBIndex))
12032 {
12034 return false;
12035 }
12036 if (itemQBIndex != -1 && player)
12037 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12038 }
12039 }
12040
12041 if (version < 140)
12042 {
12043
12044 if (!LoadVariables(ctx, version))
12045 {
12047 return false;
12048 }
12049 }
12050
12051
12053 {
12055 return false;
12056 }
12057 if (version >= 132)
12058 {
12060 if (raib)
12061 {
12063 {
12065 return false;
12066 }
12067 }
12068 }
12069
12071 return true;
12072 }
12073
12074
12075
12077 {
12078 super.OnStoreSave(ctx);
12079
12080 PlayerBase player;
12081 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12082 {
12084
12085 int itemQBIndex = -1;
12086 itemQBIndex = player.FindQuickBarEntityIndex(this);
12087 ctx.
Write(itemQBIndex);
12088 }
12089 else
12090 {
12092 }
12093
12095
12097 if (raib)
12098 {
12100 }
12101 }
12102
12103
12105 {
12106 super.AfterStoreLoad();
12107
12109 {
12111 }
12112
12114 {
12117 }
12118 }
12119
12121 {
12122 super.EEOnAfterLoad();
12123
12125 {
12127 }
12128
12131 }
12132
12134 {
12135 return false;
12136 }
12137
12138
12139
12141 {
12143 {
12144 #ifdef PLATFORM_CONSOLE
12145
12147 {
12149 if (menu)
12150 {
12152 }
12153 }
12154 #endif
12155 }
12156
12158 {
12161 }
12162
12164 {
12165 SetWeightDirty();
12167 }
12169 {
12172 }
12173
12175 {
12178 }
12180 {
12183 }
12184
12185 super.OnVariablesSynchronized();
12186 }
12187
12188
12189
12191 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12192 {
12193 if (!IsServerCheck(allow_client))
12194 return false;
12195
12197 return false;
12198
12201
12202 if (value <= (min + 0.001))
12203 value = min;
12204
12205 if (value == min)
12206 {
12207 if (destroy_config)
12208 {
12209 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12210 if (dstr)
12211 {
12213 this.Delete();
12214 return true;
12215 }
12216 }
12217 else if (destroy_forced)
12218 {
12220 this.Delete();
12221 return true;
12222 }
12223
12225 }
12226
12229
12231 {
12233
12234 if (delta)
12236 }
12237
12239
12240 return false;
12241 }
12242
12243
12245 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12246 {
12248 }
12249
12251 {
12254 }
12255
12257 {
12260 }
12261
12263 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12264 {
12265 float value_clamped = Math.Clamp(value, 0, 1);
12267 SetQuantity(result, destroy_config, destroy_forced);
12268 }
12269
12270
12273 {
12275 }
12276
12278 {
12280 }
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12292 {
12293 int slot = -1;
12294 if (GetInventory())
12295 {
12296 InventoryLocation il = new InventoryLocation;
12297 GetInventory().GetCurrentInventoryLocation(il);
12299 }
12300
12302 }
12303
12305 {
12306 float quantity_max = 0;
12307
12309 {
12310 if (attSlotID != -1)
12311 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12312
12313 if (quantity_max <= 0)
12315 }
12316
12317 if (quantity_max <= 0)
12319
12320 return quantity_max;
12321 }
12322
12324 {
12326 }
12327
12329 {
12331 }
12332
12333
12335 {
12337 }
12338
12340 {
12342 }
12343
12345 {
12347 }
12348
12349
12351 {
12352
12353 float weightEx = GetWeightEx();
12354 float special = GetInventoryAndCargoWeight();
12355 return weightEx - special;
12356 }
12357
12358
12360 {
12362 }
12363
12365 {
12367 {
12368 #ifdef DEVELOPER
12369 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12370 {
12371 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12373 }
12374 #endif
12375
12376 return GetQuantity() * GetConfigWeightModified();
12377 }
12378 else if (HasEnergyManager())
12379 {
12380 #ifdef DEVELOPER
12381 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12382 {
12383 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12384 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12385 }
12386 #endif
12387 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12388 }
12389 else
12390 {
12391 #ifdef DEVELOPER
12392 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12393 {
12394 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12395 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12396 }
12397 #endif
12398 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12399 }
12400 }
12401
12404 {
12405 int item_count = 0;
12407
12408 if (GetInventory().GetCargo() != NULL)
12409 {
12410 item_count = GetInventory().GetCargo().GetItemCount();
12411 }
12412
12413 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12414 {
12415 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12416 if (item)
12417 item_count += item.GetNumberOfItems();
12418 }
12419 return item_count;
12420 }
12421
12424 {
12425 float weight = 0;
12426 float wetness = 1;
12427 if (include_wetness)
12430 {
12431 weight = wetness * m_ConfigWeight;
12432 }
12434 {
12435 weight = 1;
12436 }
12437 return weight;
12438 }
12439
12440
12441
12443 {
12444 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12445 {
12446 GameInventory inv = GetInventory();
12447 array<EntityAI> items = new array<EntityAI>;
12449 for (int i = 0; i < items.Count(); i++)
12450 {
12452 if (item)
12453 {
12455 }
12456 }
12457 }
12458 }
12459
12460
12461
12462
12464 {
12465 float energy = 0;
12466 if (HasEnergyManager())
12467 {
12468 energy = GetCompEM().GetEnergy();
12469 }
12470 return energy;
12471 }
12472
12473
12475 {
12476 super.OnEnergyConsumed();
12477
12479 }
12480
12482 {
12483 super.OnEnergyAdded();
12484
12486 }
12487
12488
12490 {
12491 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12492 {
12494 {
12495 float energy_0to1 = GetCompEM().GetEnergy0To1();
12497 }
12498 }
12499 }
12500
12501
12503 {
12504 return ConfigGetFloat("heatIsolation");
12505 }
12506
12508 {
12510 }
12511
12513 {
12514 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12515 if (
GetGame().ConfigIsExisting(paramPath))
12517
12518 return 0.0;
12519 }
12520
12522 {
12523 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12524 if (
GetGame().ConfigIsExisting(paramPath))
12526
12527 return 0.0;
12528 }
12529
12530 override void SetWet(
float value,
bool allow_client =
false)
12531 {
12532 if (!IsServerCheck(allow_client))
12533 return;
12534
12537
12539
12540 m_VarWet = Math.Clamp(value, min, max);
12541
12543 {
12546 }
12547 }
12548
12549 override void AddWet(
float value)
12550 {
12552 }
12553
12555 {
12557 }
12558
12560 {
12562 }
12563
12565 {
12567 }
12568
12570 {
12572 }
12573
12575 {
12577 }
12578
12579 override void OnWetChanged(
float newVal,
float oldVal)
12580 {
12583 if (newLevel != oldLevel)
12584 {
12586 }
12587 }
12588
12590 {
12591 SetWeightDirty();
12592 }
12593
12595 {
12596 return GetWetLevelInternal(
m_VarWet);
12597 }
12598
12599
12600
12602 {
12604 }
12605
12607 {
12609 }
12610
12612 {
12614 }
12615
12617 {
12619 }
12620
12621
12622
12624 {
12625 if (ConfigIsExisting("itemModelLength"))
12626 {
12627 return ConfigGetFloat("itemModelLength");
12628 }
12629 return 0;
12630 }
12631
12633 {
12634 if (ConfigIsExisting("itemAttachOffset"))
12635 {
12636 return ConfigGetFloat("itemAttachOffset");
12637 }
12638 return 0;
12639 }
12640
12641 override void SetCleanness(
int value,
bool allow_client =
false)
12642 {
12643 if (!IsServerCheck(allow_client))
12644 return;
12645
12647
12649
12652 }
12653
12655 {
12657 }
12658
12660 {
12661 return true;
12662 }
12663
12664
12665
12666
12668 {
12670 }
12671
12673 {
12675 }
12676
12677
12678
12679
12680 override void SetColor(
int r,
int g,
int b,
int a)
12681 {
12687 }
12689 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12690 {
12695 }
12696
12698 {
12700 }
12701
12704 {
12705 int r,g,b,a;
12707 r = r/255;
12708 g = g/255;
12709 b = b/255;
12710 a = a/255;
12711 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12712 }
12713
12714
12715
12716 override void SetLiquidType(
int value,
bool allow_client =
false)
12717 {
12718 if (!IsServerCheck(allow_client))
12719 return;
12720
12725 }
12726
12728 {
12729 return ConfigGetInt("varLiquidTypeInit");
12730 }
12731
12733 {
12735 }
12736
12738 {
12740 SetFrozen(false);
12741 }
12742
12745 {
12746 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12747 }
12748
12749
12752 {
12753 PlayerBase nplayer;
12754 if (PlayerBase.CastTo(nplayer, player))
12755 {
12757
12758 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12759 }
12760 }
12761
12762
12765 {
12766 PlayerBase nplayer;
12767 if (PlayerBase.CastTo(nplayer,player))
12768 {
12769
12770 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12771
12772 }
12773
12774
12775 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12776
12777
12778 if (HasEnergyManager())
12779 {
12780 GetCompEM().UpdatePlugState();
12781 }
12782 }
12783
12784
12786 {
12787 super.OnPlacementStarted(player);
12788
12790 }
12791
12792 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12793 {
12795 {
12796 m_AdminLog.OnPlacementComplete(player,
this);
12797 }
12798
12799 super.OnPlacementComplete(player, position, orientation);
12800 }
12801
12802
12803
12804
12805
12807 {
12809 {
12810 return true;
12811 }
12812 else
12813 {
12814 return false;
12815 }
12816 }
12817
12818
12820 {
12822 {
12824 }
12825 }
12826
12827
12829 {
12831 }
12832
12834 {
12836 }
12837
12838 override void InsertAgent(
int agent,
float count = 1)
12839 {
12840 if (count < 1)
12841 return;
12842
12844 }
12845
12848 {
12850 }
12851
12852
12854 {
12856 }
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12900 {
12902 return false;
12903 return true;
12904 }
12905
12907 {
12908
12910 }
12911
12912
12915 {
12916 super.CheckForRoofLimited(timeTresholdMS);
12917
12919 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12920 {
12921 m_PreviousRoofTestTime = time;
12922 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12923 }
12924 }
12925
12926
12928 {
12930 {
12931 return 0;
12932 }
12933
12934 if (GetInventory().GetAttachmentSlotsCount() != 0)
12935 {
12936 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12937 if (filter)
12938 return filter.GetProtectionLevel(type, false, system);
12939 else
12940 return 0;
12941 }
12942
12943 string subclassPath, entryName;
12944
12945 switch (type)
12946 {
12948 entryName = "biological";
12949 break;
12951 entryName = "chemical";
12952 break;
12953 default:
12954 entryName = "biological";
12955 break;
12956 }
12957
12958 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12959
12961 }
12962
12963
12964
12967 {
12968 if (!IsMagazine())
12970
12972 }
12973
12974
12975
12976
12977
12982 {
12983 return true;
12984 }
12985
12987 {
12989 }
12990
12991
12992
12993
12994
12996 {
12997 if (parent)
12998 {
12999 if (parent.IsInherited(DayZInfected))
13000 return true;
13001
13002 if (!parent.IsRuined())
13003 return true;
13004 }
13005
13006 return true;
13007 }
13008
13010 {
13011 if (!super.CanPutAsAttachment(parent))
13012 {
13013 return false;
13014 }
13015
13016 if (!IsRuined() && !parent.IsRuined())
13017 {
13018 return true;
13019 }
13020
13021 return false;
13022 }
13023
13025 {
13026
13027
13028
13029
13030 return super.CanReceiveItemIntoCargo(item);
13031 }
13032
13034 {
13035
13036
13037
13038
13039 GameInventory attachmentInv = attachment.GetInventory();
13041 {
13042 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13043 return false;
13044 }
13045
13046 InventoryLocation loc = new InventoryLocation();
13047 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13048 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13049 return false;
13050
13051 return super.CanReceiveAttachment(attachment, slotId);
13052 }
13053
13055 {
13056 if (!super.CanReleaseAttachment(attachment))
13057 return false;
13058
13059 return GetInventory().AreChildrenAccessible();
13060 }
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13083 {
13084 int id = muzzle_owner.GetMuzzleID();
13085 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13086
13087 if (WPOF_array)
13088 {
13089 for (int i = 0; i < WPOF_array.Count(); i++)
13090 {
13091 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13092
13093 if (WPOF)
13094 {
13095 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13096 }
13097 }
13098 }
13099 }
13100
13101
13103 {
13104 int id = muzzle_owner.GetMuzzleID();
13106
13107 if (WPOBE_array)
13108 {
13109 for (int i = 0; i < WPOBE_array.Count(); i++)
13110 {
13111 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13112
13113 if (WPOBE)
13114 {
13115 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13116 }
13117 }
13118 }
13119 }
13120
13121
13123 {
13124 int id = muzzle_owner.GetMuzzleID();
13125 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13126
13127 if (WPOOH_array)
13128 {
13129 for (int i = 0; i < WPOOH_array.Count(); i++)
13130 {
13131 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13132
13133 if (WPOOH)
13134 {
13135 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13136 }
13137 }
13138 }
13139 }
13140
13141
13143 {
13144 int id = muzzle_owner.GetMuzzleID();
13145 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13146
13147 if (WPOOH_array)
13148 {
13149 for (int i = 0; i < WPOOH_array.Count(); i++)
13150 {
13151 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13152
13153 if (WPOOH)
13154 {
13155 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13156 }
13157 }
13158 }
13159 }
13160
13161
13163 {
13164 int id = muzzle_owner.GetMuzzleID();
13165 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13166
13167 if (WPOOH_array)
13168 {
13169 for (int i = 0; i < WPOOH_array.Count(); i++)
13170 {
13171 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13172
13173 if (WPOOH)
13174 {
13175 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13176 }
13177 }
13178 }
13179 }
13180
13181
13182
13184 {
13186 {
13187 return true;
13188 }
13189
13190 return false;
13191 }
13192
13194 {
13196 {
13197 return true;
13198 }
13199
13200 return false;
13201 }
13202
13204 {
13206 {
13207 return true;
13208 }
13209
13210 return false;
13211 }
13212
13214 {
13215 return false;
13216 }
13217
13220 {
13221 return UATimeSpent.DEFAULT_DEPLOY;
13222 }
13223
13224
13225
13226
13228 {
13230 SetSynchDirty();
13231 }
13232
13234 {
13236 }
13237
13238
13240 {
13241 return false;
13242 }
13243
13246 {
13247 string att_type = "None";
13248
13249 if (ConfigIsExisting("soundAttType"))
13250 {
13251 att_type = ConfigGetString("soundAttType");
13252 }
13253
13255 }
13256
13258 {
13260 }
13261
13262
13263
13264
13265
13271
13273 {
13276
13278 }
13279
13280
13282 {
13284 return;
13285
13287
13290
13293
13294 SoundParameters params = new SoundParameters();
13298 }
13299
13300
13302 {
13304 return;
13305
13307 SetSynchDirty();
13308
13311 }
13312
13313
13315 {
13317 return;
13318
13320 SetSynchDirty();
13321
13324 }
13325
13327 {
13329 }
13330
13332 {
13334 }
13335
13338 {
13339 if (!
GetGame().IsDedicatedServer())
13340 {
13341 if (ConfigIsExisting("attachSoundSet"))
13342 {
13343 string cfg_path = "";
13344 string soundset = "";
13345 string type_name =
GetType();
13346
13349 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13350 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13351
13352 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13353 {
13354 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13355 {
13356 if (cfg_slot_array[i] == slot_type)
13357 {
13358 soundset = cfg_soundset_array[i];
13359 break;
13360 }
13361 }
13362 }
13363
13364 if (soundset != "")
13365 {
13366 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13368 }
13369 }
13370 }
13371 }
13372
13374 {
13375
13376 }
13377
13378 void OnApply(PlayerBase player);
13379
13381 {
13382 return 1.0;
13383 };
13384
13386 {
13388 }
13389
13391 {
13393 }
13394
13396
13398 {
13399 SetDynamicPhysicsLifeTime(0.01);
13401 }
13402
13404 {
13405 array<string> zone_names = new array<string>;
13406 GetDamageZones(zone_names);
13407 for (int i = 0; i < zone_names.Count(); i++)
13408 {
13409 SetHealthMax(zone_names.Get(i),"Health");
13410 }
13411 SetHealthMax("","Health");
13412 }
13413
13416 {
13417 float global_health = GetHealth01("","Health");
13418 array<string> zones = new array<string>;
13419 GetDamageZones(zones);
13420
13421 for (int i = 0; i < zones.Count(); i++)
13422 {
13423 SetHealth01(zones.Get(i),"Health",global_health);
13424 }
13425 }
13426
13429 {
13430 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13431 }
13432
13434 {
13435 if (!hasRootAsPlayer)
13436 {
13437 if (refParentIB)
13438 {
13439
13440 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13441 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13442
13443 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13444 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13445
13448 }
13449 else
13450 {
13451
13454 }
13455 }
13456 }
13457
13459 {
13461 {
13462 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13463 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13464 {
13465 float heatPermCoef = 1.0;
13467 while (ent)
13468 {
13469 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13470 ent = ent.GetHierarchyParent();
13471 }
13472
13473 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13474 }
13475 }
13476 }
13477
13479 {
13480
13481 EntityAI parent = GetHierarchyParent();
13482 if (!parent)
13483 {
13484 hasParent = false;
13485 hasRootAsPlayer = false;
13486 }
13487 else
13488 {
13489 hasParent = true;
13490 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13491 refParentIB =
ItemBase.Cast(parent);
13492 }
13493 }
13494
13495 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13496 {
13497
13498 }
13499
13501 {
13502
13503 return false;
13504 }
13505
13507 {
13508
13509
13510 return false;
13511 }
13512
13514 {
13515
13516 return false;
13517 }
13518
13521 {
13522 return !GetIsFrozen() &&
IsOpen();
13523 }
13524
13526 {
13527 bool hasParent = false, hasRootAsPlayer = false;
13529
13530 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13531 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13532
13533 if (wwtu || foodDecay)
13534 {
13538
13539 if (processWetness || processTemperature || processDecay)
13540 {
13542
13543 if (processWetness)
13544 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13545
13546 if (processTemperature)
13548
13549 if (processDecay)
13550 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13551 }
13552 }
13553 }
13554
13557 {
13559 }
13560
13562 {
13565
13566 return super.GetTemperatureFreezeThreshold();
13567 }
13568
13570 {
13573
13574 return super.GetTemperatureThawThreshold();
13575 }
13576
13578 {
13581
13582 return super.GetItemOverheatThreshold();
13583 }
13584
13586 {
13588 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13589
13590 return super.GetTemperatureFreezeTime();
13591 }
13592
13594 {
13596 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13597
13598 return super.GetTemperatureThawTime();
13599 }
13600
13605
13607 {
13608 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13609 }
13610
13612 {
13613 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13614 }
13615
13618 {
13620 }
13621
13623 {
13625 }
13626
13628 {
13630 }
13631
13634 {
13635 return null;
13636 }
13637
13640 {
13641 return false;
13642 }
13643
13645 {
13647 {
13650 if (!trg)
13651 {
13653 explosive = this;
13654 }
13655
13656 explosive.PairRemote(trg);
13658
13659 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13660 trg.SetPersistentPairID(persistentID);
13661 explosive.SetPersistentPairID(persistentID);
13662
13663 return true;
13664 }
13665 return false;
13666 }
13667
13670 {
13671 float ret = 1.0;
13674 ret *= GetHealth01();
13675
13676 return ret;
13677 }
13678
13679 #ifdef DEVELOPER
13680 override void SetDebugItem()
13681 {
13682 super.SetDebugItem();
13683 _itemBase = this;
13684 }
13685
13687 {
13688 string text = super.GetDebugText();
13689
13691 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13692
13693 return text;
13694 }
13695 #endif
13696
13698 {
13699 return true;
13700 }
13701
13703
13705
13707 {
13710 }
13711
13712
13720
13736}
13737
13739{
13741 if (entity)
13742 {
13743 bool is_item = entity.IsInherited(
ItemBase);
13744 if (is_item && full_quantity)
13745 {
13748 }
13749 }
13750 else
13751 {
13753 return NULL;
13754 }
13755 return entity;
13756}
13757
13759{
13760 if (item)
13761 {
13762 if (health > 0)
13763 item.SetHealth("", "", health);
13764
13765 if (item.CanHaveTemperature())
13766 {
13768 if (item.CanFreeze())
13769 item.SetFrozen(false);
13770 }
13771
13772 if (item.HasEnergyManager())
13773 {
13774 if (quantity >= 0)
13775 {
13776 item.GetCompEM().SetEnergy0To1(quantity);
13777 }
13778 else
13779 {
13781 }
13782 }
13783 else if (item.IsMagazine())
13784 {
13785 Magazine mag = Magazine.Cast(item);
13786 if (quantity >= 0)
13787 {
13788 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13789 }
13790 else
13791 {
13793 }
13794
13795 }
13796 else
13797 {
13798 if (quantity >= 0)
13799 {
13800 item.SetQuantityNormalized(quantity, false);
13801 }
13802 else
13803 {
13805 }
13806
13807 }
13808 }
13809}
13810
13811#ifdef DEVELOPER
13813#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.