8921{
8923 {
8924 return true;
8925 }
8926};
8927
8928
8929
8931{
8935
8937
8940
8941
8942
8943
8944
8953
8959
8964
8969
8990 protected bool m_IsResultOfSplit
8991
8993
8998
8999
9000
9002
9006
9007
9008
9010
9013
9014
9015
9021
9022
9030
9033
9034
9036
9037
9039
9040
9045
9046
9051
9052
9054
9055
9057 {
9062
9063 if (!
GetGame().IsDedicatedServer())
9064 {
9066 {
9068
9070 {
9072 }
9073 }
9074
9077 }
9078
9079 m_OldLocation = null;
9080
9082 {
9084 }
9085
9086 if (ConfigIsExisting("headSelectionsToHide"))
9087 {
9090 }
9091
9093 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9094 {
9096 }
9097
9099
9100 m_IsResultOfSplit = false;
9101
9103 }
9104
9106 {
9107 super.InitItemVariables();
9108
9114 m_Count = ConfigGetInt(
"count");
9115
9118
9123
9126
9131
9143
9147
9148
9151 if (ConfigIsExisting("canBeSplit"))
9152 {
9155 }
9156
9158 if (ConfigIsExisting("itemBehaviour"))
9160
9161
9164 RegisterNetSyncVariableInt("m_VarLiquidType");
9165 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9166
9167 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9168 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9169 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9170
9171 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9172 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9173 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9174 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9175
9176 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9177 RegisterNetSyncVariableBool("m_IsTakeable");
9178 RegisterNetSyncVariableBool("m_IsHologram");
9179
9182 {
9185 }
9186
9188
9190 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9192
9193 }
9194
9196 {
9198 }
9199
9201 {
9204 {
9209 }
9210 }
9211
9212 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9213 {
9215 {
9218 }
9219
9221 }
9222
9224 {
9230 }
9231
9233
9235 {
9237
9238 if (!action)
9239 {
9240 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9241 return;
9242 }
9243
9245 if (!ai)
9246 {
9248 return;
9249 }
9250
9252 if (!action_array)
9253 {
9254 action_array = new array<ActionBase_Basic>;
9256 }
9257 if (LogManager.IsActionLogEnable())
9258 {
9259 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9260 }
9261
9262 if (action_array.Find(action) != -1)
9263 {
9264 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9265 }
9266 else
9267 {
9268 action_array.Insert(action);
9269 }
9270 }
9271
9273 {
9275 ActionBase action = player.GetActionManager().GetAction(actionName);
9278
9279 if (action_array)
9280 {
9281 action_array.RemoveItem(action);
9282 }
9283 }
9284
9285
9286
9288 {
9289 ActionOverrideData overrideData = new ActionOverrideData();
9293
9295 if (!actionMap)
9296 {
9299 }
9300
9301 actionMap.Insert(this.
Type(), overrideData);
9302
9303 }
9304
9306
9308
9309
9311 {
9314
9317
9318 string config_to_search = "CfgVehicles";
9319 string muzzle_owner_config;
9320
9322 {
9323 if (IsInherited(Weapon))
9324 config_to_search = "CfgWeapons";
9325
9326 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9327
9328 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9329
9331
9332 if (config_OnFire_subclass_count > 0)
9333 {
9334 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9335
9336 for (int i = 0; i < config_OnFire_subclass_count; i++)
9337 {
9338 string particle_class = "";
9340 string config_OnFire_entry = config_OnFire_class + particle_class;
9341 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9342 WPOF_array.Insert(WPOF);
9343 }
9344
9345
9347 }
9348 }
9349
9351 {
9352 config_to_search = "CfgWeapons";
9353 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9354
9355 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9356
9358
9359 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9360 {
9361 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9362
9363 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9364 {
9365 string particle_class2 = "";
9367 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9368 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9369 WPOBE_array.Insert(WPOBE);
9370 }
9371
9372
9374 }
9375 }
9376 }
9377
9378
9380 {
9383
9385 {
9386 string config_to_search = "CfgVehicles";
9387
9388 if (IsInherited(Weapon))
9389 config_to_search = "CfgWeapons";
9390
9391 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9392 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9393
9394 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9395 {
9396
9398
9400 {
9402 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9404 return;
9405 }
9406
9409
9410
9411
9413 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9414
9415 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9416 {
9417 string particle_class = "";
9419 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9421
9422 if (entry_type == CT_CLASS)
9423 {
9424 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9425 WPOOH_array.Insert(WPOF);
9426 }
9427 }
9428
9429
9431 }
9432 }
9433 }
9434
9436 {
9438 }
9439
9441 {
9443 {
9445
9448
9451
9452 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9453 }
9454 }
9455
9457 {
9459 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9460
9462 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9463
9465 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9466
9468 {
9470 }
9471 }
9472
9474 {
9476 }
9477
9479 {
9482 else
9484
9486 {
9489 }
9490 else
9491 {
9494
9497 }
9498
9500 }
9501
9503 {
9505 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9506 }
9507
9509 {
9511 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9513 }
9514
9516 {
9518 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9519 }
9520
9522 {
9525
9526 OverheatingParticle OP = new OverheatingParticle();
9531
9533 }
9534
9536 {
9539
9540 return -1;
9541 }
9542
9544 {
9546 {
9549
9550 for (int i = count; i > 0; --i)
9551 {
9552 int id = i - 1;
9555
9558
9559 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9560 {
9561 if (p)
9562 {
9565 }
9566 }
9567 }
9568 }
9569 }
9570
9572 {
9574 {
9576 {
9577 int id = i - 1;
9579
9580 if (OP)
9581 {
9583
9584 if (p)
9585 {
9587 }
9588
9589 delete OP;
9590 }
9591 }
9592
9595 }
9596 }
9597
9600 {
9601 return 0.0;
9602 }
9603
9604
9606 {
9607 return 250;
9608 }
9609
9611 {
9612 return 0;
9613 }
9614
9617 {
9619 return true;
9620
9621 return false;
9622 }
9623
9626 {
9629
9631 {
9633 }
9634 else
9635 {
9636
9638 }
9639
9641 }
9642
9649 {
9650 return -1;
9651 }
9652
9653
9654
9655
9657 {
9659 {
9661 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9662
9663 if (r_index >= 0)
9664 {
9665 InventoryLocation r_il = new InventoryLocation;
9666 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9667
9668 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9671 {
9672 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9673 }
9675 {
9676 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9677 }
9678
9679 }
9680
9681 player.GetHumanInventory().ClearUserReservedLocation(this);
9682 }
9683
9686 }
9687
9688
9689
9690
9692 {
9693 return ItemBase.m_DebugActionsMask;
9694 }
9695
9697 {
9698 return ItemBase.m_DebugActionsMask & mask;
9699 }
9700
9702 {
9703 ItemBase.m_DebugActionsMask = mask;
9704 }
9705
9707 {
9708 ItemBase.m_DebugActionsMask |= mask;
9709 }
9710
9712 {
9713 ItemBase.m_DebugActionsMask &= ~mask;
9714 }
9715
9717 {
9719 {
9721 }
9722 else
9723 {
9725 }
9726 }
9727
9728
9730 {
9731 if (GetEconomyProfile())
9732 {
9733 float q_max = GetEconomyProfile().GetQuantityMax();
9734 if (q_max > 0)
9735 {
9736 float q_min = GetEconomyProfile().GetQuantityMin();
9737 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9738
9740 {
9741 ComponentEnergyManager comp = GetCompEM();
9743 {
9745 }
9746 }
9748 {
9750
9751 }
9752
9753 }
9754 }
9755 }
9756
9759 {
9760 EntityAI parent = GetHierarchyParent();
9761
9762 if (parent)
9763 {
9764 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9765 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9766 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9767 }
9768 }
9769
9772 {
9773 EntityAI parent = GetHierarchyParent();
9774
9775 if (parent)
9776 {
9777 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9778 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9779 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9780 }
9781 }
9782
9784 {
9785
9786
9787
9788
9790
9792 {
9793 if (ScriptInputUserData.CanStoreInputUserData())
9794 {
9795 ScriptInputUserData ctx = new ScriptInputUserData;
9801 ctx.
Write(use_stack_max);
9804
9806 {
9807 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9808 }
9809 }
9810 }
9811 else if (!
GetGame().IsMultiplayer())
9812 {
9814 }
9815 }
9816
9818 {
9820 }
9821
9823 {
9825 }
9826
9828 {
9830 }
9831
9833 {
9834
9835 return false;
9836 }
9837
9839 {
9840 return false;
9841 }
9842
9846 {
9847 return false;
9848 }
9849
9851 {
9852 return "";
9853 }
9854
9856
9858 {
9859 return false;
9860 }
9861
9863 {
9864 return true;
9865 }
9866
9867
9868
9870 {
9871 return true;
9872 }
9873
9875 {
9876 return true;
9877 }
9878
9880 {
9881 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9883 }
9884
9886 {
9888 }
9889
9891 {
9893 if (!is_being_placed)
9895 SetSynchDirty();
9896 }
9897
9898
9900
9902 {
9904 }
9905
9907 {
9909 }
9910
9912 {
9913 return 1;
9914 }
9915
9917 {
9918 return false;
9919 }
9920
9922 {
9924 SetSynchDirty();
9925 }
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9962 {
9963 super.OnMovedInsideCargo(container);
9964
9965 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9966 }
9967
9968 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9969 {
9970 super.EEItemLocationChanged(oldLoc,newLoc);
9971
9972 PlayerBase new_player = null;
9973 PlayerBase old_player = null;
9974
9975 if (newLoc.GetParent())
9976 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9977
9978 if (oldLoc.GetParent())
9979 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9980
9982 {
9983 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9984
9985 if (r_index >= 0)
9986 {
9987 InventoryLocation r_il = new InventoryLocation;
9988 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9989
9990 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9993 {
9994 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9995 }
9997 {
9998 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9999 }
10000
10001 }
10002 }
10003
10005 {
10006 if (new_player)
10007 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10008
10009 if (new_player == old_player)
10010 {
10011
10012 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10013 {
10015 {
10016 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10017 {
10018 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10019 }
10020 }
10021 else
10022 {
10023 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10024 }
10025 }
10026
10027 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10028 {
10029 int type = oldLoc.GetType();
10031 {
10032 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10033 }
10035 {
10036 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10037 }
10038 }
10039 if (!m_OldLocation)
10040 {
10041 m_OldLocation = new InventoryLocation;
10042 }
10043 m_OldLocation.Copy(oldLoc);
10044 }
10045 else
10046 {
10047 if (m_OldLocation)
10048 {
10049 m_OldLocation.Reset();
10050 }
10051 }
10052
10054 }
10055 else
10056 {
10057 if (new_player)
10058 {
10059 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10060 if (res_index >= 0)
10061 {
10062 InventoryLocation il = new InventoryLocation;
10063 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10065 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10068 {
10069 il.
GetParent().GetOnReleaseLock().Invoke(it);
10070 }
10072 {
10074 }
10075
10076 }
10077 }
10079 {
10080
10082 }
10083
10084 if (m_OldLocation)
10085 {
10086 m_OldLocation.Reset();
10087 }
10088 }
10089 }
10090
10091 override void EOnContact(IEntity other, Contact extra)
10092 {
10094 {
10095 int liquidType = -1;
10097 if (impactSpeed > 0.0)
10098 {
10100 #ifndef SERVER
10102 #else
10104 SetSynchDirty();
10105 #endif
10107 }
10108 }
10109
10110 #ifdef SERVER
10111 if (GetCompEM() && GetCompEM().IsPlugged())
10112 {
10113 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10114 GetCompEM().UnplugThis();
10115 }
10116 #endif
10117 }
10118
10120
10122 {
10124 }
10125
10127 {
10128
10129 }
10130
10132 {
10133 super.OnItemLocationChanged(old_owner, new_owner);
10134
10135 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10136 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10137
10138 if (!relatedPlayer && playerNew)
10139 relatedPlayer = playerNew;
10140
10141 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10142 {
10144 if (actionMgr)
10145 {
10146 ActionBase currentAction = actionMgr.GetRunningAction();
10147 if (currentAction)
10149 }
10150 }
10151
10152 Man ownerPlayerOld = null;
10153 Man ownerPlayerNew = null;
10154
10155 if (old_owner)
10156 {
10157 if (old_owner.
IsMan())
10158 {
10159 ownerPlayerOld = Man.Cast(old_owner);
10160 }
10161 else
10162 {
10163 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10164 }
10165 }
10166 else
10167 {
10169 {
10171
10172 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10173 {
10174 GetCompEM().UnplugThis();
10175 }
10176 }
10177 }
10178
10179 if (new_owner)
10180 {
10181 if (new_owner.
IsMan())
10182 {
10183 ownerPlayerNew = Man.Cast(new_owner);
10184 }
10185 else
10186 {
10187 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10188 }
10189 }
10190
10191 if (ownerPlayerOld != ownerPlayerNew)
10192 {
10193 if (ownerPlayerOld)
10194 {
10195 array<EntityAI> subItemsExit = new array<EntityAI>;
10197 for (int i = 0; i < subItemsExit.Count(); i++)
10198 {
10201 }
10202 }
10203
10204 if (ownerPlayerNew)
10205 {
10206 array<EntityAI> subItemsEnter = new array<EntityAI>;
10208 for (int j = 0; j < subItemsEnter.Count(); j++)
10209 {
10212 }
10213 }
10214 }
10215 else if (ownerPlayerNew != null)
10216 {
10217 PlayerBase nplayer;
10218 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10219 {
10220 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10222 for (int k = 0; k < subItemsUpdate.Count(); k++)
10223 {
10225 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10226 }
10227 }
10228 }
10229
10230 if (old_owner)
10231 old_owner.OnChildItemRemoved(this);
10232 if (new_owner)
10233 new_owner.OnChildItemReceived(this);
10234 }
10235
10236
10238 {
10239 super.EEDelete(parent);
10240 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10241 if (player)
10242 {
10244
10245 if (player.IsAlive())
10246 {
10247 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10248 if (r_index >= 0)
10249 {
10250 InventoryLocation r_il = new InventoryLocation;
10251 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10252
10253 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10256 {
10257 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10258 }
10260 {
10261 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10262 }
10263
10264 }
10265
10266 player.RemoveQuickBarEntityShortcut(this);
10267 }
10268 }
10269 }
10270
10272 {
10273 super.EEKilled(killer);
10274
10277 {
10278 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10279 {
10280 if (IsMagazine())
10281 {
10282 if (Magazine.Cast(this).GetAmmoCount() > 0)
10283 {
10285 }
10286 }
10287 else
10288 {
10290 }
10291 }
10292 }
10293 }
10294
10296 {
10297 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10298
10299 super.OnWasAttached(parent, slot_id);
10300
10303
10305 }
10306
10308 {
10309 super.OnWasDetached(parent, slot_id);
10310
10313 }
10314
10316 {
10317 int idx;
10320
10321 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10322 if (inventory_slots.Count() < 1)
10323 {
10324 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10325 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10326 }
10327 else
10328 {
10329 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10330 }
10331
10332 idx = inventory_slots.Find(slot);
10333 if (idx < 0)
10334 return "";
10335
10336 return attach_types.Get(idx);
10337 }
10338
10340 {
10341 int idx = -1;
10342 string slot;
10343
10346
10347 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10348 if (inventory_slots.Count() < 1)
10349 {
10350 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10351 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10352 }
10353 else
10354 {
10355 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10356 if (detach_types.Count() < 1)
10357 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10358 }
10359
10360 for (int i = 0; i < inventory_slots.Count(); i++)
10361 {
10362 slot = inventory_slots.Get(i);
10363 }
10364
10365 if (slot != "")
10366 {
10367 if (detach_types.Count() == 1)
10368 idx = 0;
10369 else
10370 idx = inventory_slots.Find(slot);
10371 }
10372 if (idx < 0)
10373 return "";
10374
10375 return detach_types.Get(idx);
10376 }
10377
10379 {
10380
10382
10383
10384 float min_time = 1;
10385 float max_time = 3;
10386 float delay = Math.RandomFloat(min_time, max_time);
10387
10388 explode_timer.Run(delay, this, "DoAmmoExplosion");
10389 }
10390
10392 {
10393 Magazine magazine = Magazine.Cast(this);
10394 int pop_sounds_count = 6;
10395 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10396
10397
10398 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10399 string sound_name = pop_sounds[ sound_idx ];
10401
10402
10403 magazine.ServerAddAmmoCount(-1);
10404
10405
10406 float min_temp_to_explode = 100;
10407
10408 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
10409 {
10411 }
10412 }
10413
10414
10415 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10416 {
10417 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10418
10419 const int CHANCE_DAMAGE_CARGO = 4;
10420 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10421 const int CHANCE_DAMAGE_NOTHING = 2;
10422
10424 {
10425 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10426 int chances;
10427 int rnd;
10428
10429 if (GetInventory().GetCargo())
10430 {
10431 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10432 rnd = Math.RandomInt(0,chances);
10433
10434 if (rnd < CHANCE_DAMAGE_CARGO)
10435 {
10437 }
10438 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10439 {
10441 }
10442 }
10443 else
10444 {
10445 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10446 rnd = Math.RandomInt(0,chances);
10447
10448 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10449 {
10451 }
10452 }
10453 }
10454 }
10455
10457 {
10458 if (GetInventory().GetCargo())
10459 {
10460 int item_count = GetInventory().GetCargo().GetItemCount();
10461 if (item_count > 0)
10462 {
10463 int random_pick = Math.RandomInt(0, item_count);
10465 if (!item.IsExplosive())
10466 {
10467 item.AddHealth("","",damage);
10468 return true;
10469 }
10470 }
10471 }
10472 return false;
10473 }
10474
10476 {
10477 int attachment_count = GetInventory().AttachmentCount();
10478 if (attachment_count > 0)
10479 {
10480 int random_pick = Math.RandomInt(0, attachment_count);
10481 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10482 if (!attachment.IsExplosive())
10483 {
10484 attachment.AddHealth("","",damage);
10485 return true;
10486 }
10487 }
10488 return false;
10489 }
10490
10492 {
10494 }
10495
10497 {
10499 return GetInventory().CanRemoveEntity();
10500
10501 return false;
10502 }
10503
10505 {
10507 return;
10508
10510 {
10511 if (ScriptInputUserData.CanStoreInputUserData())
10512 {
10513 ScriptInputUserData ctx = new ScriptInputUserData;
10518 ctx.
Write(destination_entity);
10520 ctx.
Write(slot_id);
10522 }
10523 }
10524 else if (!
GetGame().IsMultiplayer())
10525 {
10527 }
10528 }
10529
10531 {
10533 return;
10534
10535 float split_quantity_new;
10539 InventoryLocation loc = new InventoryLocation;
10540
10541 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10542 {
10544 split_quantity_new = stack_max;
10545 else
10547
10548 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10549 if (new_item)
10550 {
10551 new_item.SetResultOfSplit(true);
10552 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10554 new_item.SetQuantity(split_quantity_new);
10555 }
10556 }
10557 else if (destination_entity && slot_id == -1)
10558 {
10559 if (quantity > stack_max)
10560 split_quantity_new = stack_max;
10561 else
10562 split_quantity_new = quantity;
10563
10565 {
10568 }
10569
10570 if (new_item)
10571 {
10572 new_item.SetResultOfSplit(true);
10573 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10575 new_item.SetQuantity(split_quantity_new);
10576 }
10577 }
10578 else
10579 {
10580 if (stack_max != 0)
10581 {
10583 {
10585 }
10586
10587 if (split_quantity_new == 0)
10588 {
10589 if (!
GetGame().IsMultiplayer())
10590 player.PhysicalPredictiveDropItem(this);
10591 else
10592 player.ServerDropEntity(this);
10593 return;
10594 }
10595
10597
10598 if (new_item)
10599 {
10600 new_item.SetResultOfSplit(true);
10601 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10603 new_item.SetQuantity(stack_max);
10604 new_item.PlaceOnSurface();
10605 }
10606 }
10607 }
10608 }
10609
10611 {
10613 return;
10614
10615 float split_quantity_new;
10619 InventoryLocation loc = new InventoryLocation;
10620
10621 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10622 {
10624 split_quantity_new = stack_max;
10625 else
10627
10628 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10629 if (new_item)
10630 {
10631 new_item.SetResultOfSplit(true);
10632 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10634 new_item.SetQuantity(split_quantity_new);
10635 }
10636 }
10637 else if (destination_entity && slot_id == -1)
10638 {
10639 if (quantity > stack_max)
10640 split_quantity_new = stack_max;
10641 else
10642 split_quantity_new = quantity;
10643
10645 {
10648 }
10649
10650 if (new_item)
10651 {
10652 new_item.SetResultOfSplit(true);
10653 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10655 new_item.SetQuantity(split_quantity_new);
10656 }
10657 }
10658 else
10659 {
10660 if (stack_max != 0)
10661 {
10663 {
10665 }
10666
10668
10669 if (new_item)
10670 {
10671 new_item.SetResultOfSplit(true);
10672 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10674 new_item.SetQuantity(stack_max);
10675 new_item.PlaceOnSurface();
10676 }
10677 }
10678 }
10679 }
10680
10682 {
10684 return;
10685
10687 {
10688 if (ScriptInputUserData.CanStoreInputUserData())
10689 {
10690 ScriptInputUserData ctx = new ScriptInputUserData;
10695 dst.WriteToContext(ctx);
10697 }
10698 }
10699 else if (!
GetGame().IsMultiplayer())
10700 {
10702 }
10703 }
10704
10706 {
10708 return;
10709
10711 {
10712 if (ScriptInputUserData.CanStoreInputUserData())
10713 {
10714 ScriptInputUserData ctx = new ScriptInputUserData;
10719 ctx.
Write(destination_entity);
10725 }
10726 }
10727 else if (!
GetGame().IsMultiplayer())
10728 {
10730 }
10731 }
10732
10734 {
10736 }
10737
10739 {
10741 return this;
10742
10744 float split_quantity_new;
10746 if (dst.IsValid())
10747 {
10748 int slot_id = dst.GetSlot();
10750
10751 if (quantity > stack_max)
10752 split_quantity_new = stack_max;
10753 else
10754 split_quantity_new = quantity;
10755
10757
10758 if (new_item)
10759 {
10760 new_item.SetResultOfSplit(true);
10761 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10764 }
10765
10766 return new_item;
10767 }
10768
10769 return null;
10770 }
10771
10773 {
10775 return;
10776
10778 float split_quantity_new;
10780 if (destination_entity)
10781 {
10783 if (quantity > stackable)
10784 split_quantity_new = stackable;
10785 else
10786 split_quantity_new = quantity;
10787
10788 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10789 if (new_item)
10790 {
10791 new_item.SetResultOfSplit(true);
10792 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10794 new_item.SetQuantity(split_quantity_new);
10795 }
10796 }
10797 }
10798
10800 {
10802 return;
10803
10805 {
10806 if (ScriptInputUserData.CanStoreInputUserData())
10807 {
10808 ScriptInputUserData ctx = new ScriptInputUserData;
10813 ItemBase destination_entity =
this;
10814 ctx.
Write(destination_entity);
10818 }
10819 }
10820 else if (!
GetGame().IsMultiplayer())
10821 {
10823 }
10824 }
10825
10827 {
10829 return;
10830
10832 float split_quantity_new;
10834 if (player)
10835 {
10837 if (quantity > stackable)
10838 split_quantity_new = stackable;
10839 else
10840 split_quantity_new = quantity;
10841
10842 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10843 new_item =
ItemBase.Cast(in_hands);
10844 if (new_item)
10845 {
10846 new_item.SetResultOfSplit(true);
10847 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10849 new_item.SetQuantity(split_quantity_new);
10850 }
10851 }
10852 }
10853
10855 {
10857 return;
10858
10860 float split_quantity_new = Math.Floor(quantity * 0.5);
10861
10863
10864 if (new_item)
10865 {
10866 if (new_item.GetQuantityMax() < split_quantity_new)
10867 {
10868 split_quantity_new = new_item.GetQuantityMax();
10869 }
10870
10871 new_item.SetResultOfSplit(true);
10872 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10873
10875 {
10878 }
10879 else
10880 {
10883 }
10884 }
10885 }
10886
10888 {
10890 return;
10891
10893 float split_quantity_new = Math.Floor(quantity / 2);
10894
10895 InventoryLocation invloc = new InventoryLocation;
10897
10899 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10900
10901 if (new_item)
10902 {
10903 if (new_item.GetQuantityMax() < split_quantity_new)
10904 {
10905 split_quantity_new = new_item.GetQuantityMax();
10906 }
10908 {
10911 }
10912 else
10913 {
10916 }
10917 }
10918 }
10919
10922 {
10923 SetWeightDirty();
10925
10926 if (parent)
10927 parent.OnAttachmentQuantityChangedEx(this, delta);
10928
10930 {
10932 {
10934 }
10936 {
10937 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10939 }
10940 }
10941
10942 }
10943
10946 {
10947
10948 }
10949
10952 {
10954 }
10955
10957 {
10958 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10959
10961 {
10962 if (newLevel == GameConstants.STATE_RUINED)
10963 {
10965 EntityAI parent = GetHierarchyParent();
10966 if (parent && parent.IsFireplace())
10967 {
10968 CargoBase cargo = GetInventory().GetCargo();
10969 if (cargo)
10970 {
10972 {
10974 }
10975 }
10976 }
10977 }
10978
10980 {
10981
10983 return;
10984 }
10985
10986 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10987 {
10989 }
10990 }
10991 }
10992
10993
10995 {
10996 super.OnRightClick();
10997
10999 {
11001 {
11002 if (ScriptInputUserData.CanStoreInputUserData())
11003 {
11004 vector m4[4];
11006
11007 EntityAI root = GetHierarchyRoot();
11008
11009 InventoryLocation dst = new InventoryLocation;
11011 {
11012 if (root)
11013 {
11014 root.GetTransform(m4);
11016 }
11017 else
11018 GetInventory().GetCurrentInventoryLocation(dst);
11019 }
11020 else
11021 {
11023
11024
11025 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11026 {
11027 if (root)
11028 {
11029 root.GetTransform(m4);
11031 }
11032 else
11033 GetInventory().GetCurrentInventoryLocation(dst);
11034 }
11035 else
11036 {
11037 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11038 }
11039 }
11040
11041 ScriptInputUserData ctx = new ScriptInputUserData;
11049 }
11050 }
11051 else if (!
GetGame().IsMultiplayer())
11052 {
11054 }
11055 }
11056 }
11057
11058 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11059 {
11060
11061 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11062 return false;
11063
11064 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11065 return false;
11066
11067
11069 return false;
11070
11071
11072 Magazine mag = Magazine.Cast(this);
11073 if (mag)
11074 {
11075 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11076 return false;
11077
11078 if (stack_max_limit)
11079 {
11080 Magazine other_mag = Magazine.Cast(other_item);
11081 if (other_item)
11082 {
11083 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11084 return false;
11085 }
11086
11087 }
11088 }
11089 else
11090 {
11091
11093 return false;
11094
11096 return false;
11097 }
11098
11099 PlayerBase player = null;
11100 if (CastTo(player, GetHierarchyRootPlayer()))
11101 {
11102 if (player.GetInventory().HasAttachment(this))
11103 return false;
11104
11105 if (player.IsItemsToDelete())
11106 return false;
11107 }
11108
11109 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11110 return false;
11111
11112 int slotID;
11114 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11115 return false;
11116
11117 return true;
11118 }
11119
11121 {
11123 }
11124
11126 {
11127 return m_IsResultOfSplit;
11128 }
11129
11131 {
11132 m_IsResultOfSplit = value;
11133 }
11134
11136 {
11138 }
11139
11141 {
11142 float other_item_quantity = other_item.GetQuantity();
11143 float this_free_space;
11144
11146
11148
11149 if (other_item_quantity > this_free_space)
11150 {
11151 return this_free_space;
11152 }
11153 else
11154 {
11155 return other_item_quantity;
11156 }
11157 }
11158
11160 {
11162 }
11163
11165 {
11167 return;
11168
11169 if (!IsMagazine() && other_item)
11170 {
11172 if (quantity_used != 0)
11173 {
11174 float hp1 = GetHealth01("","");
11175 float hp2 = other_item.GetHealth01("","");
11176 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11177 hpResult = hpResult / (
GetQuantity() + quantity_used);
11178
11179 hpResult *= GetMaxHealth();
11180 Math.Round(hpResult);
11181 SetHealth("", "Health", hpResult);
11182
11184 other_item.AddQuantity(-quantity_used);
11185 }
11186 }
11188 }
11189
11191 {
11192 #ifdef SERVER
11193 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11194 GetHierarchyParent().IncreaseLifetimeUp();
11195 #endif
11196 };
11197
11199 {
11200 PlayerBase p = PlayerBase.Cast(player);
11201
11202 array<int> recipesIds = p.m_Recipes;
11203 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11204 if (moduleRecipesManager)
11205 {
11206 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11207 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11208 }
11209
11210 for (int i = 0;i < recipesIds.Count(); i++)
11211 {
11212 int key = recipesIds.Get(i);
11213 string recipeName = moduleRecipesManager.GetRecipeName(key);
11215 }
11216 }
11217
11218
11219 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11220 {
11221 super.GetDebugActions(outputList);
11222
11223
11228
11229
11233
11237
11238
11241
11242
11244 {
11247 }
11248
11250
11253
11257 }
11258
11259
11260
11261
11263 {
11264 super.OnAction(action_id, player, ctx);
11265 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11266 {
11267 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11268 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11269 PlayerBase p = PlayerBase.Cast(player);
11270 if (
EActions.RECIPES_RANGE_START < 1000)
11271 {
11272 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11273 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11274 }
11275 }
11276 #ifndef SERVER
11277 else if (action_id ==
EActions.WATCH_PLAYER)
11278 {
11279 PluginDeveloper.SetDeveloperItemClientEx(player);
11280 }
11281 #endif
11283 {
11284 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11285 {
11286 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11287 OnDebugButtonPressServer(id + 1);
11288 }
11289
11290 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11291 {
11292 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11294 }
11295
11296 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11297 {
11298 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11300 }
11301
11302 else if (action_id ==
EActions.ADD_QUANTITY)
11303 {
11304 if (IsMagazine())
11305 {
11306 Magazine mag = Magazine.Cast(this);
11307 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11308 }
11309 else
11310 {
11312 }
11313
11314 if (m_EM)
11315 {
11316 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11317 }
11318
11319 }
11320
11321 else if (action_id ==
EActions.REMOVE_QUANTITY)
11322 {
11323 if (IsMagazine())
11324 {
11325 Magazine mag2 = Magazine.Cast(this);
11326 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11327 }
11328 else
11329 {
11331 }
11332 if (m_EM)
11333 {
11334 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11335 }
11336
11337 }
11338
11339 else if (action_id ==
EActions.SET_QUANTITY_0)
11340 {
11342
11343 if (m_EM)
11344 {
11345 m_EM.SetEnergy(0);
11346 }
11347 }
11348
11349 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11350 {
11352
11353 if (m_EM)
11354 {
11355 m_EM.SetEnergy(m_EM.GetEnergyMax());
11356 }
11357 }
11358
11359 else if (action_id ==
EActions.ADD_HEALTH)
11360 {
11361 AddHealth("","",GetMaxHealth("","Health")/5);
11362 }
11363 else if (action_id ==
EActions.REMOVE_HEALTH)
11364 {
11365 AddHealth("","",-GetMaxHealth("","Health")/5);
11366 }
11367 else if (action_id ==
EActions.DESTROY_HEALTH)
11368 {
11369 SetHealth01("","",0);
11370 }
11371 else if (action_id ==
EActions.WATCH_ITEM)
11372 {
11374 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11375 #ifdef DEVELOPER
11376 SetDebugDeveloper_item(this);
11377 #endif
11378 }
11379
11380 else if (action_id ==
EActions.ADD_TEMPERATURE)
11381 {
11382 AddTemperature(20);
11383
11384 }
11385
11386 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11387 {
11388 AddTemperature(-20);
11389
11390 }
11391
11392 else if (action_id ==
EActions.FLIP_FROZEN)
11393 {
11394 SetFrozen(!GetIsFrozen());
11395
11396 }
11397
11398 else if (action_id ==
EActions.ADD_WETNESS)
11399 {
11401
11402 }
11403
11404 else if (action_id ==
EActions.REMOVE_WETNESS)
11405 {
11407
11408 }
11409
11410 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11411 {
11414
11415
11416 }
11417
11418 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11419 {
11422 }
11423
11424 else if (action_id ==
EActions.MAKE_SPECIAL)
11425 {
11426 auto debugParams = DebugSpawnParams.WithPlayer(player);
11427 OnDebugSpawnEx(debugParams);
11428 }
11429
11430 else if (action_id ==
EActions.DELETE)
11431 {
11432 Delete();
11433 }
11434
11435 }
11436
11437
11438 return false;
11439 }
11440
11441
11442
11443
11447
11450
11451
11452
11454 {
11455 return false;
11456 }
11457
11458
11460 {
11461 return true;
11462 }
11463
11464
11466 {
11467 return true;
11468 }
11469
11470
11471
11473 {
11474 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11476 }
11477
11480 {
11481 return null;
11482 }
11483
11485 {
11486 return false;
11487 }
11488
11490 {
11491 return false;
11492 }
11493
11497
11498
11500 {
11501 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11502 return module_repairing.CanRepair(this, item_repair_kit);
11503 }
11504
11505
11506 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11507 {
11508 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11509 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11510 }
11511
11512
11514 {
11515
11516
11517
11518
11519
11520
11521
11522
11523 return 1;
11524 }
11525
11526
11527
11529 {
11531 }
11532
11533
11534
11536 {
11538 }
11539
11540
11549 {
11550 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11551
11552 if (player)
11553 {
11554 player.MessageStatus(text);
11555 }
11556 }
11557
11558
11567 {
11568 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11569
11570 if (player)
11571 {
11572 player.MessageAction(text);
11573 }
11574 }
11575
11576
11585 {
11586 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11587
11588 if (player)
11589 {
11590 player.MessageFriendly(text);
11591 }
11592 }
11593
11594
11603 {
11604 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11605
11606 if (player)
11607 {
11608 player.MessageImportant(text);
11609 }
11610 }
11611
11613 {
11614 return true;
11615 }
11616
11617
11618 override bool KindOf(
string tag)
11619 {
11620 bool found = false;
11621 string item_name = this.
GetType();
11624
11625 int array_size = item_tag_array.Count();
11626 for (int i = 0; i < array_size; i++)
11627 {
11628 if (item_tag_array.Get(i) == tag)
11629 {
11630 found = true;
11631 break;
11632 }
11633 }
11634 return found;
11635 }
11636
11637
11639 {
11640
11641 super.OnRPC(sender, rpc_type,ctx);
11642
11643
11644 switch (rpc_type)
11645 {
11646 #ifndef SERVER
11647 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11648 Param2<bool, string> p = new Param2<bool, string>(false, "");
11649
11651 return;
11652
11653 bool play = p.param1;
11654 string soundSet = p.param2;
11655
11656 if (play)
11657 {
11659 {
11661 {
11663 }
11664 }
11665 else
11666 {
11668 }
11669 }
11670 else
11671 {
11673 }
11674
11675 break;
11676 #endif
11677
11678 }
11679
11681 {
11683 }
11684 }
11685
11686
11687
11688
11690 {
11691 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11692 return plugin.GetID(
name);
11693 }
11694
11696 {
11697 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11698 return plugin.GetName(id);
11699 }
11700
11703 {
11704
11705
11706 int varFlags;
11707 if (!ctx.
Read(varFlags))
11708 return;
11709
11710 if (varFlags & ItemVariableFlags.FLOAT)
11711 {
11713 }
11714 }
11715
11717 {
11718
11719 super.SerializeNumericalVars(floats_out);
11720
11721
11722
11724 {
11726 }
11727
11729 {
11731 }
11732
11734 {
11736 }
11737
11739 {
11744 }
11745
11747 {
11749 }
11750 }
11751
11753 {
11754
11755 super.DeSerializeNumericalVars(floats);
11756
11757
11758 int index = 0;
11759 int mask = Math.Round(floats.Get(index));
11760
11761 index++;
11762
11764 {
11766 {
11768 }
11769 else
11770 {
11771 float quantity = floats.Get(index);
11772 SetQuantity(quantity,
true,
false,
false,
false);
11773 }
11774 index++;
11775 }
11776
11778 {
11779 float wet = floats.Get(index);
11781 index++;
11782 }
11783
11785 {
11786 int liquidtype = Math.Round(floats.Get(index));
11788 index++;
11789 }
11790
11792 {
11794 index++;
11796 index++;
11798 index++;
11800 index++;
11801 }
11802
11804 {
11805 int cleanness = Math.Round(floats.Get(index));
11807 index++;
11808 }
11809 }
11810
11812 {
11813 super.WriteVarsToCTX(ctx);
11814
11815
11817 {
11819 }
11820
11822 {
11824 }
11825
11827 {
11829 }
11830
11832 {
11833 int r,g,b,a;
11839 }
11840
11842 {
11844 }
11845 }
11846
11848 {
11849 if (!super.ReadVarsFromCTX(ctx,version))
11850 return false;
11851
11852 int intValue;
11853 float value;
11854
11855 if (version < 140)
11856 {
11857 if (!ctx.
Read(intValue))
11858 return false;
11859
11860 m_VariablesMask = intValue;
11861 }
11862
11864 {
11865 if (!ctx.
Read(value))
11866 return false;
11867
11869 {
11871 }
11872 else
11873 {
11875 }
11876 }
11877
11878 if (version < 140)
11879 {
11881 {
11882 if (!ctx.
Read(value))
11883 return false;
11884 SetTemperatureDirect(value);
11885 }
11886 }
11887
11889 {
11890 if (!ctx.
Read(value))
11891 return false;
11893 }
11894
11896 {
11897 if (!ctx.
Read(intValue))
11898 return false;
11900 }
11901
11903 {
11904 int r,g,b,a;
11906 return false;
11908 return false;
11910 return false;
11912 return false;
11913
11915 }
11916
11918 {
11919 if (!ctx.
Read(intValue))
11920 return false;
11922 }
11923
11924 if (version >= 138 && version < 140)
11925 {
11927 {
11928 if (!ctx.
Read(intValue))
11929 return false;
11930 SetFrozen(intValue);
11931 }
11932 }
11933
11934 return true;
11935 }
11936
11937
11939 {
11942 {
11944 }
11945
11946 if (!super.OnStoreLoad(ctx, version))
11947 {
11949 return false;
11950 }
11951
11952 if (version >= 114)
11953 {
11954 bool hasQuickBarIndexSaved;
11955
11956 if (!ctx.
Read(hasQuickBarIndexSaved))
11957 {
11959 return false;
11960 }
11961
11962 if (hasQuickBarIndexSaved)
11963 {
11964 int itmQBIndex;
11965
11966
11967 if (!ctx.
Read(itmQBIndex))
11968 {
11970 return false;
11971 }
11972
11973 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11974 if (itmQBIndex != -1 && parentPlayer)
11975 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11976 }
11977 }
11978 else
11979 {
11980
11981 PlayerBase player;
11982 int itemQBIndex;
11983 if (version ==
int.
MAX)
11984 {
11985 if (!ctx.
Read(itemQBIndex))
11986 {
11988 return false;
11989 }
11990 }
11991 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11992 {
11993
11994 if (!ctx.
Read(itemQBIndex))
11995 {
11997 return false;
11998 }
11999 if (itemQBIndex != -1 && player)
12000 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12001 }
12002 }
12003
12004 if (version < 140)
12005 {
12006
12007 if (!LoadVariables(ctx, version))
12008 {
12010 return false;
12011 }
12012 }
12013
12014
12016 {
12018 return false;
12019 }
12020 if (version >= 132)
12021 {
12023 if (raib)
12024 {
12026 {
12028 return false;
12029 }
12030 }
12031 }
12032
12034 return true;
12035 }
12036
12037
12038
12040 {
12041 super.OnStoreSave(ctx);
12042
12043 PlayerBase player;
12044 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12045 {
12047
12048 int itemQBIndex = -1;
12049 itemQBIndex = player.FindQuickBarEntityIndex(this);
12050 ctx.
Write(itemQBIndex);
12051 }
12052 else
12053 {
12055 }
12056
12058
12060 if (raib)
12061 {
12063 }
12064 }
12065
12066
12068 {
12069 super.AfterStoreLoad();
12070
12072 {
12074 }
12075
12077 {
12080 }
12081 }
12082
12084 {
12085 super.EEOnAfterLoad();
12086
12088 {
12090 }
12091
12094 }
12095
12097 {
12098 return false;
12099 }
12100
12101
12102
12104 {
12106 {
12107 #ifdef PLATFORM_CONSOLE
12108
12110 {
12112 if (menu)
12113 {
12115 }
12116 }
12117 #endif
12118 }
12119
12121 {
12124 }
12125
12127 {
12128 SetWeightDirty();
12130 }
12132 {
12135 }
12136
12138 {
12141 }
12143 {
12146 }
12147
12148 super.OnVariablesSynchronized();
12149 }
12150
12151
12152
12154 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12155 {
12156 if (!IsServerCheck(allow_client))
12157 return false;
12158
12160 return false;
12161
12164
12165 if (value <= (min + 0.001))
12166 value = min;
12167
12168 if (value == min)
12169 {
12170 if (destroy_config)
12171 {
12172 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12173 if (dstr)
12174 {
12176 this.Delete();
12177 return true;
12178 }
12179 }
12180 else if (destroy_forced)
12181 {
12183 this.Delete();
12184 return true;
12185 }
12186
12188 }
12189
12192
12194 {
12196
12197 if (delta)
12199 }
12200
12202
12203 return false;
12204 }
12205
12206
12208 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12209 {
12211 }
12212
12214 {
12217 }
12218
12220 {
12223 }
12224
12227 {
12228 float value_clamped = Math.Clamp(value, 0, 1);
12230 SetQuantity(result, destroy_config, destroy_forced);
12231 }
12232
12233
12236 {
12238 }
12239
12241 {
12243 }
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12255 {
12256 int slot = -1;
12257 if (GetInventory())
12258 {
12259 InventoryLocation il = new InventoryLocation;
12260 GetInventory().GetCurrentInventoryLocation(il);
12262 }
12263
12265 }
12266
12268 {
12269 float quantity_max = 0;
12270
12272 {
12273 if (attSlotID != -1)
12274 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12275
12276 if (quantity_max <= 0)
12278 }
12279
12280 if (quantity_max <= 0)
12282
12283 return quantity_max;
12284 }
12285
12287 {
12289 }
12290
12292 {
12294 }
12295
12296
12298 {
12300 }
12301
12303 {
12305 }
12306
12308 {
12310 }
12311
12312
12314 {
12315
12316 float weightEx = GetWeightEx();
12317 float special = GetInventoryAndCargoWeight();
12318 return weightEx - special;
12319 }
12320
12321
12323 {
12325 }
12326
12328 {
12330 {
12331 #ifdef DEVELOPER
12332 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12333 {
12334 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12336 }
12337 #endif
12338
12339 return GetQuantity() * GetConfigWeightModified();
12340 }
12341 else if (HasEnergyManager())
12342 {
12343 #ifdef DEVELOPER
12344 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12345 {
12346 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12347 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12348 }
12349 #endif
12350 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
12351 }
12352 else
12353 {
12354 #ifdef DEVELOPER
12355 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12356 {
12357 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12358 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12359 }
12360 #endif
12361 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
12362 }
12363 }
12364
12367 {
12368 int item_count = 0;
12370
12371 if (GetInventory().GetCargo() != NULL)
12372 {
12373 item_count = GetInventory().GetCargo().GetItemCount();
12374 }
12375
12376 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12377 {
12378 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12379 if (item)
12380 item_count += item.GetNumberOfItems();
12381 }
12382 return item_count;
12383 }
12384
12387 {
12388 float weight = 0;
12389 float wetness = 1;
12390 if (include_wetness)
12393 {
12394 weight = wetness * m_ConfigWeight;
12395 }
12397 {
12398 weight = 1;
12399 }
12400 return weight;
12401 }
12402
12403
12404
12406 {
12407 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12408 {
12409 GameInventory inv = GetInventory();
12410 array<EntityAI> items = new array<EntityAI>;
12412 for (int i = 0; i < items.Count(); i++)
12413 {
12415 if (item)
12416 {
12418 }
12419 }
12420 }
12421 }
12422
12423
12424
12425
12427 {
12428 float energy = 0;
12429 if (HasEnergyManager())
12430 {
12431 energy = GetCompEM().GetEnergy();
12432 }
12433 return energy;
12434 }
12435
12436
12438 {
12439 super.OnEnergyConsumed();
12440
12442 }
12443
12445 {
12446 super.OnEnergyAdded();
12447
12449 }
12450
12451
12453 {
12454 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12455 {
12457 {
12458 float energy_0to1 = GetCompEM().GetEnergy0To1();
12460 }
12461 }
12462 }
12463
12464
12466 {
12467 return ConfigGetFloat("heatIsolation");
12468 }
12469
12471 {
12473 }
12474
12476 {
12477 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12478 if (
GetGame().ConfigIsExisting(paramPath))
12480
12481 return 0.0;
12482 }
12483
12485 {
12486 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12487 if (
GetGame().ConfigIsExisting(paramPath))
12489
12490 return 0.0;
12491 }
12492
12493 override void SetWet(
float value,
bool allow_client =
false)
12494 {
12495 if (!IsServerCheck(allow_client))
12496 return;
12497
12500
12502
12503 m_VarWet = Math.Clamp(value, min, max);
12504
12506 {
12509 }
12510 }
12511
12512 override void AddWet(
float value)
12513 {
12515 }
12516
12518 {
12520 }
12521
12523 {
12525 }
12526
12528 {
12530 }
12531
12533 {
12535 }
12536
12538 {
12540 }
12541
12542 override void OnWetChanged(
float newVal,
float oldVal)
12543 {
12546 if (newLevel != oldLevel)
12547 {
12549 }
12550 }
12551
12553 {
12554 SetWeightDirty();
12555 }
12556
12558 {
12559 return GetWetLevelInternal(
m_VarWet);
12560 }
12561
12562
12563
12565 {
12567 }
12568
12570 {
12572 }
12573
12575 {
12577 }
12578
12580 {
12582 }
12583
12584
12585
12587 {
12588 if (ConfigIsExisting("itemModelLength"))
12589 {
12590 return ConfigGetFloat("itemModelLength");
12591 }
12592 return 0;
12593 }
12594
12596 {
12597 if (ConfigIsExisting("itemAttachOffset"))
12598 {
12599 return ConfigGetFloat("itemAttachOffset");
12600 }
12601 return 0;
12602 }
12603
12604 override void SetCleanness(
int value,
bool allow_client =
false)
12605 {
12606 if (!IsServerCheck(allow_client))
12607 return;
12608
12610
12612
12615 }
12616
12618 {
12620 }
12621
12623 {
12624 return true;
12625 }
12626
12627
12628
12629
12631 {
12633 }
12634
12636 {
12638 }
12639
12640
12641
12642
12643 override void SetColor(
int r,
int g,
int b,
int a)
12644 {
12650 }
12652 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12653 {
12658 }
12659
12661 {
12663 }
12664
12667 {
12668 int r,g,b,a;
12670 r = r/255;
12671 g = g/255;
12672 b = b/255;
12673 a = a/255;
12674 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12675 }
12676
12677
12678
12679 override void SetLiquidType(
int value,
bool allow_client =
false)
12680 {
12681 if (!IsServerCheck(allow_client))
12682 return;
12683
12688 }
12689
12691 {
12692 return ConfigGetInt("varLiquidTypeInit");
12693 }
12694
12696 {
12698 }
12699
12701 {
12703 SetFrozen(false);
12704 }
12705
12708 {
12709 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12710 }
12711
12712
12715 {
12716 PlayerBase nplayer;
12717 if (PlayerBase.CastTo(nplayer, player))
12718 {
12720
12721 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12722 }
12723 }
12724
12725
12728 {
12729 PlayerBase nplayer;
12730 if (PlayerBase.CastTo(nplayer,player))
12731 {
12732
12733 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12734
12735 }
12736
12737
12738 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12739
12740
12741 if (HasEnergyManager())
12742 {
12743 GetCompEM().UpdatePlugState();
12744 }
12745 }
12746
12747
12749 {
12750 super.OnPlacementStarted(player);
12751
12753 }
12754
12755 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12756 {
12758 {
12759 m_AdminLog.OnPlacementComplete(player,
this);
12760 }
12761
12762 super.OnPlacementComplete(player, position, orientation);
12763 }
12764
12765
12766
12767
12768
12770 {
12772 {
12773 return true;
12774 }
12775 else
12776 {
12777 return false;
12778 }
12779 }
12780
12781
12783 {
12785 {
12787 }
12788 }
12789
12790
12792 {
12794 }
12795
12797 {
12799 }
12800
12801 override void InsertAgent(
int agent,
float count = 1)
12802 {
12803 if (count < 1)
12804 return;
12805
12807 }
12808
12811 {
12813 }
12814
12815
12817 {
12819 }
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12863 {
12865 return false;
12866 return true;
12867 }
12868
12870 {
12871
12873 }
12874
12875
12878 {
12879 super.CheckForRoofLimited(timeTresholdMS);
12880
12882 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12883 {
12884 m_PreviousRoofTestTime = time;
12885 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12886 }
12887 }
12888
12889
12891 {
12893 {
12894 return 0;
12895 }
12896
12897 if (GetInventory().GetAttachmentSlotsCount() != 0)
12898 {
12899 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12900 if (filter)
12901 return filter.GetProtectionLevel(type, false, system);
12902 else
12903 return 0;
12904 }
12905
12906 string subclassPath, entryName;
12907
12908 switch (type)
12909 {
12911 entryName = "biological";
12912 break;
12914 entryName = "chemical";
12915 break;
12916 default:
12917 entryName = "biological";
12918 break;
12919 }
12920
12921 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12922
12924 }
12925
12926
12927
12930 {
12931 if (!IsMagazine())
12933
12935 }
12936
12937
12938
12939
12940
12945 {
12946 return true;
12947 }
12948
12950 {
12952 }
12953
12954
12955
12956
12957
12959 {
12960 if (parent)
12961 {
12962 if (parent.IsInherited(DayZInfected))
12963 return true;
12964
12965 if (!parent.IsRuined())
12966 return true;
12967 }
12968
12969 return true;
12970 }
12971
12973 {
12974 if (!super.CanPutAsAttachment(parent))
12975 {
12976 return false;
12977 }
12978
12979 if (!IsRuined() && !parent.IsRuined())
12980 {
12981 return true;
12982 }
12983
12984 return false;
12985 }
12986
12988 {
12989
12990
12991
12992
12993 return super.CanReceiveItemIntoCargo(item);
12994 }
12995
12997 {
12998
12999
13000
13001
13002 GameInventory attachmentInv = attachment.GetInventory();
13004 {
13005 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13006 return false;
13007 }
13008
13009 InventoryLocation loc = new InventoryLocation();
13010 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13011 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13012 return false;
13013
13014 return super.CanReceiveAttachment(attachment, slotId);
13015 }
13016
13018 {
13019 if (!super.CanReleaseAttachment(attachment))
13020 return false;
13021
13022 return GetInventory().AreChildrenAccessible();
13023 }
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13046 {
13047 int id = muzzle_owner.GetMuzzleID();
13048 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13049
13050 if (WPOF_array)
13051 {
13052 for (int i = 0; i < WPOF_array.Count(); i++)
13053 {
13054 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13055
13056 if (WPOF)
13057 {
13058 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13059 }
13060 }
13061 }
13062 }
13063
13064
13066 {
13067 int id = muzzle_owner.GetMuzzleID();
13069
13070 if (WPOBE_array)
13071 {
13072 for (int i = 0; i < WPOBE_array.Count(); i++)
13073 {
13074 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13075
13076 if (WPOBE)
13077 {
13078 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13079 }
13080 }
13081 }
13082 }
13083
13084
13086 {
13087 int id = muzzle_owner.GetMuzzleID();
13088 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13089
13090 if (WPOOH_array)
13091 {
13092 for (int i = 0; i < WPOOH_array.Count(); i++)
13093 {
13094 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13095
13096 if (WPOOH)
13097 {
13098 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13099 }
13100 }
13101 }
13102 }
13103
13104
13106 {
13107 int id = muzzle_owner.GetMuzzleID();
13108 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13109
13110 if (WPOOH_array)
13111 {
13112 for (int i = 0; i < WPOOH_array.Count(); i++)
13113 {
13114 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13115
13116 if (WPOOH)
13117 {
13118 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13119 }
13120 }
13121 }
13122 }
13123
13124
13126 {
13127 int id = muzzle_owner.GetMuzzleID();
13128 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13129
13130 if (WPOOH_array)
13131 {
13132 for (int i = 0; i < WPOOH_array.Count(); i++)
13133 {
13134 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13135
13136 if (WPOOH)
13137 {
13138 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13139 }
13140 }
13141 }
13142 }
13143
13144
13145
13147 {
13149 {
13150 return true;
13151 }
13152
13153 return false;
13154 }
13155
13157 {
13159 {
13160 return true;
13161 }
13162
13163 return false;
13164 }
13165
13167 {
13169 {
13170 return true;
13171 }
13172
13173 return false;
13174 }
13175
13177 {
13178 return false;
13179 }
13180
13183 {
13184 return UATimeSpent.DEFAULT_DEPLOY;
13185 }
13186
13187
13188
13189
13191 {
13193 SetSynchDirty();
13194 }
13195
13197 {
13199 }
13200
13201
13203 {
13204 return false;
13205 }
13206
13209 {
13210 string att_type = "None";
13211
13212 if (ConfigIsExisting("soundAttType"))
13213 {
13214 att_type = ConfigGetString("soundAttType");
13215 }
13216
13218 }
13219
13221 {
13223 }
13224
13225
13226
13227
13228
13232
13234 {
13237
13239 }
13240
13241
13243 {
13245 return;
13246
13248
13251
13254
13255 SoundParameters params = new SoundParameters();
13259 }
13260
13261
13263 {
13265 return;
13266
13268 SetSynchDirty();
13269
13272 }
13273
13274
13276 {
13278 return;
13279
13281 SetSynchDirty();
13282
13285 }
13286
13288 {
13290 }
13291
13293 {
13295 }
13296
13299 {
13300 if (!
GetGame().IsDedicatedServer())
13301 {
13302 if (ConfigIsExisting("attachSoundSet"))
13303 {
13304 string cfg_path = "";
13305 string soundset = "";
13306 string type_name =
GetType();
13307
13310 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13311 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13312
13313 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13314 {
13315 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13316 {
13317 if (cfg_slot_array[i] == slot_type)
13318 {
13319 soundset = cfg_soundset_array[i];
13320 break;
13321 }
13322 }
13323 }
13324
13325 if (soundset != "")
13326 {
13327 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13329 }
13330 }
13331 }
13332 }
13333
13335 {
13336
13337 }
13338
13339 void OnApply(PlayerBase player);
13340
13342 {
13343 return 1.0;
13344 };
13345
13347 {
13349 }
13350
13352 {
13354 }
13355
13357
13359 {
13360 SetDynamicPhysicsLifeTime(0.01);
13362 }
13363
13365 {
13366 array<string> zone_names = new array<string>;
13367 GetDamageZones(zone_names);
13368 for (int i = 0; i < zone_names.Count(); i++)
13369 {
13370 SetHealthMax(zone_names.Get(i),"Health");
13371 }
13372 SetHealthMax("","Health");
13373 }
13374
13377 {
13378 float global_health = GetHealth01("","Health");
13379 array<string> zones = new array<string>;
13380 GetDamageZones(zones);
13381
13382 for (int i = 0; i < zones.Count(); i++)
13383 {
13384 SetHealth01(zones.Get(i),"Health",global_health);
13385 }
13386 }
13387
13390 {
13391 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13392 }
13393
13395 {
13396 if (!hasRootAsPlayer)
13397 {
13398 if (refParentIB)
13399 {
13400
13401 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13402 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13403
13404 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13405 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13406
13409 }
13410 else
13411 {
13412
13415 }
13416 }
13417 }
13418
13420 {
13422 {
13423 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13424 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13425 {
13426 float heatPermCoef = 1.0;
13428 while (ent)
13429 {
13430 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13431 ent = ent.GetHierarchyParent();
13432 }
13433
13434 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13435 }
13436 }
13437 }
13438
13440 {
13441
13442 EntityAI parent = GetHierarchyParent();
13443 if (!parent)
13444 {
13445 hasParent = false;
13446 hasRootAsPlayer = false;
13447 }
13448 else
13449 {
13450 hasParent = true;
13451 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13452 refParentIB =
ItemBase.Cast(parent);
13453 }
13454 }
13455
13456 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13457 {
13458
13459 }
13460
13462 {
13463
13464 return false;
13465 }
13466
13468 {
13469
13470
13471 return false;
13472 }
13473
13475 {
13476
13477 return false;
13478 }
13479
13482 {
13483 return !GetIsFrozen() &&
IsOpen();
13484 }
13485
13487 {
13488 bool hasParent = false, hasRootAsPlayer = false;
13490
13491 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13492 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13493
13494 if (wwtu || foodDecay)
13495 {
13499
13500 if (processWetness || processTemperature || processDecay)
13501 {
13503
13504 if (processWetness)
13505 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13506
13507 if (processTemperature)
13509
13510 if (processDecay)
13511 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13512 }
13513 }
13514 }
13515
13518 {
13520 }
13521
13523 {
13526
13527 return super.GetTemperatureFreezeThreshold();
13528 }
13529
13531 {
13534
13535 return super.GetTemperatureThawThreshold();
13536 }
13537
13539 {
13542
13543 return super.GetItemOverheatThreshold();
13544 }
13545
13547 {
13549 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13550
13551 return super.GetTemperatureFreezeTime();
13552 }
13553
13555 {
13557 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13558
13559 return super.GetTemperatureThawTime();
13560 }
13561
13566
13568 {
13569 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13570 }
13571
13573 {
13574 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13575 }
13576
13579 {
13581 }
13582
13584 {
13586 }
13587
13589 {
13591 }
13592
13595 {
13596 return null;
13597 }
13598
13601 {
13602 return false;
13603 }
13604
13606 {
13608 {
13611 if (!trg)
13612 {
13614 explosive = this;
13615 }
13616
13617 explosive.PairRemote(trg);
13619
13620 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13621 trg.SetPersistentPairID(persistentID);
13622 explosive.SetPersistentPairID(persistentID);
13623
13624 return true;
13625 }
13626 return false;
13627 }
13628
13631 {
13632 float ret = 1.0;
13635 ret *= GetHealth01();
13636
13637 return ret;
13638 }
13639
13640 #ifdef DEVELOPER
13641 override void SetDebugItem()
13642 {
13643 super.SetDebugItem();
13644 _itemBase = this;
13645 }
13646
13648 {
13649 string text = super.GetDebugText();
13650
13652 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13653
13654 return text;
13655 }
13656 #endif
13657
13659 {
13660 return true;
13661 }
13662
13664
13666
13668 {
13671 }
13672
13673
13681
13697}
13698
13700{
13702 if (entity)
13703 {
13704 bool is_item = entity.IsInherited(
ItemBase);
13705 if (is_item && full_quantity)
13706 {
13709 }
13710 }
13711 else
13712 {
13714 return NULL;
13715 }
13716 return entity;
13717}
13718
13720{
13721 if (item)
13722 {
13723 if (health > 0)
13724 item.SetHealth("", "", health);
13725
13726 if (item.CanHaveTemperature())
13727 {
13729 if (item.CanFreeze())
13730 item.SetFrozen(false);
13731 }
13732
13733 if (item.HasEnergyManager())
13734 {
13735 if (quantity >= 0)
13736 {
13737 item.GetCompEM().SetEnergy0To1(quantity);
13738 }
13739 else
13740 {
13742 }
13743 }
13744 else if (item.IsMagazine())
13745 {
13746 Magazine mag = Magazine.Cast(item);
13747 if (quantity >= 0)
13748 {
13749 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13750 }
13751 else
13752 {
13754 }
13755
13756 }
13757 else
13758 {
13759 if (quantity >= 0)
13760 {
13761 item.SetQuantityNormalized(quantity, false);
13762 }
13763 else
13764 {
13766 }
13767
13768 }
13769 }
13770}
13771
13772#ifdef DEVELOPER
13774#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.