8515{
8517 {
8518 return true;
8519 }
8520};
8521
8522
8523
8525{
8529
8531
8534
8535
8536
8537
8538
8547
8553
8558
8563
8584 protected bool m_IsResultOfSplit
8585
8587
8592
8593
8594
8596
8600
8601
8602
8604
8607
8608
8609
8615
8616
8624
8627
8628
8630
8631
8633
8634
8639
8640
8645
8646
8648
8649
8651 {
8656
8657 if (!
GetGame().IsDedicatedServer())
8658 {
8660 {
8662
8664 {
8666 }
8667 }
8668
8671 }
8672
8673 m_OldLocation = null;
8674
8676 {
8678 }
8679
8680 if (ConfigIsExisting("headSelectionsToHide"))
8681 {
8684 }
8685
8687 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
8688 {
8690 }
8691
8693
8694 m_IsResultOfSplit = false;
8695
8697 }
8698
8700 {
8701 super.InitItemVariables();
8702
8708 m_Count = ConfigGetInt(
"count");
8709
8712
8717
8720
8725
8737
8741
8742
8745 if (ConfigIsExisting("canBeSplit"))
8746 {
8749 }
8750
8752 if (ConfigIsExisting("itemBehaviour"))
8754
8755
8758 RegisterNetSyncVariableInt("m_VarLiquidType");
8759 RegisterNetSyncVariableInt("m_Cleanness",0,1);
8760
8761 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
8762 RegisterNetSyncVariableFloat("m_ImpactSpeed");
8763 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
8764
8765 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
8766 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
8767 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
8768 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
8769
8770 RegisterNetSyncVariableBool("m_IsBeingPlaced");
8771 RegisterNetSyncVariableBool("m_IsTakeable");
8772 RegisterNetSyncVariableBool("m_IsHologram");
8773
8776 {
8779 }
8780
8782
8784 if (ConfigIsExisting("temperaturePerQuantityWeight"))
8786
8787 }
8788
8790 {
8792 }
8793
8795 {
8798 {
8803 }
8804 }
8805
8806 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
8807 {
8809 {
8812 }
8813
8815 }
8816
8818 {
8824 }
8825
8827
8829 {
8831
8832 if (!action)
8833 {
8834 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
8835 return;
8836 }
8837
8839 if (!ai)
8840 {
8842 return;
8843 }
8844
8846 if (!action_array)
8847 {
8848 action_array = new array<ActionBase_Basic>;
8850 }
8851 if (LogManager.IsActionLogEnable())
8852 {
8853 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
8854 }
8855
8856 if (action_array.Find(action) != -1)
8857 {
8858 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
8859 }
8860 else
8861 {
8862 action_array.Insert(action);
8863 }
8864 }
8865
8867 {
8869 ActionBase action = player.GetActionManager().GetAction(actionName);
8872
8873 if (action_array)
8874 {
8875 action_array.RemoveItem(action);
8876 }
8877 }
8878
8879
8880
8882 {
8883 ActionOverrideData overrideData = new ActionOverrideData();
8887
8889 if (!actionMap)
8890 {
8893 }
8894
8895 actionMap.Insert(this.
Type(), overrideData);
8896
8897 }
8898
8900
8902
8903
8905 {
8908
8911
8912 string config_to_search = "CfgVehicles";
8913 string muzzle_owner_config;
8914
8916 {
8917 if (IsInherited(Weapon))
8918 config_to_search = "CfgWeapons";
8919
8920 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8921
8922 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
8923
8925
8926 if (config_OnFire_subclass_count > 0)
8927 {
8928 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
8929
8930 for (int i = 0; i < config_OnFire_subclass_count; i++)
8931 {
8932 string particle_class = "";
8934 string config_OnFire_entry = config_OnFire_class + particle_class;
8935 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
8936 WPOF_array.Insert(WPOF);
8937 }
8938
8939
8941 }
8942 }
8943
8945 {
8946 config_to_search = "CfgWeapons";
8947 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8948
8949 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
8950
8952
8953 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
8954 {
8955 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
8956
8957 for (i = 0; i < config_OnBulletCasingEject_count; i++)
8958 {
8959 string particle_class2 = "";
8961 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
8962 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
8963 WPOBE_array.Insert(WPOBE);
8964 }
8965
8966
8968 }
8969 }
8970 }
8971
8972
8974 {
8977
8979 {
8980 string config_to_search = "CfgVehicles";
8981
8982 if (IsInherited(Weapon))
8983 config_to_search = "CfgWeapons";
8984
8985 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
8986 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
8987
8988 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
8989 {
8990
8992
8994 {
8996 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
8998 return;
8999 }
9000
9003
9004
9005
9007 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
9008
9009 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
9010 {
9011 string particle_class = "";
9013 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
9015
9016 if (entry_type == CT_CLASS)
9017 {
9018 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
9019 WPOOH_array.Insert(WPOF);
9020 }
9021 }
9022
9023
9025 }
9026 }
9027 }
9028
9030 {
9032 }
9033
9035 {
9037 {
9039
9042
9045
9046 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9047 }
9048 }
9049
9051 {
9053 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9054
9056 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9057
9059 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9060
9062 {
9064 }
9065 }
9066
9068 {
9070 }
9071
9073 {
9076 else
9078
9080 {
9083 }
9084 else
9085 {
9088
9091 }
9092
9094 }
9095
9097 {
9099 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9100 }
9101
9103 {
9105 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
9107 }
9108
9110 {
9112 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
9113 }
9114
9116 {
9119
9120 OverheatingParticle OP = new OverheatingParticle();
9125
9127 }
9128
9130 {
9133
9134 return -1;
9135 }
9136
9138 {
9140 {
9143
9144 for (int i = count; i > 0; --i)
9145 {
9146 int id = i - 1;
9149
9152
9153 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
9154 {
9155 if (p)
9156 {
9159 }
9160 }
9161 }
9162 }
9163 }
9164
9166 {
9168 {
9170 {
9171 int id = i - 1;
9173
9174 if (OP)
9175 {
9177
9178 if (p)
9179 {
9181 }
9182
9183 delete OP;
9184 }
9185 }
9186
9189 }
9190 }
9191
9194 {
9195 return 0.0;
9196 }
9197
9198
9200 {
9201 return 250;
9202 }
9203
9205 {
9206 return 0;
9207 }
9208
9211 {
9213 return true;
9214
9215 return false;
9216 }
9217
9220 {
9223
9225 {
9227 }
9228 else
9229 {
9230
9232 }
9233
9235 }
9236
9243 {
9244 return -1;
9245 }
9246
9247
9248
9249
9251 {
9253 {
9255 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9256
9257 if (r_index >= 0)
9258 {
9259 InventoryLocation r_il = new InventoryLocation;
9260 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9261
9262 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9265 {
9266 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9267 }
9269 {
9270 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9271 }
9272
9273 }
9274
9275 player.GetHumanInventory().ClearUserReservedLocation(this);
9276 }
9277
9280 }
9281
9282
9283
9284
9286 {
9287 return ItemBase.m_DebugActionsMask;
9288 }
9289
9291 {
9292 return ItemBase.m_DebugActionsMask & mask;
9293 }
9294
9296 {
9297 ItemBase.m_DebugActionsMask = mask;
9298 }
9299
9301 {
9302 ItemBase.m_DebugActionsMask |= mask;
9303 }
9304
9306 {
9307 ItemBase.m_DebugActionsMask &= ~mask;
9308 }
9309
9311 {
9313 {
9315 }
9316 else
9317 {
9319 }
9320 }
9321
9322
9324 {
9325 if (GetEconomyProfile())
9326 {
9327 float q_max = GetEconomyProfile().GetQuantityMax();
9328 if (q_max > 0)
9329 {
9330 float q_min = GetEconomyProfile().GetQuantityMin();
9331 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
9332
9334 {
9335 ComponentEnergyManager comp = GetCompEM();
9337 {
9339 }
9340 }
9342 {
9344
9345 }
9346
9347 }
9348 }
9349 }
9350
9353 {
9354 EntityAI parent = GetHierarchyParent();
9355
9356 if (parent)
9357 {
9358 InventoryLocation inventory_location_to_lock = new InventoryLocation;
9359 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
9360 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
9361 }
9362 }
9363
9366 {
9367 EntityAI parent = GetHierarchyParent();
9368
9369 if (parent)
9370 {
9371 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
9372 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
9373 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
9374 }
9375 }
9376
9378 {
9379
9380
9381
9382
9384
9386 {
9387 if (ScriptInputUserData.CanStoreInputUserData())
9388 {
9389 ScriptInputUserData ctx = new ScriptInputUserData;
9395 ctx.
Write(use_stack_max);
9398
9400 {
9401 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
9402 }
9403 }
9404 }
9405 else if (!
GetGame().IsMultiplayer())
9406 {
9408 }
9409 }
9410
9412 {
9414 }
9415
9417 {
9419 }
9420
9422 {
9424 }
9425
9427 {
9428
9429 return false;
9430 }
9431
9433 {
9434 return false;
9435 }
9436
9440 {
9441 return false;
9442 }
9443
9445 {
9446 return "";
9447 }
9448
9450
9452 {
9453 return false;
9454 }
9455
9457 {
9458 return true;
9459 }
9460
9461
9462
9464 {
9465 return true;
9466 }
9467
9469 {
9470 return true;
9471 }
9472
9474 {
9475 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
9477 }
9478
9480 {
9482 }
9483
9485 {
9487 if (!is_being_placed)
9489 SetSynchDirty();
9490 }
9491
9492
9494
9496 {
9498 }
9499
9501 {
9503 }
9504
9506 {
9507 return 1;
9508 }
9509
9511 {
9512 return false;
9513 }
9514
9516 {
9518 SetSynchDirty();
9519 }
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9556 {
9557 super.OnMovedInsideCargo(container);
9558
9559 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9560 }
9561
9562 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
9563 {
9564 super.EEItemLocationChanged(oldLoc,newLoc);
9565
9566 PlayerBase new_player = null;
9567 PlayerBase old_player = null;
9568
9569 if (newLoc.GetParent())
9570 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
9571
9572 if (oldLoc.GetParent())
9573 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
9574
9576 {
9577 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
9578
9579 if (r_index >= 0)
9580 {
9581 InventoryLocation r_il = new InventoryLocation;
9582 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9583
9584 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9587 {
9588 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9589 }
9591 {
9592 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9593 }
9594
9595 }
9596 }
9597
9599 {
9600 if (new_player)
9601 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
9602
9603 if (new_player == old_player)
9604 {
9605
9606 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
9607 {
9609 {
9610 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
9611 {
9612 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9613 }
9614 }
9615 else
9616 {
9617 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
9618 }
9619 }
9620
9621 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
9622 {
9623 int type = oldLoc.GetType();
9625 {
9626 oldLoc.GetParent().GetOnSetLock().Invoke(this);
9627 }
9629 {
9630 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
9631 }
9632 }
9633 if (!m_OldLocation)
9634 {
9635 m_OldLocation = new InventoryLocation;
9636 }
9637 m_OldLocation.Copy(oldLoc);
9638 }
9639 else
9640 {
9641 if (m_OldLocation)
9642 {
9643 m_OldLocation.Reset();
9644 }
9645 }
9646
9648 }
9649 else
9650 {
9651 if (new_player)
9652 {
9653 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
9654 if (res_index >= 0)
9655 {
9656 InventoryLocation il = new InventoryLocation;
9657 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
9659 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
9662 {
9663 il.
GetParent().GetOnReleaseLock().Invoke(it);
9664 }
9666 {
9668 }
9669
9670 }
9671 }
9673 {
9674
9676 }
9677
9678 if (m_OldLocation)
9679 {
9680 m_OldLocation.Reset();
9681 }
9682 }
9683 }
9684
9685 override void EOnContact(IEntity other, Contact extra)
9686 {
9688 {
9689 int liquidType = -1;
9691 if (impactSpeed > 0.0)
9692 {
9694 #ifndef SERVER
9696 #else
9698 SetSynchDirty();
9699 #endif
9701 }
9702 }
9703
9704 #ifdef SERVER
9705 if (GetCompEM() && GetCompEM().IsPlugged())
9706 {
9707 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
9708 GetCompEM().UnplugThis();
9709 }
9710 #endif
9711 }
9712
9714
9716 {
9718 }
9719
9721 {
9722
9723 }
9724
9726 {
9727 super.OnItemLocationChanged(old_owner, new_owner);
9728
9729 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
9730 PlayerBase playerNew = PlayerBase.Cast(new_owner);
9731
9732 if (!relatedPlayer && playerNew)
9733 relatedPlayer = playerNew;
9734
9735 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
9736 {
9738 if (actionMgr)
9739 {
9740 ActionBase currentAction = actionMgr.GetRunningAction();
9741 if (currentAction)
9743 }
9744 }
9745
9746 Man ownerPlayerOld = null;
9747 Man ownerPlayerNew = null;
9748
9749 if (old_owner)
9750 {
9751 if (old_owner.
IsMan())
9752 {
9753 ownerPlayerOld = Man.Cast(old_owner);
9754 }
9755 else
9756 {
9757 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
9758 }
9759 }
9760 else
9761 {
9763 {
9765
9766 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
9767 {
9768 GetCompEM().UnplugThis();
9769 }
9770 }
9771 }
9772
9773 if (new_owner)
9774 {
9775 if (new_owner.
IsMan())
9776 {
9777 ownerPlayerNew = Man.Cast(new_owner);
9778 }
9779 else
9780 {
9781 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
9782 }
9783 }
9784
9785 if (ownerPlayerOld != ownerPlayerNew)
9786 {
9787 if (ownerPlayerOld)
9788 {
9789 array<EntityAI> subItemsExit = new array<EntityAI>;
9791 for (int i = 0; i < subItemsExit.Count(); i++)
9792 {
9795 }
9796 }
9797
9798 if (ownerPlayerNew)
9799 {
9800 array<EntityAI> subItemsEnter = new array<EntityAI>;
9802 for (int j = 0; j < subItemsEnter.Count(); j++)
9803 {
9806 }
9807 }
9808 }
9809 else if (ownerPlayerNew != null)
9810 {
9811 PlayerBase nplayer;
9812 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
9813 {
9814 array<EntityAI> subItemsUpdate = new array<EntityAI>;
9816 for (int k = 0; k < subItemsUpdate.Count(); k++)
9817 {
9819 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
9820 }
9821 }
9822 }
9823
9824 if (old_owner)
9825 old_owner.OnChildItemRemoved(this);
9826 if (new_owner)
9827 new_owner.OnChildItemReceived(this);
9828 }
9829
9830
9832 {
9833 super.EEDelete(parent);
9834 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
9835 if (player)
9836 {
9838
9839 if (player.IsAlive())
9840 {
9841 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
9842 if (r_index >= 0)
9843 {
9844 InventoryLocation r_il = new InventoryLocation;
9845 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
9846
9847 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
9850 {
9851 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
9852 }
9854 {
9855 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
9856 }
9857
9858 }
9859
9860 player.RemoveQuickBarEntityShortcut(this);
9861 }
9862 }
9863 }
9864
9866 {
9867 super.EEKilled(killer);
9868
9871 {
9872 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
9873 {
9874 if (IsMagazine())
9875 {
9876 if (Magazine.Cast(this).GetAmmoCount() > 0)
9877 {
9879 }
9880 }
9881 else
9882 {
9884 }
9885 }
9886 }
9887 }
9888
9890 {
9891 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
9892
9893 super.OnWasAttached(parent, slot_id);
9894
9897
9899 }
9900
9902 {
9903 super.OnWasDetached(parent, slot_id);
9904
9907 }
9908
9910 {
9911 int idx;
9914
9915 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9916 if (inventory_slots.Count() < 1)
9917 {
9918 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
9919 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
9920 }
9921 else
9922 {
9923 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
9924 }
9925
9926 idx = inventory_slots.Find(slot);
9927 if (idx < 0)
9928 return "";
9929
9930 return attach_types.Get(idx);
9931 }
9932
9934 {
9935 int idx = -1;
9936 string slot;
9937
9940
9941 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
9942 if (inventory_slots.Count() < 1)
9943 {
9944 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
9945 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9946 }
9947 else
9948 {
9949 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
9950 if (detach_types.Count() < 1)
9951 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
9952 }
9953
9954 for (int i = 0; i < inventory_slots.Count(); i++)
9955 {
9956 slot = inventory_slots.Get(i);
9957 }
9958
9959 if (slot != "")
9960 {
9961 if (detach_types.Count() == 1)
9962 idx = 0;
9963 else
9964 idx = inventory_slots.Find(slot);
9965 }
9966 if (idx < 0)
9967 return "";
9968
9969 return detach_types.Get(idx);
9970 }
9971
9973 {
9974
9976
9977
9978 float min_time = 1;
9979 float max_time = 3;
9980 float delay = Math.RandomFloat(min_time, max_time);
9981
9982 explode_timer.Run(delay, this, "DoAmmoExplosion");
9983 }
9984
9986 {
9987 Magazine magazine = Magazine.Cast(this);
9988 int pop_sounds_count = 6;
9989 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
9990
9991
9992 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
9993 string sound_name = pop_sounds[ sound_idx ];
9995
9996
9997 magazine.ServerAddAmmoCount(-1);
9998
9999
10000 float min_temp_to_explode = 100;
10001
10002 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
10003 {
10005 }
10006 }
10007
10008
10009 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
10010 {
10011 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
10012
10013 const int CHANCE_DAMAGE_CARGO = 4;
10014 const int CHANCE_DAMAGE_ATTACHMENT = 1;
10015 const int CHANCE_DAMAGE_NOTHING = 2;
10016
10018 {
10019 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
10020 int chances;
10021 int rnd;
10022
10023 if (GetInventory().GetCargo())
10024 {
10025 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10026 rnd = Math.RandomInt(0,chances);
10027
10028 if (rnd < CHANCE_DAMAGE_CARGO)
10029 {
10031 }
10032 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
10033 {
10035 }
10036 }
10037 else
10038 {
10039 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
10040 rnd = Math.RandomInt(0,chances);
10041
10042 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
10043 {
10045 }
10046 }
10047 }
10048 }
10049
10051 {
10052 if (GetInventory().GetCargo())
10053 {
10054 int item_count = GetInventory().GetCargo().GetItemCount();
10055 if (item_count > 0)
10056 {
10057 int random_pick = Math.RandomInt(0, item_count);
10059 if (!item.IsExplosive())
10060 {
10061 item.AddHealth("","",damage);
10062 return true;
10063 }
10064 }
10065 }
10066 return false;
10067 }
10068
10070 {
10071 int attachment_count = GetInventory().AttachmentCount();
10072 if (attachment_count > 0)
10073 {
10074 int random_pick = Math.RandomInt(0, attachment_count);
10075 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
10076 if (!attachment.IsExplosive())
10077 {
10078 attachment.AddHealth("","",damage);
10079 return true;
10080 }
10081 }
10082 return false;
10083 }
10084
10086 {
10088 }
10089
10091 {
10093 return GetInventory().CanRemoveEntity();
10094
10095 return false;
10096 }
10097
10099 {
10100
10102 return false;
10103
10104
10106 return false;
10107
10108
10109
10111 if (delta == 0)
10112 return false;
10113
10114
10115 return true;
10116 }
10117
10119 {
10121 {
10122 if (ScriptInputUserData.CanStoreInputUserData())
10123 {
10124 ScriptInputUserData ctx = new ScriptInputUserData;
10129 ctx.
Write(destination_entity);
10131 ctx.
Write(slot_id);
10133 }
10134 }
10135 else if (!
GetGame().IsMultiplayer())
10136 {
10138 }
10139 }
10140
10142 {
10143 float split_quantity_new;
10147 InventoryLocation loc = new InventoryLocation;
10148
10149 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10150 {
10152 split_quantity_new = stack_max;
10153 else
10155
10157 {
10158 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10159 if (new_item)
10160 {
10161 new_item.SetResultOfSplit(true);
10162 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10164 new_item.
SetQuantity(split_quantity_new,
false,
true);
10165 }
10166 }
10167 }
10168 else if (destination_entity && slot_id == -1)
10169 {
10170 if (quantity > stack_max)
10171 split_quantity_new = stack_max;
10172 else
10173 split_quantity_new = quantity;
10174
10176 {
10178 {
10181 }
10182
10183 if (new_item)
10184 {
10185 new_item.SetResultOfSplit(true);
10186 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10188 new_item.
SetQuantity(split_quantity_new,
false,
true);
10189 }
10190 }
10191 }
10192 else
10193 {
10194 if (stack_max != 0)
10195 {
10197 {
10199 }
10200
10201 if (split_quantity_new == 0)
10202 {
10203 if (!
GetGame().IsMultiplayer())
10204 player.PhysicalPredictiveDropItem(this);
10205 else
10206 player.ServerDropEntity(this);
10207 return;
10208 }
10209
10211 {
10213
10214 if (new_item)
10215 {
10216 new_item.SetResultOfSplit(true);
10217 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10220 new_item.PlaceOnSurface();
10221 }
10222 }
10223 }
10224 }
10225 }
10226
10228 {
10229 float split_quantity_new;
10233 InventoryLocation loc = new InventoryLocation;
10234
10235 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
10236 {
10238 split_quantity_new = stack_max;
10239 else
10241
10243 {
10244 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
10245 if (new_item)
10246 {
10247 new_item.SetResultOfSplit(true);
10248 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10250 new_item.
SetQuantity(split_quantity_new,
false,
true);
10251 }
10252 }
10253 }
10254 else if (destination_entity && slot_id == -1)
10255 {
10256 if (quantity > stack_max)
10257 split_quantity_new = stack_max;
10258 else
10259 split_quantity_new = quantity;
10260
10262 {
10264 {
10267 }
10268
10269 if (new_item)
10270 {
10271 new_item.SetResultOfSplit(true);
10272 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10274 new_item.
SetQuantity(split_quantity_new,
false,
true);
10275 }
10276 }
10277 }
10278 else
10279 {
10280 if (stack_max != 0)
10281 {
10283 {
10285 }
10286
10288 {
10290
10291 if (new_item)
10292 {
10293 new_item.SetResultOfSplit(true);
10294 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10297 new_item.PlaceOnSurface();
10298 }
10299 }
10300 }
10301 }
10302 }
10303
10305 {
10307 {
10308 if (ScriptInputUserData.CanStoreInputUserData())
10309 {
10310 ScriptInputUserData ctx = new ScriptInputUserData;
10315 dst.WriteToContext(ctx);
10317 }
10318 }
10319 else if (!
GetGame().IsMultiplayer())
10320 {
10322 }
10323 }
10324
10326 {
10328 {
10329 if (ScriptInputUserData.CanStoreInputUserData())
10330 {
10331 ScriptInputUserData ctx = new ScriptInputUserData;
10336 ctx.
Write(destination_entity);
10342 }
10343 }
10344 else if (!
GetGame().IsMultiplayer())
10345 {
10347 }
10348 }
10349
10351 {
10353 }
10354
10356 {
10358 float split_quantity_new;
10360 if (dst.IsValid())
10361 {
10362 int slot_id = dst.GetSlot();
10364
10365 if (quantity > stack_max)
10366 split_quantity_new = stack_max;
10367 else
10368 split_quantity_new = quantity;
10369
10371 {
10373
10374 if (new_item)
10375 {
10376 new_item.SetResultOfSplit(true);
10377 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10379 new_item.
SetQuantity(split_quantity_new,
false,
true);
10380 }
10381
10382 return new_item;
10383 }
10384 }
10385
10386 return null;
10387 }
10388
10390 {
10392 float split_quantity_new;
10394 if (destination_entity)
10395 {
10397 if (quantity > stackable)
10398 split_quantity_new = stackable;
10399 else
10400 split_quantity_new = quantity;
10401
10403 {
10404 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
10405 if (new_item)
10406 {
10407 new_item.SetResultOfSplit(true);
10408 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10410 new_item.
SetQuantity(split_quantity_new,
false,
true);
10411 }
10412 }
10413 }
10414 }
10415
10417 {
10419 {
10420 if (ScriptInputUserData.CanStoreInputUserData())
10421 {
10422 ScriptInputUserData ctx = new ScriptInputUserData;
10427 ItemBase destination_entity =
this;
10428 ctx.
Write(destination_entity);
10432 }
10433 }
10434 else if (!
GetGame().IsMultiplayer())
10435 {
10437 }
10438 }
10439
10441 {
10443 float split_quantity_new;
10445 if (player)
10446 {
10448 if (quantity > stackable)
10449 split_quantity_new = stackable;
10450 else
10451 split_quantity_new = quantity;
10452
10454 {
10455 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
10456 new_item =
ItemBase.Cast(in_hands);
10457 if (new_item)
10458 {
10459 new_item.SetResultOfSplit(true);
10460 MiscGameplayFunctions.TransferItemProperties(this,new_item);
10462 new_item.SetQuantity(split_quantity_new, false, true);
10463 }
10464 }
10465 }
10466 }
10467
10469 {
10471 float split_quantity_new = Math.Floor(quantity * 0.5);
10472
10474 return;
10475
10477
10478 if (new_item)
10479 {
10480 if (new_item.GetQuantityMax() < split_quantity_new)
10481 {
10482 split_quantity_new = new_item.GetQuantityMax();
10483 }
10484
10485 new_item.SetResultOfSplit(true);
10486 MiscGameplayFunctions.TransferItemProperties(this, new_item);
10487
10489 {
10492 }
10493 else
10494 {
10496 new_item.
SetQuantity(split_quantity_new,
false,
true);
10497 }
10498 }
10499 }
10500
10502 {
10504 float split_quantity_new = Math.Floor(quantity / 2);
10505
10507 return;
10508
10509 InventoryLocation invloc = new InventoryLocation;
10511
10513 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
10514
10515 if (new_item)
10516 {
10517 if (new_item.GetQuantityMax() < split_quantity_new)
10518 {
10519 split_quantity_new = new_item.GetQuantityMax();
10520 }
10522 {
10525 }
10526 else if (split_quantity_new > 1)
10527 {
10529 new_item.
SetQuantity(split_quantity_new,
false,
true);
10530 }
10531 }
10532 }
10533
10536 {
10537 SetWeightDirty();
10539
10540 if (parent)
10541 parent.OnAttachmentQuantityChangedEx(this, delta);
10542
10544 {
10546 {
10548 }
10550 {
10551 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
10553 }
10554 }
10555
10556 }
10557
10560 {
10561
10562 }
10563
10566 {
10568 }
10569
10571 {
10572 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
10573
10575 {
10576 if (newLevel == GameConstants.STATE_RUINED)
10577 {
10579 EntityAI parent = GetHierarchyParent();
10580 if (parent && parent.IsFireplace())
10581 {
10582 CargoBase cargo = GetInventory().GetCargo();
10583 if (cargo)
10584 {
10586 {
10588 }
10589 }
10590 }
10591 }
10592
10594 {
10595
10597 return;
10598 }
10599
10600 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
10601 {
10603 }
10604 }
10605 }
10606
10607
10609 {
10610 super.OnRightClick();
10611
10613 {
10615 {
10616 if (ScriptInputUserData.CanStoreInputUserData())
10617 {
10618 EntityAI root = GetHierarchyRoot();
10619 Man playerOwner = GetHierarchyRootPlayer();
10620 InventoryLocation dst = new InventoryLocation;
10621
10622
10623 if (!playerOwner && root && root == this)
10624 {
10626 }
10627 else
10628 {
10629
10630 GetInventory().GetCurrentInventoryLocation(dst);
10632 {
10635 {
10637 }
10638 else
10639 {
10641
10642
10643 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
10644 {
10646 }
10647 else
10648 {
10649 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
10650 }
10651 }
10652 }
10653 }
10654
10655 ScriptInputUserData ctx = new ScriptInputUserData;
10663 }
10664 }
10665 else if (!
GetGame().IsMultiplayer())
10666 {
10668 }
10669 }
10670 }
10671
10673 {
10674 if (root)
10675 {
10676 vector m4[4];
10677 root.GetTransform(m4);
10678 dst.SetGround(this, m4);
10679 }
10680 else
10681 {
10682 GetInventory().GetCurrentInventoryLocation(dst);
10683 }
10684 }
10685
10686 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
10687 {
10688
10689 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
10690 return false;
10691
10692 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
10693 return false;
10694
10695
10697 return false;
10698
10699
10700 Magazine mag = Magazine.Cast(this);
10701 if (mag)
10702 {
10703 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
10704 return false;
10705
10706 if (stack_max_limit)
10707 {
10708 Magazine other_mag = Magazine.Cast(other_item);
10709 if (other_item)
10710 {
10711 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
10712 return false;
10713 }
10714
10715 }
10716 }
10717 else
10718 {
10719
10721 return false;
10722
10724 return false;
10725 }
10726
10727 PlayerBase player = null;
10728 if (CastTo(player, GetHierarchyRootPlayer()))
10729 {
10730 if (player.GetInventory().HasAttachment(this))
10731 return false;
10732
10733 if (player.IsItemsToDelete())
10734 return false;
10735 }
10736
10737 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
10738 return false;
10739
10740 int slotID;
10742 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
10743 return false;
10744
10745 return true;
10746 }
10747
10749 {
10751 }
10752
10754 {
10755 return m_IsResultOfSplit;
10756 }
10757
10759 {
10760 m_IsResultOfSplit = value;
10761 }
10762
10764 {
10766 }
10767
10769 {
10770 float other_item_quantity = other_item.GetQuantity();
10771 float this_free_space;
10772
10774
10776
10777 if (other_item_quantity > this_free_space)
10778 {
10779 return this_free_space;
10780 }
10781 else
10782 {
10783 return other_item_quantity;
10784 }
10785 }
10786
10788 {
10790 }
10791
10793 {
10795 return;
10796
10797 if (!IsMagazine() && other_item)
10798 {
10800 if (quantity_used != 0)
10801 {
10802 float hp1 = GetHealth01("","");
10803 float hp2 = other_item.GetHealth01("","");
10804 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
10805 hpResult = hpResult / (
GetQuantity() + quantity_used);
10806
10807 hpResult *= GetMaxHealth();
10808 Math.Round(hpResult);
10809 SetHealth("", "Health", hpResult);
10810
10812 other_item.AddQuantity(-quantity_used);
10813 }
10814 }
10816 }
10817
10819 {
10820 #ifdef SERVER
10821 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
10822 GetHierarchyParent().IncreaseLifetimeUp();
10823 #endif
10824 };
10825
10827 {
10828 PlayerBase p = PlayerBase.Cast(player);
10829
10830 array<int> recipesIds = p.m_Recipes;
10831 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10832 if (moduleRecipesManager)
10833 {
10834 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
10835 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
10836 }
10837
10838 for (int i = 0;i < recipesIds.Count(); i++)
10839 {
10840 int key = recipesIds.Get(i);
10841 string recipeName = moduleRecipesManager.GetRecipeName(key);
10843 }
10844 }
10845
10846
10847 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
10848 {
10849 super.GetDebugActions(outputList);
10850
10851
10857
10858
10863
10868
10869
10873
10874
10876 {
10880 }
10881
10884
10885
10889
10891
10892 InventoryLocation loc = new InventoryLocation();
10893 GetInventory().GetCurrentInventoryLocation(loc);
10895 {
10896 if (Gizmo_IsSupported())
10899 }
10900
10902 }
10903
10904
10905
10906
10908 {
10909 super.OnAction(action_id, player, ctx);
10910
10912 {
10913 switch (action_id)
10914 {
10917 return true;
10920 return true;
10921 }
10922 }
10923
10925 {
10926 switch (action_id)
10927 {
10929 Delete();
10930 return true;
10931 }
10932 }
10933
10934 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
10935 {
10936 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
10937 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
10938 PlayerBase p = PlayerBase.Cast(player);
10939 if (
EActions.RECIPES_RANGE_START < 1000)
10940 {
10941 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
10942 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
10943 }
10944 }
10945 #ifndef SERVER
10946 else if (action_id ==
EActions.WATCH_PLAYER)
10947 {
10948 PluginDeveloper.SetDeveloperItemClientEx(player);
10949 }
10950 #endif
10952 {
10953 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
10954 {
10955 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
10956 OnDebugButtonPressServer(id + 1);
10957 }
10958
10959 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
10960 {
10961 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
10963 }
10964
10965 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
10966 {
10967 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
10969 }
10970
10971 else if (action_id ==
EActions.ADD_QUANTITY)
10972 {
10973 if (IsMagazine())
10974 {
10975 Magazine mag = Magazine.Cast(this);
10976 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
10977 }
10978 else
10979 {
10981 }
10982
10983 if (m_EM)
10984 {
10985 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
10986 }
10987
10988 }
10989
10990 else if (action_id ==
EActions.REMOVE_QUANTITY)
10991 {
10992 if (IsMagazine())
10993 {
10994 Magazine mag2 = Magazine.Cast(this);
10995 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
10996 }
10997 else
10998 {
11000 }
11001 if (m_EM)
11002 {
11003 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
11004 }
11005
11006 }
11007
11008 else if (action_id ==
EActions.SET_QUANTITY_0)
11009 {
11011
11012 if (m_EM)
11013 {
11014 m_EM.SetEnergy(0);
11015 }
11016 }
11017
11018 else if (action_id ==
EActions.SET_MAX_QUANTITY)
11019 {
11021
11022 if (m_EM)
11023 {
11024 m_EM.SetEnergy(m_EM.GetEnergyMax());
11025 }
11026 }
11027
11028 else if (action_id ==
EActions.ADD_HEALTH)
11029 {
11030 AddHealth("","",GetMaxHealth("","Health")/5);
11031 }
11032 else if (action_id ==
EActions.REMOVE_HEALTH)
11033 {
11034 AddHealth("","",-GetMaxHealth("","Health")/5);
11035 }
11036 else if (action_id ==
EActions.DESTROY_HEALTH)
11037 {
11038 SetHealth01("","",0);
11039 }
11040 else if (action_id ==
EActions.WATCH_ITEM)
11041 {
11043 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
11044 #ifdef DEVELOPER
11045 SetDebugDeveloper_item(this);
11046 #endif
11047 }
11048
11049 else if (action_id ==
EActions.ADD_TEMPERATURE)
11050 {
11051 AddTemperature(20);
11052
11053 }
11054
11055 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
11056 {
11057 AddTemperature(-20);
11058
11059 }
11060
11061 else if (action_id ==
EActions.FLIP_FROZEN)
11062 {
11063 SetFrozen(!GetIsFrozen());
11064
11065 }
11066
11067 else if (action_id ==
EActions.ADD_WETNESS)
11068 {
11070
11071 }
11072
11073 else if (action_id ==
EActions.REMOVE_WETNESS)
11074 {
11076
11077 }
11078
11079 else if (action_id ==
EActions.LIQUIDTYPE_UP)
11080 {
11083
11084
11085 }
11086
11087 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
11088 {
11091 }
11092
11093 else if (action_id ==
EActions.MAKE_SPECIAL)
11094 {
11095 auto debugParams = DebugSpawnParams.WithPlayer(player);
11096 OnDebugSpawnEx(debugParams);
11097 }
11098
11099 }
11100
11101
11102 return false;
11103 }
11104
11105
11106
11107
11111
11114
11115
11116
11118 {
11119 return false;
11120 }
11121
11122
11124 {
11125 return true;
11126 }
11127
11128
11130 {
11131 return true;
11132 }
11133
11134
11135
11137 {
11138 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
11140 }
11141
11144 {
11145 return null;
11146 }
11147
11149 {
11150 return false;
11151 }
11152
11154 {
11155 return false;
11156 }
11157
11161
11162
11164 {
11165 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11166 return module_repairing.CanRepair(this, item_repair_kit);
11167 }
11168
11169
11170 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
11171 {
11172 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
11173 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
11174 }
11175
11176
11178 {
11179
11180
11181
11182
11183
11184
11185
11186
11187 return 1;
11188 }
11189
11190
11191
11193 {
11195 }
11196
11197
11198
11200 {
11202 }
11203
11204
11213 {
11214 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11215
11216 if (player)
11217 {
11218 player.MessageStatus(text);
11219 }
11220 }
11221
11222
11231 {
11232 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11233
11234 if (player)
11235 {
11236 player.MessageAction(text);
11237 }
11238 }
11239
11240
11249 {
11250 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11251
11252 if (player)
11253 {
11254 player.MessageFriendly(text);
11255 }
11256 }
11257
11258
11267 {
11268 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
11269
11270 if (player)
11271 {
11272 player.MessageImportant(text);
11273 }
11274 }
11275
11277 {
11278 return true;
11279 }
11280
11281
11282 override bool KindOf(
string tag)
11283 {
11284 bool found = false;
11285 string item_name = this.
GetType();
11288
11289 int array_size = item_tag_array.Count();
11290 for (int i = 0; i < array_size; i++)
11291 {
11292 if (item_tag_array.Get(i) == tag)
11293 {
11294 found = true;
11295 break;
11296 }
11297 }
11298 return found;
11299 }
11300
11301
11303 {
11304
11305 super.OnRPC(sender, rpc_type,ctx);
11306
11307
11308 switch (rpc_type)
11309 {
11310 #ifndef SERVER
11311 case ERPCs.RPC_SOUND_LOCK_ATTACH:
11312 Param2<bool, string> p = new Param2<bool, string>(false, "");
11313
11315 return;
11316
11317 bool play = p.param1;
11318 string soundSet = p.param2;
11319
11320 if (play)
11321 {
11323 {
11325 {
11327 }
11328 }
11329 else
11330 {
11332 }
11333 }
11334 else
11335 {
11337 }
11338
11339 break;
11340 #endif
11341
11342 }
11343
11345 {
11347 }
11348 }
11349
11350
11351
11352
11354 {
11355 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11356 return plugin.GetID(
name);
11357 }
11358
11360 {
11361 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
11362 return plugin.GetName(id);
11363 }
11364
11367 {
11368
11369
11370 int varFlags;
11371 if (!ctx.
Read(varFlags))
11372 return;
11373
11374 if (varFlags & ItemVariableFlags.FLOAT)
11375 {
11377 }
11378 }
11379
11381 {
11382
11383 super.SerializeNumericalVars(floats_out);
11384
11385
11386
11388 {
11390 }
11391
11393 {
11395 }
11396
11398 {
11400 }
11401
11403 {
11408 }
11409
11411 {
11413 }
11414 }
11415
11417 {
11418
11419 super.DeSerializeNumericalVars(floats);
11420
11421
11422 int index = 0;
11423 int mask = Math.Round(floats.Get(index));
11424
11425 index++;
11426
11428 {
11430 {
11432 }
11433 else
11434 {
11435 float quantity = floats.Get(index);
11436 SetQuantity(quantity,
true,
false,
false,
false);
11437 }
11438 index++;
11439 }
11440
11442 {
11443 float wet = floats.Get(index);
11445 index++;
11446 }
11447
11449 {
11450 int liquidtype = Math.Round(floats.Get(index));
11452 index++;
11453 }
11454
11456 {
11458 index++;
11460 index++;
11462 index++;
11464 index++;
11465 }
11466
11468 {
11469 int cleanness = Math.Round(floats.Get(index));
11471 index++;
11472 }
11473 }
11474
11476 {
11477 super.WriteVarsToCTX(ctx);
11478
11479
11481 {
11483 }
11484
11486 {
11488 }
11489
11491 {
11493 }
11494
11496 {
11497 int r,g,b,a;
11503 }
11504
11506 {
11508 }
11509 }
11510
11512 {
11513 if (!super.ReadVarsFromCTX(ctx,version))
11514 return false;
11515
11516 int intValue;
11517 float value;
11518
11519 if (version < 140)
11520 {
11521 if (!ctx.
Read(intValue))
11522 return false;
11523
11524 m_VariablesMask = intValue;
11525 }
11526
11528 {
11529 if (!ctx.
Read(value))
11530 return false;
11531
11533 {
11535 }
11536 else
11537 {
11539 }
11540 }
11541
11542 if (version < 140)
11543 {
11545 {
11546 if (!ctx.
Read(value))
11547 return false;
11548 SetTemperatureDirect(value);
11549 }
11550 }
11551
11553 {
11554 if (!ctx.
Read(value))
11555 return false;
11557 }
11558
11560 {
11561 if (!ctx.
Read(intValue))
11562 return false;
11564 }
11565
11567 {
11568 int r,g,b,a;
11570 return false;
11572 return false;
11574 return false;
11576 return false;
11577
11579 }
11580
11582 {
11583 if (!ctx.
Read(intValue))
11584 return false;
11586 }
11587
11588 if (version >= 138 && version < 140)
11589 {
11591 {
11592 if (!ctx.
Read(intValue))
11593 return false;
11594 SetFrozen(intValue);
11595 }
11596 }
11597
11598 return true;
11599 }
11600
11601
11603 {
11606 {
11608 }
11609
11610 if (!super.OnStoreLoad(ctx, version))
11611 {
11613 return false;
11614 }
11615
11616 if (version >= 114)
11617 {
11618 bool hasQuickBarIndexSaved;
11619
11620 if (!ctx.
Read(hasQuickBarIndexSaved))
11621 {
11623 return false;
11624 }
11625
11626 if (hasQuickBarIndexSaved)
11627 {
11628 int itmQBIndex;
11629
11630
11631 if (!ctx.
Read(itmQBIndex))
11632 {
11634 return false;
11635 }
11636
11637 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
11638 if (itmQBIndex != -1 && parentPlayer)
11639 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
11640 }
11641 }
11642 else
11643 {
11644
11645 PlayerBase player;
11646 int itemQBIndex;
11647 if (version ==
int.
MAX)
11648 {
11649 if (!ctx.
Read(itemQBIndex))
11650 {
11652 return false;
11653 }
11654 }
11655 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
11656 {
11657
11658 if (!ctx.
Read(itemQBIndex))
11659 {
11661 return false;
11662 }
11663 if (itemQBIndex != -1 && player)
11664 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
11665 }
11666 }
11667
11668 if (version < 140)
11669 {
11670
11671 if (!LoadVariables(ctx, version))
11672 {
11674 return false;
11675 }
11676 }
11677
11678
11680 {
11682 return false;
11683 }
11684 if (version >= 132)
11685 {
11687 if (raib)
11688 {
11690 {
11692 return false;
11693 }
11694 }
11695 }
11696
11698 return true;
11699 }
11700
11701
11702
11704 {
11705 super.OnStoreSave(ctx);
11706
11707 PlayerBase player;
11708 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
11709 {
11711
11712 int itemQBIndex = -1;
11713 itemQBIndex = player.FindQuickBarEntityIndex(this);
11714 ctx.
Write(itemQBIndex);
11715 }
11716 else
11717 {
11719 }
11720
11722
11724 if (raib)
11725 {
11727 }
11728 }
11729
11730
11732 {
11733 super.AfterStoreLoad();
11734
11736 {
11738 }
11739
11741 {
11744 }
11745 }
11746
11748 {
11749 super.EEOnAfterLoad();
11750
11752 {
11754 }
11755
11758 }
11759
11761 {
11762 return false;
11763 }
11764
11765
11766
11768 {
11770 {
11771 #ifdef PLATFORM_CONSOLE
11772
11774 {
11776 if (menu)
11777 {
11779 }
11780 }
11781 #endif
11782 }
11783
11785 {
11788 }
11789
11791 {
11792 SetWeightDirty();
11794 }
11796 {
11799 }
11800
11802 {
11805 }
11807 {
11810 }
11811
11812 super.OnVariablesSynchronized();
11813 }
11814
11815
11816
11818 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
11819 {
11820 if (!IsServerCheck(allow_client))
11821 return false;
11822
11824 return false;
11825
11828
11829 if (value <= (min + 0.001))
11830 value = min;
11831
11832 if (value == min)
11833 {
11834 if (destroy_config)
11835 {
11836 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
11837 if (dstr)
11838 {
11840 this.Delete();
11841 return true;
11842 }
11843 }
11844 else if (destroy_forced)
11845 {
11847 this.Delete();
11848 return true;
11849 }
11850
11852 }
11853
11856
11858 {
11860
11861 if (delta)
11863 }
11864
11866
11867 return false;
11868 }
11869
11870
11872 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11873 {
11875 }
11876
11878 {
11881 }
11882
11884 {
11887 }
11888
11890 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
11891 {
11892 float value_clamped = Math.Clamp(value, 0, 1);
11894 SetQuantity(result, destroy_config, destroy_forced);
11895 }
11896
11897
11900 {
11902 }
11903
11905 {
11907 }
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11919 {
11920 int slot = -1;
11921 if (GetInventory())
11922 {
11923 InventoryLocation il = new InventoryLocation;
11924 GetInventory().GetCurrentInventoryLocation(il);
11926 }
11927
11929 }
11930
11932 {
11933 float quantity_max = 0;
11934
11936 {
11937 if (attSlotID != -1)
11938 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
11939
11940 if (quantity_max <= 0)
11942 }
11943
11944 if (quantity_max <= 0)
11946
11947 return quantity_max;
11948 }
11949
11951 {
11953 }
11954
11956 {
11958 }
11959
11960
11962 {
11964 }
11965
11967 {
11969 }
11970
11972 {
11974 }
11975
11976
11978 {
11979
11980 float weightEx = GetWeightEx();
11981 float special = GetInventoryAndCargoWeight();
11982 return weightEx - special;
11983 }
11984
11985
11987 {
11989 }
11990
11992 {
11994 {
11995 #ifdef DEVELOPER
11996 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
11997 {
11998 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
12000 }
12001 #endif
12002
12003 return GetQuantity() * GetConfigWeightModified();
12004 }
12005 else if (HasEnergyManager())
12006 {
12007 #ifdef DEVELOPER
12008 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12009 {
12010 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
12011 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
12012 }
12013 #endif
12014 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
12015 }
12016 else
12017 {
12018 #ifdef DEVELOPER
12019 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
12020 {
12021 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
12022 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
12023 }
12024 #endif
12025 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
12026 }
12027 }
12028
12031 {
12032 int item_count = 0;
12034
12035 if (GetInventory().GetCargo() != NULL)
12036 {
12037 item_count = GetInventory().GetCargo().GetItemCount();
12038 }
12039
12040 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
12041 {
12042 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
12043 if (item)
12044 item_count += item.GetNumberOfItems();
12045 }
12046 return item_count;
12047 }
12048
12051 {
12052 float weight = 0;
12053 float wetness = 1;
12054 if (include_wetness)
12057 {
12058 weight = wetness * m_ConfigWeight;
12059 }
12061 {
12062 weight = 1;
12063 }
12064 return weight;
12065 }
12066
12067
12068
12070 {
12071 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
12072 {
12073 GameInventory inv = GetInventory();
12074 array<EntityAI> items = new array<EntityAI>;
12076 for (int i = 0; i < items.Count(); i++)
12077 {
12079 if (item)
12080 {
12082 }
12083 }
12084 }
12085 }
12086
12087
12088
12089
12091 {
12092 float energy = 0;
12093 if (HasEnergyManager())
12094 {
12095 energy = GetCompEM().GetEnergy();
12096 }
12097 return energy;
12098 }
12099
12100
12102 {
12103 super.OnEnergyConsumed();
12104
12106 }
12107
12109 {
12110 super.OnEnergyAdded();
12111
12113 }
12114
12115
12117 {
12118 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
12119 {
12121 {
12122 float energy_0to1 = GetCompEM().GetEnergy0To1();
12124 }
12125 }
12126 }
12127
12128
12130 {
12131 return ConfigGetFloat("heatIsolation");
12132 }
12133
12135 {
12137 }
12138
12140 {
12141 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
12142 if (
GetGame().ConfigIsExisting(paramPath))
12144
12145 return 0.0;
12146 }
12147
12149 {
12150 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
12151 if (
GetGame().ConfigIsExisting(paramPath))
12153
12154 return 0.0;
12155 }
12156
12157 override void SetWet(
float value,
bool allow_client =
false)
12158 {
12159 if (!IsServerCheck(allow_client))
12160 return;
12161
12164
12166
12167 m_VarWet = Math.Clamp(value, min, max);
12168
12170 {
12173 }
12174 }
12175
12176 override void AddWet(
float value)
12177 {
12179 }
12180
12182 {
12184 }
12185
12187 {
12189 }
12190
12192 {
12194 }
12195
12197 {
12199 }
12200
12202 {
12204 }
12205
12206 override void OnWetChanged(
float newVal,
float oldVal)
12207 {
12210 if (newLevel != oldLevel)
12211 {
12213 }
12214 }
12215
12217 {
12218 SetWeightDirty();
12219 }
12220
12222 {
12223 return GetWetLevelInternal(
m_VarWet);
12224 }
12225
12226
12227
12229 {
12231 }
12232
12234 {
12236 }
12237
12239 {
12241 }
12242
12244 {
12246 }
12247
12248
12249
12251 {
12252 if (ConfigIsExisting("itemModelLength"))
12253 {
12254 return ConfigGetFloat("itemModelLength");
12255 }
12256 return 0;
12257 }
12258
12260 {
12261 if (ConfigIsExisting("itemAttachOffset"))
12262 {
12263 return ConfigGetFloat("itemAttachOffset");
12264 }
12265 return 0;
12266 }
12267
12268 override void SetCleanness(
int value,
bool allow_client =
false)
12269 {
12270 if (!IsServerCheck(allow_client))
12271 return;
12272
12274
12276
12279 }
12280
12282 {
12284 }
12285
12287 {
12288 return true;
12289 }
12290
12291
12292
12293
12295 {
12297 }
12298
12300 {
12302 }
12303
12304
12305
12306
12307 override void SetColor(
int r,
int g,
int b,
int a)
12308 {
12314 }
12316 override void GetColor(out
int r,out
int g,out
int b,out
int a)
12317 {
12322 }
12323
12325 {
12327 }
12328
12331 {
12332 int r,g,b,a;
12334 r = r/255;
12335 g = g/255;
12336 b = b/255;
12337 a = a/255;
12338 return MiscGameplayFunctions.GetColorString(r, g, b, a);
12339 }
12340
12341
12342
12343 override void SetLiquidType(
int value,
bool allow_client =
false)
12344 {
12345 if (!IsServerCheck(allow_client))
12346 return;
12347
12352 }
12353
12355 {
12356 return ConfigGetInt("varLiquidTypeInit");
12357 }
12358
12360 {
12362 }
12363
12365 {
12367 SetFrozen(false);
12368 }
12369
12372 {
12373 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12374 }
12375
12376
12379 {
12380 PlayerBase nplayer;
12381 if (PlayerBase.CastTo(nplayer, player))
12382 {
12384
12385 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
12386 }
12387 }
12388
12389
12392 {
12393 PlayerBase nplayer;
12394 if (PlayerBase.CastTo(nplayer,player))
12395 {
12396
12397 nplayer.SetEnableQuickBarEntityShortcut(this,false);
12398
12399 }
12400
12401
12402 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
12403
12404
12405 if (HasEnergyManager())
12406 {
12407 GetCompEM().UpdatePlugState();
12408 }
12409 }
12410
12411
12413 {
12414 super.OnPlacementStarted(player);
12415
12417 }
12418
12419 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
12420 {
12422 {
12423 m_AdminLog.OnPlacementComplete(player,
this);
12424 }
12425
12426 super.OnPlacementComplete(player, position, orientation);
12427 }
12428
12429
12430
12431
12432
12434 {
12436 {
12437 return true;
12438 }
12439 else
12440 {
12441 return false;
12442 }
12443 }
12444
12445
12447 {
12449 {
12451 }
12452 }
12453
12454
12456 {
12458 }
12459
12461 {
12463 }
12464
12465 override void InsertAgent(
int agent,
float count = 1)
12466 {
12467 if (count < 1)
12468 return;
12469
12471 }
12472
12475 {
12477 }
12478
12479
12481 {
12483 }
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12527 {
12529 return false;
12530 return true;
12531 }
12532
12534 {
12535
12537 }
12538
12539
12542 {
12543 super.CheckForRoofLimited(timeTresholdMS);
12544
12546 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
12547 {
12548 m_PreviousRoofTestTime = time;
12549 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
12550 }
12551 }
12552
12553
12555 {
12557 {
12558 return 0;
12559 }
12560
12561 if (GetInventory().GetAttachmentSlotsCount() != 0)
12562 {
12563 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
12564 if (filter)
12565 return filter.GetProtectionLevel(type, false, system);
12566 else
12567 return 0;
12568 }
12569
12570 string subclassPath, entryName;
12571
12572 switch (type)
12573 {
12575 entryName = "biological";
12576 break;
12578 entryName = "chemical";
12579 break;
12580 default:
12581 entryName = "biological";
12582 break;
12583 }
12584
12585 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
12586
12588 }
12589
12590
12591
12594 {
12595 if (!IsMagazine())
12597
12599 }
12600
12601
12602
12603
12604
12609 {
12610 return true;
12611 }
12612
12614 {
12616 }
12617
12618
12619
12620
12621
12623 {
12624 if (parent)
12625 {
12626 if (parent.IsInherited(DayZInfected))
12627 return true;
12628
12629 if (!parent.IsRuined())
12630 return true;
12631 }
12632
12633 return true;
12634 }
12635
12637 {
12638 if (!super.CanPutAsAttachment(parent))
12639 {
12640 return false;
12641 }
12642
12643 if (!IsRuined() && !parent.IsRuined())
12644 {
12645 return true;
12646 }
12647
12648 return false;
12649 }
12650
12652 {
12653
12654
12655
12656
12657 return super.CanReceiveItemIntoCargo(item);
12658 }
12659
12661 {
12662
12663
12664
12665
12666 GameInventory attachmentInv = attachment.GetInventory();
12668 {
12669 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
12670 return false;
12671 }
12672
12673 InventoryLocation loc = new InventoryLocation();
12674 attachment.GetInventory().GetCurrentInventoryLocation(loc);
12675 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
12676 return false;
12677
12678 return super.CanReceiveAttachment(attachment, slotId);
12679 }
12680
12682 {
12683 if (!super.CanReleaseAttachment(attachment))
12684 return false;
12685
12686 return GetInventory().AreChildrenAccessible();
12687 }
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12710 {
12711 int id = muzzle_owner.GetMuzzleID();
12712 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
12713
12714 if (WPOF_array)
12715 {
12716 for (int i = 0; i < WPOF_array.Count(); i++)
12717 {
12718 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
12719
12720 if (WPOF)
12721 {
12722 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
12723 }
12724 }
12725 }
12726 }
12727
12728
12730 {
12731 int id = muzzle_owner.GetMuzzleID();
12733
12734 if (WPOBE_array)
12735 {
12736 for (int i = 0; i < WPOBE_array.Count(); i++)
12737 {
12738 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
12739
12740 if (WPOBE)
12741 {
12742 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12743 }
12744 }
12745 }
12746 }
12747
12748
12750 {
12751 int id = muzzle_owner.GetMuzzleID();
12752 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12753
12754 if (WPOOH_array)
12755 {
12756 for (int i = 0; i < WPOOH_array.Count(); i++)
12757 {
12758 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12759
12760 if (WPOOH)
12761 {
12762 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
12763 }
12764 }
12765 }
12766 }
12767
12768
12770 {
12771 int id = muzzle_owner.GetMuzzleID();
12772 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12773
12774 if (WPOOH_array)
12775 {
12776 for (int i = 0; i < WPOOH_array.Count(); i++)
12777 {
12778 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12779
12780 if (WPOOH)
12781 {
12782 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12783 }
12784 }
12785 }
12786 }
12787
12788
12790 {
12791 int id = muzzle_owner.GetMuzzleID();
12792 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
12793
12794 if (WPOOH_array)
12795 {
12796 for (int i = 0; i < WPOOH_array.Count(); i++)
12797 {
12798 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
12799
12800 if (WPOOH)
12801 {
12802 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
12803 }
12804 }
12805 }
12806 }
12807
12808
12809
12811 {
12813 {
12814 return true;
12815 }
12816
12817 return false;
12818 }
12819
12821 {
12823 {
12824 return true;
12825 }
12826
12827 return false;
12828 }
12829
12831 {
12833 {
12834 return true;
12835 }
12836
12837 return false;
12838 }
12839
12841 {
12842 return false;
12843 }
12844
12847 {
12848 return UATimeSpent.DEFAULT_DEPLOY;
12849 }
12850
12851
12852
12853
12855 {
12857 SetSynchDirty();
12858 }
12859
12861 {
12863 }
12864
12865
12867 {
12868 return false;
12869 }
12870
12873 {
12874 string att_type = "None";
12875
12876 if (ConfigIsExisting("soundAttType"))
12877 {
12878 att_type = ConfigGetString("soundAttType");
12879 }
12880
12882 }
12883
12885 {
12887 }
12888
12889
12890
12891
12892
12898
12900 {
12903
12905 }
12906
12907
12909 {
12911 return;
12912
12914
12917
12920
12921 SoundParameters params = new SoundParameters();
12925 }
12926
12927
12929 {
12931 return;
12932
12934 SetSynchDirty();
12935
12938 }
12939
12940
12942 {
12944 return;
12945
12947 SetSynchDirty();
12948
12951 }
12952
12954 {
12956 }
12957
12959 {
12961 }
12962
12965 {
12966 if (!
GetGame().IsDedicatedServer())
12967 {
12968 if (ConfigIsExisting("attachSoundSet"))
12969 {
12970 string cfg_path = "";
12971 string soundset = "";
12972 string type_name =
GetType();
12973
12976 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
12977 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
12978
12979 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
12980 {
12981 for (int i = 0; i < cfg_soundset_array.Count(); i++)
12982 {
12983 if (cfg_slot_array[i] == slot_type)
12984 {
12985 soundset = cfg_soundset_array[i];
12986 break;
12987 }
12988 }
12989 }
12990
12991 if (soundset != "")
12992 {
12993 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
12995 }
12996 }
12997 }
12998 }
12999
13001 {
13002
13003 }
13004
13005 void OnApply(PlayerBase player);
13006
13008 {
13009 return 1.0;
13010 };
13011
13013 {
13015 }
13016
13018 {
13020 }
13021
13023
13025 {
13026 SetDynamicPhysicsLifeTime(0.01);
13028 }
13029
13031 {
13032 array<string> zone_names = new array<string>;
13033 GetDamageZones(zone_names);
13034 for (int i = 0; i < zone_names.Count(); i++)
13035 {
13036 SetHealthMax(zone_names.Get(i),"Health");
13037 }
13038 SetHealthMax("","Health");
13039 }
13040
13043 {
13044 float global_health = GetHealth01("","Health");
13045 array<string> zones = new array<string>;
13046 GetDamageZones(zones);
13047
13048 for (int i = 0; i < zones.Count(); i++)
13049 {
13050 SetHealth01(zones.Get(i),"Health",global_health);
13051 }
13052 }
13053
13056 {
13057 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
13058 }
13059
13061 {
13062 if (!hasRootAsPlayer)
13063 {
13064 if (refParentIB)
13065 {
13066
13067 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
13068 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
13069
13070 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
13071 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
13072
13075 }
13076 else
13077 {
13078
13081 }
13082 }
13083 }
13084
13086 {
13088 {
13089 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
13090 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
13091 {
13092 float heatPermCoef = 1.0;
13094 while (ent)
13095 {
13096 heatPermCoef *= ent.GetHeatPermeabilityCoef();
13097 ent = ent.GetHierarchyParent();
13098 }
13099
13100 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
13101 }
13102 }
13103 }
13104
13106 {
13107
13108 EntityAI parent = GetHierarchyParent();
13109 if (!parent)
13110 {
13111 hasParent = false;
13112 hasRootAsPlayer = false;
13113 }
13114 else
13115 {
13116 hasParent = true;
13117 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
13118 refParentIB =
ItemBase.Cast(parent);
13119 }
13120 }
13121
13122 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
13123 {
13124
13125 }
13126
13128 {
13129
13130 return false;
13131 }
13132
13134 {
13135
13136
13137 return false;
13138 }
13139
13141 {
13142
13143 return false;
13144 }
13145
13148 {
13149 return !GetIsFrozen() &&
IsOpen();
13150 }
13151
13153 {
13154 bool hasParent = false, hasRootAsPlayer = false;
13156
13157 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
13158 bool foodDecay =
g_Game.IsFoodDecayEnabled();
13159
13160 if (wwtu || foodDecay)
13161 {
13165
13166 if (processWetness || processTemperature || processDecay)
13167 {
13169
13170 if (processWetness)
13171 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
13172
13173 if (processTemperature)
13175
13176 if (processDecay)
13177 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
13178 }
13179 }
13180 }
13181
13184 {
13186 }
13187
13189 {
13192
13193 return super.GetTemperatureFreezeThreshold();
13194 }
13195
13197 {
13200
13201 return super.GetTemperatureThawThreshold();
13202 }
13203
13205 {
13208
13209 return super.GetItemOverheatThreshold();
13210 }
13211
13213 {
13215 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
13216
13217 return super.GetTemperatureFreezeTime();
13218 }
13219
13221 {
13223 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
13224
13225 return super.GetTemperatureThawTime();
13226 }
13227
13232
13234 {
13235 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
13236 }
13237
13239 {
13240 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
13241 }
13242
13245 {
13247 }
13248
13250 {
13252 }
13253
13255 {
13257 }
13258
13261 {
13262 return null;
13263 }
13264
13267 {
13268 return false;
13269 }
13270
13272 {
13274 {
13277 if (!trg)
13278 {
13280 explosive = this;
13281 }
13282
13283 explosive.PairRemote(trg);
13285
13286 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
13287 trg.SetPersistentPairID(persistentID);
13288 explosive.SetPersistentPairID(persistentID);
13289
13290 return true;
13291 }
13292 return false;
13293 }
13294
13297 {
13298 float ret = 1.0;
13301 ret *= GetHealth01();
13302
13303 return ret;
13304 }
13305
13306 #ifdef DEVELOPER
13307 override void SetDebugItem()
13308 {
13309 super.SetDebugItem();
13310 _itemBase = this;
13311 }
13312
13314 {
13315 string text = super.GetDebugText();
13316
13318 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
13319
13320 return text;
13321 }
13322 #endif
13323
13325 {
13326 return true;
13327 }
13328
13330
13332
13334 {
13337 }
13338
13339
13347
13363}
13364
13366{
13368 if (entity)
13369 {
13370 bool is_item = entity.IsInherited(
ItemBase);
13371 if (is_item && full_quantity)
13372 {
13375 }
13376 }
13377 else
13378 {
13380 return NULL;
13381 }
13382 return entity;
13383}
13384
13386{
13387 if (item)
13388 {
13389 if (health > 0)
13390 item.SetHealth("", "", health);
13391
13392 if (item.CanHaveTemperature())
13393 {
13395 if (item.CanFreeze())
13396 item.SetFrozen(false);
13397 }
13398
13399 if (item.HasEnergyManager())
13400 {
13401 if (quantity >= 0)
13402 {
13403 item.GetCompEM().SetEnergy0To1(quantity);
13404 }
13405 else
13406 {
13408 }
13409 }
13410 else if (item.IsMagazine())
13411 {
13412 Magazine mag = Magazine.Cast(item);
13413 if (quantity >= 0)
13414 {
13415 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
13416 }
13417 else
13418 {
13420 }
13421
13422 }
13423 else
13424 {
13425 if (quantity >= 0)
13426 {
13427 item.SetQuantityNormalized(quantity, false);
13428 }
13429 else
13430 {
13432 }
13433
13434 }
13435 }
13436}
13437
13438#ifdef DEVELOPER
13440#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.