8468{
8470 {
8471 return true;
8472 }
8473};
8474
8475
8476
8478{
8482
8484
8487
8488
8489
8490
8491
8500
8506
8511
8516
8537 protected bool m_IsResultOfSplit
8538
8540
8545
8546
8547
8549
8553
8554
8555
8557
8560
8561
8562
8568
8569
8577
8580
8581
8583
8584
8586
8587
8592
8593
8598
8599
8601
8602
8604 {
8609
8610 if (!
GetGame().IsDedicatedServer())
8611 {
8613 {
8615
8617 {
8619 }
8620 }
8621
8624 }
8625
8626 m_OldLocation = null;
8627
8629 {
8631 }
8632
8633 if (ConfigIsExisting("headSelectionsToHide"))
8634 {
8637 }
8638
8640 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8641 {
8643 }
8644
8646
8647 m_IsResultOfSplit = false;
8648
8650 }
8651
8653 {
8654 super.InitItemVariables();
8655
8661 m_Count = ConfigGetInt(
"count");
8662
8665
8670
8673
8678
8690
8694
8695
8698 if (ConfigIsExisting("canBeSplit"))
8699 {
8702 }
8703
8705 if (ConfigIsExisting("itemBehaviour"))
8707
8708
8711 RegisterNetSyncVariableInt("m_VarLiquidType");
8712 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8713
8714 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8715 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8716 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8717
8718 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8719 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8720 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8721 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8722
8723 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8724 RegisterNetSyncVariableBool("m_IsTakeable");
8725 RegisterNetSyncVariableBool("m_IsHologram");
8726
8729 {
8732 }
8733
8735
8737 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8739
8740 }
8741
8743 {
8745 }
8746
8748 {
8751 {
8756 }
8757 }
8758
8759 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8760 {
8762 {
8765 }
8766
8768 }
8769
8771 {
8777 }
8778
8780
8782 {
8784
8785 if (!action)
8786 {
8787 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8788 return;
8789 }
8790
8792 if (!ai)
8793 {
8795 return;
8796 }
8797
8799 if (!action_array)
8800 {
8801 action_array = new array<ActionBase_Basic>;
8803 }
8804 if (LogManager.IsActionLogEnable())
8805 {
8806 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8807 }
8808
8809 if (action_array.Find(action) != -1)
8810 {
8811 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8812 }
8813 else
8814 {
8815 action_array.Insert(action);
8816 }
8817 }
8818
8820 {
8822 ActionBase action = player.GetActionManager().GetAction(actionName);
8825
8826 if (action_array)
8827 {
8828 action_array.RemoveItem(action);
8829 }
8830 }
8831
8832
8833
8835 {
8836 ActionOverrideData overrideData = new ActionOverrideData();
8840
8842 if (!actionMap)
8843 {
8846 }
8847
8848 actionMap.Insert(this.
Type(), overrideData);
8849
8850 }
8851
8853
8855
8856
8858 {
8861
8864
8865 string config_to_search = "CfgVehicles";
8866 string muzzle_owner_config;
8867
8869 {
8870 if (IsInherited(Weapon))
8871 config_to_search = "CfgWeapons";
8872
8873 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8874
8875 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8876
8878
8879 if (config_OnFire_subclass_count > 0)
8880 {
8881 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8882
8883 for (int i = 0; i < config_OnFire_subclass_count; i++)
8884 {
8885 string particle_class = "";
8887 string config_OnFire_entry = config_OnFire_class + particle_class;
8888 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8889 WPOF_array.Insert(WPOF);
8890 }
8891
8892
8894 }
8895 }
8896
8898 {
8899 config_to_search = "CfgWeapons";
8900 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8901
8902 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8903
8905
8906 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8907 {
8908 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8909
8910 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8911 {
8912 string particle_class2 = "";
8914 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8915 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8916 WPOBE_array.Insert(WPOBE);
8917 }
8918
8919
8921 }
8922 }
8923 }
8924
8925
8927 {
8930
8932 {
8933 string config_to_search = "CfgVehicles";
8934
8935 if (IsInherited(Weapon))
8936 config_to_search = "CfgWeapons";
8937
8938 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8939 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8940
8941 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8942 {
8943
8945
8947 {
8949 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8951 return;
8952 }
8953
8956
8957
8958
8960 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
8961
8962 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
8963 {
8964 string particle_class = "";
8966 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
8968
8969 if (entry_type == CT_CLASS)
8970 {
8971 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
8972 WPOOH_array.Insert(WPOF);
8973 }
8974 }
8975
8976
8978 }
8979 }
8980 }
8981
8983 {
8985 }
8986
8988 {
8990 {
8992
8995
8998
8999 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9000 }
9001 }
9002
9004 {
9006 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9007
9009 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9010
9012 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9013
9015 {
9017 }
9018 }
9019
9021 {
9023 }
9024
9026 {
9029 else
9031
9033 {
9036 }
9037 else
9038 {
9041
9044 }
9045
9047 }
9048
9050 {
9052 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9053 }
9054
9056 {
9058 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9060 }
9061
9063 {
9065 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9066 }
9067
9069 {
9072
9073 OverheatingParticle OP = new OverheatingParticle();
9078
9080 }
9081
9083 {
9086
9087 return -1;
9088 }
9089
9091 {
9093 {
9096
9097 for (int i = count; i > 0; --i)
9098 {
9099 int id = i - 1;
9102
9105
9106 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9107 {
9108 if (p)
9109 {
9112 }
9113 }
9114 }
9115 }
9116 }
9117
9119 {
9121 {
9123 {
9124 int id = i - 1;
9126
9127 if (OP)
9128 {
9130
9131 if (p)
9132 {
9134 }
9135
9136 delete OP;
9137 }
9138 }
9139
9142 }
9143 }
9144
9147 {
9148 return 0.0;
9149 }
9150
9151
9153 {
9154 return 250;
9155 }
9156
9158 {
9159 return 0;
9160 }
9161
9164 {
9166 return true;
9167
9168 return false;
9169 }
9170
9173 {
9176
9178 {
9180 }
9181 else
9182 {
9183
9185 }
9186
9188 }
9189
9196 {
9197 return -1;
9198 }
9199
9200
9201
9202
9204 {
9206 {
9208 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9209
9210 if (r_index >= 0)
9211 {
9212 InventoryLocation r_il = new InventoryLocation;
9213 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9214
9215 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9218 {
9219 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9220 }
9222 {
9223 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9224 }
9225
9226 }
9227
9228 player.GetHumanInventory().ClearUserReservedLocation(this);
9229 }
9230
9233 }
9234
9235
9236
9237
9239 {
9240 return ItemBase.m_DebugActionsMask;
9241 }
9242
9244 {
9245 return ItemBase.m_DebugActionsMask & mask;
9246 }
9247
9249 {
9250 ItemBase.m_DebugActionsMask = mask;
9251 }
9252
9254 {
9255 ItemBase.m_DebugActionsMask |= mask;
9256 }
9257
9259 {
9260 ItemBase.m_DebugActionsMask &= ~mask;
9261 }
9262
9264 {
9266 {
9268 }
9269 else
9270 {
9272 }
9273 }
9274
9275
9277 {
9278 if (GetEconomyProfile())
9279 {
9280 float q_max = GetEconomyProfile().GetQuantityMax();
9281 if (q_max > 0)
9282 {
9283 float q_min = GetEconomyProfile().GetQuantityMin();
9284 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9285
9287 {
9288 ComponentEnergyManager comp = GetCompEM();
9290 {
9292 }
9293 }
9295 {
9297
9298 }
9299
9300 }
9301 }
9302 }
9303
9306 {
9307 EntityAI parent = GetHierarchyParent();
9308
9309 if (parent)
9310 {
9311 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9312 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9313 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9314 }
9315 }
9316
9319 {
9320 EntityAI parent = GetHierarchyParent();
9321
9322 if (parent)
9323 {
9324 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9325 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9326 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9327 }
9328 }
9329
9331 {
9332
9333
9334
9335
9337
9339 {
9340 if (ScriptInputUserData.CanStoreInputUserData())
9341 {
9342 ScriptInputUserData ctx = new ScriptInputUserData;
9348 ctx.
Write(use_stack_max);
9351
9353 {
9354 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9355 }
9356 }
9357 }
9358 else if (!
GetGame().IsMultiplayer())
9359 {
9361 }
9362 }
9363
9365 {
9367 }
9368
9370 {
9372 }
9373
9375 {
9377 }
9378
9380 {
9381
9382 return false;
9383 }
9384
9386 {
9387 return false;
9388 }
9389
9393 {
9394 return false;
9395 }
9396
9398 {
9399 return "";
9400 }
9401
9403
9405 {
9406 return false;
9407 }
9408
9410 {
9411 return true;
9412 }
9413
9414
9415
9417 {
9418 return true;
9419 }
9420
9422 {
9423 return true;
9424 }
9425
9427 {
9428 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9430 }
9431
9433 {
9435 }
9436
9438 {
9440 if (!is_being_placed)
9442 SetSynchDirty();
9443 }
9444
9445
9447
9449 {
9451 }
9452
9454 {
9456 }
9457
9459 {
9460 return 1;
9461 }
9462
9464 {
9465 return false;
9466 }
9467
9469 {
9471 SetSynchDirty();
9472 }
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9509 {
9510 super.OnMovedInsideCargo(container);
9511
9512 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9513 }
9514
9515 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9516 {
9517 super.EEItemLocationChanged(oldLoc,newLoc);
9518
9519 PlayerBase new_player = null;
9520 PlayerBase old_player = null;
9521
9522 if (newLoc.GetParent())
9523 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9524
9525 if (oldLoc.GetParent())
9526 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9527
9529 {
9530 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9531
9532 if (r_index >= 0)
9533 {
9534 InventoryLocation r_il = new InventoryLocation;
9535 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9536
9537 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9540 {
9541 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9542 }
9544 {
9545 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9546 }
9547
9548 }
9549 }
9550
9552 {
9553 if (new_player)
9554 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9555
9556 if (new_player == old_player)
9557 {
9558
9559 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9560 {
9562 {
9563 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9564 {
9565 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9566 }
9567 }
9568 else
9569 {
9570 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9571 }
9572 }
9573
9574 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9575 {
9576 int type = oldLoc.GetType();
9578 {
9579 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9580 }
9582 {
9583 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9584 }
9585 }
9586 if (!m_OldLocation)
9587 {
9588 m_OldLocation = new InventoryLocation;
9589 }
9590 m_OldLocation.Copy(oldLoc);
9591 }
9592 else
9593 {
9594 if (m_OldLocation)
9595 {
9596 m_OldLocation.Reset();
9597 }
9598 }
9599
9601 }
9602 else
9603 {
9604 if (new_player)
9605 {
9606 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9607 if (res_index >= 0)
9608 {
9609 InventoryLocation il = new InventoryLocation;
9610 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9612 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9615 {
9616 il.
GetParent().GetOnReleaseLock().Invoke(it);
9617 }
9619 {
9621 }
9622
9623 }
9624 }
9626 {
9627
9629 }
9630
9631 if (m_OldLocation)
9632 {
9633 m_OldLocation.Reset();
9634 }
9635 }
9636 }
9637
9638 override void EOnContact(IEntity other, Contact extra)
9639 {
9641 {
9642 int liquidType = -1;
9644 if (impactSpeed > 0.0)
9645 {
9647 #ifndef SERVER
9649 #else
9651 SetSynchDirty();
9652 #endif
9654 }
9655 }
9656
9657 #ifdef SERVER
9658 if (GetCompEM() && GetCompEM().IsPlugged())
9659 {
9660 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9661 GetCompEM().UnplugThis();
9662 }
9663 #endif
9664 }
9665
9667
9669 {
9671 }
9672
9674 {
9675
9676 }
9677
9679 {
9680 super.OnItemLocationChanged(old_owner, new_owner);
9681
9682 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9683 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9684
9685 if (!relatedPlayer && playerNew)
9686 relatedPlayer = playerNew;
9687
9688 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9689 {
9691 if (actionMgr)
9692 {
9693 ActionBase currentAction = actionMgr.GetRunningAction();
9694 if (currentAction)
9696 }
9697 }
9698
9699 Man ownerPlayerOld = null;
9700 Man ownerPlayerNew = null;
9701
9702 if (old_owner)
9703 {
9704 if (old_owner.
IsMan())
9705 {
9706 ownerPlayerOld = Man.Cast(old_owner);
9707 }
9708 else
9709 {
9710 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9711 }
9712 }
9713 else
9714 {
9716 {
9718
9719 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9720 {
9721 GetCompEM().UnplugThis();
9722 }
9723 }
9724 }
9725
9726 if (new_owner)
9727 {
9728 if (new_owner.
IsMan())
9729 {
9730 ownerPlayerNew = Man.Cast(new_owner);
9731 }
9732 else
9733 {
9734 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9735 }
9736 }
9737
9738 if (ownerPlayerOld != ownerPlayerNew)
9739 {
9740 if (ownerPlayerOld)
9741 {
9742 array<EntityAI> subItemsExit = new array<EntityAI>;
9744 for (int i = 0; i < subItemsExit.Count(); i++)
9745 {
9748 }
9749 }
9750
9751 if (ownerPlayerNew)
9752 {
9753 array<EntityAI> subItemsEnter = new array<EntityAI>;
9755 for (int j = 0; j < subItemsEnter.Count(); j++)
9756 {
9759 }
9760 }
9761 }
9762 else if (ownerPlayerNew != null)
9763 {
9764 PlayerBase nplayer;
9765 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9766 {
9767 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9769 for (int k = 0; k < subItemsUpdate.Count(); k++)
9770 {
9772 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9773 }
9774 }
9775 }
9776
9777 if (old_owner)
9778 old_owner.OnChildItemRemoved(this);
9779 if (new_owner)
9780 new_owner.OnChildItemReceived(this);
9781 }
9782
9783
9785 {
9786 super.EEDelete(parent);
9787 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9788 if (player)
9789 {
9791
9792 if (player.IsAlive())
9793 {
9794 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9795 if (r_index >= 0)
9796 {
9797 InventoryLocation r_il = new InventoryLocation;
9798 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9799
9800 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9803 {
9804 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9805 }
9807 {
9808 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9809 }
9810
9811 }
9812
9813 player.RemoveQuickBarEntityShortcut(this);
9814 }
9815 }
9816 }
9817
9819 {
9820 super.EEKilled(killer);
9821
9824 {
9825 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9826 {
9827 if (IsMagazine())
9828 {
9829 if (Magazine.Cast(this).GetAmmoCount() > 0)
9830 {
9832 }
9833 }
9834 else
9835 {
9837 }
9838 }
9839 }
9840 }
9841
9843 {
9844 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9845
9846 super.OnWasAttached(parent, slot_id);
9847
9850
9852 }
9853
9855 {
9856 super.OnWasDetached(parent, slot_id);
9857
9860 }
9861
9863 {
9864 int idx;
9867
9868 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9869 if (inventory_slots.Count() < 1)
9870 {
9871 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9872 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9873 }
9874 else
9875 {
9876 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9877 }
9878
9879 idx = inventory_slots.Find(slot);
9880 if (idx < 0)
9881 return "";
9882
9883 return attach_types.Get(idx);
9884 }
9885
9887 {
9888 int idx = -1;
9889 string slot;
9890
9893
9894 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9895 if (inventory_slots.Count() < 1)
9896 {
9897 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9898 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9899 }
9900 else
9901 {
9902 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9903 if (detach_types.Count() < 1)
9904 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9905 }
9906
9907 for (int i = 0; i < inventory_slots.Count(); i++)
9908 {
9909 slot = inventory_slots.Get(i);
9910 }
9911
9912 if (slot != "")
9913 {
9914 if (detach_types.Count() == 1)
9915 idx = 0;
9916 else
9917 idx = inventory_slots.Find(slot);
9918 }
9919 if (idx < 0)
9920 return "";
9921
9922 return detach_types.Get(idx);
9923 }
9924
9926 {
9927
9929
9930
9931 float min_time = 1;
9932 float max_time = 3;
9933 float delay = Math.RandomFloat(min_time, max_time);
9934
9935 explode_timer.Run(delay, this, "DoAmmoExplosion");
9936 }
9937
9939 {
9940 Magazine magazine = Magazine.Cast(this);
9941 int pop_sounds_count = 6;
9942 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9943
9944
9945 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9946 string sound_name = pop_sounds[ sound_idx ];
9948
9949
9950 magazine.ServerAddAmmoCount(-1);
9951
9952
9953 float min_temp_to_explode = 100;
9954
9955 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
9956 {
9958 }
9959 }
9960
9961
9962 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
9963 {
9964 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
9965
9966 const int CHANCE_DAMAGE_CARGO = 4;
9967 const int CHANCE_DAMAGE_ATTACHMENT = 1;
9968 const int CHANCE_DAMAGE_NOTHING = 2;
9969
9971 {
9972 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
9973 int chances;
9974 int rnd;
9975
9976 if (GetInventory().GetCargo())
9977 {
9978 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9979 rnd = Math.RandomInt(0,chances);
9980
9981 if (rnd < CHANCE_DAMAGE_CARGO)
9982 {
9984 }
9985 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
9986 {
9988 }
9989 }
9990 else
9991 {
9992 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
9993 rnd = Math.RandomInt(0,chances);
9994
9995 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
9996 {
9998 }
9999 }
10000 }
10001 }
10002
10004 {
10005 if (GetInventory().GetCargo())
10006 {
10007 int item_count = GetInventory().GetCargo().GetItemCount();
10008 if (item_count > 0)
10009 {
10010 int random_pick = Math.RandomInt(0, item_count);
10012 if (!item.IsExplosive())
10013 {
10014 item.AddHealth("","",damage);
10015 return true;
10016 }
10017 }
10018 }
10019 return false;
10020 }
10021
10023 {
10024 int attachment_count = GetInventory().AttachmentCount();
10025 if (attachment_count > 0)
10026 {
10027 int random_pick = Math.RandomInt(0, attachment_count);
10028 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10029 if (!attachment.IsExplosive())
10030 {
10031 attachment.AddHealth("","",damage);
10032 return true;
10033 }
10034 }
10035 return false;
10036 }
10037
10039 {
10041 }
10042
10044 {
10046 return GetInventory().CanRemoveEntity();
10047
10048 return false;
10049 }
10050
10052 {
10053
10055 return false;
10056
10057
10059 return false;
10060
10061
10062
10064 if (delta == 0)
10065 return false;
10066
10067
10068 return true;
10069 }
10070
10072 {
10074 {
10075 if (ScriptInputUserData.CanStoreInputUserData())
10076 {
10077 ScriptInputUserData ctx = new ScriptInputUserData;
10082 ctx.
Write(destination_entity);
10084 ctx.
Write(slot_id);
10086 }
10087 }
10088 else if (!
GetGame().IsMultiplayer())
10089 {
10091 }
10092 }
10093
10095 {
10096 float split_quantity_new;
10100 InventoryLocation loc = new InventoryLocation;
10101
10102 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10103 {
10105 split_quantity_new = stack_max;
10106 else
10108
10110 {
10111 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10112 if (new_item)
10113 {
10114 new_item.SetResultOfSplit(true);
10115 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10117 new_item.
SetQuantity(split_quantity_new,
false,
true);
10118 }
10119 }
10120 }
10121 else if (destination_entity && slot_id == -1)
10122 {
10123 if (quantity > stack_max)
10124 split_quantity_new = stack_max;
10125 else
10126 split_quantity_new = quantity;
10127
10129 {
10131 {
10134 }
10135
10136 if (new_item)
10137 {
10138 new_item.SetResultOfSplit(true);
10139 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10141 new_item.
SetQuantity(split_quantity_new,
false,
true);
10142 }
10143 }
10144 }
10145 else
10146 {
10147 if (stack_max != 0)
10148 {
10150 {
10152 }
10153
10154 if (split_quantity_new == 0)
10155 {
10156 if (!
GetGame().IsMultiplayer())
10157 player.PhysicalPredictiveDropItem(this);
10158 else
10159 player.ServerDropEntity(this);
10160 return;
10161 }
10162
10164 {
10166
10167 if (new_item)
10168 {
10169 new_item.SetResultOfSplit(true);
10170 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10173 new_item.PlaceOnSurface();
10174 }
10175 }
10176 }
10177 }
10178 }
10179
10181 {
10182 float split_quantity_new;
10186 InventoryLocation loc = new InventoryLocation;
10187
10188 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10189 {
10191 split_quantity_new = stack_max;
10192 else
10194
10196 {
10197 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10198 if (new_item)
10199 {
10200 new_item.SetResultOfSplit(true);
10201 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10203 new_item.
SetQuantity(split_quantity_new,
false,
true);
10204 }
10205 }
10206 }
10207 else if (destination_entity && slot_id == -1)
10208 {
10209 if (quantity > stack_max)
10210 split_quantity_new = stack_max;
10211 else
10212 split_quantity_new = quantity;
10213
10215 {
10217 {
10220 }
10221
10222 if (new_item)
10223 {
10224 new_item.SetResultOfSplit(true);
10225 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10227 new_item.
SetQuantity(split_quantity_new,
false,
true);
10228 }
10229 }
10230 }
10231 else
10232 {
10233 if (stack_max != 0)
10234 {
10236 {
10238 }
10239
10241 {
10243
10244 if (new_item)
10245 {
10246 new_item.SetResultOfSplit(true);
10247 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10250 new_item.PlaceOnSurface();
10251 }
10252 }
10253 }
10254 }
10255 }
10256
10258 {
10260 {
10261 if (ScriptInputUserData.CanStoreInputUserData())
10262 {
10263 ScriptInputUserData ctx = new ScriptInputUserData;
10268 dst.WriteToContext(ctx);
10270 }
10271 }
10272 else if (!
GetGame().IsMultiplayer())
10273 {
10275 }
10276 }
10277
10279 {
10281 {
10282 if (ScriptInputUserData.CanStoreInputUserData())
10283 {
10284 ScriptInputUserData ctx = new ScriptInputUserData;
10289 ctx.
Write(destination_entity);
10295 }
10296 }
10297 else if (!
GetGame().IsMultiplayer())
10298 {
10300 }
10301 }
10302
10304 {
10306 }
10307
10309 {
10311 float split_quantity_new;
10313 if (dst.IsValid())
10314 {
10315 int slot_id = dst.GetSlot();
10317
10318 if (quantity > stack_max)
10319 split_quantity_new = stack_max;
10320 else
10321 split_quantity_new = quantity;
10322
10324 {
10326
10327 if (new_item)
10328 {
10329 new_item.SetResultOfSplit(true);
10330 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10332 new_item.
SetQuantity(split_quantity_new,
false,
true);
10333 }
10334
10335 return new_item;
10336 }
10337 }
10338
10339 return null;
10340 }
10341
10343 {
10345 float split_quantity_new;
10347 if (destination_entity)
10348 {
10350 if (quantity > stackable)
10351 split_quantity_new = stackable;
10352 else
10353 split_quantity_new = quantity;
10354
10356 {
10357 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10358 if (new_item)
10359 {
10360 new_item.SetResultOfSplit(true);
10361 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10363 new_item.
SetQuantity(split_quantity_new,
false,
true);
10364 }
10365 }
10366 }
10367 }
10368
10370 {
10372 {
10373 if (ScriptInputUserData.CanStoreInputUserData())
10374 {
10375 ScriptInputUserData ctx = new ScriptInputUserData;
10380 ItemBase destination_entity =
this;
10381 ctx.
Write(destination_entity);
10385 }
10386 }
10387 else if (!
GetGame().IsMultiplayer())
10388 {
10390 }
10391 }
10392
10394 {
10396 float split_quantity_new;
10398 if (player)
10399 {
10401 if (quantity > stackable)
10402 split_quantity_new = stackable;
10403 else
10404 split_quantity_new = quantity;
10405
10407 {
10408 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10409 new_item =
ItemBase.Cast(in_hands);
10410 if (new_item)
10411 {
10412 new_item.SetResultOfSplit(true);
10413 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10415 new_item.SetQuantity(split_quantity_new, false, true);
10416 }
10417 }
10418 }
10419 }
10420
10422 {
10424 float split_quantity_new = Math.Floor(quantity * 0.5);
10425
10427 return;
10428
10430
10431 if (new_item)
10432 {
10433 if (new_item.GetQuantityMax() < split_quantity_new)
10434 {
10435 split_quantity_new = new_item.GetQuantityMax();
10436 }
10437
10438 new_item.SetResultOfSplit(true);
10439 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10440
10442 {
10445 }
10446 else
10447 {
10449 new_item.
SetQuantity(split_quantity_new,
false,
true);
10450 }
10451 }
10452 }
10453
10455 {
10457 float split_quantity_new = Math.Floor(quantity / 2);
10458
10460 return;
10461
10462 InventoryLocation invloc = new InventoryLocation;
10464
10466 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10467
10468 if (new_item)
10469 {
10470 if (new_item.GetQuantityMax() < split_quantity_new)
10471 {
10472 split_quantity_new = new_item.GetQuantityMax();
10473 }
10475 {
10478 }
10479 else if (split_quantity_new > 1)
10480 {
10482 new_item.
SetQuantity(split_quantity_new,
false,
true);
10483 }
10484 }
10485 }
10486
10489 {
10490 SetWeightDirty();
10492
10493 if (parent)
10494 parent.OnAttachmentQuantityChangedEx(this, delta);
10495
10497 {
10499 {
10501 }
10503 {
10504 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10506 }
10507 }
10508
10509 }
10510
10513 {
10514
10515 }
10516
10519 {
10521 }
10522
10524 {
10525 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10526
10528 {
10529 if (newLevel == GameConstants.STATE_RUINED)
10530 {
10532 EntityAI parent = GetHierarchyParent();
10533 if (parent && parent.IsFireplace())
10534 {
10535 CargoBase cargo = GetInventory().GetCargo();
10536 if (cargo)
10537 {
10539 {
10541 }
10542 }
10543 }
10544 }
10545
10547 {
10548
10550 return;
10551 }
10552
10553 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10554 {
10556 }
10557 }
10558 }
10559
10560
10562 {
10563 super.OnRightClick();
10564
10566 {
10568 {
10569 if (ScriptInputUserData.CanStoreInputUserData())
10570 {
10571 EntityAI root = GetHierarchyRoot();
10572 Man playerOwner = GetHierarchyRootPlayer();
10573 InventoryLocation dst = new InventoryLocation;
10574
10575
10576 if (!playerOwner && root && root == this)
10577 {
10579 }
10580 else
10581 {
10582
10583 GetInventory().GetCurrentInventoryLocation(dst);
10585 {
10588 {
10590 }
10591 else
10592 {
10594
10595
10596 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10597 {
10599 }
10600 else
10601 {
10602 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10603 }
10604 }
10605 }
10606 }
10607
10608 ScriptInputUserData ctx = new ScriptInputUserData;
10616 }
10617 }
10618 else if (!
GetGame().IsMultiplayer())
10619 {
10621 }
10622 }
10623 }
10624
10626 {
10627 if (root)
10628 {
10629 vector m4[4];
10630 root.GetTransform(m4);
10631 dst.SetGround(this, m4);
10632 }
10633 else
10634 {
10635 GetInventory().GetCurrentInventoryLocation(dst);
10636 }
10637 }
10638
10639 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10640 {
10641
10642 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10643 return false;
10644
10645 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10646 return false;
10647
10648
10650 return false;
10651
10652
10653 Magazine mag = Magazine.Cast(this);
10654 if (mag)
10655 {
10656 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10657 return false;
10658
10659 if (stack_max_limit)
10660 {
10661 Magazine other_mag = Magazine.Cast(other_item);
10662 if (other_item)
10663 {
10664 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10665 return false;
10666 }
10667
10668 }
10669 }
10670 else
10671 {
10672
10674 return false;
10675
10677 return false;
10678 }
10679
10680 PlayerBase player = null;
10681 if (CastTo(player, GetHierarchyRootPlayer()))
10682 {
10683 if (player.GetInventory().HasAttachment(this))
10684 return false;
10685
10686 if (player.IsItemsToDelete())
10687 return false;
10688 }
10689
10690 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10691 return false;
10692
10693 int slotID;
10695 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10696 return false;
10697
10698 return true;
10699 }
10700
10702 {
10704 }
10705
10707 {
10708 return m_IsResultOfSplit;
10709 }
10710
10712 {
10713 m_IsResultOfSplit = value;
10714 }
10715
10717 {
10719 }
10720
10722 {
10723 float other_item_quantity = other_item.GetQuantity();
10724 float this_free_space;
10725
10727
10729
10730 if (other_item_quantity > this_free_space)
10731 {
10732 return this_free_space;
10733 }
10734 else
10735 {
10736 return other_item_quantity;
10737 }
10738 }
10739
10741 {
10743 }
10744
10746 {
10748 return;
10749
10750 if (!IsMagazine() && other_item)
10751 {
10753 if (quantity_used != 0)
10754 {
10755 float hp1 = GetHealth01("","");
10756 float hp2 = other_item.GetHealth01("","");
10757 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10758 hpResult = hpResult / (
GetQuantity() + quantity_used);
10759
10760 hpResult *= GetMaxHealth();
10761 Math.Round(hpResult);
10762 SetHealth("", "Health", hpResult);
10763
10765 other_item.AddQuantity(-quantity_used);
10766 }
10767 }
10769 }
10770
10772 {
10773 #ifdef SERVER
10774 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10775 GetHierarchyParent().IncreaseLifetimeUp();
10776 #endif
10777 };
10778
10780 {
10781 PlayerBase p = PlayerBase.Cast(player);
10782
10783 array<int> recipesIds = p.m_Recipes;
10784 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10785 if (moduleRecipesManager)
10786 {
10787 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10788 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10789 }
10790
10791 for (int i = 0;i < recipesIds.Count(); i++)
10792 {
10793 int key = recipesIds.Get(i);
10794 string recipeName = moduleRecipesManager.GetRecipeName(key);
10796 }
10797 }
10798
10799
10800 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10801 {
10802 super.GetDebugActions(outputList);
10803
10804
10810
10811
10816
10821
10822
10826
10827
10829 {
10833 }
10834
10837
10838
10842
10844
10845 InventoryLocation loc = new InventoryLocation();
10846 GetInventory().GetCurrentInventoryLocation(loc);
10848 {
10849 if (Gizmo_IsSupported())
10852 }
10853
10855 }
10856
10857
10858
10859
10861 {
10862 super.OnAction(action_id, player, ctx);
10863
10865 {
10866 switch (action_id)
10867 {
10870 return true;
10873 return true;
10874 }
10875 }
10876
10878 {
10879 switch (action_id)
10880 {
10882 Delete();
10883 return true;
10884 }
10885 }
10886
10887 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10888 {
10889 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10890 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10891 PlayerBase p = PlayerBase.Cast(player);
10892 if (
EActions.RECIPES_RANGE_START < 1000)
10893 {
10894 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10895 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10896 }
10897 }
10898 #ifndef SERVER
10899 else if (action_id ==
EActions.WATCH_PLAYER)
10900 {
10901 PluginDeveloper.SetDeveloperItemClientEx(player);
10902 }
10903 #endif
10905 {
10906 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10907 {
10908 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10909 OnDebugButtonPressServer(id + 1);
10910 }
10911
10912 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10913 {
10914 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10916 }
10917
10918 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10919 {
10920 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10922 }
10923
10924 else if (action_id ==
EActions.ADD_QUANTITY)
10925 {
10926 if (IsMagazine())
10927 {
10928 Magazine mag = Magazine.Cast(this);
10929 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10930 }
10931 else
10932 {
10934 }
10935
10936 if (m_EM)
10937 {
10938 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10939 }
10940
10941 }
10942
10943 else if (action_id ==
EActions.REMOVE_QUANTITY)
10944 {
10945 if (IsMagazine())
10946 {
10947 Magazine mag2 = Magazine.Cast(this);
10948 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10949 }
10950 else
10951 {
10953 }
10954 if (m_EM)
10955 {
10956 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
10957 }
10958
10959 }
10960
10961 else if (action_id ==
EActions.SET_QUANTITY_0)
10962 {
10964
10965 if (m_EM)
10966 {
10967 m_EM.SetEnergy(0);
10968 }
10969 }
10970
10971 else if (action_id ==
EActions.SET_MAX_QUANTITY)
10972 {
10974
10975 if (m_EM)
10976 {
10977 m_EM.SetEnergy(m_EM.GetEnergyMax());
10978 }
10979 }
10980
10981 else if (action_id ==
EActions.ADD_HEALTH)
10982 {
10983 AddHealth("","",GetMaxHealth("","Health")/5);
10984 }
10985 else if (action_id ==
EActions.REMOVE_HEALTH)
10986 {
10987 AddHealth("","",-GetMaxHealth("","Health")/5);
10988 }
10989 else if (action_id ==
EActions.DESTROY_HEALTH)
10990 {
10991 SetHealth01("","",0);
10992 }
10993 else if (action_id ==
EActions.WATCH_ITEM)
10994 {
10996 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
10997 #ifdef DEVELOPER
10998 SetDebugDeveloper_item(this);
10999 #endif
11000 }
11001
11002 else if (action_id ==
EActions.ADD_TEMPERATURE)
11003 {
11004 AddTemperature(20);
11005
11006 }
11007
11008 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11009 {
11010 AddTemperature(-20);
11011
11012 }
11013
11014 else if (action_id ==
EActions.FLIP_FROZEN)
11015 {
11016 SetFrozen(!GetIsFrozen());
11017
11018 }
11019
11020 else if (action_id ==
EActions.ADD_WETNESS)
11021 {
11023
11024 }
11025
11026 else if (action_id ==
EActions.REMOVE_WETNESS)
11027 {
11029
11030 }
11031
11032 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11033 {
11036
11037
11038 }
11039
11040 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11041 {
11044 }
11045
11046 else if (action_id ==
EActions.MAKE_SPECIAL)
11047 {
11048 auto debugParams = DebugSpawnParams.WithPlayer(player);
11049 OnDebugSpawnEx(debugParams);
11050 }
11051
11052 }
11053
11054
11055 return false;
11056 }
11057
11058
11059
11060
11064
11067
11068
11069
11071 {
11072 return false;
11073 }
11074
11075
11077 {
11078 return true;
11079 }
11080
11081
11083 {
11084 return true;
11085 }
11086
11087
11088
11090 {
11091 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11093 }
11094
11097 {
11098 return null;
11099 }
11100
11102 {
11103 return false;
11104 }
11105
11107 {
11108 return false;
11109 }
11110
11114
11115
11117 {
11118 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11119 return module_repairing.CanRepair(this, item_repair_kit);
11120 }
11121
11122
11123 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11124 {
11125 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11126 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11127 }
11128
11129
11131 {
11132
11133
11134
11135
11136
11137
11138
11139
11140 return 1;
11141 }
11142
11143
11144
11146 {
11148 }
11149
11150
11151
11153 {
11155 }
11156
11157
11166 {
11167 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11168
11169 if (player)
11170 {
11171 player.MessageStatus(text);
11172 }
11173 }
11174
11175
11184 {
11185 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11186
11187 if (player)
11188 {
11189 player.MessageAction(text);
11190 }
11191 }
11192
11193
11202 {
11203 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11204
11205 if (player)
11206 {
11207 player.MessageFriendly(text);
11208 }
11209 }
11210
11211
11220 {
11221 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11222
11223 if (player)
11224 {
11225 player.MessageImportant(text);
11226 }
11227 }
11228
11230 {
11231 return true;
11232 }
11233
11234
11235 override bool KindOf(
string tag)
11236 {
11237 bool found = false;
11238 string item_name = this.
GetType();
11241
11242 int array_size = item_tag_array.Count();
11243 for (int i = 0; i < array_size; i++)
11244 {
11245 if (item_tag_array.Get(i) == tag)
11246 {
11247 found = true;
11248 break;
11249 }
11250 }
11251 return found;
11252 }
11253
11254
11256 {
11257
11258 super.OnRPC(sender, rpc_type,ctx);
11259
11260
11261 switch (rpc_type)
11262 {
11263 #ifndef SERVER
11264 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11265 Param2<bool, string> p = new Param2<bool, string>(false, "");
11266
11268 return;
11269
11270 bool play = p.param1;
11271 string soundSet = p.param2;
11272
11273 if (play)
11274 {
11276 {
11278 {
11280 }
11281 }
11282 else
11283 {
11285 }
11286 }
11287 else
11288 {
11290 }
11291
11292 break;
11293 #endif
11294
11295 }
11296
11298 {
11300 }
11301 }
11302
11303
11304
11305
11307 {
11308 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11309 return plugin.GetID(
name);
11310 }
11311
11313 {
11314 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11315 return plugin.GetName(id);
11316 }
11317
11320 {
11321
11322
11323 int varFlags;
11324 if (!ctx.
Read(varFlags))
11325 return;
11326
11327 if (varFlags & ItemVariableFlags.FLOAT)
11328 {
11330 }
11331 }
11332
11334 {
11335
11336 super.SerializeNumericalVars(floats_out);
11337
11338
11339
11341 {
11343 }
11344
11346 {
11348 }
11349
11351 {
11353 }
11354
11356 {
11361 }
11362
11364 {
11366 }
11367 }
11368
11370 {
11371
11372 super.DeSerializeNumericalVars(floats);
11373
11374
11375 int index = 0;
11376 int mask = Math.Round(floats.Get(index));
11377
11378 index++;
11379
11381 {
11383 {
11385 }
11386 else
11387 {
11388 float quantity = floats.Get(index);
11389 SetQuantity(quantity,
true,
false,
false,
false);
11390 }
11391 index++;
11392 }
11393
11395 {
11396 float wet = floats.Get(index);
11398 index++;
11399 }
11400
11402 {
11403 int liquidtype = Math.Round(floats.Get(index));
11405 index++;
11406 }
11407
11409 {
11411 index++;
11413 index++;
11415 index++;
11417 index++;
11418 }
11419
11421 {
11422 int cleanness = Math.Round(floats.Get(index));
11424 index++;
11425 }
11426 }
11427
11429 {
11430 super.WriteVarsToCTX(ctx);
11431
11432
11434 {
11436 }
11437
11439 {
11441 }
11442
11444 {
11446 }
11447
11449 {
11450 int r,g,b,a;
11456 }
11457
11459 {
11461 }
11462 }
11463
11465 {
11466 if (!super.ReadVarsFromCTX(ctx,version))
11467 return false;
11468
11469 int intValue;
11470 float value;
11471
11472 if (version < 140)
11473 {
11474 if (!ctx.
Read(intValue))
11475 return false;
11476
11477 m_VariablesMask = intValue;
11478 }
11479
11481 {
11482 if (!ctx.
Read(value))
11483 return false;
11484
11486 {
11488 }
11489 else
11490 {
11492 }
11493 }
11494
11495 if (version < 140)
11496 {
11498 {
11499 if (!ctx.
Read(value))
11500 return false;
11501 SetTemperatureDirect(value);
11502 }
11503 }
11504
11506 {
11507 if (!ctx.
Read(value))
11508 return false;
11510 }
11511
11513 {
11514 if (!ctx.
Read(intValue))
11515 return false;
11517 }
11518
11520 {
11521 int r,g,b,a;
11523 return false;
11525 return false;
11527 return false;
11529 return false;
11530
11532 }
11533
11535 {
11536 if (!ctx.
Read(intValue))
11537 return false;
11539 }
11540
11541 if (version >= 138 && version < 140)
11542 {
11544 {
11545 if (!ctx.
Read(intValue))
11546 return false;
11547 SetFrozen(intValue);
11548 }
11549 }
11550
11551 return true;
11552 }
11553
11554
11556 {
11559 {
11561 }
11562
11563 if (!super.OnStoreLoad(ctx, version))
11564 {
11566 return false;
11567 }
11568
11569 if (version >= 114)
11570 {
11571 bool hasQuickBarIndexSaved;
11572
11573 if (!ctx.
Read(hasQuickBarIndexSaved))
11574 {
11576 return false;
11577 }
11578
11579 if (hasQuickBarIndexSaved)
11580 {
11581 int itmQBIndex;
11582
11583
11584 if (!ctx.
Read(itmQBIndex))
11585 {
11587 return false;
11588 }
11589
11590 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11591 if (itmQBIndex != -1 && parentPlayer)
11592 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11593 }
11594 }
11595 else
11596 {
11597
11598 PlayerBase player;
11599 int itemQBIndex;
11600 if (version ==
int.
MAX)
11601 {
11602 if (!ctx.
Read(itemQBIndex))
11603 {
11605 return false;
11606 }
11607 }
11608 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11609 {
11610
11611 if (!ctx.
Read(itemQBIndex))
11612 {
11614 return false;
11615 }
11616 if (itemQBIndex != -1 && player)
11617 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11618 }
11619 }
11620
11621 if (version < 140)
11622 {
11623
11624 if (!LoadVariables(ctx, version))
11625 {
11627 return false;
11628 }
11629 }
11630
11631
11633 {
11635 return false;
11636 }
11637 if (version >= 132)
11638 {
11640 if (raib)
11641 {
11643 {
11645 return false;
11646 }
11647 }
11648 }
11649
11651 return true;
11652 }
11653
11654
11655
11657 {
11658 super.OnStoreSave(ctx);
11659
11660 PlayerBase player;
11661 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11662 {
11664
11665 int itemQBIndex = -1;
11666 itemQBIndex = player.FindQuickBarEntityIndex(this);
11667 ctx.
Write(itemQBIndex);
11668 }
11669 else
11670 {
11672 }
11673
11675
11677 if (raib)
11678 {
11680 }
11681 }
11682
11683
11685 {
11686 super.AfterStoreLoad();
11687
11689 {
11691 }
11692
11694 {
11697 }
11698 }
11699
11701 {
11702 super.EEOnAfterLoad();
11703
11705 {
11707 }
11708
11711 }
11712
11714 {
11715 return false;
11716 }
11717
11718
11719
11721 {
11723 {
11724 #ifdef PLATFORM_CONSOLE
11725
11727 {
11729 if (menu)
11730 {
11732 }
11733 }
11734 #endif
11735 }
11736
11738 {
11741 }
11742
11744 {
11745 SetWeightDirty();
11747 }
11749 {
11752 }
11753
11755 {
11758 }
11760 {
11763 }
11764
11765 super.OnVariablesSynchronized();
11766 }
11767
11768
11769
11771 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11772 {
11773 if (!IsServerCheck(allow_client))
11774 return false;
11775
11777 return false;
11778
11781
11782 if (value <= (min + 0.001))
11783 value = min;
11784
11785 if (value == min)
11786 {
11787 if (destroy_config)
11788 {
11789 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11790 if (dstr)
11791 {
11793 this.Delete();
11794 return true;
11795 }
11796 }
11797 else if (destroy_forced)
11798 {
11800 this.Delete();
11801 return true;
11802 }
11803
11805 }
11806
11809
11811 {
11813
11814 if (delta)
11816 }
11817
11819
11820 return false;
11821 }
11822
11823
11825 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11826 {
11828 }
11829
11831 {
11834 }
11835
11837 {
11840 }
11841
11843 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11844 {
11845 float value_clamped = Math.Clamp(value, 0, 1);
11847 SetQuantity(result, destroy_config, destroy_forced);
11848 }
11849
11850
11853 {
11855 }
11856
11858 {
11860 }
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11872 {
11873 int slot = -1;
11874 if (GetInventory())
11875 {
11876 InventoryLocation il = new InventoryLocation;
11877 GetInventory().GetCurrentInventoryLocation(il);
11879 }
11880
11882 }
11883
11885 {
11886 float quantity_max = 0;
11887
11889 {
11890 if (attSlotID != -1)
11891 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11892
11893 if (quantity_max <= 0)
11895 }
11896
11897 if (quantity_max <= 0)
11899
11900 return quantity_max;
11901 }
11902
11904 {
11906 }
11907
11909 {
11911 }
11912
11913
11915 {
11917 }
11918
11920 {
11922 }
11923
11925 {
11927 }
11928
11929
11931 {
11932
11933 float weightEx = GetWeightEx();
11934 float special = GetInventoryAndCargoWeight();
11935 return weightEx - special;
11936 }
11937
11938
11940 {
11942 }
11943
11945 {
11947 {
11948 #ifdef DEVELOPER
11949 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11950 {
11951 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
11953 }
11954 #endif
11955
11956 return GetQuantity() * GetConfigWeightModified();
11957 }
11958 else if (HasEnergyManager())
11959 {
11960 #ifdef DEVELOPER
11961 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11962 {
11963 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
11964 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
11965 }
11966 #endif
11967 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
11968 }
11969 else
11970 {
11971 #ifdef DEVELOPER
11972 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11973 {
11974 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
11975 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
11976 }
11977 #endif
11978 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
11979 }
11980 }
11981
11984 {
11985 int item_count = 0;
11987
11988 if (GetInventory().GetCargo() != NULL)
11989 {
11990 item_count = GetInventory().GetCargo().GetItemCount();
11991 }
11992
11993 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
11994 {
11995 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
11996 if (item)
11997 item_count += item.GetNumberOfItems();
11998 }
11999 return item_count;
12000 }
12001
12004 {
12005 float weight = 0;
12006 float wetness = 1;
12007 if (include_wetness)
12010 {
12011 weight = wetness * m_ConfigWeight;
12012 }
12014 {
12015 weight = 1;
12016 }
12017 return weight;
12018 }
12019
12020
12021
12023 {
12024 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12025 {
12026 GameInventory inv = GetInventory();
12027 array<EntityAI> items = new array<EntityAI>;
12029 for (int i = 0; i < items.Count(); i++)
12030 {
12032 if (item)
12033 {
12035 }
12036 }
12037 }
12038 }
12039
12040
12041
12042
12044 {
12045 float energy = 0;
12046 if (HasEnergyManager())
12047 {
12048 energy = GetCompEM().GetEnergy();
12049 }
12050 return energy;
12051 }
12052
12053
12055 {
12056 super.OnEnergyConsumed();
12057
12059 }
12060
12062 {
12063 super.OnEnergyAdded();
12064
12066 }
12067
12068
12070 {
12071 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12072 {
12074 {
12075 float energy_0to1 = GetCompEM().GetEnergy0To1();
12077 }
12078 }
12079 }
12080
12081
12083 {
12084 return ConfigGetFloat("heatIsolation");
12085 }
12086
12088 {
12090 }
12091
12093 {
12094 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12095 if (
GetGame().ConfigIsExisting(paramPath))
12097
12098 return 0.0;
12099 }
12100
12102 {
12103 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12104 if (
GetGame().ConfigIsExisting(paramPath))
12106
12107 return 0.0;
12108 }
12109
12110 override void SetWet(
float value,
bool allow_client =
false)
12111 {
12112 if (!IsServerCheck(allow_client))
12113 return;
12114
12117
12119
12120 m_VarWet = Math.Clamp(value, min, max);
12121
12123 {
12126 }
12127 }
12128
12129 override void AddWet(
float value)
12130 {
12132 }
12133
12135 {
12137 }
12138
12140 {
12142 }
12143
12145 {
12147 }
12148
12150 {
12152 }
12153
12155 {
12157 }
12158
12159 override void OnWetChanged(
float newVal,
float oldVal)
12160 {
12163 if (newLevel != oldLevel)
12164 {
12166 }
12167 }
12168
12170 {
12171 SetWeightDirty();
12172 }
12173
12175 {
12176 return GetWetLevelInternal(
m_VarWet);
12177 }
12178
12179
12180
12182 {
12184 }
12185
12187 {
12189 }
12190
12192 {
12194 }
12195
12197 {
12199 }
12200
12201
12202
12204 {
12205 if (ConfigIsExisting("itemModelLength"))
12206 {
12207 return ConfigGetFloat("itemModelLength");
12208 }
12209 return 0;
12210 }
12211
12213 {
12214 if (ConfigIsExisting("itemAttachOffset"))
12215 {
12216 return ConfigGetFloat("itemAttachOffset");
12217 }
12218 return 0;
12219 }
12220
12221 override void SetCleanness(
int value,
bool allow_client =
false)
12222 {
12223 if (!IsServerCheck(allow_client))
12224 return;
12225
12227
12229
12232 }
12233
12235 {
12237 }
12238
12240 {
12241 return true;
12242 }
12243
12244
12245
12246
12248 {
12250 }
12251
12253 {
12255 }
12256
12257
12258
12259
12260 override void SetColor(
int r,
int g,
int b,
int a)
12261 {
12267 }
12269 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12270 {
12275 }
12276
12278 {
12280 }
12281
12284 {
12285 int r,g,b,a;
12287 r = r/255;
12288 g = g/255;
12289 b = b/255;
12290 a = a/255;
12291 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12292 }
12293
12294
12295
12296 override void SetLiquidType(
int value,
bool allow_client =
false)
12297 {
12298 if (!IsServerCheck(allow_client))
12299 return;
12300
12305 }
12306
12308 {
12309 return ConfigGetInt("varLiquidTypeInit");
12310 }
12311
12313 {
12315 }
12316
12318 {
12320 SetFrozen(false);
12321 }
12322
12325 {
12326 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12327 }
12328
12329
12332 {
12333 PlayerBase nplayer;
12334 if (PlayerBase.CastTo(nplayer, player))
12335 {
12337
12338 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12339 }
12340 }
12341
12342
12345 {
12346 PlayerBase nplayer;
12347 if (PlayerBase.CastTo(nplayer,player))
12348 {
12349
12350 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12351
12352 }
12353
12354
12355 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12356
12357
12358 if (HasEnergyManager())
12359 {
12360 GetCompEM().UpdatePlugState();
12361 }
12362 }
12363
12364
12366 {
12367 super.OnPlacementStarted(player);
12368
12370 }
12371
12372 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12373 {
12375 {
12376 m_AdminLog.OnPlacementComplete(player,
this);
12377 }
12378
12379 super.OnPlacementComplete(player, position, orientation);
12380 }
12381
12382
12383
12384
12385
12387 {
12389 {
12390 return true;
12391 }
12392 else
12393 {
12394 return false;
12395 }
12396 }
12397
12398
12400 {
12402 {
12404 }
12405 }
12406
12407
12409 {
12411 }
12412
12414 {
12416 }
12417
12418 override void InsertAgent(
int agent,
float count = 1)
12419 {
12420 if (count < 1)
12421 return;
12422
12424 }
12425
12428 {
12430 }
12431
12432
12434 {
12436 }
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12480 {
12482 return false;
12483 return true;
12484 }
12485
12487 {
12488
12490 }
12491
12492
12495 {
12496 super.CheckForRoofLimited(timeTresholdMS);
12497
12499 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12500 {
12501 m_PreviousRoofTestTime = time;
12502 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12503 }
12504 }
12505
12506
12508 {
12510 {
12511 return 0;
12512 }
12513
12514 if (GetInventory().GetAttachmentSlotsCount() != 0)
12515 {
12516 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12517 if (filter)
12518 return filter.GetProtectionLevel(type, false, system);
12519 else
12520 return 0;
12521 }
12522
12523 string subclassPath, entryName;
12524
12525 switch (type)
12526 {
12528 entryName = "biological";
12529 break;
12531 entryName = "chemical";
12532 break;
12533 default:
12534 entryName = "biological";
12535 break;
12536 }
12537
12538 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12539
12541 }
12542
12543
12544
12547 {
12548 if (!IsMagazine())
12550
12552 }
12553
12554
12555
12556
12557
12562 {
12563 return true;
12564 }
12565
12567 {
12569 }
12570
12571
12572
12573
12574
12576 {
12577 if (parent)
12578 {
12579 if (parent.IsInherited(DayZInfected))
12580 return true;
12581
12582 if (!parent.IsRuined())
12583 return true;
12584 }
12585
12586 return true;
12587 }
12588
12590 {
12591 if (!super.CanPutAsAttachment(parent))
12592 {
12593 return false;
12594 }
12595
12596 if (!IsRuined() && !parent.IsRuined())
12597 {
12598 return true;
12599 }
12600
12601 return false;
12602 }
12603
12605 {
12606
12607
12608
12609
12610 return super.CanReceiveItemIntoCargo(item);
12611 }
12612
12614 {
12615
12616
12617
12618
12619 GameInventory attachmentInv = attachment.GetInventory();
12621 {
12622 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12623 return false;
12624 }
12625
12626 InventoryLocation loc = new InventoryLocation();
12627 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12628 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12629 return false;
12630
12631 return super.CanReceiveAttachment(attachment, slotId);
12632 }
12633
12635 {
12636 if (!super.CanReleaseAttachment(attachment))
12637 return false;
12638
12639 return GetInventory().AreChildrenAccessible();
12640 }
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12663 {
12664 int id = muzzle_owner.GetMuzzleID();
12665 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12666
12667 if (WPOF_array)
12668 {
12669 for (int i = 0; i < WPOF_array.Count(); i++)
12670 {
12671 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12672
12673 if (WPOF)
12674 {
12675 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12676 }
12677 }
12678 }
12679 }
12680
12681
12683 {
12684 int id = muzzle_owner.GetMuzzleID();
12686
12687 if (WPOBE_array)
12688 {
12689 for (int i = 0; i < WPOBE_array.Count(); i++)
12690 {
12691 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12692
12693 if (WPOBE)
12694 {
12695 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12696 }
12697 }
12698 }
12699 }
12700
12701
12703 {
12704 int id = muzzle_owner.GetMuzzleID();
12705 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12706
12707 if (WPOOH_array)
12708 {
12709 for (int i = 0; i < WPOOH_array.Count(); i++)
12710 {
12711 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12712
12713 if (WPOOH)
12714 {
12715 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12716 }
12717 }
12718 }
12719 }
12720
12721
12723 {
12724 int id = muzzle_owner.GetMuzzleID();
12725 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12726
12727 if (WPOOH_array)
12728 {
12729 for (int i = 0; i < WPOOH_array.Count(); i++)
12730 {
12731 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12732
12733 if (WPOOH)
12734 {
12735 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12736 }
12737 }
12738 }
12739 }
12740
12741
12743 {
12744 int id = muzzle_owner.GetMuzzleID();
12745 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12746
12747 if (WPOOH_array)
12748 {
12749 for (int i = 0; i < WPOOH_array.Count(); i++)
12750 {
12751 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12752
12753 if (WPOOH)
12754 {
12755 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12756 }
12757 }
12758 }
12759 }
12760
12761
12762
12764 {
12766 {
12767 return true;
12768 }
12769
12770 return false;
12771 }
12772
12774 {
12776 {
12777 return true;
12778 }
12779
12780 return false;
12781 }
12782
12784 {
12786 {
12787 return true;
12788 }
12789
12790 return false;
12791 }
12792
12794 {
12795 return false;
12796 }
12797
12800 {
12801 return UATimeSpent.DEFAULT_DEPLOY;
12802 }
12803
12804
12805
12806
12808 {
12810 SetSynchDirty();
12811 }
12812
12814 {
12816 }
12817
12818
12820 {
12821 return false;
12822 }
12823
12826 {
12827 string att_type = "None";
12828
12829 if (ConfigIsExisting("soundAttType"))
12830 {
12831 att_type = ConfigGetString("soundAttType");
12832 }
12833
12835 }
12836
12838 {
12840 }
12841
12842
12843
12844
12845
12851
12853 {
12856
12858 }
12859
12860
12862 {
12864 return;
12865
12867
12870
12873
12874 SoundParameters params = new SoundParameters();
12878 }
12879
12880
12882 {
12884 return;
12885
12887 SetSynchDirty();
12888
12891 }
12892
12893
12895 {
12897 return;
12898
12900 SetSynchDirty();
12901
12904 }
12905
12907 {
12909 }
12910
12912 {
12914 }
12915
12918 {
12919 if (!
GetGame().IsDedicatedServer())
12920 {
12921 if (ConfigIsExisting("attachSoundSet"))
12922 {
12923 string cfg_path = "";
12924 string soundset = "";
12925 string type_name =
GetType();
12926
12929 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12930 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12931
12932 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12933 {
12934 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12935 {
12936 if (cfg_slot_array[i] == slot_type)
12937 {
12938 soundset = cfg_soundset_array[i];
12939 break;
12940 }
12941 }
12942 }
12943
12944 if (soundset != "")
12945 {
12946 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12948 }
12949 }
12950 }
12951 }
12952
12954 {
12955
12956 }
12957
12958 void OnApply(PlayerBase player);
12959
12961 {
12962 return 1.0;
12963 };
12964
12966 {
12968 }
12969
12971 {
12973 }
12974
12976
12978 {
12979 SetDynamicPhysicsLifeTime(0.01);
12981 }
12982
12984 {
12985 array<string> zone_names = new array<string>;
12986 GetDamageZones(zone_names);
12987 for (int i = 0; i < zone_names.Count(); i++)
12988 {
12989 SetHealthMax(zone_names.Get(i),"Health");
12990 }
12991 SetHealthMax("","Health");
12992 }
12993
12996 {
12997 float global_health = GetHealth01("","Health");
12998 array<string> zones = new array<string>;
12999 GetDamageZones(zones);
13000
13001 for (int i = 0; i < zones.Count(); i++)
13002 {
13003 SetHealth01(zones.Get(i),"Health",global_health);
13004 }
13005 }
13006
13009 {
13010 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13011 }
13012
13014 {
13015 if (!hasRootAsPlayer)
13016 {
13017 if (refParentIB)
13018 {
13019
13020 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13021 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13022
13023 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13024 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13025
13028 }
13029 else
13030 {
13031
13034 }
13035 }
13036 }
13037
13039 {
13041 {
13042 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13043 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13044 {
13045 float heatPermCoef = 1.0;
13047 while (ent)
13048 {
13049 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13050 ent = ent.GetHierarchyParent();
13051 }
13052
13053 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13054 }
13055 }
13056 }
13057
13059 {
13060
13061 EntityAI parent = GetHierarchyParent();
13062 if (!parent)
13063 {
13064 hasParent = false;
13065 hasRootAsPlayer = false;
13066 }
13067 else
13068 {
13069 hasParent = true;
13070 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13071 refParentIB =
ItemBase.Cast(parent);
13072 }
13073 }
13074
13075 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13076 {
13077
13078 }
13079
13081 {
13082
13083 return false;
13084 }
13085
13087 {
13088
13089
13090 return false;
13091 }
13092
13094 {
13095
13096 return false;
13097 }
13098
13101 {
13102 return !GetIsFrozen() &&
IsOpen();
13103 }
13104
13106 {
13107 bool hasParent = false, hasRootAsPlayer = false;
13109
13110 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13111 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13112
13113 if (wwtu || foodDecay)
13114 {
13118
13119 if (processWetness || processTemperature || processDecay)
13120 {
13122
13123 if (processWetness)
13124 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13125
13126 if (processTemperature)
13128
13129 if (processDecay)
13130 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13131 }
13132 }
13133 }
13134
13137 {
13139 }
13140
13142 {
13145
13146 return super.GetTemperatureFreezeThreshold();
13147 }
13148
13150 {
13153
13154 return super.GetTemperatureThawThreshold();
13155 }
13156
13158 {
13161
13162 return super.GetItemOverheatThreshold();
13163 }
13164
13166 {
13168 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13169
13170 return super.GetTemperatureFreezeTime();
13171 }
13172
13174 {
13176 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13177
13178 return super.GetTemperatureThawTime();
13179 }
13180
13185
13187 {
13188 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13189 }
13190
13192 {
13193 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13194 }
13195
13198 {
13200 }
13201
13203 {
13205 }
13206
13208 {
13210 }
13211
13214 {
13215 return null;
13216 }
13217
13220 {
13221 return false;
13222 }
13223
13225 {
13227 {
13230 if (!trg)
13231 {
13233 explosive = this;
13234 }
13235
13236 explosive.PairRemote(trg);
13238
13239 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13240 trg.SetPersistentPairID(persistentID);
13241 explosive.SetPersistentPairID(persistentID);
13242
13243 return true;
13244 }
13245 return false;
13246 }
13247
13250 {
13251 float ret = 1.0;
13254 ret *= GetHealth01();
13255
13256 return ret;
13257 }
13258
13259 #ifdef DEVELOPER
13260 override void SetDebugItem()
13261 {
13262 super.SetDebugItem();
13263 _itemBase = this;
13264 }
13265
13267 {
13268 string text = super.GetDebugText();
13269
13271 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13272
13273 return text;
13274 }
13275 #endif
13276
13278 {
13279 return true;
13280 }
13281
13283
13285
13287 {
13290 }
13291
13292
13300
13316}
13317
13319{
13321 if (entity)
13322 {
13323 bool is_item = entity.IsInherited(
ItemBase);
13324 if (is_item && full_quantity)
13325 {
13328 }
13329 }
13330 else
13331 {
13333 return NULL;
13334 }
13335 return entity;
13336}
13337
13339{
13340 if (item)
13341 {
13342 if (health > 0)
13343 item.SetHealth("", "", health);
13344
13345 if (item.CanHaveTemperature())
13346 {
13348 if (item.CanFreeze())
13349 item.SetFrozen(false);
13350 }
13351
13352 if (item.HasEnergyManager())
13353 {
13354 if (quantity >= 0)
13355 {
13356 item.GetCompEM().SetEnergy0To1(quantity);
13357 }
13358 else
13359 {
13361 }
13362 }
13363 else if (item.IsMagazine())
13364 {
13365 Magazine mag = Magazine.Cast(item);
13366 if (quantity >= 0)
13367 {
13368 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13369 }
13370 else
13371 {
13373 }
13374
13375 }
13376 else
13377 {
13378 if (quantity >= 0)
13379 {
13380 item.SetQuantityNormalized(quantity, false);
13381 }
13382 else
13383 {
13385 }
13386
13387 }
13388 }
13389}
13390
13391#ifdef DEVELOPER
13393#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.