8482{
8484 {
8485 return true;
8486 }
8487};
8488
8489
8490
8492{
8496
8498
8501
8502
8503
8504
8505
8514
8520
8525
8530
8551 protected bool m_IsResultOfSplit
8552
8554
8559
8560
8561
8563
8567
8568
8569
8571
8574
8575
8576
8582
8583
8591
8594
8595
8597
8598
8600
8601
8606
8607
8612
8613
8615
8616
8618 {
8623
8624 if (!
GetGame().IsDedicatedServer())
8625 {
8627 {
8629
8631 {
8633 }
8634 }
8635
8638 }
8639
8640 m_OldLocation = null;
8641
8643 {
8645 }
8646
8647 if (ConfigIsExisting("headSelectionsToHide"))
8648 {
8651 }
8652
8654 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8655 {
8657 }
8658
8660
8661 m_IsResultOfSplit = false;
8662
8664 }
8665
8667 {
8668 super.InitItemVariables();
8669
8675 m_Count = ConfigGetInt(
"count");
8676
8679
8684
8687
8692
8704
8708
8709
8712 if (ConfigIsExisting("canBeSplit"))
8713 {
8716 }
8717
8719 if (ConfigIsExisting("itemBehaviour"))
8721
8722
8725 RegisterNetSyncVariableInt("m_VarLiquidType");
8726 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8727
8728 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8729 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8730 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8731
8732 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8733 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8734 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8735 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8736
8737 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8738 RegisterNetSyncVariableBool("m_IsTakeable");
8739 RegisterNetSyncVariableBool("m_IsHologram");
8740
8743 {
8746 }
8747
8749
8751 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8753
8754 }
8755
8757 {
8759 }
8760
8762 {
8765 {
8770 }
8771 }
8772
8773 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8774 {
8776 {
8779 }
8780
8782 }
8783
8785 {
8791 }
8792
8794
8796 {
8798
8799 if (!action)
8800 {
8801 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8802 return;
8803 }
8804
8806 if (!ai)
8807 {
8809 return;
8810 }
8811
8813 if (!action_array)
8814 {
8815 action_array = new array<ActionBase_Basic>;
8817 }
8818 if (LogManager.IsActionLogEnable())
8819 {
8820 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8821 }
8822
8823 if (action_array.Find(action) != -1)
8824 {
8825 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8826 }
8827 else
8828 {
8829 action_array.Insert(action);
8830 }
8831 }
8832
8834 {
8836 ActionBase action = player.GetActionManager().GetAction(actionName);
8839
8840 if (action_array)
8841 {
8842 action_array.RemoveItem(action);
8843 }
8844 }
8845
8846
8847
8849 {
8850 ActionOverrideData overrideData = new ActionOverrideData();
8854
8856 if (!actionMap)
8857 {
8860 }
8861
8862 actionMap.Insert(this.
Type(), overrideData);
8863
8864 }
8865
8867
8869
8870
8872 {
8875
8878
8879 string config_to_search = "CfgVehicles";
8880 string muzzle_owner_config;
8881
8883 {
8884 if (IsInherited(Weapon))
8885 config_to_search = "CfgWeapons";
8886
8887 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8888
8889 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8890
8892
8893 if (config_OnFire_subclass_count > 0)
8894 {
8895 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8896
8897 for (int i = 0; i < config_OnFire_subclass_count; i++)
8898 {
8899 string particle_class = "";
8901 string config_OnFire_entry = config_OnFire_class + particle_class;
8902 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8903 WPOF_array.Insert(WPOF);
8904 }
8905
8906
8908 }
8909 }
8910
8912 {
8913 config_to_search = "CfgWeapons";
8914 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8915
8916 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8917
8919
8920 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8921 {
8922 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8923
8924 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8925 {
8926 string particle_class2 = "";
8928 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8929 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8930 WPOBE_array.Insert(WPOBE);
8931 }
8932
8933
8935 }
8936 }
8937 }
8938
8939
8941 {
8944
8946 {
8947 string config_to_search = "CfgVehicles";
8948
8949 if (IsInherited(Weapon))
8950 config_to_search = "CfgWeapons";
8951
8952 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8953 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8954
8955 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8956 {
8957
8959
8961 {
8963 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8965 return;
8966 }
8967
8970
8971
8972
8974 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8975
8976 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8977 {
8978 string particle_class = "";
8980 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8982
8983 if (entry_type == CT_CLASS)
8984 {
8985 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8986 WPOOH_array.Insert(WPOF);
8987 }
8988 }
8989
8990
8992 }
8993 }
8994 }
8995
8997 {
8999 }
9000
9002 {
9004 {
9006
9009
9012
9013 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9014 }
9015 }
9016
9018 {
9020 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9021
9023 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9024
9026 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9027
9029 {
9031 }
9032 }
9033
9035 {
9037 }
9038
9040 {
9043 else
9045
9047 {
9050 }
9051 else
9052 {
9055
9058 }
9059
9061 }
9062
9064 {
9066 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9067 }
9068
9070 {
9072 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9074 }
9075
9077 {
9079 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9080 }
9081
9083 {
9086
9087 OverheatingParticle OP = new OverheatingParticle();
9092
9094 }
9095
9097 {
9100
9101 return -1;
9102 }
9103
9105 {
9107 {
9110
9111 for (int i = count; i > 0; --i)
9112 {
9113 int id = i - 1;
9116
9119
9120 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9121 {
9122 if (p)
9123 {
9126 }
9127 }
9128 }
9129 }
9130 }
9131
9133 {
9135 {
9137 {
9138 int id = i - 1;
9140
9141 if (OP)
9142 {
9144
9145 if (p)
9146 {
9148 }
9149
9150 delete OP;
9151 }
9152 }
9153
9156 }
9157 }
9158
9161 {
9162 return 0.0;
9163 }
9164
9165
9167 {
9168 return 250;
9169 }
9170
9172 {
9173 return 0;
9174 }
9175
9178 {
9180 return true;
9181
9182 return false;
9183 }
9184
9187 {
9190
9192 {
9194 }
9195 else
9196 {
9197
9199 }
9200
9202 }
9203
9210 {
9211 return -1;
9212 }
9213
9214
9215
9216
9218 {
9220 {
9222 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9223
9224 if (r_index >= 0)
9225 {
9226 InventoryLocation r_il = new InventoryLocation;
9227 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9228
9229 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9232 {
9233 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9234 }
9236 {
9237 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9238 }
9239
9240 }
9241
9242 player.GetHumanInventory().ClearUserReservedLocation(this);
9243 }
9244
9247 }
9248
9249
9250
9251
9253 {
9254 return ItemBase.m_DebugActionsMask;
9255 }
9256
9258 {
9259 return ItemBase.m_DebugActionsMask & mask;
9260 }
9261
9263 {
9264 ItemBase.m_DebugActionsMask = mask;
9265 }
9266
9268 {
9269 ItemBase.m_DebugActionsMask |= mask;
9270 }
9271
9273 {
9274 ItemBase.m_DebugActionsMask &= ~mask;
9275 }
9276
9278 {
9280 {
9282 }
9283 else
9284 {
9286 }
9287 }
9288
9289
9291 {
9292 if (GetEconomyProfile())
9293 {
9294 float q_max = GetEconomyProfile().GetQuantityMax();
9295 if (q_max > 0)
9296 {
9297 float q_min = GetEconomyProfile().GetQuantityMin();
9298 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9299
9301 {
9302 ComponentEnergyManager comp = GetCompEM();
9304 {
9306 }
9307 }
9309 {
9311
9312 }
9313
9314 }
9315 }
9316 }
9317
9320 {
9321 EntityAI parent = GetHierarchyParent();
9322
9323 if (parent)
9324 {
9325 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9326 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9327 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9328 }
9329 }
9330
9333 {
9334 EntityAI parent = GetHierarchyParent();
9335
9336 if (parent)
9337 {
9338 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9339 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9340 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9341 }
9342 }
9343
9345 {
9346
9347
9348
9349
9351
9353 {
9354 if (ScriptInputUserData.CanStoreInputUserData())
9355 {
9356 ScriptInputUserData ctx = new ScriptInputUserData;
9362 ctx.
Write(use_stack_max);
9365
9367 {
9368 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9369 }
9370 }
9371 }
9372 else if (!
GetGame().IsMultiplayer())
9373 {
9375 }
9376 }
9377
9379 {
9381 }
9382
9384 {
9386 }
9387
9389 {
9391 }
9392
9394 {
9395
9396 return false;
9397 }
9398
9400 {
9401 return false;
9402 }
9403
9407 {
9408 return false;
9409 }
9410
9412 {
9413 return "";
9414 }
9415
9417
9419 {
9420 return false;
9421 }
9422
9424 {
9425 return true;
9426 }
9427
9428
9429
9431 {
9432 return true;
9433 }
9434
9436 {
9437 return true;
9438 }
9439
9441 {
9442 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9444 }
9445
9447 {
9449 }
9450
9452 {
9454 if (!is_being_placed)
9456 SetSynchDirty();
9457 }
9458
9459
9461
9463 {
9465 }
9466
9468 {
9470 }
9471
9473 {
9474 return 1;
9475 }
9476
9478 {
9479 return false;
9480 }
9481
9483 {
9485 SetSynchDirty();
9486 }
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9523 {
9524 super.OnMovedInsideCargo(container);
9525
9526 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9527 }
9528
9529 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9530 {
9531 super.EEItemLocationChanged(oldLoc,newLoc);
9532
9533 PlayerBase new_player = null;
9534 PlayerBase old_player = null;
9535
9536 if (newLoc.GetParent())
9537 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9538
9539 if (oldLoc.GetParent())
9540 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9541
9543 {
9544 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9545
9546 if (r_index >= 0)
9547 {
9548 InventoryLocation r_il = new InventoryLocation;
9549 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9550
9551 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9554 {
9555 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9556 }
9558 {
9559 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9560 }
9561
9562 }
9563 }
9564
9566 {
9567 if (new_player)
9568 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9569
9570 if (new_player == old_player)
9571 {
9572
9573 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9574 {
9576 {
9577 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9578 {
9579 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9580 }
9581 }
9582 else
9583 {
9584 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9585 }
9586 }
9587
9588 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9589 {
9590 int type = oldLoc.GetType();
9592 {
9593 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9594 }
9596 {
9597 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9598 }
9599 }
9600 if (!m_OldLocation)
9601 {
9602 m_OldLocation = new InventoryLocation;
9603 }
9604 m_OldLocation.Copy(oldLoc);
9605 }
9606 else
9607 {
9608 if (m_OldLocation)
9609 {
9610 m_OldLocation.Reset();
9611 }
9612 }
9613
9615 }
9616 else
9617 {
9618 if (new_player)
9619 {
9620 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9621 if (res_index >= 0)
9622 {
9623 InventoryLocation il = new InventoryLocation;
9624 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9626 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9629 {
9630 il.
GetParent().GetOnReleaseLock().Invoke(it);
9631 }
9633 {
9635 }
9636
9637 }
9638 }
9640 {
9641
9643 }
9644
9645 if (m_OldLocation)
9646 {
9647 m_OldLocation.Reset();
9648 }
9649 }
9650 }
9651
9652 override void EOnContact(IEntity other, Contact extra)
9653 {
9655 {
9656 int liquidType = -1;
9658 if (impactSpeed > 0.0)
9659 {
9661 #ifndef SERVER
9663 #else
9665 SetSynchDirty();
9666 #endif
9668 }
9669 }
9670
9671 #ifdef SERVER
9672 if (GetCompEM() && GetCompEM().IsPlugged())
9673 {
9674 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9675 GetCompEM().UnplugThis();
9676 }
9677 #endif
9678 }
9679
9681
9683 {
9685 }
9686
9688 {
9689
9690 }
9691
9693 {
9694 super.OnItemLocationChanged(old_owner, new_owner);
9695
9696 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9697 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9698
9699 if (!relatedPlayer && playerNew)
9700 relatedPlayer = playerNew;
9701
9702 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9703 {
9705 if (actionMgr)
9706 {
9707 ActionBase currentAction = actionMgr.GetRunningAction();
9708 if (currentAction)
9710 }
9711 }
9712
9713 Man ownerPlayerOld = null;
9714 Man ownerPlayerNew = null;
9715
9716 if (old_owner)
9717 {
9718 if (old_owner.
IsMan())
9719 {
9720 ownerPlayerOld = Man.Cast(old_owner);
9721 }
9722 else
9723 {
9724 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9725 }
9726 }
9727 else
9728 {
9730 {
9732
9733 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9734 {
9735 GetCompEM().UnplugThis();
9736 }
9737 }
9738 }
9739
9740 if (new_owner)
9741 {
9742 if (new_owner.
IsMan())
9743 {
9744 ownerPlayerNew = Man.Cast(new_owner);
9745 }
9746 else
9747 {
9748 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9749 }
9750 }
9751
9752 if (ownerPlayerOld != ownerPlayerNew)
9753 {
9754 if (ownerPlayerOld)
9755 {
9756 array<EntityAI> subItemsExit = new array<EntityAI>;
9758 for (int i = 0; i < subItemsExit.Count(); i++)
9759 {
9762 }
9763 }
9764
9765 if (ownerPlayerNew)
9766 {
9767 array<EntityAI> subItemsEnter = new array<EntityAI>;
9769 for (int j = 0; j < subItemsEnter.Count(); j++)
9770 {
9773 }
9774 }
9775 }
9776 else if (ownerPlayerNew != null)
9777 {
9778 PlayerBase nplayer;
9779 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9780 {
9781 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9783 for (int k = 0; k < subItemsUpdate.Count(); k++)
9784 {
9786 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9787 }
9788 }
9789 }
9790
9791 if (old_owner)
9792 old_owner.OnChildItemRemoved(this);
9793 if (new_owner)
9794 new_owner.OnChildItemReceived(this);
9795 }
9796
9797
9799 {
9800 super.EEDelete(parent);
9801 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9802 if (player)
9803 {
9805
9806 if (player.IsAlive())
9807 {
9808 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9809 if (r_index >= 0)
9810 {
9811 InventoryLocation r_il = new InventoryLocation;
9812 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9813
9814 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9817 {
9818 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9819 }
9821 {
9822 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9823 }
9824
9825 }
9826
9827 player.RemoveQuickBarEntityShortcut(this);
9828 }
9829 }
9830 }
9831
9833 {
9834 super.EEKilled(killer);
9835
9838 {
9839 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9840 {
9841 if (IsMagazine())
9842 {
9843 if (Magazine.Cast(this).GetAmmoCount() > 0)
9844 {
9846 }
9847 }
9848 else
9849 {
9851 }
9852 }
9853 }
9854 }
9855
9857 {
9858 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9859
9860 super.OnWasAttached(parent, slot_id);
9861
9864
9866 }
9867
9869 {
9870 super.OnWasDetached(parent, slot_id);
9871
9874 }
9875
9877 {
9878 int idx;
9881
9882 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9883 if (inventory_slots.Count() < 1)
9884 {
9885 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9886 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9887 }
9888 else
9889 {
9890 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9891 }
9892
9893 idx = inventory_slots.Find(slot);
9894 if (idx < 0)
9895 return "";
9896
9897 return attach_types.Get(idx);
9898 }
9899
9901 {
9902 int idx = -1;
9903 string slot;
9904
9907
9908 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9909 if (inventory_slots.Count() < 1)
9910 {
9911 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9912 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9913 }
9914 else
9915 {
9916 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9917 if (detach_types.Count() < 1)
9918 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9919 }
9920
9921 for (int i = 0; i < inventory_slots.Count(); i++)
9922 {
9923 slot = inventory_slots.Get(i);
9924 }
9925
9926 if (slot != "")
9927 {
9928 if (detach_types.Count() == 1)
9929 idx = 0;
9930 else
9931 idx = inventory_slots.Find(slot);
9932 }
9933 if (idx < 0)
9934 return "";
9935
9936 return detach_types.Get(idx);
9937 }
9938
9940 {
9941
9943
9944
9945 float min_time = 1;
9946 float max_time = 3;
9947 float delay = Math.RandomFloat(min_time, max_time);
9948
9949 explode_timer.Run(delay, this, "DoAmmoExplosion");
9950 }
9951
9953 {
9954 Magazine magazine = Magazine.Cast(this);
9955 int pop_sounds_count = 6;
9956 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9957
9958
9959 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9960 string sound_name = pop_sounds[ sound_idx ];
9962
9963
9964 magazine.ServerAddAmmoCount(-1);
9965
9966
9967 float min_temp_to_explode = 100;
9968
9969 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9970 {
9972 }
9973 }
9974
9975
9976 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9977 {
9978 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9979
9980 const int CHANCE_DAMAGE_CARGO = 4;
9981 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9982 const int CHANCE_DAMAGE_NOTHING = 2;
9983
9985 {
9986 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9987 int chances;
9988 int rnd;
9989
9990 if (GetInventory().GetCargo())
9991 {
9992 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9993 rnd = Math.RandomInt(0,chances);
9994
9995 if (rnd < CHANCE_DAMAGE_CARGO)
9996 {
9998 }
9999 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10000 {
10002 }
10003 }
10004 else
10005 {
10006 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10007 rnd = Math.RandomInt(0,chances);
10008
10009 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10010 {
10012 }
10013 }
10014 }
10015 }
10016
10018 {
10019 if (GetInventory().GetCargo())
10020 {
10021 int item_count = GetInventory().GetCargo().GetItemCount();
10022 if (item_count > 0)
10023 {
10024 int random_pick = Math.RandomInt(0, item_count);
10026 if (!item.IsExplosive())
10027 {
10028 item.AddHealth("","",damage);
10029 return true;
10030 }
10031 }
10032 }
10033 return false;
10034 }
10035
10037 {
10038 int attachment_count = GetInventory().AttachmentCount();
10039 if (attachment_count > 0)
10040 {
10041 int random_pick = Math.RandomInt(0, attachment_count);
10042 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10043 if (!attachment.IsExplosive())
10044 {
10045 attachment.AddHealth("","",damage);
10046 return true;
10047 }
10048 }
10049 return false;
10050 }
10051
10053 {
10055 }
10056
10058 {
10060 return GetInventory().CanRemoveEntity();
10061
10062 return false;
10063 }
10064
10066 {
10067
10069 return false;
10070
10071
10073 return false;
10074
10075
10076
10078 if (delta == 0)
10079 return false;
10080
10081
10082 return true;
10083 }
10084
10086 {
10088 {
10089 if (ScriptInputUserData.CanStoreInputUserData())
10090 {
10091 ScriptInputUserData ctx = new ScriptInputUserData;
10096 ctx.
Write(destination_entity);
10098 ctx.
Write(slot_id);
10100 }
10101 }
10102 else if (!
GetGame().IsMultiplayer())
10103 {
10105 }
10106 }
10107
10109 {
10110 float split_quantity_new;
10114 InventoryLocation loc = new InventoryLocation;
10115
10116 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10117 {
10119 split_quantity_new = stack_max;
10120 else
10122
10124 {
10125 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10126 if (new_item)
10127 {
10128 new_item.SetResultOfSplit(true);
10129 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10131 new_item.
SetQuantity(split_quantity_new,
false,
true);
10132 }
10133 }
10134 }
10135 else if (destination_entity && slot_id == -1)
10136 {
10137 if (quantity > stack_max)
10138 split_quantity_new = stack_max;
10139 else
10140 split_quantity_new = quantity;
10141
10143 {
10145 {
10148 }
10149
10150 if (new_item)
10151 {
10152 new_item.SetResultOfSplit(true);
10153 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10155 new_item.
SetQuantity(split_quantity_new,
false,
true);
10156 }
10157 }
10158 }
10159 else
10160 {
10161 if (stack_max != 0)
10162 {
10164 {
10166 }
10167
10168 if (split_quantity_new == 0)
10169 {
10170 if (!
GetGame().IsMultiplayer())
10171 player.PhysicalPredictiveDropItem(this);
10172 else
10173 player.ServerDropEntity(this);
10174 return;
10175 }
10176
10178 {
10180
10181 if (new_item)
10182 {
10183 new_item.SetResultOfSplit(true);
10184 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10187 new_item.PlaceOnSurface();
10188 }
10189 }
10190 }
10191 }
10192 }
10193
10195 {
10196 float split_quantity_new;
10200 InventoryLocation loc = new InventoryLocation;
10201
10202 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10203 {
10205 split_quantity_new = stack_max;
10206 else
10208
10210 {
10211 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10212 if (new_item)
10213 {
10214 new_item.SetResultOfSplit(true);
10215 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10217 new_item.
SetQuantity(split_quantity_new,
false,
true);
10218 }
10219 }
10220 }
10221 else if (destination_entity && slot_id == -1)
10222 {
10223 if (quantity > stack_max)
10224 split_quantity_new = stack_max;
10225 else
10226 split_quantity_new = quantity;
10227
10229 {
10231 {
10234 }
10235
10236 if (new_item)
10237 {
10238 new_item.SetResultOfSplit(true);
10239 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10241 new_item.
SetQuantity(split_quantity_new,
false,
true);
10242 }
10243 }
10244 }
10245 else
10246 {
10247 if (stack_max != 0)
10248 {
10250 {
10252 }
10253
10255 {
10257
10258 if (new_item)
10259 {
10260 new_item.SetResultOfSplit(true);
10261 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10264 new_item.PlaceOnSurface();
10265 }
10266 }
10267 }
10268 }
10269 }
10270
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 {
10296 if (ScriptInputUserData.CanStoreInputUserData())
10297 {
10298 ScriptInputUserData ctx = new ScriptInputUserData;
10303 ctx.
Write(destination_entity);
10309 }
10310 }
10311 else if (!
GetGame().IsMultiplayer())
10312 {
10314 }
10315 }
10316
10318 {
10320 }
10321
10323 {
10325 float split_quantity_new;
10327 if (dst.IsValid())
10328 {
10329 int slot_id = dst.GetSlot();
10331
10332 if (quantity > stack_max)
10333 split_quantity_new = stack_max;
10334 else
10335 split_quantity_new = quantity;
10336
10338 {
10340
10341 if (new_item)
10342 {
10343 new_item.SetResultOfSplit(true);
10344 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10346 new_item.
SetQuantity(split_quantity_new,
false,
true);
10347 }
10348
10349 return new_item;
10350 }
10351 }
10352
10353 return null;
10354 }
10355
10357 {
10359 float split_quantity_new;
10361 if (destination_entity)
10362 {
10364 if (quantity > stackable)
10365 split_quantity_new = stackable;
10366 else
10367 split_quantity_new = quantity;
10368
10370 {
10371 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10372 if (new_item)
10373 {
10374 new_item.SetResultOfSplit(true);
10375 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10377 new_item.
SetQuantity(split_quantity_new,
false,
true);
10378 }
10379 }
10380 }
10381 }
10382
10384 {
10386 {
10387 if (ScriptInputUserData.CanStoreInputUserData())
10388 {
10389 ScriptInputUserData ctx = new ScriptInputUserData;
10394 ItemBase destination_entity =
this;
10395 ctx.
Write(destination_entity);
10399 }
10400 }
10401 else if (!
GetGame().IsMultiplayer())
10402 {
10404 }
10405 }
10406
10408 {
10410 float split_quantity_new;
10412 if (player)
10413 {
10415 if (quantity > stackable)
10416 split_quantity_new = stackable;
10417 else
10418 split_quantity_new = quantity;
10419
10421 {
10422 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10423 new_item =
ItemBase.Cast(in_hands);
10424 if (new_item)
10425 {
10426 new_item.SetResultOfSplit(true);
10427 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10429 new_item.SetQuantity(split_quantity_new, false, true);
10430 }
10431 }
10432 }
10433 }
10434
10436 {
10438 float split_quantity_new = Math.Floor(quantity * 0.5);
10439
10441 return;
10442
10444
10445 if (new_item)
10446 {
10447 if (new_item.GetQuantityMax() < split_quantity_new)
10448 {
10449 split_quantity_new = new_item.GetQuantityMax();
10450 }
10451
10452 new_item.SetResultOfSplit(true);
10453 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10454
10456 {
10459 }
10460 else
10461 {
10463 new_item.
SetQuantity(split_quantity_new,
false,
true);
10464 }
10465 }
10466 }
10467
10469 {
10471 float split_quantity_new = Math.Floor(quantity / 2);
10472
10474 return;
10475
10476 InventoryLocation invloc = new InventoryLocation;
10478
10480 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10481
10482 if (new_item)
10483 {
10484 if (new_item.GetQuantityMax() < split_quantity_new)
10485 {
10486 split_quantity_new = new_item.GetQuantityMax();
10487 }
10489 {
10492 }
10493 else if (split_quantity_new > 1)
10494 {
10496 new_item.
SetQuantity(split_quantity_new,
false,
true);
10497 }
10498 }
10499 }
10500
10503 {
10504 SetWeightDirty();
10506
10507 if (parent)
10508 parent.OnAttachmentQuantityChangedEx(this, delta);
10509
10511 {
10513 {
10515 }
10517 {
10518 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10520 }
10521 }
10522
10523 }
10524
10527 {
10528
10529 }
10530
10533 {
10535 }
10536
10538 {
10539 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10540
10542 {
10543 if (newLevel == GameConstants.STATE_RUINED)
10544 {
10546 EntityAI parent = GetHierarchyParent();
10547 if (parent && parent.IsFireplace())
10548 {
10549 CargoBase cargo = GetInventory().GetCargo();
10550 if (cargo)
10551 {
10553 {
10555 }
10556 }
10557 }
10558 }
10559
10561 {
10562
10564 return;
10565 }
10566
10567 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10568 {
10570 }
10571 }
10572 }
10573
10574
10576 {
10577 super.OnRightClick();
10578
10580 {
10582 {
10583 if (ScriptInputUserData.CanStoreInputUserData())
10584 {
10585 EntityAI root = GetHierarchyRoot();
10586 Man playerOwner = GetHierarchyRootPlayer();
10587 InventoryLocation dst = new InventoryLocation;
10588
10589
10590 if (!playerOwner && root && root == this)
10591 {
10593 }
10594 else
10595 {
10596
10597 GetInventory().GetCurrentInventoryLocation(dst);
10599 {
10602 {
10604 }
10605 else
10606 {
10608
10609
10610 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10611 {
10613 }
10614 else
10615 {
10616 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10617 }
10618 }
10619 }
10620 }
10621
10622 ScriptInputUserData ctx = new ScriptInputUserData;
10630 }
10631 }
10632 else if (!
GetGame().IsMultiplayer())
10633 {
10635 }
10636 }
10637 }
10638
10640 {
10641 if (root)
10642 {
10643 vector m4[4];
10644 root.GetTransform(m4);
10645 dst.SetGround(this, m4);
10646 }
10647 else
10648 {
10649 GetInventory().GetCurrentInventoryLocation(dst);
10650 }
10651 }
10652
10653 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10654 {
10655
10656 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10657 return false;
10658
10659 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10660 return false;
10661
10662
10664 return false;
10665
10666
10667 Magazine mag = Magazine.Cast(this);
10668 if (mag)
10669 {
10670 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10671 return false;
10672
10673 if (stack_max_limit)
10674 {
10675 Magazine other_mag = Magazine.Cast(other_item);
10676 if (other_item)
10677 {
10678 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10679 return false;
10680 }
10681
10682 }
10683 }
10684 else
10685 {
10686
10688 return false;
10689
10691 return false;
10692 }
10693
10694 PlayerBase player = null;
10695 if (CastTo(player, GetHierarchyRootPlayer()))
10696 {
10697 if (player.GetInventory().HasAttachment(this))
10698 return false;
10699
10700 if (player.IsItemsToDelete())
10701 return false;
10702 }
10703
10704 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10705 return false;
10706
10707 int slotID;
10709 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10710 return false;
10711
10712 return true;
10713 }
10714
10716 {
10718 }
10719
10721 {
10722 return m_IsResultOfSplit;
10723 }
10724
10726 {
10727 m_IsResultOfSplit = value;
10728 }
10729
10731 {
10733 }
10734
10736 {
10737 float other_item_quantity = other_item.GetQuantity();
10738 float this_free_space;
10739
10741
10743
10744 if (other_item_quantity > this_free_space)
10745 {
10746 return this_free_space;
10747 }
10748 else
10749 {
10750 return other_item_quantity;
10751 }
10752 }
10753
10755 {
10757 }
10758
10760 {
10762 return;
10763
10764 if (!IsMagazine() && other_item)
10765 {
10767 if (quantity_used != 0)
10768 {
10769 float hp1 = GetHealth01("","");
10770 float hp2 = other_item.GetHealth01("","");
10771 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10772 hpResult = hpResult / (
GetQuantity() + quantity_used);
10773
10774 hpResult *= GetMaxHealth();
10775 Math.Round(hpResult);
10776 SetHealth("", "Health", hpResult);
10777
10779 other_item.AddQuantity(-quantity_used);
10780 }
10781 }
10783 }
10784
10786 {
10787 #ifdef SERVER
10788 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10789 GetHierarchyParent().IncreaseLifetimeUp();
10790 #endif
10791 };
10792
10794 {
10795 PlayerBase p = PlayerBase.Cast(player);
10796
10797 array<int> recipesIds = p.m_Recipes;
10798 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10799 if (moduleRecipesManager)
10800 {
10801 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10802 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10803 }
10804
10805 for (int i = 0;i < recipesIds.Count(); i++)
10806 {
10807 int key = recipesIds.Get(i);
10808 string recipeName = moduleRecipesManager.GetRecipeName(key);
10810 }
10811 }
10812
10813
10814 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10815 {
10816 super.GetDebugActions(outputList);
10817
10818
10824
10825
10830
10835
10836
10840
10841
10843 {
10847 }
10848
10851
10852
10856
10858
10859 InventoryLocation loc = new InventoryLocation();
10860 GetInventory().GetCurrentInventoryLocation(loc);
10862 {
10863 if (Gizmo_IsSupported())
10866 }
10867
10869 }
10870
10871
10872
10873
10875 {
10876 super.OnAction(action_id, player, ctx);
10877
10879 {
10880 switch (action_id)
10881 {
10884 return true;
10887 return true;
10888 }
10889 }
10890
10892 {
10893 switch (action_id)
10894 {
10896 Delete();
10897 return true;
10898 }
10899 }
10900
10901 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10902 {
10903 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10904 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10905 PlayerBase p = PlayerBase.Cast(player);
10906 if (
EActions.RECIPES_RANGE_START < 1000)
10907 {
10908 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10909 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10910 }
10911 }
10912 #ifndef SERVER
10913 else if (action_id ==
EActions.WATCH_PLAYER)
10914 {
10915 PluginDeveloper.SetDeveloperItemClientEx(player);
10916 }
10917 #endif
10919 {
10920 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10921 {
10922 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10923 OnDebugButtonPressServer(id + 1);
10924 }
10925
10926 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10927 {
10928 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10930 }
10931
10932 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10933 {
10934 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10936 }
10937
10938 else if (action_id ==
EActions.ADD_QUANTITY)
10939 {
10940 if (IsMagazine())
10941 {
10942 Magazine mag = Magazine.Cast(this);
10943 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10944 }
10945 else
10946 {
10948 }
10949
10950 if (m_EM)
10951 {
10952 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10953 }
10954
10955 }
10956
10957 else if (action_id ==
EActions.REMOVE_QUANTITY)
10958 {
10959 if (IsMagazine())
10960 {
10961 Magazine mag2 = Magazine.Cast(this);
10962 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10963 }
10964 else
10965 {
10967 }
10968 if (m_EM)
10969 {
10970 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10971 }
10972
10973 }
10974
10975 else if (action_id ==
EActions.SET_QUANTITY_0)
10976 {
10978
10979 if (m_EM)
10980 {
10981 m_EM.SetEnergy(0);
10982 }
10983 }
10984
10985 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10986 {
10988
10989 if (m_EM)
10990 {
10991 m_EM.SetEnergy(m_EM.GetEnergyMax());
10992 }
10993 }
10994
10995 else if (action_id ==
EActions.ADD_HEALTH)
10996 {
10997 AddHealth("","",GetMaxHealth("","Health")/5);
10998 }
10999 else if (action_id ==
EActions.REMOVE_HEALTH)
11000 {
11001 AddHealth("","",-GetMaxHealth("","Health")/5);
11002 }
11003 else if (action_id ==
EActions.DESTROY_HEALTH)
11004 {
11005 SetHealth01("","",0);
11006 }
11007 else if (action_id ==
EActions.WATCH_ITEM)
11008 {
11010 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11011 #ifdef DEVELOPER
11012 SetDebugDeveloper_item(this);
11013 #endif
11014 }
11015
11016 else if (action_id ==
EActions.ADD_TEMPERATURE)
11017 {
11018 AddTemperature(20);
11019
11020 }
11021
11022 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11023 {
11024 AddTemperature(-20);
11025
11026 }
11027
11028 else if (action_id ==
EActions.FLIP_FROZEN)
11029 {
11030 SetFrozen(!GetIsFrozen());
11031
11032 }
11033
11034 else if (action_id ==
EActions.ADD_WETNESS)
11035 {
11037
11038 }
11039
11040 else if (action_id ==
EActions.REMOVE_WETNESS)
11041 {
11043
11044 }
11045
11046 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11047 {
11050
11051
11052 }
11053
11054 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11055 {
11058 }
11059
11060 else if (action_id ==
EActions.MAKE_SPECIAL)
11061 {
11062 auto debugParams = DebugSpawnParams.WithPlayer(player);
11063 OnDebugSpawnEx(debugParams);
11064 }
11065
11066 }
11067
11068
11069 return false;
11070 }
11071
11072
11073
11074
11078
11081
11082
11083
11085 {
11086 return false;
11087 }
11088
11089
11091 {
11092 return true;
11093 }
11094
11095
11097 {
11098 return true;
11099 }
11100
11101
11102
11104 {
11105 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11107 }
11108
11111 {
11112 return null;
11113 }
11114
11116 {
11117 return false;
11118 }
11119
11121 {
11122 return false;
11123 }
11124
11128
11129
11131 {
11132 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11133 return module_repairing.CanRepair(this, item_repair_kit);
11134 }
11135
11136
11137 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11138 {
11139 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11140 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11141 }
11142
11143
11145 {
11146
11147
11148
11149
11150
11151
11152
11153
11154 return 1;
11155 }
11156
11157
11158
11160 {
11162 }
11163
11164
11165
11167 {
11169 }
11170
11171
11180 {
11181 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11182
11183 if (player)
11184 {
11185 player.MessageStatus(text);
11186 }
11187 }
11188
11189
11198 {
11199 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11200
11201 if (player)
11202 {
11203 player.MessageAction(text);
11204 }
11205 }
11206
11207
11216 {
11217 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11218
11219 if (player)
11220 {
11221 player.MessageFriendly(text);
11222 }
11223 }
11224
11225
11234 {
11235 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11236
11237 if (player)
11238 {
11239 player.MessageImportant(text);
11240 }
11241 }
11242
11244 {
11245 return true;
11246 }
11247
11248
11249 override bool KindOf(
string tag)
11250 {
11251 bool found = false;
11252 string item_name = this.
GetType();
11255
11256 int array_size = item_tag_array.Count();
11257 for (int i = 0; i < array_size; i++)
11258 {
11259 if (item_tag_array.Get(i) == tag)
11260 {
11261 found = true;
11262 break;
11263 }
11264 }
11265 return found;
11266 }
11267
11268
11270 {
11271
11272 super.OnRPC(sender, rpc_type,ctx);
11273
11274
11275 switch (rpc_type)
11276 {
11277 #ifndef SERVER
11278 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11279 Param2<bool, string> p = new Param2<bool, string>(false, "");
11280
11282 return;
11283
11284 bool play = p.param1;
11285 string soundSet = p.param2;
11286
11287 if (play)
11288 {
11290 {
11292 {
11294 }
11295 }
11296 else
11297 {
11299 }
11300 }
11301 else
11302 {
11304 }
11305
11306 break;
11307 #endif
11308
11309 }
11310
11312 {
11314 }
11315 }
11316
11317
11318
11319
11321 {
11322 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11323 return plugin.GetID(
name);
11324 }
11325
11327 {
11328 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11329 return plugin.GetName(id);
11330 }
11331
11334 {
11335
11336
11337 int varFlags;
11338 if (!ctx.
Read(varFlags))
11339 return;
11340
11341 if (varFlags & ItemVariableFlags.FLOAT)
11342 {
11344 }
11345 }
11346
11348 {
11349
11350 super.SerializeNumericalVars(floats_out);
11351
11352
11353
11355 {
11357 }
11358
11360 {
11362 }
11363
11365 {
11367 }
11368
11370 {
11375 }
11376
11378 {
11380 }
11381 }
11382
11384 {
11385
11386 super.DeSerializeNumericalVars(floats);
11387
11388
11389 int index = 0;
11390 int mask = Math.Round(floats.Get(index));
11391
11392 index++;
11393
11395 {
11397 {
11399 }
11400 else
11401 {
11402 float quantity = floats.Get(index);
11403 SetQuantity(quantity,
true,
false,
false,
false);
11404 }
11405 index++;
11406 }
11407
11409 {
11410 float wet = floats.Get(index);
11412 index++;
11413 }
11414
11416 {
11417 int liquidtype = Math.Round(floats.Get(index));
11419 index++;
11420 }
11421
11423 {
11425 index++;
11427 index++;
11429 index++;
11431 index++;
11432 }
11433
11435 {
11436 int cleanness = Math.Round(floats.Get(index));
11438 index++;
11439 }
11440 }
11441
11443 {
11444 super.WriteVarsToCTX(ctx);
11445
11446
11448 {
11450 }
11451
11453 {
11455 }
11456
11458 {
11460 }
11461
11463 {
11464 int r,g,b,a;
11470 }
11471
11473 {
11475 }
11476 }
11477
11479 {
11480 if (!super.ReadVarsFromCTX(ctx,version))
11481 return false;
11482
11483 int intValue;
11484 float value;
11485
11486 if (version < 140)
11487 {
11488 if (!ctx.
Read(intValue))
11489 return false;
11490
11491 m_VariablesMask = intValue;
11492 }
11493
11495 {
11496 if (!ctx.
Read(value))
11497 return false;
11498
11500 {
11502 }
11503 else
11504 {
11506 }
11507 }
11508
11509 if (version < 140)
11510 {
11512 {
11513 if (!ctx.
Read(value))
11514 return false;
11515 SetTemperatureDirect(value);
11516 }
11517 }
11518
11520 {
11521 if (!ctx.
Read(value))
11522 return false;
11524 }
11525
11527 {
11528 if (!ctx.
Read(intValue))
11529 return false;
11531 }
11532
11534 {
11535 int r,g,b,a;
11537 return false;
11539 return false;
11541 return false;
11543 return false;
11544
11546 }
11547
11549 {
11550 if (!ctx.
Read(intValue))
11551 return false;
11553 }
11554
11555 if (version >= 138 && version < 140)
11556 {
11558 {
11559 if (!ctx.
Read(intValue))
11560 return false;
11561 SetFrozen(intValue);
11562 }
11563 }
11564
11565 return true;
11566 }
11567
11568
11570 {
11573 {
11575 }
11576
11577 if (!super.OnStoreLoad(ctx, version))
11578 {
11580 return false;
11581 }
11582
11583 if (version >= 114)
11584 {
11585 bool hasQuickBarIndexSaved;
11586
11587 if (!ctx.
Read(hasQuickBarIndexSaved))
11588 {
11590 return false;
11591 }
11592
11593 if (hasQuickBarIndexSaved)
11594 {
11595 int itmQBIndex;
11596
11597
11598 if (!ctx.
Read(itmQBIndex))
11599 {
11601 return false;
11602 }
11603
11604 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11605 if (itmQBIndex != -1 && parentPlayer)
11606 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11607 }
11608 }
11609 else
11610 {
11611
11612 PlayerBase player;
11613 int itemQBIndex;
11614 if (version ==
int.
MAX)
11615 {
11616 if (!ctx.
Read(itemQBIndex))
11617 {
11619 return false;
11620 }
11621 }
11622 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11623 {
11624
11625 if (!ctx.
Read(itemQBIndex))
11626 {
11628 return false;
11629 }
11630 if (itemQBIndex != -1 && player)
11631 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11632 }
11633 }
11634
11635 if (version < 140)
11636 {
11637
11638 if (!LoadVariables(ctx, version))
11639 {
11641 return false;
11642 }
11643 }
11644
11645
11647 {
11649 return false;
11650 }
11651 if (version >= 132)
11652 {
11654 if (raib)
11655 {
11657 {
11659 return false;
11660 }
11661 }
11662 }
11663
11665 return true;
11666 }
11667
11668
11669
11671 {
11672 super.OnStoreSave(ctx);
11673
11674 PlayerBase player;
11675 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11676 {
11678
11679 int itemQBIndex = -1;
11680 itemQBIndex = player.FindQuickBarEntityIndex(this);
11681 ctx.
Write(itemQBIndex);
11682 }
11683 else
11684 {
11686 }
11687
11689
11691 if (raib)
11692 {
11694 }
11695 }
11696
11697
11699 {
11700 super.AfterStoreLoad();
11701
11703 {
11705 }
11706
11708 {
11711 }
11712 }
11713
11715 {
11716 super.EEOnAfterLoad();
11717
11719 {
11721 }
11722
11725 }
11726
11728 {
11729 return false;
11730 }
11731
11732
11733
11735 {
11737 {
11738 #ifdef PLATFORM_CONSOLE
11739
11741 {
11743 if (menu)
11744 {
11746 }
11747 }
11748 #endif
11749 }
11750
11752 {
11755 }
11756
11758 {
11759 SetWeightDirty();
11761 }
11763 {
11766 }
11767
11769 {
11772 }
11774 {
11777 }
11778
11779 super.OnVariablesSynchronized();
11780 }
11781
11782
11783
11785 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11786 {
11787 if (!IsServerCheck(allow_client))
11788 return false;
11789
11791 return false;
11792
11795
11796 if (value <= (min + 0.001))
11797 value = min;
11798
11799 if (value == min)
11800 {
11801 if (destroy_config)
11802 {
11803 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11804 if (dstr)
11805 {
11807 this.Delete();
11808 return true;
11809 }
11810 }
11811 else if (destroy_forced)
11812 {
11814 this.Delete();
11815 return true;
11816 }
11817
11819 }
11820
11823
11825 {
11827
11828 if (delta)
11830 }
11831
11833
11834 return false;
11835 }
11836
11837
11839 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11840 {
11842 }
11843
11845 {
11848 }
11849
11851 {
11854 }
11855
11857 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11858 {
11859 float value_clamped = Math.Clamp(value, 0, 1);
11861 SetQuantity(result, destroy_config, destroy_forced);
11862 }
11863
11864
11867 {
11869 }
11870
11872 {
11874 }
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11886 {
11887 int slot = -1;
11888 if (GetInventory())
11889 {
11890 InventoryLocation il = new InventoryLocation;
11891 GetInventory().GetCurrentInventoryLocation(il);
11893 }
11894
11896 }
11897
11899 {
11900 float quantity_max = 0;
11901
11903 {
11904 if (attSlotID != -1)
11905 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11906
11907 if (quantity_max <= 0)
11909 }
11910
11911 if (quantity_max <= 0)
11913
11914 return quantity_max;
11915 }
11916
11918 {
11920 }
11921
11923 {
11925 }
11926
11927
11929 {
11931 }
11932
11934 {
11936 }
11937
11939 {
11941 }
11942
11943
11945 {
11946
11947 float weightEx = GetWeightEx();
11948 float special = GetInventoryAndCargoWeight();
11949 return weightEx - special;
11950 }
11951
11952
11954 {
11956 }
11957
11959 {
11961 {
11962 #ifdef DEVELOPER
11963 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11964 {
11965 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11967 }
11968 #endif
11969
11970 return GetQuantity() * GetConfigWeightModified();
11971 }
11972 else if (HasEnergyManager())
11973 {
11974 #ifdef DEVELOPER
11975 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11976 {
11977 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11978 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11979 }
11980 #endif
11981 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11982 }
11983 else
11984 {
11985 #ifdef DEVELOPER
11986 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11987 {
11988 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11989 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11990 }
11991 #endif
11992 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11993 }
11994 }
11995
11998 {
11999 int item_count = 0;
12001
12002 if (GetInventory().GetCargo() != NULL)
12003 {
12004 item_count = GetInventory().GetCargo().GetItemCount();
12005 }
12006
12007 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12008 {
12009 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12010 if (item)
12011 item_count += item.GetNumberOfItems();
12012 }
12013 return item_count;
12014 }
12015
12018 {
12019 float weight = 0;
12020 float wetness = 1;
12021 if (include_wetness)
12024 {
12025 weight = wetness * m_ConfigWeight;
12026 }
12028 {
12029 weight = 1;
12030 }
12031 return weight;
12032 }
12033
12034
12035
12037 {
12038 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12039 {
12040 GameInventory inv = GetInventory();
12041 array<EntityAI> items = new array<EntityAI>;
12043 for (int i = 0; i < items.Count(); i++)
12044 {
12046 if (item)
12047 {
12049 }
12050 }
12051 }
12052 }
12053
12054
12055
12056
12058 {
12059 float energy = 0;
12060 if (HasEnergyManager())
12061 {
12062 energy = GetCompEM().GetEnergy();
12063 }
12064 return energy;
12065 }
12066
12067
12069 {
12070 super.OnEnergyConsumed();
12071
12073 }
12074
12076 {
12077 super.OnEnergyAdded();
12078
12080 }
12081
12082
12084 {
12085 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12086 {
12088 {
12089 float energy_0to1 = GetCompEM().GetEnergy0To1();
12091 }
12092 }
12093 }
12094
12095
12097 {
12098 return ConfigGetFloat("heatIsolation");
12099 }
12100
12102 {
12104 }
12105
12107 {
12108 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12109 if (
GetGame().ConfigIsExisting(paramPath))
12111
12112 return 0.0;
12113 }
12114
12116 {
12117 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12118 if (
GetGame().ConfigIsExisting(paramPath))
12120
12121 return 0.0;
12122 }
12123
12124 override void SetWet(
float value,
bool allow_client =
false)
12125 {
12126 if (!IsServerCheck(allow_client))
12127 return;
12128
12131
12133
12134 m_VarWet = Math.Clamp(value, min, max);
12135
12137 {
12140 }
12141 }
12142
12143 override void AddWet(
float value)
12144 {
12146 }
12147
12149 {
12151 }
12152
12154 {
12156 }
12157
12159 {
12161 }
12162
12164 {
12166 }
12167
12169 {
12171 }
12172
12173 override void OnWetChanged(
float newVal,
float oldVal)
12174 {
12177 if (newLevel != oldLevel)
12178 {
12180 }
12181 }
12182
12184 {
12185 SetWeightDirty();
12186 }
12187
12189 {
12190 return GetWetLevelInternal(
m_VarWet);
12191 }
12192
12193
12194
12196 {
12198 }
12199
12201 {
12203 }
12204
12206 {
12208 }
12209
12211 {
12213 }
12214
12215
12216
12218 {
12219 if (ConfigIsExisting("itemModelLength"))
12220 {
12221 return ConfigGetFloat("itemModelLength");
12222 }
12223 return 0;
12224 }
12225
12227 {
12228 if (ConfigIsExisting("itemAttachOffset"))
12229 {
12230 return ConfigGetFloat("itemAttachOffset");
12231 }
12232 return 0;
12233 }
12234
12235 override void SetCleanness(
int value,
bool allow_client =
false)
12236 {
12237 if (!IsServerCheck(allow_client))
12238 return;
12239
12241
12243
12246 }
12247
12249 {
12251 }
12252
12254 {
12255 return true;
12256 }
12257
12258
12259
12260
12262 {
12264 }
12265
12267 {
12269 }
12270
12271
12272
12273
12274 override void SetColor(
int r,
int g,
int b,
int a)
12275 {
12281 }
12283 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12284 {
12289 }
12290
12292 {
12294 }
12295
12298 {
12299 int r,g,b,a;
12301 r = r/255;
12302 g = g/255;
12303 b = b/255;
12304 a = a/255;
12305 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12306 }
12307
12308
12309
12310 override void SetLiquidType(
int value,
bool allow_client =
false)
12311 {
12312 if (!IsServerCheck(allow_client))
12313 return;
12314
12319 }
12320
12322 {
12323 return ConfigGetInt("varLiquidTypeInit");
12324 }
12325
12327 {
12329 }
12330
12332 {
12334 SetFrozen(false);
12335 }
12336
12339 {
12340 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12341 }
12342
12343
12346 {
12347 PlayerBase nplayer;
12348 if (PlayerBase.CastTo(nplayer, player))
12349 {
12351
12352 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12353 }
12354 }
12355
12356
12359 {
12360 PlayerBase nplayer;
12361 if (PlayerBase.CastTo(nplayer,player))
12362 {
12363
12364 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12365
12366 }
12367
12368
12369 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12370
12371
12372 if (HasEnergyManager())
12373 {
12374 GetCompEM().UpdatePlugState();
12375 }
12376 }
12377
12378
12380 {
12381 super.OnPlacementStarted(player);
12382
12384 }
12385
12386 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12387 {
12389 {
12390 m_AdminLog.OnPlacementComplete(player,
this);
12391 }
12392
12393 super.OnPlacementComplete(player, position, orientation);
12394 }
12395
12396
12397
12398
12399
12401 {
12403 {
12404 return true;
12405 }
12406 else
12407 {
12408 return false;
12409 }
12410 }
12411
12412
12414 {
12416 {
12418 }
12419 }
12420
12421
12423 {
12425 }
12426
12428 {
12430 }
12431
12432 override void InsertAgent(
int agent,
float count = 1)
12433 {
12434 if (count < 1)
12435 return;
12436
12438 }
12439
12442 {
12444 }
12445
12446
12448 {
12450 }
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12494 {
12496 return false;
12497 return true;
12498 }
12499
12501 {
12502
12504 }
12505
12506
12509 {
12510 super.CheckForRoofLimited(timeTresholdMS);
12511
12513 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12514 {
12515 m_PreviousRoofTestTime = time;
12516 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12517 }
12518 }
12519
12520
12522 {
12524 {
12525 return 0;
12526 }
12527
12528 if (GetInventory().GetAttachmentSlotsCount() != 0)
12529 {
12530 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12531 if (filter)
12532 return filter.GetProtectionLevel(type, false, system);
12533 else
12534 return 0;
12535 }
12536
12537 string subclassPath, entryName;
12538
12539 switch (type)
12540 {
12542 entryName = "biological";
12543 break;
12545 entryName = "chemical";
12546 break;
12547 default:
12548 entryName = "biological";
12549 break;
12550 }
12551
12552 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12553
12555 }
12556
12557
12558
12561 {
12562 if (!IsMagazine())
12564
12566 }
12567
12568
12569
12570
12571
12576 {
12577 return true;
12578 }
12579
12581 {
12583 }
12584
12585
12586
12587
12588
12590 {
12591 if (parent)
12592 {
12593 if (parent.IsInherited(DayZInfected))
12594 return true;
12595
12596 if (!parent.IsRuined())
12597 return true;
12598 }
12599
12600 return true;
12601 }
12602
12604 {
12605 if (!super.CanPutAsAttachment(parent))
12606 {
12607 return false;
12608 }
12609
12610 if (!IsRuined() && !parent.IsRuined())
12611 {
12612 return true;
12613 }
12614
12615 return false;
12616 }
12617
12619 {
12620
12621
12622
12623
12624 return super.CanReceiveItemIntoCargo(item);
12625 }
12626
12628 {
12629
12630
12631
12632
12633 GameInventory attachmentInv = attachment.GetInventory();
12635 {
12636 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12637 return false;
12638 }
12639
12640 InventoryLocation loc = new InventoryLocation();
12641 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12642 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12643 return false;
12644
12645 return super.CanReceiveAttachment(attachment, slotId);
12646 }
12647
12649 {
12650 if (!super.CanReleaseAttachment(attachment))
12651 return false;
12652
12653 return GetInventory().AreChildrenAccessible();
12654 }
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12677 {
12678 int id = muzzle_owner.GetMuzzleID();
12679 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12680
12681 if (WPOF_array)
12682 {
12683 for (int i = 0; i < WPOF_array.Count(); i++)
12684 {
12685 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12686
12687 if (WPOF)
12688 {
12689 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12690 }
12691 }
12692 }
12693 }
12694
12695
12697 {
12698 int id = muzzle_owner.GetMuzzleID();
12700
12701 if (WPOBE_array)
12702 {
12703 for (int i = 0; i < WPOBE_array.Count(); i++)
12704 {
12705 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12706
12707 if (WPOBE)
12708 {
12709 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12710 }
12711 }
12712 }
12713 }
12714
12715
12717 {
12718 int id = muzzle_owner.GetMuzzleID();
12719 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12720
12721 if (WPOOH_array)
12722 {
12723 for (int i = 0; i < WPOOH_array.Count(); i++)
12724 {
12725 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12726
12727 if (WPOOH)
12728 {
12729 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12730 }
12731 }
12732 }
12733 }
12734
12735
12737 {
12738 int id = muzzle_owner.GetMuzzleID();
12739 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12740
12741 if (WPOOH_array)
12742 {
12743 for (int i = 0; i < WPOOH_array.Count(); i++)
12744 {
12745 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12746
12747 if (WPOOH)
12748 {
12749 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12750 }
12751 }
12752 }
12753 }
12754
12755
12757 {
12758 int id = muzzle_owner.GetMuzzleID();
12759 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12760
12761 if (WPOOH_array)
12762 {
12763 for (int i = 0; i < WPOOH_array.Count(); i++)
12764 {
12765 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12766
12767 if (WPOOH)
12768 {
12769 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12770 }
12771 }
12772 }
12773 }
12774
12775
12776
12778 {
12780 {
12781 return true;
12782 }
12783
12784 return false;
12785 }
12786
12788 {
12790 {
12791 return true;
12792 }
12793
12794 return false;
12795 }
12796
12798 {
12800 {
12801 return true;
12802 }
12803
12804 return false;
12805 }
12806
12808 {
12809 return false;
12810 }
12811
12814 {
12815 return UATimeSpent.DEFAULT_DEPLOY;
12816 }
12817
12818
12819
12820
12822 {
12824 SetSynchDirty();
12825 }
12826
12828 {
12830 }
12831
12832
12834 {
12835 return false;
12836 }
12837
12840 {
12841 string att_type = "None";
12842
12843 if (ConfigIsExisting("soundAttType"))
12844 {
12845 att_type = ConfigGetString("soundAttType");
12846 }
12847
12849 }
12850
12852 {
12854 }
12855
12856
12857
12858
12859
12865
12867 {
12870
12872 }
12873
12874
12876 {
12878 return;
12879
12881
12884
12887
12888 SoundParameters params = new SoundParameters();
12892 }
12893
12894
12896 {
12898 return;
12899
12901 SetSynchDirty();
12902
12905 }
12906
12907
12909 {
12911 return;
12912
12914 SetSynchDirty();
12915
12918 }
12919
12921 {
12923 }
12924
12926 {
12928 }
12929
12932 {
12933 if (!
GetGame().IsDedicatedServer())
12934 {
12935 if (ConfigIsExisting("attachSoundSet"))
12936 {
12937 string cfg_path = "";
12938 string soundset = "";
12939 string type_name =
GetType();
12940
12943 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12944 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12945
12946 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12947 {
12948 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12949 {
12950 if (cfg_slot_array[i] == slot_type)
12951 {
12952 soundset = cfg_soundset_array[i];
12953 break;
12954 }
12955 }
12956 }
12957
12958 if (soundset != "")
12959 {
12960 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12962 }
12963 }
12964 }
12965 }
12966
12968 {
12969
12970 }
12971
12972 void OnApply(PlayerBase player);
12973
12975 {
12976 return 1.0;
12977 };
12978
12980 {
12982 }
12983
12985 {
12987 }
12988
12990
12992 {
12993 SetDynamicPhysicsLifeTime(0.01);
12995 }
12996
12998 {
12999 array<string> zone_names = new array<string>;
13000 GetDamageZones(zone_names);
13001 for (int i = 0; i < zone_names.Count(); i++)
13002 {
13003 SetHealthMax(zone_names.Get(i),"Health");
13004 }
13005 SetHealthMax("","Health");
13006 }
13007
13010 {
13011 float global_health = GetHealth01("","Health");
13012 array<string> zones = new array<string>;
13013 GetDamageZones(zones);
13014
13015 for (int i = 0; i < zones.Count(); i++)
13016 {
13017 SetHealth01(zones.Get(i),"Health",global_health);
13018 }
13019 }
13020
13023 {
13024 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13025 }
13026
13028 {
13029 if (!hasRootAsPlayer)
13030 {
13031 if (refParentIB)
13032 {
13033
13034 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13035 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13036
13037 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13038 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13039
13042 }
13043 else
13044 {
13045
13048 }
13049 }
13050 }
13051
13053 {
13055 {
13056 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13057 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13058 {
13059 float heatPermCoef = 1.0;
13061 while (ent)
13062 {
13063 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13064 ent = ent.GetHierarchyParent();
13065 }
13066
13067 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13068 }
13069 }
13070 }
13071
13073 {
13074
13075 EntityAI parent = GetHierarchyParent();
13076 if (!parent)
13077 {
13078 hasParent = false;
13079 hasRootAsPlayer = false;
13080 }
13081 else
13082 {
13083 hasParent = true;
13084 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13085 refParentIB =
ItemBase.Cast(parent);
13086 }
13087 }
13088
13089 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13090 {
13091
13092 }
13093
13095 {
13096
13097 return false;
13098 }
13099
13101 {
13102
13103
13104 return false;
13105 }
13106
13108 {
13109
13110 return false;
13111 }
13112
13115 {
13116 return !GetIsFrozen() &&
IsOpen();
13117 }
13118
13120 {
13121 bool hasParent = false, hasRootAsPlayer = false;
13123
13124 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13125 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13126
13127 if (wwtu || foodDecay)
13128 {
13132
13133 if (processWetness || processTemperature || processDecay)
13134 {
13136
13137 if (processWetness)
13138 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13139
13140 if (processTemperature)
13142
13143 if (processDecay)
13144 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13145 }
13146 }
13147 }
13148
13151 {
13153 }
13154
13156 {
13159
13160 return super.GetTemperatureFreezeThreshold();
13161 }
13162
13164 {
13167
13168 return super.GetTemperatureThawThreshold();
13169 }
13170
13172 {
13175
13176 return super.GetItemOverheatThreshold();
13177 }
13178
13180 {
13182 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13183
13184 return super.GetTemperatureFreezeTime();
13185 }
13186
13188 {
13190 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13191
13192 return super.GetTemperatureThawTime();
13193 }
13194
13199
13201 {
13202 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13203 }
13204
13206 {
13207 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13208 }
13209
13212 {
13214 }
13215
13217 {
13219 }
13220
13222 {
13224 }
13225
13228 {
13229 return null;
13230 }
13231
13234 {
13235 return false;
13236 }
13237
13239 {
13241 {
13244 if (!trg)
13245 {
13247 explosive = this;
13248 }
13249
13250 explosive.PairRemote(trg);
13252
13253 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13254 trg.SetPersistentPairID(persistentID);
13255 explosive.SetPersistentPairID(persistentID);
13256
13257 return true;
13258 }
13259 return false;
13260 }
13261
13264 {
13265 float ret = 1.0;
13268 ret *= GetHealth01();
13269
13270 return ret;
13271 }
13272
13273 #ifdef DEVELOPER
13274 override void SetDebugItem()
13275 {
13276 super.SetDebugItem();
13277 _itemBase = this;
13278 }
13279
13281 {
13282 string text = super.GetDebugText();
13283
13285 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13286
13287 return text;
13288 }
13289 #endif
13290
13292 {
13293 return true;
13294 }
13295
13297
13299
13301 {
13304 }
13305
13306
13314
13330}
13331
13333{
13335 if (entity)
13336 {
13337 bool is_item = entity.IsInherited(
ItemBase);
13338 if (is_item && full_quantity)
13339 {
13342 }
13343 }
13344 else
13345 {
13347 return NULL;
13348 }
13349 return entity;
13350}
13351
13353{
13354 if (item)
13355 {
13356 if (health > 0)
13357 item.SetHealth("", "", health);
13358
13359 if (item.CanHaveTemperature())
13360 {
13362 if (item.CanFreeze())
13363 item.SetFrozen(false);
13364 }
13365
13366 if (item.HasEnergyManager())
13367 {
13368 if (quantity >= 0)
13369 {
13370 item.GetCompEM().SetEnergy0To1(quantity);
13371 }
13372 else
13373 {
13375 }
13376 }
13377 else if (item.IsMagazine())
13378 {
13379 Magazine mag = Magazine.Cast(item);
13380 if (quantity >= 0)
13381 {
13382 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13383 }
13384 else
13385 {
13387 }
13388
13389 }
13390 else
13391 {
13392 if (quantity >= 0)
13393 {
13394 item.SetQuantityNormalized(quantity, false);
13395 }
13396 else
13397 {
13399 }
13400
13401 }
13402 }
13403}
13404
13405#ifdef DEVELOPER
13407#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.