8941{
8943 {
8944 return true;
8945 }
8946};
8947
8948
8949
8951{
8955
8957
8960
8961
8962
8963
8964
8973
8979
8984
8989
9010 protected bool m_IsResultOfSplit
9011
9013
9018
9019
9020
9022
9026
9027
9028
9030
9033
9034
9035
9041
9042
9050
9053
9054
9056
9057
9059
9060
9065
9066
9071
9072
9074
9075
9077 {
9082
9083 if (!
GetGame().IsDedicatedServer())
9084 {
9086 {
9088
9090 {
9092 }
9093 }
9094
9097 }
9098
9099 m_OldLocation = null;
9100
9102 {
9104 }
9105
9106 if (ConfigIsExisting("headSelectionsToHide"))
9107 {
9110 }
9111
9113 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9114 {
9116 }
9117
9119
9120 m_IsResultOfSplit = false;
9121
9123 }
9124
9126 {
9127 super.InitItemVariables();
9128
9134 m_Count = ConfigGetInt(
"count");
9135
9138
9143
9146
9151
9163
9167
9168
9171 if (ConfigIsExisting("canBeSplit"))
9172 {
9175 }
9176
9178 if (ConfigIsExisting("itemBehaviour"))
9180
9181
9184 RegisterNetSyncVariableInt("m_VarLiquidType");
9185 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9186
9187 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9188 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9189 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9190
9191 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9192 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9193 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9194 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9195
9196 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9197 RegisterNetSyncVariableBool("m_IsTakeable");
9198 RegisterNetSyncVariableBool("m_IsHologram");
9199
9202 {
9205 }
9206
9208
9210 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9212
9213 }
9214
9216 {
9218 }
9219
9221 {
9224 {
9229 }
9230 }
9231
9232 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9233 {
9235 {
9238 }
9239
9241 }
9242
9244 {
9250 }
9251
9253
9255 {
9257
9258 if (!action)
9259 {
9260 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9261 return;
9262 }
9263
9265 if (!ai)
9266 {
9268 return;
9269 }
9270
9272 if (!action_array)
9273 {
9274 action_array = new array<ActionBase_Basic>;
9276 }
9277 if (LogManager.IsActionLogEnable())
9278 {
9279 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9280 }
9281
9282 if (action_array.Find(action) != -1)
9283 {
9284 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9285 }
9286 else
9287 {
9288 action_array.Insert(action);
9289 }
9290 }
9291
9293 {
9295 ActionBase action = player.GetActionManager().GetAction(actionName);
9298
9299 if (action_array)
9300 {
9301 action_array.RemoveItem(action);
9302 }
9303 }
9304
9305
9306
9308 {
9309 ActionOverrideData overrideData = new ActionOverrideData();
9313
9315 if (!actionMap)
9316 {
9319 }
9320
9321 actionMap.Insert(this.
Type(), overrideData);
9322
9323 }
9324
9326
9328
9329
9331 {
9334
9337
9338 string config_to_search = "CfgVehicles";
9339 string muzzle_owner_config;
9340
9342 {
9343 if (IsInherited(Weapon))
9344 config_to_search = "CfgWeapons";
9345
9346 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9347
9348 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9349
9351
9352 if (config_OnFire_subclass_count > 0)
9353 {
9354 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9355
9356 for (int i = 0; i < config_OnFire_subclass_count; i++)
9357 {
9358 string particle_class = "";
9360 string config_OnFire_entry = config_OnFire_class + particle_class;
9361 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9362 WPOF_array.Insert(WPOF);
9363 }
9364
9365
9367 }
9368 }
9369
9371 {
9372 config_to_search = "CfgWeapons";
9373 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9374
9375 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9376
9378
9379 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9380 {
9381 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9382
9383 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9384 {
9385 string particle_class2 = "";
9387 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9388 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9389 WPOBE_array.Insert(WPOBE);
9390 }
9391
9392
9394 }
9395 }
9396 }
9397
9398
9400 {
9403
9405 {
9406 string config_to_search = "CfgVehicles";
9407
9408 if (IsInherited(Weapon))
9409 config_to_search = "CfgWeapons";
9410
9411 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9412 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9413
9414 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9415 {
9416
9418
9420 {
9422 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9424 return;
9425 }
9426
9429
9430
9431
9433 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9434
9435 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9436 {
9437 string particle_class = "";
9439 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9441
9442 if (entry_type == CT_CLASS)
9443 {
9444 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9445 WPOOH_array.Insert(WPOF);
9446 }
9447 }
9448
9449
9451 }
9452 }
9453 }
9454
9456 {
9458 }
9459
9461 {
9463 {
9465
9468
9471
9472 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9473 }
9474 }
9475
9477 {
9479 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9480
9482 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9483
9485 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9486
9488 {
9490 }
9491 }
9492
9494 {
9496 }
9497
9499 {
9502 else
9504
9506 {
9509 }
9510 else
9511 {
9514
9517 }
9518
9520 }
9521
9523 {
9525 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9526 }
9527
9529 {
9531 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9533 }
9534
9536 {
9538 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9539 }
9540
9542 {
9545
9546 OverheatingParticle OP = new OverheatingParticle();
9551
9553 }
9554
9556 {
9559
9560 return -1;
9561 }
9562
9564 {
9566 {
9569
9570 for (int i = count; i > 0; --i)
9571 {
9572 int id = i - 1;
9575
9578
9579 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9580 {
9581 if (p)
9582 {
9585 }
9586 }
9587 }
9588 }
9589 }
9590
9592 {
9594 {
9596 {
9597 int id = i - 1;
9599
9600 if (OP)
9601 {
9603
9604 if (p)
9605 {
9607 }
9608
9609 delete OP;
9610 }
9611 }
9612
9615 }
9616 }
9617
9620 {
9621 return 0.0;
9622 }
9623
9624
9626 {
9627 return 250;
9628 }
9629
9631 {
9632 return 0;
9633 }
9634
9637 {
9639 return true;
9640
9641 return false;
9642 }
9643
9646 {
9649
9651 {
9653 }
9654 else
9655 {
9656
9658 }
9659
9661 }
9662
9669 {
9670 return -1;
9671 }
9672
9673
9674
9675
9677 {
9679 {
9681 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9682
9683 if (r_index >= 0)
9684 {
9685 InventoryLocation r_il = new InventoryLocation;
9686 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9687
9688 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9691 {
9692 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9693 }
9695 {
9696 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9697 }
9698
9699 }
9700
9701 player.GetHumanInventory().ClearUserReservedLocation(this);
9702 }
9703
9706 }
9707
9708
9709
9710
9712 {
9713 return ItemBase.m_DebugActionsMask;
9714 }
9715
9717 {
9718 return ItemBase.m_DebugActionsMask & mask;
9719 }
9720
9722 {
9723 ItemBase.m_DebugActionsMask = mask;
9724 }
9725
9727 {
9728 ItemBase.m_DebugActionsMask |= mask;
9729 }
9730
9732 {
9733 ItemBase.m_DebugActionsMask &= ~mask;
9734 }
9735
9737 {
9739 {
9741 }
9742 else
9743 {
9745 }
9746 }
9747
9748
9750 {
9751 if (GetEconomyProfile())
9752 {
9753 float q_max = GetEconomyProfile().GetQuantityMax();
9754 if (q_max > 0)
9755 {
9756 float q_min = GetEconomyProfile().GetQuantityMin();
9757 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9758
9760 {
9761 ComponentEnergyManager comp = GetCompEM();
9763 {
9765 }
9766 }
9768 {
9770
9771 }
9772
9773 }
9774 }
9775 }
9776
9779 {
9780 EntityAI parent = GetHierarchyParent();
9781
9782 if (parent)
9783 {
9784 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9785 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9786 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9787 }
9788 }
9789
9792 {
9793 EntityAI parent = GetHierarchyParent();
9794
9795 if (parent)
9796 {
9797 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9798 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9799 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9800 }
9801 }
9802
9804 {
9805
9806
9807
9808
9810
9812 {
9813 if (ScriptInputUserData.CanStoreInputUserData())
9814 {
9815 ScriptInputUserData ctx = new ScriptInputUserData;
9821 ctx.
Write(use_stack_max);
9824
9826 {
9827 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9828 }
9829 }
9830 }
9831 else if (!
GetGame().IsMultiplayer())
9832 {
9834 }
9835 }
9836
9838 {
9840 }
9841
9843 {
9845 }
9846
9848 {
9850 }
9851
9853 {
9854
9855 return false;
9856 }
9857
9859 {
9860 return false;
9861 }
9862
9866 {
9867 return false;
9868 }
9869
9871 {
9872 return "";
9873 }
9874
9876
9878 {
9879 return false;
9880 }
9881
9883 {
9884 return true;
9885 }
9886
9887
9888
9890 {
9891 return true;
9892 }
9893
9895 {
9896 return true;
9897 }
9898
9900 {
9901 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9903 }
9904
9906 {
9908 }
9909
9911 {
9913 if (!is_being_placed)
9915 SetSynchDirty();
9916 }
9917
9918
9920
9922 {
9924 }
9925
9927 {
9929 }
9930
9932 {
9933 return 1;
9934 }
9935
9937 {
9938 return false;
9939 }
9940
9942 {
9944 SetSynchDirty();
9945 }
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9982 {
9983 super.OnMovedInsideCargo(container);
9984
9985 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9986 }
9987
9988 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9989 {
9990 super.EEItemLocationChanged(oldLoc,newLoc);
9991
9992 PlayerBase new_player = null;
9993 PlayerBase old_player = null;
9994
9995 if (newLoc.GetParent())
9996 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9997
9998 if (oldLoc.GetParent())
9999 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10000
10002 {
10003 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10004
10005 if (r_index >= 0)
10006 {
10007 InventoryLocation r_il = new InventoryLocation;
10008 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10009
10010 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10013 {
10014 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10015 }
10017 {
10018 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10019 }
10020
10021 }
10022 }
10023
10025 {
10026 if (new_player)
10027 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10028
10029 if (new_player == old_player)
10030 {
10031
10032 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10033 {
10035 {
10036 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10037 {
10038 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10039 }
10040 }
10041 else
10042 {
10043 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10044 }
10045 }
10046
10047 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10048 {
10049 int type = oldLoc.GetType();
10051 {
10052 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10053 }
10055 {
10056 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10057 }
10058 }
10059 if (!m_OldLocation)
10060 {
10061 m_OldLocation = new InventoryLocation;
10062 }
10063 m_OldLocation.Copy(oldLoc);
10064 }
10065 else
10066 {
10067 if (m_OldLocation)
10068 {
10069 m_OldLocation.Reset();
10070 }
10071 }
10072
10074 }
10075 else
10076 {
10077 if (new_player)
10078 {
10079 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10080 if (res_index >= 0)
10081 {
10082 InventoryLocation il = new InventoryLocation;
10083 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10085 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10088 {
10089 il.
GetParent().GetOnReleaseLock().Invoke(it);
10090 }
10092 {
10094 }
10095
10096 }
10097 }
10099 {
10100
10102 }
10103
10104 if (m_OldLocation)
10105 {
10106 m_OldLocation.Reset();
10107 }
10108 }
10109 }
10110
10111 override void EOnContact(IEntity other, Contact extra)
10112 {
10114 {
10115 int liquidType = -1;
10117 if (impactSpeed > 0.0)
10118 {
10120 #ifndef SERVER
10122 #else
10124 SetSynchDirty();
10125 #endif
10127 }
10128 }
10129
10130 #ifdef SERVER
10131 if (GetCompEM() && GetCompEM().IsPlugged())
10132 {
10133 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10134 GetCompEM().UnplugThis();
10135 }
10136 #endif
10137 }
10138
10140
10142 {
10144 }
10145
10147 {
10148
10149 }
10150
10152 {
10153 super.OnItemLocationChanged(old_owner, new_owner);
10154
10155 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10156 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10157
10158 if (!relatedPlayer && playerNew)
10159 relatedPlayer = playerNew;
10160
10161 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10162 {
10164 if (actionMgr)
10165 {
10166 ActionBase currentAction = actionMgr.GetRunningAction();
10167 if (currentAction)
10169 }
10170 }
10171
10172 Man ownerPlayerOld = null;
10173 Man ownerPlayerNew = null;
10174
10175 if (old_owner)
10176 {
10177 if (old_owner.
IsMan())
10178 {
10179 ownerPlayerOld = Man.Cast(old_owner);
10180 }
10181 else
10182 {
10183 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10184 }
10185 }
10186 else
10187 {
10189 {
10191
10192 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10193 {
10194 GetCompEM().UnplugThis();
10195 }
10196 }
10197 }
10198
10199 if (new_owner)
10200 {
10201 if (new_owner.
IsMan())
10202 {
10203 ownerPlayerNew = Man.Cast(new_owner);
10204 }
10205 else
10206 {
10207 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10208 }
10209 }
10210
10211 if (ownerPlayerOld != ownerPlayerNew)
10212 {
10213 if (ownerPlayerOld)
10214 {
10215 array<EntityAI> subItemsExit = new array<EntityAI>;
10217 for (int i = 0; i < subItemsExit.Count(); i++)
10218 {
10221 }
10222 }
10223
10224 if (ownerPlayerNew)
10225 {
10226 array<EntityAI> subItemsEnter = new array<EntityAI>;
10228 for (int j = 0; j < subItemsEnter.Count(); j++)
10229 {
10232 }
10233 }
10234 }
10235 else if (ownerPlayerNew != null)
10236 {
10237 PlayerBase nplayer;
10238 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10239 {
10240 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10242 for (int k = 0; k < subItemsUpdate.Count(); k++)
10243 {
10245 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10246 }
10247 }
10248 }
10249
10250 if (old_owner)
10251 old_owner.OnChildItemRemoved(this);
10252 if (new_owner)
10253 new_owner.OnChildItemReceived(this);
10254 }
10255
10256
10258 {
10259 super.EEDelete(parent);
10260 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10261 if (player)
10262 {
10264
10265 if (player.IsAlive())
10266 {
10267 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10268 if (r_index >= 0)
10269 {
10270 InventoryLocation r_il = new InventoryLocation;
10271 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10272
10273 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10276 {
10277 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10278 }
10280 {
10281 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10282 }
10283
10284 }
10285
10286 player.RemoveQuickBarEntityShortcut(this);
10287 }
10288 }
10289 }
10290
10292 {
10293 super.EEKilled(killer);
10294
10297 {
10298 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10299 {
10300 if (IsMagazine())
10301 {
10302 if (Magazine.Cast(this).GetAmmoCount() > 0)
10303 {
10305 }
10306 }
10307 else
10308 {
10310 }
10311 }
10312 }
10313 }
10314
10316 {
10317 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10318
10319 super.OnWasAttached(parent, slot_id);
10320
10323
10325 }
10326
10328 {
10329 super.OnWasDetached(parent, slot_id);
10330
10333 }
10334
10336 {
10337 int idx;
10340
10341 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10342 if (inventory_slots.Count() < 1)
10343 {
10344 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10345 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10346 }
10347 else
10348 {
10349 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10350 }
10351
10352 idx = inventory_slots.Find(slot);
10353 if (idx < 0)
10354 return "";
10355
10356 return attach_types.Get(idx);
10357 }
10358
10360 {
10361 int idx = -1;
10362 string slot;
10363
10366
10367 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10368 if (inventory_slots.Count() < 1)
10369 {
10370 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10371 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10372 }
10373 else
10374 {
10375 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10376 if (detach_types.Count() < 1)
10377 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10378 }
10379
10380 for (int i = 0; i < inventory_slots.Count(); i++)
10381 {
10382 slot = inventory_slots.Get(i);
10383 }
10384
10385 if (slot != "")
10386 {
10387 if (detach_types.Count() == 1)
10388 idx = 0;
10389 else
10390 idx = inventory_slots.Find(slot);
10391 }
10392 if (idx < 0)
10393 return "";
10394
10395 return detach_types.Get(idx);
10396 }
10397
10399 {
10400
10402
10403
10404 float min_time = 1;
10405 float max_time = 3;
10406 float delay = Math.RandomFloat(min_time, max_time);
10407
10408 explode_timer.Run(delay, this, "DoAmmoExplosion");
10409 }
10410
10412 {
10413 Magazine magazine = Magazine.Cast(this);
10414 int pop_sounds_count = 6;
10415 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10416
10417
10418 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10419 string sound_name = pop_sounds[ sound_idx ];
10421
10422
10423 magazine.ServerAddAmmoCount(-1);
10424
10425
10426 float min_temp_to_explode = 100;
10427
10428 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10429 {
10431 }
10432 }
10433
10434
10435 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10436 {
10437 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10438
10439 const int CHANCE_DAMAGE_CARGO = 4;
10440 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10441 const int CHANCE_DAMAGE_NOTHING = 2;
10442
10444 {
10445 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10446 int chances;
10447 int rnd;
10448
10449 if (GetInventory().GetCargo())
10450 {
10451 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10452 rnd = Math.RandomInt(0,chances);
10453
10454 if (rnd < CHANCE_DAMAGE_CARGO)
10455 {
10457 }
10458 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10459 {
10461 }
10462 }
10463 else
10464 {
10465 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10466 rnd = Math.RandomInt(0,chances);
10467
10468 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10469 {
10471 }
10472 }
10473 }
10474 }
10475
10477 {
10478 if (GetInventory().GetCargo())
10479 {
10480 int item_count = GetInventory().GetCargo().GetItemCount();
10481 if (item_count > 0)
10482 {
10483 int random_pick = Math.RandomInt(0, item_count);
10485 if (!item.IsExplosive())
10486 {
10487 item.AddHealth("","",damage);
10488 return true;
10489 }
10490 }
10491 }
10492 return false;
10493 }
10494
10496 {
10497 int attachment_count = GetInventory().AttachmentCount();
10498 if (attachment_count > 0)
10499 {
10500 int random_pick = Math.RandomInt(0, attachment_count);
10501 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10502 if (!attachment.IsExplosive())
10503 {
10504 attachment.AddHealth("","",damage);
10505 return true;
10506 }
10507 }
10508 return false;
10509 }
10510
10512 {
10514 }
10515
10517 {
10519 return GetInventory().CanRemoveEntity();
10520
10521 return false;
10522 }
10523
10525 {
10527 return;
10528
10530 {
10531 if (ScriptInputUserData.CanStoreInputUserData())
10532 {
10533 ScriptInputUserData ctx = new ScriptInputUserData;
10538 ctx.
Write(destination_entity);
10540 ctx.
Write(slot_id);
10542 }
10543 }
10544 else if (!
GetGame().IsMultiplayer())
10545 {
10547 }
10548 }
10549
10551 {
10553 return;
10554
10555 float split_quantity_new;
10559 InventoryLocation loc = new InventoryLocation;
10560
10561 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10562 {
10564 split_quantity_new = stack_max;
10565 else
10567
10568 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10569 if (new_item)
10570 {
10571 new_item.SetResultOfSplit(true);
10572 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10574 new_item.SetQuantity(split_quantity_new);
10575 }
10576 }
10577 else if (destination_entity && slot_id == -1)
10578 {
10579 if (quantity > stack_max)
10580 split_quantity_new = stack_max;
10581 else
10582 split_quantity_new = quantity;
10583
10585 {
10588 }
10589
10590 if (new_item)
10591 {
10592 new_item.SetResultOfSplit(true);
10593 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10595 new_item.SetQuantity(split_quantity_new);
10596 }
10597 }
10598 else
10599 {
10600 if (stack_max != 0)
10601 {
10603 {
10605 }
10606
10607 if (split_quantity_new == 0)
10608 {
10609 if (!
GetGame().IsMultiplayer())
10610 player.PhysicalPredictiveDropItem(this);
10611 else
10612 player.ServerDropEntity(this);
10613 return;
10614 }
10615
10617
10618 if (new_item)
10619 {
10620 new_item.SetResultOfSplit(true);
10621 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10623 new_item.SetQuantity(stack_max);
10624 new_item.PlaceOnSurface();
10625 }
10626 }
10627 }
10628 }
10629
10631 {
10633 return;
10634
10635 float split_quantity_new;
10639 InventoryLocation loc = new InventoryLocation;
10640
10641 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10642 {
10644 split_quantity_new = stack_max;
10645 else
10647
10648 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10649 if (new_item)
10650 {
10651 new_item.SetResultOfSplit(true);
10652 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10654 new_item.SetQuantity(split_quantity_new);
10655 }
10656 }
10657 else if (destination_entity && slot_id == -1)
10658 {
10659 if (quantity > stack_max)
10660 split_quantity_new = stack_max;
10661 else
10662 split_quantity_new = quantity;
10663
10665 {
10668 }
10669
10670 if (new_item)
10671 {
10672 new_item.SetResultOfSplit(true);
10673 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10675 new_item.SetQuantity(split_quantity_new);
10676 }
10677 }
10678 else
10679 {
10680 if (stack_max != 0)
10681 {
10683 {
10685 }
10686
10688
10689 if (new_item)
10690 {
10691 new_item.SetResultOfSplit(true);
10692 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10694 new_item.SetQuantity(stack_max);
10695 new_item.PlaceOnSurface();
10696 }
10697 }
10698 }
10699 }
10700
10702 {
10704 return;
10705
10707 {
10708 if (ScriptInputUserData.CanStoreInputUserData())
10709 {
10710 ScriptInputUserData ctx = new ScriptInputUserData;
10715 dst.WriteToContext(ctx);
10717 }
10718 }
10719 else if (!
GetGame().IsMultiplayer())
10720 {
10722 }
10723 }
10724
10726 {
10728 return;
10729
10731 {
10732 if (ScriptInputUserData.CanStoreInputUserData())
10733 {
10734 ScriptInputUserData ctx = new ScriptInputUserData;
10739 ctx.
Write(destination_entity);
10745 }
10746 }
10747 else if (!
GetGame().IsMultiplayer())
10748 {
10750 }
10751 }
10752
10754 {
10756 }
10757
10759 {
10761 return this;
10762
10764 float split_quantity_new;
10766 if (dst.IsValid())
10767 {
10768 int slot_id = dst.GetSlot();
10770
10771 if (quantity > stack_max)
10772 split_quantity_new = stack_max;
10773 else
10774 split_quantity_new = quantity;
10775
10777
10778 if (new_item)
10779 {
10780 new_item.SetResultOfSplit(true);
10781 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10784 }
10785
10786 return new_item;
10787 }
10788
10789 return null;
10790 }
10791
10793 {
10795 return;
10796
10798 float split_quantity_new;
10800 if (destination_entity)
10801 {
10803 if (quantity > stackable)
10804 split_quantity_new = stackable;
10805 else
10806 split_quantity_new = quantity;
10807
10808 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10809 if (new_item)
10810 {
10811 new_item.SetResultOfSplit(true);
10812 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10814 new_item.SetQuantity(split_quantity_new);
10815 }
10816 }
10817 }
10818
10820 {
10822 return;
10823
10825 {
10826 if (ScriptInputUserData.CanStoreInputUserData())
10827 {
10828 ScriptInputUserData ctx = new ScriptInputUserData;
10833 ItemBase destination_entity =
this;
10834 ctx.
Write(destination_entity);
10838 }
10839 }
10840 else if (!
GetGame().IsMultiplayer())
10841 {
10843 }
10844 }
10845
10847 {
10849 return;
10850
10852 float split_quantity_new;
10854 if (player)
10855 {
10857 if (quantity > stackable)
10858 split_quantity_new = stackable;
10859 else
10860 split_quantity_new = quantity;
10861
10862 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10863 new_item =
ItemBase.Cast(in_hands);
10864 if (new_item)
10865 {
10866 new_item.SetResultOfSplit(true);
10867 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10869 new_item.SetQuantity(split_quantity_new);
10870 }
10871 }
10872 }
10873
10875 {
10877 return;
10878
10880 float split_quantity_new = Math.Floor(quantity * 0.5);
10881
10883
10884 if (new_item)
10885 {
10886 if (new_item.GetQuantityMax() < split_quantity_new)
10887 {
10888 split_quantity_new = new_item.GetQuantityMax();
10889 }
10890
10891 new_item.SetResultOfSplit(true);
10892 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10893
10895 {
10898 }
10899 else
10900 {
10903 }
10904 }
10905 }
10906
10908 {
10910 return;
10911
10913 float split_quantity_new = Math.Floor(quantity / 2);
10914
10915 InventoryLocation invloc = new InventoryLocation;
10917
10919 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10920
10921 if (new_item)
10922 {
10923 if (new_item.GetQuantityMax() < split_quantity_new)
10924 {
10925 split_quantity_new = new_item.GetQuantityMax();
10926 }
10928 {
10931 }
10932 else
10933 {
10936 }
10937 }
10938 }
10939
10942 {
10943 SetWeightDirty();
10945
10946 if (parent)
10947 parent.OnAttachmentQuantityChangedEx(this, delta);
10948
10950 {
10952 {
10954 }
10956 {
10957 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10959 }
10960 }
10961
10962 }
10963
10966 {
10967
10968 }
10969
10972 {
10974 }
10975
10977 {
10978 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10979
10981 {
10982 if (newLevel == GameConstants.STATE_RUINED)
10983 {
10985 EntityAI parent = GetHierarchyParent();
10986 if (parent && parent.IsFireplace())
10987 {
10988 CargoBase cargo = GetInventory().GetCargo();
10989 if (cargo)
10990 {
10992 {
10994 }
10995 }
10996 }
10997 }
10998
11000 {
11001
11003 return;
11004 }
11005
11006 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11007 {
11009 }
11010 }
11011 }
11012
11013
11015 {
11016 super.OnRightClick();
11017
11019 {
11021 {
11022 if (ScriptInputUserData.CanStoreInputUserData())
11023 {
11024 vector m4[4];
11026
11027 EntityAI root = GetHierarchyRoot();
11028
11029 InventoryLocation dst = new InventoryLocation;
11031 {
11032 if (root)
11033 {
11034 root.GetTransform(m4);
11036 }
11037 else
11038 GetInventory().GetCurrentInventoryLocation(dst);
11039 }
11040 else
11041 {
11043
11044
11045 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11046 {
11047 if (root)
11048 {
11049 root.GetTransform(m4);
11051 }
11052 else
11053 GetInventory().GetCurrentInventoryLocation(dst);
11054 }
11055 else
11056 {
11057 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11058 }
11059 }
11060
11061 ScriptInputUserData ctx = new ScriptInputUserData;
11069 }
11070 }
11071 else if (!
GetGame().IsMultiplayer())
11072 {
11074 }
11075 }
11076 }
11077
11078 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11079 {
11080
11081 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11082 return false;
11083
11084 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11085 return false;
11086
11087
11089 return false;
11090
11091
11092 Magazine mag = Magazine.Cast(this);
11093 if (mag)
11094 {
11095 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11096 return false;
11097
11098 if (stack_max_limit)
11099 {
11100 Magazine other_mag = Magazine.Cast(other_item);
11101 if (other_item)
11102 {
11103 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11104 return false;
11105 }
11106
11107 }
11108 }
11109 else
11110 {
11111
11113 return false;
11114
11116 return false;
11117 }
11118
11119 PlayerBase player = null;
11120 if (CastTo(player, GetHierarchyRootPlayer()))
11121 {
11122 if (player.GetInventory().HasAttachment(this))
11123 return false;
11124
11125 if (player.IsItemsToDelete())
11126 return false;
11127 }
11128
11129 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11130 return false;
11131
11132 int slotID;
11134 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11135 return false;
11136
11137 return true;
11138 }
11139
11141 {
11143 }
11144
11146 {
11147 return m_IsResultOfSplit;
11148 }
11149
11151 {
11152 m_IsResultOfSplit = value;
11153 }
11154
11156 {
11158 }
11159
11161 {
11162 float other_item_quantity = other_item.GetQuantity();
11163 float this_free_space;
11164
11166
11168
11169 if (other_item_quantity > this_free_space)
11170 {
11171 return this_free_space;
11172 }
11173 else
11174 {
11175 return other_item_quantity;
11176 }
11177 }
11178
11180 {
11182 }
11183
11185 {
11187 return;
11188
11189 if (!IsMagazine() && other_item)
11190 {
11192 if (quantity_used != 0)
11193 {
11194 float hp1 = GetHealth01("","");
11195 float hp2 = other_item.GetHealth01("","");
11196 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11197 hpResult = hpResult / (
GetQuantity() + quantity_used);
11198
11199 hpResult *= GetMaxHealth();
11200 Math.Round(hpResult);
11201 SetHealth("", "Health", hpResult);
11202
11204 other_item.AddQuantity(-quantity_used);
11205 }
11206 }
11208 }
11209
11211 {
11212 #ifdef SERVER
11213 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11214 GetHierarchyParent().IncreaseLifetimeUp();
11215 #endif
11216 };
11217
11219 {
11220 PlayerBase p = PlayerBase.Cast(player);
11221
11222 array<int> recipesIds = p.m_Recipes;
11223 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11224 if (moduleRecipesManager)
11225 {
11226 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11227 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11228 }
11229
11230 for (int i = 0;i < recipesIds.Count(); i++)
11231 {
11232 int key = recipesIds.Get(i);
11233 string recipeName = moduleRecipesManager.GetRecipeName(key);
11235 }
11236 }
11237
11238
11239 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11240 {
11241 super.GetDebugActions(outputList);
11242
11243
11248
11249
11253
11257
11258
11261
11262
11264 {
11267 }
11268
11270
11273
11277 }
11278
11279
11280
11281
11283 {
11284 super.OnAction(action_id, player, ctx);
11285 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11286 {
11287 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11288 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11289 PlayerBase p = PlayerBase.Cast(player);
11290 if (
EActions.RECIPES_RANGE_START < 1000)
11291 {
11292 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11293 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11294 }
11295 }
11296 #ifndef SERVER
11297 else if (action_id ==
EActions.WATCH_PLAYER)
11298 {
11299 PluginDeveloper.SetDeveloperItemClientEx(player);
11300 }
11301 #endif
11303 {
11304 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11305 {
11306 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11307 OnDebugButtonPressServer(id + 1);
11308 }
11309
11310 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11311 {
11312 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11314 }
11315
11316 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11317 {
11318 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11320 }
11321
11322 else if (action_id ==
EActions.ADD_QUANTITY)
11323 {
11324 if (IsMagazine())
11325 {
11326 Magazine mag = Magazine.Cast(this);
11327 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11328 }
11329 else
11330 {
11332 }
11333
11334 if (m_EM)
11335 {
11336 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11337 }
11338
11339 }
11340
11341 else if (action_id ==
EActions.REMOVE_QUANTITY)
11342 {
11343 if (IsMagazine())
11344 {
11345 Magazine mag2 = Magazine.Cast(this);
11346 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11347 }
11348 else
11349 {
11351 }
11352 if (m_EM)
11353 {
11354 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11355 }
11356
11357 }
11358
11359 else if (action_id ==
EActions.SET_QUANTITY_0)
11360 {
11362
11363 if (m_EM)
11364 {
11365 m_EM.SetEnergy(0);
11366 }
11367 }
11368
11369 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11370 {
11372
11373 if (m_EM)
11374 {
11375 m_EM.SetEnergy(m_EM.GetEnergyMax());
11376 }
11377 }
11378
11379 else if (action_id ==
EActions.ADD_HEALTH)
11380 {
11381 AddHealth("","",GetMaxHealth("","Health")/5);
11382 }
11383 else if (action_id ==
EActions.REMOVE_HEALTH)
11384 {
11385 AddHealth("","",-GetMaxHealth("","Health")/5);
11386 }
11387 else if (action_id ==
EActions.DESTROY_HEALTH)
11388 {
11389 SetHealth01("","",0);
11390 }
11391 else if (action_id ==
EActions.WATCH_ITEM)
11392 {
11394 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11395 #ifdef DEVELOPER
11396 SetDebugDeveloper_item(this);
11397 #endif
11398 }
11399
11400 else if (action_id ==
EActions.ADD_TEMPERATURE)
11401 {
11402 AddTemperature(20);
11403
11404 }
11405
11406 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11407 {
11408 AddTemperature(-20);
11409
11410 }
11411
11412 else if (action_id ==
EActions.FLIP_FROZEN)
11413 {
11414 SetFrozen(!GetIsFrozen());
11415
11416 }
11417
11418 else if (action_id ==
EActions.ADD_WETNESS)
11419 {
11421
11422 }
11423
11424 else if (action_id ==
EActions.REMOVE_WETNESS)
11425 {
11427
11428 }
11429
11430 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11431 {
11434
11435
11436 }
11437
11438 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11439 {
11442 }
11443
11444 else if (action_id ==
EActions.MAKE_SPECIAL)
11445 {
11446 auto debugParams = DebugSpawnParams.WithPlayer(player);
11447 OnDebugSpawnEx(debugParams);
11448 }
11449
11450 else if (action_id ==
EActions.DELETE)
11451 {
11452 Delete();
11453 }
11454
11455 }
11456
11457
11458 return false;
11459 }
11460
11461
11462
11463
11467
11470
11471
11472
11474 {
11475 return false;
11476 }
11477
11478
11480 {
11481 return true;
11482 }
11483
11484
11486 {
11487 return true;
11488 }
11489
11490
11491
11493 {
11494 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11496 }
11497
11500 {
11501 return null;
11502 }
11503
11505 {
11506 return false;
11507 }
11508
11510 {
11511 return false;
11512 }
11513
11517
11518
11520 {
11521 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11522 return module_repairing.CanRepair(this, item_repair_kit);
11523 }
11524
11525
11526 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11527 {
11528 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11529 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11530 }
11531
11532
11534 {
11535
11536
11537
11538
11539
11540
11541
11542
11543 return 1;
11544 }
11545
11546
11547
11549 {
11551 }
11552
11553
11554
11556 {
11558 }
11559
11560
11569 {
11570 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11571
11572 if (player)
11573 {
11574 player.MessageStatus(text);
11575 }
11576 }
11577
11578
11587 {
11588 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11589
11590 if (player)
11591 {
11592 player.MessageAction(text);
11593 }
11594 }
11595
11596
11605 {
11606 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11607
11608 if (player)
11609 {
11610 player.MessageFriendly(text);
11611 }
11612 }
11613
11614
11623 {
11624 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11625
11626 if (player)
11627 {
11628 player.MessageImportant(text);
11629 }
11630 }
11631
11633 {
11634 return true;
11635 }
11636
11637
11638 override bool KindOf(
string tag)
11639 {
11640 bool found = false;
11641 string item_name = this.
GetType();
11644
11645 int array_size = item_tag_array.Count();
11646 for (int i = 0; i < array_size; i++)
11647 {
11648 if (item_tag_array.Get(i) == tag)
11649 {
11650 found = true;
11651 break;
11652 }
11653 }
11654 return found;
11655 }
11656
11657
11659 {
11660
11661 super.OnRPC(sender, rpc_type,ctx);
11662
11663
11664 switch (rpc_type)
11665 {
11666 #ifndef SERVER
11667 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11668 Param2<bool, string> p = new Param2<bool, string>(false, "");
11669
11671 return;
11672
11673 bool play = p.param1;
11674 string soundSet = p.param2;
11675
11676 if (play)
11677 {
11679 {
11681 {
11683 }
11684 }
11685 else
11686 {
11688 }
11689 }
11690 else
11691 {
11693 }
11694
11695 break;
11696 #endif
11697
11698 }
11699
11701 {
11703 }
11704 }
11705
11706
11707
11708
11710 {
11711 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11712 return plugin.GetID(
name);
11713 }
11714
11716 {
11717 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11718 return plugin.GetName(id);
11719 }
11720
11723 {
11724
11725
11726 int varFlags;
11727 if (!ctx.
Read(varFlags))
11728 return;
11729
11730 if (varFlags & ItemVariableFlags.FLOAT)
11731 {
11733 }
11734 }
11735
11737 {
11738
11739 super.SerializeNumericalVars(floats_out);
11740
11741
11742
11744 {
11746 }
11747
11749 {
11751 }
11752
11754 {
11756 }
11757
11759 {
11764 }
11765
11767 {
11769 }
11770 }
11771
11773 {
11774
11775 super.DeSerializeNumericalVars(floats);
11776
11777
11778 int index = 0;
11779 int mask = Math.Round(floats.Get(index));
11780
11781 index++;
11782
11784 {
11786 {
11788 }
11789 else
11790 {
11791 float quantity = floats.Get(index);
11792 SetQuantity(quantity,
true,
false,
false,
false);
11793 }
11794 index++;
11795 }
11796
11798 {
11799 float wet = floats.Get(index);
11801 index++;
11802 }
11803
11805 {
11806 int liquidtype = Math.Round(floats.Get(index));
11808 index++;
11809 }
11810
11812 {
11814 index++;
11816 index++;
11818 index++;
11820 index++;
11821 }
11822
11824 {
11825 int cleanness = Math.Round(floats.Get(index));
11827 index++;
11828 }
11829 }
11830
11832 {
11833 super.WriteVarsToCTX(ctx);
11834
11835
11837 {
11839 }
11840
11842 {
11844 }
11845
11847 {
11849 }
11850
11852 {
11853 int r,g,b,a;
11859 }
11860
11862 {
11864 }
11865 }
11866
11868 {
11869 if (!super.ReadVarsFromCTX(ctx,version))
11870 return false;
11871
11872 int intValue;
11873 float value;
11874
11875 if (version < 140)
11876 {
11877 if (!ctx.
Read(intValue))
11878 return false;
11879
11880 m_VariablesMask = intValue;
11881 }
11882
11884 {
11885 if (!ctx.
Read(value))
11886 return false;
11887
11889 {
11891 }
11892 else
11893 {
11895 }
11896 }
11897
11898 if (version < 140)
11899 {
11901 {
11902 if (!ctx.
Read(value))
11903 return false;
11904 SetTemperatureDirect(value);
11905 }
11906 }
11907
11909 {
11910 if (!ctx.
Read(value))
11911 return false;
11913 }
11914
11916 {
11917 if (!ctx.
Read(intValue))
11918 return false;
11920 }
11921
11923 {
11924 int r,g,b,a;
11926 return false;
11928 return false;
11930 return false;
11932 return false;
11933
11935 }
11936
11938 {
11939 if (!ctx.
Read(intValue))
11940 return false;
11942 }
11943
11944 if (version >= 138 && version < 140)
11945 {
11947 {
11948 if (!ctx.
Read(intValue))
11949 return false;
11950 SetFrozen(intValue);
11951 }
11952 }
11953
11954 return true;
11955 }
11956
11957
11959 {
11962 {
11964 }
11965
11966 if (!super.OnStoreLoad(ctx, version))
11967 {
11969 return false;
11970 }
11971
11972 if (version >= 114)
11973 {
11974 bool hasQuickBarIndexSaved;
11975
11976 if (!ctx.
Read(hasQuickBarIndexSaved))
11977 {
11979 return false;
11980 }
11981
11982 if (hasQuickBarIndexSaved)
11983 {
11984 int itmQBIndex;
11985
11986
11987 if (!ctx.
Read(itmQBIndex))
11988 {
11990 return false;
11991 }
11992
11993 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11994 if (itmQBIndex != -1 && parentPlayer)
11995 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11996 }
11997 }
11998 else
11999 {
12000
12001 PlayerBase player;
12002 int itemQBIndex;
12003 if (version ==
int.
MAX)
12004 {
12005 if (!ctx.
Read(itemQBIndex))
12006 {
12008 return false;
12009 }
12010 }
12011 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12012 {
12013
12014 if (!ctx.
Read(itemQBIndex))
12015 {
12017 return false;
12018 }
12019 if (itemQBIndex != -1 && player)
12020 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12021 }
12022 }
12023
12024 if (version < 140)
12025 {
12026
12027 if (!LoadVariables(ctx, version))
12028 {
12030 return false;
12031 }
12032 }
12033
12034
12036 {
12038 return false;
12039 }
12040 if (version >= 132)
12041 {
12043 if (raib)
12044 {
12046 {
12048 return false;
12049 }
12050 }
12051 }
12052
12054 return true;
12055 }
12056
12057
12058
12060 {
12061 super.OnStoreSave(ctx);
12062
12063 PlayerBase player;
12064 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12065 {
12067
12068 int itemQBIndex = -1;
12069 itemQBIndex = player.FindQuickBarEntityIndex(this);
12070 ctx.
Write(itemQBIndex);
12071 }
12072 else
12073 {
12075 }
12076
12078
12080 if (raib)
12081 {
12083 }
12084 }
12085
12086
12088 {
12089 super.AfterStoreLoad();
12090
12092 {
12094 }
12095
12097 {
12100 }
12101 }
12102
12104 {
12105 super.EEOnAfterLoad();
12106
12108 {
12110 }
12111
12114 }
12115
12117 {
12118 return false;
12119 }
12120
12121
12122
12124 {
12126 {
12127 #ifdef PLATFORM_CONSOLE
12128
12130 {
12132 if (menu)
12133 {
12135 }
12136 }
12137 #endif
12138 }
12139
12141 {
12144 }
12145
12147 {
12148 SetWeightDirty();
12150 }
12152 {
12155 }
12156
12158 {
12161 }
12163 {
12166 }
12167
12168 super.OnVariablesSynchronized();
12169 }
12170
12171
12172
12174 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12175 {
12176 if (!IsServerCheck(allow_client))
12177 return false;
12178
12180 return false;
12181
12184
12185 if (value <= (min + 0.001))
12186 value = min;
12187
12188 if (value == min)
12189 {
12190 if (destroy_config)
12191 {
12192 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12193 if (dstr)
12194 {
12196 this.Delete();
12197 return true;
12198 }
12199 }
12200 else if (destroy_forced)
12201 {
12203 this.Delete();
12204 return true;
12205 }
12206
12208 }
12209
12212
12214 {
12216
12217 if (delta)
12219 }
12220
12222
12223 return false;
12224 }
12225
12226
12228 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12229 {
12231 }
12232
12234 {
12237 }
12238
12240 {
12243 }
12244
12247 {
12248 float value_clamped = Math.Clamp(value, 0, 1);
12250 SetQuantity(result, destroy_config, destroy_forced);
12251 }
12252
12253
12256 {
12258 }
12259
12261 {
12263 }
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12275 {
12276 int slot = -1;
12277 if (GetInventory())
12278 {
12279 InventoryLocation il = new InventoryLocation;
12280 GetInventory().GetCurrentInventoryLocation(il);
12282 }
12283
12285 }
12286
12288 {
12289 float quantity_max = 0;
12290
12292 {
12293 if (attSlotID != -1)
12294 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12295
12296 if (quantity_max <= 0)
12298 }
12299
12300 if (quantity_max <= 0)
12302
12303 return quantity_max;
12304 }
12305
12307 {
12309 }
12310
12312 {
12314 }
12315
12316
12318 {
12320 }
12321
12323 {
12325 }
12326
12328 {
12330 }
12331
12332
12334 {
12335
12336 float weightEx = GetWeightEx();
12337 float special = GetInventoryAndCargoWeight();
12338 return weightEx - special;
12339 }
12340
12341
12343 {
12345 }
12346
12348 {
12350 {
12351 #ifdef DEVELOPER
12352 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12353 {
12354 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12356 }
12357 #endif
12358
12359 return GetQuantity() * GetConfigWeightModified();
12360 }
12361 else if (HasEnergyManager())
12362 {
12363 #ifdef DEVELOPER
12364 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12365 {
12366 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12367 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12368 }
12369 #endif
12370 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12371 }
12372 else
12373 {
12374 #ifdef DEVELOPER
12375 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12376 {
12377 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12378 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12379 }
12380 #endif
12381 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12382 }
12383 }
12384
12387 {
12388 int item_count = 0;
12390
12391 if (GetInventory().GetCargo() != NULL)
12392 {
12393 item_count = GetInventory().GetCargo().GetItemCount();
12394 }
12395
12396 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12397 {
12398 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12399 if (item)
12400 item_count += item.GetNumberOfItems();
12401 }
12402 return item_count;
12403 }
12404
12407 {
12408 float weight = 0;
12409 float wetness = 1;
12410 if (include_wetness)
12413 {
12414 weight = wetness * m_ConfigWeight;
12415 }
12417 {
12418 weight = 1;
12419 }
12420 return weight;
12421 }
12422
12423
12424
12426 {
12427 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12428 {
12429 GameInventory inv = GetInventory();
12430 array<EntityAI> items = new array<EntityAI>;
12432 for (int i = 0; i < items.Count(); i++)
12433 {
12435 if (item)
12436 {
12438 }
12439 }
12440 }
12441 }
12442
12443
12444
12445
12447 {
12448 float energy = 0;
12449 if (HasEnergyManager())
12450 {
12451 energy = GetCompEM().GetEnergy();
12452 }
12453 return energy;
12454 }
12455
12456
12458 {
12459 super.OnEnergyConsumed();
12460
12462 }
12463
12465 {
12466 super.OnEnergyAdded();
12467
12469 }
12470
12471
12473 {
12474 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12475 {
12477 {
12478 float energy_0to1 = GetCompEM().GetEnergy0To1();
12480 }
12481 }
12482 }
12483
12484
12486 {
12487 return ConfigGetFloat("heatIsolation");
12488 }
12489
12491 {
12493 }
12494
12496 {
12497 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12498 if (
GetGame().ConfigIsExisting(paramPath))
12500
12501 return 0.0;
12502 }
12503
12505 {
12506 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12507 if (
GetGame().ConfigIsExisting(paramPath))
12509
12510 return 0.0;
12511 }
12512
12513 override void SetWet(
float value,
bool allow_client =
false)
12514 {
12515 if (!IsServerCheck(allow_client))
12516 return;
12517
12520
12522
12523 m_VarWet = Math.Clamp(value, min, max);
12524
12526 {
12529 }
12530 }
12531
12532 override void AddWet(
float value)
12533 {
12535 }
12536
12538 {
12540 }
12541
12543 {
12545 }
12546
12548 {
12550 }
12551
12553 {
12555 }
12556
12558 {
12560 }
12561
12562 override void OnWetChanged(
float newVal,
float oldVal)
12563 {
12566 if (newLevel != oldLevel)
12567 {
12569 }
12570 }
12571
12573 {
12574 SetWeightDirty();
12575 }
12576
12578 {
12579 return GetWetLevelInternal(
m_VarWet);
12580 }
12581
12582
12583
12585 {
12587 }
12588
12590 {
12592 }
12593
12595 {
12597 }
12598
12600 {
12602 }
12603
12604
12605
12607 {
12608 if (ConfigIsExisting("itemModelLength"))
12609 {
12610 return ConfigGetFloat("itemModelLength");
12611 }
12612 return 0;
12613 }
12614
12616 {
12617 if (ConfigIsExisting("itemAttachOffset"))
12618 {
12619 return ConfigGetFloat("itemAttachOffset");
12620 }
12621 return 0;
12622 }
12623
12624 override void SetCleanness(
int value,
bool allow_client =
false)
12625 {
12626 if (!IsServerCheck(allow_client))
12627 return;
12628
12630
12632
12635 }
12636
12638 {
12640 }
12641
12643 {
12644 return true;
12645 }
12646
12647
12648
12649
12651 {
12653 }
12654
12656 {
12658 }
12659
12660
12661
12662
12663 override void SetColor(
int r,
int g,
int b,
int a)
12664 {
12670 }
12672 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12673 {
12678 }
12679
12681 {
12683 }
12684
12687 {
12688 int r,g,b,a;
12690 r = r/255;
12691 g = g/255;
12692 b = b/255;
12693 a = a/255;
12694 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12695 }
12696
12697
12698
12699 override void SetLiquidType(
int value,
bool allow_client =
false)
12700 {
12701 if (!IsServerCheck(allow_client))
12702 return;
12703
12708 }
12709
12711 {
12712 return ConfigGetInt("varLiquidTypeInit");
12713 }
12714
12716 {
12718 }
12719
12721 {
12723 SetFrozen(false);
12724 }
12725
12728 {
12729 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12730 }
12731
12732
12735 {
12736 PlayerBase nplayer;
12737 if (PlayerBase.CastTo(nplayer, player))
12738 {
12740
12741 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12742 }
12743 }
12744
12745
12748 {
12749 PlayerBase nplayer;
12750 if (PlayerBase.CastTo(nplayer,player))
12751 {
12752
12753 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12754
12755 }
12756
12757
12758 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12759
12760
12761 if (HasEnergyManager())
12762 {
12763 GetCompEM().UpdatePlugState();
12764 }
12765 }
12766
12767
12769 {
12770 super.OnPlacementStarted(player);
12771
12773 }
12774
12775 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12776 {
12778 {
12779 m_AdminLog.OnPlacementComplete(player,
this);
12780 }
12781
12782 super.OnPlacementComplete(player, position, orientation);
12783 }
12784
12785
12786
12787
12788
12790 {
12792 {
12793 return true;
12794 }
12795 else
12796 {
12797 return false;
12798 }
12799 }
12800
12801
12803 {
12805 {
12807 }
12808 }
12809
12810
12812 {
12814 }
12815
12817 {
12819 }
12820
12821 override void InsertAgent(
int agent,
float count = 1)
12822 {
12823 if (count < 1)
12824 return;
12825
12827 }
12828
12831 {
12833 }
12834
12835
12837 {
12839 }
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
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
12883 {
12885 return false;
12886 return true;
12887 }
12888
12890 {
12891
12893 }
12894
12895
12898 {
12899 super.CheckForRoofLimited(timeTresholdMS);
12900
12902 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12903 {
12904 m_PreviousRoofTestTime = time;
12905 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12906 }
12907 }
12908
12909
12911 {
12913 {
12914 return 0;
12915 }
12916
12917 if (GetInventory().GetAttachmentSlotsCount() != 0)
12918 {
12919 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12920 if (filter)
12921 return filter.GetProtectionLevel(type, false, system);
12922 else
12923 return 0;
12924 }
12925
12926 string subclassPath, entryName;
12927
12928 switch (type)
12929 {
12931 entryName = "biological";
12932 break;
12934 entryName = "chemical";
12935 break;
12936 default:
12937 entryName = "biological";
12938 break;
12939 }
12940
12941 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12942
12944 }
12945
12946
12947
12950 {
12951 if (!IsMagazine())
12953
12955 }
12956
12957
12958
12959
12960
12965 {
12966 return true;
12967 }
12968
12970 {
12972 }
12973
12974
12975
12976
12977
12979 {
12980 if (parent)
12981 {
12982 if (parent.IsInherited(DayZInfected))
12983 return true;
12984
12985 if (!parent.IsRuined())
12986 return true;
12987 }
12988
12989 return true;
12990 }
12991
12993 {
12994 if (!super.CanPutAsAttachment(parent))
12995 {
12996 return false;
12997 }
12998
12999 if (!IsRuined() && !parent.IsRuined())
13000 {
13001 return true;
13002 }
13003
13004 return false;
13005 }
13006
13008 {
13009
13010
13011
13012
13013 return super.CanReceiveItemIntoCargo(item);
13014 }
13015
13017 {
13018
13019
13020
13021
13022 GameInventory attachmentInv = attachment.GetInventory();
13024 {
13025 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13026 return false;
13027 }
13028
13029 InventoryLocation loc = new InventoryLocation();
13030 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13031 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13032 return false;
13033
13034 return super.CanReceiveAttachment(attachment, slotId);
13035 }
13036
13038 {
13039 if (!super.CanReleaseAttachment(attachment))
13040 return false;
13041
13042 return GetInventory().AreChildrenAccessible();
13043 }
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13066 {
13067 int id = muzzle_owner.GetMuzzleID();
13068 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13069
13070 if (WPOF_array)
13071 {
13072 for (int i = 0; i < WPOF_array.Count(); i++)
13073 {
13074 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13075
13076 if (WPOF)
13077 {
13078 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13079 }
13080 }
13081 }
13082 }
13083
13084
13086 {
13087 int id = muzzle_owner.GetMuzzleID();
13089
13090 if (WPOBE_array)
13091 {
13092 for (int i = 0; i < WPOBE_array.Count(); i++)
13093 {
13094 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13095
13096 if (WPOBE)
13097 {
13098 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13099 }
13100 }
13101 }
13102 }
13103
13104
13106 {
13107 int id = muzzle_owner.GetMuzzleID();
13108 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13109
13110 if (WPOOH_array)
13111 {
13112 for (int i = 0; i < WPOOH_array.Count(); i++)
13113 {
13114 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13115
13116 if (WPOOH)
13117 {
13118 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13119 }
13120 }
13121 }
13122 }
13123
13124
13126 {
13127 int id = muzzle_owner.GetMuzzleID();
13128 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13129
13130 if (WPOOH_array)
13131 {
13132 for (int i = 0; i < WPOOH_array.Count(); i++)
13133 {
13134 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13135
13136 if (WPOOH)
13137 {
13138 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13139 }
13140 }
13141 }
13142 }
13143
13144
13146 {
13147 int id = muzzle_owner.GetMuzzleID();
13148 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13149
13150 if (WPOOH_array)
13151 {
13152 for (int i = 0; i < WPOOH_array.Count(); i++)
13153 {
13154 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13155
13156 if (WPOOH)
13157 {
13158 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13159 }
13160 }
13161 }
13162 }
13163
13164
13165
13167 {
13169 {
13170 return true;
13171 }
13172
13173 return false;
13174 }
13175
13177 {
13179 {
13180 return true;
13181 }
13182
13183 return false;
13184 }
13185
13187 {
13189 {
13190 return true;
13191 }
13192
13193 return false;
13194 }
13195
13197 {
13198 return false;
13199 }
13200
13203 {
13204 return UATimeSpent.DEFAULT_DEPLOY;
13205 }
13206
13207
13208
13209
13211 {
13213 SetSynchDirty();
13214 }
13215
13217 {
13219 }
13220
13221
13223 {
13224 return false;
13225 }
13226
13229 {
13230 string att_type = "None";
13231
13232 if (ConfigIsExisting("soundAttType"))
13233 {
13234 att_type = ConfigGetString("soundAttType");
13235 }
13236
13238 }
13239
13241 {
13243 }
13244
13245
13246
13247
13248
13252
13254 {
13257
13259 }
13260
13261
13263 {
13265 return;
13266
13268
13271
13274
13275 SoundParameters params = new SoundParameters();
13279 }
13280
13281
13283 {
13285 return;
13286
13288 SetSynchDirty();
13289
13292 }
13293
13294
13296 {
13298 return;
13299
13301 SetSynchDirty();
13302
13305 }
13306
13308 {
13310 }
13311
13313 {
13315 }
13316
13319 {
13320 if (!
GetGame().IsDedicatedServer())
13321 {
13322 if (ConfigIsExisting("attachSoundSet"))
13323 {
13324 string cfg_path = "";
13325 string soundset = "";
13326 string type_name =
GetType();
13327
13330 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13331 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13332
13333 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13334 {
13335 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13336 {
13337 if (cfg_slot_array[i] == slot_type)
13338 {
13339 soundset = cfg_soundset_array[i];
13340 break;
13341 }
13342 }
13343 }
13344
13345 if (soundset != "")
13346 {
13347 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13349 }
13350 }
13351 }
13352 }
13353
13355 {
13356
13357 }
13358
13359 void OnApply(PlayerBase player);
13360
13362 {
13363 return 1.0;
13364 };
13365
13367 {
13369 }
13370
13372 {
13374 }
13375
13377
13379 {
13380 SetDynamicPhysicsLifeTime(0.01);
13382 }
13383
13385 {
13386 array<string> zone_names = new array<string>;
13387 GetDamageZones(zone_names);
13388 for (int i = 0; i < zone_names.Count(); i++)
13389 {
13390 SetHealthMax(zone_names.Get(i),"Health");
13391 }
13392 SetHealthMax("","Health");
13393 }
13394
13397 {
13398 float global_health = GetHealth01("","Health");
13399 array<string> zones = new array<string>;
13400 GetDamageZones(zones);
13401
13402 for (int i = 0; i < zones.Count(); i++)
13403 {
13404 SetHealth01(zones.Get(i),"Health",global_health);
13405 }
13406 }
13407
13410 {
13411 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13412 }
13413
13415 {
13416 if (!hasRootAsPlayer)
13417 {
13418 if (refParentIB)
13419 {
13420
13421 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13422 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13423
13424 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13425 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13426
13429 }
13430 else
13431 {
13432
13435 }
13436 }
13437 }
13438
13440 {
13442 {
13443 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13444 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13445 {
13446 float heatPermCoef = 1.0;
13448 while (ent)
13449 {
13450 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13451 ent = ent.GetHierarchyParent();
13452 }
13453
13454 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13455 }
13456 }
13457 }
13458
13460 {
13461
13462 EntityAI parent = GetHierarchyParent();
13463 if (!parent)
13464 {
13465 hasParent = false;
13466 hasRootAsPlayer = false;
13467 }
13468 else
13469 {
13470 hasParent = true;
13471 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13472 refParentIB =
ItemBase.Cast(parent);
13473 }
13474 }
13475
13476 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13477 {
13478
13479 }
13480
13482 {
13483
13484 return false;
13485 }
13486
13488 {
13489
13490
13491 return false;
13492 }
13493
13495 {
13496
13497 return false;
13498 }
13499
13502 {
13503 return !GetIsFrozen() &&
IsOpen();
13504 }
13505
13507 {
13508 bool hasParent = false, hasRootAsPlayer = false;
13510
13511 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13512 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13513
13514 if (wwtu || foodDecay)
13515 {
13519
13520 if (processWetness || processTemperature || processDecay)
13521 {
13523
13524 if (processWetness)
13525 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13526
13527 if (processTemperature)
13529
13530 if (processDecay)
13531 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13532 }
13533 }
13534 }
13535
13538 {
13540 }
13541
13543 {
13546
13547 return super.GetTemperatureFreezeThreshold();
13548 }
13549
13551 {
13554
13555 return super.GetTemperatureThawThreshold();
13556 }
13557
13559 {
13562
13563 return super.GetItemOverheatThreshold();
13564 }
13565
13567 {
13569 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13570
13571 return super.GetTemperatureFreezeTime();
13572 }
13573
13575 {
13577 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13578
13579 return super.GetTemperatureThawTime();
13580 }
13581
13586
13588 {
13589 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13590 }
13591
13593 {
13594 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13595 }
13596
13599 {
13601 }
13602
13604 {
13606 }
13607
13609 {
13611 }
13612
13615 {
13616 return null;
13617 }
13618
13621 {
13622 return false;
13623 }
13624
13626 {
13628 {
13631 if (!trg)
13632 {
13634 explosive = this;
13635 }
13636
13637 explosive.PairRemote(trg);
13639
13640 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13641 trg.SetPersistentPairID(persistentID);
13642 explosive.SetPersistentPairID(persistentID);
13643
13644 return true;
13645 }
13646 return false;
13647 }
13648
13651 {
13652 float ret = 1.0;
13655 ret *= GetHealth01();
13656
13657 return ret;
13658 }
13659
13660 #ifdef DEVELOPER
13661 override void SetDebugItem()
13662 {
13663 super.SetDebugItem();
13664 _itemBase = this;
13665 }
13666
13668 {
13669 string text = super.GetDebugText();
13670
13672 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13673
13674 return text;
13675 }
13676 #endif
13677
13679 {
13680 return true;
13681 }
13682
13684
13686
13688 {
13691 }
13692
13693
13701
13717}
13718
13720{
13722 if (entity)
13723 {
13724 bool is_item = entity.IsInherited(
ItemBase);
13725 if (is_item && full_quantity)
13726 {
13729 }
13730 }
13731 else
13732 {
13734 return NULL;
13735 }
13736 return entity;
13737}
13738
13740{
13741 if (item)
13742 {
13743 if (health > 0)
13744 item.SetHealth("", "", health);
13745
13746 if (item.CanHaveTemperature())
13747 {
13749 if (item.CanFreeze())
13750 item.SetFrozen(false);
13751 }
13752
13753 if (item.HasEnergyManager())
13754 {
13755 if (quantity >= 0)
13756 {
13757 item.GetCompEM().SetEnergy0To1(quantity);
13758 }
13759 else
13760 {
13762 }
13763 }
13764 else if (item.IsMagazine())
13765 {
13766 Magazine mag = Magazine.Cast(item);
13767 if (quantity >= 0)
13768 {
13769 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13770 }
13771 else
13772 {
13774 }
13775
13776 }
13777 else
13778 {
13779 if (quantity >= 0)
13780 {
13781 item.SetQuantityNormalized(quantity, false);
13782 }
13783 else
13784 {
13786 }
13787
13788 }
13789 }
13790}
13791
13792#ifdef DEVELOPER
13794#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.