9083{
9085 {
9086 return true;
9087 }
9088};
9089
9090
9091
9093{
9097
9099
9102
9103
9104
9105
9106
9115
9121
9126
9131
9152 protected bool m_IsResultOfSplit
9153
9155
9160
9161
9162
9164
9168
9169
9170
9172
9175
9176
9177
9183
9184
9192
9195
9196
9198
9199
9201
9202
9207
9208
9213
9214
9216
9217
9219 {
9224
9225 if (!
GetGame().IsDedicatedServer())
9226 {
9228 {
9230
9232 {
9234 }
9235 }
9236
9239 }
9240
9241 m_OldLocation = null;
9242
9244 {
9246 }
9247
9248 if (ConfigIsExisting("headSelectionsToHide"))
9249 {
9252 }
9253
9255 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
9256 {
9258 }
9259
9261
9262 m_IsResultOfSplit = false;
9263
9265 }
9266
9268 {
9269 super.InitItemVariables();
9270
9276 m_Count = ConfigGetInt(
"count");
9277
9280
9285
9288
9293
9305
9309
9310
9313 if (ConfigIsExisting("canBeSplit"))
9314 {
9317 }
9318
9320 if (ConfigIsExisting("itemBehaviour"))
9322
9323
9326 RegisterNetSyncVariableInt("m_VarLiquidType");
9327 RegisterNetSyncVariableInt("m_Cleanness",0,1);
9328
9329 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
9330 RegisterNetSyncVariableFloat("m_ImpactSpeed");
9331 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
9332
9333 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
9334 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
9335 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
9336 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
9337
9338 RegisterNetSyncVariableBool("m_IsBeingPlaced");
9339 RegisterNetSyncVariableBool("m_IsTakeable");
9340 RegisterNetSyncVariableBool("m_IsHologram");
9341
9344 {
9347 }
9348
9350
9352 if (ConfigIsExisting("temperaturePerQuantityWeight"))
9354
9355 }
9356
9358 {
9360 }
9361
9363 {
9366 {
9371 }
9372 }
9373
9374 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
9375 {
9377 {
9380 }
9381
9383 }
9384
9386 {
9392 }
9393
9395
9397 {
9399
9400 if (!action)
9401 {
9402 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
9403 return;
9404 }
9405
9407 if (!ai)
9408 {
9410 return;
9411 }
9412
9414 if (!action_array)
9415 {
9416 action_array = new array<ActionBase_Basic>;
9418 }
9419 if (LogManager.IsActionLogEnable())
9420 {
9421 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
9422 }
9423
9424 if (action_array.Find(action) != -1)
9425 {
9426 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
9427 }
9428 else
9429 {
9430 action_array.Insert(action);
9431 }
9432 }
9433
9435 {
9437 ActionBase action = player.GetActionManager().GetAction(actionName);
9440
9441 if (action_array)
9442 {
9443 action_array.RemoveItem(action);
9444 }
9445 }
9446
9447
9448
9450 {
9451 ActionOverrideData overrideData = new ActionOverrideData();
9455
9457 if (!actionMap)
9458 {
9461 }
9462
9463 actionMap.Insert(this.
Type(), overrideData);
9464
9465 }
9466
9468
9470
9471
9473 {
9476
9479
9480 string config_to_search = "CfgVehicles";
9481 string muzzle_owner_config;
9482
9484 {
9485 if (IsInherited(Weapon))
9486 config_to_search = "CfgWeapons";
9487
9488 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9489
9490 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
9491
9493
9494 if (config_OnFire_subclass_count > 0)
9495 {
9496 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
9497
9498 for (int i = 0; i < config_OnFire_subclass_count; i++)
9499 {
9500 string particle_class = "";
9502 string config_OnFire_entry = config_OnFire_class + particle_class;
9503 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
9504 WPOF_array.Insert(WPOF);
9505 }
9506
9507
9509 }
9510 }
9511
9513 {
9514 config_to_search = "CfgWeapons";
9515 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9516
9517 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
9518
9520
9521 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
9522 {
9523 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
9524
9525 for (i = 0; i < config_OnBulletCasingEject_count; i++)
9526 {
9527 string particle_class2 = "";
9529 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
9530 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
9531 WPOBE_array.Insert(WPOBE);
9532 }
9533
9534
9536 }
9537 }
9538 }
9539
9540
9542 {
9545
9547 {
9548 string config_to_search = "CfgVehicles";
9549
9550 if (IsInherited(Weapon))
9551 config_to_search = "CfgWeapons";
9552
9553 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
9554 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
9555
9556 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
9557 {
9558
9560
9562 {
9564 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
9566 return;
9567 }
9568
9571
9572
9573
9575 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9576
9577 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9578 {
9579 string particle_class = "";
9581 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9583
9584 if (entry_type == CT_CLASS)
9585 {
9586 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9587 WPOOH_array.Insert(WPOF);
9588 }
9589 }
9590
9591
9593 }
9594 }
9595 }
9596
9598 {
9600 }
9601
9603 {
9605 {
9607
9610
9613
9614 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9615 }
9616 }
9617
9619 {
9621 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9622
9624 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9625
9627 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9628
9630 {
9632 }
9633 }
9634
9636 {
9638 }
9639
9641 {
9644 else
9646
9648 {
9651 }
9652 else
9653 {
9656
9659 }
9660
9662 }
9663
9665 {
9667 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9668 }
9669
9671 {
9673 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9675 }
9676
9678 {
9680 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9681 }
9682
9684 {
9687
9688 OverheatingParticle OP = new OverheatingParticle();
9693
9695 }
9696
9698 {
9701
9702 return -1;
9703 }
9704
9706 {
9708 {
9711
9712 for (int i = count; i > 0; --i)
9713 {
9714 int id = i - 1;
9717
9720
9721 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9722 {
9723 if (p)
9724 {
9727 }
9728 }
9729 }
9730 }
9731 }
9732
9734 {
9736 {
9738 {
9739 int id = i - 1;
9741
9742 if (OP)
9743 {
9745
9746 if (p)
9747 {
9749 }
9750
9751 delete OP;
9752 }
9753 }
9754
9757 }
9758 }
9759
9762 {
9763 return 0.0;
9764 }
9765
9766
9768 {
9769 return 250;
9770 }
9771
9773 {
9774 return 0;
9775 }
9776
9779 {
9781 return true;
9782
9783 return false;
9784 }
9785
9788 {
9791
9793 {
9795 }
9796 else
9797 {
9798
9800 }
9801
9803 }
9804
9811 {
9812 return -1;
9813 }
9814
9815
9816
9817
9819 {
9821 {
9823 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9824
9825 if (r_index >= 0)
9826 {
9827 InventoryLocation r_il = new InventoryLocation;
9828 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9829
9830 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9833 {
9834 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9835 }
9837 {
9838 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9839 }
9840
9841 }
9842
9843 player.GetHumanInventory().ClearUserReservedLocation(this);
9844 }
9845
9848 }
9849
9850
9851
9852
9854 {
9855 return ItemBase.m_DebugActionsMask;
9856 }
9857
9859 {
9860 return ItemBase.m_DebugActionsMask & mask;
9861 }
9862
9864 {
9865 ItemBase.m_DebugActionsMask = mask;
9866 }
9867
9869 {
9870 ItemBase.m_DebugActionsMask |= mask;
9871 }
9872
9874 {
9875 ItemBase.m_DebugActionsMask &= ~mask;
9876 }
9877
9879 {
9881 {
9883 }
9884 else
9885 {
9887 }
9888 }
9889
9890
9892 {
9893 if (GetEconomyProfile())
9894 {
9895 float q_max = GetEconomyProfile().GetQuantityMax();
9896 if (q_max > 0)
9897 {
9898 float q_min = GetEconomyProfile().GetQuantityMin();
9899 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9900
9902 {
9903 ComponentEnergyManager comp = GetCompEM();
9905 {
9907 }
9908 }
9910 {
9912
9913 }
9914
9915 }
9916 }
9917 }
9918
9921 {
9922 EntityAI parent = GetHierarchyParent();
9923
9924 if (parent)
9925 {
9926 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9927 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9928 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9929 }
9930 }
9931
9934 {
9935 EntityAI parent = GetHierarchyParent();
9936
9937 if (parent)
9938 {
9939 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9940 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9941 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9942 }
9943 }
9944
9946 {
9947
9948
9949
9950
9952
9954 {
9955 if (ScriptInputUserData.CanStoreInputUserData())
9956 {
9957 ScriptInputUserData ctx = new ScriptInputUserData;
9963 ctx.
Write(use_stack_max);
9966
9968 {
9969 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9970 }
9971 }
9972 }
9973 else if (!
GetGame().IsMultiplayer())
9974 {
9976 }
9977 }
9978
9980 {
9982 }
9983
9985 {
9987 }
9988
9990 {
9992 }
9993
9995 {
9996
9997 return false;
9998 }
9999
10001 {
10002 return false;
10003 }
10004
10008 {
10009 return false;
10010 }
10011
10013 {
10014 return "";
10015 }
10016
10018
10020 {
10021 return false;
10022 }
10023
10025 {
10026 return true;
10027 }
10028
10029
10030
10032 {
10033 return true;
10034 }
10035
10037 {
10038 return true;
10039 }
10040
10042 {
10043 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
10045 }
10046
10048 {
10050 }
10051
10053 {
10055 if (!is_being_placed)
10057 SetSynchDirty();
10058 }
10059
10060
10062
10064 {
10066 }
10067
10069 {
10071 }
10072
10074 {
10075 return 1;
10076 }
10077
10079 {
10080 return false;
10081 }
10082
10084 {
10086 SetSynchDirty();
10087 }
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10124 {
10125 super.OnMovedInsideCargo(container);
10126
10127 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10128 }
10129
10130 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
10131 {
10132 super.EEItemLocationChanged(oldLoc,newLoc);
10133
10134 PlayerBase new_player = null;
10135 PlayerBase old_player = null;
10136
10137 if (newLoc.GetParent())
10138 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
10139
10140 if (oldLoc.GetParent())
10141 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
10142
10144 {
10145 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
10146
10147 if (r_index >= 0)
10148 {
10149 InventoryLocation r_il = new InventoryLocation;
10150 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10151
10152 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10155 {
10156 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10157 }
10159 {
10160 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10161 }
10162
10163 }
10164 }
10165
10167 {
10168 if (new_player)
10169 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
10170
10171 if (new_player == old_player)
10172 {
10173
10174 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
10175 {
10177 {
10178 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
10179 {
10180 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10181 }
10182 }
10183 else
10184 {
10185 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
10186 }
10187 }
10188
10189 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
10190 {
10191 int type = oldLoc.GetType();
10193 {
10194 oldLoc.GetParent().GetOnSetLock().Invoke(this);
10195 }
10197 {
10198 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
10199 }
10200 }
10201 if (!m_OldLocation)
10202 {
10203 m_OldLocation = new InventoryLocation;
10204 }
10205 m_OldLocation.Copy(oldLoc);
10206 }
10207 else
10208 {
10209 if (m_OldLocation)
10210 {
10211 m_OldLocation.Reset();
10212 }
10213 }
10214
10216 }
10217 else
10218 {
10219 if (new_player)
10220 {
10221 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
10222 if (res_index >= 0)
10223 {
10224 InventoryLocation il = new InventoryLocation;
10225 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
10227 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
10230 {
10231 il.
GetParent().GetOnReleaseLock().Invoke(it);
10232 }
10234 {
10236 }
10237
10238 }
10239 }
10241 {
10242
10244 }
10245
10246 if (m_OldLocation)
10247 {
10248 m_OldLocation.Reset();
10249 }
10250 }
10251 }
10252
10253 override void EOnContact(IEntity other, Contact extra)
10254 {
10256 {
10257 int liquidType = -1;
10259 if (impactSpeed > 0.0)
10260 {
10262 #ifndef SERVER
10264 #else
10266 SetSynchDirty();
10267 #endif
10269 }
10270 }
10271
10272 #ifdef SERVER
10273 if (GetCompEM() && GetCompEM().IsPlugged())
10274 {
10275 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
10276 GetCompEM().UnplugThis();
10277 }
10278 #endif
10279 }
10280
10282
10284 {
10286 }
10287
10289 {
10290
10291 }
10292
10294 {
10295 super.OnItemLocationChanged(old_owner, new_owner);
10296
10297 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
10298 PlayerBase playerNew = PlayerBase.Cast(new_owner);
10299
10300 if (!relatedPlayer && playerNew)
10301 relatedPlayer = playerNew;
10302
10303 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
10304 {
10306 if (actionMgr)
10307 {
10308 ActionBase currentAction = actionMgr.GetRunningAction();
10309 if (currentAction)
10311 }
10312 }
10313
10314 Man ownerPlayerOld = null;
10315 Man ownerPlayerNew = null;
10316
10317 if (old_owner)
10318 {
10319 if (old_owner.
IsMan())
10320 {
10321 ownerPlayerOld = Man.Cast(old_owner);
10322 }
10323 else
10324 {
10325 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
10326 }
10327 }
10328 else
10329 {
10331 {
10333
10334 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
10335 {
10336 GetCompEM().UnplugThis();
10337 }
10338 }
10339 }
10340
10341 if (new_owner)
10342 {
10343 if (new_owner.
IsMan())
10344 {
10345 ownerPlayerNew = Man.Cast(new_owner);
10346 }
10347 else
10348 {
10349 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
10350 }
10351 }
10352
10353 if (ownerPlayerOld != ownerPlayerNew)
10354 {
10355 if (ownerPlayerOld)
10356 {
10357 array<EntityAI> subItemsExit = new array<EntityAI>;
10359 for (int i = 0; i < subItemsExit.Count(); i++)
10360 {
10363 }
10364 }
10365
10366 if (ownerPlayerNew)
10367 {
10368 array<EntityAI> subItemsEnter = new array<EntityAI>;
10370 for (int j = 0; j < subItemsEnter.Count(); j++)
10371 {
10374 }
10375 }
10376 }
10377 else if (ownerPlayerNew != null)
10378 {
10379 PlayerBase nplayer;
10380 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
10381 {
10382 array<EntityAI> subItemsUpdate = new array<EntityAI>;
10384 for (int k = 0; k < subItemsUpdate.Count(); k++)
10385 {
10387 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
10388 }
10389 }
10390 }
10391
10392 if (old_owner)
10393 old_owner.OnChildItemRemoved(this);
10394 if (new_owner)
10395 new_owner.OnChildItemReceived(this);
10396 }
10397
10398
10400 {
10401 super.EEDelete(parent);
10402 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
10403 if (player)
10404 {
10406
10407 if (player.IsAlive())
10408 {
10409 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
10410 if (r_index >= 0)
10411 {
10412 InventoryLocation r_il = new InventoryLocation;
10413 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
10414
10415 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
10418 {
10419 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
10420 }
10422 {
10423 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
10424 }
10425
10426 }
10427
10428 player.RemoveQuickBarEntityShortcut(this);
10429 }
10430 }
10431 }
10432
10434 {
10435 super.EEKilled(killer);
10436
10439 {
10440 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
10441 {
10442 if (IsMagazine())
10443 {
10444 if (Magazine.Cast(this).GetAmmoCount() > 0)
10445 {
10447 }
10448 }
10449 else
10450 {
10452 }
10453 }
10454 }
10455 }
10456
10458 {
10459 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
10460
10461 super.OnWasAttached(parent, slot_id);
10462
10465
10467 }
10468
10470 {
10471 super.OnWasDetached(parent, slot_id);
10472
10475 }
10476
10478 {
10479 int idx;
10482
10483 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10484 if (inventory_slots.Count() < 1)
10485 {
10486 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
10487 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
10488 }
10489 else
10490 {
10491 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
10492 }
10493
10494 idx = inventory_slots.Find(slot);
10495 if (idx < 0)
10496 return "";
10497
10498 return attach_types.Get(idx);
10499 }
10500
10502 {
10503 int idx = -1;
10504 string slot;
10505
10508
10509 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
10510 if (inventory_slots.Count() < 1)
10511 {
10512 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
10513 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10514 }
10515 else
10516 {
10517 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
10518 if (detach_types.Count() < 1)
10519 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
10520 }
10521
10522 for (int i = 0; i < inventory_slots.Count(); i++)
10523 {
10524 slot = inventory_slots.Get(i);
10525 }
10526
10527 if (slot != "")
10528 {
10529 if (detach_types.Count() == 1)
10530 idx = 0;
10531 else
10532 idx = inventory_slots.Find(slot);
10533 }
10534 if (idx < 0)
10535 return "";
10536
10537 return detach_types.Get(idx);
10538 }
10539
10541 {
10542
10544
10545
10546 float min_time = 1;
10547 float max_time = 3;
10548 float delay = Math.RandomFloat(min_time, max_time);
10549
10550 explode_timer.Run(delay, this, "DoAmmoExplosion");
10551 }
10552
10554 {
10555 Magazine magazine = Magazine.Cast(this);
10556 int pop_sounds_count = 6;
10557 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
10558
10559
10560 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
10561 string sound_name = pop_sounds[ sound_idx ];
10563
10564
10565 magazine.ServerAddAmmoCount(-1);
10566
10567
10568 float min_temp_to_explode = 100;
10569
10570 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10571 {
10573 }
10574 }
10575
10576
10577 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10578 {
10579 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10580
10581 const int CHANCE_DAMAGE_CARGO = 4;
10582 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10583 const int CHANCE_DAMAGE_NOTHING = 2;
10584
10586 {
10587 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10588 int chances;
10589 int rnd;
10590
10591 if (GetInventory().GetCargo())
10592 {
10593 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10594 rnd = Math.RandomInt(0,chances);
10595
10596 if (rnd < CHANCE_DAMAGE_CARGO)
10597 {
10599 }
10600 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10601 {
10603 }
10604 }
10605 else
10606 {
10607 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10608 rnd = Math.RandomInt(0,chances);
10609
10610 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10611 {
10613 }
10614 }
10615 }
10616 }
10617
10619 {
10620 if (GetInventory().GetCargo())
10621 {
10622 int item_count = GetInventory().GetCargo().GetItemCount();
10623 if (item_count > 0)
10624 {
10625 int random_pick = Math.RandomInt(0, item_count);
10627 if (!item.IsExplosive())
10628 {
10629 item.AddHealth("","",damage);
10630 return true;
10631 }
10632 }
10633 }
10634 return false;
10635 }
10636
10638 {
10639 int attachment_count = GetInventory().AttachmentCount();
10640 if (attachment_count > 0)
10641 {
10642 int random_pick = Math.RandomInt(0, attachment_count);
10643 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10644 if (!attachment.IsExplosive())
10645 {
10646 attachment.AddHealth("","",damage);
10647 return true;
10648 }
10649 }
10650 return false;
10651 }
10652
10654 {
10656 }
10657
10659 {
10661 return GetInventory().CanRemoveEntity();
10662
10663 return false;
10664 }
10665
10667 {
10668
10670 return false;
10671
10672
10674 return false;
10675
10676
10677
10679 if (delta == 0)
10680 return false;
10681
10682
10683 return true;
10684 }
10685
10687 {
10689 {
10690 if (ScriptInputUserData.CanStoreInputUserData())
10691 {
10692 ScriptInputUserData ctx = new ScriptInputUserData;
10697 ctx.
Write(destination_entity);
10699 ctx.
Write(slot_id);
10701 }
10702 }
10703 else if (!
GetGame().IsMultiplayer())
10704 {
10706 }
10707 }
10708
10710 {
10711 float split_quantity_new;
10715 InventoryLocation loc = new InventoryLocation;
10716
10717 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10718 {
10720 split_quantity_new = stack_max;
10721 else
10723
10725 {
10726 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10727 if (new_item)
10728 {
10729 new_item.SetResultOfSplit(true);
10730 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10732 new_item.
SetQuantity(split_quantity_new,
false,
true);
10733 }
10734 }
10735 }
10736 else if (destination_entity && slot_id == -1)
10737 {
10738 if (quantity > stack_max)
10739 split_quantity_new = stack_max;
10740 else
10741 split_quantity_new = quantity;
10742
10744 {
10746 {
10749 }
10750
10751 if (new_item)
10752 {
10753 new_item.SetResultOfSplit(true);
10754 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10756 new_item.
SetQuantity(split_quantity_new,
false,
true);
10757 }
10758 }
10759 }
10760 else
10761 {
10762 if (stack_max != 0)
10763 {
10765 {
10767 }
10768
10769 if (split_quantity_new == 0)
10770 {
10771 if (!
GetGame().IsMultiplayer())
10772 player.PhysicalPredictiveDropItem(this);
10773 else
10774 player.ServerDropEntity(this);
10775 return;
10776 }
10777
10779 {
10781
10782 if (new_item)
10783 {
10784 new_item.SetResultOfSplit(true);
10785 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10788 new_item.PlaceOnSurface();
10789 }
10790 }
10791 }
10792 }
10793 }
10794
10796 {
10797 float split_quantity_new;
10801 InventoryLocation loc = new InventoryLocation;
10802
10803 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10804 {
10806 split_quantity_new = stack_max;
10807 else
10809
10811 {
10812 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10813 if (new_item)
10814 {
10815 new_item.SetResultOfSplit(true);
10816 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10818 new_item.
SetQuantity(split_quantity_new,
false,
true);
10819 }
10820 }
10821 }
10822 else if (destination_entity && slot_id == -1)
10823 {
10824 if (quantity > stack_max)
10825 split_quantity_new = stack_max;
10826 else
10827 split_quantity_new = quantity;
10828
10830 {
10832 {
10835 }
10836
10837 if (new_item)
10838 {
10839 new_item.SetResultOfSplit(true);
10840 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10842 new_item.
SetQuantity(split_quantity_new,
false,
true);
10843 }
10844 }
10845 }
10846 else
10847 {
10848 if (stack_max != 0)
10849 {
10851 {
10853 }
10854
10856 {
10858
10859 if (new_item)
10860 {
10861 new_item.SetResultOfSplit(true);
10862 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10865 new_item.PlaceOnSurface();
10866 }
10867 }
10868 }
10869 }
10870 }
10871
10873 {
10875 {
10876 if (ScriptInputUserData.CanStoreInputUserData())
10877 {
10878 ScriptInputUserData ctx = new ScriptInputUserData;
10883 dst.WriteToContext(ctx);
10885 }
10886 }
10887 else if (!
GetGame().IsMultiplayer())
10888 {
10890 }
10891 }
10892
10894 {
10896 {
10897 if (ScriptInputUserData.CanStoreInputUserData())
10898 {
10899 ScriptInputUserData ctx = new ScriptInputUserData;
10904 ctx.
Write(destination_entity);
10910 }
10911 }
10912 else if (!
GetGame().IsMultiplayer())
10913 {
10915 }
10916 }
10917
10919 {
10921 }
10922
10924 {
10926 float split_quantity_new;
10928 if (dst.IsValid())
10929 {
10930 int slot_id = dst.GetSlot();
10932
10933 if (quantity > stack_max)
10934 split_quantity_new = stack_max;
10935 else
10936 split_quantity_new = quantity;
10937
10939 {
10941
10942 if (new_item)
10943 {
10944 new_item.SetResultOfSplit(true);
10945 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10947 new_item.
SetQuantity(split_quantity_new,
false,
true);
10948 }
10949
10950 return new_item;
10951 }
10952 }
10953
10954 return null;
10955 }
10956
10958 {
10960 float split_quantity_new;
10962 if (destination_entity)
10963 {
10965 if (quantity > stackable)
10966 split_quantity_new = stackable;
10967 else
10968 split_quantity_new = quantity;
10969
10971 {
10972 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10973 if (new_item)
10974 {
10975 new_item.SetResultOfSplit(true);
10976 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10978 new_item.
SetQuantity(split_quantity_new,
false,
true);
10979 }
10980 }
10981 }
10982 }
10983
10985 {
10987 {
10988 if (ScriptInputUserData.CanStoreInputUserData())
10989 {
10990 ScriptInputUserData ctx = new ScriptInputUserData;
10995 ItemBase destination_entity =
this;
10996 ctx.
Write(destination_entity);
11000 }
11001 }
11002 else if (!
GetGame().IsMultiplayer())
11003 {
11005 }
11006 }
11007
11009 {
11011 float split_quantity_new;
11013 if (player)
11014 {
11016 if (quantity > stackable)
11017 split_quantity_new = stackable;
11018 else
11019 split_quantity_new = quantity;
11020
11022 {
11023 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
11024 new_item =
ItemBase.Cast(in_hands);
11025 if (new_item)
11026 {
11027 new_item.SetResultOfSplit(true);
11028 MiscGameplayFunctions.TransferItemProperties(this,new_item);
11030 new_item.SetQuantity(split_quantity_new, false, true);
11031 }
11032 }
11033 }
11034 }
11035
11037 {
11039 float split_quantity_new = Math.Floor(quantity * 0.5);
11040
11042 return;
11043
11045
11046 if (new_item)
11047 {
11048 if (new_item.GetQuantityMax() < split_quantity_new)
11049 {
11050 split_quantity_new = new_item.GetQuantityMax();
11051 }
11052
11053 new_item.SetResultOfSplit(true);
11054 MiscGameplayFunctions.TransferItemProperties(this, new_item);
11055
11057 {
11060 }
11061 else
11062 {
11064 new_item.
SetQuantity(split_quantity_new,
false,
true);
11065 }
11066 }
11067 }
11068
11070 {
11072 float split_quantity_new = Math.Floor(quantity / 2);
11073
11075 return;
11076
11077 InventoryLocation invloc = new InventoryLocation;
11079
11081 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
11082
11083 if (new_item)
11084 {
11085 if (new_item.GetQuantityMax() < split_quantity_new)
11086 {
11087 split_quantity_new = new_item.GetQuantityMax();
11088 }
11090 {
11093 }
11094 else if (split_quantity_new > 1)
11095 {
11097 new_item.
SetQuantity(split_quantity_new,
false,
true);
11098 }
11099 }
11100 }
11101
11104 {
11105 SetWeightDirty();
11107
11108 if (parent)
11109 parent.OnAttachmentQuantityChangedEx(this, delta);
11110
11112 {
11114 {
11116 }
11118 {
11119 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
11121 }
11122 }
11123
11124 }
11125
11128 {
11129
11130 }
11131
11134 {
11136 }
11137
11139 {
11140 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
11141
11143 {
11144 if (newLevel == GameConstants.STATE_RUINED)
11145 {
11147 EntityAI parent = GetHierarchyParent();
11148 if (parent && parent.IsFireplace())
11149 {
11150 CargoBase cargo = GetInventory().GetCargo();
11151 if (cargo)
11152 {
11154 {
11156 }
11157 }
11158 }
11159 }
11160
11162 {
11163
11165 return;
11166 }
11167
11168 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
11169 {
11171 }
11172 }
11173 }
11174
11175
11177 {
11178 super.OnRightClick();
11179
11181 {
11183 {
11184 if (ScriptInputUserData.CanStoreInputUserData())
11185 {
11186 EntityAI root = GetHierarchyRoot();
11187 Man playerOwner = GetHierarchyRootPlayer();
11188 InventoryLocation dst = new InventoryLocation;
11189
11190
11191 if (!playerOwner && root && root == this)
11192 {
11194 }
11195 else
11196 {
11197
11198 GetInventory().GetCurrentInventoryLocation(dst);
11200 {
11203 {
11205 }
11206 else
11207 {
11209
11210
11211 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
11212 {
11214 }
11215 else
11216 {
11217 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
11218 }
11219 }
11220 }
11221 }
11222
11223 ScriptInputUserData ctx = new ScriptInputUserData;
11231 }
11232 }
11233 else if (!
GetGame().IsMultiplayer())
11234 {
11236 }
11237 }
11238 }
11239
11241 {
11242 if (root)
11243 {
11244 vector m4[4];
11245 root.GetTransform(m4);
11246 dst.SetGround(this, m4);
11247 }
11248 else
11249 {
11250 GetInventory().GetCurrentInventoryLocation(dst);
11251 }
11252 }
11253
11254 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
11255 {
11256
11257 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
11258 return false;
11259
11260 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
11261 return false;
11262
11263
11265 return false;
11266
11267
11268 Magazine mag = Magazine.Cast(this);
11269 if (mag)
11270 {
11271 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
11272 return false;
11273
11274 if (stack_max_limit)
11275 {
11276 Magazine other_mag = Magazine.Cast(other_item);
11277 if (other_item)
11278 {
11279 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
11280 return false;
11281 }
11282
11283 }
11284 }
11285 else
11286 {
11287
11289 return false;
11290
11292 return false;
11293 }
11294
11295 PlayerBase player = null;
11296 if (CastTo(player, GetHierarchyRootPlayer()))
11297 {
11298 if (player.GetInventory().HasAttachment(this))
11299 return false;
11300
11301 if (player.IsItemsToDelete())
11302 return false;
11303 }
11304
11305 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
11306 return false;
11307
11308 int slotID;
11310 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
11311 return false;
11312
11313 return true;
11314 }
11315
11317 {
11319 }
11320
11322 {
11323 return m_IsResultOfSplit;
11324 }
11325
11327 {
11328 m_IsResultOfSplit = value;
11329 }
11330
11332 {
11334 }
11335
11337 {
11338 float other_item_quantity = other_item.GetQuantity();
11339 float this_free_space;
11340
11342
11344
11345 if (other_item_quantity > this_free_space)
11346 {
11347 return this_free_space;
11348 }
11349 else
11350 {
11351 return other_item_quantity;
11352 }
11353 }
11354
11356 {
11358 }
11359
11361 {
11363 return;
11364
11365 if (!IsMagazine() && other_item)
11366 {
11368 if (quantity_used != 0)
11369 {
11370 float hp1 = GetHealth01("","");
11371 float hp2 = other_item.GetHealth01("","");
11372 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
11373 hpResult = hpResult / (
GetQuantity() + quantity_used);
11374
11375 hpResult *= GetMaxHealth();
11376 Math.Round(hpResult);
11377 SetHealth("", "Health", hpResult);
11378
11380 other_item.AddQuantity(-quantity_used);
11381 }
11382 }
11384 }
11385
11387 {
11388 #ifdef SERVER
11389 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
11390 GetHierarchyParent().IncreaseLifetimeUp();
11391 #endif
11392 };
11393
11395 {
11396 PlayerBase p = PlayerBase.Cast(player);
11397
11398 array<int> recipesIds = p.m_Recipes;
11399 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11400 if (moduleRecipesManager)
11401 {
11402 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
11403 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
11404 }
11405
11406 for (int i = 0;i < recipesIds.Count(); i++)
11407 {
11408 int key = recipesIds.Get(i);
11409 string recipeName = moduleRecipesManager.GetRecipeName(key);
11411 }
11412 }
11413
11414
11415 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
11416 {
11417 super.GetDebugActions(outputList);
11418
11419
11425
11426
11431
11436
11437
11441
11442
11444 {
11448 }
11449
11452
11453
11457
11459
11460 InventoryLocation loc = new InventoryLocation();
11461 GetInventory().GetCurrentInventoryLocation(loc);
11463 {
11464 if (Gizmo_IsSupported())
11467 }
11468
11470 }
11471
11472
11473
11474
11476 {
11477 super.OnAction(action_id, player, ctx);
11478
11480 {
11481 switch (action_id)
11482 {
11485 return true;
11488 return true;
11489 }
11490 }
11491
11493 {
11494 switch (action_id)
11495 {
11497 Delete();
11498 return true;
11499 }
11500 }
11501
11502 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
11503 {
11504 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
11505 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
11506 PlayerBase p = PlayerBase.Cast(player);
11507 if (
EActions.RECIPES_RANGE_START < 1000)
11508 {
11509 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
11510 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
11511 }
11512 }
11513 #ifndef SERVER
11514 else if (action_id ==
EActions.WATCH_PLAYER)
11515 {
11516 PluginDeveloper.SetDeveloperItemClientEx(player);
11517 }
11518 #endif
11520 {
11521 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
11522 {
11523 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
11524 OnDebugButtonPressServer(id + 1);
11525 }
11526
11527 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
11528 {
11529 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
11531 }
11532
11533 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
11534 {
11535 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
11537 }
11538
11539 else if (action_id ==
EActions.ADD_QUANTITY)
11540 {
11541 if (IsMagazine())
11542 {
11543 Magazine mag = Magazine.Cast(this);
11544 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
11545 }
11546 else
11547 {
11549 }
11550
11551 if (m_EM)
11552 {
11553 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
11554 }
11555
11556 }
11557
11558 else if (action_id ==
EActions.REMOVE_QUANTITY)
11559 {
11560 if (IsMagazine())
11561 {
11562 Magazine mag2 = Magazine.Cast(this);
11563 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
11564 }
11565 else
11566 {
11568 }
11569 if (m_EM)
11570 {
11571 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11572 }
11573
11574 }
11575
11576 else if (action_id ==
EActions.SET_QUANTITY_0)
11577 {
11579
11580 if (m_EM)
11581 {
11582 m_EM.SetEnergy(0);
11583 }
11584 }
11585
11586 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11587 {
11589
11590 if (m_EM)
11591 {
11592 m_EM.SetEnergy(m_EM.GetEnergyMax());
11593 }
11594 }
11595
11596 else if (action_id ==
EActions.ADD_HEALTH)
11597 {
11598 AddHealth("","",GetMaxHealth("","Health")/5);
11599 }
11600 else if (action_id ==
EActions.REMOVE_HEALTH)
11601 {
11602 AddHealth("","",-GetMaxHealth("","Health")/5);
11603 }
11604 else if (action_id ==
EActions.DESTROY_HEALTH)
11605 {
11606 SetHealth01("","",0);
11607 }
11608 else if (action_id ==
EActions.WATCH_ITEM)
11609 {
11611 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11612 #ifdef DEVELOPER
11613 SetDebugDeveloper_item(this);
11614 #endif
11615 }
11616
11617 else if (action_id ==
EActions.ADD_TEMPERATURE)
11618 {
11619 AddTemperature(20);
11620
11621 }
11622
11623 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11624 {
11625 AddTemperature(-20);
11626
11627 }
11628
11629 else if (action_id ==
EActions.FLIP_FROZEN)
11630 {
11631 SetFrozen(!GetIsFrozen());
11632
11633 }
11634
11635 else if (action_id ==
EActions.ADD_WETNESS)
11636 {
11638
11639 }
11640
11641 else if (action_id ==
EActions.REMOVE_WETNESS)
11642 {
11644
11645 }
11646
11647 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11648 {
11651
11652
11653 }
11654
11655 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11656 {
11659 }
11660
11661 else if (action_id ==
EActions.MAKE_SPECIAL)
11662 {
11663 auto debugParams = DebugSpawnParams.WithPlayer(player);
11664 OnDebugSpawnEx(debugParams);
11665 }
11666
11667 }
11668
11669
11670 return false;
11671 }
11672
11673
11674
11675
11679
11682
11683
11684
11686 {
11687 return false;
11688 }
11689
11690
11692 {
11693 return true;
11694 }
11695
11696
11698 {
11699 return true;
11700 }
11701
11702
11703
11705 {
11706 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11708 }
11709
11712 {
11713 return null;
11714 }
11715
11717 {
11718 return false;
11719 }
11720
11722 {
11723 return false;
11724 }
11725
11729
11730
11732 {
11733 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11734 return module_repairing.CanRepair(this, item_repair_kit);
11735 }
11736
11737
11738 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11739 {
11740 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11741 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11742 }
11743
11744
11746 {
11747
11748
11749
11750
11751
11752
11753
11754
11755 return 1;
11756 }
11757
11758
11759
11761 {
11763 }
11764
11765
11766
11768 {
11770 }
11771
11772
11781 {
11782 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11783
11784 if (player)
11785 {
11786 player.MessageStatus(text);
11787 }
11788 }
11789
11790
11799 {
11800 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11801
11802 if (player)
11803 {
11804 player.MessageAction(text);
11805 }
11806 }
11807
11808
11817 {
11818 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11819
11820 if (player)
11821 {
11822 player.MessageFriendly(text);
11823 }
11824 }
11825
11826
11835 {
11836 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11837
11838 if (player)
11839 {
11840 player.MessageImportant(text);
11841 }
11842 }
11843
11845 {
11846 return true;
11847 }
11848
11849
11850 override bool KindOf(
string tag)
11851 {
11852 bool found = false;
11853 string item_name = this.
GetType();
11856
11857 int array_size = item_tag_array.Count();
11858 for (int i = 0; i < array_size; i++)
11859 {
11860 if (item_tag_array.Get(i) == tag)
11861 {
11862 found = true;
11863 break;
11864 }
11865 }
11866 return found;
11867 }
11868
11869
11871 {
11872
11873 super.OnRPC(sender, rpc_type,ctx);
11874
11875
11876 switch (rpc_type)
11877 {
11878 #ifndef SERVER
11879 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11880 Param2<bool, string> p = new Param2<bool, string>(false, "");
11881
11883 return;
11884
11885 bool play = p.param1;
11886 string soundSet = p.param2;
11887
11888 if (play)
11889 {
11891 {
11893 {
11895 }
11896 }
11897 else
11898 {
11900 }
11901 }
11902 else
11903 {
11905 }
11906
11907 break;
11908 #endif
11909
11910 }
11911
11913 {
11915 }
11916 }
11917
11918
11919
11920
11922 {
11923 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11924 return plugin.GetID(
name);
11925 }
11926
11928 {
11929 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11930 return plugin.GetName(id);
11931 }
11932
11935 {
11936
11937
11938 int varFlags;
11939 if (!ctx.
Read(varFlags))
11940 return;
11941
11942 if (varFlags & ItemVariableFlags.FLOAT)
11943 {
11945 }
11946 }
11947
11949 {
11950
11951 super.SerializeNumericalVars(floats_out);
11952
11953
11954
11956 {
11958 }
11959
11961 {
11963 }
11964
11966 {
11968 }
11969
11971 {
11976 }
11977
11979 {
11981 }
11982 }
11983
11985 {
11986
11987 super.DeSerializeNumericalVars(floats);
11988
11989
11990 int index = 0;
11991 int mask = Math.Round(floats.Get(index));
11992
11993 index++;
11994
11996 {
11998 {
12000 }
12001 else
12002 {
12003 float quantity = floats.Get(index);
12004 SetQuantity(quantity,
true,
false,
false,
false);
12005 }
12006 index++;
12007 }
12008
12010 {
12011 float wet = floats.Get(index);
12013 index++;
12014 }
12015
12017 {
12018 int liquidtype = Math.Round(floats.Get(index));
12020 index++;
12021 }
12022
12024 {
12026 index++;
12028 index++;
12030 index++;
12032 index++;
12033 }
12034
12036 {
12037 int cleanness = Math.Round(floats.Get(index));
12039 index++;
12040 }
12041 }
12042
12044 {
12045 super.WriteVarsToCTX(ctx);
12046
12047
12049 {
12051 }
12052
12054 {
12056 }
12057
12059 {
12061 }
12062
12064 {
12065 int r,g,b,a;
12071 }
12072
12074 {
12076 }
12077 }
12078
12080 {
12081 if (!super.ReadVarsFromCTX(ctx,version))
12082 return false;
12083
12084 int intValue;
12085 float value;
12086
12087 if (version < 140)
12088 {
12089 if (!ctx.
Read(intValue))
12090 return false;
12091
12092 m_VariablesMask = intValue;
12093 }
12094
12096 {
12097 if (!ctx.
Read(value))
12098 return false;
12099
12101 {
12103 }
12104 else
12105 {
12107 }
12108 }
12109
12110 if (version < 140)
12111 {
12113 {
12114 if (!ctx.
Read(value))
12115 return false;
12116 SetTemperatureDirect(value);
12117 }
12118 }
12119
12121 {
12122 if (!ctx.
Read(value))
12123 return false;
12125 }
12126
12128 {
12129 if (!ctx.
Read(intValue))
12130 return false;
12132 }
12133
12135 {
12136 int r,g,b,a;
12138 return false;
12140 return false;
12142 return false;
12144 return false;
12145
12147 }
12148
12150 {
12151 if (!ctx.
Read(intValue))
12152 return false;
12154 }
12155
12156 if (version >= 138 && version < 140)
12157 {
12159 {
12160 if (!ctx.
Read(intValue))
12161 return false;
12162 SetFrozen(intValue);
12163 }
12164 }
12165
12166 return true;
12167 }
12168
12169
12171 {
12174 {
12176 }
12177
12178 if (!super.OnStoreLoad(ctx, version))
12179 {
12181 return false;
12182 }
12183
12184 if (version >= 114)
12185 {
12186 bool hasQuickBarIndexSaved;
12187
12188 if (!ctx.
Read(hasQuickBarIndexSaved))
12189 {
12191 return false;
12192 }
12193
12194 if (hasQuickBarIndexSaved)
12195 {
12196 int itmQBIndex;
12197
12198
12199 if (!ctx.
Read(itmQBIndex))
12200 {
12202 return false;
12203 }
12204
12205 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
12206 if (itmQBIndex != -1 && parentPlayer)
12207 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
12208 }
12209 }
12210 else
12211 {
12212
12213 PlayerBase player;
12214 int itemQBIndex;
12215 if (version ==
int.
MAX)
12216 {
12217 if (!ctx.
Read(itemQBIndex))
12218 {
12220 return false;
12221 }
12222 }
12223 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
12224 {
12225
12226 if (!ctx.
Read(itemQBIndex))
12227 {
12229 return false;
12230 }
12231 if (itemQBIndex != -1 && player)
12232 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
12233 }
12234 }
12235
12236 if (version < 140)
12237 {
12238
12239 if (!LoadVariables(ctx, version))
12240 {
12242 return false;
12243 }
12244 }
12245
12246
12248 {
12250 return false;
12251 }
12252 if (version >= 132)
12253 {
12255 if (raib)
12256 {
12258 {
12260 return false;
12261 }
12262 }
12263 }
12264
12266 return true;
12267 }
12268
12269
12270
12272 {
12273 super.OnStoreSave(ctx);
12274
12275 PlayerBase player;
12276 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
12277 {
12279
12280 int itemQBIndex = -1;
12281 itemQBIndex = player.FindQuickBarEntityIndex(this);
12282 ctx.
Write(itemQBIndex);
12283 }
12284 else
12285 {
12287 }
12288
12290
12292 if (raib)
12293 {
12295 }
12296 }
12297
12298
12300 {
12301 super.AfterStoreLoad();
12302
12304 {
12306 }
12307
12309 {
12312 }
12313 }
12314
12316 {
12317 super.EEOnAfterLoad();
12318
12320 {
12322 }
12323
12326 }
12327
12329 {
12330 return false;
12331 }
12332
12333
12334
12336 {
12338 {
12339 #ifdef PLATFORM_CONSOLE
12340
12342 {
12344 if (menu)
12345 {
12347 }
12348 }
12349 #endif
12350 }
12351
12353 {
12356 }
12357
12359 {
12360 SetWeightDirty();
12362 }
12364 {
12367 }
12368
12370 {
12373 }
12375 {
12378 }
12379
12380 super.OnVariablesSynchronized();
12381 }
12382
12383
12384
12386 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
12387 {
12388 if (!IsServerCheck(allow_client))
12389 return false;
12390
12392 return false;
12393
12396
12397 if (value <= (min + 0.001))
12398 value = min;
12399
12400 if (value == min)
12401 {
12402 if (destroy_config)
12403 {
12404 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
12405 if (dstr)
12406 {
12408 this.Delete();
12409 return true;
12410 }
12411 }
12412 else if (destroy_forced)
12413 {
12415 this.Delete();
12416 return true;
12417 }
12418
12420 }
12421
12424
12426 {
12428
12429 if (delta)
12431 }
12432
12434
12435 return false;
12436 }
12437
12438
12440 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12441 {
12443 }
12444
12446 {
12449 }
12450
12452 {
12455 }
12456
12458 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
12459 {
12460 float value_clamped = Math.Clamp(value, 0, 1);
12462 SetQuantity(result, destroy_config, destroy_forced);
12463 }
12464
12465
12468 {
12470 }
12471
12473 {
12475 }
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12487 {
12488 int slot = -1;
12489 if (GetInventory())
12490 {
12491 InventoryLocation il = new InventoryLocation;
12492 GetInventory().GetCurrentInventoryLocation(il);
12494 }
12495
12497 }
12498
12500 {
12501 float quantity_max = 0;
12502
12504 {
12505 if (attSlotID != -1)
12506 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
12507
12508 if (quantity_max <= 0)
12510 }
12511
12512 if (quantity_max <= 0)
12514
12515 return quantity_max;
12516 }
12517
12519 {
12521 }
12522
12524 {
12526 }
12527
12528
12530 {
12532 }
12533
12535 {
12537 }
12538
12540 {
12542 }
12543
12544
12546 {
12547
12548 float weightEx = GetWeightEx();
12549 float special = GetInventoryAndCargoWeight();
12550 return weightEx - special;
12551 }
12552
12553
12555 {
12557 }
12558
12560 {
12562 {
12563 #ifdef DEVELOPER
12564 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12565 {
12566 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12568 }
12569 #endif
12570
12571 return GetQuantity() * GetConfigWeightModified();
12572 }
12573 else if (HasEnergyManager())
12574 {
12575 #ifdef DEVELOPER
12576 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12577 {
12578 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12579 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12580 }
12581 #endif
12582 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12583 }
12584 else
12585 {
12586 #ifdef DEVELOPER
12587 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12588 {
12589 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12590 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12591 }
12592 #endif
12593 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12594 }
12595 }
12596
12599 {
12600 int item_count = 0;
12602
12603 if (GetInventory().GetCargo() != NULL)
12604 {
12605 item_count = GetInventory().GetCargo().GetItemCount();
12606 }
12607
12608 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12609 {
12610 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12611 if (item)
12612 item_count += item.GetNumberOfItems();
12613 }
12614 return item_count;
12615 }
12616
12619 {
12620 float weight = 0;
12621 float wetness = 1;
12622 if (include_wetness)
12625 {
12626 weight = wetness * m_ConfigWeight;
12627 }
12629 {
12630 weight = 1;
12631 }
12632 return weight;
12633 }
12634
12635
12636
12638 {
12639 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12640 {
12641 GameInventory inv = GetInventory();
12642 array<EntityAI> items = new array<EntityAI>;
12644 for (int i = 0; i < items.Count(); i++)
12645 {
12647 if (item)
12648 {
12650 }
12651 }
12652 }
12653 }
12654
12655
12656
12657
12659 {
12660 float energy = 0;
12661 if (HasEnergyManager())
12662 {
12663 energy = GetCompEM().GetEnergy();
12664 }
12665 return energy;
12666 }
12667
12668
12670 {
12671 super.OnEnergyConsumed();
12672
12674 }
12675
12677 {
12678 super.OnEnergyAdded();
12679
12681 }
12682
12683
12685 {
12686 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12687 {
12689 {
12690 float energy_0to1 = GetCompEM().GetEnergy0To1();
12692 }
12693 }
12694 }
12695
12696
12698 {
12699 return ConfigGetFloat("heatIsolation");
12700 }
12701
12703 {
12705 }
12706
12708 {
12709 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12710 if (
GetGame().ConfigIsExisting(paramPath))
12712
12713 return 0.0;
12714 }
12715
12717 {
12718 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12719 if (
GetGame().ConfigIsExisting(paramPath))
12721
12722 return 0.0;
12723 }
12724
12725 override void SetWet(
float value,
bool allow_client =
false)
12726 {
12727 if (!IsServerCheck(allow_client))
12728 return;
12729
12732
12734
12735 m_VarWet = Math.Clamp(value, min, max);
12736
12738 {
12741 }
12742 }
12743
12744 override void AddWet(
float value)
12745 {
12747 }
12748
12750 {
12752 }
12753
12755 {
12757 }
12758
12760 {
12762 }
12763
12765 {
12767 }
12768
12770 {
12772 }
12773
12774 override void OnWetChanged(
float newVal,
float oldVal)
12775 {
12778 if (newLevel != oldLevel)
12779 {
12781 }
12782 }
12783
12785 {
12786 SetWeightDirty();
12787 }
12788
12790 {
12791 return GetWetLevelInternal(
m_VarWet);
12792 }
12793
12794
12795
12797 {
12799 }
12800
12802 {
12804 }
12805
12807 {
12809 }
12810
12812 {
12814 }
12815
12816
12817
12819 {
12820 if (ConfigIsExisting("itemModelLength"))
12821 {
12822 return ConfigGetFloat("itemModelLength");
12823 }
12824 return 0;
12825 }
12826
12828 {
12829 if (ConfigIsExisting("itemAttachOffset"))
12830 {
12831 return ConfigGetFloat("itemAttachOffset");
12832 }
12833 return 0;
12834 }
12835
12836 override void SetCleanness(
int value,
bool allow_client =
false)
12837 {
12838 if (!IsServerCheck(allow_client))
12839 return;
12840
12842
12844
12847 }
12848
12850 {
12852 }
12853
12855 {
12856 return true;
12857 }
12858
12859
12860
12861
12863 {
12865 }
12866
12868 {
12870 }
12871
12872
12873
12874
12875 override void SetColor(
int r,
int g,
int b,
int a)
12876 {
12882 }
12884 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12885 {
12890 }
12891
12893 {
12895 }
12896
12899 {
12900 int r,g,b,a;
12902 r = r/255;
12903 g = g/255;
12904 b = b/255;
12905 a = a/255;
12906 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12907 }
12908
12909
12910
12911 override void SetLiquidType(
int value,
bool allow_client =
false)
12912 {
12913 if (!IsServerCheck(allow_client))
12914 return;
12915
12920 }
12921
12923 {
12924 return ConfigGetInt("varLiquidTypeInit");
12925 }
12926
12928 {
12930 }
12931
12933 {
12935 SetFrozen(false);
12936 }
12937
12940 {
12941 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12942 }
12943
12944
12947 {
12948 PlayerBase nplayer;
12949 if (PlayerBase.CastTo(nplayer, player))
12950 {
12952
12953 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12954 }
12955 }
12956
12957
12960 {
12961 PlayerBase nplayer;
12962 if (PlayerBase.CastTo(nplayer,player))
12963 {
12964
12965 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12966
12967 }
12968
12969
12970 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12971
12972
12973 if (HasEnergyManager())
12974 {
12975 GetCompEM().UpdatePlugState();
12976 }
12977 }
12978
12979
12981 {
12982 super.OnPlacementStarted(player);
12983
12985 }
12986
12987 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12988 {
12990 {
12991 m_AdminLog.OnPlacementComplete(player,
this);
12992 }
12993
12994 super.OnPlacementComplete(player, position, orientation);
12995 }
12996
12997
12998
12999
13000
13002 {
13004 {
13005 return true;
13006 }
13007 else
13008 {
13009 return false;
13010 }
13011 }
13012
13013
13015 {
13017 {
13019 }
13020 }
13021
13022
13024 {
13026 }
13027
13029 {
13031 }
13032
13033 override void InsertAgent(
int agent,
float count = 1)
13034 {
13035 if (count < 1)
13036 return;
13037
13039 }
13040
13043 {
13045 }
13046
13047
13049 {
13051 }
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13095 {
13097 return false;
13098 return true;
13099 }
13100
13102 {
13103
13105 }
13106
13107
13110 {
13111 super.CheckForRoofLimited(timeTresholdMS);
13112
13114 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
13115 {
13116 m_PreviousRoofTestTime = time;
13117 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
13118 }
13119 }
13120
13121
13123 {
13125 {
13126 return 0;
13127 }
13128
13129 if (GetInventory().GetAttachmentSlotsCount() != 0)
13130 {
13131 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
13132 if (filter)
13133 return filter.GetProtectionLevel(type, false, system);
13134 else
13135 return 0;
13136 }
13137
13138 string subclassPath, entryName;
13139
13140 switch (type)
13141 {
13143 entryName = "biological";
13144 break;
13146 entryName = "chemical";
13147 break;
13148 default:
13149 entryName = "biological";
13150 break;
13151 }
13152
13153 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
13154
13156 }
13157
13158
13159
13162 {
13163 if (!IsMagazine())
13165
13167 }
13168
13169
13170
13171
13172
13177 {
13178 return true;
13179 }
13180
13182 {
13184 }
13185
13186
13187
13188
13189
13191 {
13192 if (parent)
13193 {
13194 if (parent.IsInherited(DayZInfected))
13195 return true;
13196
13197 if (!parent.IsRuined())
13198 return true;
13199 }
13200
13201 return true;
13202 }
13203
13205 {
13206 if (!super.CanPutAsAttachment(parent))
13207 {
13208 return false;
13209 }
13210
13211 if (!IsRuined() && !parent.IsRuined())
13212 {
13213 return true;
13214 }
13215
13216 return false;
13217 }
13218
13220 {
13221
13222
13223
13224
13225 return super.CanReceiveItemIntoCargo(item);
13226 }
13227
13229 {
13230
13231
13232
13233
13234 GameInventory attachmentInv = attachment.GetInventory();
13236 {
13237 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
13238 return false;
13239 }
13240
13241 InventoryLocation loc = new InventoryLocation();
13242 attachment.GetInventory().GetCurrentInventoryLocation(loc);
13243 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
13244 return false;
13245
13246 return super.CanReceiveAttachment(attachment, slotId);
13247 }
13248
13250 {
13251 if (!super.CanReleaseAttachment(attachment))
13252 return false;
13253
13254 return GetInventory().AreChildrenAccessible();
13255 }
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13278 {
13279 int id = muzzle_owner.GetMuzzleID();
13280 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
13281
13282 if (WPOF_array)
13283 {
13284 for (int i = 0; i < WPOF_array.Count(); i++)
13285 {
13286 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
13287
13288 if (WPOF)
13289 {
13290 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
13291 }
13292 }
13293 }
13294 }
13295
13296
13298 {
13299 int id = muzzle_owner.GetMuzzleID();
13301
13302 if (WPOBE_array)
13303 {
13304 for (int i = 0; i < WPOBE_array.Count(); i++)
13305 {
13306 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
13307
13308 if (WPOBE)
13309 {
13310 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13311 }
13312 }
13313 }
13314 }
13315
13316
13318 {
13319 int id = muzzle_owner.GetMuzzleID();
13320 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13321
13322 if (WPOOH_array)
13323 {
13324 for (int i = 0; i < WPOOH_array.Count(); i++)
13325 {
13326 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13327
13328 if (WPOOH)
13329 {
13330 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
13331 }
13332 }
13333 }
13334 }
13335
13336
13338 {
13339 int id = muzzle_owner.GetMuzzleID();
13340 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13341
13342 if (WPOOH_array)
13343 {
13344 for (int i = 0; i < WPOOH_array.Count(); i++)
13345 {
13346 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13347
13348 if (WPOOH)
13349 {
13350 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13351 }
13352 }
13353 }
13354 }
13355
13356
13358 {
13359 int id = muzzle_owner.GetMuzzleID();
13360 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
13361
13362 if (WPOOH_array)
13363 {
13364 for (int i = 0; i < WPOOH_array.Count(); i++)
13365 {
13366 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
13367
13368 if (WPOOH)
13369 {
13370 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
13371 }
13372 }
13373 }
13374 }
13375
13376
13377
13379 {
13381 {
13382 return true;
13383 }
13384
13385 return false;
13386 }
13387
13389 {
13391 {
13392 return true;
13393 }
13394
13395 return false;
13396 }
13397
13399 {
13401 {
13402 return true;
13403 }
13404
13405 return false;
13406 }
13407
13409 {
13410 return false;
13411 }
13412
13415 {
13416 return UATimeSpent.DEFAULT_DEPLOY;
13417 }
13418
13419
13420
13421
13423 {
13425 SetSynchDirty();
13426 }
13427
13429 {
13431 }
13432
13433
13435 {
13436 return false;
13437 }
13438
13441 {
13442 string att_type = "None";
13443
13444 if (ConfigIsExisting("soundAttType"))
13445 {
13446 att_type = ConfigGetString("soundAttType");
13447 }
13448
13450 }
13451
13453 {
13455 }
13456
13457
13458
13459
13460
13466
13468 {
13471
13473 }
13474
13475
13477 {
13479 return;
13480
13482
13485
13488
13489 SoundParameters params = new SoundParameters();
13493 }
13494
13495
13497 {
13499 return;
13500
13502 SetSynchDirty();
13503
13506 }
13507
13508
13510 {
13512 return;
13513
13515 SetSynchDirty();
13516
13519 }
13520
13522 {
13524 }
13525
13527 {
13529 }
13530
13533 {
13534 if (!
GetGame().IsDedicatedServer())
13535 {
13536 if (ConfigIsExisting("attachSoundSet"))
13537 {
13538 string cfg_path = "";
13539 string soundset = "";
13540 string type_name =
GetType();
13541
13544 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
13545 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
13546
13547 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
13548 {
13549 for (int i = 0; i < cfg_soundset_array.Count(); i++)
13550 {
13551 if (cfg_slot_array[i] == slot_type)
13552 {
13553 soundset = cfg_soundset_array[i];
13554 break;
13555 }
13556 }
13557 }
13558
13559 if (soundset != "")
13560 {
13561 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
13563 }
13564 }
13565 }
13566 }
13567
13569 {
13570
13571 }
13572
13573 void OnApply(PlayerBase player);
13574
13576 {
13577 return 1.0;
13578 };
13579
13581 {
13583 }
13584
13586 {
13588 }
13589
13591
13593 {
13594 SetDynamicPhysicsLifeTime(0.01);
13596 }
13597
13599 {
13600 array<string> zone_names = new array<string>;
13601 GetDamageZones(zone_names);
13602 for (int i = 0; i < zone_names.Count(); i++)
13603 {
13604 SetHealthMax(zone_names.Get(i),"Health");
13605 }
13606 SetHealthMax("","Health");
13607 }
13608
13611 {
13612 float global_health = GetHealth01("","Health");
13613 array<string> zones = new array<string>;
13614 GetDamageZones(zones);
13615
13616 for (int i = 0; i < zones.Count(); i++)
13617 {
13618 SetHealth01(zones.Get(i),"Health",global_health);
13619 }
13620 }
13621
13624 {
13625 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13626 }
13627
13629 {
13630 if (!hasRootAsPlayer)
13631 {
13632 if (refParentIB)
13633 {
13634
13635 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13636 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13637
13638 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13639 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13640
13643 }
13644 else
13645 {
13646
13649 }
13650 }
13651 }
13652
13654 {
13656 {
13657 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13658 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13659 {
13660 float heatPermCoef = 1.0;
13662 while (ent)
13663 {
13664 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13665 ent = ent.GetHierarchyParent();
13666 }
13667
13668 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13669 }
13670 }
13671 }
13672
13674 {
13675
13676 EntityAI parent = GetHierarchyParent();
13677 if (!parent)
13678 {
13679 hasParent = false;
13680 hasRootAsPlayer = false;
13681 }
13682 else
13683 {
13684 hasParent = true;
13685 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13686 refParentIB =
ItemBase.Cast(parent);
13687 }
13688 }
13689
13690 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13691 {
13692
13693 }
13694
13696 {
13697
13698 return false;
13699 }
13700
13702 {
13703
13704
13705 return false;
13706 }
13707
13709 {
13710
13711 return false;
13712 }
13713
13716 {
13717 return !GetIsFrozen() &&
IsOpen();
13718 }
13719
13721 {
13722 bool hasParent = false, hasRootAsPlayer = false;
13724
13725 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13726 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13727
13728 if (wwtu || foodDecay)
13729 {
13733
13734 if (processWetness || processTemperature || processDecay)
13735 {
13737
13738 if (processWetness)
13739 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13740
13741 if (processTemperature)
13743
13744 if (processDecay)
13745 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13746 }
13747 }
13748 }
13749
13752 {
13754 }
13755
13757 {
13760
13761 return super.GetTemperatureFreezeThreshold();
13762 }
13763
13765 {
13768
13769 return super.GetTemperatureThawThreshold();
13770 }
13771
13773 {
13776
13777 return super.GetItemOverheatThreshold();
13778 }
13779
13781 {
13783 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13784
13785 return super.GetTemperatureFreezeTime();
13786 }
13787
13789 {
13791 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13792
13793 return super.GetTemperatureThawTime();
13794 }
13795
13800
13802 {
13803 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13804 }
13805
13807 {
13808 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13809 }
13810
13813 {
13815 }
13816
13818 {
13820 }
13821
13823 {
13825 }
13826
13829 {
13830 return null;
13831 }
13832
13835 {
13836 return false;
13837 }
13838
13840 {
13842 {
13845 if (!trg)
13846 {
13848 explosive = this;
13849 }
13850
13851 explosive.PairRemote(trg);
13853
13854 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13855 trg.SetPersistentPairID(persistentID);
13856 explosive.SetPersistentPairID(persistentID);
13857
13858 return true;
13859 }
13860 return false;
13861 }
13862
13865 {
13866 float ret = 1.0;
13869 ret *= GetHealth01();
13870
13871 return ret;
13872 }
13873
13874 #ifdef DEVELOPER
13875 override void SetDebugItem()
13876 {
13877 super.SetDebugItem();
13878 _itemBase = this;
13879 }
13880
13882 {
13883 string text = super.GetDebugText();
13884
13886 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13887
13888 return text;
13889 }
13890 #endif
13891
13893 {
13894 return true;
13895 }
13896
13898
13900
13902 {
13905 }
13906
13907
13915
13931}
13932
13934{
13936 if (entity)
13937 {
13938 bool is_item = entity.IsInherited(
ItemBase);
13939 if (is_item && full_quantity)
13940 {
13943 }
13944 }
13945 else
13946 {
13948 return NULL;
13949 }
13950 return entity;
13951}
13952
13954{
13955 if (item)
13956 {
13957 if (health > 0)
13958 item.SetHealth("", "", health);
13959
13960 if (item.CanHaveTemperature())
13961 {
13963 if (item.CanFreeze())
13964 item.SetFrozen(false);
13965 }
13966
13967 if (item.HasEnergyManager())
13968 {
13969 if (quantity >= 0)
13970 {
13971 item.GetCompEM().SetEnergy0To1(quantity);
13972 }
13973 else
13974 {
13976 }
13977 }
13978 else if (item.IsMagazine())
13979 {
13980 Magazine mag = Magazine.Cast(item);
13981 if (quantity >= 0)
13982 {
13983 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13984 }
13985 else
13986 {
13988 }
13989
13990 }
13991 else
13992 {
13993 if (quantity >= 0)
13994 {
13995 item.SetQuantityNormalized(quantity, false);
13996 }
13997 else
13998 {
14000 }
14001
14002 }
14003 }
14004}
14005
14006#ifdef DEVELOPER
14008#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.