8451{
8453 {
8454 return true;
8455 }
8456};
8457
8458
8459
8461{
8465
8467
8470
8471
8472
8473
8474
8483
8489
8494
8499
8520 protected bool m_IsResultOfSplit
8521
8523
8528
8529
8530
8532
8536
8537
8538
8540
8543
8544
8545
8551
8552
8560
8563
8564
8566
8567
8569
8570
8575
8576
8581
8582
8584
8585
8587 {
8592
8593 if (!
GetGame().IsDedicatedServer())
8594 {
8596 {
8598
8600 {
8602 }
8603 }
8604
8607 }
8608
8609 m_OldLocation = null;
8610
8612 {
8614 }
8615
8616 if (ConfigIsExisting("headSelectionsToHide"))
8617 {
8620 }
8621
8623 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8624 {
8626 }
8627
8629
8630 m_IsResultOfSplit = false;
8631
8633 }
8634
8636 {
8637 super.InitItemVariables();
8638
8644 m_Count = ConfigGetInt(
"count");
8645
8648
8653
8656
8661
8673
8677
8678
8681 if (ConfigIsExisting("canBeSplit"))
8682 {
8685 }
8686
8688 if (ConfigIsExisting("itemBehaviour"))
8690
8691
8694 RegisterNetSyncVariableInt("m_VarLiquidType");
8695 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8696
8697 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8698 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8699 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8700
8701 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8702 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8703 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8704 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8705
8706 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8707 RegisterNetSyncVariableBool("m_IsTakeable");
8708 RegisterNetSyncVariableBool("m_IsHologram");
8709
8712 {
8715 }
8716
8718
8720 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8722
8723 }
8724
8726 {
8728 }
8729
8731 {
8734 {
8739 }
8740 }
8741
8742 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8743 {
8745 {
8748 }
8749
8751 }
8752
8754 {
8760 }
8761
8763
8765 {
8767
8768 if (!action)
8769 {
8770 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8771 return;
8772 }
8773
8775 if (!ai)
8776 {
8778 return;
8779 }
8780
8782 if (!action_array)
8783 {
8784 action_array = new array<ActionBase_Basic>;
8786 }
8787 if (LogManager.IsActionLogEnable())
8788 {
8789 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8790 }
8791
8792 if (action_array.Find(action) != -1)
8793 {
8794 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8795 }
8796 else
8797 {
8798 action_array.Insert(action);
8799 }
8800 }
8801
8803 {
8805 ActionBase action = player.GetActionManager().GetAction(actionName);
8808
8809 if (action_array)
8810 {
8811 action_array.RemoveItem(action);
8812 }
8813 }
8814
8815
8816
8818 {
8819 ActionOverrideData overrideData = new ActionOverrideData();
8823
8825 if (!actionMap)
8826 {
8829 }
8830
8831 actionMap.Insert(this.
Type(), overrideData);
8832
8833 }
8834
8836
8838
8839
8841 {
8844
8847
8848 string config_to_search = "CfgVehicles";
8849 string muzzle_owner_config;
8850
8852 {
8853 if (IsInherited(Weapon))
8854 config_to_search = "CfgWeapons";
8855
8856 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8857
8858 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8859
8861
8862 if (config_OnFire_subclass_count > 0)
8863 {
8864 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8865
8866 for (int i = 0; i < config_OnFire_subclass_count; i++)
8867 {
8868 string particle_class = "";
8870 string config_OnFire_entry = config_OnFire_class + particle_class;
8871 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8872 WPOF_array.Insert(WPOF);
8873 }
8874
8875
8877 }
8878 }
8879
8881 {
8882 config_to_search = "CfgWeapons";
8883 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8884
8885 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8886
8888
8889 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8890 {
8891 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8892
8893 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8894 {
8895 string particle_class2 = "";
8897 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8898 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8899 WPOBE_array.Insert(WPOBE);
8900 }
8901
8902
8904 }
8905 }
8906 }
8907
8908
8910 {
8913
8915 {
8916 string config_to_search = "CfgVehicles";
8917
8918 if (IsInherited(Weapon))
8919 config_to_search = "CfgWeapons";
8920
8921 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8922 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8923
8924 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8925 {
8926
8928
8930 {
8932 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8934 return;
8935 }
8936
8939
8940
8941
8943 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8944
8945 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8946 {
8947 string particle_class = "";
8949 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8951
8952 if (entry_type == CT_CLASS)
8953 {
8954 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8955 WPOOH_array.Insert(WPOF);
8956 }
8957 }
8958
8959
8961 }
8962 }
8963 }
8964
8966 {
8968 }
8969
8971 {
8973 {
8975
8978
8981
8982 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8983 }
8984 }
8985
8987 {
8989 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8990
8992 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8993
8995 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8996
8998 {
9000 }
9001 }
9002
9004 {
9006 }
9007
9009 {
9012 else
9014
9016 {
9019 }
9020 else
9021 {
9024
9027 }
9028
9030 }
9031
9033 {
9035 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9036 }
9037
9039 {
9041 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9043 }
9044
9046 {
9048 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9049 }
9050
9052 {
9055
9056 OverheatingParticle OP = new OverheatingParticle();
9061
9063 }
9064
9066 {
9069
9070 return -1;
9071 }
9072
9074 {
9076 {
9079
9080 for (int i = count; i > 0; --i)
9081 {
9082 int id = i - 1;
9085
9088
9089 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9090 {
9091 if (p)
9092 {
9095 }
9096 }
9097 }
9098 }
9099 }
9100
9102 {
9104 {
9106 {
9107 int id = i - 1;
9109
9110 if (OP)
9111 {
9113
9114 if (p)
9115 {
9117 }
9118
9119 delete OP;
9120 }
9121 }
9122
9125 }
9126 }
9127
9130 {
9131 return 0.0;
9132 }
9133
9134
9136 {
9137 return 250;
9138 }
9139
9141 {
9142 return 0;
9143 }
9144
9147 {
9149 return true;
9150
9151 return false;
9152 }
9153
9156 {
9159
9161 {
9163 }
9164 else
9165 {
9166
9168 }
9169
9171 }
9172
9179 {
9180 return -1;
9181 }
9182
9183
9184
9185
9187 {
9189 {
9191 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9192
9193 if (r_index >= 0)
9194 {
9195 InventoryLocation r_il = new InventoryLocation;
9196 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9197
9198 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9201 {
9202 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9203 }
9205 {
9206 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9207 }
9208
9209 }
9210
9211 player.GetHumanInventory().ClearUserReservedLocation(this);
9212 }
9213
9216 }
9217
9218
9219
9220
9222 {
9223 return ItemBase.m_DebugActionsMask;
9224 }
9225
9227 {
9228 return ItemBase.m_DebugActionsMask & mask;
9229 }
9230
9232 {
9233 ItemBase.m_DebugActionsMask = mask;
9234 }
9235
9237 {
9238 ItemBase.m_DebugActionsMask |= mask;
9239 }
9240
9242 {
9243 ItemBase.m_DebugActionsMask &= ~mask;
9244 }
9245
9247 {
9249 {
9251 }
9252 else
9253 {
9255 }
9256 }
9257
9258
9260 {
9261 if (GetEconomyProfile())
9262 {
9263 float q_max = GetEconomyProfile().GetQuantityMax();
9264 if (q_max > 0)
9265 {
9266 float q_min = GetEconomyProfile().GetQuantityMin();
9267 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9268
9270 {
9271 ComponentEnergyManager comp = GetCompEM();
9273 {
9275 }
9276 }
9278 {
9280
9281 }
9282
9283 }
9284 }
9285 }
9286
9289 {
9290 EntityAI parent = GetHierarchyParent();
9291
9292 if (parent)
9293 {
9294 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9295 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9296 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9297 }
9298 }
9299
9302 {
9303 EntityAI parent = GetHierarchyParent();
9304
9305 if (parent)
9306 {
9307 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9308 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9309 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9310 }
9311 }
9312
9314 {
9315
9316
9317
9318
9320
9322 {
9323 if (ScriptInputUserData.CanStoreInputUserData())
9324 {
9325 ScriptInputUserData ctx = new ScriptInputUserData;
9331 ctx.
Write(use_stack_max);
9334
9336 {
9337 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9338 }
9339 }
9340 }
9341 else if (!
GetGame().IsMultiplayer())
9342 {
9344 }
9345 }
9346
9348 {
9350 }
9351
9353 {
9355 }
9356
9358 {
9360 }
9361
9363 {
9364
9365 return false;
9366 }
9367
9369 {
9370 return false;
9371 }
9372
9376 {
9377 return false;
9378 }
9379
9381 {
9382 return "";
9383 }
9384
9386
9388 {
9389 return false;
9390 }
9391
9393 {
9394 return true;
9395 }
9396
9397
9398
9400 {
9401 return true;
9402 }
9403
9405 {
9406 return true;
9407 }
9408
9410 {
9411 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9413 }
9414
9416 {
9418 }
9419
9421 {
9423 if (!is_being_placed)
9425 SetSynchDirty();
9426 }
9427
9428
9430
9432 {
9434 }
9435
9437 {
9439 }
9440
9442 {
9443 return 1;
9444 }
9445
9447 {
9448 return false;
9449 }
9450
9452 {
9454 SetSynchDirty();
9455 }
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9492 {
9493 super.OnMovedInsideCargo(container);
9494
9495 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9496 }
9497
9498 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9499 {
9500 super.EEItemLocationChanged(oldLoc,newLoc);
9501
9502 PlayerBase new_player = null;
9503 PlayerBase old_player = null;
9504
9505 if (newLoc.GetParent())
9506 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9507
9508 if (oldLoc.GetParent())
9509 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9510
9512 {
9513 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9514
9515 if (r_index >= 0)
9516 {
9517 InventoryLocation r_il = new InventoryLocation;
9518 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9519
9520 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9523 {
9524 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9525 }
9527 {
9528 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9529 }
9530
9531 }
9532 }
9533
9535 {
9536 if (new_player)
9537 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9538
9539 if (new_player == old_player)
9540 {
9541
9542 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9543 {
9545 {
9546 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9547 {
9548 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9549 }
9550 }
9551 else
9552 {
9553 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9554 }
9555 }
9556
9557 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9558 {
9559 int type = oldLoc.GetType();
9561 {
9562 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9563 }
9565 {
9566 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9567 }
9568 }
9569 if (!m_OldLocation)
9570 {
9571 m_OldLocation = new InventoryLocation;
9572 }
9573 m_OldLocation.Copy(oldLoc);
9574 }
9575 else
9576 {
9577 if (m_OldLocation)
9578 {
9579 m_OldLocation.Reset();
9580 }
9581 }
9582
9584 }
9585 else
9586 {
9587 if (new_player)
9588 {
9589 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9590 if (res_index >= 0)
9591 {
9592 InventoryLocation il = new InventoryLocation;
9593 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9595 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9598 {
9599 il.
GetParent().GetOnReleaseLock().Invoke(it);
9600 }
9602 {
9604 }
9605
9606 }
9607 }
9609 {
9610
9612 }
9613
9614 if (m_OldLocation)
9615 {
9616 m_OldLocation.Reset();
9617 }
9618 }
9619 }
9620
9621 override void EOnContact(IEntity other, Contact extra)
9622 {
9624 {
9625 int liquidType = -1;
9627 if (impactSpeed > 0.0)
9628 {
9630 #ifndef SERVER
9632 #else
9634 SetSynchDirty();
9635 #endif
9637 }
9638 }
9639
9640 #ifdef SERVER
9641 if (GetCompEM() && GetCompEM().IsPlugged())
9642 {
9643 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9644 GetCompEM().UnplugThis();
9645 }
9646 #endif
9647 }
9648
9650
9652 {
9654 }
9655
9657 {
9658
9659 }
9660
9662 {
9663 super.OnItemLocationChanged(old_owner, new_owner);
9664
9665 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9666 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9667
9668 if (!relatedPlayer && playerNew)
9669 relatedPlayer = playerNew;
9670
9671 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9672 {
9674 if (actionMgr)
9675 {
9676 ActionBase currentAction = actionMgr.GetRunningAction();
9677 if (currentAction)
9679 }
9680 }
9681
9682 Man ownerPlayerOld = null;
9683 Man ownerPlayerNew = null;
9684
9685 if (old_owner)
9686 {
9687 if (old_owner.
IsMan())
9688 {
9689 ownerPlayerOld = Man.Cast(old_owner);
9690 }
9691 else
9692 {
9693 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9694 }
9695 }
9696 else
9697 {
9699 {
9701
9702 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9703 {
9704 GetCompEM().UnplugThis();
9705 }
9706 }
9707 }
9708
9709 if (new_owner)
9710 {
9711 if (new_owner.
IsMan())
9712 {
9713 ownerPlayerNew = Man.Cast(new_owner);
9714 }
9715 else
9716 {
9717 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9718 }
9719 }
9720
9721 if (ownerPlayerOld != ownerPlayerNew)
9722 {
9723 if (ownerPlayerOld)
9724 {
9725 array<EntityAI> subItemsExit = new array<EntityAI>;
9727 for (int i = 0; i < subItemsExit.Count(); i++)
9728 {
9731 }
9732 }
9733
9734 if (ownerPlayerNew)
9735 {
9736 array<EntityAI> subItemsEnter = new array<EntityAI>;
9738 for (int j = 0; j < subItemsEnter.Count(); j++)
9739 {
9742 }
9743 }
9744 }
9745 else if (ownerPlayerNew != null)
9746 {
9747 PlayerBase nplayer;
9748 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9749 {
9750 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9752 for (int k = 0; k < subItemsUpdate.Count(); k++)
9753 {
9755 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9756 }
9757 }
9758 }
9759
9760 if (old_owner)
9761 old_owner.OnChildItemRemoved(this);
9762 if (new_owner)
9763 new_owner.OnChildItemReceived(this);
9764 }
9765
9766
9768 {
9769 super.EEDelete(parent);
9770 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9771 if (player)
9772 {
9774
9775 if (player.IsAlive())
9776 {
9777 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9778 if (r_index >= 0)
9779 {
9780 InventoryLocation r_il = new InventoryLocation;
9781 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9782
9783 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9786 {
9787 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9788 }
9790 {
9791 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9792 }
9793
9794 }
9795
9796 player.RemoveQuickBarEntityShortcut(this);
9797 }
9798 }
9799 }
9800
9802 {
9803 super.EEKilled(killer);
9804
9807 {
9808 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9809 {
9810 if (IsMagazine())
9811 {
9812 if (Magazine.Cast(this).GetAmmoCount() > 0)
9813 {
9815 }
9816 }
9817 else
9818 {
9820 }
9821 }
9822 }
9823 }
9824
9826 {
9827 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9828
9829 super.OnWasAttached(parent, slot_id);
9830
9833
9835 }
9836
9838 {
9839 super.OnWasDetached(parent, slot_id);
9840
9843 }
9844
9846 {
9847 int idx;
9850
9851 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9852 if (inventory_slots.Count() < 1)
9853 {
9854 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9855 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9856 }
9857 else
9858 {
9859 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9860 }
9861
9862 idx = inventory_slots.Find(slot);
9863 if (idx < 0)
9864 return "";
9865
9866 return attach_types.Get(idx);
9867 }
9868
9870 {
9871 int idx = -1;
9872 string slot;
9873
9876
9877 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9878 if (inventory_slots.Count() < 1)
9879 {
9880 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9881 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9882 }
9883 else
9884 {
9885 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9886 if (detach_types.Count() < 1)
9887 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9888 }
9889
9890 for (int i = 0; i < inventory_slots.Count(); i++)
9891 {
9892 slot = inventory_slots.Get(i);
9893 }
9894
9895 if (slot != "")
9896 {
9897 if (detach_types.Count() == 1)
9898 idx = 0;
9899 else
9900 idx = inventory_slots.Find(slot);
9901 }
9902 if (idx < 0)
9903 return "";
9904
9905 return detach_types.Get(idx);
9906 }
9907
9909 {
9910
9912
9913
9914 float min_time = 1;
9915 float max_time = 3;
9916 float delay = Math.RandomFloat(min_time, max_time);
9917
9918 explode_timer.Run(delay, this, "DoAmmoExplosion");
9919 }
9920
9922 {
9923 Magazine magazine = Magazine.Cast(this);
9924 int pop_sounds_count = 6;
9925 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9926
9927
9928 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9929 string sound_name = pop_sounds[ sound_idx ];
9931
9932
9933 magazine.ServerAddAmmoCount(-1);
9934
9935
9936 float min_temp_to_explode = 100;
9937
9938 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
9939 {
9941 }
9942 }
9943
9944
9945 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9946 {
9947 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9948
9949 const int CHANCE_DAMAGE_CARGO = 4;
9950 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9951 const int CHANCE_DAMAGE_NOTHING = 2;
9952
9954 {
9955 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9956 int chances;
9957 int rnd;
9958
9959 if (GetInventory().GetCargo())
9960 {
9961 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9962 rnd = Math.RandomInt(0,chances);
9963
9964 if (rnd < CHANCE_DAMAGE_CARGO)
9965 {
9967 }
9968 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9969 {
9971 }
9972 }
9973 else
9974 {
9975 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9976 rnd = Math.RandomInt(0,chances);
9977
9978 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9979 {
9981 }
9982 }
9983 }
9984 }
9985
9987 {
9988 if (GetInventory().GetCargo())
9989 {
9990 int item_count = GetInventory().GetCargo().GetItemCount();
9991 if (item_count > 0)
9992 {
9993 int random_pick = Math.RandomInt(0, item_count);
9995 if (!item.IsExplosive())
9996 {
9997 item.AddHealth("","",damage);
9998 return true;
9999 }
10000 }
10001 }
10002 return false;
10003 }
10004
10006 {
10007 int attachment_count = GetInventory().AttachmentCount();
10008 if (attachment_count > 0)
10009 {
10010 int random_pick = Math.RandomInt(0, attachment_count);
10011 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10012 if (!attachment.IsExplosive())
10013 {
10014 attachment.AddHealth("","",damage);
10015 return true;
10016 }
10017 }
10018 return false;
10019 }
10020
10022 {
10024 }
10025
10027 {
10029 return GetInventory().CanRemoveEntity();
10030
10031 return false;
10032 }
10033
10035 {
10037 return;
10038
10040 {
10041 if (ScriptInputUserData.CanStoreInputUserData())
10042 {
10043 ScriptInputUserData ctx = new ScriptInputUserData;
10048 ctx.
Write(destination_entity);
10050 ctx.
Write(slot_id);
10052 }
10053 }
10054 else if (!
GetGame().IsMultiplayer())
10055 {
10057 }
10058 }
10059
10061 {
10063 return;
10064
10065 float split_quantity_new;
10069 InventoryLocation loc = new InventoryLocation;
10070
10071 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10072 {
10074 split_quantity_new = stack_max;
10075 else
10077
10078 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10079 if (new_item)
10080 {
10081 new_item.SetResultOfSplit(true);
10082 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10084 new_item.SetQuantity(split_quantity_new);
10085 }
10086 }
10087 else if (destination_entity && slot_id == -1)
10088 {
10089 if (quantity > stack_max)
10090 split_quantity_new = stack_max;
10091 else
10092 split_quantity_new = quantity;
10093
10095 {
10098 }
10099
10100 if (new_item)
10101 {
10102 new_item.SetResultOfSplit(true);
10103 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10105 new_item.SetQuantity(split_quantity_new);
10106 }
10107 }
10108 else
10109 {
10110 if (stack_max != 0)
10111 {
10113 {
10115 }
10116
10117 if (split_quantity_new == 0)
10118 {
10119 if (!
GetGame().IsMultiplayer())
10120 player.PhysicalPredictiveDropItem(this);
10121 else
10122 player.ServerDropEntity(this);
10123 return;
10124 }
10125
10127
10128 if (new_item)
10129 {
10130 new_item.SetResultOfSplit(true);
10131 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10133 new_item.SetQuantity(stack_max);
10134 new_item.PlaceOnSurface();
10135 }
10136 }
10137 }
10138 }
10139
10141 {
10143 return;
10144
10145 float split_quantity_new;
10149 InventoryLocation loc = new InventoryLocation;
10150
10151 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10152 {
10154 split_quantity_new = stack_max;
10155 else
10157
10158 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10159 if (new_item)
10160 {
10161 new_item.SetResultOfSplit(true);
10162 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10164 new_item.SetQuantity(split_quantity_new);
10165 }
10166 }
10167 else if (destination_entity && slot_id == -1)
10168 {
10169 if (quantity > stack_max)
10170 split_quantity_new = stack_max;
10171 else
10172 split_quantity_new = quantity;
10173
10175 {
10178 }
10179
10180 if (new_item)
10181 {
10182 new_item.SetResultOfSplit(true);
10183 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10185 new_item.SetQuantity(split_quantity_new);
10186 }
10187 }
10188 else
10189 {
10190 if (stack_max != 0)
10191 {
10193 {
10195 }
10196
10198
10199 if (new_item)
10200 {
10201 new_item.SetResultOfSplit(true);
10202 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10204 new_item.SetQuantity(stack_max);
10205 new_item.PlaceOnSurface();
10206 }
10207 }
10208 }
10209 }
10210
10212 {
10214 return;
10215
10217 {
10218 if (ScriptInputUserData.CanStoreInputUserData())
10219 {
10220 ScriptInputUserData ctx = new ScriptInputUserData;
10225 dst.WriteToContext(ctx);
10227 }
10228 }
10229 else if (!
GetGame().IsMultiplayer())
10230 {
10232 }
10233 }
10234
10236 {
10238 return;
10239
10241 {
10242 if (ScriptInputUserData.CanStoreInputUserData())
10243 {
10244 ScriptInputUserData ctx = new ScriptInputUserData;
10249 ctx.
Write(destination_entity);
10255 }
10256 }
10257 else if (!
GetGame().IsMultiplayer())
10258 {
10260 }
10261 }
10262
10264 {
10266 }
10267
10269 {
10271 return this;
10272
10274 float split_quantity_new;
10276 if (dst.IsValid())
10277 {
10278 int slot_id = dst.GetSlot();
10280
10281 if (quantity > stack_max)
10282 split_quantity_new = stack_max;
10283 else
10284 split_quantity_new = quantity;
10285
10287
10288 if (new_item)
10289 {
10290 new_item.SetResultOfSplit(true);
10291 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10294 }
10295
10296 return new_item;
10297 }
10298
10299 return null;
10300 }
10301
10303 {
10305 return;
10306
10308 float split_quantity_new;
10310 if (destination_entity)
10311 {
10313 if (quantity > stackable)
10314 split_quantity_new = stackable;
10315 else
10316 split_quantity_new = quantity;
10317
10318 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10319 if (new_item)
10320 {
10321 new_item.SetResultOfSplit(true);
10322 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10324 new_item.SetQuantity(split_quantity_new);
10325 }
10326 }
10327 }
10328
10330 {
10332 return;
10333
10335 {
10336 if (ScriptInputUserData.CanStoreInputUserData())
10337 {
10338 ScriptInputUserData ctx = new ScriptInputUserData;
10343 ItemBase destination_entity =
this;
10344 ctx.
Write(destination_entity);
10348 }
10349 }
10350 else if (!
GetGame().IsMultiplayer())
10351 {
10353 }
10354 }
10355
10357 {
10359 return;
10360
10362 float split_quantity_new;
10364 if (player)
10365 {
10367 if (quantity > stackable)
10368 split_quantity_new = stackable;
10369 else
10370 split_quantity_new = quantity;
10371
10372 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10373 new_item =
ItemBase.Cast(in_hands);
10374 if (new_item)
10375 {
10376 new_item.SetResultOfSplit(true);
10377 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10379 new_item.SetQuantity(split_quantity_new);
10380 }
10381 }
10382 }
10383
10385 {
10387 return;
10388
10390 float split_quantity_new = Math.Floor(quantity * 0.5);
10391
10393
10394 if (new_item)
10395 {
10396 if (new_item.GetQuantityMax() < split_quantity_new)
10397 {
10398 split_quantity_new = new_item.GetQuantityMax();
10399 }
10400
10401 new_item.SetResultOfSplit(true);
10402 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10403
10405 {
10408 }
10409 else
10410 {
10413 }
10414 }
10415 }
10416
10418 {
10420 return;
10421
10423 float split_quantity_new = Math.Floor(quantity / 2);
10424
10425 InventoryLocation invloc = new InventoryLocation;
10427
10429 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10430
10431 if (new_item)
10432 {
10433 if (new_item.GetQuantityMax() < split_quantity_new)
10434 {
10435 split_quantity_new = new_item.GetQuantityMax();
10436 }
10438 {
10441 }
10442 else
10443 {
10446 }
10447 }
10448 }
10449
10452 {
10453 SetWeightDirty();
10455
10456 if (parent)
10457 parent.OnAttachmentQuantityChangedEx(this, delta);
10458
10460 {
10462 {
10464 }
10466 {
10467 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10469 }
10470 }
10471
10472 }
10473
10476 {
10477
10478 }
10479
10482 {
10484 }
10485
10487 {
10488 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10489
10491 {
10492 if (newLevel == GameConstants.STATE_RUINED)
10493 {
10495 EntityAI parent = GetHierarchyParent();
10496 if (parent && parent.IsFireplace())
10497 {
10498 CargoBase cargo = GetInventory().GetCargo();
10499 if (cargo)
10500 {
10502 {
10504 }
10505 }
10506 }
10507 }
10508
10510 {
10511
10513 return;
10514 }
10515
10516 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10517 {
10519 }
10520 }
10521 }
10522
10523
10525 {
10526 super.OnRightClick();
10527
10529 {
10531 {
10532 if (ScriptInputUserData.CanStoreInputUserData())
10533 {
10534 vector m4[4];
10536
10537 EntityAI root = GetHierarchyRoot();
10538
10539 InventoryLocation dst = new InventoryLocation;
10541 {
10542 if (root)
10543 {
10544 root.GetTransform(m4);
10546 }
10547 else
10548 GetInventory().GetCurrentInventoryLocation(dst);
10549 }
10550 else
10551 {
10553
10554
10555 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10556 {
10557 if (root)
10558 {
10559 root.GetTransform(m4);
10561 }
10562 else
10563 GetInventory().GetCurrentInventoryLocation(dst);
10564 }
10565 else
10566 {
10567 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10568 }
10569 }
10570
10571 ScriptInputUserData ctx = new ScriptInputUserData;
10579 }
10580 }
10581 else if (!
GetGame().IsMultiplayer())
10582 {
10584 }
10585 }
10586 }
10587
10588 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10589 {
10590
10591 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10592 return false;
10593
10594 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10595 return false;
10596
10597
10599 return false;
10600
10601
10602 Magazine mag = Magazine.Cast(this);
10603 if (mag)
10604 {
10605 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10606 return false;
10607
10608 if (stack_max_limit)
10609 {
10610 Magazine other_mag = Magazine.Cast(other_item);
10611 if (other_item)
10612 {
10613 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10614 return false;
10615 }
10616
10617 }
10618 }
10619 else
10620 {
10621
10623 return false;
10624
10626 return false;
10627 }
10628
10629 PlayerBase player = null;
10630 if (CastTo(player, GetHierarchyRootPlayer()))
10631 {
10632 if (player.GetInventory().HasAttachment(this))
10633 return false;
10634
10635 if (player.IsItemsToDelete())
10636 return false;
10637 }
10638
10639 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10640 return false;
10641
10642 int slotID;
10644 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10645 return false;
10646
10647 return true;
10648 }
10649
10651 {
10653 }
10654
10656 {
10657 return m_IsResultOfSplit;
10658 }
10659
10661 {
10662 m_IsResultOfSplit = value;
10663 }
10664
10666 {
10668 }
10669
10671 {
10672 float other_item_quantity = other_item.GetQuantity();
10673 float this_free_space;
10674
10676
10678
10679 if (other_item_quantity > this_free_space)
10680 {
10681 return this_free_space;
10682 }
10683 else
10684 {
10685 return other_item_quantity;
10686 }
10687 }
10688
10690 {
10692 }
10693
10695 {
10697 return;
10698
10699 if (!IsMagazine() && other_item)
10700 {
10702 if (quantity_used != 0)
10703 {
10704 float hp1 = GetHealth01("","");
10705 float hp2 = other_item.GetHealth01("","");
10706 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10707 hpResult = hpResult / (
GetQuantity() + quantity_used);
10708
10709 hpResult *= GetMaxHealth();
10710 Math.Round(hpResult);
10711 SetHealth("", "Health", hpResult);
10712
10714 other_item.AddQuantity(-quantity_used);
10715 }
10716 }
10718 }
10719
10721 {
10722 #ifdef SERVER
10723 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10724 GetHierarchyParent().IncreaseLifetimeUp();
10725 #endif
10726 };
10727
10729 {
10730 PlayerBase p = PlayerBase.Cast(player);
10731
10732 array<int> recipesIds = p.m_Recipes;
10733 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10734 if (moduleRecipesManager)
10735 {
10736 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10737 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10738 }
10739
10740 for (int i = 0;i < recipesIds.Count(); i++)
10741 {
10742 int key = recipesIds.Get(i);
10743 string recipeName = moduleRecipesManager.GetRecipeName(key);
10745 }
10746 }
10747
10748
10749 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10750 {
10751 super.GetDebugActions(outputList);
10752
10753
10758
10759
10763
10767
10768
10771
10772
10774 {
10777 }
10778
10780
10783
10787 }
10788
10789
10790
10791
10793 {
10794 super.OnAction(action_id, player, ctx);
10795 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10796 {
10797 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10798 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10799 PlayerBase p = PlayerBase.Cast(player);
10800 if (
EActions.RECIPES_RANGE_START < 1000)
10801 {
10802 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10803 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10804 }
10805 }
10806 #ifndef SERVER
10807 else if (action_id ==
EActions.WATCH_PLAYER)
10808 {
10809 PluginDeveloper.SetDeveloperItemClientEx(player);
10810 }
10811 #endif
10813 {
10814 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10815 {
10816 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10817 OnDebugButtonPressServer(id + 1);
10818 }
10819
10820 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10821 {
10822 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10824 }
10825
10826 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10827 {
10828 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10830 }
10831
10832 else if (action_id ==
EActions.ADD_QUANTITY)
10833 {
10834 if (IsMagazine())
10835 {
10836 Magazine mag = Magazine.Cast(this);
10837 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10838 }
10839 else
10840 {
10842 }
10843
10844 if (m_EM)
10845 {
10846 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10847 }
10848
10849 }
10850
10851 else if (action_id ==
EActions.REMOVE_QUANTITY)
10852 {
10853 if (IsMagazine())
10854 {
10855 Magazine mag2 = Magazine.Cast(this);
10856 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10857 }
10858 else
10859 {
10861 }
10862 if (m_EM)
10863 {
10864 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10865 }
10866
10867 }
10868
10869 else if (action_id ==
EActions.SET_QUANTITY_0)
10870 {
10872
10873 if (m_EM)
10874 {
10875 m_EM.SetEnergy(0);
10876 }
10877 }
10878
10879 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10880 {
10882
10883 if (m_EM)
10884 {
10885 m_EM.SetEnergy(m_EM.GetEnergyMax());
10886 }
10887 }
10888
10889 else if (action_id ==
EActions.ADD_HEALTH)
10890 {
10891 AddHealth("","",GetMaxHealth("","Health")/5);
10892 }
10893 else if (action_id ==
EActions.REMOVE_HEALTH)
10894 {
10895 AddHealth("","",-GetMaxHealth("","Health")/5);
10896 }
10897 else if (action_id ==
EActions.DESTROY_HEALTH)
10898 {
10899 SetHealth01("","",0);
10900 }
10901 else if (action_id ==
EActions.WATCH_ITEM)
10902 {
10904 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10905 #ifdef DEVELOPER
10906 SetDebugDeveloper_item(this);
10907 #endif
10908 }
10909
10910 else if (action_id ==
EActions.ADD_TEMPERATURE)
10911 {
10912 AddTemperature(20);
10913
10914 }
10915
10916 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10917 {
10918 AddTemperature(-20);
10919
10920 }
10921
10922 else if (action_id ==
EActions.FLIP_FROZEN)
10923 {
10924 SetFrozen(!GetIsFrozen());
10925
10926 }
10927
10928 else if (action_id ==
EActions.ADD_WETNESS)
10929 {
10931
10932 }
10933
10934 else if (action_id ==
EActions.REMOVE_WETNESS)
10935 {
10937
10938 }
10939
10940 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10941 {
10944
10945
10946 }
10947
10948 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10949 {
10952 }
10953
10954 else if (action_id ==
EActions.MAKE_SPECIAL)
10955 {
10956 auto debugParams = DebugSpawnParams.WithPlayer(player);
10957 OnDebugSpawnEx(debugParams);
10958 }
10959
10960 else if (action_id ==
EActions.DELETE)
10961 {
10962 Delete();
10963 }
10964
10965 }
10966
10967
10968 return false;
10969 }
10970
10971
10972
10973
10977
10980
10981
10982
10984 {
10985 return false;
10986 }
10987
10988
10990 {
10991 return true;
10992 }
10993
10994
10996 {
10997 return true;
10998 }
10999
11000
11001
11003 {
11004 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11006 }
11007
11010 {
11011 return null;
11012 }
11013
11015 {
11016 return false;
11017 }
11018
11020 {
11021 return false;
11022 }
11023
11027
11028
11030 {
11031 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11032 return module_repairing.CanRepair(this, item_repair_kit);
11033 }
11034
11035
11036 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11037 {
11038 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11039 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11040 }
11041
11042
11044 {
11045
11046
11047
11048
11049
11050
11051
11052
11053 return 1;
11054 }
11055
11056
11057
11059 {
11061 }
11062
11063
11064
11066 {
11068 }
11069
11070
11079 {
11080 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11081
11082 if (player)
11083 {
11084 player.MessageStatus(text);
11085 }
11086 }
11087
11088
11097 {
11098 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11099
11100 if (player)
11101 {
11102 player.MessageAction(text);
11103 }
11104 }
11105
11106
11115 {
11116 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11117
11118 if (player)
11119 {
11120 player.MessageFriendly(text);
11121 }
11122 }
11123
11124
11133 {
11134 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11135
11136 if (player)
11137 {
11138 player.MessageImportant(text);
11139 }
11140 }
11141
11143 {
11144 return true;
11145 }
11146
11147
11148 override bool KindOf(
string tag)
11149 {
11150 bool found = false;
11151 string item_name = this.
GetType();
11154
11155 int array_size = item_tag_array.Count();
11156 for (int i = 0; i < array_size; i++)
11157 {
11158 if (item_tag_array.Get(i) == tag)
11159 {
11160 found = true;
11161 break;
11162 }
11163 }
11164 return found;
11165 }
11166
11167
11169 {
11170
11171 super.OnRPC(sender, rpc_type,ctx);
11172
11173
11174 switch (rpc_type)
11175 {
11176 #ifndef SERVER
11177 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11178 Param2<bool, string> p = new Param2<bool, string>(false, "");
11179
11181 return;
11182
11183 bool play = p.param1;
11184 string soundSet = p.param2;
11185
11186 if (play)
11187 {
11189 {
11191 {
11193 }
11194 }
11195 else
11196 {
11198 }
11199 }
11200 else
11201 {
11203 }
11204
11205 break;
11206 #endif
11207
11208 }
11209
11211 {
11213 }
11214 }
11215
11216
11217
11218
11220 {
11221 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11222 return plugin.GetID(
name);
11223 }
11224
11226 {
11227 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11228 return plugin.GetName(id);
11229 }
11230
11233 {
11234
11235
11236 int varFlags;
11237 if (!ctx.
Read(varFlags))
11238 return;
11239
11240 if (varFlags & ItemVariableFlags.FLOAT)
11241 {
11243 }
11244 }
11245
11247 {
11248
11249 super.SerializeNumericalVars(floats_out);
11250
11251
11252
11254 {
11256 }
11257
11259 {
11261 }
11262
11264 {
11266 }
11267
11269 {
11274 }
11275
11277 {
11279 }
11280 }
11281
11283 {
11284
11285 super.DeSerializeNumericalVars(floats);
11286
11287
11288 int index = 0;
11289 int mask = Math.Round(floats.Get(index));
11290
11291 index++;
11292
11294 {
11296 {
11298 }
11299 else
11300 {
11301 float quantity = floats.Get(index);
11302 SetQuantity(quantity,
true,
false,
false,
false);
11303 }
11304 index++;
11305 }
11306
11308 {
11309 float wet = floats.Get(index);
11311 index++;
11312 }
11313
11315 {
11316 int liquidtype = Math.Round(floats.Get(index));
11318 index++;
11319 }
11320
11322 {
11324 index++;
11326 index++;
11328 index++;
11330 index++;
11331 }
11332
11334 {
11335 int cleanness = Math.Round(floats.Get(index));
11337 index++;
11338 }
11339 }
11340
11342 {
11343 super.WriteVarsToCTX(ctx);
11344
11345
11347 {
11349 }
11350
11352 {
11354 }
11355
11357 {
11359 }
11360
11362 {
11363 int r,g,b,a;
11369 }
11370
11372 {
11374 }
11375 }
11376
11378 {
11379 if (!super.ReadVarsFromCTX(ctx,version))
11380 return false;
11381
11382 int intValue;
11383 float value;
11384
11385 if (version < 140)
11386 {
11387 if (!ctx.
Read(intValue))
11388 return false;
11389
11390 m_VariablesMask = intValue;
11391 }
11392
11394 {
11395 if (!ctx.
Read(value))
11396 return false;
11397
11399 {
11401 }
11402 else
11403 {
11405 }
11406 }
11407
11408 if (version < 140)
11409 {
11411 {
11412 if (!ctx.
Read(value))
11413 return false;
11414 SetTemperatureDirect(value);
11415 }
11416 }
11417
11419 {
11420 if (!ctx.
Read(value))
11421 return false;
11423 }
11424
11426 {
11427 if (!ctx.
Read(intValue))
11428 return false;
11430 }
11431
11433 {
11434 int r,g,b,a;
11436 return false;
11438 return false;
11440 return false;
11442 return false;
11443
11445 }
11446
11448 {
11449 if (!ctx.
Read(intValue))
11450 return false;
11452 }
11453
11454 if (version >= 138 && version < 140)
11455 {
11457 {
11458 if (!ctx.
Read(intValue))
11459 return false;
11460 SetFrozen(intValue);
11461 }
11462 }
11463
11464 return true;
11465 }
11466
11467
11469 {
11472 {
11474 }
11475
11476 if (!super.OnStoreLoad(ctx, version))
11477 {
11479 return false;
11480 }
11481
11482 if (version >= 114)
11483 {
11484 bool hasQuickBarIndexSaved;
11485
11486 if (!ctx.
Read(hasQuickBarIndexSaved))
11487 {
11489 return false;
11490 }
11491
11492 if (hasQuickBarIndexSaved)
11493 {
11494 int itmQBIndex;
11495
11496
11497 if (!ctx.
Read(itmQBIndex))
11498 {
11500 return false;
11501 }
11502
11503 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11504 if (itmQBIndex != -1 && parentPlayer)
11505 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11506 }
11507 }
11508 else
11509 {
11510
11511 PlayerBase player;
11512 int itemQBIndex;
11513 if (version ==
int.
MAX)
11514 {
11515 if (!ctx.
Read(itemQBIndex))
11516 {
11518 return false;
11519 }
11520 }
11521 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11522 {
11523
11524 if (!ctx.
Read(itemQBIndex))
11525 {
11527 return false;
11528 }
11529 if (itemQBIndex != -1 && player)
11530 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11531 }
11532 }
11533
11534 if (version < 140)
11535 {
11536
11537 if (!LoadVariables(ctx, version))
11538 {
11540 return false;
11541 }
11542 }
11543
11544
11546 {
11548 return false;
11549 }
11550 if (version >= 132)
11551 {
11553 if (raib)
11554 {
11556 {
11558 return false;
11559 }
11560 }
11561 }
11562
11564 return true;
11565 }
11566
11567
11568
11570 {
11571 super.OnStoreSave(ctx);
11572
11573 PlayerBase player;
11574 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11575 {
11577
11578 int itemQBIndex = -1;
11579 itemQBIndex = player.FindQuickBarEntityIndex(this);
11580 ctx.
Write(itemQBIndex);
11581 }
11582 else
11583 {
11585 }
11586
11588
11590 if (raib)
11591 {
11593 }
11594 }
11595
11596
11598 {
11599 super.AfterStoreLoad();
11600
11602 {
11604 }
11605
11607 {
11610 }
11611 }
11612
11614 {
11615 super.EEOnAfterLoad();
11616
11618 {
11620 }
11621
11624 }
11625
11627 {
11628 return false;
11629 }
11630
11631
11632
11634 {
11636 {
11637 #ifdef PLATFORM_CONSOLE
11638
11640 {
11642 if (menu)
11643 {
11645 }
11646 }
11647 #endif
11648 }
11649
11651 {
11654 }
11655
11657 {
11658 SetWeightDirty();
11660 }
11662 {
11665 }
11666
11668 {
11671 }
11673 {
11676 }
11677
11678 super.OnVariablesSynchronized();
11679 }
11680
11681
11682
11684 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11685 {
11686 if (!IsServerCheck(allow_client))
11687 return false;
11688
11690 return false;
11691
11694
11695 if (value <= (min + 0.001))
11696 value = min;
11697
11698 if (value == min)
11699 {
11700 if (destroy_config)
11701 {
11702 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11703 if (dstr)
11704 {
11706 this.Delete();
11707 return true;
11708 }
11709 }
11710 else if (destroy_forced)
11711 {
11713 this.Delete();
11714 return true;
11715 }
11716
11718 }
11719
11722
11724 {
11726
11727 if (delta)
11729 }
11730
11732
11733 return false;
11734 }
11735
11736
11738 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11739 {
11741 }
11742
11744 {
11747 }
11748
11750 {
11753 }
11754
11757 {
11758 float value_clamped = Math.Clamp(value, 0, 1);
11760 SetQuantity(result, destroy_config, destroy_forced);
11761 }
11762
11763
11766 {
11768 }
11769
11771 {
11773 }
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11785 {
11786 int slot = -1;
11787 if (GetInventory())
11788 {
11789 InventoryLocation il = new InventoryLocation;
11790 GetInventory().GetCurrentInventoryLocation(il);
11792 }
11793
11795 }
11796
11798 {
11799 float quantity_max = 0;
11800
11802 {
11803 if (attSlotID != -1)
11804 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11805
11806 if (quantity_max <= 0)
11808 }
11809
11810 if (quantity_max <= 0)
11812
11813 return quantity_max;
11814 }
11815
11817 {
11819 }
11820
11822 {
11824 }
11825
11826
11828 {
11830 }
11831
11833 {
11835 }
11836
11838 {
11840 }
11841
11842
11844 {
11845
11846 float weightEx = GetWeightEx();
11847 float special = GetInventoryAndCargoWeight();
11848 return weightEx - special;
11849 }
11850
11851
11853 {
11855 }
11856
11858 {
11860 {
11861 #ifdef DEVELOPER
11862 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11863 {
11864 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11866 }
11867 #endif
11868
11869 return GetQuantity() * GetConfigWeightModified();
11870 }
11871 else if (HasEnergyManager())
11872 {
11873 #ifdef DEVELOPER
11874 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11875 {
11876 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11877 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11878 }
11879 #endif
11880 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11881 }
11882 else
11883 {
11884 #ifdef DEVELOPER
11885 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11886 {
11887 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11888 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11889 }
11890 #endif
11891 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11892 }
11893 }
11894
11897 {
11898 int item_count = 0;
11900
11901 if (GetInventory().GetCargo() != NULL)
11902 {
11903 item_count = GetInventory().GetCargo().GetItemCount();
11904 }
11905
11906 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11907 {
11908 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11909 if (item)
11910 item_count += item.GetNumberOfItems();
11911 }
11912 return item_count;
11913 }
11914
11917 {
11918 float weight = 0;
11919 float wetness = 1;
11920 if (include_wetness)
11923 {
11924 weight = wetness * m_ConfigWeight;
11925 }
11927 {
11928 weight = 1;
11929 }
11930 return weight;
11931 }
11932
11933
11934
11936 {
11937 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11938 {
11939 GameInventory inv = GetInventory();
11940 array<EntityAI> items = new array<EntityAI>;
11942 for (int i = 0; i < items.Count(); i++)
11943 {
11945 if (item)
11946 {
11948 }
11949 }
11950 }
11951 }
11952
11953
11954
11955
11957 {
11958 float energy = 0;
11959 if (HasEnergyManager())
11960 {
11961 energy = GetCompEM().GetEnergy();
11962 }
11963 return energy;
11964 }
11965
11966
11968 {
11969 super.OnEnergyConsumed();
11970
11972 }
11973
11975 {
11976 super.OnEnergyAdded();
11977
11979 }
11980
11981
11983 {
11984 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11985 {
11987 {
11988 float energy_0to1 = GetCompEM().GetEnergy0To1();
11990 }
11991 }
11992 }
11993
11994
11996 {
11997 return ConfigGetFloat("heatIsolation");
11998 }
11999
12001 {
12003 }
12004
12006 {
12007 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12008 if (
GetGame().ConfigIsExisting(paramPath))
12010
12011 return 0.0;
12012 }
12013
12015 {
12016 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12017 if (
GetGame().ConfigIsExisting(paramPath))
12019
12020 return 0.0;
12021 }
12022
12023 override void SetWet(
float value,
bool allow_client =
false)
12024 {
12025 if (!IsServerCheck(allow_client))
12026 return;
12027
12030
12032
12033 m_VarWet = Math.Clamp(value, min, max);
12034
12036 {
12039 }
12040 }
12041
12042 override void AddWet(
float value)
12043 {
12045 }
12046
12048 {
12050 }
12051
12053 {
12055 }
12056
12058 {
12060 }
12061
12063 {
12065 }
12066
12068 {
12070 }
12071
12072 override void OnWetChanged(
float newVal,
float oldVal)
12073 {
12076 if (newLevel != oldLevel)
12077 {
12079 }
12080 }
12081
12083 {
12084 SetWeightDirty();
12085 }
12086
12088 {
12089 return GetWetLevelInternal(
m_VarWet);
12090 }
12091
12092
12093
12095 {
12097 }
12098
12100 {
12102 }
12103
12105 {
12107 }
12108
12110 {
12112 }
12113
12114
12115
12117 {
12118 if (ConfigIsExisting("itemModelLength"))
12119 {
12120 return ConfigGetFloat("itemModelLength");
12121 }
12122 return 0;
12123 }
12124
12126 {
12127 if (ConfigIsExisting("itemAttachOffset"))
12128 {
12129 return ConfigGetFloat("itemAttachOffset");
12130 }
12131 return 0;
12132 }
12133
12134 override void SetCleanness(
int value,
bool allow_client =
false)
12135 {
12136 if (!IsServerCheck(allow_client))
12137 return;
12138
12140
12142
12145 }
12146
12148 {
12150 }
12151
12153 {
12154 return true;
12155 }
12156
12157
12158
12159
12161 {
12163 }
12164
12166 {
12168 }
12169
12170
12171
12172
12173 override void SetColor(
int r,
int g,
int b,
int a)
12174 {
12180 }
12182 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12183 {
12188 }
12189
12191 {
12193 }
12194
12197 {
12198 int r,g,b,a;
12200 r = r/255;
12201 g = g/255;
12202 b = b/255;
12203 a = a/255;
12204 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12205 }
12206
12207
12208
12209 override void SetLiquidType(
int value,
bool allow_client =
false)
12210 {
12211 if (!IsServerCheck(allow_client))
12212 return;
12213
12218 }
12219
12221 {
12222 return ConfigGetInt("varLiquidTypeInit");
12223 }
12224
12226 {
12228 }
12229
12231 {
12233 SetFrozen(false);
12234 }
12235
12238 {
12239 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12240 }
12241
12242
12245 {
12246 PlayerBase nplayer;
12247 if (PlayerBase.CastTo(nplayer, player))
12248 {
12250
12251 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12252 }
12253 }
12254
12255
12258 {
12259 PlayerBase nplayer;
12260 if (PlayerBase.CastTo(nplayer,player))
12261 {
12262
12263 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12264
12265 }
12266
12267
12268 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12269
12270
12271 if (HasEnergyManager())
12272 {
12273 GetCompEM().UpdatePlugState();
12274 }
12275 }
12276
12277
12279 {
12280 super.OnPlacementStarted(player);
12281
12283 }
12284
12285 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12286 {
12288 {
12289 m_AdminLog.OnPlacementComplete(player,
this);
12290 }
12291
12292 super.OnPlacementComplete(player, position, orientation);
12293 }
12294
12295
12296
12297
12298
12300 {
12302 {
12303 return true;
12304 }
12305 else
12306 {
12307 return false;
12308 }
12309 }
12310
12311
12313 {
12315 {
12317 }
12318 }
12319
12320
12322 {
12324 }
12325
12327 {
12329 }
12330
12331 override void InsertAgent(
int agent,
float count = 1)
12332 {
12333 if (count < 1)
12334 return;
12335
12337 }
12338
12341 {
12343 }
12344
12345
12347 {
12349 }
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12393 {
12395 return false;
12396 return true;
12397 }
12398
12400 {
12401
12403 }
12404
12405
12408 {
12409 super.CheckForRoofLimited(timeTresholdMS);
12410
12412 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12413 {
12414 m_PreviousRoofTestTime = time;
12415 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12416 }
12417 }
12418
12419
12421 {
12423 {
12424 return 0;
12425 }
12426
12427 if (GetInventory().GetAttachmentSlotsCount() != 0)
12428 {
12429 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12430 if (filter)
12431 return filter.GetProtectionLevel(type, false, system);
12432 else
12433 return 0;
12434 }
12435
12436 string subclassPath, entryName;
12437
12438 switch (type)
12439 {
12441 entryName = "biological";
12442 break;
12444 entryName = "chemical";
12445 break;
12446 default:
12447 entryName = "biological";
12448 break;
12449 }
12450
12451 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12452
12454 }
12455
12456
12457
12460 {
12461 if (!IsMagazine())
12463
12465 }
12466
12467
12468
12469
12470
12475 {
12476 return true;
12477 }
12478
12480 {
12482 }
12483
12484
12485
12486
12487
12489 {
12490 if (parent)
12491 {
12492 if (parent.IsInherited(DayZInfected))
12493 return true;
12494
12495 if (!parent.IsRuined())
12496 return true;
12497 }
12498
12499 return true;
12500 }
12501
12503 {
12504 if (!super.CanPutAsAttachment(parent))
12505 {
12506 return false;
12507 }
12508
12509 if (!IsRuined() && !parent.IsRuined())
12510 {
12511 return true;
12512 }
12513
12514 return false;
12515 }
12516
12518 {
12519
12520
12521
12522
12523 return super.CanReceiveItemIntoCargo(item);
12524 }
12525
12527 {
12528
12529
12530
12531
12532 GameInventory attachmentInv = attachment.GetInventory();
12534 {
12535 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12536 return false;
12537 }
12538
12539 InventoryLocation loc = new InventoryLocation();
12540 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12541 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12542 return false;
12543
12544 return super.CanReceiveAttachment(attachment, slotId);
12545 }
12546
12548 {
12549 if (!super.CanReleaseAttachment(attachment))
12550 return false;
12551
12552 return GetInventory().AreChildrenAccessible();
12553 }
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12576 {
12577 int id = muzzle_owner.GetMuzzleID();
12578 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12579
12580 if (WPOF_array)
12581 {
12582 for (int i = 0; i < WPOF_array.Count(); i++)
12583 {
12584 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12585
12586 if (WPOF)
12587 {
12588 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12589 }
12590 }
12591 }
12592 }
12593
12594
12596 {
12597 int id = muzzle_owner.GetMuzzleID();
12599
12600 if (WPOBE_array)
12601 {
12602 for (int i = 0; i < WPOBE_array.Count(); i++)
12603 {
12604 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12605
12606 if (WPOBE)
12607 {
12608 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12609 }
12610 }
12611 }
12612 }
12613
12614
12616 {
12617 int id = muzzle_owner.GetMuzzleID();
12618 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12619
12620 if (WPOOH_array)
12621 {
12622 for (int i = 0; i < WPOOH_array.Count(); i++)
12623 {
12624 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12625
12626 if (WPOOH)
12627 {
12628 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12629 }
12630 }
12631 }
12632 }
12633
12634
12636 {
12637 int id = muzzle_owner.GetMuzzleID();
12638 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12639
12640 if (WPOOH_array)
12641 {
12642 for (int i = 0; i < WPOOH_array.Count(); i++)
12643 {
12644 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12645
12646 if (WPOOH)
12647 {
12648 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12649 }
12650 }
12651 }
12652 }
12653
12654
12656 {
12657 int id = muzzle_owner.GetMuzzleID();
12658 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12659
12660 if (WPOOH_array)
12661 {
12662 for (int i = 0; i < WPOOH_array.Count(); i++)
12663 {
12664 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12665
12666 if (WPOOH)
12667 {
12668 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12669 }
12670 }
12671 }
12672 }
12673
12674
12675
12677 {
12679 {
12680 return true;
12681 }
12682
12683 return false;
12684 }
12685
12687 {
12689 {
12690 return true;
12691 }
12692
12693 return false;
12694 }
12695
12697 {
12699 {
12700 return true;
12701 }
12702
12703 return false;
12704 }
12705
12707 {
12708 return false;
12709 }
12710
12713 {
12714 return UATimeSpent.DEFAULT_DEPLOY;
12715 }
12716
12717
12718
12719
12721 {
12723 SetSynchDirty();
12724 }
12725
12727 {
12729 }
12730
12731
12733 {
12734 return false;
12735 }
12736
12739 {
12740 string att_type = "None";
12741
12742 if (ConfigIsExisting("soundAttType"))
12743 {
12744 att_type = ConfigGetString("soundAttType");
12745 }
12746
12748 }
12749
12751 {
12753 }
12754
12755
12756
12757
12758
12762
12764 {
12767
12769 }
12770
12771
12773 {
12775 return;
12776
12778
12781
12784
12785 SoundParameters params = new SoundParameters();
12789 }
12790
12791
12793 {
12795 return;
12796
12798 SetSynchDirty();
12799
12802 }
12803
12804
12806 {
12808 return;
12809
12811 SetSynchDirty();
12812
12815 }
12816
12818 {
12820 }
12821
12823 {
12825 }
12826
12829 {
12830 if (!
GetGame().IsDedicatedServer())
12831 {
12832 if (ConfigIsExisting("attachSoundSet"))
12833 {
12834 string cfg_path = "";
12835 string soundset = "";
12836 string type_name =
GetType();
12837
12840 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12841 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12842
12843 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12844 {
12845 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12846 {
12847 if (cfg_slot_array[i] == slot_type)
12848 {
12849 soundset = cfg_soundset_array[i];
12850 break;
12851 }
12852 }
12853 }
12854
12855 if (soundset != "")
12856 {
12857 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12859 }
12860 }
12861 }
12862 }
12863
12865 {
12866
12867 }
12868
12869 void OnApply(PlayerBase player);
12870
12872 {
12873 return 1.0;
12874 };
12875
12877 {
12879 }
12880
12882 {
12884 }
12885
12887
12889 {
12890 SetDynamicPhysicsLifeTime(0.01);
12892 }
12893
12895 {
12896 array<string> zone_names = new array<string>;
12897 GetDamageZones(zone_names);
12898 for (int i = 0; i < zone_names.Count(); i++)
12899 {
12900 SetHealthMax(zone_names.Get(i),"Health");
12901 }
12902 SetHealthMax("","Health");
12903 }
12904
12907 {
12908 float global_health = GetHealth01("","Health");
12909 array<string> zones = new array<string>;
12910 GetDamageZones(zones);
12911
12912 for (int i = 0; i < zones.Count(); i++)
12913 {
12914 SetHealth01(zones.Get(i),"Health",global_health);
12915 }
12916 }
12917
12920 {
12921 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12922 }
12923
12925 {
12926 if (!hasRootAsPlayer)
12927 {
12928 if (refParentIB)
12929 {
12930
12931 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12932 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12933
12934 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12935 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12936
12939 }
12940 else
12941 {
12942
12945 }
12946 }
12947 }
12948
12950 {
12952 {
12953 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12954 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12955 {
12956 float heatPermCoef = 1.0;
12958 while (ent)
12959 {
12960 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12961 ent = ent.GetHierarchyParent();
12962 }
12963
12964 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12965 }
12966 }
12967 }
12968
12970 {
12971
12972 EntityAI parent = GetHierarchyParent();
12973 if (!parent)
12974 {
12975 hasParent = false;
12976 hasRootAsPlayer = false;
12977 }
12978 else
12979 {
12980 hasParent = true;
12981 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12982 refParentIB =
ItemBase.Cast(parent);
12983 }
12984 }
12985
12986 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12987 {
12988
12989 }
12990
12992 {
12993
12994 return false;
12995 }
12996
12998 {
12999
13000
13001 return false;
13002 }
13003
13005 {
13006
13007 return false;
13008 }
13009
13012 {
13013 return !GetIsFrozen() &&
IsOpen();
13014 }
13015
13017 {
13018 bool hasParent = false, hasRootAsPlayer = false;
13020
13021 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13022 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13023
13024 if (wwtu || foodDecay)
13025 {
13029
13030 if (processWetness || processTemperature || processDecay)
13031 {
13033
13034 if (processWetness)
13035 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13036
13037 if (processTemperature)
13039
13040 if (processDecay)
13041 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13042 }
13043 }
13044 }
13045
13048 {
13050 }
13051
13053 {
13056
13057 return super.GetTemperatureFreezeThreshold();
13058 }
13059
13061 {
13064
13065 return super.GetTemperatureThawThreshold();
13066 }
13067
13069 {
13072
13073 return super.GetItemOverheatThreshold();
13074 }
13075
13077 {
13079 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13080
13081 return super.GetTemperatureFreezeTime();
13082 }
13083
13085 {
13087 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13088
13089 return super.GetTemperatureThawTime();
13090 }
13091
13096
13098 {
13099 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13100 }
13101
13103 {
13104 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13105 }
13106
13109 {
13111 }
13112
13114 {
13116 }
13117
13119 {
13121 }
13122
13125 {
13126 return null;
13127 }
13128
13131 {
13132 return false;
13133 }
13134
13136 {
13138 {
13141 if (!trg)
13142 {
13144 explosive = this;
13145 }
13146
13147 explosive.PairRemote(trg);
13149
13150 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13151 trg.SetPersistentPairID(persistentID);
13152 explosive.SetPersistentPairID(persistentID);
13153
13154 return true;
13155 }
13156 return false;
13157 }
13158
13161 {
13162 float ret = 1.0;
13165 ret *= GetHealth01();
13166
13167 return ret;
13168 }
13169
13170 #ifdef DEVELOPER
13171 override void SetDebugItem()
13172 {
13173 super.SetDebugItem();
13174 _itemBase = this;
13175 }
13176
13178 {
13179 string text = super.GetDebugText();
13180
13182 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13183
13184 return text;
13185 }
13186 #endif
13187
13189 {
13190 return true;
13191 }
13192
13194
13196
13198 {
13201 }
13202
13203
13211
13227}
13228
13230{
13232 if (entity)
13233 {
13234 bool is_item = entity.IsInherited(
ItemBase);
13235 if (is_item && full_quantity)
13236 {
13239 }
13240 }
13241 else
13242 {
13244 return NULL;
13245 }
13246 return entity;
13247}
13248
13250{
13251 if (item)
13252 {
13253 if (health > 0)
13254 item.SetHealth("", "", health);
13255
13256 if (item.CanHaveTemperature())
13257 {
13259 if (item.CanFreeze())
13260 item.SetFrozen(false);
13261 }
13262
13263 if (item.HasEnergyManager())
13264 {
13265 if (quantity >= 0)
13266 {
13267 item.GetCompEM().SetEnergy0To1(quantity);
13268 }
13269 else
13270 {
13272 }
13273 }
13274 else if (item.IsMagazine())
13275 {
13276 Magazine mag = Magazine.Cast(item);
13277 if (quantity >= 0)
13278 {
13279 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13280 }
13281 else
13282 {
13284 }
13285
13286 }
13287 else
13288 {
13289 if (quantity >= 0)
13290 {
13291 item.SetQuantityNormalized(quantity, false);
13292 }
13293 else
13294 {
13296 }
13297
13298 }
13299 }
13300}
13301
13302#ifdef DEVELOPER
13304#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.