8970{
8972 {
8973 return true;
8974 }
8975};
8976
8977
8978
8980{
8984
8986
8989
8990
8991
8992
8993
9002
9008
9013
9018
9039 protected bool m_IsResultOfSplit
9040
9042
9047
9048
9049
9051
9055
9056
9057
9059
9062
9063
9064
9070
9071
9079
9082
9083
9085
9086
9088
9089
9094
9095
9100
9101
9103
9104
9106 {
9111
9112 if (!
GetGame().IsDedicatedServer())
9113 {
9115 {
9117
9119 {
9121 }
9122 }
9123
9126 }
9127
9128 m_OldLocation = null;
9129
9131 {
9133 }
9134
9135 if (ConfigIsExisting("headSelectionsToHide"))
9136 {
9139 }
9140
9142 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9143 {
9145 }
9146
9148
9149 m_IsResultOfSplit = false;
9150
9152 }
9153
9155 {
9156 super.InitItemVariables();
9157
9163 m_Count = ConfigGetInt(
"count");
9164
9167
9172
9175
9180
9192
9196
9197
9200 if (ConfigIsExisting("canBeSplit"))
9201 {
9204 }
9205
9207 if (ConfigIsExisting("itemBehaviour"))
9209
9210
9213 RegisterNetSyncVariableInt("m_VarLiquidType");
9214 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9215
9216 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9217 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9218 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9219
9220 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9221 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9222 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9223 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9224
9225 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9226 RegisterNetSyncVariableBool("m_IsTakeable");
9227 RegisterNetSyncVariableBool("m_IsHologram");
9228
9231 {
9234 }
9235
9237
9239 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9241
9242 }
9243
9245 {
9247 }
9248
9250 {
9253 {
9258 }
9259 }
9260
9261 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9262 {
9264 {
9267 }
9268
9270 }
9271
9273 {
9279 }
9280
9282
9284 {
9286
9287 if (!action)
9288 {
9289 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9290 return;
9291 }
9292
9294 if (!ai)
9295 {
9297 return;
9298 }
9299
9301 if (!action_array)
9302 {
9303 action_array = new array<ActionBase_Basic>;
9305 }
9306 if (LogManager.IsActionLogEnable())
9307 {
9308 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9309 }
9310
9311 if (action_array.Find(action) != -1)
9312 {
9313 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9314 }
9315 else
9316 {
9317 action_array.Insert(action);
9318 }
9319 }
9320
9322 {
9324 ActionBase action = player.GetActionManager().GetAction(actionName);
9327
9328 if (action_array)
9329 {
9330 action_array.RemoveItem(action);
9331 }
9332 }
9333
9334
9335
9337 {
9338 ActionOverrideData overrideData = new ActionOverrideData();
9342
9344 if (!actionMap)
9345 {
9348 }
9349
9350 actionMap.Insert(this.
Type(), overrideData);
9351
9352 }
9353
9355
9357
9358
9360 {
9363
9366
9367 string config_to_search = "CfgVehicles";
9368 string muzzle_owner_config;
9369
9371 {
9372 if (IsInherited(Weapon))
9373 config_to_search = "CfgWeapons";
9374
9375 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9376
9377 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9378
9380
9381 if (config_OnFire_subclass_count > 0)
9382 {
9383 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9384
9385 for (int i = 0; i < config_OnFire_subclass_count; i++)
9386 {
9387 string particle_class = "";
9389 string config_OnFire_entry = config_OnFire_class + particle_class;
9390 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9391 WPOF_array.Insert(WPOF);
9392 }
9393
9394
9396 }
9397 }
9398
9400 {
9401 config_to_search = "CfgWeapons";
9402 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9403
9404 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9405
9407
9408 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9409 {
9410 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9411
9412 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9413 {
9414 string particle_class2 = "";
9416 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9417 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9418 WPOBE_array.Insert(WPOBE);
9419 }
9420
9421
9423 }
9424 }
9425 }
9426
9427
9429 {
9432
9434 {
9435 string config_to_search = "CfgVehicles";
9436
9437 if (IsInherited(Weapon))
9438 config_to_search = "CfgWeapons";
9439
9440 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9441 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9442
9443 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9444 {
9445
9447
9449 {
9451 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9453 return;
9454 }
9455
9458
9459
9460
9462 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9463
9464 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9465 {
9466 string particle_class = "";
9468 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9470
9471 if (entry_type == CT_CLASS)
9472 {
9473 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9474 WPOOH_array.Insert(WPOF);
9475 }
9476 }
9477
9478
9480 }
9481 }
9482 }
9483
9485 {
9487 }
9488
9490 {
9492 {
9494
9497
9500
9501 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9502 }
9503 }
9504
9506 {
9508 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9509
9511 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9512
9514 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9515
9517 {
9519 }
9520 }
9521
9523 {
9525 }
9526
9528 {
9531 else
9533
9535 {
9538 }
9539 else
9540 {
9543
9546 }
9547
9549 }
9550
9552 {
9554 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9555 }
9556
9558 {
9560 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9562 }
9563
9565 {
9567 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9568 }
9569
9571 {
9574
9575 OverheatingParticle OP = new OverheatingParticle();
9580
9582 }
9583
9585 {
9588
9589 return -1;
9590 }
9591
9593 {
9595 {
9598
9599 for (int i = count; i > 0; --i)
9600 {
9601 int id = i - 1;
9604
9607
9608 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9609 {
9610 if (p)
9611 {
9614 }
9615 }
9616 }
9617 }
9618 }
9619
9621 {
9623 {
9625 {
9626 int id = i - 1;
9628
9629 if (OP)
9630 {
9632
9633 if (p)
9634 {
9636 }
9637
9638 delete OP;
9639 }
9640 }
9641
9644 }
9645 }
9646
9649 {
9650 return 0.0;
9651 }
9652
9653
9655 {
9656 return 250;
9657 }
9658
9660 {
9661 return 0;
9662 }
9663
9666 {
9668 return true;
9669
9670 return false;
9671 }
9672
9675 {
9678
9680 {
9682 }
9683 else
9684 {
9685
9687 }
9688
9690 }
9691
9698 {
9699 return -1;
9700 }
9701
9702
9703
9704
9706 {
9708 {
9710 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9711
9712 if (r_index >= 0)
9713 {
9714 InventoryLocation r_il = new InventoryLocation;
9715 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9716
9717 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9720 {
9721 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9722 }
9724 {
9725 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9726 }
9727
9728 }
9729
9730 player.GetHumanInventory().ClearUserReservedLocation(this);
9731 }
9732
9735 }
9736
9737
9738
9739
9741 {
9742 return ItemBase.m_DebugActionsMask;
9743 }
9744
9746 {
9747 return ItemBase.m_DebugActionsMask & mask;
9748 }
9749
9751 {
9752 ItemBase.m_DebugActionsMask = mask;
9753 }
9754
9756 {
9757 ItemBase.m_DebugActionsMask |= mask;
9758 }
9759
9761 {
9762 ItemBase.m_DebugActionsMask &= ~mask;
9763 }
9764
9766 {
9768 {
9770 }
9771 else
9772 {
9774 }
9775 }
9776
9777
9779 {
9780 if (GetEconomyProfile())
9781 {
9782 float q_max = GetEconomyProfile().GetQuantityMax();
9783 if (q_max > 0)
9784 {
9785 float q_min = GetEconomyProfile().GetQuantityMin();
9786 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9787
9789 {
9790 ComponentEnergyManager comp = GetCompEM();
9792 {
9794 }
9795 }
9797 {
9799
9800 }
9801
9802 }
9803 }
9804 }
9805
9808 {
9809 EntityAI parent = GetHierarchyParent();
9810
9811 if (parent)
9812 {
9813 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9814 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9815 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9816 }
9817 }
9818
9821 {
9822 EntityAI parent = GetHierarchyParent();
9823
9824 if (parent)
9825 {
9826 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9827 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9828 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9829 }
9830 }
9831
9833 {
9834
9835
9836
9837
9839
9841 {
9842 if (ScriptInputUserData.CanStoreInputUserData())
9843 {
9844 ScriptInputUserData ctx = new ScriptInputUserData;
9850 ctx.
Write(use_stack_max);
9853
9855 {
9856 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9857 }
9858 }
9859 }
9860 else if (!
GetGame().IsMultiplayer())
9861 {
9863 }
9864 }
9865
9867 {
9869 }
9870
9872 {
9874 }
9875
9877 {
9879 }
9880
9882 {
9883
9884 return false;
9885 }
9886
9888 {
9889 return false;
9890 }
9891
9895 {
9896 return false;
9897 }
9898
9900 {
9901 return "";
9902 }
9903
9905
9907 {
9908 return false;
9909 }
9910
9912 {
9913 return true;
9914 }
9915
9916
9917
9919 {
9920 return true;
9921 }
9922
9924 {
9925 return true;
9926 }
9927
9929 {
9930 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9932 }
9933
9935 {
9937 }
9938
9940 {
9942 if (!is_being_placed)
9944 SetSynchDirty();
9945 }
9946
9947
9949
9951 {
9953 }
9954
9956 {
9958 }
9959
9961 {
9962 return 1;
9963 }
9964
9966 {
9967 return false;
9968 }
9969
9971 {
9973 SetSynchDirty();
9974 }
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
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
10011 {
10012 super.OnMovedInsideCargo(container);
10013
10014 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10015 }
10016
10017 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10018 {
10019 super.EEItemLocationChanged(oldLoc,newLoc);
10020
10021 PlayerBase new_player = null;
10022 PlayerBase old_player = null;
10023
10024 if (newLoc.GetParent())
10025 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10026
10027 if (oldLoc.GetParent())
10028 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10029
10031 {
10032 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10033
10034 if (r_index >= 0)
10035 {
10036 InventoryLocation r_il = new InventoryLocation;
10037 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10038
10039 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10042 {
10043 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10044 }
10046 {
10047 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10048 }
10049
10050 }
10051 }
10052
10054 {
10055 if (new_player)
10056 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10057
10058 if (new_player == old_player)
10059 {
10060
10061 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10062 {
10064 {
10065 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10066 {
10067 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10068 }
10069 }
10070 else
10071 {
10072 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10073 }
10074 }
10075
10076 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10077 {
10078 int type = oldLoc.GetType();
10080 {
10081 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10082 }
10084 {
10085 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10086 }
10087 }
10088 if (!m_OldLocation)
10089 {
10090 m_OldLocation = new InventoryLocation;
10091 }
10092 m_OldLocation.Copy(oldLoc);
10093 }
10094 else
10095 {
10096 if (m_OldLocation)
10097 {
10098 m_OldLocation.Reset();
10099 }
10100 }
10101
10103 }
10104 else
10105 {
10106 if (new_player)
10107 {
10108 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10109 if (res_index >= 0)
10110 {
10111 InventoryLocation il = new InventoryLocation;
10112 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10114 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10117 {
10118 il.
GetParent().GetOnReleaseLock().Invoke(it);
10119 }
10121 {
10123 }
10124
10125 }
10126 }
10128 {
10129
10131 }
10132
10133 if (m_OldLocation)
10134 {
10135 m_OldLocation.Reset();
10136 }
10137 }
10138 }
10139
10140 override void EOnContact(IEntity other, Contact extra)
10141 {
10143 {
10144 int liquidType = -1;
10146 if (impactSpeed > 0.0)
10147 {
10149 #ifndef SERVER
10151 #else
10153 SetSynchDirty();
10154 #endif
10156 }
10157 }
10158
10159 #ifdef SERVER
10160 if (GetCompEM() && GetCompEM().IsPlugged())
10161 {
10162 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10163 GetCompEM().UnplugThis();
10164 }
10165 #endif
10166 }
10167
10169
10171 {
10173 }
10174
10176 {
10177
10178 }
10179
10181 {
10182 super.OnItemLocationChanged(old_owner, new_owner);
10183
10184 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10185 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10186
10187 if (!relatedPlayer && playerNew)
10188 relatedPlayer = playerNew;
10189
10190 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10191 {
10193 if (actionMgr)
10194 {
10195 ActionBase currentAction = actionMgr.GetRunningAction();
10196 if (currentAction)
10198 }
10199 }
10200
10201 Man ownerPlayerOld = null;
10202 Man ownerPlayerNew = null;
10203
10204 if (old_owner)
10205 {
10206 if (old_owner.
IsMan())
10207 {
10208 ownerPlayerOld = Man.Cast(old_owner);
10209 }
10210 else
10211 {
10212 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10213 }
10214 }
10215 else
10216 {
10218 {
10220
10221 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10222 {
10223 GetCompEM().UnplugThis();
10224 }
10225 }
10226 }
10227
10228 if (new_owner)
10229 {
10230 if (new_owner.
IsMan())
10231 {
10232 ownerPlayerNew = Man.Cast(new_owner);
10233 }
10234 else
10235 {
10236 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10237 }
10238 }
10239
10240 if (ownerPlayerOld != ownerPlayerNew)
10241 {
10242 if (ownerPlayerOld)
10243 {
10244 array<EntityAI> subItemsExit = new array<EntityAI>;
10246 for (int i = 0; i < subItemsExit.Count(); i++)
10247 {
10250 }
10251 }
10252
10253 if (ownerPlayerNew)
10254 {
10255 array<EntityAI> subItemsEnter = new array<EntityAI>;
10257 for (int j = 0; j < subItemsEnter.Count(); j++)
10258 {
10261 }
10262 }
10263 }
10264 else if (ownerPlayerNew != null)
10265 {
10266 PlayerBase nplayer;
10267 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10268 {
10269 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10271 for (int k = 0; k < subItemsUpdate.Count(); k++)
10272 {
10274 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10275 }
10276 }
10277 }
10278
10279 if (old_owner)
10280 old_owner.OnChildItemRemoved(this);
10281 if (new_owner)
10282 new_owner.OnChildItemReceived(this);
10283 }
10284
10285
10287 {
10288 super.EEDelete(parent);
10289 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10290 if (player)
10291 {
10293
10294 if (player.IsAlive())
10295 {
10296 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10297 if (r_index >= 0)
10298 {
10299 InventoryLocation r_il = new InventoryLocation;
10300 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10301
10302 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10305 {
10306 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10307 }
10309 {
10310 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10311 }
10312
10313 }
10314
10315 player.RemoveQuickBarEntityShortcut(this);
10316 }
10317 }
10318 }
10319
10321 {
10322 super.EEKilled(killer);
10323
10326 {
10327 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10328 {
10329 if (IsMagazine())
10330 {
10331 if (Magazine.Cast(this).GetAmmoCount() > 0)
10332 {
10334 }
10335 }
10336 else
10337 {
10339 }
10340 }
10341 }
10342 }
10343
10345 {
10346 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10347
10348 super.OnWasAttached(parent, slot_id);
10349
10352
10354 }
10355
10357 {
10358 super.OnWasDetached(parent, slot_id);
10359
10362 }
10363
10365 {
10366 int idx;
10369
10370 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10371 if (inventory_slots.Count() < 1)
10372 {
10373 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10374 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10375 }
10376 else
10377 {
10378 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10379 }
10380
10381 idx = inventory_slots.Find(slot);
10382 if (idx < 0)
10383 return "";
10384
10385 return attach_types.Get(idx);
10386 }
10387
10389 {
10390 int idx = -1;
10391 string slot;
10392
10395
10396 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10397 if (inventory_slots.Count() < 1)
10398 {
10399 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10400 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10401 }
10402 else
10403 {
10404 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10405 if (detach_types.Count() < 1)
10406 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10407 }
10408
10409 for (int i = 0; i < inventory_slots.Count(); i++)
10410 {
10411 slot = inventory_slots.Get(i);
10412 }
10413
10414 if (slot != "")
10415 {
10416 if (detach_types.Count() == 1)
10417 idx = 0;
10418 else
10419 idx = inventory_slots.Find(slot);
10420 }
10421 if (idx < 0)
10422 return "";
10423
10424 return detach_types.Get(idx);
10425 }
10426
10428 {
10429
10431
10432
10433 float min_time = 1;
10434 float max_time = 3;
10435 float delay = Math.RandomFloat(min_time, max_time);
10436
10437 explode_timer.Run(delay, this, "DoAmmoExplosion");
10438 }
10439
10441 {
10442 Magazine magazine = Magazine.Cast(this);
10443 int pop_sounds_count = 6;
10444 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10445
10446
10447 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10448 string sound_name = pop_sounds[ sound_idx ];
10450
10451
10452 magazine.ServerAddAmmoCount(-1);
10453
10454
10455 float min_temp_to_explode = 100;
10456
10457 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10458 {
10460 }
10461 }
10462
10463
10464 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10465 {
10466 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10467
10468 const int CHANCE_DAMAGE_CARGO = 4;
10469 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10470 const int CHANCE_DAMAGE_NOTHING = 2;
10471
10473 {
10474 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10475 int chances;
10476 int rnd;
10477
10478 if (GetInventory().GetCargo())
10479 {
10480 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10481 rnd = Math.RandomInt(0,chances);
10482
10483 if (rnd < CHANCE_DAMAGE_CARGO)
10484 {
10486 }
10487 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10488 {
10490 }
10491 }
10492 else
10493 {
10494 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10495 rnd = Math.RandomInt(0,chances);
10496
10497 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10498 {
10500 }
10501 }
10502 }
10503 }
10504
10506 {
10507 if (GetInventory().GetCargo())
10508 {
10509 int item_count = GetInventory().GetCargo().GetItemCount();
10510 if (item_count > 0)
10511 {
10512 int random_pick = Math.RandomInt(0, item_count);
10514 if (!item.IsExplosive())
10515 {
10516 item.AddHealth("","",damage);
10517 return true;
10518 }
10519 }
10520 }
10521 return false;
10522 }
10523
10525 {
10526 int attachment_count = GetInventory().AttachmentCount();
10527 if (attachment_count > 0)
10528 {
10529 int random_pick = Math.RandomInt(0, attachment_count);
10530 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10531 if (!attachment.IsExplosive())
10532 {
10533 attachment.AddHealth("","",damage);
10534 return true;
10535 }
10536 }
10537 return false;
10538 }
10539
10541 {
10543 }
10544
10546 {
10548 return GetInventory().CanRemoveEntity();
10549
10550 return false;
10551 }
10552
10554 {
10555
10557 return false;
10558
10559
10561 return false;
10562
10563
10564
10566 if (delta == 0)
10567 return false;
10568
10569
10570 return true;
10571 }
10572
10574 {
10576 {
10577 if (ScriptInputUserData.CanStoreInputUserData())
10578 {
10579 ScriptInputUserData ctx = new ScriptInputUserData;
10584 ctx.
Write(destination_entity);
10586 ctx.
Write(slot_id);
10588 }
10589 }
10590 else if (!
GetGame().IsMultiplayer())
10591 {
10593 }
10594 }
10595
10597 {
10598 float split_quantity_new;
10602 InventoryLocation loc = new InventoryLocation;
10603
10604 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10605 {
10607 split_quantity_new = stack_max;
10608 else
10610
10612 {
10613 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10614 if (new_item)
10615 {
10616 new_item.SetResultOfSplit(true);
10617 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10619 new_item.
SetQuantity(split_quantity_new,
false,
true);
10620 }
10621 }
10622 }
10623 else if (destination_entity && slot_id == -1)
10624 {
10625 if (quantity > stack_max)
10626 split_quantity_new = stack_max;
10627 else
10628 split_quantity_new = quantity;
10629
10631 {
10633 {
10636 }
10637
10638 if (new_item)
10639 {
10640 new_item.SetResultOfSplit(true);
10641 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10643 new_item.
SetQuantity(split_quantity_new,
false,
true);
10644 }
10645 }
10646 }
10647 else
10648 {
10649 if (stack_max != 0)
10650 {
10652 {
10654 }
10655
10656 if (split_quantity_new == 0)
10657 {
10658 if (!
GetGame().IsMultiplayer())
10659 player.PhysicalPredictiveDropItem(this);
10660 else
10661 player.ServerDropEntity(this);
10662 return;
10663 }
10664
10666 {
10668
10669 if (new_item)
10670 {
10671 new_item.SetResultOfSplit(true);
10672 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10675 new_item.PlaceOnSurface();
10676 }
10677 }
10678 }
10679 }
10680 }
10681
10683 {
10684 float split_quantity_new;
10688 InventoryLocation loc = new InventoryLocation;
10689
10690 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10691 {
10693 split_quantity_new = stack_max;
10694 else
10696
10698 {
10699 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10700 if (new_item)
10701 {
10702 new_item.SetResultOfSplit(true);
10703 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10705 new_item.
SetQuantity(split_quantity_new,
false,
true);
10706 }
10707 }
10708 }
10709 else if (destination_entity && slot_id == -1)
10710 {
10711 if (quantity > stack_max)
10712 split_quantity_new = stack_max;
10713 else
10714 split_quantity_new = quantity;
10715
10717 {
10719 {
10722 }
10723
10724 if (new_item)
10725 {
10726 new_item.SetResultOfSplit(true);
10727 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10729 new_item.
SetQuantity(split_quantity_new,
false,
true);
10730 }
10731 }
10732 }
10733 else
10734 {
10735 if (stack_max != 0)
10736 {
10738 {
10740 }
10741
10743 {
10745
10746 if (new_item)
10747 {
10748 new_item.SetResultOfSplit(true);
10749 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10752 new_item.PlaceOnSurface();
10753 }
10754 }
10755 }
10756 }
10757 }
10758
10760 {
10762 {
10763 if (ScriptInputUserData.CanStoreInputUserData())
10764 {
10765 ScriptInputUserData ctx = new ScriptInputUserData;
10770 dst.WriteToContext(ctx);
10772 }
10773 }
10774 else if (!
GetGame().IsMultiplayer())
10775 {
10777 }
10778 }
10779
10781 {
10783 {
10784 if (ScriptInputUserData.CanStoreInputUserData())
10785 {
10786 ScriptInputUserData ctx = new ScriptInputUserData;
10791 ctx.
Write(destination_entity);
10797 }
10798 }
10799 else if (!
GetGame().IsMultiplayer())
10800 {
10802 }
10803 }
10804
10806 {
10808 }
10809
10811 {
10813 float split_quantity_new;
10815 if (dst.IsValid())
10816 {
10817 int slot_id = dst.GetSlot();
10819
10820 if (quantity > stack_max)
10821 split_quantity_new = stack_max;
10822 else
10823 split_quantity_new = quantity;
10824
10826 {
10828
10829 if (new_item)
10830 {
10831 new_item.SetResultOfSplit(true);
10832 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10834 new_item.
SetQuantity(split_quantity_new,
false,
true);
10835 }
10836
10837 return new_item;
10838 }
10839 }
10840
10841 return null;
10842 }
10843
10845 {
10847 float split_quantity_new;
10849 if (destination_entity)
10850 {
10852 if (quantity > stackable)
10853 split_quantity_new = stackable;
10854 else
10855 split_quantity_new = quantity;
10856
10858 {
10859 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10860 if (new_item)
10861 {
10862 new_item.SetResultOfSplit(true);
10863 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10865 new_item.
SetQuantity(split_quantity_new,
false,
true);
10866 }
10867 }
10868 }
10869 }
10870
10872 {
10874 {
10875 if (ScriptInputUserData.CanStoreInputUserData())
10876 {
10877 ScriptInputUserData ctx = new ScriptInputUserData;
10882 ItemBase destination_entity =
this;
10883 ctx.
Write(destination_entity);
10887 }
10888 }
10889 else if (!
GetGame().IsMultiplayer())
10890 {
10892 }
10893 }
10894
10896 {
10898 float split_quantity_new;
10900 if (player)
10901 {
10903 if (quantity > stackable)
10904 split_quantity_new = stackable;
10905 else
10906 split_quantity_new = quantity;
10907
10909 {
10910 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10911 new_item =
ItemBase.Cast(in_hands);
10912 if (new_item)
10913 {
10914 new_item.SetResultOfSplit(true);
10915 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10917 new_item.SetQuantity(split_quantity_new, false, true);
10918 }
10919 }
10920 }
10921 }
10922
10924 {
10926 float split_quantity_new = Math.Floor(quantity * 0.5);
10927
10929 return;
10930
10932
10933 if (new_item)
10934 {
10935 if (new_item.GetQuantityMax() < split_quantity_new)
10936 {
10937 split_quantity_new = new_item.GetQuantityMax();
10938 }
10939
10940 new_item.SetResultOfSplit(true);
10941 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10942
10944 {
10947 }
10948 else
10949 {
10951 new_item.
SetQuantity(split_quantity_new,
false,
true);
10952 }
10953 }
10954 }
10955
10957 {
10959 float split_quantity_new = Math.Floor(quantity / 2);
10960
10962 return;
10963
10964 InventoryLocation invloc = new InventoryLocation;
10966
10968 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10969
10970 if (new_item)
10971 {
10972 if (new_item.GetQuantityMax() < split_quantity_new)
10973 {
10974 split_quantity_new = new_item.GetQuantityMax();
10975 }
10977 {
10980 }
10981 else if (split_quantity_new > 1)
10982 {
10984 new_item.
SetQuantity(split_quantity_new,
false,
true);
10985 }
10986 }
10987 }
10988
10991 {
10992 SetWeightDirty();
10994
10995 if (parent)
10996 parent.OnAttachmentQuantityChangedEx(this, delta);
10997
10999 {
11001 {
11003 }
11005 {
11006 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11008 }
11009 }
11010
11011 }
11012
11015 {
11016
11017 }
11018
11021 {
11023 }
11024
11026 {
11027 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11028
11030 {
11031 if (newLevel == GameConstants.STATE_RUINED)
11032 {
11034 EntityAI parent = GetHierarchyParent();
11035 if (parent && parent.IsFireplace())
11036 {
11037 CargoBase cargo = GetInventory().GetCargo();
11038 if (cargo)
11039 {
11041 {
11043 }
11044 }
11045 }
11046 }
11047
11049 {
11050
11052 return;
11053 }
11054
11055 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11056 {
11058 }
11059 }
11060 }
11061
11062
11064 {
11065 super.OnRightClick();
11066
11068 {
11070 {
11071 if (ScriptInputUserData.CanStoreInputUserData())
11072 {
11073 EntityAI root = GetHierarchyRoot();
11074 Man playerOwner = GetHierarchyRootPlayer();
11075 InventoryLocation dst = new InventoryLocation;
11076
11077
11078 if (!playerOwner && root && root == this)
11079 {
11081 }
11082 else
11083 {
11084
11085 GetInventory().GetCurrentInventoryLocation(dst);
11087 {
11090 {
11092 }
11093 else
11094 {
11096
11097
11098 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11099 {
11101 }
11102 else
11103 {
11104 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11105 }
11106 }
11107 }
11108 }
11109
11110 ScriptInputUserData ctx = new ScriptInputUserData;
11118 }
11119 }
11120 else if (!
GetGame().IsMultiplayer())
11121 {
11123 }
11124 }
11125 }
11126
11128 {
11129 if (root)
11130 {
11131 vector m4[4];
11132 root.GetTransform(m4);
11133 dst.SetGround(this, m4);
11134 }
11135 else
11136 {
11137 GetInventory().GetCurrentInventoryLocation(dst);
11138 }
11139 }
11140
11141 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11142 {
11143
11144 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11145 return false;
11146
11147 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11148 return false;
11149
11150
11152 return false;
11153
11154
11155 Magazine mag = Magazine.Cast(this);
11156 if (mag)
11157 {
11158 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11159 return false;
11160
11161 if (stack_max_limit)
11162 {
11163 Magazine other_mag = Magazine.Cast(other_item);
11164 if (other_item)
11165 {
11166 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11167 return false;
11168 }
11169
11170 }
11171 }
11172 else
11173 {
11174
11176 return false;
11177
11179 return false;
11180 }
11181
11182 PlayerBase player = null;
11183 if (CastTo(player, GetHierarchyRootPlayer()))
11184 {
11185 if (player.GetInventory().HasAttachment(this))
11186 return false;
11187
11188 if (player.IsItemsToDelete())
11189 return false;
11190 }
11191
11192 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11193 return false;
11194
11195 int slotID;
11197 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11198 return false;
11199
11200 return true;
11201 }
11202
11204 {
11206 }
11207
11209 {
11210 return m_IsResultOfSplit;
11211 }
11212
11214 {
11215 m_IsResultOfSplit = value;
11216 }
11217
11219 {
11221 }
11222
11224 {
11225 float other_item_quantity = other_item.GetQuantity();
11226 float this_free_space;
11227
11229
11231
11232 if (other_item_quantity > this_free_space)
11233 {
11234 return this_free_space;
11235 }
11236 else
11237 {
11238 return other_item_quantity;
11239 }
11240 }
11241
11243 {
11245 }
11246
11248 {
11250 return;
11251
11252 if (!IsMagazine() && other_item)
11253 {
11255 if (quantity_used != 0)
11256 {
11257 float hp1 = GetHealth01("","");
11258 float hp2 = other_item.GetHealth01("","");
11259 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11260 hpResult = hpResult / (
GetQuantity() + quantity_used);
11261
11262 hpResult *= GetMaxHealth();
11263 Math.Round(hpResult);
11264 SetHealth("", "Health", hpResult);
11265
11267 other_item.AddQuantity(-quantity_used);
11268 }
11269 }
11271 }
11272
11274 {
11275 #ifdef SERVER
11276 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11277 GetHierarchyParent().IncreaseLifetimeUp();
11278 #endif
11279 };
11280
11282 {
11283 PlayerBase p = PlayerBase.Cast(player);
11284
11285 array<int> recipesIds = p.m_Recipes;
11286 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11287 if (moduleRecipesManager)
11288 {
11289 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11290 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11291 }
11292
11293 for (int i = 0;i < recipesIds.Count(); i++)
11294 {
11295 int key = recipesIds.Get(i);
11296 string recipeName = moduleRecipesManager.GetRecipeName(key);
11298 }
11299 }
11300
11301
11302 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11303 {
11304 super.GetDebugActions(outputList);
11305
11306
11312
11313
11318
11323
11324
11328
11329
11331 {
11335 }
11336
11339
11340
11344
11346
11347 InventoryLocation loc = new InventoryLocation();
11348 GetInventory().GetCurrentInventoryLocation(loc);
11350 {
11351 if (Gizmo_IsSupported())
11354 }
11355
11357 }
11358
11359
11360
11361
11363 {
11364 super.OnAction(action_id, player, ctx);
11365
11367 {
11368 switch (action_id)
11369 {
11372 return true;
11375 return true;
11376 }
11377 }
11378
11380 {
11381 switch (action_id)
11382 {
11384 Delete();
11385 return true;
11386 }
11387 }
11388
11389 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11390 {
11391 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11392 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11393 PlayerBase p = PlayerBase.Cast(player);
11394 if (
EActions.RECIPES_RANGE_START < 1000)
11395 {
11396 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11397 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11398 }
11399 }
11400 #ifndef SERVER
11401 else if (action_id ==
EActions.WATCH_PLAYER)
11402 {
11403 PluginDeveloper.SetDeveloperItemClientEx(player);
11404 }
11405 #endif
11407 {
11408 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11409 {
11410 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11411 OnDebugButtonPressServer(id + 1);
11412 }
11413
11414 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11415 {
11416 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11418 }
11419
11420 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11421 {
11422 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11424 }
11425
11426 else if (action_id ==
EActions.ADD_QUANTITY)
11427 {
11428 if (IsMagazine())
11429 {
11430 Magazine mag = Magazine.Cast(this);
11431 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11432 }
11433 else
11434 {
11436 }
11437
11438 if (m_EM)
11439 {
11440 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11441 }
11442
11443 }
11444
11445 else if (action_id ==
EActions.REMOVE_QUANTITY)
11446 {
11447 if (IsMagazine())
11448 {
11449 Magazine mag2 = Magazine.Cast(this);
11450 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11451 }
11452 else
11453 {
11455 }
11456 if (m_EM)
11457 {
11458 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11459 }
11460
11461 }
11462
11463 else if (action_id ==
EActions.SET_QUANTITY_0)
11464 {
11466
11467 if (m_EM)
11468 {
11469 m_EM.SetEnergy(0);
11470 }
11471 }
11472
11473 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11474 {
11476
11477 if (m_EM)
11478 {
11479 m_EM.SetEnergy(m_EM.GetEnergyMax());
11480 }
11481 }
11482
11483 else if (action_id ==
EActions.ADD_HEALTH)
11484 {
11485 AddHealth("","",GetMaxHealth("","Health")/5);
11486 }
11487 else if (action_id ==
EActions.REMOVE_HEALTH)
11488 {
11489 AddHealth("","",-GetMaxHealth("","Health")/5);
11490 }
11491 else if (action_id ==
EActions.DESTROY_HEALTH)
11492 {
11493 SetHealth01("","",0);
11494 }
11495 else if (action_id ==
EActions.WATCH_ITEM)
11496 {
11498 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11499 #ifdef DEVELOPER
11500 SetDebugDeveloper_item(this);
11501 #endif
11502 }
11503
11504 else if (action_id ==
EActions.ADD_TEMPERATURE)
11505 {
11506 AddTemperature(20);
11507
11508 }
11509
11510 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11511 {
11512 AddTemperature(-20);
11513
11514 }
11515
11516 else if (action_id ==
EActions.FLIP_FROZEN)
11517 {
11518 SetFrozen(!GetIsFrozen());
11519
11520 }
11521
11522 else if (action_id ==
EActions.ADD_WETNESS)
11523 {
11525
11526 }
11527
11528 else if (action_id ==
EActions.REMOVE_WETNESS)
11529 {
11531
11532 }
11533
11534 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11535 {
11538
11539
11540 }
11541
11542 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11543 {
11546 }
11547
11548 else if (action_id ==
EActions.MAKE_SPECIAL)
11549 {
11550 auto debugParams = DebugSpawnParams.WithPlayer(player);
11551 OnDebugSpawnEx(debugParams);
11552 }
11553
11554 }
11555
11556
11557 return false;
11558 }
11559
11560
11561
11562
11566
11569
11570
11571
11573 {
11574 return false;
11575 }
11576
11577
11579 {
11580 return true;
11581 }
11582
11583
11585 {
11586 return true;
11587 }
11588
11589
11590
11592 {
11593 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11595 }
11596
11599 {
11600 return null;
11601 }
11602
11604 {
11605 return false;
11606 }
11607
11609 {
11610 return false;
11611 }
11612
11616
11617
11619 {
11620 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11621 return module_repairing.CanRepair(this, item_repair_kit);
11622 }
11623
11624
11625 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11626 {
11627 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11628 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11629 }
11630
11631
11633 {
11634
11635
11636
11637
11638
11639
11640
11641
11642 return 1;
11643 }
11644
11645
11646
11648 {
11650 }
11651
11652
11653
11655 {
11657 }
11658
11659
11668 {
11669 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11670
11671 if (player)
11672 {
11673 player.MessageStatus(text);
11674 }
11675 }
11676
11677
11686 {
11687 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11688
11689 if (player)
11690 {
11691 player.MessageAction(text);
11692 }
11693 }
11694
11695
11704 {
11705 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11706
11707 if (player)
11708 {
11709 player.MessageFriendly(text);
11710 }
11711 }
11712
11713
11722 {
11723 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11724
11725 if (player)
11726 {
11727 player.MessageImportant(text);
11728 }
11729 }
11730
11732 {
11733 return true;
11734 }
11735
11736
11737 override bool KindOf(
string tag)
11738 {
11739 bool found = false;
11740 string item_name = this.
GetType();
11743
11744 int array_size = item_tag_array.Count();
11745 for (int i = 0; i < array_size; i++)
11746 {
11747 if (item_tag_array.Get(i) == tag)
11748 {
11749 found = true;
11750 break;
11751 }
11752 }
11753 return found;
11754 }
11755
11756
11758 {
11759
11760 super.OnRPC(sender, rpc_type,ctx);
11761
11762
11763 switch (rpc_type)
11764 {
11765 #ifndef SERVER
11766 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11767 Param2<bool, string> p = new Param2<bool, string>(false, "");
11768
11770 return;
11771
11772 bool play = p.param1;
11773 string soundSet = p.param2;
11774
11775 if (play)
11776 {
11778 {
11780 {
11782 }
11783 }
11784 else
11785 {
11787 }
11788 }
11789 else
11790 {
11792 }
11793
11794 break;
11795 #endif
11796
11797 }
11798
11800 {
11802 }
11803 }
11804
11805
11806
11807
11809 {
11810 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11811 return plugin.GetID(
name);
11812 }
11813
11815 {
11816 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11817 return plugin.GetName(id);
11818 }
11819
11822 {
11823
11824
11825 int varFlags;
11826 if (!ctx.
Read(varFlags))
11827 return;
11828
11829 if (varFlags & ItemVariableFlags.FLOAT)
11830 {
11832 }
11833 }
11834
11836 {
11837
11838 super.SerializeNumericalVars(floats_out);
11839
11840
11841
11843 {
11845 }
11846
11848 {
11850 }
11851
11853 {
11855 }
11856
11858 {
11863 }
11864
11866 {
11868 }
11869 }
11870
11872 {
11873
11874 super.DeSerializeNumericalVars(floats);
11875
11876
11877 int index = 0;
11878 int mask = Math.Round(floats.Get(index));
11879
11880 index++;
11881
11883 {
11885 {
11887 }
11888 else
11889 {
11890 float quantity = floats.Get(index);
11891 SetQuantity(quantity,
true,
false,
false,
false);
11892 }
11893 index++;
11894 }
11895
11897 {
11898 float wet = floats.Get(index);
11900 index++;
11901 }
11902
11904 {
11905 int liquidtype = Math.Round(floats.Get(index));
11907 index++;
11908 }
11909
11911 {
11913 index++;
11915 index++;
11917 index++;
11919 index++;
11920 }
11921
11923 {
11924 int cleanness = Math.Round(floats.Get(index));
11926 index++;
11927 }
11928 }
11929
11931 {
11932 super.WriteVarsToCTX(ctx);
11933
11934
11936 {
11938 }
11939
11941 {
11943 }
11944
11946 {
11948 }
11949
11951 {
11952 int r,g,b,a;
11958 }
11959
11961 {
11963 }
11964 }
11965
11967 {
11968 if (!super.ReadVarsFromCTX(ctx,version))
11969 return false;
11970
11971 int intValue;
11972 float value;
11973
11974 if (version < 140)
11975 {
11976 if (!ctx.
Read(intValue))
11977 return false;
11978
11979 m_VariablesMask = intValue;
11980 }
11981
11983 {
11984 if (!ctx.
Read(value))
11985 return false;
11986
11988 {
11990 }
11991 else
11992 {
11994 }
11995 }
11996
11997 if (version < 140)
11998 {
12000 {
12001 if (!ctx.
Read(value))
12002 return false;
12003 SetTemperatureDirect(value);
12004 }
12005 }
12006
12008 {
12009 if (!ctx.
Read(value))
12010 return false;
12012 }
12013
12015 {
12016 if (!ctx.
Read(intValue))
12017 return false;
12019 }
12020
12022 {
12023 int r,g,b,a;
12025 return false;
12027 return false;
12029 return false;
12031 return false;
12032
12034 }
12035
12037 {
12038 if (!ctx.
Read(intValue))
12039 return false;
12041 }
12042
12043 if (version >= 138 && version < 140)
12044 {
12046 {
12047 if (!ctx.
Read(intValue))
12048 return false;
12049 SetFrozen(intValue);
12050 }
12051 }
12052
12053 return true;
12054 }
12055
12056
12058 {
12061 {
12063 }
12064
12065 if (!super.OnStoreLoad(ctx, version))
12066 {
12068 return false;
12069 }
12070
12071 if (version >= 114)
12072 {
12073 bool hasQuickBarIndexSaved;
12074
12075 if (!ctx.
Read(hasQuickBarIndexSaved))
12076 {
12078 return false;
12079 }
12080
12081 if (hasQuickBarIndexSaved)
12082 {
12083 int itmQBIndex;
12084
12085
12086 if (!ctx.
Read(itmQBIndex))
12087 {
12089 return false;
12090 }
12091
12092 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12093 if (itmQBIndex != -1 && parentPlayer)
12094 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12095 }
12096 }
12097 else
12098 {
12099
12100 PlayerBase player;
12101 int itemQBIndex;
12102 if (version ==
int.
MAX)
12103 {
12104 if (!ctx.
Read(itemQBIndex))
12105 {
12107 return false;
12108 }
12109 }
12110 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12111 {
12112
12113 if (!ctx.
Read(itemQBIndex))
12114 {
12116 return false;
12117 }
12118 if (itemQBIndex != -1 && player)
12119 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12120 }
12121 }
12122
12123 if (version < 140)
12124 {
12125
12126 if (!LoadVariables(ctx, version))
12127 {
12129 return false;
12130 }
12131 }
12132
12133
12135 {
12137 return false;
12138 }
12139 if (version >= 132)
12140 {
12142 if (raib)
12143 {
12145 {
12147 return false;
12148 }
12149 }
12150 }
12151
12153 return true;
12154 }
12155
12156
12157
12159 {
12160 super.OnStoreSave(ctx);
12161
12162 PlayerBase player;
12163 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12164 {
12166
12167 int itemQBIndex = -1;
12168 itemQBIndex = player.FindQuickBarEntityIndex(this);
12169 ctx.
Write(itemQBIndex);
12170 }
12171 else
12172 {
12174 }
12175
12177
12179 if (raib)
12180 {
12182 }
12183 }
12184
12185
12187 {
12188 super.AfterStoreLoad();
12189
12191 {
12193 }
12194
12196 {
12199 }
12200 }
12201
12203 {
12204 super.EEOnAfterLoad();
12205
12207 {
12209 }
12210
12213 }
12214
12216 {
12217 return false;
12218 }
12219
12220
12221
12223 {
12225 {
12226 #ifdef PLATFORM_CONSOLE
12227
12229 {
12231 if (menu)
12232 {
12234 }
12235 }
12236 #endif
12237 }
12238
12240 {
12243 }
12244
12246 {
12247 SetWeightDirty();
12249 }
12251 {
12254 }
12255
12257 {
12260 }
12262 {
12265 }
12266
12267 super.OnVariablesSynchronized();
12268 }
12269
12270
12271
12273 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12274 {
12275 if (!IsServerCheck(allow_client))
12276 return false;
12277
12279 return false;
12280
12283
12284 if (value <= (min + 0.001))
12285 value = min;
12286
12287 if (value == min)
12288 {
12289 if (destroy_config)
12290 {
12291 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12292 if (dstr)
12293 {
12295 this.Delete();
12296 return true;
12297 }
12298 }
12299 else if (destroy_forced)
12300 {
12302 this.Delete();
12303 return true;
12304 }
12305
12307 }
12308
12311
12313 {
12315
12316 if (delta)
12318 }
12319
12321
12322 return false;
12323 }
12324
12325
12327 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12328 {
12330 }
12331
12333 {
12336 }
12337
12339 {
12342 }
12343
12345 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12346 {
12347 float value_clamped = Math.Clamp(value, 0, 1);
12349 SetQuantity(result, destroy_config, destroy_forced);
12350 }
12351
12352
12355 {
12357 }
12358
12360 {
12362 }
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12374 {
12375 int slot = -1;
12376 if (GetInventory())
12377 {
12378 InventoryLocation il = new InventoryLocation;
12379 GetInventory().GetCurrentInventoryLocation(il);
12381 }
12382
12384 }
12385
12387 {
12388 float quantity_max = 0;
12389
12391 {
12392 if (attSlotID != -1)
12393 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12394
12395 if (quantity_max <= 0)
12397 }
12398
12399 if (quantity_max <= 0)
12401
12402 return quantity_max;
12403 }
12404
12406 {
12408 }
12409
12411 {
12413 }
12414
12415
12417 {
12419 }
12420
12422 {
12424 }
12425
12427 {
12429 }
12430
12431
12433 {
12434
12435 float weightEx = GetWeightEx();
12436 float special = GetInventoryAndCargoWeight();
12437 return weightEx - special;
12438 }
12439
12440
12442 {
12444 }
12445
12447 {
12449 {
12450 #ifdef DEVELOPER
12451 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12452 {
12453 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12455 }
12456 #endif
12457
12458 return GetQuantity() * GetConfigWeightModified();
12459 }
12460 else if (HasEnergyManager())
12461 {
12462 #ifdef DEVELOPER
12463 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12464 {
12465 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12466 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12467 }
12468 #endif
12469 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12470 }
12471 else
12472 {
12473 #ifdef DEVELOPER
12474 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12475 {
12476 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12477 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12478 }
12479 #endif
12480 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12481 }
12482 }
12483
12486 {
12487 int item_count = 0;
12489
12490 if (GetInventory().GetCargo() != NULL)
12491 {
12492 item_count = GetInventory().GetCargo().GetItemCount();
12493 }
12494
12495 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12496 {
12497 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12498 if (item)
12499 item_count += item.GetNumberOfItems();
12500 }
12501 return item_count;
12502 }
12503
12506 {
12507 float weight = 0;
12508 float wetness = 1;
12509 if (include_wetness)
12512 {
12513 weight = wetness * m_ConfigWeight;
12514 }
12516 {
12517 weight = 1;
12518 }
12519 return weight;
12520 }
12521
12522
12523
12525 {
12526 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12527 {
12528 GameInventory inv = GetInventory();
12529 array<EntityAI> items = new array<EntityAI>;
12531 for (int i = 0; i < items.Count(); i++)
12532 {
12534 if (item)
12535 {
12537 }
12538 }
12539 }
12540 }
12541
12542
12543
12544
12546 {
12547 float energy = 0;
12548 if (HasEnergyManager())
12549 {
12550 energy = GetCompEM().GetEnergy();
12551 }
12552 return energy;
12553 }
12554
12555
12557 {
12558 super.OnEnergyConsumed();
12559
12561 }
12562
12564 {
12565 super.OnEnergyAdded();
12566
12568 }
12569
12570
12572 {
12573 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12574 {
12576 {
12577 float energy_0to1 = GetCompEM().GetEnergy0To1();
12579 }
12580 }
12581 }
12582
12583
12585 {
12586 return ConfigGetFloat("heatIsolation");
12587 }
12588
12590 {
12592 }
12593
12595 {
12596 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12597 if (
GetGame().ConfigIsExisting(paramPath))
12599
12600 return 0.0;
12601 }
12602
12604 {
12605 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12606 if (
GetGame().ConfigIsExisting(paramPath))
12608
12609 return 0.0;
12610 }
12611
12612 override void SetWet(
float value,
bool allow_client =
false)
12613 {
12614 if (!IsServerCheck(allow_client))
12615 return;
12616
12619
12621
12622 m_VarWet = Math.Clamp(value, min, max);
12623
12625 {
12628 }
12629 }
12630
12631 override void AddWet(
float value)
12632 {
12634 }
12635
12637 {
12639 }
12640
12642 {
12644 }
12645
12647 {
12649 }
12650
12652 {
12654 }
12655
12657 {
12659 }
12660
12661 override void OnWetChanged(
float newVal,
float oldVal)
12662 {
12665 if (newLevel != oldLevel)
12666 {
12668 }
12669 }
12670
12672 {
12673 SetWeightDirty();
12674 }
12675
12677 {
12678 return GetWetLevelInternal(
m_VarWet);
12679 }
12680
12681
12682
12684 {
12686 }
12687
12689 {
12691 }
12692
12694 {
12696 }
12697
12699 {
12701 }
12702
12703
12704
12706 {
12707 if (ConfigIsExisting("itemModelLength"))
12708 {
12709 return ConfigGetFloat("itemModelLength");
12710 }
12711 return 0;
12712 }
12713
12715 {
12716 if (ConfigIsExisting("itemAttachOffset"))
12717 {
12718 return ConfigGetFloat("itemAttachOffset");
12719 }
12720 return 0;
12721 }
12722
12723 override void SetCleanness(
int value,
bool allow_client =
false)
12724 {
12725 if (!IsServerCheck(allow_client))
12726 return;
12727
12729
12731
12734 }
12735
12737 {
12739 }
12740
12742 {
12743 return true;
12744 }
12745
12746
12747
12748
12750 {
12752 }
12753
12755 {
12757 }
12758
12759
12760
12761
12762 override void SetColor(
int r,
int g,
int b,
int a)
12763 {
12769 }
12771 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12772 {
12777 }
12778
12780 {
12782 }
12783
12786 {
12787 int r,g,b,a;
12789 r = r/255;
12790 g = g/255;
12791 b = b/255;
12792 a = a/255;
12793 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12794 }
12795
12796
12797
12798 override void SetLiquidType(
int value,
bool allow_client =
false)
12799 {
12800 if (!IsServerCheck(allow_client))
12801 return;
12802
12807 }
12808
12810 {
12811 return ConfigGetInt("varLiquidTypeInit");
12812 }
12813
12815 {
12817 }
12818
12820 {
12822 SetFrozen(false);
12823 }
12824
12827 {
12828 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12829 }
12830
12831
12834 {
12835 PlayerBase nplayer;
12836 if (PlayerBase.CastTo(nplayer, player))
12837 {
12839
12840 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12841 }
12842 }
12843
12844
12847 {
12848 PlayerBase nplayer;
12849 if (PlayerBase.CastTo(nplayer,player))
12850 {
12851
12852 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12853
12854 }
12855
12856
12857 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12858
12859
12860 if (HasEnergyManager())
12861 {
12862 GetCompEM().UpdatePlugState();
12863 }
12864 }
12865
12866
12868 {
12869 super.OnPlacementStarted(player);
12870
12872 }
12873
12874 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12875 {
12877 {
12878 m_AdminLog.OnPlacementComplete(player,
this);
12879 }
12880
12881 super.OnPlacementComplete(player, position, orientation);
12882 }
12883
12884
12885
12886
12887
12889 {
12891 {
12892 return true;
12893 }
12894 else
12895 {
12896 return false;
12897 }
12898 }
12899
12900
12902 {
12904 {
12906 }
12907 }
12908
12909
12911 {
12913 }
12914
12916 {
12918 }
12919
12920 override void InsertAgent(
int agent,
float count = 1)
12921 {
12922 if (count < 1)
12923 return;
12924
12926 }
12927
12930 {
12932 }
12933
12934
12936 {
12938 }
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12982 {
12984 return false;
12985 return true;
12986 }
12987
12989 {
12990
12992 }
12993
12994
12997 {
12998 super.CheckForRoofLimited(timeTresholdMS);
12999
13001 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13002 {
13003 m_PreviousRoofTestTime = time;
13004 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13005 }
13006 }
13007
13008
13010 {
13012 {
13013 return 0;
13014 }
13015
13016 if (GetInventory().GetAttachmentSlotsCount() != 0)
13017 {
13018 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13019 if (filter)
13020 return filter.GetProtectionLevel(type, false, system);
13021 else
13022 return 0;
13023 }
13024
13025 string subclassPath, entryName;
13026
13027 switch (type)
13028 {
13030 entryName = "biological";
13031 break;
13033 entryName = "chemical";
13034 break;
13035 default:
13036 entryName = "biological";
13037 break;
13038 }
13039
13040 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13041
13043 }
13044
13045
13046
13049 {
13050 if (!IsMagazine())
13052
13054 }
13055
13056
13057
13058
13059
13064 {
13065 return true;
13066 }
13067
13069 {
13071 }
13072
13073
13074
13075
13076
13078 {
13079 if (parent)
13080 {
13081 if (parent.IsInherited(DayZInfected))
13082 return true;
13083
13084 if (!parent.IsRuined())
13085 return true;
13086 }
13087
13088 return true;
13089 }
13090
13092 {
13093 if (!super.CanPutAsAttachment(parent))
13094 {
13095 return false;
13096 }
13097
13098 if (!IsRuined() && !parent.IsRuined())
13099 {
13100 return true;
13101 }
13102
13103 return false;
13104 }
13105
13107 {
13108
13109
13110
13111
13112 return super.CanReceiveItemIntoCargo(item);
13113 }
13114
13116 {
13117
13118
13119
13120
13121 GameInventory attachmentInv = attachment.GetInventory();
13123 {
13124 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13125 return false;
13126 }
13127
13128 InventoryLocation loc = new InventoryLocation();
13129 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13130 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13131 return false;
13132
13133 return super.CanReceiveAttachment(attachment, slotId);
13134 }
13135
13137 {
13138 if (!super.CanReleaseAttachment(attachment))
13139 return false;
13140
13141 return GetInventory().AreChildrenAccessible();
13142 }
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13165 {
13166 int id = muzzle_owner.GetMuzzleID();
13167 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13168
13169 if (WPOF_array)
13170 {
13171 for (int i = 0; i < WPOF_array.Count(); i++)
13172 {
13173 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13174
13175 if (WPOF)
13176 {
13177 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13178 }
13179 }
13180 }
13181 }
13182
13183
13185 {
13186 int id = muzzle_owner.GetMuzzleID();
13188
13189 if (WPOBE_array)
13190 {
13191 for (int i = 0; i < WPOBE_array.Count(); i++)
13192 {
13193 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13194
13195 if (WPOBE)
13196 {
13197 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13198 }
13199 }
13200 }
13201 }
13202
13203
13205 {
13206 int id = muzzle_owner.GetMuzzleID();
13207 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13208
13209 if (WPOOH_array)
13210 {
13211 for (int i = 0; i < WPOOH_array.Count(); i++)
13212 {
13213 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13214
13215 if (WPOOH)
13216 {
13217 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13218 }
13219 }
13220 }
13221 }
13222
13223
13225 {
13226 int id = muzzle_owner.GetMuzzleID();
13227 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13228
13229 if (WPOOH_array)
13230 {
13231 for (int i = 0; i < WPOOH_array.Count(); i++)
13232 {
13233 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13234
13235 if (WPOOH)
13236 {
13237 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13238 }
13239 }
13240 }
13241 }
13242
13243
13245 {
13246 int id = muzzle_owner.GetMuzzleID();
13247 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13248
13249 if (WPOOH_array)
13250 {
13251 for (int i = 0; i < WPOOH_array.Count(); i++)
13252 {
13253 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13254
13255 if (WPOOH)
13256 {
13257 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13258 }
13259 }
13260 }
13261 }
13262
13263
13264
13266 {
13268 {
13269 return true;
13270 }
13271
13272 return false;
13273 }
13274
13276 {
13278 {
13279 return true;
13280 }
13281
13282 return false;
13283 }
13284
13286 {
13288 {
13289 return true;
13290 }
13291
13292 return false;
13293 }
13294
13296 {
13297 return false;
13298 }
13299
13302 {
13303 return UATimeSpent.DEFAULT_DEPLOY;
13304 }
13305
13306
13307
13308
13310 {
13312 SetSynchDirty();
13313 }
13314
13316 {
13318 }
13319
13320
13322 {
13323 return false;
13324 }
13325
13328 {
13329 string att_type = "None";
13330
13331 if (ConfigIsExisting("soundAttType"))
13332 {
13333 att_type = ConfigGetString("soundAttType");
13334 }
13335
13337 }
13338
13340 {
13342 }
13343
13344
13345
13346
13347
13353
13355 {
13358
13360 }
13361
13362
13364 {
13366 return;
13367
13369
13372
13375
13376 SoundParameters params = new SoundParameters();
13380 }
13381
13382
13384 {
13386 return;
13387
13389 SetSynchDirty();
13390
13393 }
13394
13395
13397 {
13399 return;
13400
13402 SetSynchDirty();
13403
13406 }
13407
13409 {
13411 }
13412
13414 {
13416 }
13417
13420 {
13421 if (!
GetGame().IsDedicatedServer())
13422 {
13423 if (ConfigIsExisting("attachSoundSet"))
13424 {
13425 string cfg_path = "";
13426 string soundset = "";
13427 string type_name =
GetType();
13428
13431 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13432 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13433
13434 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13435 {
13436 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13437 {
13438 if (cfg_slot_array[i] == slot_type)
13439 {
13440 soundset = cfg_soundset_array[i];
13441 break;
13442 }
13443 }
13444 }
13445
13446 if (soundset != "")
13447 {
13448 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13450 }
13451 }
13452 }
13453 }
13454
13456 {
13457
13458 }
13459
13460 void OnApply(PlayerBase player);
13461
13463 {
13464 return 1.0;
13465 };
13466
13468 {
13470 }
13471
13473 {
13475 }
13476
13478
13480 {
13481 SetDynamicPhysicsLifeTime(0.01);
13483 }
13484
13486 {
13487 array<string> zone_names = new array<string>;
13488 GetDamageZones(zone_names);
13489 for (int i = 0; i < zone_names.Count(); i++)
13490 {
13491 SetHealthMax(zone_names.Get(i),"Health");
13492 }
13493 SetHealthMax("","Health");
13494 }
13495
13498 {
13499 float global_health = GetHealth01("","Health");
13500 array<string> zones = new array<string>;
13501 GetDamageZones(zones);
13502
13503 for (int i = 0; i < zones.Count(); i++)
13504 {
13505 SetHealth01(zones.Get(i),"Health",global_health);
13506 }
13507 }
13508
13511 {
13512 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13513 }
13514
13516 {
13517 if (!hasRootAsPlayer)
13518 {
13519 if (refParentIB)
13520 {
13521
13522 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13523 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13524
13525 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13526 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13527
13530 }
13531 else
13532 {
13533
13536 }
13537 }
13538 }
13539
13541 {
13543 {
13544 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13545 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13546 {
13547 float heatPermCoef = 1.0;
13549 while (ent)
13550 {
13551 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13552 ent = ent.GetHierarchyParent();
13553 }
13554
13555 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13556 }
13557 }
13558 }
13559
13561 {
13562
13563 EntityAI parent = GetHierarchyParent();
13564 if (!parent)
13565 {
13566 hasParent = false;
13567 hasRootAsPlayer = false;
13568 }
13569 else
13570 {
13571 hasParent = true;
13572 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13573 refParentIB =
ItemBase.Cast(parent);
13574 }
13575 }
13576
13577 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13578 {
13579
13580 }
13581
13583 {
13584
13585 return false;
13586 }
13587
13589 {
13590
13591
13592 return false;
13593 }
13594
13596 {
13597
13598 return false;
13599 }
13600
13603 {
13604 return !GetIsFrozen() &&
IsOpen();
13605 }
13606
13608 {
13609 bool hasParent = false, hasRootAsPlayer = false;
13611
13612 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13613 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13614
13615 if (wwtu || foodDecay)
13616 {
13620
13621 if (processWetness || processTemperature || processDecay)
13622 {
13624
13625 if (processWetness)
13626 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13627
13628 if (processTemperature)
13630
13631 if (processDecay)
13632 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13633 }
13634 }
13635 }
13636
13639 {
13641 }
13642
13644 {
13647
13648 return super.GetTemperatureFreezeThreshold();
13649 }
13650
13652 {
13655
13656 return super.GetTemperatureThawThreshold();
13657 }
13658
13660 {
13663
13664 return super.GetItemOverheatThreshold();
13665 }
13666
13668 {
13670 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13671
13672 return super.GetTemperatureFreezeTime();
13673 }
13674
13676 {
13678 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13679
13680 return super.GetTemperatureThawTime();
13681 }
13682
13687
13689 {
13690 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13691 }
13692
13694 {
13695 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13696 }
13697
13700 {
13702 }
13703
13705 {
13707 }
13708
13710 {
13712 }
13713
13716 {
13717 return null;
13718 }
13719
13722 {
13723 return false;
13724 }
13725
13727 {
13729 {
13732 if (!trg)
13733 {
13735 explosive = this;
13736 }
13737
13738 explosive.PairRemote(trg);
13740
13741 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13742 trg.SetPersistentPairID(persistentID);
13743 explosive.SetPersistentPairID(persistentID);
13744
13745 return true;
13746 }
13747 return false;
13748 }
13749
13752 {
13753 float ret = 1.0;
13756 ret *= GetHealth01();
13757
13758 return ret;
13759 }
13760
13761 #ifdef DEVELOPER
13762 override void SetDebugItem()
13763 {
13764 super.SetDebugItem();
13765 _itemBase = this;
13766 }
13767
13769 {
13770 string text = super.GetDebugText();
13771
13773 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13774
13775 return text;
13776 }
13777 #endif
13778
13780 {
13781 return true;
13782 }
13783
13785
13787
13789 {
13792 }
13793
13794
13802
13818}
13819
13821{
13823 if (entity)
13824 {
13825 bool is_item = entity.IsInherited(
ItemBase);
13826 if (is_item && full_quantity)
13827 {
13830 }
13831 }
13832 else
13833 {
13835 return NULL;
13836 }
13837 return entity;
13838}
13839
13841{
13842 if (item)
13843 {
13844 if (health > 0)
13845 item.SetHealth("", "", health);
13846
13847 if (item.CanHaveTemperature())
13848 {
13850 if (item.CanFreeze())
13851 item.SetFrozen(false);
13852 }
13853
13854 if (item.HasEnergyManager())
13855 {
13856 if (quantity >= 0)
13857 {
13858 item.GetCompEM().SetEnergy0To1(quantity);
13859 }
13860 else
13861 {
13863 }
13864 }
13865 else if (item.IsMagazine())
13866 {
13867 Magazine mag = Magazine.Cast(item);
13868 if (quantity >= 0)
13869 {
13870 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13871 }
13872 else
13873 {
13875 }
13876
13877 }
13878 else
13879 {
13880 if (quantity >= 0)
13881 {
13882 item.SetQuantityNormalized(quantity, false);
13883 }
13884 else
13885 {
13887 }
13888
13889 }
13890 }
13891}
13892
13893#ifdef DEVELOPER
13895#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.