8442{
8444 {
8445 return true;
8446 }
8447};
8448
8449
8450
8452{
8456
8458
8461
8462
8463
8464
8465
8474
8480
8485
8490
8511 protected bool m_IsResultOfSplit
8512
8514
8519
8520
8521
8523
8527
8528
8529
8531
8534
8535
8536
8542
8543
8551
8554
8555
8557
8558
8560
8561
8566
8567
8572
8573
8575
8576
8578 {
8583
8584 if (!
GetGame().IsDedicatedServer())
8585 {
8587 {
8589
8591 {
8593 }
8594 }
8595
8598 }
8599
8600 m_OldLocation = null;
8601
8603 {
8605 }
8606
8607 if (ConfigIsExisting("headSelectionsToHide"))
8608 {
8611 }
8612
8614 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8615 {
8617 }
8618
8620
8621 m_IsResultOfSplit = false;
8622
8624 }
8625
8627 {
8628 super.InitItemVariables();
8629
8635 m_Count = ConfigGetInt(
"count");
8636
8639
8644
8647
8652
8664
8668
8669
8672 if (ConfigIsExisting("canBeSplit"))
8673 {
8676 }
8677
8679 if (ConfigIsExisting("itemBehaviour"))
8681
8682
8685 RegisterNetSyncVariableInt("m_VarLiquidType");
8686 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8687
8688 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8689 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8690 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8691
8692 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8693 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8694 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8695 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8696
8697 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8698 RegisterNetSyncVariableBool("m_IsTakeable");
8699 RegisterNetSyncVariableBool("m_IsHologram");
8700
8703 {
8706 }
8707
8709
8711 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8713
8714 }
8715
8717 {
8719 }
8720
8722 {
8725 {
8730 }
8731 }
8732
8733 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8734 {
8736 {
8739 }
8740
8742 }
8743
8745 {
8751 }
8752
8754
8756 {
8758
8759 if (!action)
8760 {
8761 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8762 return;
8763 }
8764
8766 if (!ai)
8767 {
8769 return;
8770 }
8771
8773 if (!action_array)
8774 {
8775 action_array = new array<ActionBase_Basic>;
8777 }
8778 if (LogManager.IsActionLogEnable())
8779 {
8780 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8781 }
8782
8783 if (action_array.Find(action) != -1)
8784 {
8785 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8786 }
8787 else
8788 {
8789 action_array.Insert(action);
8790 }
8791 }
8792
8794 {
8796 ActionBase action = player.GetActionManager().GetAction(actionName);
8799
8800 if (action_array)
8801 {
8802 action_array.RemoveItem(action);
8803 }
8804 }
8805
8806
8807
8809 {
8810 ActionOverrideData overrideData = new ActionOverrideData();
8814
8816 if (!actionMap)
8817 {
8820 }
8821
8822 actionMap.Insert(this.
Type(), overrideData);
8823
8824 }
8825
8827
8829
8830
8832 {
8835
8838
8839 string config_to_search = "CfgVehicles";
8840 string muzzle_owner_config;
8841
8843 {
8844 if (IsInherited(Weapon))
8845 config_to_search = "CfgWeapons";
8846
8847 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8848
8849 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8850
8852
8853 if (config_OnFire_subclass_count > 0)
8854 {
8855 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8856
8857 for (int i = 0; i < config_OnFire_subclass_count; i++)
8858 {
8859 string particle_class = "";
8861 string config_OnFire_entry = config_OnFire_class + particle_class;
8862 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8863 WPOF_array.Insert(WPOF);
8864 }
8865
8866
8868 }
8869 }
8870
8872 {
8873 config_to_search = "CfgWeapons";
8874 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8875
8876 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8877
8879
8880 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8881 {
8882 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8883
8884 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8885 {
8886 string particle_class2 = "";
8888 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8889 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8890 WPOBE_array.Insert(WPOBE);
8891 }
8892
8893
8895 }
8896 }
8897 }
8898
8899
8901 {
8904
8906 {
8907 string config_to_search = "CfgVehicles";
8908
8909 if (IsInherited(Weapon))
8910 config_to_search = "CfgWeapons";
8911
8912 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8913 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8914
8915 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8916 {
8917
8919
8921 {
8923 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8925 return;
8926 }
8927
8930
8931
8932
8934 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8935
8936 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8937 {
8938 string particle_class = "";
8940 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8942
8943 if (entry_type == CT_CLASS)
8944 {
8945 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8946 WPOOH_array.Insert(WPOF);
8947 }
8948 }
8949
8950
8952 }
8953 }
8954 }
8955
8957 {
8959 }
8960
8962 {
8964 {
8966
8969
8972
8973 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8974 }
8975 }
8976
8978 {
8980 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8981
8983 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8984
8986 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
8987
8989 {
8991 }
8992 }
8993
8995 {
8997 }
8998
9000 {
9003 else
9005
9007 {
9010 }
9011 else
9012 {
9015
9018 }
9019
9021 }
9022
9024 {
9026 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9027 }
9028
9030 {
9032 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9034 }
9035
9037 {
9039 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9040 }
9041
9043 {
9046
9047 OverheatingParticle OP = new OverheatingParticle();
9052
9054 }
9055
9057 {
9060
9061 return -1;
9062 }
9063
9065 {
9067 {
9070
9071 for (int i = count; i > 0; --i)
9072 {
9073 int id = i - 1;
9076
9079
9080 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9081 {
9082 if (p)
9083 {
9086 }
9087 }
9088 }
9089 }
9090 }
9091
9093 {
9095 {
9097 {
9098 int id = i - 1;
9100
9101 if (OP)
9102 {
9104
9105 if (p)
9106 {
9108 }
9109
9110 delete OP;
9111 }
9112 }
9113
9116 }
9117 }
9118
9121 {
9122 return 0.0;
9123 }
9124
9125
9127 {
9128 return 250;
9129 }
9130
9132 {
9133 return 0;
9134 }
9135
9138 {
9140 return true;
9141
9142 return false;
9143 }
9144
9147 {
9150
9152 {
9154 }
9155 else
9156 {
9157
9159 }
9160
9162 }
9163
9170 {
9171 return -1;
9172 }
9173
9174
9175
9176
9178 {
9180 {
9182 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9183
9184 if (r_index >= 0)
9185 {
9186 InventoryLocation r_il = new InventoryLocation;
9187 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9188
9189 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9192 {
9193 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9194 }
9196 {
9197 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9198 }
9199
9200 }
9201
9202 player.GetHumanInventory().ClearUserReservedLocation(this);
9203 }
9204
9207 }
9208
9209
9210
9211
9213 {
9214 return ItemBase.m_DebugActionsMask;
9215 }
9216
9218 {
9219 return ItemBase.m_DebugActionsMask & mask;
9220 }
9221
9223 {
9224 ItemBase.m_DebugActionsMask = mask;
9225 }
9226
9228 {
9229 ItemBase.m_DebugActionsMask |= mask;
9230 }
9231
9233 {
9234 ItemBase.m_DebugActionsMask &= ~mask;
9235 }
9236
9238 {
9240 {
9242 }
9243 else
9244 {
9246 }
9247 }
9248
9249
9251 {
9252 if (GetEconomyProfile())
9253 {
9254 float q_max = GetEconomyProfile().GetQuantityMax();
9255 if (q_max > 0)
9256 {
9257 float q_min = GetEconomyProfile().GetQuantityMin();
9258 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9259
9261 {
9262 ComponentEnergyManager comp = GetCompEM();
9264 {
9266 }
9267 }
9269 {
9271
9272 }
9273
9274 }
9275 }
9276 }
9277
9280 {
9281 EntityAI parent = GetHierarchyParent();
9282
9283 if (parent)
9284 {
9285 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9286 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9287 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9288 }
9289 }
9290
9293 {
9294 EntityAI parent = GetHierarchyParent();
9295
9296 if (parent)
9297 {
9298 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9299 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9300 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9301 }
9302 }
9303
9305 {
9306
9307
9308
9309
9311
9313 {
9314 if (ScriptInputUserData.CanStoreInputUserData())
9315 {
9316 ScriptInputUserData ctx = new ScriptInputUserData;
9322 ctx.
Write(use_stack_max);
9325
9327 {
9328 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9329 }
9330 }
9331 }
9332 else if (!
GetGame().IsMultiplayer())
9333 {
9335 }
9336 }
9337
9339 {
9341 }
9342
9344 {
9346 }
9347
9349 {
9351 }
9352
9354 {
9355
9356 return false;
9357 }
9358
9360 {
9361 return false;
9362 }
9363
9367 {
9368 return false;
9369 }
9370
9372 {
9373 return "";
9374 }
9375
9377
9379 {
9380 return false;
9381 }
9382
9384 {
9385 return true;
9386 }
9387
9388
9389
9391 {
9392 return true;
9393 }
9394
9396 {
9397 return true;
9398 }
9399
9401 {
9402 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9404 }
9405
9407 {
9409 }
9410
9412 {
9414 if (!is_being_placed)
9416 SetSynchDirty();
9417 }
9418
9419
9421
9423 {
9425 }
9426
9428 {
9430 }
9431
9433 {
9434 return 1;
9435 }
9436
9438 {
9439 return false;
9440 }
9441
9443 {
9445 SetSynchDirty();
9446 }
9447
9448
9449
9450
9451
9452
9453
9454
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
9483 {
9484 super.OnMovedInsideCargo(container);
9485
9486 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9487 }
9488
9489 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9490 {
9491 super.EEItemLocationChanged(oldLoc,newLoc);
9492
9493 PlayerBase new_player = null;
9494 PlayerBase old_player = null;
9495
9496 if (newLoc.GetParent())
9497 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9498
9499 if (oldLoc.GetParent())
9500 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9501
9503 {
9504 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9505
9506 if (r_index >= 0)
9507 {
9508 InventoryLocation r_il = new InventoryLocation;
9509 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9510
9511 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9514 {
9515 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9516 }
9518 {
9519 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9520 }
9521
9522 }
9523 }
9524
9526 {
9527 if (new_player)
9528 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9529
9530 if (new_player == old_player)
9531 {
9532
9533 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9534 {
9536 {
9537 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9538 {
9539 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9540 }
9541 }
9542 else
9543 {
9544 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9545 }
9546 }
9547
9548 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9549 {
9550 int type = oldLoc.GetType();
9552 {
9553 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9554 }
9556 {
9557 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9558 }
9559 }
9560 if (!m_OldLocation)
9561 {
9562 m_OldLocation = new InventoryLocation;
9563 }
9564 m_OldLocation.Copy(oldLoc);
9565 }
9566 else
9567 {
9568 if (m_OldLocation)
9569 {
9570 m_OldLocation.Reset();
9571 }
9572 }
9573
9575 }
9576 else
9577 {
9578 if (new_player)
9579 {
9580 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9581 if (res_index >= 0)
9582 {
9583 InventoryLocation il = new InventoryLocation;
9584 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9586 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9589 {
9590 il.
GetParent().GetOnReleaseLock().Invoke(it);
9591 }
9593 {
9595 }
9596
9597 }
9598 }
9600 {
9601
9603 }
9604
9605 if (m_OldLocation)
9606 {
9607 m_OldLocation.Reset();
9608 }
9609 }
9610 }
9611
9612 override void EOnContact(IEntity other, Contact extra)
9613 {
9615 {
9616 int liquidType = -1;
9618 if (impactSpeed > 0.0)
9619 {
9621 #ifndef SERVER
9623 #else
9625 SetSynchDirty();
9626 #endif
9628 }
9629 }
9630
9631 #ifdef SERVER
9632 if (GetCompEM() && GetCompEM().IsPlugged())
9633 {
9634 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9635 GetCompEM().UnplugThis();
9636 }
9637 #endif
9638 }
9639
9641
9643 {
9645 }
9646
9648 {
9649
9650 }
9651
9653 {
9654 super.OnItemLocationChanged(old_owner, new_owner);
9655
9656 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9657 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9658
9659 if (!relatedPlayer && playerNew)
9660 relatedPlayer = playerNew;
9661
9662 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9663 {
9665 if (actionMgr)
9666 {
9667 ActionBase currentAction = actionMgr.GetRunningAction();
9668 if (currentAction)
9670 }
9671 }
9672
9673 Man ownerPlayerOld = null;
9674 Man ownerPlayerNew = null;
9675
9676 if (old_owner)
9677 {
9678 if (old_owner.
IsMan())
9679 {
9680 ownerPlayerOld = Man.Cast(old_owner);
9681 }
9682 else
9683 {
9684 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9685 }
9686 }
9687 else
9688 {
9690 {
9692
9693 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9694 {
9695 GetCompEM().UnplugThis();
9696 }
9697 }
9698 }
9699
9700 if (new_owner)
9701 {
9702 if (new_owner.
IsMan())
9703 {
9704 ownerPlayerNew = Man.Cast(new_owner);
9705 }
9706 else
9707 {
9708 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9709 }
9710 }
9711
9712 if (ownerPlayerOld != ownerPlayerNew)
9713 {
9714 if (ownerPlayerOld)
9715 {
9716 array<EntityAI> subItemsExit = new array<EntityAI>;
9718 for (int i = 0; i < subItemsExit.Count(); i++)
9719 {
9722 }
9723 }
9724
9725 if (ownerPlayerNew)
9726 {
9727 array<EntityAI> subItemsEnter = new array<EntityAI>;
9729 for (int j = 0; j < subItemsEnter.Count(); j++)
9730 {
9733 }
9734 }
9735 }
9736 else if (ownerPlayerNew != null)
9737 {
9738 PlayerBase nplayer;
9739 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9740 {
9741 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9743 for (int k = 0; k < subItemsUpdate.Count(); k++)
9744 {
9746 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9747 }
9748 }
9749 }
9750
9751 if (old_owner)
9752 old_owner.OnChildItemRemoved(this);
9753 if (new_owner)
9754 new_owner.OnChildItemReceived(this);
9755 }
9756
9757
9759 {
9760 super.EEDelete(parent);
9761 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9762 if (player)
9763 {
9765
9766 if (player.IsAlive())
9767 {
9768 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9769 if (r_index >= 0)
9770 {
9771 InventoryLocation r_il = new InventoryLocation;
9772 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9773
9774 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9777 {
9778 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9779 }
9781 {
9782 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9783 }
9784
9785 }
9786
9787 player.RemoveQuickBarEntityShortcut(this);
9788 }
9789 }
9790 }
9791
9793 {
9794 super.EEKilled(killer);
9795
9798 {
9799 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9800 {
9801 if (IsMagazine())
9802 {
9803 if (Magazine.Cast(this).GetAmmoCount() > 0)
9804 {
9806 }
9807 }
9808 else
9809 {
9811 }
9812 }
9813 }
9814 }
9815
9817 {
9818 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9819
9820 super.OnWasAttached(parent, slot_id);
9821
9824
9826 }
9827
9829 {
9830 super.OnWasDetached(parent, slot_id);
9831
9834 }
9835
9837 {
9838 int idx;
9841
9842 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9843 if (inventory_slots.Count() < 1)
9844 {
9845 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9846 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9847 }
9848 else
9849 {
9850 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9851 }
9852
9853 idx = inventory_slots.Find(slot);
9854 if (idx < 0)
9855 return "";
9856
9857 return attach_types.Get(idx);
9858 }
9859
9861 {
9862 int idx = -1;
9863 string slot;
9864
9867
9868 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9869 if (inventory_slots.Count() < 1)
9870 {
9871 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9872 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9873 }
9874 else
9875 {
9876 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9877 if (detach_types.Count() < 1)
9878 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9879 }
9880
9881 for (int i = 0; i < inventory_slots.Count(); i++)
9882 {
9883 slot = inventory_slots.Get(i);
9884 }
9885
9886 if (slot != "")
9887 {
9888 if (detach_types.Count() == 1)
9889 idx = 0;
9890 else
9891 idx = inventory_slots.Find(slot);
9892 }
9893 if (idx < 0)
9894 return "";
9895
9896 return detach_types.Get(idx);
9897 }
9898
9900 {
9901
9903
9904
9905 float min_time = 1;
9906 float max_time = 3;
9907 float delay = Math.RandomFloat(min_time, max_time);
9908
9909 explode_timer.Run(delay, this, "DoAmmoExplosion");
9910 }
9911
9913 {
9914 Magazine magazine = Magazine.Cast(this);
9915 int pop_sounds_count = 6;
9916 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9917
9918
9919 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9920 string sound_name = pop_sounds[ sound_idx ];
9922
9923
9924 magazine.ServerAddAmmoCount(-1);
9925
9926
9927 float min_temp_to_explode = 100;
9928
9929 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9930 {
9932 }
9933 }
9934
9935
9936 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9937 {
9938 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9939
9940 const int CHANCE_DAMAGE_CARGO = 4;
9941 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9942 const int CHANCE_DAMAGE_NOTHING = 2;
9943
9945 {
9946 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9947 int chances;
9948 int rnd;
9949
9950 if (GetInventory().GetCargo())
9951 {
9952 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9953 rnd = Math.RandomInt(0,chances);
9954
9955 if (rnd < CHANCE_DAMAGE_CARGO)
9956 {
9958 }
9959 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9960 {
9962 }
9963 }
9964 else
9965 {
9966 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9967 rnd = Math.RandomInt(0,chances);
9968
9969 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9970 {
9972 }
9973 }
9974 }
9975 }
9976
9978 {
9979 if (GetInventory().GetCargo())
9980 {
9981 int item_count = GetInventory().GetCargo().GetItemCount();
9982 if (item_count > 0)
9983 {
9984 int random_pick = Math.RandomInt(0, item_count);
9986 if (!item.IsExplosive())
9987 {
9988 item.AddHealth("","",damage);
9989 return true;
9990 }
9991 }
9992 }
9993 return false;
9994 }
9995
9997 {
9998 int attachment_count = GetInventory().AttachmentCount();
9999 if (attachment_count > 0)
10000 {
10001 int random_pick = Math.RandomInt(0, attachment_count);
10002 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10003 if (!attachment.IsExplosive())
10004 {
10005 attachment.AddHealth("","",damage);
10006 return true;
10007 }
10008 }
10009 return false;
10010 }
10011
10013 {
10015 }
10016
10018 {
10020 return GetInventory().CanRemoveEntity();
10021
10022 return false;
10023 }
10024
10026 {
10027
10029 return false;
10030
10031
10033 return false;
10034
10035
10036
10038 if (delta == 0)
10039 return false;
10040
10041
10042 return true;
10043 }
10044
10046 {
10048 {
10049 if (ScriptInputUserData.CanStoreInputUserData())
10050 {
10051 ScriptInputUserData ctx = new ScriptInputUserData;
10056 ctx.
Write(destination_entity);
10058 ctx.
Write(slot_id);
10060 }
10061 }
10062 else if (!
GetGame().IsMultiplayer())
10063 {
10065 }
10066 }
10067
10069 {
10070 float split_quantity_new;
10074 InventoryLocation loc = new InventoryLocation;
10075
10076 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10077 {
10079 split_quantity_new = stack_max;
10080 else
10082
10084 {
10085 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10086 if (new_item)
10087 {
10088 new_item.SetResultOfSplit(true);
10089 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10091 new_item.
SetQuantity(split_quantity_new,
false,
true);
10092 }
10093 }
10094 }
10095 else if (destination_entity && slot_id == -1)
10096 {
10097 if (quantity > stack_max)
10098 split_quantity_new = stack_max;
10099 else
10100 split_quantity_new = quantity;
10101
10103 {
10105 {
10108 }
10109
10110 if (new_item)
10111 {
10112 new_item.SetResultOfSplit(true);
10113 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10115 new_item.
SetQuantity(split_quantity_new,
false,
true);
10116 }
10117 }
10118 }
10119 else
10120 {
10121 if (stack_max != 0)
10122 {
10124 {
10126 }
10127
10128 if (split_quantity_new == 0)
10129 {
10130 if (!
GetGame().IsMultiplayer())
10131 player.PhysicalPredictiveDropItem(this);
10132 else
10133 player.ServerDropEntity(this);
10134 return;
10135 }
10136
10138 {
10140
10141 if (new_item)
10142 {
10143 new_item.SetResultOfSplit(true);
10144 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10147 new_item.PlaceOnSurface();
10148 }
10149 }
10150 }
10151 }
10152 }
10153
10155 {
10156 float split_quantity_new;
10160 InventoryLocation loc = new InventoryLocation;
10161
10162 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10163 {
10165 split_quantity_new = stack_max;
10166 else
10168
10170 {
10171 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10172 if (new_item)
10173 {
10174 new_item.SetResultOfSplit(true);
10175 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10177 new_item.
SetQuantity(split_quantity_new,
false,
true);
10178 }
10179 }
10180 }
10181 else if (destination_entity && slot_id == -1)
10182 {
10183 if (quantity > stack_max)
10184 split_quantity_new = stack_max;
10185 else
10186 split_quantity_new = quantity;
10187
10189 {
10191 {
10194 }
10195
10196 if (new_item)
10197 {
10198 new_item.SetResultOfSplit(true);
10199 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10201 new_item.
SetQuantity(split_quantity_new,
false,
true);
10202 }
10203 }
10204 }
10205 else
10206 {
10207 if (stack_max != 0)
10208 {
10210 {
10212 }
10213
10215 {
10217
10218 if (new_item)
10219 {
10220 new_item.SetResultOfSplit(true);
10221 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10224 new_item.PlaceOnSurface();
10225 }
10226 }
10227 }
10228 }
10229 }
10230
10232 {
10234 {
10235 if (ScriptInputUserData.CanStoreInputUserData())
10236 {
10237 ScriptInputUserData ctx = new ScriptInputUserData;
10242 dst.WriteToContext(ctx);
10244 }
10245 }
10246 else if (!
GetGame().IsMultiplayer())
10247 {
10249 }
10250 }
10251
10253 {
10255 {
10256 if (ScriptInputUserData.CanStoreInputUserData())
10257 {
10258 ScriptInputUserData ctx = new ScriptInputUserData;
10263 ctx.
Write(destination_entity);
10269 }
10270 }
10271 else if (!
GetGame().IsMultiplayer())
10272 {
10274 }
10275 }
10276
10278 {
10280 }
10281
10283 {
10285 float split_quantity_new;
10287 if (dst.IsValid())
10288 {
10289 int slot_id = dst.GetSlot();
10291
10292 if (quantity > stack_max)
10293 split_quantity_new = stack_max;
10294 else
10295 split_quantity_new = quantity;
10296
10298 {
10300
10301 if (new_item)
10302 {
10303 new_item.SetResultOfSplit(true);
10304 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10306 new_item.
SetQuantity(split_quantity_new,
false,
true);
10307 }
10308
10309 return new_item;
10310 }
10311 }
10312
10313 return null;
10314 }
10315
10317 {
10319 float split_quantity_new;
10321 if (destination_entity)
10322 {
10324 if (quantity > stackable)
10325 split_quantity_new = stackable;
10326 else
10327 split_quantity_new = quantity;
10328
10330 {
10331 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10332 if (new_item)
10333 {
10334 new_item.SetResultOfSplit(true);
10335 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10337 new_item.
SetQuantity(split_quantity_new,
false,
true);
10338 }
10339 }
10340 }
10341 }
10342
10344 {
10346 {
10347 if (ScriptInputUserData.CanStoreInputUserData())
10348 {
10349 ScriptInputUserData ctx = new ScriptInputUserData;
10354 ItemBase destination_entity =
this;
10355 ctx.
Write(destination_entity);
10359 }
10360 }
10361 else if (!
GetGame().IsMultiplayer())
10362 {
10364 }
10365 }
10366
10368 {
10370 float split_quantity_new;
10372 if (player)
10373 {
10375 if (quantity > stackable)
10376 split_quantity_new = stackable;
10377 else
10378 split_quantity_new = quantity;
10379
10381 {
10382 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10383 new_item =
ItemBase.Cast(in_hands);
10384 if (new_item)
10385 {
10386 new_item.SetResultOfSplit(true);
10387 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10389 new_item.SetQuantity(split_quantity_new, false, true);
10390 }
10391 }
10392 }
10393 }
10394
10396 {
10398 float split_quantity_new = Math.Floor(quantity * 0.5);
10399
10401 return;
10402
10404
10405 if (new_item)
10406 {
10407 if (new_item.GetQuantityMax() < split_quantity_new)
10408 {
10409 split_quantity_new = new_item.GetQuantityMax();
10410 }
10411
10412 new_item.SetResultOfSplit(true);
10413 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10414
10416 {
10419 }
10420 else
10421 {
10423 new_item.
SetQuantity(split_quantity_new,
false,
true);
10424 }
10425 }
10426 }
10427
10429 {
10431 float split_quantity_new = Math.Floor(quantity / 2);
10432
10434 return;
10435
10436 InventoryLocation invloc = new InventoryLocation;
10438
10440 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10441
10442 if (new_item)
10443 {
10444 if (new_item.GetQuantityMax() < split_quantity_new)
10445 {
10446 split_quantity_new = new_item.GetQuantityMax();
10447 }
10449 {
10452 }
10453 else if (split_quantity_new > 1)
10454 {
10456 new_item.
SetQuantity(split_quantity_new,
false,
true);
10457 }
10458 }
10459 }
10460
10463 {
10464 SetWeightDirty();
10466
10467 if (parent)
10468 parent.OnAttachmentQuantityChangedEx(this, delta);
10469
10471 {
10473 {
10475 }
10477 {
10478 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10480 }
10481 }
10482
10483 }
10484
10487 {
10488
10489 }
10490
10493 {
10495 }
10496
10498 {
10499 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10500
10502 {
10503 if (newLevel == GameConstants.STATE_RUINED)
10504 {
10506 EntityAI parent = GetHierarchyParent();
10507 if (parent && parent.IsFireplace())
10508 {
10509 CargoBase cargo = GetInventory().GetCargo();
10510 if (cargo)
10511 {
10513 {
10515 }
10516 }
10517 }
10518 }
10519
10521 {
10522
10524 return;
10525 }
10526
10527 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10528 {
10530 }
10531 }
10532 }
10533
10534
10536 {
10537 super.OnRightClick();
10538
10540 {
10542 {
10543 if (ScriptInputUserData.CanStoreInputUserData())
10544 {
10545 EntityAI root = GetHierarchyRoot();
10546 Man playerOwner = GetHierarchyRootPlayer();
10547 InventoryLocation dst = new InventoryLocation;
10548
10549
10550 if (!playerOwner && root && root == this)
10551 {
10553 }
10554 else
10555 {
10556
10557 GetInventory().GetCurrentInventoryLocation(dst);
10559 {
10562 {
10564 }
10565 else
10566 {
10568
10569
10570 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10571 {
10573 }
10574 else
10575 {
10576 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10577 }
10578 }
10579 }
10580 }
10581
10582 ScriptInputUserData ctx = new ScriptInputUserData;
10590 }
10591 }
10592 else if (!
GetGame().IsMultiplayer())
10593 {
10595 }
10596 }
10597 }
10598
10600 {
10601 if (root)
10602 {
10603 vector m4[4];
10604 root.GetTransform(m4);
10605 dst.SetGround(this, m4);
10606 }
10607 else
10608 {
10609 GetInventory().GetCurrentInventoryLocation(dst);
10610 }
10611 }
10612
10613 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10614 {
10615
10616 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10617 return false;
10618
10619 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10620 return false;
10621
10622
10624 return false;
10625
10626
10627 Magazine mag = Magazine.Cast(this);
10628 if (mag)
10629 {
10630 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10631 return false;
10632
10633 if (stack_max_limit)
10634 {
10635 Magazine other_mag = Magazine.Cast(other_item);
10636 if (other_item)
10637 {
10638 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10639 return false;
10640 }
10641
10642 }
10643 }
10644 else
10645 {
10646
10648 return false;
10649
10651 return false;
10652 }
10653
10654 PlayerBase player = null;
10655 if (CastTo(player, GetHierarchyRootPlayer()))
10656 {
10657 if (player.GetInventory().HasAttachment(this))
10658 return false;
10659
10660 if (player.IsItemsToDelete())
10661 return false;
10662 }
10663
10664 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10665 return false;
10666
10667 int slotID;
10669 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10670 return false;
10671
10672 return true;
10673 }
10674
10676 {
10678 }
10679
10681 {
10682 return m_IsResultOfSplit;
10683 }
10684
10686 {
10687 m_IsResultOfSplit = value;
10688 }
10689
10691 {
10693 }
10694
10696 {
10697 float other_item_quantity = other_item.GetQuantity();
10698 float this_free_space;
10699
10701
10703
10704 if (other_item_quantity > this_free_space)
10705 {
10706 return this_free_space;
10707 }
10708 else
10709 {
10710 return other_item_quantity;
10711 }
10712 }
10713
10715 {
10717 }
10718
10720 {
10722 return;
10723
10724 if (!IsMagazine() && other_item)
10725 {
10727 if (quantity_used != 0)
10728 {
10729 float hp1 = GetHealth01("","");
10730 float hp2 = other_item.GetHealth01("","");
10731 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10732 hpResult = hpResult / (
GetQuantity() + quantity_used);
10733
10734 hpResult *= GetMaxHealth();
10735 Math.Round(hpResult);
10736 SetHealth("", "Health", hpResult);
10737
10739 other_item.AddQuantity(-quantity_used);
10740 }
10741 }
10743 }
10744
10746 {
10747 #ifdef SERVER
10748 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10749 GetHierarchyParent().IncreaseLifetimeUp();
10750 #endif
10751 };
10752
10754 {
10755 PlayerBase p = PlayerBase.Cast(player);
10756
10757 array<int> recipesIds = p.m_Recipes;
10758 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10759 if (moduleRecipesManager)
10760 {
10761 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10762 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10763 }
10764
10765 for (int i = 0;i < recipesIds.Count(); i++)
10766 {
10767 int key = recipesIds.Get(i);
10768 string recipeName = moduleRecipesManager.GetRecipeName(key);
10770 }
10771 }
10772
10773
10774 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10775 {
10776 super.GetDebugActions(outputList);
10777
10778
10784
10785
10790
10795
10796
10800
10801
10803 {
10807 }
10808
10811
10812
10816
10818
10819 InventoryLocation loc = new InventoryLocation();
10820 GetInventory().GetCurrentInventoryLocation(loc);
10822 {
10823 if (Gizmo_IsSupported())
10826 }
10827
10829 }
10830
10831
10832
10833
10835 {
10836 super.OnAction(action_id, player, ctx);
10837
10839 {
10840 switch (action_id)
10841 {
10844 return true;
10847 return true;
10848 }
10849 }
10850
10852 {
10853 switch (action_id)
10854 {
10856 Delete();
10857 return true;
10858 }
10859 }
10860
10861 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10862 {
10863 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10864 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10865 PlayerBase p = PlayerBase.Cast(player);
10866 if (
EActions.RECIPES_RANGE_START < 1000)
10867 {
10868 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10869 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10870 }
10871 }
10872 #ifndef SERVER
10873 else if (action_id ==
EActions.WATCH_PLAYER)
10874 {
10875 PluginDeveloper.SetDeveloperItemClientEx(player);
10876 }
10877 #endif
10879 {
10880 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10881 {
10882 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10883 OnDebugButtonPressServer(id + 1);
10884 }
10885
10886 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10887 {
10888 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10890 }
10891
10892 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10893 {
10894 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10896 }
10897
10898 else if (action_id ==
EActions.ADD_QUANTITY)
10899 {
10900 if (IsMagazine())
10901 {
10902 Magazine mag = Magazine.Cast(this);
10903 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10904 }
10905 else
10906 {
10908 }
10909
10910 if (m_EM)
10911 {
10912 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10913 }
10914
10915 }
10916
10917 else if (action_id ==
EActions.REMOVE_QUANTITY)
10918 {
10919 if (IsMagazine())
10920 {
10921 Magazine mag2 = Magazine.Cast(this);
10922 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10923 }
10924 else
10925 {
10927 }
10928 if (m_EM)
10929 {
10930 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10931 }
10932
10933 }
10934
10935 else if (action_id ==
EActions.SET_QUANTITY_0)
10936 {
10938
10939 if (m_EM)
10940 {
10941 m_EM.SetEnergy(0);
10942 }
10943 }
10944
10945 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10946 {
10948
10949 if (m_EM)
10950 {
10951 m_EM.SetEnergy(m_EM.GetEnergyMax());
10952 }
10953 }
10954
10955 else if (action_id ==
EActions.ADD_HEALTH)
10956 {
10957 AddHealth("","",GetMaxHealth("","Health")/5);
10958 }
10959 else if (action_id ==
EActions.REMOVE_HEALTH)
10960 {
10961 AddHealth("","",-GetMaxHealth("","Health")/5);
10962 }
10963 else if (action_id ==
EActions.DESTROY_HEALTH)
10964 {
10965 SetHealth01("","",0);
10966 }
10967 else if (action_id ==
EActions.WATCH_ITEM)
10968 {
10970 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10971 #ifdef DEVELOPER
10972 SetDebugDeveloper_item(this);
10973 #endif
10974 }
10975
10976 else if (action_id ==
EActions.ADD_TEMPERATURE)
10977 {
10978 AddTemperature(20);
10979
10980 }
10981
10982 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10983 {
10984 AddTemperature(-20);
10985
10986 }
10987
10988 else if (action_id ==
EActions.FLIP_FROZEN)
10989 {
10990 SetFrozen(!GetIsFrozen());
10991
10992 }
10993
10994 else if (action_id ==
EActions.ADD_WETNESS)
10995 {
10997
10998 }
10999
11000 else if (action_id ==
EActions.REMOVE_WETNESS)
11001 {
11003
11004 }
11005
11006 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11007 {
11010
11011
11012 }
11013
11014 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11015 {
11018 }
11019
11020 else if (action_id ==
EActions.MAKE_SPECIAL)
11021 {
11022 auto debugParams = DebugSpawnParams.WithPlayer(player);
11023 OnDebugSpawnEx(debugParams);
11024 }
11025
11026 }
11027
11028
11029 return false;
11030 }
11031
11032
11033
11034
11038
11041
11042
11043
11045 {
11046 return false;
11047 }
11048
11049
11051 {
11052 return true;
11053 }
11054
11055
11057 {
11058 return true;
11059 }
11060
11061
11062
11064 {
11065 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11067 }
11068
11071 {
11072 return null;
11073 }
11074
11076 {
11077 return false;
11078 }
11079
11081 {
11082 return false;
11083 }
11084
11088
11089
11091 {
11092 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11093 return module_repairing.CanRepair(this, item_repair_kit);
11094 }
11095
11096
11097 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11098 {
11099 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11100 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11101 }
11102
11103
11105 {
11106
11107
11108
11109
11110
11111
11112
11113
11114 return 1;
11115 }
11116
11117
11118
11120 {
11122 }
11123
11124
11125
11127 {
11129 }
11130
11131
11140 {
11141 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11142
11143 if (player)
11144 {
11145 player.MessageStatus(text);
11146 }
11147 }
11148
11149
11158 {
11159 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11160
11161 if (player)
11162 {
11163 player.MessageAction(text);
11164 }
11165 }
11166
11167
11176 {
11177 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11178
11179 if (player)
11180 {
11181 player.MessageFriendly(text);
11182 }
11183 }
11184
11185
11194 {
11195 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11196
11197 if (player)
11198 {
11199 player.MessageImportant(text);
11200 }
11201 }
11202
11204 {
11205 return true;
11206 }
11207
11208
11209 override bool KindOf(
string tag)
11210 {
11211 bool found = false;
11212 string item_name = this.
GetType();
11215
11216 int array_size = item_tag_array.Count();
11217 for (int i = 0; i < array_size; i++)
11218 {
11219 if (item_tag_array.Get(i) == tag)
11220 {
11221 found = true;
11222 break;
11223 }
11224 }
11225 return found;
11226 }
11227
11228
11230 {
11231
11232 super.OnRPC(sender, rpc_type,ctx);
11233
11234
11235 switch (rpc_type)
11236 {
11237 #ifndef SERVER
11238 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11239 Param2<bool, string> p = new Param2<bool, string>(false, "");
11240
11242 return;
11243
11244 bool play = p.param1;
11245 string soundSet = p.param2;
11246
11247 if (play)
11248 {
11250 {
11252 {
11254 }
11255 }
11256 else
11257 {
11259 }
11260 }
11261 else
11262 {
11264 }
11265
11266 break;
11267 #endif
11268
11269 }
11270
11272 {
11274 }
11275 }
11276
11277
11278
11279
11281 {
11282 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11283 return plugin.GetID(
name);
11284 }
11285
11287 {
11288 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11289 return plugin.GetName(id);
11290 }
11291
11294 {
11295
11296
11297 int varFlags;
11298 if (!ctx.
Read(varFlags))
11299 return;
11300
11301 if (varFlags & ItemVariableFlags.FLOAT)
11302 {
11304 }
11305 }
11306
11308 {
11309
11310 super.SerializeNumericalVars(floats_out);
11311
11312
11313
11315 {
11317 }
11318
11320 {
11322 }
11323
11325 {
11327 }
11328
11330 {
11335 }
11336
11338 {
11340 }
11341 }
11342
11344 {
11345
11346 super.DeSerializeNumericalVars(floats);
11347
11348
11349 int index = 0;
11350 int mask = Math.Round(floats.Get(index));
11351
11352 index++;
11353
11355 {
11357 {
11359 }
11360 else
11361 {
11362 float quantity = floats.Get(index);
11363 SetQuantity(quantity,
true,
false,
false,
false);
11364 }
11365 index++;
11366 }
11367
11369 {
11370 float wet = floats.Get(index);
11372 index++;
11373 }
11374
11376 {
11377 int liquidtype = Math.Round(floats.Get(index));
11379 index++;
11380 }
11381
11383 {
11385 index++;
11387 index++;
11389 index++;
11391 index++;
11392 }
11393
11395 {
11396 int cleanness = Math.Round(floats.Get(index));
11398 index++;
11399 }
11400 }
11401
11403 {
11404 super.WriteVarsToCTX(ctx);
11405
11406
11408 {
11410 }
11411
11413 {
11415 }
11416
11418 {
11420 }
11421
11423 {
11424 int r,g,b,a;
11430 }
11431
11433 {
11435 }
11436 }
11437
11439 {
11440 if (!super.ReadVarsFromCTX(ctx,version))
11441 return false;
11442
11443 int intValue;
11444 float value;
11445
11446 if (version < 140)
11447 {
11448 if (!ctx.
Read(intValue))
11449 return false;
11450
11451 m_VariablesMask = intValue;
11452 }
11453
11455 {
11456 if (!ctx.
Read(value))
11457 return false;
11458
11460 {
11462 }
11463 else
11464 {
11466 }
11467 }
11468
11469 if (version < 140)
11470 {
11472 {
11473 if (!ctx.
Read(value))
11474 return false;
11475 SetTemperatureDirect(value);
11476 }
11477 }
11478
11480 {
11481 if (!ctx.
Read(value))
11482 return false;
11484 }
11485
11487 {
11488 if (!ctx.
Read(intValue))
11489 return false;
11491 }
11492
11494 {
11495 int r,g,b,a;
11497 return false;
11499 return false;
11501 return false;
11503 return false;
11504
11506 }
11507
11509 {
11510 if (!ctx.
Read(intValue))
11511 return false;
11513 }
11514
11515 if (version >= 138 && version < 140)
11516 {
11518 {
11519 if (!ctx.
Read(intValue))
11520 return false;
11521 SetFrozen(intValue);
11522 }
11523 }
11524
11525 return true;
11526 }
11527
11528
11530 {
11533 {
11535 }
11536
11537 if (!super.OnStoreLoad(ctx, version))
11538 {
11540 return false;
11541 }
11542
11543 if (version >= 114)
11544 {
11545 bool hasQuickBarIndexSaved;
11546
11547 if (!ctx.
Read(hasQuickBarIndexSaved))
11548 {
11550 return false;
11551 }
11552
11553 if (hasQuickBarIndexSaved)
11554 {
11555 int itmQBIndex;
11556
11557
11558 if (!ctx.
Read(itmQBIndex))
11559 {
11561 return false;
11562 }
11563
11564 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11565 if (itmQBIndex != -1 && parentPlayer)
11566 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11567 }
11568 }
11569 else
11570 {
11571
11572 PlayerBase player;
11573 int itemQBIndex;
11574 if (version ==
int.
MAX)
11575 {
11576 if (!ctx.
Read(itemQBIndex))
11577 {
11579 return false;
11580 }
11581 }
11582 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11583 {
11584
11585 if (!ctx.
Read(itemQBIndex))
11586 {
11588 return false;
11589 }
11590 if (itemQBIndex != -1 && player)
11591 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11592 }
11593 }
11594
11595 if (version < 140)
11596 {
11597
11598 if (!LoadVariables(ctx, version))
11599 {
11601 return false;
11602 }
11603 }
11604
11605
11607 {
11609 return false;
11610 }
11611 if (version >= 132)
11612 {
11614 if (raib)
11615 {
11617 {
11619 return false;
11620 }
11621 }
11622 }
11623
11625 return true;
11626 }
11627
11628
11629
11631 {
11632 super.OnStoreSave(ctx);
11633
11634 PlayerBase player;
11635 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11636 {
11638
11639 int itemQBIndex = -1;
11640 itemQBIndex = player.FindQuickBarEntityIndex(this);
11641 ctx.
Write(itemQBIndex);
11642 }
11643 else
11644 {
11646 }
11647
11649
11651 if (raib)
11652 {
11654 }
11655 }
11656
11657
11659 {
11660 super.AfterStoreLoad();
11661
11663 {
11665 }
11666
11668 {
11671 }
11672 }
11673
11675 {
11676 super.EEOnAfterLoad();
11677
11679 {
11681 }
11682
11685 }
11686
11688 {
11689 return false;
11690 }
11691
11692
11693
11695 {
11697 {
11698 #ifdef PLATFORM_CONSOLE
11699
11701 {
11703 if (menu)
11704 {
11706 }
11707 }
11708 #endif
11709 }
11710
11712 {
11715 }
11716
11718 {
11719 SetWeightDirty();
11721 }
11723 {
11726 }
11727
11729 {
11732 }
11734 {
11737 }
11738
11739 super.OnVariablesSynchronized();
11740 }
11741
11742
11743
11745 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11746 {
11747 if (!IsServerCheck(allow_client))
11748 return false;
11749
11751 return false;
11752
11755
11756 if (value <= (min + 0.001))
11757 value = min;
11758
11759 if (value == min)
11760 {
11761 if (destroy_config)
11762 {
11763 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11764 if (dstr)
11765 {
11767 this.Delete();
11768 return true;
11769 }
11770 }
11771 else if (destroy_forced)
11772 {
11774 this.Delete();
11775 return true;
11776 }
11777
11779 }
11780
11783
11785 {
11787
11788 if (delta)
11790 }
11791
11793
11794 return false;
11795 }
11796
11797
11799 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11800 {
11802 }
11803
11805 {
11808 }
11809
11811 {
11814 }
11815
11817 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11818 {
11819 float value_clamped = Math.Clamp(value, 0, 1);
11821 SetQuantity(result, destroy_config, destroy_forced);
11822 }
11823
11824
11827 {
11829 }
11830
11832 {
11834 }
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11846 {
11847 int slot = -1;
11848 if (GetInventory())
11849 {
11850 InventoryLocation il = new InventoryLocation;
11851 GetInventory().GetCurrentInventoryLocation(il);
11853 }
11854
11856 }
11857
11859 {
11860 float quantity_max = 0;
11861
11863 {
11864 if (attSlotID != -1)
11865 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11866
11867 if (quantity_max <= 0)
11869 }
11870
11871 if (quantity_max <= 0)
11873
11874 return quantity_max;
11875 }
11876
11878 {
11880 }
11881
11883 {
11885 }
11886
11887
11889 {
11891 }
11892
11894 {
11896 }
11897
11899 {
11901 }
11902
11903
11905 {
11906
11907 float weightEx = GetWeightEx();
11908 float special = GetInventoryAndCargoWeight();
11909 return weightEx - special;
11910 }
11911
11912
11914 {
11916 }
11917
11919 {
11921 {
11922 #ifdef DEVELOPER
11923 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11924 {
11925 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11927 }
11928 #endif
11929
11930 return GetQuantity() * GetConfigWeightModified();
11931 }
11932 else if (HasEnergyManager())
11933 {
11934 #ifdef DEVELOPER
11935 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11936 {
11937 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11938 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11939 }
11940 #endif
11941 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11942 }
11943 else
11944 {
11945 #ifdef DEVELOPER
11946 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11947 {
11948 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11949 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11950 }
11951 #endif
11952 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11953 }
11954 }
11955
11958 {
11959 int item_count = 0;
11961
11962 if (GetInventory().GetCargo() != NULL)
11963 {
11964 item_count = GetInventory().GetCargo().GetItemCount();
11965 }
11966
11967 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11968 {
11969 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11970 if (item)
11971 item_count += item.GetNumberOfItems();
11972 }
11973 return item_count;
11974 }
11975
11978 {
11979 float weight = 0;
11980 float wetness = 1;
11981 if (include_wetness)
11984 {
11985 weight = wetness * m_ConfigWeight;
11986 }
11988 {
11989 weight = 1;
11990 }
11991 return weight;
11992 }
11993
11994
11995
11997 {
11998 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11999 {
12000 GameInventory inv = GetInventory();
12001 array<EntityAI> items = new array<EntityAI>;
12003 for (int i = 0; i < items.Count(); i++)
12004 {
12006 if (item)
12007 {
12009 }
12010 }
12011 }
12012 }
12013
12014
12015
12016
12018 {
12019 float energy = 0;
12020 if (HasEnergyManager())
12021 {
12022 energy = GetCompEM().GetEnergy();
12023 }
12024 return energy;
12025 }
12026
12027
12029 {
12030 super.OnEnergyConsumed();
12031
12033 }
12034
12036 {
12037 super.OnEnergyAdded();
12038
12040 }
12041
12042
12044 {
12045 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12046 {
12048 {
12049 float energy_0to1 = GetCompEM().GetEnergy0To1();
12051 }
12052 }
12053 }
12054
12055
12057 {
12058 return ConfigGetFloat("heatIsolation");
12059 }
12060
12062 {
12064 }
12065
12067 {
12068 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12069 if (
GetGame().ConfigIsExisting(paramPath))
12071
12072 return 0.0;
12073 }
12074
12076 {
12077 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12078 if (
GetGame().ConfigIsExisting(paramPath))
12080
12081 return 0.0;
12082 }
12083
12084 override void SetWet(
float value,
bool allow_client =
false)
12085 {
12086 if (!IsServerCheck(allow_client))
12087 return;
12088
12091
12093
12094 m_VarWet = Math.Clamp(value, min, max);
12095
12097 {
12100 }
12101 }
12102
12103 override void AddWet(
float value)
12104 {
12106 }
12107
12109 {
12111 }
12112
12114 {
12116 }
12117
12119 {
12121 }
12122
12124 {
12126 }
12127
12129 {
12131 }
12132
12133 override void OnWetChanged(
float newVal,
float oldVal)
12134 {
12137 if (newLevel != oldLevel)
12138 {
12140 }
12141 }
12142
12144 {
12145 SetWeightDirty();
12146 }
12147
12149 {
12150 return GetWetLevelInternal(
m_VarWet);
12151 }
12152
12153
12154
12156 {
12158 }
12159
12161 {
12163 }
12164
12166 {
12168 }
12169
12171 {
12173 }
12174
12175
12176
12178 {
12179 if (ConfigIsExisting("itemModelLength"))
12180 {
12181 return ConfigGetFloat("itemModelLength");
12182 }
12183 return 0;
12184 }
12185
12187 {
12188 if (ConfigIsExisting("itemAttachOffset"))
12189 {
12190 return ConfigGetFloat("itemAttachOffset");
12191 }
12192 return 0;
12193 }
12194
12195 override void SetCleanness(
int value,
bool allow_client =
false)
12196 {
12197 if (!IsServerCheck(allow_client))
12198 return;
12199
12201
12203
12206 }
12207
12209 {
12211 }
12212
12214 {
12215 return true;
12216 }
12217
12218
12219
12220
12222 {
12224 }
12225
12227 {
12229 }
12230
12231
12232
12233
12234 override void SetColor(
int r,
int g,
int b,
int a)
12235 {
12241 }
12243 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12244 {
12249 }
12250
12252 {
12254 }
12255
12258 {
12259 int r,g,b,a;
12261 r = r/255;
12262 g = g/255;
12263 b = b/255;
12264 a = a/255;
12265 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12266 }
12267
12268
12269
12270 override void SetLiquidType(
int value,
bool allow_client =
false)
12271 {
12272 if (!IsServerCheck(allow_client))
12273 return;
12274
12279 }
12280
12282 {
12283 return ConfigGetInt("varLiquidTypeInit");
12284 }
12285
12287 {
12289 }
12290
12292 {
12294 SetFrozen(false);
12295 }
12296
12299 {
12300 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12301 }
12302
12303
12306 {
12307 PlayerBase nplayer;
12308 if (PlayerBase.CastTo(nplayer, player))
12309 {
12311
12312 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12313 }
12314 }
12315
12316
12319 {
12320 PlayerBase nplayer;
12321 if (PlayerBase.CastTo(nplayer,player))
12322 {
12323
12324 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12325
12326 }
12327
12328
12329 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12330
12331
12332 if (HasEnergyManager())
12333 {
12334 GetCompEM().UpdatePlugState();
12335 }
12336 }
12337
12338
12340 {
12341 super.OnPlacementStarted(player);
12342
12344 }
12345
12346 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12347 {
12349 {
12350 m_AdminLog.OnPlacementComplete(player,
this);
12351 }
12352
12353 super.OnPlacementComplete(player, position, orientation);
12354 }
12355
12356
12357
12358
12359
12361 {
12363 {
12364 return true;
12365 }
12366 else
12367 {
12368 return false;
12369 }
12370 }
12371
12372
12374 {
12376 {
12378 }
12379 }
12380
12381
12383 {
12385 }
12386
12388 {
12390 }
12391
12392 override void InsertAgent(
int agent,
float count = 1)
12393 {
12394 if (count < 1)
12395 return;
12396
12398 }
12399
12402 {
12404 }
12405
12406
12408 {
12410 }
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12454 {
12456 return false;
12457 return true;
12458 }
12459
12461 {
12462
12464 }
12465
12466
12469 {
12470 super.CheckForRoofLimited(timeTresholdMS);
12471
12473 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12474 {
12475 m_PreviousRoofTestTime = time;
12476 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12477 }
12478 }
12479
12480
12482 {
12484 {
12485 return 0;
12486 }
12487
12488 if (GetInventory().GetAttachmentSlotsCount() != 0)
12489 {
12490 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12491 if (filter)
12492 return filter.GetProtectionLevel(type, false, system);
12493 else
12494 return 0;
12495 }
12496
12497 string subclassPath, entryName;
12498
12499 switch (type)
12500 {
12502 entryName = "biological";
12503 break;
12505 entryName = "chemical";
12506 break;
12507 default:
12508 entryName = "biological";
12509 break;
12510 }
12511
12512 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12513
12515 }
12516
12517
12518
12521 {
12522 if (!IsMagazine())
12524
12526 }
12527
12528
12529
12530
12531
12536 {
12537 return true;
12538 }
12539
12541 {
12543 }
12544
12545
12546
12547
12548
12550 {
12551 if (parent)
12552 {
12553 if (parent.IsInherited(DayZInfected))
12554 return true;
12555
12556 if (!parent.IsRuined())
12557 return true;
12558 }
12559
12560 return true;
12561 }
12562
12564 {
12565 if (!super.CanPutAsAttachment(parent))
12566 {
12567 return false;
12568 }
12569
12570 if (!IsRuined() && !parent.IsRuined())
12571 {
12572 return true;
12573 }
12574
12575 return false;
12576 }
12577
12579 {
12580
12581
12582
12583
12584 return super.CanReceiveItemIntoCargo(item);
12585 }
12586
12588 {
12589
12590
12591
12592
12593 GameInventory attachmentInv = attachment.GetInventory();
12595 {
12596 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12597 return false;
12598 }
12599
12600 InventoryLocation loc = new InventoryLocation();
12601 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12602 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12603 return false;
12604
12605 return super.CanReceiveAttachment(attachment, slotId);
12606 }
12607
12609 {
12610 if (!super.CanReleaseAttachment(attachment))
12611 return false;
12612
12613 return GetInventory().AreChildrenAccessible();
12614 }
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12637 {
12638 int id = muzzle_owner.GetMuzzleID();
12639 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12640
12641 if (WPOF_array)
12642 {
12643 for (int i = 0; i < WPOF_array.Count(); i++)
12644 {
12645 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12646
12647 if (WPOF)
12648 {
12649 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12650 }
12651 }
12652 }
12653 }
12654
12655
12657 {
12658 int id = muzzle_owner.GetMuzzleID();
12660
12661 if (WPOBE_array)
12662 {
12663 for (int i = 0; i < WPOBE_array.Count(); i++)
12664 {
12665 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12666
12667 if (WPOBE)
12668 {
12669 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12670 }
12671 }
12672 }
12673 }
12674
12675
12677 {
12678 int id = muzzle_owner.GetMuzzleID();
12679 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12680
12681 if (WPOOH_array)
12682 {
12683 for (int i = 0; i < WPOOH_array.Count(); i++)
12684 {
12685 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12686
12687 if (WPOOH)
12688 {
12689 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12690 }
12691 }
12692 }
12693 }
12694
12695
12697 {
12698 int id = muzzle_owner.GetMuzzleID();
12699 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12700
12701 if (WPOOH_array)
12702 {
12703 for (int i = 0; i < WPOOH_array.Count(); i++)
12704 {
12705 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12706
12707 if (WPOOH)
12708 {
12709 WPOOH.OnUpdate(weapon, 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.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12730 }
12731 }
12732 }
12733 }
12734
12735
12736
12738 {
12740 {
12741 return true;
12742 }
12743
12744 return false;
12745 }
12746
12748 {
12750 {
12751 return true;
12752 }
12753
12754 return false;
12755 }
12756
12758 {
12760 {
12761 return true;
12762 }
12763
12764 return false;
12765 }
12766
12768 {
12769 return false;
12770 }
12771
12774 {
12775 return UATimeSpent.DEFAULT_DEPLOY;
12776 }
12777
12778
12779
12780
12782 {
12784 SetSynchDirty();
12785 }
12786
12788 {
12790 }
12791
12792
12794 {
12795 return false;
12796 }
12797
12800 {
12801 string att_type = "None";
12802
12803 if (ConfigIsExisting("soundAttType"))
12804 {
12805 att_type = ConfigGetString("soundAttType");
12806 }
12807
12809 }
12810
12812 {
12814 }
12815
12816
12817
12818
12819
12825
12827 {
12830
12832 }
12833
12834
12836 {
12838 return;
12839
12841
12844
12847
12848 SoundParameters params = new SoundParameters();
12852 }
12853
12854
12856 {
12858 return;
12859
12861 SetSynchDirty();
12862
12865 }
12866
12867
12869 {
12871 return;
12872
12874 SetSynchDirty();
12875
12878 }
12879
12881 {
12883 }
12884
12886 {
12888 }
12889
12892 {
12893 if (!
GetGame().IsDedicatedServer())
12894 {
12895 if (ConfigIsExisting("attachSoundSet"))
12896 {
12897 string cfg_path = "";
12898 string soundset = "";
12899 string type_name =
GetType();
12900
12903 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12904 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12905
12906 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12907 {
12908 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12909 {
12910 if (cfg_slot_array[i] == slot_type)
12911 {
12912 soundset = cfg_soundset_array[i];
12913 break;
12914 }
12915 }
12916 }
12917
12918 if (soundset != "")
12919 {
12920 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12922 }
12923 }
12924 }
12925 }
12926
12928 {
12929
12930 }
12931
12932 void OnApply(PlayerBase player);
12933
12935 {
12936 return 1.0;
12937 };
12938
12940 {
12942 }
12943
12945 {
12947 }
12948
12950
12952 {
12953 SetDynamicPhysicsLifeTime(0.01);
12955 }
12956
12958 {
12959 array<string> zone_names = new array<string>;
12960 GetDamageZones(zone_names);
12961 for (int i = 0; i < zone_names.Count(); i++)
12962 {
12963 SetHealthMax(zone_names.Get(i),"Health");
12964 }
12965 SetHealthMax("","Health");
12966 }
12967
12970 {
12971 float global_health = GetHealth01("","Health");
12972 array<string> zones = new array<string>;
12973 GetDamageZones(zones);
12974
12975 for (int i = 0; i < zones.Count(); i++)
12976 {
12977 SetHealth01(zones.Get(i),"Health",global_health);
12978 }
12979 }
12980
12983 {
12984 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12985 }
12986
12988 {
12989 if (!hasRootAsPlayer)
12990 {
12991 if (refParentIB)
12992 {
12993
12994 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12995 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12996
12997 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12998 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12999
13002 }
13003 else
13004 {
13005
13008 }
13009 }
13010 }
13011
13013 {
13015 {
13016 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13017 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13018 {
13019 float heatPermCoef = 1.0;
13021 while (ent)
13022 {
13023 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13024 ent = ent.GetHierarchyParent();
13025 }
13026
13027 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13028 }
13029 }
13030 }
13031
13033 {
13034
13035 EntityAI parent = GetHierarchyParent();
13036 if (!parent)
13037 {
13038 hasParent = false;
13039 hasRootAsPlayer = false;
13040 }
13041 else
13042 {
13043 hasParent = true;
13044 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13045 refParentIB =
ItemBase.Cast(parent);
13046 }
13047 }
13048
13049 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13050 {
13051
13052 }
13053
13055 {
13056
13057 return false;
13058 }
13059
13061 {
13062
13063
13064 return false;
13065 }
13066
13068 {
13069
13070 return false;
13071 }
13072
13075 {
13076 return !GetIsFrozen() &&
IsOpen();
13077 }
13078
13080 {
13081 bool hasParent = false, hasRootAsPlayer = false;
13083
13084 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13085 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13086
13087 if (wwtu || foodDecay)
13088 {
13092
13093 if (processWetness || processTemperature || processDecay)
13094 {
13096
13097 if (processWetness)
13098 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13099
13100 if (processTemperature)
13102
13103 if (processDecay)
13104 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13105 }
13106 }
13107 }
13108
13111 {
13113 }
13114
13116 {
13119
13120 return super.GetTemperatureFreezeThreshold();
13121 }
13122
13124 {
13127
13128 return super.GetTemperatureThawThreshold();
13129 }
13130
13132 {
13135
13136 return super.GetItemOverheatThreshold();
13137 }
13138
13140 {
13142 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13143
13144 return super.GetTemperatureFreezeTime();
13145 }
13146
13148 {
13150 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13151
13152 return super.GetTemperatureThawTime();
13153 }
13154
13159
13161 {
13162 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13163 }
13164
13166 {
13167 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13168 }
13169
13172 {
13174 }
13175
13177 {
13179 }
13180
13182 {
13184 }
13185
13188 {
13189 return null;
13190 }
13191
13194 {
13195 return false;
13196 }
13197
13199 {
13201 {
13204 if (!trg)
13205 {
13207 explosive = this;
13208 }
13209
13210 explosive.PairRemote(trg);
13212
13213 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13214 trg.SetPersistentPairID(persistentID);
13215 explosive.SetPersistentPairID(persistentID);
13216
13217 return true;
13218 }
13219 return false;
13220 }
13221
13224 {
13225 float ret = 1.0;
13228 ret *= GetHealth01();
13229
13230 return ret;
13231 }
13232
13233 #ifdef DEVELOPER
13234 override void SetDebugItem()
13235 {
13236 super.SetDebugItem();
13237 _itemBase = this;
13238 }
13239
13241 {
13242 string text = super.GetDebugText();
13243
13245 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13246
13247 return text;
13248 }
13249 #endif
13250
13252 {
13253 return true;
13254 }
13255
13257
13259
13261 {
13264 }
13265
13266
13274
13290}
13291
13293{
13295 if (entity)
13296 {
13297 bool is_item = entity.IsInherited(
ItemBase);
13298 if (is_item && full_quantity)
13299 {
13302 }
13303 }
13304 else
13305 {
13307 return NULL;
13308 }
13309 return entity;
13310}
13311
13313{
13314 if (item)
13315 {
13316 if (health > 0)
13317 item.SetHealth("", "", health);
13318
13319 if (item.CanHaveTemperature())
13320 {
13322 if (item.CanFreeze())
13323 item.SetFrozen(false);
13324 }
13325
13326 if (item.HasEnergyManager())
13327 {
13328 if (quantity >= 0)
13329 {
13330 item.GetCompEM().SetEnergy0To1(quantity);
13331 }
13332 else
13333 {
13335 }
13336 }
13337 else if (item.IsMagazine())
13338 {
13339 Magazine mag = Magazine.Cast(item);
13340 if (quantity >= 0)
13341 {
13342 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13343 }
13344 else
13345 {
13347 }
13348
13349 }
13350 else
13351 {
13352 if (quantity >= 0)
13353 {
13354 item.SetQuantityNormalized(quantity, false);
13355 }
13356 else
13357 {
13359 }
13360
13361 }
13362 }
13363}
13364
13365#ifdef DEVELOPER
13367#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.