8981{
8983 {
8984 return true;
8985 }
8986};
8987
8988
8989
8991{
8995
8997
9000
9001
9002
9003
9004
9013
9019
9024
9029
9050 protected bool m_IsResultOfSplit
9051
9053
9058
9059
9060
9062
9066
9067
9068
9070
9073
9074
9075
9081
9082
9090
9093
9094
9096
9097
9099
9100
9105
9106
9111
9112
9114
9115
9117 {
9122
9123 if (!
GetGame().IsDedicatedServer())
9124 {
9126 {
9128
9130 {
9132 }
9133 }
9134
9137 }
9138
9139 m_OldLocation = null;
9140
9142 {
9144 }
9145
9146 if (ConfigIsExisting("headSelectionsToHide"))
9147 {
9150 }
9151
9153 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9154 {
9156 }
9157
9159
9160 m_IsResultOfSplit = false;
9161
9163 }
9164
9166 {
9167 super.InitItemVariables();
9168
9174 m_Count = ConfigGetInt(
"count");
9175
9178
9183
9186
9191
9203
9207
9208
9211 if (ConfigIsExisting("canBeSplit"))
9212 {
9215 }
9216
9218 if (ConfigIsExisting("itemBehaviour"))
9220
9221
9224 RegisterNetSyncVariableInt("m_VarLiquidType");
9225 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9226
9227 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9228 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9229 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9230
9231 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9232 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9233 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9234 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9235
9236 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9237 RegisterNetSyncVariableBool("m_IsTakeable");
9238 RegisterNetSyncVariableBool("m_IsHologram");
9239
9242 {
9245 }
9246
9248
9250 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9252
9253 }
9254
9256 {
9258 }
9259
9261 {
9264 {
9269 }
9270 }
9271
9272 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9273 {
9275 {
9278 }
9279
9281 }
9282
9284 {
9290 }
9291
9293
9295 {
9297
9298 if (!action)
9299 {
9300 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9301 return;
9302 }
9303
9305 if (!ai)
9306 {
9308 return;
9309 }
9310
9312 if (!action_array)
9313 {
9314 action_array = new array<ActionBase_Basic>;
9316 }
9317 if (LogManager.IsActionLogEnable())
9318 {
9319 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9320 }
9321
9322 if (action_array.Find(action) != -1)
9323 {
9324 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9325 }
9326 else
9327 {
9328 action_array.Insert(action);
9329 }
9330 }
9331
9333 {
9335 ActionBase action = player.GetActionManager().GetAction(actionName);
9338
9339 if (action_array)
9340 {
9341 action_array.RemoveItem(action);
9342 }
9343 }
9344
9345
9346
9348 {
9349 ActionOverrideData overrideData = new ActionOverrideData();
9353
9355 if (!actionMap)
9356 {
9359 }
9360
9361 actionMap.Insert(this.
Type(), overrideData);
9362
9363 }
9364
9366
9368
9369
9371 {
9374
9377
9378 string config_to_search = "CfgVehicles";
9379 string muzzle_owner_config;
9380
9382 {
9383 if (IsInherited(Weapon))
9384 config_to_search = "CfgWeapons";
9385
9386 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9387
9388 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9389
9391
9392 if (config_OnFire_subclass_count > 0)
9393 {
9394 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9395
9396 for (int i = 0; i < config_OnFire_subclass_count; i++)
9397 {
9398 string particle_class = "";
9400 string config_OnFire_entry = config_OnFire_class + particle_class;
9401 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9402 WPOF_array.Insert(WPOF);
9403 }
9404
9405
9407 }
9408 }
9409
9411 {
9412 config_to_search = "CfgWeapons";
9413 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9414
9415 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9416
9418
9419 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9420 {
9421 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9422
9423 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9424 {
9425 string particle_class2 = "";
9427 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9428 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9429 WPOBE_array.Insert(WPOBE);
9430 }
9431
9432
9434 }
9435 }
9436 }
9437
9438
9440 {
9443
9445 {
9446 string config_to_search = "CfgVehicles";
9447
9448 if (IsInherited(Weapon))
9449 config_to_search = "CfgWeapons";
9450
9451 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9452 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9453
9454 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9455 {
9456
9458
9460 {
9462 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9464 return;
9465 }
9466
9469
9470
9471
9473 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9474
9475 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9476 {
9477 string particle_class = "";
9479 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9481
9482 if (entry_type == CT_CLASS)
9483 {
9484 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9485 WPOOH_array.Insert(WPOF);
9486 }
9487 }
9488
9489
9491 }
9492 }
9493 }
9494
9496 {
9498 }
9499
9501 {
9503 {
9505
9508
9511
9512 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9513 }
9514 }
9515
9517 {
9519 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9520
9522 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9523
9525 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9526
9528 {
9530 }
9531 }
9532
9534 {
9536 }
9537
9539 {
9542 else
9544
9546 {
9549 }
9550 else
9551 {
9554
9557 }
9558
9560 }
9561
9563 {
9565 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9566 }
9567
9569 {
9571 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9573 }
9574
9576 {
9578 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9579 }
9580
9582 {
9585
9586 OverheatingParticle OP = new OverheatingParticle();
9591
9593 }
9594
9596 {
9599
9600 return -1;
9601 }
9602
9604 {
9606 {
9609
9610 for (int i = count; i > 0; --i)
9611 {
9612 int id = i - 1;
9615
9618
9619 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9620 {
9621 if (p)
9622 {
9625 }
9626 }
9627 }
9628 }
9629 }
9630
9632 {
9634 {
9636 {
9637 int id = i - 1;
9639
9640 if (OP)
9641 {
9643
9644 if (p)
9645 {
9647 }
9648
9649 delete OP;
9650 }
9651 }
9652
9655 }
9656 }
9657
9660 {
9661 return 0.0;
9662 }
9663
9664
9666 {
9667 return 250;
9668 }
9669
9671 {
9672 return 0;
9673 }
9674
9677 {
9679 return true;
9680
9681 return false;
9682 }
9683
9686 {
9689
9691 {
9693 }
9694 else
9695 {
9696
9698 }
9699
9701 }
9702
9709 {
9710 return -1;
9711 }
9712
9713
9714
9715
9717 {
9719 {
9721 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9722
9723 if (r_index >= 0)
9724 {
9725 InventoryLocation r_il = new InventoryLocation;
9726 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9727
9728 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9731 {
9732 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9733 }
9735 {
9736 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9737 }
9738
9739 }
9740
9741 player.GetHumanInventory().ClearUserReservedLocation(this);
9742 }
9743
9746 }
9747
9748
9749
9750
9752 {
9753 return ItemBase.m_DebugActionsMask;
9754 }
9755
9757 {
9758 return ItemBase.m_DebugActionsMask & mask;
9759 }
9760
9762 {
9763 ItemBase.m_DebugActionsMask = mask;
9764 }
9765
9767 {
9768 ItemBase.m_DebugActionsMask |= mask;
9769 }
9770
9772 {
9773 ItemBase.m_DebugActionsMask &= ~mask;
9774 }
9775
9777 {
9779 {
9781 }
9782 else
9783 {
9785 }
9786 }
9787
9788
9790 {
9791 if (GetEconomyProfile())
9792 {
9793 float q_max = GetEconomyProfile().GetQuantityMax();
9794 if (q_max > 0)
9795 {
9796 float q_min = GetEconomyProfile().GetQuantityMin();
9797 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9798
9800 {
9801 ComponentEnergyManager comp = GetCompEM();
9803 {
9805 }
9806 }
9808 {
9810
9811 }
9812
9813 }
9814 }
9815 }
9816
9819 {
9820 EntityAI parent = GetHierarchyParent();
9821
9822 if (parent)
9823 {
9824 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9825 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9826 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9827 }
9828 }
9829
9832 {
9833 EntityAI parent = GetHierarchyParent();
9834
9835 if (parent)
9836 {
9837 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9838 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9839 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9840 }
9841 }
9842
9844 {
9845
9846
9847
9848
9850
9852 {
9853 if (ScriptInputUserData.CanStoreInputUserData())
9854 {
9855 ScriptInputUserData ctx = new ScriptInputUserData;
9861 ctx.
Write(use_stack_max);
9864
9866 {
9867 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9868 }
9869 }
9870 }
9871 else if (!
GetGame().IsMultiplayer())
9872 {
9874 }
9875 }
9876
9878 {
9880 }
9881
9883 {
9885 }
9886
9888 {
9890 }
9891
9893 {
9894
9895 return false;
9896 }
9897
9899 {
9900 return false;
9901 }
9902
9906 {
9907 return false;
9908 }
9909
9911 {
9912 return "";
9913 }
9914
9916
9918 {
9919 return false;
9920 }
9921
9923 {
9924 return true;
9925 }
9926
9927
9928
9930 {
9931 return true;
9932 }
9933
9935 {
9936 return true;
9937 }
9938
9940 {
9941 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9943 }
9944
9946 {
9948 }
9949
9951 {
9953 if (!is_being_placed)
9955 SetSynchDirty();
9956 }
9957
9958
9960
9962 {
9964 }
9965
9967 {
9969 }
9970
9972 {
9973 return 1;
9974 }
9975
9977 {
9978 return false;
9979 }
9980
9982 {
9984 SetSynchDirty();
9985 }
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10022 {
10023 super.OnMovedInsideCargo(container);
10024
10025 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10026 }
10027
10028 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10029 {
10030 super.EEItemLocationChanged(oldLoc,newLoc);
10031
10032 PlayerBase new_player = null;
10033 PlayerBase old_player = null;
10034
10035 if (newLoc.GetParent())
10036 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10037
10038 if (oldLoc.GetParent())
10039 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10040
10042 {
10043 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10044
10045 if (r_index >= 0)
10046 {
10047 InventoryLocation r_il = new InventoryLocation;
10048 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10049
10050 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10053 {
10054 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10055 }
10057 {
10058 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10059 }
10060
10061 }
10062 }
10063
10065 {
10066 if (new_player)
10067 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10068
10069 if (new_player == old_player)
10070 {
10071
10072 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10073 {
10075 {
10076 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10077 {
10078 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10079 }
10080 }
10081 else
10082 {
10083 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10084 }
10085 }
10086
10087 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10088 {
10089 int type = oldLoc.GetType();
10091 {
10092 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10093 }
10095 {
10096 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10097 }
10098 }
10099 if (!m_OldLocation)
10100 {
10101 m_OldLocation = new InventoryLocation;
10102 }
10103 m_OldLocation.Copy(oldLoc);
10104 }
10105 else
10106 {
10107 if (m_OldLocation)
10108 {
10109 m_OldLocation.Reset();
10110 }
10111 }
10112
10114 }
10115 else
10116 {
10117 if (new_player)
10118 {
10119 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10120 if (res_index >= 0)
10121 {
10122 InventoryLocation il = new InventoryLocation;
10123 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10125 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10128 {
10129 il.
GetParent().GetOnReleaseLock().Invoke(it);
10130 }
10132 {
10134 }
10135
10136 }
10137 }
10139 {
10140
10142 }
10143
10144 if (m_OldLocation)
10145 {
10146 m_OldLocation.Reset();
10147 }
10148 }
10149 }
10150
10151 override void EOnContact(IEntity other, Contact extra)
10152 {
10154 {
10155 int liquidType = -1;
10157 if (impactSpeed > 0.0)
10158 {
10160 #ifndef SERVER
10162 #else
10164 SetSynchDirty();
10165 #endif
10167 }
10168 }
10169
10170 #ifdef SERVER
10171 if (GetCompEM() && GetCompEM().IsPlugged())
10172 {
10173 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10174 GetCompEM().UnplugThis();
10175 }
10176 #endif
10177 }
10178
10180
10182 {
10184 }
10185
10187 {
10188
10189 }
10190
10192 {
10193 super.OnItemLocationChanged(old_owner, new_owner);
10194
10195 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10196 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10197
10198 if (!relatedPlayer && playerNew)
10199 relatedPlayer = playerNew;
10200
10201 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10202 {
10204 if (actionMgr)
10205 {
10206 ActionBase currentAction = actionMgr.GetRunningAction();
10207 if (currentAction)
10209 }
10210 }
10211
10212 Man ownerPlayerOld = null;
10213 Man ownerPlayerNew = null;
10214
10215 if (old_owner)
10216 {
10217 if (old_owner.
IsMan())
10218 {
10219 ownerPlayerOld = Man.Cast(old_owner);
10220 }
10221 else
10222 {
10223 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10224 }
10225 }
10226 else
10227 {
10229 {
10231
10232 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10233 {
10234 GetCompEM().UnplugThis();
10235 }
10236 }
10237 }
10238
10239 if (new_owner)
10240 {
10241 if (new_owner.
IsMan())
10242 {
10243 ownerPlayerNew = Man.Cast(new_owner);
10244 }
10245 else
10246 {
10247 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10248 }
10249 }
10250
10251 if (ownerPlayerOld != ownerPlayerNew)
10252 {
10253 if (ownerPlayerOld)
10254 {
10255 array<EntityAI> subItemsExit = new array<EntityAI>;
10257 for (int i = 0; i < subItemsExit.Count(); i++)
10258 {
10261 }
10262 }
10263
10264 if (ownerPlayerNew)
10265 {
10266 array<EntityAI> subItemsEnter = new array<EntityAI>;
10268 for (int j = 0; j < subItemsEnter.Count(); j++)
10269 {
10272 }
10273 }
10274 }
10275 else if (ownerPlayerNew != null)
10276 {
10277 PlayerBase nplayer;
10278 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10279 {
10280 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10282 for (int k = 0; k < subItemsUpdate.Count(); k++)
10283 {
10285 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10286 }
10287 }
10288 }
10289
10290 if (old_owner)
10291 old_owner.OnChildItemRemoved(this);
10292 if (new_owner)
10293 new_owner.OnChildItemReceived(this);
10294 }
10295
10296
10298 {
10299 super.EEDelete(parent);
10300 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10301 if (player)
10302 {
10304
10305 if (player.IsAlive())
10306 {
10307 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10308 if (r_index >= 0)
10309 {
10310 InventoryLocation r_il = new InventoryLocation;
10311 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10312
10313 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10316 {
10317 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10318 }
10320 {
10321 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10322 }
10323
10324 }
10325
10326 player.RemoveQuickBarEntityShortcut(this);
10327 }
10328 }
10329 }
10330
10332 {
10333 super.EEKilled(killer);
10334
10337 {
10338 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10339 {
10340 if (IsMagazine())
10341 {
10342 if (Magazine.Cast(this).GetAmmoCount() > 0)
10343 {
10345 }
10346 }
10347 else
10348 {
10350 }
10351 }
10352 }
10353 }
10354
10356 {
10357 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10358
10359 super.OnWasAttached(parent, slot_id);
10360
10363
10365 }
10366
10368 {
10369 super.OnWasDetached(parent, slot_id);
10370
10373 }
10374
10376 {
10377 int idx;
10380
10381 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10382 if (inventory_slots.Count() < 1)
10383 {
10384 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10385 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10386 }
10387 else
10388 {
10389 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10390 }
10391
10392 idx = inventory_slots.Find(slot);
10393 if (idx < 0)
10394 return "";
10395
10396 return attach_types.Get(idx);
10397 }
10398
10400 {
10401 int idx = -1;
10402 string slot;
10403
10406
10407 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10408 if (inventory_slots.Count() < 1)
10409 {
10410 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10411 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10412 }
10413 else
10414 {
10415 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10416 if (detach_types.Count() < 1)
10417 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10418 }
10419
10420 for (int i = 0; i < inventory_slots.Count(); i++)
10421 {
10422 slot = inventory_slots.Get(i);
10423 }
10424
10425 if (slot != "")
10426 {
10427 if (detach_types.Count() == 1)
10428 idx = 0;
10429 else
10430 idx = inventory_slots.Find(slot);
10431 }
10432 if (idx < 0)
10433 return "";
10434
10435 return detach_types.Get(idx);
10436 }
10437
10439 {
10440
10442
10443
10444 float min_time = 1;
10445 float max_time = 3;
10446 float delay = Math.RandomFloat(min_time, max_time);
10447
10448 explode_timer.Run(delay, this, "DoAmmoExplosion");
10449 }
10450
10452 {
10453 Magazine magazine = Magazine.Cast(this);
10454 int pop_sounds_count = 6;
10455 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10456
10457
10458 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10459 string sound_name = pop_sounds[ sound_idx ];
10461
10462
10463 magazine.ServerAddAmmoCount(-1);
10464
10465
10466 float min_temp_to_explode = 100;
10467
10468 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10469 {
10471 }
10472 }
10473
10474
10475 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10476 {
10477 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10478
10479 const int CHANCE_DAMAGE_CARGO = 4;
10480 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10481 const int CHANCE_DAMAGE_NOTHING = 2;
10482
10484 {
10485 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10486 int chances;
10487 int rnd;
10488
10489 if (GetInventory().GetCargo())
10490 {
10491 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10492 rnd = Math.RandomInt(0,chances);
10493
10494 if (rnd < CHANCE_DAMAGE_CARGO)
10495 {
10497 }
10498 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10499 {
10501 }
10502 }
10503 else
10504 {
10505 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10506 rnd = Math.RandomInt(0,chances);
10507
10508 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10509 {
10511 }
10512 }
10513 }
10514 }
10515
10517 {
10518 if (GetInventory().GetCargo())
10519 {
10520 int item_count = GetInventory().GetCargo().GetItemCount();
10521 if (item_count > 0)
10522 {
10523 int random_pick = Math.RandomInt(0, item_count);
10525 if (!item.IsExplosive())
10526 {
10527 item.AddHealth("","",damage);
10528 return true;
10529 }
10530 }
10531 }
10532 return false;
10533 }
10534
10536 {
10537 int attachment_count = GetInventory().AttachmentCount();
10538 if (attachment_count > 0)
10539 {
10540 int random_pick = Math.RandomInt(0, attachment_count);
10541 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10542 if (!attachment.IsExplosive())
10543 {
10544 attachment.AddHealth("","",damage);
10545 return true;
10546 }
10547 }
10548 return false;
10549 }
10550
10552 {
10554 }
10555
10557 {
10559 return GetInventory().CanRemoveEntity();
10560
10561 return false;
10562 }
10563
10565 {
10567 return;
10568
10570 {
10571 if (ScriptInputUserData.CanStoreInputUserData())
10572 {
10573 ScriptInputUserData ctx = new ScriptInputUserData;
10578 ctx.
Write(destination_entity);
10580 ctx.
Write(slot_id);
10582 }
10583 }
10584 else if (!
GetGame().IsMultiplayer())
10585 {
10587 }
10588 }
10589
10591 {
10593 return;
10594
10595 float split_quantity_new;
10599 InventoryLocation loc = new InventoryLocation;
10600
10601 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10602 {
10604 split_quantity_new = stack_max;
10605 else
10607
10608 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10609 if (new_item)
10610 {
10611 new_item.SetResultOfSplit(true);
10612 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10614 new_item.SetQuantity(split_quantity_new);
10615 }
10616 }
10617 else if (destination_entity && slot_id == -1)
10618 {
10619 if (quantity > stack_max)
10620 split_quantity_new = stack_max;
10621 else
10622 split_quantity_new = quantity;
10623
10625 {
10628 }
10629
10630 if (new_item)
10631 {
10632 new_item.SetResultOfSplit(true);
10633 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10635 new_item.SetQuantity(split_quantity_new);
10636 }
10637 }
10638 else
10639 {
10640 if (stack_max != 0)
10641 {
10643 {
10645 }
10646
10647 if (split_quantity_new == 0)
10648 {
10649 if (!
GetGame().IsMultiplayer())
10650 player.PhysicalPredictiveDropItem(this);
10651 else
10652 player.ServerDropEntity(this);
10653 return;
10654 }
10655
10657
10658 if (new_item)
10659 {
10660 new_item.SetResultOfSplit(true);
10661 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10663 new_item.SetQuantity(stack_max);
10664 new_item.PlaceOnSurface();
10665 }
10666 }
10667 }
10668 }
10669
10671 {
10673 return;
10674
10675 float split_quantity_new;
10679 InventoryLocation loc = new InventoryLocation;
10680
10681 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10682 {
10684 split_quantity_new = stack_max;
10685 else
10687
10688 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10689 if (new_item)
10690 {
10691 new_item.SetResultOfSplit(true);
10692 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10694 new_item.SetQuantity(split_quantity_new);
10695 }
10696 }
10697 else if (destination_entity && slot_id == -1)
10698 {
10699 if (quantity > stack_max)
10700 split_quantity_new = stack_max;
10701 else
10702 split_quantity_new = quantity;
10703
10705 {
10708 }
10709
10710 if (new_item)
10711 {
10712 new_item.SetResultOfSplit(true);
10713 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10715 new_item.SetQuantity(split_quantity_new);
10716 }
10717 }
10718 else
10719 {
10720 if (stack_max != 0)
10721 {
10723 {
10725 }
10726
10728
10729 if (new_item)
10730 {
10731 new_item.SetResultOfSplit(true);
10732 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10734 new_item.SetQuantity(stack_max);
10735 new_item.PlaceOnSurface();
10736 }
10737 }
10738 }
10739 }
10740
10742 {
10744 return;
10745
10747 {
10748 if (ScriptInputUserData.CanStoreInputUserData())
10749 {
10750 ScriptInputUserData ctx = new ScriptInputUserData;
10755 dst.WriteToContext(ctx);
10757 }
10758 }
10759 else if (!
GetGame().IsMultiplayer())
10760 {
10762 }
10763 }
10764
10766 {
10768 return;
10769
10771 {
10772 if (ScriptInputUserData.CanStoreInputUserData())
10773 {
10774 ScriptInputUserData ctx = new ScriptInputUserData;
10779 ctx.
Write(destination_entity);
10785 }
10786 }
10787 else if (!
GetGame().IsMultiplayer())
10788 {
10790 }
10791 }
10792
10794 {
10796 }
10797
10799 {
10801 return this;
10802
10804 float split_quantity_new;
10806 if (dst.IsValid())
10807 {
10808 int slot_id = dst.GetSlot();
10810
10811 if (quantity > stack_max)
10812 split_quantity_new = stack_max;
10813 else
10814 split_quantity_new = quantity;
10815
10817
10818 if (new_item)
10819 {
10820 new_item.SetResultOfSplit(true);
10821 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10824 }
10825
10826 return new_item;
10827 }
10828
10829 return null;
10830 }
10831
10833 {
10835 return;
10836
10838 float split_quantity_new;
10840 if (destination_entity)
10841 {
10843 if (quantity > stackable)
10844 split_quantity_new = stackable;
10845 else
10846 split_quantity_new = quantity;
10847
10848 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10849 if (new_item)
10850 {
10851 new_item.SetResultOfSplit(true);
10852 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10854 new_item.SetQuantity(split_quantity_new);
10855 }
10856 }
10857 }
10858
10860 {
10862 return;
10863
10865 {
10866 if (ScriptInputUserData.CanStoreInputUserData())
10867 {
10868 ScriptInputUserData ctx = new ScriptInputUserData;
10873 ItemBase destination_entity =
this;
10874 ctx.
Write(destination_entity);
10878 }
10879 }
10880 else if (!
GetGame().IsMultiplayer())
10881 {
10883 }
10884 }
10885
10887 {
10889 return;
10890
10892 float split_quantity_new;
10894 if (player)
10895 {
10897 if (quantity > stackable)
10898 split_quantity_new = stackable;
10899 else
10900 split_quantity_new = quantity;
10901
10902 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10903 new_item =
ItemBase.Cast(in_hands);
10904 if (new_item)
10905 {
10906 new_item.SetResultOfSplit(true);
10907 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10909 new_item.SetQuantity(split_quantity_new);
10910 }
10911 }
10912 }
10913
10915 {
10917 return;
10918
10920 float split_quantity_new = Math.Floor(quantity * 0.5);
10921
10923
10924 if (new_item)
10925 {
10926 if (new_item.GetQuantityMax() < split_quantity_new)
10927 {
10928 split_quantity_new = new_item.GetQuantityMax();
10929 }
10930
10931 new_item.SetResultOfSplit(true);
10932 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10933
10935 {
10938 }
10939 else
10940 {
10943 }
10944 }
10945 }
10946
10948 {
10950 return;
10951
10953 float split_quantity_new = Math.Floor(quantity / 2);
10954
10955 InventoryLocation invloc = new InventoryLocation;
10957
10959 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10960
10961 if (new_item)
10962 {
10963 if (new_item.GetQuantityMax() < split_quantity_new)
10964 {
10965 split_quantity_new = new_item.GetQuantityMax();
10966 }
10968 {
10971 }
10972 else
10973 {
10976 }
10977 }
10978 }
10979
10982 {
10983 SetWeightDirty();
10985
10986 if (parent)
10987 parent.OnAttachmentQuantityChangedEx(this, delta);
10988
10990 {
10992 {
10994 }
10996 {
10997 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10999 }
11000 }
11001
11002 }
11003
11006 {
11007
11008 }
11009
11012 {
11014 }
11015
11017 {
11018 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11019
11021 {
11022 if (newLevel == GameConstants.STATE_RUINED)
11023 {
11025 EntityAI parent = GetHierarchyParent();
11026 if (parent && parent.IsFireplace())
11027 {
11028 CargoBase cargo = GetInventory().GetCargo();
11029 if (cargo)
11030 {
11032 {
11034 }
11035 }
11036 }
11037 }
11038
11040 {
11041
11043 return;
11044 }
11045
11046 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11047 {
11049 }
11050 }
11051 }
11052
11053
11055 {
11056 super.OnRightClick();
11057
11059 {
11061 {
11062 if (ScriptInputUserData.CanStoreInputUserData())
11063 {
11064 vector m4[4];
11066
11067 EntityAI root = GetHierarchyRoot();
11068
11069 InventoryLocation dst = new InventoryLocation;
11071 {
11072 if (root)
11073 {
11074 root.GetTransform(m4);
11076 }
11077 else
11078 GetInventory().GetCurrentInventoryLocation(dst);
11079 }
11080 else
11081 {
11083
11084
11085 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11086 {
11087 if (root)
11088 {
11089 root.GetTransform(m4);
11091 }
11092 else
11093 GetInventory().GetCurrentInventoryLocation(dst);
11094 }
11095 else
11096 {
11097 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11098 }
11099 }
11100
11101 ScriptInputUserData ctx = new ScriptInputUserData;
11109 }
11110 }
11111 else if (!
GetGame().IsMultiplayer())
11112 {
11114 }
11115 }
11116 }
11117
11118 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11119 {
11120
11121 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11122 return false;
11123
11124 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11125 return false;
11126
11127
11129 return false;
11130
11131
11132 Magazine mag = Magazine.Cast(this);
11133 if (mag)
11134 {
11135 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11136 return false;
11137
11138 if (stack_max_limit)
11139 {
11140 Magazine other_mag = Magazine.Cast(other_item);
11141 if (other_item)
11142 {
11143 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11144 return false;
11145 }
11146
11147 }
11148 }
11149 else
11150 {
11151
11153 return false;
11154
11156 return false;
11157 }
11158
11159 PlayerBase player = null;
11160 if (CastTo(player, GetHierarchyRootPlayer()))
11161 {
11162 if (player.GetInventory().HasAttachment(this))
11163 return false;
11164
11165 if (player.IsItemsToDelete())
11166 return false;
11167 }
11168
11169 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11170 return false;
11171
11172 int slotID;
11174 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11175 return false;
11176
11177 return true;
11178 }
11179
11181 {
11183 }
11184
11186 {
11187 return m_IsResultOfSplit;
11188 }
11189
11191 {
11192 m_IsResultOfSplit = value;
11193 }
11194
11196 {
11198 }
11199
11201 {
11202 float other_item_quantity = other_item.GetQuantity();
11203 float this_free_space;
11204
11206
11208
11209 if (other_item_quantity > this_free_space)
11210 {
11211 return this_free_space;
11212 }
11213 else
11214 {
11215 return other_item_quantity;
11216 }
11217 }
11218
11220 {
11222 }
11223
11225 {
11227 return;
11228
11229 if (!IsMagazine() && other_item)
11230 {
11232 if (quantity_used != 0)
11233 {
11234 float hp1 = GetHealth01("","");
11235 float hp2 = other_item.GetHealth01("","");
11236 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11237 hpResult = hpResult / (
GetQuantity() + quantity_used);
11238
11239 hpResult *= GetMaxHealth();
11240 Math.Round(hpResult);
11241 SetHealth("", "Health", hpResult);
11242
11244 other_item.AddQuantity(-quantity_used);
11245 }
11246 }
11248 }
11249
11251 {
11252 #ifdef SERVER
11253 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11254 GetHierarchyParent().IncreaseLifetimeUp();
11255 #endif
11256 };
11257
11259 {
11260 PlayerBase p = PlayerBase.Cast(player);
11261
11262 array<int> recipesIds = p.m_Recipes;
11263 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11264 if (moduleRecipesManager)
11265 {
11266 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11267 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11268 }
11269
11270 for (int i = 0;i < recipesIds.Count(); i++)
11271 {
11272 int key = recipesIds.Get(i);
11273 string recipeName = moduleRecipesManager.GetRecipeName(key);
11275 }
11276 }
11277
11278
11279 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11280 {
11281 super.GetDebugActions(outputList);
11282
11283
11288
11289
11293
11297
11298
11301
11302
11304 {
11307 }
11308
11310
11313
11317 }
11318
11319
11320
11321
11323 {
11324 super.OnAction(action_id, player, ctx);
11325 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11326 {
11327 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11328 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11329 PlayerBase p = PlayerBase.Cast(player);
11330 if (
EActions.RECIPES_RANGE_START < 1000)
11331 {
11332 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11333 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11334 }
11335 }
11336 #ifndef SERVER
11337 else if (action_id ==
EActions.WATCH_PLAYER)
11338 {
11339 PluginDeveloper.SetDeveloperItemClientEx(player);
11340 }
11341 #endif
11343 {
11344 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11345 {
11346 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11347 OnDebugButtonPressServer(id + 1);
11348 }
11349
11350 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11351 {
11352 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11354 }
11355
11356 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11357 {
11358 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11360 }
11361
11362 else if (action_id ==
EActions.ADD_QUANTITY)
11363 {
11364 if (IsMagazine())
11365 {
11366 Magazine mag = Magazine.Cast(this);
11367 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11368 }
11369 else
11370 {
11372 }
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.REMOVE_QUANTITY)
11382 {
11383 if (IsMagazine())
11384 {
11385 Magazine mag2 = Magazine.Cast(this);
11386 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11387 }
11388 else
11389 {
11391 }
11392 if (m_EM)
11393 {
11394 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11395 }
11396
11397 }
11398
11399 else if (action_id ==
EActions.SET_QUANTITY_0)
11400 {
11402
11403 if (m_EM)
11404 {
11405 m_EM.SetEnergy(0);
11406 }
11407 }
11408
11409 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11410 {
11412
11413 if (m_EM)
11414 {
11415 m_EM.SetEnergy(m_EM.GetEnergyMax());
11416 }
11417 }
11418
11419 else if (action_id ==
EActions.ADD_HEALTH)
11420 {
11421 AddHealth("","",GetMaxHealth("","Health")/5);
11422 }
11423 else if (action_id ==
EActions.REMOVE_HEALTH)
11424 {
11425 AddHealth("","",-GetMaxHealth("","Health")/5);
11426 }
11427 else if (action_id ==
EActions.DESTROY_HEALTH)
11428 {
11429 SetHealth01("","",0);
11430 }
11431 else if (action_id ==
EActions.WATCH_ITEM)
11432 {
11434 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11435 #ifdef DEVELOPER
11436 SetDebugDeveloper_item(this);
11437 #endif
11438 }
11439
11440 else if (action_id ==
EActions.ADD_TEMPERATURE)
11441 {
11442 AddTemperature(20);
11443
11444 }
11445
11446 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11447 {
11448 AddTemperature(-20);
11449
11450 }
11451
11452 else if (action_id ==
EActions.FLIP_FROZEN)
11453 {
11454 SetFrozen(!GetIsFrozen());
11455
11456 }
11457
11458 else if (action_id ==
EActions.ADD_WETNESS)
11459 {
11461
11462 }
11463
11464 else if (action_id ==
EActions.REMOVE_WETNESS)
11465 {
11467
11468 }
11469
11470 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11471 {
11474
11475
11476 }
11477
11478 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11479 {
11482 }
11483
11484 else if (action_id ==
EActions.MAKE_SPECIAL)
11485 {
11486 auto debugParams = DebugSpawnParams.WithPlayer(player);
11487 OnDebugSpawnEx(debugParams);
11488 }
11489
11490 else if (action_id ==
EActions.DELETE)
11491 {
11492 Delete();
11493 }
11494
11495 }
11496
11497
11498 return false;
11499 }
11500
11501
11502
11503
11507
11510
11511
11512
11514 {
11515 return false;
11516 }
11517
11518
11520 {
11521 return true;
11522 }
11523
11524
11526 {
11527 return true;
11528 }
11529
11530
11531
11533 {
11534 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11536 }
11537
11540 {
11541 return null;
11542 }
11543
11545 {
11546 return false;
11547 }
11548
11550 {
11551 return false;
11552 }
11553
11557
11558
11560 {
11561 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11562 return module_repairing.CanRepair(this, item_repair_kit);
11563 }
11564
11565
11566 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11567 {
11568 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11569 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11570 }
11571
11572
11574 {
11575
11576
11577
11578
11579
11580
11581
11582
11583 return 1;
11584 }
11585
11586
11587
11589 {
11591 }
11592
11593
11594
11596 {
11598 }
11599
11600
11609 {
11610 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11611
11612 if (player)
11613 {
11614 player.MessageStatus(text);
11615 }
11616 }
11617
11618
11627 {
11628 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11629
11630 if (player)
11631 {
11632 player.MessageAction(text);
11633 }
11634 }
11635
11636
11645 {
11646 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11647
11648 if (player)
11649 {
11650 player.MessageFriendly(text);
11651 }
11652 }
11653
11654
11663 {
11664 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11665
11666 if (player)
11667 {
11668 player.MessageImportant(text);
11669 }
11670 }
11671
11673 {
11674 return true;
11675 }
11676
11677
11678 override bool KindOf(
string tag)
11679 {
11680 bool found = false;
11681 string item_name = this.
GetType();
11684
11685 int array_size = item_tag_array.Count();
11686 for (int i = 0; i < array_size; i++)
11687 {
11688 if (item_tag_array.Get(i) == tag)
11689 {
11690 found = true;
11691 break;
11692 }
11693 }
11694 return found;
11695 }
11696
11697
11699 {
11700
11701 super.OnRPC(sender, rpc_type,ctx);
11702
11703
11704 switch (rpc_type)
11705 {
11706 #ifndef SERVER
11707 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11708 Param2<bool, string> p = new Param2<bool, string>(false, "");
11709
11711 return;
11712
11713 bool play = p.param1;
11714 string soundSet = p.param2;
11715
11716 if (play)
11717 {
11719 {
11721 {
11723 }
11724 }
11725 else
11726 {
11728 }
11729 }
11730 else
11731 {
11733 }
11734
11735 break;
11736 #endif
11737
11738 }
11739
11741 {
11743 }
11744 }
11745
11746
11747
11748
11750 {
11751 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11752 return plugin.GetID(
name);
11753 }
11754
11756 {
11757 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11758 return plugin.GetName(id);
11759 }
11760
11763 {
11764
11765
11766 int varFlags;
11767 if (!ctx.
Read(varFlags))
11768 return;
11769
11770 if (varFlags & ItemVariableFlags.FLOAT)
11771 {
11773 }
11774 }
11775
11777 {
11778
11779 super.SerializeNumericalVars(floats_out);
11780
11781
11782
11784 {
11786 }
11787
11789 {
11791 }
11792
11794 {
11796 }
11797
11799 {
11804 }
11805
11807 {
11809 }
11810 }
11811
11813 {
11814
11815 super.DeSerializeNumericalVars(floats);
11816
11817
11818 int index = 0;
11819 int mask = Math.Round(floats.Get(index));
11820
11821 index++;
11822
11824 {
11826 {
11828 }
11829 else
11830 {
11831 float quantity = floats.Get(index);
11832 SetQuantity(quantity,
true,
false,
false,
false);
11833 }
11834 index++;
11835 }
11836
11838 {
11839 float wet = floats.Get(index);
11841 index++;
11842 }
11843
11845 {
11846 int liquidtype = Math.Round(floats.Get(index));
11848 index++;
11849 }
11850
11852 {
11854 index++;
11856 index++;
11858 index++;
11860 index++;
11861 }
11862
11864 {
11865 int cleanness = Math.Round(floats.Get(index));
11867 index++;
11868 }
11869 }
11870
11872 {
11873 super.WriteVarsToCTX(ctx);
11874
11875
11877 {
11879 }
11880
11882 {
11884 }
11885
11887 {
11889 }
11890
11892 {
11893 int r,g,b,a;
11899 }
11900
11902 {
11904 }
11905 }
11906
11908 {
11909 if (!super.ReadVarsFromCTX(ctx,version))
11910 return false;
11911
11912 int intValue;
11913 float value;
11914
11915 if (version < 140)
11916 {
11917 if (!ctx.
Read(intValue))
11918 return false;
11919
11920 m_VariablesMask = intValue;
11921 }
11922
11924 {
11925 if (!ctx.
Read(value))
11926 return false;
11927
11929 {
11931 }
11932 else
11933 {
11935 }
11936 }
11937
11938 if (version < 140)
11939 {
11941 {
11942 if (!ctx.
Read(value))
11943 return false;
11944 SetTemperatureDirect(value);
11945 }
11946 }
11947
11949 {
11950 if (!ctx.
Read(value))
11951 return false;
11953 }
11954
11956 {
11957 if (!ctx.
Read(intValue))
11958 return false;
11960 }
11961
11963 {
11964 int r,g,b,a;
11966 return false;
11968 return false;
11970 return false;
11972 return false;
11973
11975 }
11976
11978 {
11979 if (!ctx.
Read(intValue))
11980 return false;
11982 }
11983
11984 if (version >= 138 && version < 140)
11985 {
11987 {
11988 if (!ctx.
Read(intValue))
11989 return false;
11990 SetFrozen(intValue);
11991 }
11992 }
11993
11994 return true;
11995 }
11996
11997
11999 {
12002 {
12004 }
12005
12006 if (!super.OnStoreLoad(ctx, version))
12007 {
12009 return false;
12010 }
12011
12012 if (version >= 114)
12013 {
12014 bool hasQuickBarIndexSaved;
12015
12016 if (!ctx.
Read(hasQuickBarIndexSaved))
12017 {
12019 return false;
12020 }
12021
12022 if (hasQuickBarIndexSaved)
12023 {
12024 int itmQBIndex;
12025
12026
12027 if (!ctx.
Read(itmQBIndex))
12028 {
12030 return false;
12031 }
12032
12033 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12034 if (itmQBIndex != -1 && parentPlayer)
12035 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12036 }
12037 }
12038 else
12039 {
12040
12041 PlayerBase player;
12042 int itemQBIndex;
12043 if (version ==
int.
MAX)
12044 {
12045 if (!ctx.
Read(itemQBIndex))
12046 {
12048 return false;
12049 }
12050 }
12051 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12052 {
12053
12054 if (!ctx.
Read(itemQBIndex))
12055 {
12057 return false;
12058 }
12059 if (itemQBIndex != -1 && player)
12060 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12061 }
12062 }
12063
12064 if (version < 140)
12065 {
12066
12067 if (!LoadVariables(ctx, version))
12068 {
12070 return false;
12071 }
12072 }
12073
12074
12076 {
12078 return false;
12079 }
12080 if (version >= 132)
12081 {
12083 if (raib)
12084 {
12086 {
12088 return false;
12089 }
12090 }
12091 }
12092
12094 return true;
12095 }
12096
12097
12098
12100 {
12101 super.OnStoreSave(ctx);
12102
12103 PlayerBase player;
12104 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12105 {
12107
12108 int itemQBIndex = -1;
12109 itemQBIndex = player.FindQuickBarEntityIndex(this);
12110 ctx.
Write(itemQBIndex);
12111 }
12112 else
12113 {
12115 }
12116
12118
12120 if (raib)
12121 {
12123 }
12124 }
12125
12126
12128 {
12129 super.AfterStoreLoad();
12130
12132 {
12134 }
12135
12137 {
12140 }
12141 }
12142
12144 {
12145 super.EEOnAfterLoad();
12146
12148 {
12150 }
12151
12154 }
12155
12157 {
12158 return false;
12159 }
12160
12161
12162
12164 {
12166 {
12167 #ifdef PLATFORM_CONSOLE
12168
12170 {
12172 if (menu)
12173 {
12175 }
12176 }
12177 #endif
12178 }
12179
12181 {
12184 }
12185
12187 {
12188 SetWeightDirty();
12190 }
12192 {
12195 }
12196
12198 {
12201 }
12203 {
12206 }
12207
12208 super.OnVariablesSynchronized();
12209 }
12210
12211
12212
12214 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12215 {
12216 if (!IsServerCheck(allow_client))
12217 return false;
12218
12220 return false;
12221
12224
12225 if (value <= (min + 0.001))
12226 value = min;
12227
12228 if (value == min)
12229 {
12230 if (destroy_config)
12231 {
12232 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12233 if (dstr)
12234 {
12236 this.Delete();
12237 return true;
12238 }
12239 }
12240 else if (destroy_forced)
12241 {
12243 this.Delete();
12244 return true;
12245 }
12246
12248 }
12249
12252
12254 {
12256
12257 if (delta)
12259 }
12260
12262
12263 return false;
12264 }
12265
12266
12268 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12269 {
12271 }
12272
12274 {
12277 }
12278
12280 {
12283 }
12284
12287 {
12288 float value_clamped = Math.Clamp(value, 0, 1);
12290 SetQuantity(result, destroy_config, destroy_forced);
12291 }
12292
12293
12296 {
12298 }
12299
12301 {
12303 }
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12315 {
12316 int slot = -1;
12317 if (GetInventory())
12318 {
12319 InventoryLocation il = new InventoryLocation;
12320 GetInventory().GetCurrentInventoryLocation(il);
12322 }
12323
12325 }
12326
12328 {
12329 float quantity_max = 0;
12330
12332 {
12333 if (attSlotID != -1)
12334 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12335
12336 if (quantity_max <= 0)
12338 }
12339
12340 if (quantity_max <= 0)
12342
12343 return quantity_max;
12344 }
12345
12347 {
12349 }
12350
12352 {
12354 }
12355
12356
12358 {
12360 }
12361
12363 {
12365 }
12366
12368 {
12370 }
12371
12372
12374 {
12375
12376 float weightEx = GetWeightEx();
12377 float special = GetInventoryAndCargoWeight();
12378 return weightEx - special;
12379 }
12380
12381
12383 {
12385 }
12386
12388 {
12390 {
12391 #ifdef DEVELOPER
12392 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12393 {
12394 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12396 }
12397 #endif
12398
12399 return GetQuantity() * GetConfigWeightModified();
12400 }
12401 else if (HasEnergyManager())
12402 {
12403 #ifdef DEVELOPER
12404 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12405 {
12406 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12407 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12408 }
12409 #endif
12410 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12411 }
12412 else
12413 {
12414 #ifdef DEVELOPER
12415 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12416 {
12417 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12418 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12419 }
12420 #endif
12421 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12422 }
12423 }
12424
12427 {
12428 int item_count = 0;
12430
12431 if (GetInventory().GetCargo() != NULL)
12432 {
12433 item_count = GetInventory().GetCargo().GetItemCount();
12434 }
12435
12436 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12437 {
12438 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12439 if (item)
12440 item_count += item.GetNumberOfItems();
12441 }
12442 return item_count;
12443 }
12444
12447 {
12448 float weight = 0;
12449 float wetness = 1;
12450 if (include_wetness)
12453 {
12454 weight = wetness * m_ConfigWeight;
12455 }
12457 {
12458 weight = 1;
12459 }
12460 return weight;
12461 }
12462
12463
12464
12466 {
12467 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12468 {
12469 GameInventory inv = GetInventory();
12470 array<EntityAI> items = new array<EntityAI>;
12472 for (int i = 0; i < items.Count(); i++)
12473 {
12475 if (item)
12476 {
12478 }
12479 }
12480 }
12481 }
12482
12483
12484
12485
12487 {
12488 float energy = 0;
12489 if (HasEnergyManager())
12490 {
12491 energy = GetCompEM().GetEnergy();
12492 }
12493 return energy;
12494 }
12495
12496
12498 {
12499 super.OnEnergyConsumed();
12500
12502 }
12503
12505 {
12506 super.OnEnergyAdded();
12507
12509 }
12510
12511
12513 {
12514 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12515 {
12517 {
12518 float energy_0to1 = GetCompEM().GetEnergy0To1();
12520 }
12521 }
12522 }
12523
12524
12526 {
12527 return ConfigGetFloat("heatIsolation");
12528 }
12529
12531 {
12533 }
12534
12536 {
12537 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12538 if (
GetGame().ConfigIsExisting(paramPath))
12540
12541 return 0.0;
12542 }
12543
12545 {
12546 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12547 if (
GetGame().ConfigIsExisting(paramPath))
12549
12550 return 0.0;
12551 }
12552
12553 override void SetWet(
float value,
bool allow_client =
false)
12554 {
12555 if (!IsServerCheck(allow_client))
12556 return;
12557
12560
12562
12563 m_VarWet = Math.Clamp(value, min, max);
12564
12566 {
12569 }
12570 }
12571
12572 override void AddWet(
float value)
12573 {
12575 }
12576
12578 {
12580 }
12581
12583 {
12585 }
12586
12588 {
12590 }
12591
12593 {
12595 }
12596
12598 {
12600 }
12601
12602 override void OnWetChanged(
float newVal,
float oldVal)
12603 {
12606 if (newLevel != oldLevel)
12607 {
12609 }
12610 }
12611
12613 {
12614 SetWeightDirty();
12615 }
12616
12618 {
12619 return GetWetLevelInternal(
m_VarWet);
12620 }
12621
12622
12623
12625 {
12627 }
12628
12630 {
12632 }
12633
12635 {
12637 }
12638
12640 {
12642 }
12643
12644
12645
12647 {
12648 if (ConfigIsExisting("itemModelLength"))
12649 {
12650 return ConfigGetFloat("itemModelLength");
12651 }
12652 return 0;
12653 }
12654
12656 {
12657 if (ConfigIsExisting("itemAttachOffset"))
12658 {
12659 return ConfigGetFloat("itemAttachOffset");
12660 }
12661 return 0;
12662 }
12663
12664 override void SetCleanness(
int value,
bool allow_client =
false)
12665 {
12666 if (!IsServerCheck(allow_client))
12667 return;
12668
12670
12672
12675 }
12676
12678 {
12680 }
12681
12683 {
12684 return true;
12685 }
12686
12687
12688
12689
12691 {
12693 }
12694
12696 {
12698 }
12699
12700
12701
12702
12703 override void SetColor(
int r,
int g,
int b,
int a)
12704 {
12710 }
12712 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12713 {
12718 }
12719
12721 {
12723 }
12724
12727 {
12728 int r,g,b,a;
12730 r = r/255;
12731 g = g/255;
12732 b = b/255;
12733 a = a/255;
12734 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12735 }
12736
12737
12738
12739 override void SetLiquidType(
int value,
bool allow_client =
false)
12740 {
12741 if (!IsServerCheck(allow_client))
12742 return;
12743
12748 }
12749
12751 {
12752 return ConfigGetInt("varLiquidTypeInit");
12753 }
12754
12756 {
12758 }
12759
12761 {
12763 SetFrozen(false);
12764 }
12765
12768 {
12769 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12770 }
12771
12772
12775 {
12776 PlayerBase nplayer;
12777 if (PlayerBase.CastTo(nplayer, player))
12778 {
12780
12781 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12782 }
12783 }
12784
12785
12788 {
12789 PlayerBase nplayer;
12790 if (PlayerBase.CastTo(nplayer,player))
12791 {
12792
12793 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12794
12795 }
12796
12797
12798 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12799
12800
12801 if (HasEnergyManager())
12802 {
12803 GetCompEM().UpdatePlugState();
12804 }
12805 }
12806
12807
12809 {
12810 super.OnPlacementStarted(player);
12811
12813 }
12814
12815 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12816 {
12818 {
12819 m_AdminLog.OnPlacementComplete(player,
this);
12820 }
12821
12822 super.OnPlacementComplete(player, position, orientation);
12823 }
12824
12825
12826
12827
12828
12830 {
12832 {
12833 return true;
12834 }
12835 else
12836 {
12837 return false;
12838 }
12839 }
12840
12841
12843 {
12845 {
12847 }
12848 }
12849
12850
12852 {
12854 }
12855
12857 {
12859 }
12860
12861 override void InsertAgent(
int agent,
float count = 1)
12862 {
12863 if (count < 1)
12864 return;
12865
12867 }
12868
12871 {
12873 }
12874
12875
12877 {
12879 }
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12923 {
12925 return false;
12926 return true;
12927 }
12928
12930 {
12931
12933 }
12934
12935
12938 {
12939 super.CheckForRoofLimited(timeTresholdMS);
12940
12942 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12943 {
12944 m_PreviousRoofTestTime = time;
12945 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12946 }
12947 }
12948
12949
12951 {
12953 {
12954 return 0;
12955 }
12956
12957 if (GetInventory().GetAttachmentSlotsCount() != 0)
12958 {
12959 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12960 if (filter)
12961 return filter.GetProtectionLevel(type, false, system);
12962 else
12963 return 0;
12964 }
12965
12966 string subclassPath, entryName;
12967
12968 switch (type)
12969 {
12971 entryName = "biological";
12972 break;
12974 entryName = "chemical";
12975 break;
12976 default:
12977 entryName = "biological";
12978 break;
12979 }
12980
12981 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12982
12984 }
12985
12986
12987
12990 {
12991 if (!IsMagazine())
12993
12995 }
12996
12997
12998
12999
13000
13005 {
13006 return true;
13007 }
13008
13010 {
13012 }
13013
13014
13015
13016
13017
13019 {
13020 if (parent)
13021 {
13022 if (parent.IsInherited(DayZInfected))
13023 return true;
13024
13025 if (!parent.IsRuined())
13026 return true;
13027 }
13028
13029 return true;
13030 }
13031
13033 {
13034 if (!super.CanPutAsAttachment(parent))
13035 {
13036 return false;
13037 }
13038
13039 if (!IsRuined() && !parent.IsRuined())
13040 {
13041 return true;
13042 }
13043
13044 return false;
13045 }
13046
13048 {
13049
13050
13051
13052
13053 return super.CanReceiveItemIntoCargo(item);
13054 }
13055
13057 {
13058
13059
13060
13061
13062 GameInventory attachmentInv = attachment.GetInventory();
13064 {
13065 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13066 return false;
13067 }
13068
13069 InventoryLocation loc = new InventoryLocation();
13070 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13071 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13072 return false;
13073
13074 return super.CanReceiveAttachment(attachment, slotId);
13075 }
13076
13078 {
13079 if (!super.CanReleaseAttachment(attachment))
13080 return false;
13081
13082 return GetInventory().AreChildrenAccessible();
13083 }
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13106 {
13107 int id = muzzle_owner.GetMuzzleID();
13108 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13109
13110 if (WPOF_array)
13111 {
13112 for (int i = 0; i < WPOF_array.Count(); i++)
13113 {
13114 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13115
13116 if (WPOF)
13117 {
13118 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13119 }
13120 }
13121 }
13122 }
13123
13124
13126 {
13127 int id = muzzle_owner.GetMuzzleID();
13129
13130 if (WPOBE_array)
13131 {
13132 for (int i = 0; i < WPOBE_array.Count(); i++)
13133 {
13134 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13135
13136 if (WPOBE)
13137 {
13138 WPOBE.OnActivate(weapon, 0, 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.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13159 }
13160 }
13161 }
13162 }
13163
13164
13166 {
13167 int id = muzzle_owner.GetMuzzleID();
13168 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13169
13170 if (WPOOH_array)
13171 {
13172 for (int i = 0; i < WPOOH_array.Count(); i++)
13173 {
13174 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13175
13176 if (WPOOH)
13177 {
13178 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13179 }
13180 }
13181 }
13182 }
13183
13184
13186 {
13187 int id = muzzle_owner.GetMuzzleID();
13188 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13189
13190 if (WPOOH_array)
13191 {
13192 for (int i = 0; i < WPOOH_array.Count(); i++)
13193 {
13194 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13195
13196 if (WPOOH)
13197 {
13198 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13199 }
13200 }
13201 }
13202 }
13203
13204
13205
13207 {
13209 {
13210 return true;
13211 }
13212
13213 return false;
13214 }
13215
13217 {
13219 {
13220 return true;
13221 }
13222
13223 return false;
13224 }
13225
13227 {
13229 {
13230 return true;
13231 }
13232
13233 return false;
13234 }
13235
13237 {
13238 return false;
13239 }
13240
13243 {
13244 return UATimeSpent.DEFAULT_DEPLOY;
13245 }
13246
13247
13248
13249
13251 {
13253 SetSynchDirty();
13254 }
13255
13257 {
13259 }
13260
13261
13263 {
13264 return false;
13265 }
13266
13269 {
13270 string att_type = "None";
13271
13272 if (ConfigIsExisting("soundAttType"))
13273 {
13274 att_type = ConfigGetString("soundAttType");
13275 }
13276
13278 }
13279
13281 {
13283 }
13284
13285
13286
13287
13288
13292
13294 {
13297
13299 }
13300
13301
13303 {
13305 return;
13306
13308
13311
13314
13315 SoundParameters params = new SoundParameters();
13319 }
13320
13321
13323 {
13325 return;
13326
13328 SetSynchDirty();
13329
13332 }
13333
13334
13336 {
13338 return;
13339
13341 SetSynchDirty();
13342
13345 }
13346
13348 {
13350 }
13351
13353 {
13355 }
13356
13359 {
13360 if (!
GetGame().IsDedicatedServer())
13361 {
13362 if (ConfigIsExisting("attachSoundSet"))
13363 {
13364 string cfg_path = "";
13365 string soundset = "";
13366 string type_name =
GetType();
13367
13370 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13371 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13372
13373 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13374 {
13375 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13376 {
13377 if (cfg_slot_array[i] == slot_type)
13378 {
13379 soundset = cfg_soundset_array[i];
13380 break;
13381 }
13382 }
13383 }
13384
13385 if (soundset != "")
13386 {
13387 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13389 }
13390 }
13391 }
13392 }
13393
13395 {
13396
13397 }
13398
13399 void OnApply(PlayerBase player);
13400
13402 {
13403 return 1.0;
13404 };
13405
13407 {
13409 }
13410
13412 {
13414 }
13415
13417
13419 {
13420 SetDynamicPhysicsLifeTime(0.01);
13422 }
13423
13425 {
13426 array<string> zone_names = new array<string>;
13427 GetDamageZones(zone_names);
13428 for (int i = 0; i < zone_names.Count(); i++)
13429 {
13430 SetHealthMax(zone_names.Get(i),"Health");
13431 }
13432 SetHealthMax("","Health");
13433 }
13434
13437 {
13438 float global_health = GetHealth01("","Health");
13439 array<string> zones = new array<string>;
13440 GetDamageZones(zones);
13441
13442 for (int i = 0; i < zones.Count(); i++)
13443 {
13444 SetHealth01(zones.Get(i),"Health",global_health);
13445 }
13446 }
13447
13450 {
13451 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13452 }
13453
13455 {
13456 if (!hasRootAsPlayer)
13457 {
13458 if (refParentIB)
13459 {
13460
13461 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13462 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13463
13464 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13465 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13466
13469 }
13470 else
13471 {
13472
13475 }
13476 }
13477 }
13478
13480 {
13482 {
13483 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13484 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13485 {
13486 float heatPermCoef = 1.0;
13488 while (ent)
13489 {
13490 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13491 ent = ent.GetHierarchyParent();
13492 }
13493
13494 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13495 }
13496 }
13497 }
13498
13500 {
13501
13502 EntityAI parent = GetHierarchyParent();
13503 if (!parent)
13504 {
13505 hasParent = false;
13506 hasRootAsPlayer = false;
13507 }
13508 else
13509 {
13510 hasParent = true;
13511 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13512 refParentIB =
ItemBase.Cast(parent);
13513 }
13514 }
13515
13516 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13517 {
13518
13519 }
13520
13522 {
13523
13524 return false;
13525 }
13526
13528 {
13529
13530
13531 return false;
13532 }
13533
13535 {
13536
13537 return false;
13538 }
13539
13542 {
13543 return !GetIsFrozen() &&
IsOpen();
13544 }
13545
13547 {
13548 bool hasParent = false, hasRootAsPlayer = false;
13550
13551 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13552 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13553
13554 if (wwtu || foodDecay)
13555 {
13559
13560 if (processWetness || processTemperature || processDecay)
13561 {
13563
13564 if (processWetness)
13565 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13566
13567 if (processTemperature)
13569
13570 if (processDecay)
13571 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13572 }
13573 }
13574 }
13575
13578 {
13580 }
13581
13583 {
13586
13587 return super.GetTemperatureFreezeThreshold();
13588 }
13589
13591 {
13594
13595 return super.GetTemperatureThawThreshold();
13596 }
13597
13599 {
13602
13603 return super.GetItemOverheatThreshold();
13604 }
13605
13607 {
13609 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13610
13611 return super.GetTemperatureFreezeTime();
13612 }
13613
13615 {
13617 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13618
13619 return super.GetTemperatureThawTime();
13620 }
13621
13626
13628 {
13629 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13630 }
13631
13633 {
13634 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13635 }
13636
13639 {
13641 }
13642
13644 {
13646 }
13647
13649 {
13651 }
13652
13655 {
13656 return null;
13657 }
13658
13661 {
13662 return false;
13663 }
13664
13666 {
13668 {
13671 if (!trg)
13672 {
13674 explosive = this;
13675 }
13676
13677 explosive.PairRemote(trg);
13679
13680 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13681 trg.SetPersistentPairID(persistentID);
13682 explosive.SetPersistentPairID(persistentID);
13683
13684 return true;
13685 }
13686 return false;
13687 }
13688
13691 {
13692 float ret = 1.0;
13695 ret *= GetHealth01();
13696
13697 return ret;
13698 }
13699
13700 #ifdef DEVELOPER
13701 override void SetDebugItem()
13702 {
13703 super.SetDebugItem();
13704 _itemBase = this;
13705 }
13706
13708 {
13709 string text = super.GetDebugText();
13710
13712 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13713
13714 return text;
13715 }
13716 #endif
13717
13719 {
13720 return true;
13721 }
13722
13724
13726
13728 {
13731 }
13732
13733
13741
13757}
13758
13760{
13762 if (entity)
13763 {
13764 bool is_item = entity.IsInherited(
ItemBase);
13765 if (is_item && full_quantity)
13766 {
13769 }
13770 }
13771 else
13772 {
13774 return NULL;
13775 }
13776 return entity;
13777}
13778
13780{
13781 if (item)
13782 {
13783 if (health > 0)
13784 item.SetHealth("", "", health);
13785
13786 if (item.CanHaveTemperature())
13787 {
13789 if (item.CanFreeze())
13790 item.SetFrozen(false);
13791 }
13792
13793 if (item.HasEnergyManager())
13794 {
13795 if (quantity >= 0)
13796 {
13797 item.GetCompEM().SetEnergy0To1(quantity);
13798 }
13799 else
13800 {
13802 }
13803 }
13804 else if (item.IsMagazine())
13805 {
13806 Magazine mag = Magazine.Cast(item);
13807 if (quantity >= 0)
13808 {
13809 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13810 }
13811 else
13812 {
13814 }
13815
13816 }
13817 else
13818 {
13819 if (quantity >= 0)
13820 {
13821 item.SetQuantityNormalized(quantity, false);
13822 }
13823 else
13824 {
13826 }
13827
13828 }
13829 }
13830}
13831
13832#ifdef DEVELOPER
13834#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.