8508{
8510 {
8511 return true;
8512 }
8513};
8514
8515
8516
8518{
8522
8524
8527
8528
8529
8530
8531
8540
8546
8551
8556
8577 protected bool m_IsResultOfSplit
8578
8580
8585
8586
8587
8589
8593
8594
8595
8597
8600
8601
8602
8608
8609
8617
8620
8621
8623
8624
8626
8627
8632
8633
8638
8639
8641
8642
8644 {
8649
8650 if (!
GetGame().IsDedicatedServer())
8651 {
8653 {
8655
8657 {
8659 }
8660 }
8661
8664 }
8665
8666 m_OldLocation = null;
8667
8669 {
8671 }
8672
8673 if (ConfigIsExisting("headSelectionsToHide"))
8674 {
8677 }
8678
8680 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8681 {
8683 }
8684
8686
8687 m_IsResultOfSplit = false;
8688
8690 }
8691
8693 {
8694 super.InitItemVariables();
8695
8701 m_Count = ConfigGetInt(
"count");
8702
8705
8710
8713
8718
8730
8734
8735
8738 if (ConfigIsExisting("canBeSplit"))
8739 {
8742 }
8743
8745 if (ConfigIsExisting("itemBehaviour"))
8747
8748
8751 RegisterNetSyncVariableInt("m_VarLiquidType");
8752 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8753
8754 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8755 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8756 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8757
8758 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8759 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8760 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8761 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8762
8763 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8764 RegisterNetSyncVariableBool("m_IsTakeable");
8765 RegisterNetSyncVariableBool("m_IsHologram");
8766
8769 {
8772 }
8773
8775
8777 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8779
8780 }
8781
8783 {
8785 }
8786
8788 {
8791 {
8796 }
8797 }
8798
8799 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8800 {
8802 {
8805 }
8806
8808 }
8809
8811 {
8817 }
8818
8820
8822 {
8824
8825 if (!action)
8826 {
8827 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8828 return;
8829 }
8830
8832 if (!ai)
8833 {
8835 return;
8836 }
8837
8839 if (!action_array)
8840 {
8841 action_array = new array<ActionBase_Basic>;
8843 }
8844 if (LogManager.IsActionLogEnable())
8845 {
8846 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8847 }
8848
8849 if (action_array.Find(action) != -1)
8850 {
8851 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8852 }
8853 else
8854 {
8855 action_array.Insert(action);
8856 }
8857 }
8858
8860 {
8862 ActionBase action = player.GetActionManager().GetAction(actionName);
8865
8866 if (action_array)
8867 {
8868 action_array.RemoveItem(action);
8869 }
8870 }
8871
8872
8873
8875 {
8876 ActionOverrideData overrideData = new ActionOverrideData();
8880
8882 if (!actionMap)
8883 {
8886 }
8887
8888 actionMap.Insert(this.
Type(), overrideData);
8889
8890 }
8891
8893
8895
8896
8898 {
8901
8904
8905 string config_to_search = "CfgVehicles";
8906 string muzzle_owner_config;
8907
8909 {
8910 if (IsInherited(Weapon))
8911 config_to_search = "CfgWeapons";
8912
8913 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8914
8915 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8916
8918
8919 if (config_OnFire_subclass_count > 0)
8920 {
8921 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8922
8923 for (int i = 0; i < config_OnFire_subclass_count; i++)
8924 {
8925 string particle_class = "";
8927 string config_OnFire_entry = config_OnFire_class + particle_class;
8928 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8929 WPOF_array.Insert(WPOF);
8930 }
8931
8932
8934 }
8935 }
8936
8938 {
8939 config_to_search = "CfgWeapons";
8940 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8941
8942 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8943
8945
8946 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8947 {
8948 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8949
8950 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8951 {
8952 string particle_class2 = "";
8954 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8955 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8956 WPOBE_array.Insert(WPOBE);
8957 }
8958
8959
8961 }
8962 }
8963 }
8964
8965
8967 {
8970
8972 {
8973 string config_to_search = "CfgVehicles";
8974
8975 if (IsInherited(Weapon))
8976 config_to_search = "CfgWeapons";
8977
8978 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8979 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8980
8981 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8982 {
8983
8985
8987 {
8989 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8991 return;
8992 }
8993
8996
8997
8998
9000 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9001
9002 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9003 {
9004 string particle_class = "";
9006 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9008
9009 if (entry_type == CT_CLASS)
9010 {
9011 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9012 WPOOH_array.Insert(WPOF);
9013 }
9014 }
9015
9016
9018 }
9019 }
9020 }
9021
9023 {
9025 }
9026
9028 {
9030 {
9032
9035
9038
9039 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9040 }
9041 }
9042
9044 {
9046 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9047
9049 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9050
9052 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9053
9055 {
9057 }
9058 }
9059
9061 {
9063 }
9064
9066 {
9069 else
9071
9073 {
9076 }
9077 else
9078 {
9081
9084 }
9085
9087 }
9088
9090 {
9092 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9093 }
9094
9096 {
9098 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9100 }
9101
9103 {
9105 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9106 }
9107
9109 {
9112
9113 OverheatingParticle OP = new OverheatingParticle();
9118
9120 }
9121
9123 {
9126
9127 return -1;
9128 }
9129
9131 {
9133 {
9136
9137 for (int i = count; i > 0; --i)
9138 {
9139 int id = i - 1;
9142
9145
9146 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9147 {
9148 if (p)
9149 {
9152 }
9153 }
9154 }
9155 }
9156 }
9157
9159 {
9161 {
9163 {
9164 int id = i - 1;
9166
9167 if (OP)
9168 {
9170
9171 if (p)
9172 {
9174 }
9175
9176 delete OP;
9177 }
9178 }
9179
9182 }
9183 }
9184
9187 {
9188 return 0.0;
9189 }
9190
9191
9193 {
9194 return 250;
9195 }
9196
9198 {
9199 return 0;
9200 }
9201
9204 {
9206 return true;
9207
9208 return false;
9209 }
9210
9213 {
9216
9218 {
9220 }
9221 else
9222 {
9223
9225 }
9226
9228 }
9229
9236 {
9237 return -1;
9238 }
9239
9240
9241
9242
9244 {
9246 {
9248 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9249
9250 if (r_index >= 0)
9251 {
9252 InventoryLocation r_il = new InventoryLocation;
9253 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9254
9255 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9258 {
9259 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9260 }
9262 {
9263 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9264 }
9265
9266 }
9267
9268 player.GetHumanInventory().ClearUserReservedLocation(this);
9269 }
9270
9273 }
9274
9275
9276
9277
9279 {
9280 return ItemBase.m_DebugActionsMask;
9281 }
9282
9284 {
9285 return ItemBase.m_DebugActionsMask & mask;
9286 }
9287
9289 {
9290 ItemBase.m_DebugActionsMask = mask;
9291 }
9292
9294 {
9295 ItemBase.m_DebugActionsMask |= mask;
9296 }
9297
9299 {
9300 ItemBase.m_DebugActionsMask &= ~mask;
9301 }
9302
9304 {
9306 {
9308 }
9309 else
9310 {
9312 }
9313 }
9314
9315
9317 {
9318 if (GetEconomyProfile())
9319 {
9320 float q_max = GetEconomyProfile().GetQuantityMax();
9321 if (q_max > 0)
9322 {
9323 float q_min = GetEconomyProfile().GetQuantityMin();
9324 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9325
9327 {
9328 ComponentEnergyManager comp = GetCompEM();
9330 {
9332 }
9333 }
9335 {
9337
9338 }
9339
9340 }
9341 }
9342 }
9343
9346 {
9347 EntityAI parent = GetHierarchyParent();
9348
9349 if (parent)
9350 {
9351 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9352 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9353 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9354 }
9355 }
9356
9359 {
9360 EntityAI parent = GetHierarchyParent();
9361
9362 if (parent)
9363 {
9364 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9365 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9366 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9367 }
9368 }
9369
9371 {
9372
9373
9374
9375
9377
9379 {
9380 if (ScriptInputUserData.CanStoreInputUserData())
9381 {
9382 ScriptInputUserData ctx = new ScriptInputUserData;
9388 ctx.
Write(use_stack_max);
9391
9393 {
9394 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9395 }
9396 }
9397 }
9398 else if (!
GetGame().IsMultiplayer())
9399 {
9401 }
9402 }
9403
9405 {
9407 }
9408
9410 {
9412 }
9413
9415 {
9417 }
9418
9420 {
9421
9422 return false;
9423 }
9424
9426 {
9427 return false;
9428 }
9429
9433 {
9434 return false;
9435 }
9436
9438 {
9439 return "";
9440 }
9441
9443
9445 {
9446 return false;
9447 }
9448
9450 {
9451 return true;
9452 }
9453
9454
9455
9457 {
9458 return true;
9459 }
9460
9462 {
9463 return true;
9464 }
9465
9467 {
9468 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9470 }
9471
9473 {
9475 }
9476
9478 {
9480 if (!is_being_placed)
9482 SetSynchDirty();
9483 }
9484
9485
9487
9489 {
9491 }
9492
9494 {
9496 }
9497
9499 {
9500 return 1;
9501 }
9502
9504 {
9505 return false;
9506 }
9507
9509 {
9511 SetSynchDirty();
9512 }
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9549 {
9550 super.OnMovedInsideCargo(container);
9551
9552 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9553 }
9554
9555 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9556 {
9557 super.EEItemLocationChanged(oldLoc,newLoc);
9558
9559 PlayerBase new_player = null;
9560 PlayerBase old_player = null;
9561
9562 if (newLoc.GetParent())
9563 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9564
9565 if (oldLoc.GetParent())
9566 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9567
9569 {
9570 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9571
9572 if (r_index >= 0)
9573 {
9574 InventoryLocation r_il = new InventoryLocation;
9575 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9576
9577 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9580 {
9581 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9582 }
9584 {
9585 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9586 }
9587
9588 }
9589 }
9590
9592 {
9593 if (new_player)
9594 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9595
9596 if (new_player == old_player)
9597 {
9598
9599 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9600 {
9602 {
9603 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9604 {
9605 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9606 }
9607 }
9608 else
9609 {
9610 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9611 }
9612 }
9613
9614 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9615 {
9616 int type = oldLoc.GetType();
9618 {
9619 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9620 }
9622 {
9623 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9624 }
9625 }
9626 if (!m_OldLocation)
9627 {
9628 m_OldLocation = new InventoryLocation;
9629 }
9630 m_OldLocation.Copy(oldLoc);
9631 }
9632 else
9633 {
9634 if (m_OldLocation)
9635 {
9636 m_OldLocation.Reset();
9637 }
9638 }
9639
9641 }
9642 else
9643 {
9644 if (new_player)
9645 {
9646 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9647 if (res_index >= 0)
9648 {
9649 InventoryLocation il = new InventoryLocation;
9650 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9652 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9655 {
9656 il.
GetParent().GetOnReleaseLock().Invoke(it);
9657 }
9659 {
9661 }
9662
9663 }
9664 }
9666 {
9667
9669 }
9670
9671 if (m_OldLocation)
9672 {
9673 m_OldLocation.Reset();
9674 }
9675 }
9676 }
9677
9678 override void EOnContact(IEntity other, Contact extra)
9679 {
9681 {
9682 int liquidType = -1;
9684 if (impactSpeed > 0.0)
9685 {
9687 #ifndef SERVER
9689 #else
9691 SetSynchDirty();
9692 #endif
9694 }
9695 }
9696
9697 #ifdef SERVER
9698 if (GetCompEM() && GetCompEM().IsPlugged())
9699 {
9700 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9701 GetCompEM().UnplugThis();
9702 }
9703 #endif
9704 }
9705
9707
9709 {
9711 }
9712
9714 {
9715
9716 }
9717
9719 {
9720 super.OnItemLocationChanged(old_owner, new_owner);
9721
9722 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9723 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9724
9725 if (!relatedPlayer && playerNew)
9726 relatedPlayer = playerNew;
9727
9728 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9729 {
9731 if (actionMgr)
9732 {
9733 ActionBase currentAction = actionMgr.GetRunningAction();
9734 if (currentAction)
9736 }
9737 }
9738
9739 Man ownerPlayerOld = null;
9740 Man ownerPlayerNew = null;
9741
9742 if (old_owner)
9743 {
9744 if (old_owner.
IsMan())
9745 {
9746 ownerPlayerOld = Man.Cast(old_owner);
9747 }
9748 else
9749 {
9750 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9751 }
9752 }
9753 else
9754 {
9756 {
9758
9759 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9760 {
9761 GetCompEM().UnplugThis();
9762 }
9763 }
9764 }
9765
9766 if (new_owner)
9767 {
9768 if (new_owner.
IsMan())
9769 {
9770 ownerPlayerNew = Man.Cast(new_owner);
9771 }
9772 else
9773 {
9774 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9775 }
9776 }
9777
9778 if (ownerPlayerOld != ownerPlayerNew)
9779 {
9780 if (ownerPlayerOld)
9781 {
9782 array<EntityAI> subItemsExit = new array<EntityAI>;
9784 for (int i = 0; i < subItemsExit.Count(); i++)
9785 {
9788 }
9789 }
9790
9791 if (ownerPlayerNew)
9792 {
9793 array<EntityAI> subItemsEnter = new array<EntityAI>;
9795 for (int j = 0; j < subItemsEnter.Count(); j++)
9796 {
9799 }
9800 }
9801 }
9802 else if (ownerPlayerNew != null)
9803 {
9804 PlayerBase nplayer;
9805 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9806 {
9807 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9809 for (int k = 0; k < subItemsUpdate.Count(); k++)
9810 {
9812 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9813 }
9814 }
9815 }
9816
9817 if (old_owner)
9818 old_owner.OnChildItemRemoved(this);
9819 if (new_owner)
9820 new_owner.OnChildItemReceived(this);
9821 }
9822
9823
9825 {
9826 super.EEDelete(parent);
9827 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9828 if (player)
9829 {
9831
9832 if (player.IsAlive())
9833 {
9834 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9835 if (r_index >= 0)
9836 {
9837 InventoryLocation r_il = new InventoryLocation;
9838 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9839
9840 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9843 {
9844 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9845 }
9847 {
9848 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9849 }
9850
9851 }
9852
9853 player.RemoveQuickBarEntityShortcut(this);
9854 }
9855 }
9856 }
9857
9859 {
9860 super.EEKilled(killer);
9861
9864 {
9865 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9866 {
9867 if (IsMagazine())
9868 {
9869 if (Magazine.Cast(this).GetAmmoCount() > 0)
9870 {
9872 }
9873 }
9874 else
9875 {
9877 }
9878 }
9879 }
9880 }
9881
9883 {
9884 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9885
9886 super.OnWasAttached(parent, slot_id);
9887
9890
9892 }
9893
9895 {
9896 super.OnWasDetached(parent, slot_id);
9897
9900 }
9901
9903 {
9904 int idx;
9907
9908 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9909 if (inventory_slots.Count() < 1)
9910 {
9911 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9912 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9913 }
9914 else
9915 {
9916 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9917 }
9918
9919 idx = inventory_slots.Find(slot);
9920 if (idx < 0)
9921 return "";
9922
9923 return attach_types.Get(idx);
9924 }
9925
9927 {
9928 int idx = -1;
9929 string slot;
9930
9933
9934 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9935 if (inventory_slots.Count() < 1)
9936 {
9937 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9938 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9939 }
9940 else
9941 {
9942 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9943 if (detach_types.Count() < 1)
9944 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9945 }
9946
9947 for (int i = 0; i < inventory_slots.Count(); i++)
9948 {
9949 slot = inventory_slots.Get(i);
9950 }
9951
9952 if (slot != "")
9953 {
9954 if (detach_types.Count() == 1)
9955 idx = 0;
9956 else
9957 idx = inventory_slots.Find(slot);
9958 }
9959 if (idx < 0)
9960 return "";
9961
9962 return detach_types.Get(idx);
9963 }
9964
9966 {
9967
9969
9970
9971 float min_time = 1;
9972 float max_time = 3;
9973 float delay = Math.RandomFloat(min_time, max_time);
9974
9975 explode_timer.Run(delay, this, "DoAmmoExplosion");
9976 }
9977
9979 {
9980 Magazine magazine = Magazine.Cast(this);
9981 int pop_sounds_count = 6;
9982 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9983
9984
9985 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9986 string sound_name = pop_sounds[ sound_idx ];
9988
9989
9990 magazine.ServerAddAmmoCount(-1);
9991
9992
9993 float min_temp_to_explode = 100;
9994
9995 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9996 {
9998 }
9999 }
10000
10001
10002 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10003 {
10004 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10005
10006 const int CHANCE_DAMAGE_CARGO = 4;
10007 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10008 const int CHANCE_DAMAGE_NOTHING = 2;
10009
10011 {
10012 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10013 int chances;
10014 int rnd;
10015
10016 if (GetInventory().GetCargo())
10017 {
10018 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10019 rnd = Math.RandomInt(0,chances);
10020
10021 if (rnd < CHANCE_DAMAGE_CARGO)
10022 {
10024 }
10025 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10026 {
10028 }
10029 }
10030 else
10031 {
10032 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10033 rnd = Math.RandomInt(0,chances);
10034
10035 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10036 {
10038 }
10039 }
10040 }
10041 }
10042
10044 {
10045 if (GetInventory().GetCargo())
10046 {
10047 int item_count = GetInventory().GetCargo().GetItemCount();
10048 if (item_count > 0)
10049 {
10050 int random_pick = Math.RandomInt(0, item_count);
10052 if (!item.IsExplosive())
10053 {
10054 item.AddHealth("","",damage);
10055 return true;
10056 }
10057 }
10058 }
10059 return false;
10060 }
10061
10063 {
10064 int attachment_count = GetInventory().AttachmentCount();
10065 if (attachment_count > 0)
10066 {
10067 int random_pick = Math.RandomInt(0, attachment_count);
10068 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10069 if (!attachment.IsExplosive())
10070 {
10071 attachment.AddHealth("","",damage);
10072 return true;
10073 }
10074 }
10075 return false;
10076 }
10077
10079 {
10081 }
10082
10084 {
10086 return GetInventory().CanRemoveEntity();
10087
10088 return false;
10089 }
10090
10092 {
10094 return;
10095
10097 {
10098 if (ScriptInputUserData.CanStoreInputUserData())
10099 {
10100 ScriptInputUserData ctx = new ScriptInputUserData;
10105 ctx.
Write(destination_entity);
10107 ctx.
Write(slot_id);
10109 }
10110 }
10111 else if (!
GetGame().IsMultiplayer())
10112 {
10114 }
10115 }
10116
10118 {
10120 return;
10121
10122 float split_quantity_new;
10126 InventoryLocation loc = new InventoryLocation;
10127
10128 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10129 {
10131 split_quantity_new = stack_max;
10132 else
10134
10135 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10136 if (new_item)
10137 {
10138 new_item.SetResultOfSplit(true);
10139 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10141 new_item.SetQuantity(split_quantity_new);
10142 }
10143 }
10144 else if (destination_entity && slot_id == -1)
10145 {
10146 if (quantity > stack_max)
10147 split_quantity_new = stack_max;
10148 else
10149 split_quantity_new = quantity;
10150
10152 {
10155 }
10156
10157 if (new_item)
10158 {
10159 new_item.SetResultOfSplit(true);
10160 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10162 new_item.SetQuantity(split_quantity_new);
10163 }
10164 }
10165 else
10166 {
10167 if (stack_max != 0)
10168 {
10170 {
10172 }
10173
10174 if (split_quantity_new == 0)
10175 {
10176 if (!
GetGame().IsMultiplayer())
10177 player.PhysicalPredictiveDropItem(this);
10178 else
10179 player.ServerDropEntity(this);
10180 return;
10181 }
10182
10184
10185 if (new_item)
10186 {
10187 new_item.SetResultOfSplit(true);
10188 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10190 new_item.SetQuantity(stack_max);
10191 new_item.PlaceOnSurface();
10192 }
10193 }
10194 }
10195 }
10196
10198 {
10200 return;
10201
10202 float split_quantity_new;
10206 InventoryLocation loc = new InventoryLocation;
10207
10208 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10209 {
10211 split_quantity_new = stack_max;
10212 else
10214
10215 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10216 if (new_item)
10217 {
10218 new_item.SetResultOfSplit(true);
10219 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10221 new_item.SetQuantity(split_quantity_new);
10222 }
10223 }
10224 else if (destination_entity && slot_id == -1)
10225 {
10226 if (quantity > stack_max)
10227 split_quantity_new = stack_max;
10228 else
10229 split_quantity_new = quantity;
10230
10232 {
10235 }
10236
10237 if (new_item)
10238 {
10239 new_item.SetResultOfSplit(true);
10240 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10242 new_item.SetQuantity(split_quantity_new);
10243 }
10244 }
10245 else
10246 {
10247 if (stack_max != 0)
10248 {
10250 {
10252 }
10253
10255
10256 if (new_item)
10257 {
10258 new_item.SetResultOfSplit(true);
10259 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10261 new_item.SetQuantity(stack_max);
10262 new_item.PlaceOnSurface();
10263 }
10264 }
10265 }
10266 }
10267
10269 {
10271 return;
10272
10274 {
10275 if (ScriptInputUserData.CanStoreInputUserData())
10276 {
10277 ScriptInputUserData ctx = new ScriptInputUserData;
10282 dst.WriteToContext(ctx);
10284 }
10285 }
10286 else if (!
GetGame().IsMultiplayer())
10287 {
10289 }
10290 }
10291
10293 {
10295 return;
10296
10298 {
10299 if (ScriptInputUserData.CanStoreInputUserData())
10300 {
10301 ScriptInputUserData ctx = new ScriptInputUserData;
10306 ctx.
Write(destination_entity);
10312 }
10313 }
10314 else if (!
GetGame().IsMultiplayer())
10315 {
10317 }
10318 }
10319
10321 {
10323 }
10324
10326 {
10328 return this;
10329
10331 float split_quantity_new;
10333 if (dst.IsValid())
10334 {
10335 int slot_id = dst.GetSlot();
10337
10338 if (quantity > stack_max)
10339 split_quantity_new = stack_max;
10340 else
10341 split_quantity_new = quantity;
10342
10344
10345 if (new_item)
10346 {
10347 new_item.SetResultOfSplit(true);
10348 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10351 }
10352
10353 return new_item;
10354 }
10355
10356 return null;
10357 }
10358
10360 {
10362 return;
10363
10365 float split_quantity_new;
10367 if (destination_entity)
10368 {
10370 if (quantity > stackable)
10371 split_quantity_new = stackable;
10372 else
10373 split_quantity_new = quantity;
10374
10375 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10376 if (new_item)
10377 {
10378 new_item.SetResultOfSplit(true);
10379 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10381 new_item.SetQuantity(split_quantity_new);
10382 }
10383 }
10384 }
10385
10387 {
10389 return;
10390
10392 {
10393 if (ScriptInputUserData.CanStoreInputUserData())
10394 {
10395 ScriptInputUserData ctx = new ScriptInputUserData;
10400 ItemBase destination_entity =
this;
10401 ctx.
Write(destination_entity);
10405 }
10406 }
10407 else if (!
GetGame().IsMultiplayer())
10408 {
10410 }
10411 }
10412
10414 {
10416 return;
10417
10419 float split_quantity_new;
10421 if (player)
10422 {
10424 if (quantity > stackable)
10425 split_quantity_new = stackable;
10426 else
10427 split_quantity_new = quantity;
10428
10429 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10430 new_item =
ItemBase.Cast(in_hands);
10431 if (new_item)
10432 {
10433 new_item.SetResultOfSplit(true);
10434 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10436 new_item.SetQuantity(split_quantity_new);
10437 }
10438 }
10439 }
10440
10442 {
10444 return;
10445
10447 float split_quantity_new = Math.Floor(quantity * 0.5);
10448
10450
10451 if (new_item)
10452 {
10453 if (new_item.GetQuantityMax() < split_quantity_new)
10454 {
10455 split_quantity_new = new_item.GetQuantityMax();
10456 }
10457
10458 new_item.SetResultOfSplit(true);
10459 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10460
10462 {
10465 }
10466 else
10467 {
10470 }
10471 }
10472 }
10473
10475 {
10477 return;
10478
10480 float split_quantity_new = Math.Floor(quantity / 2);
10481
10482 InventoryLocation invloc = new InventoryLocation;
10484
10486 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10487
10488 if (new_item)
10489 {
10490 if (new_item.GetQuantityMax() < split_quantity_new)
10491 {
10492 split_quantity_new = new_item.GetQuantityMax();
10493 }
10495 {
10498 }
10499 else
10500 {
10503 }
10504 }
10505 }
10506
10509 {
10510 SetWeightDirty();
10512
10513 if (parent)
10514 parent.OnAttachmentQuantityChangedEx(this, delta);
10515
10517 {
10519 {
10521 }
10523 {
10524 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10526 }
10527 }
10528
10529 }
10530
10533 {
10534
10535 }
10536
10539 {
10541 }
10542
10544 {
10545 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10546
10548 {
10549 if (newLevel == GameConstants.STATE_RUINED)
10550 {
10552 EntityAI parent = GetHierarchyParent();
10553 if (parent && parent.IsFireplace())
10554 {
10555 CargoBase cargo = GetInventory().GetCargo();
10556 if (cargo)
10557 {
10559 {
10561 }
10562 }
10563 }
10564 }
10565
10567 {
10568
10570 return;
10571 }
10572
10573 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10574 {
10576 }
10577 }
10578 }
10579
10580
10582 {
10583 super.OnRightClick();
10584
10586 {
10588 {
10589 if (ScriptInputUserData.CanStoreInputUserData())
10590 {
10591 vector m4[4];
10593
10594 EntityAI root = GetHierarchyRoot();
10595
10596 InventoryLocation dst = new InventoryLocation;
10598 {
10599 if (root)
10600 {
10601 root.GetTransform(m4);
10603 }
10604 else
10605 GetInventory().GetCurrentInventoryLocation(dst);
10606 }
10607 else
10608 {
10610
10611
10612 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10613 {
10614 if (root)
10615 {
10616 root.GetTransform(m4);
10618 }
10619 else
10620 GetInventory().GetCurrentInventoryLocation(dst);
10621 }
10622 else
10623 {
10624 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10625 }
10626 }
10627
10628 ScriptInputUserData ctx = new ScriptInputUserData;
10636 }
10637 }
10638 else if (!
GetGame().IsMultiplayer())
10639 {
10641 }
10642 }
10643 }
10644
10645 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10646 {
10647
10648 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10649 return false;
10650
10651 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10652 return false;
10653
10654
10656 return false;
10657
10658
10659 Magazine mag = Magazine.Cast(this);
10660 if (mag)
10661 {
10662 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10663 return false;
10664
10665 if (stack_max_limit)
10666 {
10667 Magazine other_mag = Magazine.Cast(other_item);
10668 if (other_item)
10669 {
10670 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10671 return false;
10672 }
10673
10674 }
10675 }
10676 else
10677 {
10678
10680 return false;
10681
10683 return false;
10684 }
10685
10686 PlayerBase player = null;
10687 if (CastTo(player, GetHierarchyRootPlayer()))
10688 {
10689 if (player.GetInventory().HasAttachment(this))
10690 return false;
10691
10692 if (player.IsItemsToDelete())
10693 return false;
10694 }
10695
10696 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10697 return false;
10698
10699 int slotID;
10701 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10702 return false;
10703
10704 return true;
10705 }
10706
10708 {
10710 }
10711
10713 {
10714 return m_IsResultOfSplit;
10715 }
10716
10718 {
10719 m_IsResultOfSplit = value;
10720 }
10721
10723 {
10725 }
10726
10728 {
10729 float other_item_quantity = other_item.GetQuantity();
10730 float this_free_space;
10731
10733
10735
10736 if (other_item_quantity > this_free_space)
10737 {
10738 return this_free_space;
10739 }
10740 else
10741 {
10742 return other_item_quantity;
10743 }
10744 }
10745
10747 {
10749 }
10750
10752 {
10754 return;
10755
10756 if (!IsMagazine() && other_item)
10757 {
10759 if (quantity_used != 0)
10760 {
10761 float hp1 = GetHealth01("","");
10762 float hp2 = other_item.GetHealth01("","");
10763 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10764 hpResult = hpResult / (
GetQuantity() + quantity_used);
10765
10766 hpResult *= GetMaxHealth();
10767 Math.Round(hpResult);
10768 SetHealth("", "Health", hpResult);
10769
10771 other_item.AddQuantity(-quantity_used);
10772 }
10773 }
10775 }
10776
10778 {
10779 #ifdef SERVER
10780 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10781 GetHierarchyParent().IncreaseLifetimeUp();
10782 #endif
10783 };
10784
10786 {
10787 PlayerBase p = PlayerBase.Cast(player);
10788
10789 array<int> recipesIds = p.m_Recipes;
10790 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10791 if (moduleRecipesManager)
10792 {
10793 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10794 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10795 }
10796
10797 for (int i = 0;i < recipesIds.Count(); i++)
10798 {
10799 int key = recipesIds.Get(i);
10800 string recipeName = moduleRecipesManager.GetRecipeName(key);
10802 }
10803 }
10804
10805
10806 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10807 {
10808 super.GetDebugActions(outputList);
10809
10810
10815
10816
10820
10824
10825
10828
10829
10831 {
10834 }
10835
10837
10840
10844 }
10845
10846
10847
10848
10850 {
10851 super.OnAction(action_id, player, ctx);
10852 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10853 {
10854 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10855 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10856 PlayerBase p = PlayerBase.Cast(player);
10857 if (
EActions.RECIPES_RANGE_START < 1000)
10858 {
10859 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10860 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10861 }
10862 }
10863 #ifndef SERVER
10864 else if (action_id ==
EActions.WATCH_PLAYER)
10865 {
10866 PluginDeveloper.SetDeveloperItemClientEx(player);
10867 }
10868 #endif
10870 {
10871 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10872 {
10873 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10874 OnDebugButtonPressServer(id + 1);
10875 }
10876
10877 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10878 {
10879 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10881 }
10882
10883 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10884 {
10885 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10887 }
10888
10889 else if (action_id ==
EActions.ADD_QUANTITY)
10890 {
10891 if (IsMagazine())
10892 {
10893 Magazine mag = Magazine.Cast(this);
10894 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10895 }
10896 else
10897 {
10899 }
10900
10901 if (m_EM)
10902 {
10903 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10904 }
10905
10906 }
10907
10908 else if (action_id ==
EActions.REMOVE_QUANTITY)
10909 {
10910 if (IsMagazine())
10911 {
10912 Magazine mag2 = Magazine.Cast(this);
10913 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10914 }
10915 else
10916 {
10918 }
10919 if (m_EM)
10920 {
10921 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10922 }
10923
10924 }
10925
10926 else if (action_id ==
EActions.SET_QUANTITY_0)
10927 {
10929
10930 if (m_EM)
10931 {
10932 m_EM.SetEnergy(0);
10933 }
10934 }
10935
10936 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10937 {
10939
10940 if (m_EM)
10941 {
10942 m_EM.SetEnergy(m_EM.GetEnergyMax());
10943 }
10944 }
10945
10946 else if (action_id ==
EActions.ADD_HEALTH)
10947 {
10948 AddHealth("","",GetMaxHealth("","Health")/5);
10949 }
10950 else if (action_id ==
EActions.REMOVE_HEALTH)
10951 {
10952 AddHealth("","",-GetMaxHealth("","Health")/5);
10953 }
10954 else if (action_id ==
EActions.DESTROY_HEALTH)
10955 {
10956 SetHealth01("","",0);
10957 }
10958 else if (action_id ==
EActions.WATCH_ITEM)
10959 {
10961 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10962 #ifdef DEVELOPER
10963 SetDebugDeveloper_item(this);
10964 #endif
10965 }
10966
10967 else if (action_id ==
EActions.ADD_TEMPERATURE)
10968 {
10969 AddTemperature(20);
10970
10971 }
10972
10973 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10974 {
10975 AddTemperature(-20);
10976
10977 }
10978
10979 else if (action_id ==
EActions.FLIP_FROZEN)
10980 {
10981 SetFrozen(!GetIsFrozen());
10982
10983 }
10984
10985 else if (action_id ==
EActions.ADD_WETNESS)
10986 {
10988
10989 }
10990
10991 else if (action_id ==
EActions.REMOVE_WETNESS)
10992 {
10994
10995 }
10996
10997 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10998 {
11001
11002
11003 }
11004
11005 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11006 {
11009 }
11010
11011 else if (action_id ==
EActions.MAKE_SPECIAL)
11012 {
11013 auto debugParams = DebugSpawnParams.WithPlayer(player);
11014 OnDebugSpawnEx(debugParams);
11015 }
11016
11017 else if (action_id ==
EActions.DELETE)
11018 {
11019 Delete();
11020 }
11021
11022 }
11023
11024
11025 return false;
11026 }
11027
11028
11029
11030
11034
11037
11038
11039
11041 {
11042 return false;
11043 }
11044
11045
11047 {
11048 return true;
11049 }
11050
11051
11053 {
11054 return true;
11055 }
11056
11057
11058
11060 {
11061 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11063 }
11064
11067 {
11068 return null;
11069 }
11070
11072 {
11073 return false;
11074 }
11075
11077 {
11078 return false;
11079 }
11080
11084
11085
11087 {
11088 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11089 return module_repairing.CanRepair(this, item_repair_kit);
11090 }
11091
11092
11093 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11094 {
11095 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11096 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11097 }
11098
11099
11101 {
11102
11103
11104
11105
11106
11107
11108
11109
11110 return 1;
11111 }
11112
11113
11114
11116 {
11118 }
11119
11120
11121
11123 {
11125 }
11126
11127
11136 {
11137 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11138
11139 if (player)
11140 {
11141 player.MessageStatus(text);
11142 }
11143 }
11144
11145
11154 {
11155 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11156
11157 if (player)
11158 {
11159 player.MessageAction(text);
11160 }
11161 }
11162
11163
11172 {
11173 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11174
11175 if (player)
11176 {
11177 player.MessageFriendly(text);
11178 }
11179 }
11180
11181
11190 {
11191 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11192
11193 if (player)
11194 {
11195 player.MessageImportant(text);
11196 }
11197 }
11198
11200 {
11201 return true;
11202 }
11203
11204
11205 override bool KindOf(
string tag)
11206 {
11207 bool found = false;
11208 string item_name = this.
GetType();
11211
11212 int array_size = item_tag_array.Count();
11213 for (int i = 0; i < array_size; i++)
11214 {
11215 if (item_tag_array.Get(i) == tag)
11216 {
11217 found = true;
11218 break;
11219 }
11220 }
11221 return found;
11222 }
11223
11224
11226 {
11227
11228 super.OnRPC(sender, rpc_type,ctx);
11229
11230
11231 switch (rpc_type)
11232 {
11233 #ifndef SERVER
11234 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11235 Param2<bool, string> p = new Param2<bool, string>(false, "");
11236
11238 return;
11239
11240 bool play = p.param1;
11241 string soundSet = p.param2;
11242
11243 if (play)
11244 {
11246 {
11248 {
11250 }
11251 }
11252 else
11253 {
11255 }
11256 }
11257 else
11258 {
11260 }
11261
11262 break;
11263 #endif
11264
11265 }
11266
11268 {
11270 }
11271 }
11272
11273
11274
11275
11277 {
11278 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11279 return plugin.GetID(
name);
11280 }
11281
11283 {
11284 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11285 return plugin.GetName(id);
11286 }
11287
11290 {
11291
11292
11293 int varFlags;
11294 if (!ctx.
Read(varFlags))
11295 return;
11296
11297 if (varFlags & ItemVariableFlags.FLOAT)
11298 {
11300 }
11301 }
11302
11304 {
11305
11306 super.SerializeNumericalVars(floats_out);
11307
11308
11309
11311 {
11313 }
11314
11316 {
11318 }
11319
11321 {
11323 }
11324
11326 {
11331 }
11332
11334 {
11336 }
11337 }
11338
11340 {
11341
11342 super.DeSerializeNumericalVars(floats);
11343
11344
11345 int index = 0;
11346 int mask = Math.Round(floats.Get(index));
11347
11348 index++;
11349
11351 {
11353 {
11355 }
11356 else
11357 {
11358 float quantity = floats.Get(index);
11359 SetQuantity(quantity,
true,
false,
false,
false);
11360 }
11361 index++;
11362 }
11363
11365 {
11366 float wet = floats.Get(index);
11368 index++;
11369 }
11370
11372 {
11373 int liquidtype = Math.Round(floats.Get(index));
11375 index++;
11376 }
11377
11379 {
11381 index++;
11383 index++;
11385 index++;
11387 index++;
11388 }
11389
11391 {
11392 int cleanness = Math.Round(floats.Get(index));
11394 index++;
11395 }
11396 }
11397
11399 {
11400 super.WriteVarsToCTX(ctx);
11401
11402
11404 {
11406 }
11407
11409 {
11411 }
11412
11414 {
11416 }
11417
11419 {
11420 int r,g,b,a;
11426 }
11427
11429 {
11431 }
11432 }
11433
11435 {
11436 if (!super.ReadVarsFromCTX(ctx,version))
11437 return false;
11438
11439 int intValue;
11440 float value;
11441
11442 if (version < 140)
11443 {
11444 if (!ctx.
Read(intValue))
11445 return false;
11446
11447 m_VariablesMask = intValue;
11448 }
11449
11451 {
11452 if (!ctx.
Read(value))
11453 return false;
11454
11456 {
11458 }
11459 else
11460 {
11462 }
11463 }
11464
11465 if (version < 140)
11466 {
11468 {
11469 if (!ctx.
Read(value))
11470 return false;
11471 SetTemperatureDirect(value);
11472 }
11473 }
11474
11476 {
11477 if (!ctx.
Read(value))
11478 return false;
11480 }
11481
11483 {
11484 if (!ctx.
Read(intValue))
11485 return false;
11487 }
11488
11490 {
11491 int r,g,b,a;
11493 return false;
11495 return false;
11497 return false;
11499 return false;
11500
11502 }
11503
11505 {
11506 if (!ctx.
Read(intValue))
11507 return false;
11509 }
11510
11511 if (version >= 138 && version < 140)
11512 {
11514 {
11515 if (!ctx.
Read(intValue))
11516 return false;
11517 SetFrozen(intValue);
11518 }
11519 }
11520
11521 return true;
11522 }
11523
11524
11526 {
11529 {
11531 }
11532
11533 if (!super.OnStoreLoad(ctx, version))
11534 {
11536 return false;
11537 }
11538
11539 if (version >= 114)
11540 {
11541 bool hasQuickBarIndexSaved;
11542
11543 if (!ctx.
Read(hasQuickBarIndexSaved))
11544 {
11546 return false;
11547 }
11548
11549 if (hasQuickBarIndexSaved)
11550 {
11551 int itmQBIndex;
11552
11553
11554 if (!ctx.
Read(itmQBIndex))
11555 {
11557 return false;
11558 }
11559
11560 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11561 if (itmQBIndex != -1 && parentPlayer)
11562 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11563 }
11564 }
11565 else
11566 {
11567
11568 PlayerBase player;
11569 int itemQBIndex;
11570 if (version ==
int.
MAX)
11571 {
11572 if (!ctx.
Read(itemQBIndex))
11573 {
11575 return false;
11576 }
11577 }
11578 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11579 {
11580
11581 if (!ctx.
Read(itemQBIndex))
11582 {
11584 return false;
11585 }
11586 if (itemQBIndex != -1 && player)
11587 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11588 }
11589 }
11590
11591 if (version < 140)
11592 {
11593
11594 if (!LoadVariables(ctx, version))
11595 {
11597 return false;
11598 }
11599 }
11600
11601
11603 {
11605 return false;
11606 }
11607 if (version >= 132)
11608 {
11610 if (raib)
11611 {
11613 {
11615 return false;
11616 }
11617 }
11618 }
11619
11621 return true;
11622 }
11623
11624
11625
11627 {
11628 super.OnStoreSave(ctx);
11629
11630 PlayerBase player;
11631 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11632 {
11634
11635 int itemQBIndex = -1;
11636 itemQBIndex = player.FindQuickBarEntityIndex(this);
11637 ctx.
Write(itemQBIndex);
11638 }
11639 else
11640 {
11642 }
11643
11645
11647 if (raib)
11648 {
11650 }
11651 }
11652
11653
11655 {
11656 super.AfterStoreLoad();
11657
11659 {
11661 }
11662
11664 {
11667 }
11668 }
11669
11671 {
11672 super.EEOnAfterLoad();
11673
11675 {
11677 }
11678
11681 }
11682
11684 {
11685 return false;
11686 }
11687
11688
11689
11691 {
11693 {
11694 #ifdef PLATFORM_CONSOLE
11695
11697 {
11699 if (menu)
11700 {
11702 }
11703 }
11704 #endif
11705 }
11706
11708 {
11711 }
11712
11714 {
11715 SetWeightDirty();
11717 }
11719 {
11722 }
11723
11725 {
11728 }
11730 {
11733 }
11734
11735 super.OnVariablesSynchronized();
11736 }
11737
11738
11739
11741 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11742 {
11743 if (!IsServerCheck(allow_client))
11744 return false;
11745
11747 return false;
11748
11751
11752 if (value <= (min + 0.001))
11753 value = min;
11754
11755 if (value == min)
11756 {
11757 if (destroy_config)
11758 {
11759 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11760 if (dstr)
11761 {
11763 this.Delete();
11764 return true;
11765 }
11766 }
11767 else if (destroy_forced)
11768 {
11770 this.Delete();
11771 return true;
11772 }
11773
11775 }
11776
11779
11781 {
11783
11784 if (delta)
11786 }
11787
11789
11790 return false;
11791 }
11792
11793
11795 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11796 {
11798 }
11799
11801 {
11804 }
11805
11807 {
11810 }
11811
11814 {
11815 float value_clamped = Math.Clamp(value, 0, 1);
11817 SetQuantity(result, destroy_config, destroy_forced);
11818 }
11819
11820
11823 {
11825 }
11826
11828 {
11830 }
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11842 {
11843 int slot = -1;
11844 if (GetInventory())
11845 {
11846 InventoryLocation il = new InventoryLocation;
11847 GetInventory().GetCurrentInventoryLocation(il);
11849 }
11850
11852 }
11853
11855 {
11856 float quantity_max = 0;
11857
11859 {
11860 if (attSlotID != -1)
11861 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11862
11863 if (quantity_max <= 0)
11865 }
11866
11867 if (quantity_max <= 0)
11869
11870 return quantity_max;
11871 }
11872
11874 {
11876 }
11877
11879 {
11881 }
11882
11883
11885 {
11887 }
11888
11890 {
11892 }
11893
11895 {
11897 }
11898
11899
11901 {
11902
11903 float weightEx = GetWeightEx();
11904 float special = GetInventoryAndCargoWeight();
11905 return weightEx - special;
11906 }
11907
11908
11910 {
11912 }
11913
11915 {
11917 {
11918 #ifdef DEVELOPER
11919 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11920 {
11921 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11923 }
11924 #endif
11925
11926 return GetQuantity() * GetConfigWeightModified();
11927 }
11928 else if (HasEnergyManager())
11929 {
11930 #ifdef DEVELOPER
11931 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11932 {
11933 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11934 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11935 }
11936 #endif
11937 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11938 }
11939 else
11940 {
11941 #ifdef DEVELOPER
11942 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11943 {
11944 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11945 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11946 }
11947 #endif
11948 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11949 }
11950 }
11951
11954 {
11955 int item_count = 0;
11957
11958 if (GetInventory().GetCargo() != NULL)
11959 {
11960 item_count = GetInventory().GetCargo().GetItemCount();
11961 }
11962
11963 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11964 {
11965 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11966 if (item)
11967 item_count += item.GetNumberOfItems();
11968 }
11969 return item_count;
11970 }
11971
11974 {
11975 float weight = 0;
11976 float wetness = 1;
11977 if (include_wetness)
11980 {
11981 weight = wetness * m_ConfigWeight;
11982 }
11984 {
11985 weight = 1;
11986 }
11987 return weight;
11988 }
11989
11990
11991
11993 {
11994 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11995 {
11996 GameInventory inv = GetInventory();
11997 array<EntityAI> items = new array<EntityAI>;
11999 for (int i = 0; i < items.Count(); i++)
12000 {
12002 if (item)
12003 {
12005 }
12006 }
12007 }
12008 }
12009
12010
12011
12012
12014 {
12015 float energy = 0;
12016 if (HasEnergyManager())
12017 {
12018 energy = GetCompEM().GetEnergy();
12019 }
12020 return energy;
12021 }
12022
12023
12025 {
12026 super.OnEnergyConsumed();
12027
12029 }
12030
12032 {
12033 super.OnEnergyAdded();
12034
12036 }
12037
12038
12040 {
12041 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12042 {
12044 {
12045 float energy_0to1 = GetCompEM().GetEnergy0To1();
12047 }
12048 }
12049 }
12050
12051
12053 {
12054 return ConfigGetFloat("heatIsolation");
12055 }
12056
12058 {
12060 }
12061
12063 {
12064 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12065 if (
GetGame().ConfigIsExisting(paramPath))
12067
12068 return 0.0;
12069 }
12070
12072 {
12073 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12074 if (
GetGame().ConfigIsExisting(paramPath))
12076
12077 return 0.0;
12078 }
12079
12080 override void SetWet(
float value,
bool allow_client =
false)
12081 {
12082 if (!IsServerCheck(allow_client))
12083 return;
12084
12087
12089
12090 m_VarWet = Math.Clamp(value, min, max);
12091
12093 {
12096 }
12097 }
12098
12099 override void AddWet(
float value)
12100 {
12102 }
12103
12105 {
12107 }
12108
12110 {
12112 }
12113
12115 {
12117 }
12118
12120 {
12122 }
12123
12125 {
12127 }
12128
12129 override void OnWetChanged(
float newVal,
float oldVal)
12130 {
12133 if (newLevel != oldLevel)
12134 {
12136 }
12137 }
12138
12140 {
12141 SetWeightDirty();
12142 }
12143
12145 {
12146 return GetWetLevelInternal(
m_VarWet);
12147 }
12148
12149
12150
12152 {
12154 }
12155
12157 {
12159 }
12160
12162 {
12164 }
12165
12167 {
12169 }
12170
12171
12172
12174 {
12175 if (ConfigIsExisting("itemModelLength"))
12176 {
12177 return ConfigGetFloat("itemModelLength");
12178 }
12179 return 0;
12180 }
12181
12183 {
12184 if (ConfigIsExisting("itemAttachOffset"))
12185 {
12186 return ConfigGetFloat("itemAttachOffset");
12187 }
12188 return 0;
12189 }
12190
12191 override void SetCleanness(
int value,
bool allow_client =
false)
12192 {
12193 if (!IsServerCheck(allow_client))
12194 return;
12195
12197
12199
12202 }
12203
12205 {
12207 }
12208
12210 {
12211 return true;
12212 }
12213
12214
12215
12216
12218 {
12220 }
12221
12223 {
12225 }
12226
12227
12228
12229
12230 override void SetColor(
int r,
int g,
int b,
int a)
12231 {
12237 }
12239 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12240 {
12245 }
12246
12248 {
12250 }
12251
12254 {
12255 int r,g,b,a;
12257 r = r/255;
12258 g = g/255;
12259 b = b/255;
12260 a = a/255;
12261 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12262 }
12263
12264
12265
12266 override void SetLiquidType(
int value,
bool allow_client =
false)
12267 {
12268 if (!IsServerCheck(allow_client))
12269 return;
12270
12275 }
12276
12278 {
12279 return ConfigGetInt("varLiquidTypeInit");
12280 }
12281
12283 {
12285 }
12286
12288 {
12290 SetFrozen(false);
12291 }
12292
12295 {
12296 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12297 }
12298
12299
12302 {
12303 PlayerBase nplayer;
12304 if (PlayerBase.CastTo(nplayer, player))
12305 {
12307
12308 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12309 }
12310 }
12311
12312
12315 {
12316 PlayerBase nplayer;
12317 if (PlayerBase.CastTo(nplayer,player))
12318 {
12319
12320 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12321
12322 }
12323
12324
12325 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12326
12327
12328 if (HasEnergyManager())
12329 {
12330 GetCompEM().UpdatePlugState();
12331 }
12332 }
12333
12334
12336 {
12337 super.OnPlacementStarted(player);
12338
12340 }
12341
12342 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12343 {
12345 {
12346 m_AdminLog.OnPlacementComplete(player,
this);
12347 }
12348
12349 super.OnPlacementComplete(player, position, orientation);
12350 }
12351
12352
12353
12354
12355
12357 {
12359 {
12360 return true;
12361 }
12362 else
12363 {
12364 return false;
12365 }
12366 }
12367
12368
12370 {
12372 {
12374 }
12375 }
12376
12377
12379 {
12381 }
12382
12384 {
12386 }
12387
12388 override void InsertAgent(
int agent,
float count = 1)
12389 {
12390 if (count < 1)
12391 return;
12392
12394 }
12395
12398 {
12400 }
12401
12402
12404 {
12406 }
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12450 {
12452 return false;
12453 return true;
12454 }
12455
12457 {
12458
12460 }
12461
12462
12465 {
12466 super.CheckForRoofLimited(timeTresholdMS);
12467
12469 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12470 {
12471 m_PreviousRoofTestTime = time;
12472 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12473 }
12474 }
12475
12476
12478 {
12480 {
12481 return 0;
12482 }
12483
12484 if (GetInventory().GetAttachmentSlotsCount() != 0)
12485 {
12486 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12487 if (filter)
12488 return filter.GetProtectionLevel(type, false, system);
12489 else
12490 return 0;
12491 }
12492
12493 string subclassPath, entryName;
12494
12495 switch (type)
12496 {
12498 entryName = "biological";
12499 break;
12501 entryName = "chemical";
12502 break;
12503 default:
12504 entryName = "biological";
12505 break;
12506 }
12507
12508 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12509
12511 }
12512
12513
12514
12517 {
12518 if (!IsMagazine())
12520
12522 }
12523
12524
12525
12526
12527
12532 {
12533 return true;
12534 }
12535
12537 {
12539 }
12540
12541
12542
12543
12544
12546 {
12547 if (parent)
12548 {
12549 if (parent.IsInherited(DayZInfected))
12550 return true;
12551
12552 if (!parent.IsRuined())
12553 return true;
12554 }
12555
12556 return true;
12557 }
12558
12560 {
12561 if (!super.CanPutAsAttachment(parent))
12562 {
12563 return false;
12564 }
12565
12566 if (!IsRuined() && !parent.IsRuined())
12567 {
12568 return true;
12569 }
12570
12571 return false;
12572 }
12573
12575 {
12576
12577
12578
12579
12580 return super.CanReceiveItemIntoCargo(item);
12581 }
12582
12584 {
12585
12586
12587
12588
12589 GameInventory attachmentInv = attachment.GetInventory();
12591 {
12592 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12593 return false;
12594 }
12595
12596 InventoryLocation loc = new InventoryLocation();
12597 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12598 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12599 return false;
12600
12601 return super.CanReceiveAttachment(attachment, slotId);
12602 }
12603
12605 {
12606 if (!super.CanReleaseAttachment(attachment))
12607 return false;
12608
12609 return GetInventory().AreChildrenAccessible();
12610 }
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12633 {
12634 int id = muzzle_owner.GetMuzzleID();
12635 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12636
12637 if (WPOF_array)
12638 {
12639 for (int i = 0; i < WPOF_array.Count(); i++)
12640 {
12641 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12642
12643 if (WPOF)
12644 {
12645 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12646 }
12647 }
12648 }
12649 }
12650
12651
12653 {
12654 int id = muzzle_owner.GetMuzzleID();
12656
12657 if (WPOBE_array)
12658 {
12659 for (int i = 0; i < WPOBE_array.Count(); i++)
12660 {
12661 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12662
12663 if (WPOBE)
12664 {
12665 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12666 }
12667 }
12668 }
12669 }
12670
12671
12673 {
12674 int id = muzzle_owner.GetMuzzleID();
12675 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12676
12677 if (WPOOH_array)
12678 {
12679 for (int i = 0; i < WPOOH_array.Count(); i++)
12680 {
12681 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12682
12683 if (WPOOH)
12684 {
12685 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12686 }
12687 }
12688 }
12689 }
12690
12691
12693 {
12694 int id = muzzle_owner.GetMuzzleID();
12695 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12696
12697 if (WPOOH_array)
12698 {
12699 for (int i = 0; i < WPOOH_array.Count(); i++)
12700 {
12701 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12702
12703 if (WPOOH)
12704 {
12705 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12706 }
12707 }
12708 }
12709 }
12710
12711
12713 {
12714 int id = muzzle_owner.GetMuzzleID();
12715 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12716
12717 if (WPOOH_array)
12718 {
12719 for (int i = 0; i < WPOOH_array.Count(); i++)
12720 {
12721 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12722
12723 if (WPOOH)
12724 {
12725 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12726 }
12727 }
12728 }
12729 }
12730
12731
12732
12734 {
12736 {
12737 return true;
12738 }
12739
12740 return false;
12741 }
12742
12744 {
12746 {
12747 return true;
12748 }
12749
12750 return false;
12751 }
12752
12754 {
12756 {
12757 return true;
12758 }
12759
12760 return false;
12761 }
12762
12764 {
12765 return false;
12766 }
12767
12770 {
12771 return UATimeSpent.DEFAULT_DEPLOY;
12772 }
12773
12774
12775
12776
12778 {
12780 SetSynchDirty();
12781 }
12782
12784 {
12786 }
12787
12788
12790 {
12791 return false;
12792 }
12793
12796 {
12797 string att_type = "None";
12798
12799 if (ConfigIsExisting("soundAttType"))
12800 {
12801 att_type = ConfigGetString("soundAttType");
12802 }
12803
12805 }
12806
12808 {
12810 }
12811
12812
12813
12814
12815
12819
12821 {
12824
12826 }
12827
12828
12830 {
12832 return;
12833
12835
12838
12841
12842 SoundParameters params = new SoundParameters();
12846 }
12847
12848
12850 {
12852 return;
12853
12855 SetSynchDirty();
12856
12859 }
12860
12861
12863 {
12865 return;
12866
12868 SetSynchDirty();
12869
12872 }
12873
12875 {
12877 }
12878
12880 {
12882 }
12883
12886 {
12887 if (!
GetGame().IsDedicatedServer())
12888 {
12889 if (ConfigIsExisting("attachSoundSet"))
12890 {
12891 string cfg_path = "";
12892 string soundset = "";
12893 string type_name =
GetType();
12894
12897 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12898 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12899
12900 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12901 {
12902 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12903 {
12904 if (cfg_slot_array[i] == slot_type)
12905 {
12906 soundset = cfg_soundset_array[i];
12907 break;
12908 }
12909 }
12910 }
12911
12912 if (soundset != "")
12913 {
12914 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12916 }
12917 }
12918 }
12919 }
12920
12922 {
12923
12924 }
12925
12926 void OnApply(PlayerBase player);
12927
12929 {
12930 return 1.0;
12931 };
12932
12934 {
12936 }
12937
12939 {
12941 }
12942
12944
12946 {
12947 SetDynamicPhysicsLifeTime(0.01);
12949 }
12950
12952 {
12953 array<string> zone_names = new array<string>;
12954 GetDamageZones(zone_names);
12955 for (int i = 0; i < zone_names.Count(); i++)
12956 {
12957 SetHealthMax(zone_names.Get(i),"Health");
12958 }
12959 SetHealthMax("","Health");
12960 }
12961
12964 {
12965 float global_health = GetHealth01("","Health");
12966 array<string> zones = new array<string>;
12967 GetDamageZones(zones);
12968
12969 for (int i = 0; i < zones.Count(); i++)
12970 {
12971 SetHealth01(zones.Get(i),"Health",global_health);
12972 }
12973 }
12974
12977 {
12978 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12979 }
12980
12982 {
12983 if (!hasRootAsPlayer)
12984 {
12985 if (refParentIB)
12986 {
12987
12988 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12989 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12990
12991 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12992 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12993
12996 }
12997 else
12998 {
12999
13002 }
13003 }
13004 }
13005
13007 {
13009 {
13010 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13011 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
13012 {
13013 float heatPermCoef = 1.0;
13015 while (ent)
13016 {
13017 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13018 ent = ent.GetHierarchyParent();
13019 }
13020
13021 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13022 }
13023 }
13024 }
13025
13027 {
13028
13029 EntityAI parent = GetHierarchyParent();
13030 if (!parent)
13031 {
13032 hasParent = false;
13033 hasRootAsPlayer = false;
13034 }
13035 else
13036 {
13037 hasParent = true;
13038 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13039 refParentIB =
ItemBase.Cast(parent);
13040 }
13041 }
13042
13043 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13044 {
13045
13046 }
13047
13049 {
13050
13051 return false;
13052 }
13053
13055 {
13056
13057
13058 return false;
13059 }
13060
13062 {
13063
13064 return false;
13065 }
13066
13069 {
13070 return !GetIsFrozen() &&
IsOpen();
13071 }
13072
13074 {
13075 bool hasParent = false, hasRootAsPlayer = false;
13077
13078 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13079 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13080
13081 if (wwtu || foodDecay)
13082 {
13086
13087 if (processWetness || processTemperature || processDecay)
13088 {
13090
13091 if (processWetness)
13092 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13093
13094 if (processTemperature)
13096
13097 if (processDecay)
13098 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13099 }
13100 }
13101 }
13102
13105 {
13107 }
13108
13110 {
13113
13114 return super.GetTemperatureFreezeThreshold();
13115 }
13116
13118 {
13121
13122 return super.GetTemperatureThawThreshold();
13123 }
13124
13126 {
13129
13130 return super.GetItemOverheatThreshold();
13131 }
13132
13134 {
13136 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13137
13138 return super.GetTemperatureFreezeTime();
13139 }
13140
13142 {
13144 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13145
13146 return super.GetTemperatureThawTime();
13147 }
13148
13153
13155 {
13156 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13157 }
13158
13160 {
13161 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13162 }
13163
13166 {
13168 }
13169
13171 {
13173 }
13174
13176 {
13178 }
13179
13182 {
13183 return null;
13184 }
13185
13188 {
13189 return false;
13190 }
13191
13193 {
13195 {
13198 if (!trg)
13199 {
13201 explosive = this;
13202 }
13203
13204 explosive.PairRemote(trg);
13206
13207 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13208 trg.SetPersistentPairID(persistentID);
13209 explosive.SetPersistentPairID(persistentID);
13210
13211 return true;
13212 }
13213 return false;
13214 }
13215
13218 {
13219 float ret = 1.0;
13222 ret *= GetHealth01();
13223
13224 return ret;
13225 }
13226
13227 #ifdef DEVELOPER
13228 override void SetDebugItem()
13229 {
13230 super.SetDebugItem();
13231 _itemBase = this;
13232 }
13233
13235 {
13236 string text = super.GetDebugText();
13237
13239 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13240
13241 return text;
13242 }
13243 #endif
13244
13246 {
13247 return true;
13248 }
13249
13251
13253
13255 {
13258 }
13259
13260
13268
13284}
13285
13287{
13289 if (entity)
13290 {
13291 bool is_item = entity.IsInherited(
ItemBase);
13292 if (is_item && full_quantity)
13293 {
13296 }
13297 }
13298 else
13299 {
13301 return NULL;
13302 }
13303 return entity;
13304}
13305
13307{
13308 if (item)
13309 {
13310 if (health > 0)
13311 item.SetHealth("", "", health);
13312
13313 if (item.CanHaveTemperature())
13314 {
13316 if (item.CanFreeze())
13317 item.SetFrozen(false);
13318 }
13319
13320 if (item.HasEnergyManager())
13321 {
13322 if (quantity >= 0)
13323 {
13324 item.GetCompEM().SetEnergy0To1(quantity);
13325 }
13326 else
13327 {
13329 }
13330 }
13331 else if (item.IsMagazine())
13332 {
13333 Magazine mag = Magazine.Cast(item);
13334 if (quantity >= 0)
13335 {
13336 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13337 }
13338 else
13339 {
13341 }
13342
13343 }
13344 else
13345 {
13346 if (quantity >= 0)
13347 {
13348 item.SetQuantityNormalized(quantity, false);
13349 }
13350 else
13351 {
13353 }
13354
13355 }
13356 }
13357}
13358
13359#ifdef DEVELOPER
13361#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.