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 {
10028 return;
10029
10031 {
10032 if (ScriptInputUserData.CanStoreInputUserData())
10033 {
10034 ScriptInputUserData ctx = new ScriptInputUserData;
10039 ctx.
Write(destination_entity);
10041 ctx.
Write(slot_id);
10043 }
10044 }
10045 else if (!
GetGame().IsMultiplayer())
10046 {
10048 }
10049 }
10050
10052 {
10054 return;
10055
10056 float split_quantity_new;
10060 InventoryLocation loc = new InventoryLocation;
10061
10062 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10063 {
10065 split_quantity_new = stack_max;
10066 else
10068
10069 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10070 if (new_item)
10071 {
10072 new_item.SetResultOfSplit(true);
10073 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10075 new_item.SetQuantity(split_quantity_new);
10076 }
10077 }
10078 else if (destination_entity && slot_id == -1)
10079 {
10080 if (quantity > stack_max)
10081 split_quantity_new = stack_max;
10082 else
10083 split_quantity_new = quantity;
10084
10086 {
10089 }
10090
10091 if (new_item)
10092 {
10093 new_item.SetResultOfSplit(true);
10094 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10096 new_item.SetQuantity(split_quantity_new);
10097 }
10098 }
10099 else
10100 {
10101 if (stack_max != 0)
10102 {
10104 {
10106 }
10107
10108 if (split_quantity_new == 0)
10109 {
10110 if (!
GetGame().IsMultiplayer())
10111 player.PhysicalPredictiveDropItem(this);
10112 else
10113 player.ServerDropEntity(this);
10114 return;
10115 }
10116
10118
10119 if (new_item)
10120 {
10121 new_item.SetResultOfSplit(true);
10122 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10124 new_item.SetQuantity(stack_max);
10125 new_item.PlaceOnSurface();
10126 }
10127 }
10128 }
10129 }
10130
10132 {
10134 return;
10135
10136 float split_quantity_new;
10140 InventoryLocation loc = new InventoryLocation;
10141
10142 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10143 {
10145 split_quantity_new = stack_max;
10146 else
10148
10149 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10150 if (new_item)
10151 {
10152 new_item.SetResultOfSplit(true);
10153 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10155 new_item.SetQuantity(split_quantity_new);
10156 }
10157 }
10158 else if (destination_entity && slot_id == -1)
10159 {
10160 if (quantity > stack_max)
10161 split_quantity_new = stack_max;
10162 else
10163 split_quantity_new = quantity;
10164
10166 {
10169 }
10170
10171 if (new_item)
10172 {
10173 new_item.SetResultOfSplit(true);
10174 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10176 new_item.SetQuantity(split_quantity_new);
10177 }
10178 }
10179 else
10180 {
10181 if (stack_max != 0)
10182 {
10184 {
10186 }
10187
10189
10190 if (new_item)
10191 {
10192 new_item.SetResultOfSplit(true);
10193 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10195 new_item.SetQuantity(stack_max);
10196 new_item.PlaceOnSurface();
10197 }
10198 }
10199 }
10200 }
10201
10203 {
10205 return;
10206
10208 {
10209 if (ScriptInputUserData.CanStoreInputUserData())
10210 {
10211 ScriptInputUserData ctx = new ScriptInputUserData;
10216 dst.WriteToContext(ctx);
10218 }
10219 }
10220 else if (!
GetGame().IsMultiplayer())
10221 {
10223 }
10224 }
10225
10227 {
10229 return;
10230
10232 {
10233 if (ScriptInputUserData.CanStoreInputUserData())
10234 {
10235 ScriptInputUserData ctx = new ScriptInputUserData;
10240 ctx.
Write(destination_entity);
10246 }
10247 }
10248 else if (!
GetGame().IsMultiplayer())
10249 {
10251 }
10252 }
10253
10255 {
10257 }
10258
10260 {
10262 return this;
10263
10265 float split_quantity_new;
10267 if (dst.IsValid())
10268 {
10269 int slot_id = dst.GetSlot();
10271
10272 if (quantity > stack_max)
10273 split_quantity_new = stack_max;
10274 else
10275 split_quantity_new = quantity;
10276
10278
10279 if (new_item)
10280 {
10281 new_item.SetResultOfSplit(true);
10282 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10285 }
10286
10287 return new_item;
10288 }
10289
10290 return null;
10291 }
10292
10294 {
10296 return;
10297
10299 float split_quantity_new;
10301 if (destination_entity)
10302 {
10304 if (quantity > stackable)
10305 split_quantity_new = stackable;
10306 else
10307 split_quantity_new = quantity;
10308
10309 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10310 if (new_item)
10311 {
10312 new_item.SetResultOfSplit(true);
10313 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10315 new_item.SetQuantity(split_quantity_new);
10316 }
10317 }
10318 }
10319
10321 {
10323 return;
10324
10326 {
10327 if (ScriptInputUserData.CanStoreInputUserData())
10328 {
10329 ScriptInputUserData ctx = new ScriptInputUserData;
10334 ItemBase destination_entity =
this;
10335 ctx.
Write(destination_entity);
10339 }
10340 }
10341 else if (!
GetGame().IsMultiplayer())
10342 {
10344 }
10345 }
10346
10348 {
10350 return;
10351
10353 float split_quantity_new;
10355 if (player)
10356 {
10358 if (quantity > stackable)
10359 split_quantity_new = stackable;
10360 else
10361 split_quantity_new = quantity;
10362
10363 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10364 new_item =
ItemBase.Cast(in_hands);
10365 if (new_item)
10366 {
10367 new_item.SetResultOfSplit(true);
10368 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10370 new_item.SetQuantity(split_quantity_new);
10371 }
10372 }
10373 }
10374
10376 {
10378 return;
10379
10381 float split_quantity_new = Math.Floor(quantity * 0.5);
10382
10384
10385 if (new_item)
10386 {
10387 if (new_item.GetQuantityMax() < split_quantity_new)
10388 {
10389 split_quantity_new = new_item.GetQuantityMax();
10390 }
10391
10392 new_item.SetResultOfSplit(true);
10393 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10394
10396 {
10399 }
10400 else
10401 {
10404 }
10405 }
10406 }
10407
10409 {
10411 return;
10412
10414 float split_quantity_new = Math.Floor(quantity / 2);
10415
10416 InventoryLocation invloc = new InventoryLocation;
10418
10420 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10421
10422 if (new_item)
10423 {
10424 if (new_item.GetQuantityMax() < split_quantity_new)
10425 {
10426 split_quantity_new = new_item.GetQuantityMax();
10427 }
10429 {
10432 }
10433 else
10434 {
10437 }
10438 }
10439 }
10440
10443 {
10444 SetWeightDirty();
10446
10447 if (parent)
10448 parent.OnAttachmentQuantityChangedEx(this, delta);
10449
10451 {
10453 {
10455 }
10457 {
10458 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10460 }
10461 }
10462
10463 }
10464
10467 {
10468
10469 }
10470
10473 {
10475 }
10476
10478 {
10479 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10480
10482 {
10483 if (newLevel == GameConstants.STATE_RUINED)
10484 {
10486 EntityAI parent = GetHierarchyParent();
10487 if (parent && parent.IsFireplace())
10488 {
10489 CargoBase cargo = GetInventory().GetCargo();
10490 if (cargo)
10491 {
10493 {
10495 }
10496 }
10497 }
10498 }
10499
10501 {
10502
10504 return;
10505 }
10506
10507 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10508 {
10510 }
10511 }
10512 }
10513
10514
10516 {
10517 super.OnRightClick();
10518
10520 {
10522 {
10523 if (ScriptInputUserData.CanStoreInputUserData())
10524 {
10525 vector m4[4];
10527
10528 EntityAI root = GetHierarchyRoot();
10529
10530 InventoryLocation dst = new InventoryLocation;
10532 {
10533 if (root)
10534 {
10535 root.GetTransform(m4);
10537 }
10538 else
10539 GetInventory().GetCurrentInventoryLocation(dst);
10540 }
10541 else
10542 {
10544
10545
10546 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10547 {
10548 if (root)
10549 {
10550 root.GetTransform(m4);
10552 }
10553 else
10554 GetInventory().GetCurrentInventoryLocation(dst);
10555 }
10556 else
10557 {
10558 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10559 }
10560 }
10561
10562 ScriptInputUserData ctx = new ScriptInputUserData;
10570 }
10571 }
10572 else if (!
GetGame().IsMultiplayer())
10573 {
10575 }
10576 }
10577 }
10578
10579 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10580 {
10581
10582 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10583 return false;
10584
10585 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10586 return false;
10587
10588
10590 return false;
10591
10592
10593 Magazine mag = Magazine.Cast(this);
10594 if (mag)
10595 {
10596 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10597 return false;
10598
10599 if (stack_max_limit)
10600 {
10601 Magazine other_mag = Magazine.Cast(other_item);
10602 if (other_item)
10603 {
10604 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10605 return false;
10606 }
10607
10608 }
10609 }
10610 else
10611 {
10612
10614 return false;
10615
10617 return false;
10618 }
10619
10620 PlayerBase player = null;
10621 if (CastTo(player, GetHierarchyRootPlayer()))
10622 {
10623 if (player.GetInventory().HasAttachment(this))
10624 return false;
10625
10626 if (player.IsItemsToDelete())
10627 return false;
10628 }
10629
10630 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10631 return false;
10632
10633 int slotID;
10635 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10636 return false;
10637
10638 return true;
10639 }
10640
10642 {
10644 }
10645
10647 {
10648 return m_IsResultOfSplit;
10649 }
10650
10652 {
10653 m_IsResultOfSplit = value;
10654 }
10655
10657 {
10659 }
10660
10662 {
10663 float other_item_quantity = other_item.GetQuantity();
10664 float this_free_space;
10665
10667
10669
10670 if (other_item_quantity > this_free_space)
10671 {
10672 return this_free_space;
10673 }
10674 else
10675 {
10676 return other_item_quantity;
10677 }
10678 }
10679
10681 {
10683 }
10684
10686 {
10688 return;
10689
10690 if (!IsMagazine() && other_item)
10691 {
10693 if (quantity_used != 0)
10694 {
10695 float hp1 = GetHealth01("","");
10696 float hp2 = other_item.GetHealth01("","");
10697 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10698 hpResult = hpResult / (
GetQuantity() + quantity_used);
10699
10700 hpResult *= GetMaxHealth();
10701 Math.Round(hpResult);
10702 SetHealth("", "Health", hpResult);
10703
10705 other_item.AddQuantity(-quantity_used);
10706 }
10707 }
10709 }
10710
10712 {
10713 #ifdef SERVER
10714 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10715 GetHierarchyParent().IncreaseLifetimeUp();
10716 #endif
10717 };
10718
10720 {
10721 PlayerBase p = PlayerBase.Cast(player);
10722
10723 array<int> recipesIds = p.m_Recipes;
10724 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10725 if (moduleRecipesManager)
10726 {
10727 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10728 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10729 }
10730
10731 for (int i = 0;i < recipesIds.Count(); i++)
10732 {
10733 int key = recipesIds.Get(i);
10734 string recipeName = moduleRecipesManager.GetRecipeName(key);
10736 }
10737 }
10738
10739
10740 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10741 {
10742 super.GetDebugActions(outputList);
10743
10744
10749
10750
10754
10758
10759
10762
10763
10765 {
10768 }
10769
10771
10774
10778 }
10779
10780
10781
10782
10784 {
10785 super.OnAction(action_id, player, ctx);
10786 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10787 {
10788 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10789 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10790 PlayerBase p = PlayerBase.Cast(player);
10791 if (
EActions.RECIPES_RANGE_START < 1000)
10792 {
10793 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10794 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10795 }
10796 }
10797 #ifndef SERVER
10798 else if (action_id ==
EActions.WATCH_PLAYER)
10799 {
10800 PluginDeveloper.SetDeveloperItemClientEx(player);
10801 }
10802 #endif
10804 {
10805 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10806 {
10807 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10808 OnDebugButtonPressServer(id + 1);
10809 }
10810
10811 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10812 {
10813 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10815 }
10816
10817 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10818 {
10819 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10821 }
10822
10823 else if (action_id ==
EActions.ADD_QUANTITY)
10824 {
10825 if (IsMagazine())
10826 {
10827 Magazine mag = Magazine.Cast(this);
10828 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10829 }
10830 else
10831 {
10833 }
10834
10835 if (m_EM)
10836 {
10837 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10838 }
10839
10840 }
10841
10842 else if (action_id ==
EActions.REMOVE_QUANTITY)
10843 {
10844 if (IsMagazine())
10845 {
10846 Magazine mag2 = Magazine.Cast(this);
10847 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10848 }
10849 else
10850 {
10852 }
10853 if (m_EM)
10854 {
10855 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10856 }
10857
10858 }
10859
10860 else if (action_id ==
EActions.SET_QUANTITY_0)
10861 {
10863
10864 if (m_EM)
10865 {
10866 m_EM.SetEnergy(0);
10867 }
10868 }
10869
10870 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10871 {
10873
10874 if (m_EM)
10875 {
10876 m_EM.SetEnergy(m_EM.GetEnergyMax());
10877 }
10878 }
10879
10880 else if (action_id ==
EActions.ADD_HEALTH)
10881 {
10882 AddHealth("","",GetMaxHealth("","Health")/5);
10883 }
10884 else if (action_id ==
EActions.REMOVE_HEALTH)
10885 {
10886 AddHealth("","",-GetMaxHealth("","Health")/5);
10887 }
10888 else if (action_id ==
EActions.DESTROY_HEALTH)
10889 {
10890 SetHealth01("","",0);
10891 }
10892 else if (action_id ==
EActions.WATCH_ITEM)
10893 {
10895 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10896 #ifdef DEVELOPER
10897 SetDebugDeveloper_item(this);
10898 #endif
10899 }
10900
10901 else if (action_id ==
EActions.ADD_TEMPERATURE)
10902 {
10903 AddTemperature(20);
10904
10905 }
10906
10907 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
10908 {
10909 AddTemperature(-20);
10910
10911 }
10912
10913 else if (action_id ==
EActions.FLIP_FROZEN)
10914 {
10915 SetFrozen(!GetIsFrozen());
10916
10917 }
10918
10919 else if (action_id ==
EActions.ADD_WETNESS)
10920 {
10922
10923 }
10924
10925 else if (action_id ==
EActions.REMOVE_WETNESS)
10926 {
10928
10929 }
10930
10931 else if (action_id ==
EActions.LIQUIDTYPE_UP)
10932 {
10935
10936
10937 }
10938
10939 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
10940 {
10943 }
10944
10945 else if (action_id ==
EActions.MAKE_SPECIAL)
10946 {
10947 auto debugParams = DebugSpawnParams.WithPlayer(player);
10948 OnDebugSpawnEx(debugParams);
10949 }
10950
10951 else if (action_id ==
EActions.DELETE)
10952 {
10953 Delete();
10954 }
10955
10956 }
10957
10958
10959 return false;
10960 }
10961
10962
10963
10964
10968
10971
10972
10973
10975 {
10976 return false;
10977 }
10978
10979
10981 {
10982 return true;
10983 }
10984
10985
10987 {
10988 return true;
10989 }
10990
10991
10992
10994 {
10995 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
10997 }
10998
11001 {
11002 return null;
11003 }
11004
11006 {
11007 return false;
11008 }
11009
11011 {
11012 return false;
11013 }
11014
11018
11019
11021 {
11022 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11023 return module_repairing.CanRepair(this, item_repair_kit);
11024 }
11025
11026
11027 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11028 {
11029 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11030 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11031 }
11032
11033
11035 {
11036
11037
11038
11039
11040
11041
11042
11043
11044 return 1;
11045 }
11046
11047
11048
11050 {
11052 }
11053
11054
11055
11057 {
11059 }
11060
11061
11070 {
11071 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11072
11073 if (player)
11074 {
11075 player.MessageStatus(text);
11076 }
11077 }
11078
11079
11088 {
11089 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11090
11091 if (player)
11092 {
11093 player.MessageAction(text);
11094 }
11095 }
11096
11097
11106 {
11107 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11108
11109 if (player)
11110 {
11111 player.MessageFriendly(text);
11112 }
11113 }
11114
11115
11124 {
11125 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11126
11127 if (player)
11128 {
11129 player.MessageImportant(text);
11130 }
11131 }
11132
11134 {
11135 return true;
11136 }
11137
11138
11139 override bool KindOf(
string tag)
11140 {
11141 bool found = false;
11142 string item_name = this.
GetType();
11145
11146 int array_size = item_tag_array.Count();
11147 for (int i = 0; i < array_size; i++)
11148 {
11149 if (item_tag_array.Get(i) == tag)
11150 {
11151 found = true;
11152 break;
11153 }
11154 }
11155 return found;
11156 }
11157
11158
11160 {
11161
11162 super.OnRPC(sender, rpc_type,ctx);
11163
11164
11165 switch (rpc_type)
11166 {
11167 #ifndef SERVER
11168 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11169 Param2<bool, string> p = new Param2<bool, string>(false, "");
11170
11172 return;
11173
11174 bool play = p.param1;
11175 string soundSet = p.param2;
11176
11177 if (play)
11178 {
11180 {
11182 {
11184 }
11185 }
11186 else
11187 {
11189 }
11190 }
11191 else
11192 {
11194 }
11195
11196 break;
11197 #endif
11198
11199 }
11200
11202 {
11204 }
11205 }
11206
11207
11208
11209
11211 {
11212 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11213 return plugin.GetID(
name);
11214 }
11215
11217 {
11218 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11219 return plugin.GetName(id);
11220 }
11221
11224 {
11225
11226
11227 int varFlags;
11228 if (!ctx.
Read(varFlags))
11229 return;
11230
11231 if (varFlags & ItemVariableFlags.FLOAT)
11232 {
11234 }
11235 }
11236
11238 {
11239
11240 super.SerializeNumericalVars(floats_out);
11241
11242
11243
11245 {
11247 }
11248
11250 {
11252 }
11253
11255 {
11257 }
11258
11260 {
11265 }
11266
11268 {
11270 }
11271 }
11272
11274 {
11275
11276 super.DeSerializeNumericalVars(floats);
11277
11278
11279 int index = 0;
11280 int mask = Math.Round(floats.Get(index));
11281
11282 index++;
11283
11285 {
11287 {
11289 }
11290 else
11291 {
11292 float quantity = floats.Get(index);
11293 SetQuantity(quantity,
true,
false,
false,
false);
11294 }
11295 index++;
11296 }
11297
11299 {
11300 float wet = floats.Get(index);
11302 index++;
11303 }
11304
11306 {
11307 int liquidtype = Math.Round(floats.Get(index));
11309 index++;
11310 }
11311
11313 {
11315 index++;
11317 index++;
11319 index++;
11321 index++;
11322 }
11323
11325 {
11326 int cleanness = Math.Round(floats.Get(index));
11328 index++;
11329 }
11330 }
11331
11333 {
11334 super.WriteVarsToCTX(ctx);
11335
11336
11338 {
11340 }
11341
11343 {
11345 }
11346
11348 {
11350 }
11351
11353 {
11354 int r,g,b,a;
11360 }
11361
11363 {
11365 }
11366 }
11367
11369 {
11370 if (!super.ReadVarsFromCTX(ctx,version))
11371 return false;
11372
11373 int intValue;
11374 float value;
11375
11376 if (version < 140)
11377 {
11378 if (!ctx.
Read(intValue))
11379 return false;
11380
11381 m_VariablesMask = intValue;
11382 }
11383
11385 {
11386 if (!ctx.
Read(value))
11387 return false;
11388
11390 {
11392 }
11393 else
11394 {
11396 }
11397 }
11398
11399 if (version < 140)
11400 {
11402 {
11403 if (!ctx.
Read(value))
11404 return false;
11405 SetTemperatureDirect(value);
11406 }
11407 }
11408
11410 {
11411 if (!ctx.
Read(value))
11412 return false;
11414 }
11415
11417 {
11418 if (!ctx.
Read(intValue))
11419 return false;
11421 }
11422
11424 {
11425 int r,g,b,a;
11427 return false;
11429 return false;
11431 return false;
11433 return false;
11434
11436 }
11437
11439 {
11440 if (!ctx.
Read(intValue))
11441 return false;
11443 }
11444
11445 if (version >= 138 && version < 140)
11446 {
11448 {
11449 if (!ctx.
Read(intValue))
11450 return false;
11451 SetFrozen(intValue);
11452 }
11453 }
11454
11455 return true;
11456 }
11457
11458
11460 {
11463 {
11465 }
11466
11467 if (!super.OnStoreLoad(ctx, version))
11468 {
11470 return false;
11471 }
11472
11473 if (version >= 114)
11474 {
11475 bool hasQuickBarIndexSaved;
11476
11477 if (!ctx.
Read(hasQuickBarIndexSaved))
11478 {
11480 return false;
11481 }
11482
11483 if (hasQuickBarIndexSaved)
11484 {
11485 int itmQBIndex;
11486
11487
11488 if (!ctx.
Read(itmQBIndex))
11489 {
11491 return false;
11492 }
11493
11494 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11495 if (itmQBIndex != -1 && parentPlayer)
11496 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11497 }
11498 }
11499 else
11500 {
11501
11502 PlayerBase player;
11503 int itemQBIndex;
11504 if (version ==
int.
MAX)
11505 {
11506 if (!ctx.
Read(itemQBIndex))
11507 {
11509 return false;
11510 }
11511 }
11512 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11513 {
11514
11515 if (!ctx.
Read(itemQBIndex))
11516 {
11518 return false;
11519 }
11520 if (itemQBIndex != -1 && player)
11521 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11522 }
11523 }
11524
11525 if (version < 140)
11526 {
11527
11528 if (!LoadVariables(ctx, version))
11529 {
11531 return false;
11532 }
11533 }
11534
11535
11537 {
11539 return false;
11540 }
11541 if (version >= 132)
11542 {
11544 if (raib)
11545 {
11547 {
11549 return false;
11550 }
11551 }
11552 }
11553
11555 return true;
11556 }
11557
11558
11559
11561 {
11562 super.OnStoreSave(ctx);
11563
11564 PlayerBase player;
11565 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11566 {
11568
11569 int itemQBIndex = -1;
11570 itemQBIndex = player.FindQuickBarEntityIndex(this);
11571 ctx.
Write(itemQBIndex);
11572 }
11573 else
11574 {
11576 }
11577
11579
11581 if (raib)
11582 {
11584 }
11585 }
11586
11587
11589 {
11590 super.AfterStoreLoad();
11591
11593 {
11595 }
11596
11598 {
11601 }
11602 }
11603
11605 {
11606 super.EEOnAfterLoad();
11607
11609 {
11611 }
11612
11615 }
11616
11618 {
11619 return false;
11620 }
11621
11622
11623
11625 {
11627 {
11628 #ifdef PLATFORM_CONSOLE
11629
11631 {
11633 if (menu)
11634 {
11636 }
11637 }
11638 #endif
11639 }
11640
11642 {
11645 }
11646
11648 {
11649 SetWeightDirty();
11651 }
11653 {
11656 }
11657
11659 {
11662 }
11664 {
11667 }
11668
11669 super.OnVariablesSynchronized();
11670 }
11671
11672
11673
11675 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11676 {
11677 if (!IsServerCheck(allow_client))
11678 return false;
11679
11681 return false;
11682
11685
11686 if (value <= (min + 0.001))
11687 value = min;
11688
11689 if (value == min)
11690 {
11691 if (destroy_config)
11692 {
11693 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11694 if (dstr)
11695 {
11697 this.Delete();
11698 return true;
11699 }
11700 }
11701 else if (destroy_forced)
11702 {
11704 this.Delete();
11705 return true;
11706 }
11707
11709 }
11710
11713
11715 {
11717
11718 if (delta)
11720 }
11721
11723
11724 return false;
11725 }
11726
11727
11729 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11730 {
11732 }
11733
11735 {
11738 }
11739
11741 {
11744 }
11745
11748 {
11749 float value_clamped = Math.Clamp(value, 0, 1);
11751 SetQuantity(result, destroy_config, destroy_forced);
11752 }
11753
11754
11757 {
11759 }
11760
11762 {
11764 }
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11776 {
11777 int slot = -1;
11778 if (GetInventory())
11779 {
11780 InventoryLocation il = new InventoryLocation;
11781 GetInventory().GetCurrentInventoryLocation(il);
11783 }
11784
11786 }
11787
11789 {
11790 float quantity_max = 0;
11791
11793 {
11794 if (attSlotID != -1)
11795 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11796
11797 if (quantity_max <= 0)
11799 }
11800
11801 if (quantity_max <= 0)
11803
11804 return quantity_max;
11805 }
11806
11808 {
11810 }
11811
11813 {
11815 }
11816
11817
11819 {
11821 }
11822
11824 {
11826 }
11827
11829 {
11831 }
11832
11833
11835 {
11836
11837 float weightEx = GetWeightEx();
11838 float special = GetInventoryAndCargoWeight();
11839 return weightEx - special;
11840 }
11841
11842
11844 {
11846 }
11847
11849 {
11851 {
11852 #ifdef DEVELOPER
11853 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11854 {
11855 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11857 }
11858 #endif
11859
11860 return GetQuantity() * GetConfigWeightModified();
11861 }
11862 else if (HasEnergyManager())
11863 {
11864 #ifdef DEVELOPER
11865 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11866 {
11867 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11868 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11869 }
11870 #endif
11871 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
11872 }
11873 else
11874 {
11875 #ifdef DEVELOPER
11876 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11877 {
11878 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11879 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11880 }
11881 #endif
11882 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
11883 }
11884 }
11885
11888 {
11889 int item_count = 0;
11891
11892 if (GetInventory().GetCargo() != NULL)
11893 {
11894 item_count = GetInventory().GetCargo().GetItemCount();
11895 }
11896
11897 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11898 {
11899 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11900 if (item)
11901 item_count += item.GetNumberOfItems();
11902 }
11903 return item_count;
11904 }
11905
11908 {
11909 float weight = 0;
11910 float wetness = 1;
11911 if (include_wetness)
11914 {
11915 weight = wetness * m_ConfigWeight;
11916 }
11918 {
11919 weight = 1;
11920 }
11921 return weight;
11922 }
11923
11924
11925
11927 {
11928 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
11929 {
11930 GameInventory inv = GetInventory();
11931 array<EntityAI> items = new array<EntityAI>;
11933 for (int i = 0; i < items.Count(); i++)
11934 {
11936 if (item)
11937 {
11939 }
11940 }
11941 }
11942 }
11943
11944
11945
11946
11948 {
11949 float energy = 0;
11950 if (HasEnergyManager())
11951 {
11952 energy = GetCompEM().GetEnergy();
11953 }
11954 return energy;
11955 }
11956
11957
11959 {
11960 super.OnEnergyConsumed();
11961
11963 }
11964
11966 {
11967 super.OnEnergyAdded();
11968
11970 }
11971
11972
11974 {
11975 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
11976 {
11978 {
11979 float energy_0to1 = GetCompEM().GetEnergy0To1();
11981 }
11982 }
11983 }
11984
11985
11987 {
11988 return ConfigGetFloat("heatIsolation");
11989 }
11990
11992 {
11994 }
11995
11997 {
11998 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
11999 if (
GetGame().ConfigIsExisting(paramPath))
12001
12002 return 0.0;
12003 }
12004
12006 {
12007 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12008 if (
GetGame().ConfigIsExisting(paramPath))
12010
12011 return 0.0;
12012 }
12013
12014 override void SetWet(
float value,
bool allow_client =
false)
12015 {
12016 if (!IsServerCheck(allow_client))
12017 return;
12018
12021
12023
12024 m_VarWet = Math.Clamp(value, min, max);
12025
12027 {
12030 }
12031 }
12032
12033 override void AddWet(
float value)
12034 {
12036 }
12037
12039 {
12041 }
12042
12044 {
12046 }
12047
12049 {
12051 }
12052
12054 {
12056 }
12057
12059 {
12061 }
12062
12063 override void OnWetChanged(
float newVal,
float oldVal)
12064 {
12067 if (newLevel != oldLevel)
12068 {
12070 }
12071 }
12072
12074 {
12075 SetWeightDirty();
12076 }
12077
12079 {
12080 return GetWetLevelInternal(
m_VarWet);
12081 }
12082
12083
12084
12086 {
12088 }
12089
12091 {
12093 }
12094
12096 {
12098 }
12099
12101 {
12103 }
12104
12105
12106
12108 {
12109 if (ConfigIsExisting("itemModelLength"))
12110 {
12111 return ConfigGetFloat("itemModelLength");
12112 }
12113 return 0;
12114 }
12115
12117 {
12118 if (ConfigIsExisting("itemAttachOffset"))
12119 {
12120 return ConfigGetFloat("itemAttachOffset");
12121 }
12122 return 0;
12123 }
12124
12125 override void SetCleanness(
int value,
bool allow_client =
false)
12126 {
12127 if (!IsServerCheck(allow_client))
12128 return;
12129
12131
12133
12136 }
12137
12139 {
12141 }
12142
12144 {
12145 return true;
12146 }
12147
12148
12149
12150
12152 {
12154 }
12155
12157 {
12159 }
12160
12161
12162
12163
12164 override void SetColor(
int r,
int g,
int b,
int a)
12165 {
12171 }
12173 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12174 {
12179 }
12180
12182 {
12184 }
12185
12188 {
12189 int r,g,b,a;
12191 r = r/255;
12192 g = g/255;
12193 b = b/255;
12194 a = a/255;
12195 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12196 }
12197
12198
12199
12200 override void SetLiquidType(
int value,
bool allow_client =
false)
12201 {
12202 if (!IsServerCheck(allow_client))
12203 return;
12204
12209 }
12210
12212 {
12213 return ConfigGetInt("varLiquidTypeInit");
12214 }
12215
12217 {
12219 }
12220
12222 {
12224 SetFrozen(false);
12225 }
12226
12229 {
12230 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12231 }
12232
12233
12236 {
12237 PlayerBase nplayer;
12238 if (PlayerBase.CastTo(nplayer, player))
12239 {
12241
12242 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12243 }
12244 }
12245
12246
12249 {
12250 PlayerBase nplayer;
12251 if (PlayerBase.CastTo(nplayer,player))
12252 {
12253
12254 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12255
12256 }
12257
12258
12259 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12260
12261
12262 if (HasEnergyManager())
12263 {
12264 GetCompEM().UpdatePlugState();
12265 }
12266 }
12267
12268
12270 {
12271 super.OnPlacementStarted(player);
12272
12274 }
12275
12276 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12277 {
12279 {
12280 m_AdminLog.OnPlacementComplete(player,
this);
12281 }
12282
12283 super.OnPlacementComplete(player, position, orientation);
12284 }
12285
12286
12287
12288
12289
12291 {
12293 {
12294 return true;
12295 }
12296 else
12297 {
12298 return false;
12299 }
12300 }
12301
12302
12304 {
12306 {
12308 }
12309 }
12310
12311
12313 {
12315 }
12316
12318 {
12320 }
12321
12322 override void InsertAgent(
int agent,
float count = 1)
12323 {
12324 if (count < 1)
12325 return;
12326
12328 }
12329
12332 {
12334 }
12335
12336
12338 {
12340 }
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12384 {
12386 return false;
12387 return true;
12388 }
12389
12391 {
12392
12394 }
12395
12396
12399 {
12400 super.CheckForRoofLimited(timeTresholdMS);
12401
12403 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12404 {
12405 m_PreviousRoofTestTime = time;
12406 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12407 }
12408 }
12409
12410
12412 {
12414 {
12415 return 0;
12416 }
12417
12418 if (GetInventory().GetAttachmentSlotsCount() != 0)
12419 {
12420 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12421 if (filter)
12422 return filter.GetProtectionLevel(type, false, system);
12423 else
12424 return 0;
12425 }
12426
12427 string subclassPath, entryName;
12428
12429 switch (type)
12430 {
12432 entryName = "biological";
12433 break;
12435 entryName = "chemical";
12436 break;
12437 default:
12438 entryName = "biological";
12439 break;
12440 }
12441
12442 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12443
12445 }
12446
12447
12448
12451 {
12452 if (!IsMagazine())
12454
12456 }
12457
12458
12459
12460
12461
12466 {
12467 return true;
12468 }
12469
12471 {
12473 }
12474
12475
12476
12477
12478
12480 {
12481 if (parent)
12482 {
12483 if (parent.IsInherited(DayZInfected))
12484 return true;
12485
12486 if (!parent.IsRuined())
12487 return true;
12488 }
12489
12490 return true;
12491 }
12492
12494 {
12495 if (!super.CanPutAsAttachment(parent))
12496 {
12497 return false;
12498 }
12499
12500 if (!IsRuined() && !parent.IsRuined())
12501 {
12502 return true;
12503 }
12504
12505 return false;
12506 }
12507
12509 {
12510
12511
12512
12513
12514 return super.CanReceiveItemIntoCargo(item);
12515 }
12516
12518 {
12519
12520
12521
12522
12523 GameInventory attachmentInv = attachment.GetInventory();
12525 {
12526 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12527 return false;
12528 }
12529
12530 InventoryLocation loc = new InventoryLocation();
12531 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12532 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12533 return false;
12534
12535 return super.CanReceiveAttachment(attachment, slotId);
12536 }
12537
12539 {
12540 if (!super.CanReleaseAttachment(attachment))
12541 return false;
12542
12543 return GetInventory().AreChildrenAccessible();
12544 }
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12567 {
12568 int id = muzzle_owner.GetMuzzleID();
12569 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12570
12571 if (WPOF_array)
12572 {
12573 for (int i = 0; i < WPOF_array.Count(); i++)
12574 {
12575 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12576
12577 if (WPOF)
12578 {
12579 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12580 }
12581 }
12582 }
12583 }
12584
12585
12587 {
12588 int id = muzzle_owner.GetMuzzleID();
12590
12591 if (WPOBE_array)
12592 {
12593 for (int i = 0; i < WPOBE_array.Count(); i++)
12594 {
12595 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12596
12597 if (WPOBE)
12598 {
12599 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12600 }
12601 }
12602 }
12603 }
12604
12605
12607 {
12608 int id = muzzle_owner.GetMuzzleID();
12609 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12610
12611 if (WPOOH_array)
12612 {
12613 for (int i = 0; i < WPOOH_array.Count(); i++)
12614 {
12615 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12616
12617 if (WPOOH)
12618 {
12619 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12620 }
12621 }
12622 }
12623 }
12624
12625
12627 {
12628 int id = muzzle_owner.GetMuzzleID();
12629 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12630
12631 if (WPOOH_array)
12632 {
12633 for (int i = 0; i < WPOOH_array.Count(); i++)
12634 {
12635 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12636
12637 if (WPOOH)
12638 {
12639 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12640 }
12641 }
12642 }
12643 }
12644
12645
12647 {
12648 int id = muzzle_owner.GetMuzzleID();
12649 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12650
12651 if (WPOOH_array)
12652 {
12653 for (int i = 0; i < WPOOH_array.Count(); i++)
12654 {
12655 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12656
12657 if (WPOOH)
12658 {
12659 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12660 }
12661 }
12662 }
12663 }
12664
12665
12666
12668 {
12670 {
12671 return true;
12672 }
12673
12674 return false;
12675 }
12676
12678 {
12680 {
12681 return true;
12682 }
12683
12684 return false;
12685 }
12686
12688 {
12690 {
12691 return true;
12692 }
12693
12694 return false;
12695 }
12696
12698 {
12699 return false;
12700 }
12701
12704 {
12705 return UATimeSpent.DEFAULT_DEPLOY;
12706 }
12707
12708
12709
12710
12712 {
12714 SetSynchDirty();
12715 }
12716
12718 {
12720 }
12721
12722
12724 {
12725 return false;
12726 }
12727
12730 {
12731 string att_type = "None";
12732
12733 if (ConfigIsExisting("soundAttType"))
12734 {
12735 att_type = ConfigGetString("soundAttType");
12736 }
12737
12739 }
12740
12742 {
12744 }
12745
12746
12747
12748
12749
12753
12755 {
12758
12760 }
12761
12762
12764 {
12766 return;
12767
12769
12772
12775
12776 SoundParameters params = new SoundParameters();
12780 }
12781
12782
12784 {
12786 return;
12787
12789 SetSynchDirty();
12790
12793 }
12794
12795
12797 {
12799 return;
12800
12802 SetSynchDirty();
12803
12806 }
12807
12809 {
12811 }
12812
12814 {
12816 }
12817
12820 {
12821 if (!
GetGame().IsDedicatedServer())
12822 {
12823 if (ConfigIsExisting("attachSoundSet"))
12824 {
12825 string cfg_path = "";
12826 string soundset = "";
12827 string type_name =
GetType();
12828
12831 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12832 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12833
12834 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12835 {
12836 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12837 {
12838 if (cfg_slot_array[i] == slot_type)
12839 {
12840 soundset = cfg_soundset_array[i];
12841 break;
12842 }
12843 }
12844 }
12845
12846 if (soundset != "")
12847 {
12848 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12850 }
12851 }
12852 }
12853 }
12854
12856 {
12857
12858 }
12859
12860 void OnApply(PlayerBase player);
12861
12863 {
12864 return 1.0;
12865 };
12866
12868 {
12870 }
12871
12873 {
12875 }
12876
12878
12880 {
12881 SetDynamicPhysicsLifeTime(0.01);
12883 }
12884
12886 {
12887 array<string> zone_names = new array<string>;
12888 GetDamageZones(zone_names);
12889 for (int i = 0; i < zone_names.Count(); i++)
12890 {
12891 SetHealthMax(zone_names.Get(i),"Health");
12892 }
12893 SetHealthMax("","Health");
12894 }
12895
12898 {
12899 float global_health = GetHealth01("","Health");
12900 array<string> zones = new array<string>;
12901 GetDamageZones(zones);
12902
12903 for (int i = 0; i < zones.Count(); i++)
12904 {
12905 SetHealth01(zones.Get(i),"Health",global_health);
12906 }
12907 }
12908
12911 {
12912 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
12913 }
12914
12916 {
12917 if (!hasRootAsPlayer)
12918 {
12919 if (refParentIB)
12920 {
12921
12922 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
12923 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
12924
12925 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
12926 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
12927
12930 }
12931 else
12932 {
12933
12936 }
12937 }
12938 }
12939
12941 {
12943 {
12944 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
12945 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
12946 {
12947 float heatPermCoef = 1.0;
12949 while (ent)
12950 {
12951 heatPermCoef *= ent.GetHeatPermeabilityCoef();
12952 ent = ent.GetHierarchyParent();
12953 }
12954
12955 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
12956 }
12957 }
12958 }
12959
12961 {
12962
12963 EntityAI parent = GetHierarchyParent();
12964 if (!parent)
12965 {
12966 hasParent = false;
12967 hasRootAsPlayer = false;
12968 }
12969 else
12970 {
12971 hasParent = true;
12972 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
12973 refParentIB =
ItemBase.Cast(parent);
12974 }
12975 }
12976
12977 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
12978 {
12979
12980 }
12981
12983 {
12984
12985 return false;
12986 }
12987
12989 {
12990
12991
12992 return false;
12993 }
12994
12996 {
12997
12998 return false;
12999 }
13000
13003 {
13004 return !GetIsFrozen() &&
IsOpen();
13005 }
13006
13008 {
13009 bool hasParent = false, hasRootAsPlayer = false;
13011
13012 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13013 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13014
13015 if (wwtu || foodDecay)
13016 {
13020
13021 if (processWetness || processTemperature || processDecay)
13022 {
13024
13025 if (processWetness)
13026 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13027
13028 if (processTemperature)
13030
13031 if (processDecay)
13032 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13033 }
13034 }
13035 }
13036
13039 {
13041 }
13042
13044 {
13047
13048 return super.GetTemperatureFreezeThreshold();
13049 }
13050
13052 {
13055
13056 return super.GetTemperatureThawThreshold();
13057 }
13058
13060 {
13063
13064 return super.GetItemOverheatThreshold();
13065 }
13066
13068 {
13070 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13071
13072 return super.GetTemperatureFreezeTime();
13073 }
13074
13076 {
13078 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13079
13080 return super.GetTemperatureThawTime();
13081 }
13082
13087
13089 {
13090 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13091 }
13092
13094 {
13095 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13096 }
13097
13100 {
13102 }
13103
13105 {
13107 }
13108
13110 {
13112 }
13113
13116 {
13117 return null;
13118 }
13119
13122 {
13123 return false;
13124 }
13125
13127 {
13129 {
13132 if (!trg)
13133 {
13135 explosive = this;
13136 }
13137
13138 explosive.PairRemote(trg);
13140
13141 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13142 trg.SetPersistentPairID(persistentID);
13143 explosive.SetPersistentPairID(persistentID);
13144
13145 return true;
13146 }
13147 return false;
13148 }
13149
13152 {
13153 float ret = 1.0;
13156 ret *= GetHealth01();
13157
13158 return ret;
13159 }
13160
13161 #ifdef DEVELOPER
13162 override void SetDebugItem()
13163 {
13164 super.SetDebugItem();
13165 _itemBase = this;
13166 }
13167
13169 {
13170 string text = super.GetDebugText();
13171
13173 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13174
13175 return text;
13176 }
13177 #endif
13178
13180 {
13181 return true;
13182 }
13183
13185
13187
13189 {
13192 }
13193
13194
13202
13218}
13219
13221{
13223 if (entity)
13224 {
13225 bool is_item = entity.IsInherited(
ItemBase);
13226 if (is_item && full_quantity)
13227 {
13230 }
13231 }
13232 else
13233 {
13235 return NULL;
13236 }
13237 return entity;
13238}
13239
13241{
13242 if (item)
13243 {
13244 if (health > 0)
13245 item.SetHealth("", "", health);
13246
13247 if (item.CanHaveTemperature())
13248 {
13250 if (item.CanFreeze())
13251 item.SetFrozen(false);
13252 }
13253
13254 if (item.HasEnergyManager())
13255 {
13256 if (quantity >= 0)
13257 {
13258 item.GetCompEM().SetEnergy0To1(quantity);
13259 }
13260 else
13261 {
13263 }
13264 }
13265 else if (item.IsMagazine())
13266 {
13267 Magazine mag = Magazine.Cast(item);
13268 if (quantity >= 0)
13269 {
13270 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13271 }
13272 else
13273 {
13275 }
13276
13277 }
13278 else
13279 {
13280 if (quantity >= 0)
13281 {
13282 item.SetQuantityNormalized(quantity, false);
13283 }
13284 else
13285 {
13287 }
13288
13289 }
13290 }
13291}
13292
13293#ifdef DEVELOPER
13295#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.