6594{
6596 {
6597 return true;
6598 }
6599};
6600
6601
6602
6604{
6608
6610
6613
6614
6615
6616
6617
6626
6632
6637
6642
6663 protected bool m_IsResultOfSplit
6664
6666
6671
6672
6673
6675
6679
6680
6681
6683
6686
6687
6688
6694
6695
6703
6706
6707
6709
6710
6712
6713
6718
6719
6724
6725
6727
6728
6730 {
6735
6736 if (!
GetGame().IsDedicatedServer())
6737 {
6739 {
6741
6743 {
6745 }
6746 }
6747
6750 }
6751
6752 m_OldLocation = null;
6753
6755 {
6757 }
6758
6759 if (ConfigIsExisting("headSelectionsToHide"))
6760 {
6763 }
6764
6766 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6767 {
6769 }
6770
6772
6773 m_IsResultOfSplit = false;
6774
6776 }
6777
6779 {
6780 super.InitItemVariables();
6781
6787 m_Count = ConfigGetInt(
"count");
6788
6791
6796
6799
6804
6816
6820
6821
6824 if (ConfigIsExisting("canBeSplit"))
6825 {
6828 }
6829
6831 if (ConfigIsExisting("itemBehaviour"))
6833
6834
6837 RegisterNetSyncVariableInt("m_VarLiquidType");
6838 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6839
6840 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6841 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6842 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6843
6844 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6845 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6846 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6847 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6848
6849 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6850 RegisterNetSyncVariableBool("m_IsTakeable");
6851 RegisterNetSyncVariableBool("m_IsHologram");
6852
6855 {
6858 }
6859
6861
6863 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6865
6866 }
6867
6869 {
6871 }
6872
6874 {
6877 {
6882 }
6883 }
6884
6885 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6886 {
6888 {
6891 }
6892
6894 }
6895
6897 {
6903 }
6904
6906
6908 {
6910
6911 if (!action)
6912 {
6913 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6914 return;
6915 }
6916
6918 if (!ai)
6919 {
6921 return;
6922 }
6923
6925 if (!action_array)
6926 {
6927 action_array = new array<ActionBase_Basic>;
6929 }
6930 if (LogManager.IsActionLogEnable())
6931 {
6932 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6933 }
6934
6935 if (action_array.Find(action) != -1)
6936 {
6937 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6938 }
6939 else
6940 {
6941 action_array.Insert(action);
6942 }
6943 }
6944
6946 {
6948 ActionBase action = player.GetActionManager().GetAction(actionName);
6951
6952 if (action_array)
6953 {
6954 action_array.RemoveItem(action);
6955 }
6956 }
6957
6958
6959
6961 {
6962 ActionOverrideData overrideData = new ActionOverrideData();
6966
6968 if (!actionMap)
6969 {
6972 }
6973
6974 actionMap.Insert(this.
Type(), overrideData);
6975
6976 }
6977
6979
6981
6982
6984 {
6987
6990
6991 string config_to_search = "CfgVehicles";
6992 string muzzle_owner_config;
6993
6995 {
6996 if (IsInherited(Weapon))
6997 config_to_search = "CfgWeapons";
6998
6999 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7000
7001 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7002
7004
7005 if (config_OnFire_subclass_count > 0)
7006 {
7007 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7008
7009 for (int i = 0; i < config_OnFire_subclass_count; i++)
7010 {
7011 string particle_class = "";
7013 string config_OnFire_entry = config_OnFire_class + particle_class;
7014 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7015 WPOF_array.Insert(WPOF);
7016 }
7017
7018
7020 }
7021 }
7022
7024 {
7025 config_to_search = "CfgWeapons";
7026 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7027
7028 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7029
7031
7032 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7033 {
7034 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7035
7036 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7037 {
7038 string particle_class2 = "";
7040 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7041 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7042 WPOBE_array.Insert(WPOBE);
7043 }
7044
7045
7047 }
7048 }
7049 }
7050
7051
7053 {
7056
7058 {
7059 string config_to_search = "CfgVehicles";
7060
7061 if (IsInherited(Weapon))
7062 config_to_search = "CfgWeapons";
7063
7064 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7065 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7066
7067 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7068 {
7069
7071
7073 {
7075 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7077 return;
7078 }
7079
7082
7083
7084
7086 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7087
7088 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7089 {
7090 string particle_class = "";
7092 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7094
7095 if (entry_type == CT_CLASS)
7096 {
7097 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7098 WPOOH_array.Insert(WPOF);
7099 }
7100 }
7101
7102
7104 }
7105 }
7106 }
7107
7109 {
7111 }
7112
7114 {
7116 {
7118
7121
7124
7125 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7126 }
7127 }
7128
7130 {
7132 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7133
7135 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7136
7138 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7139
7141 {
7143 }
7144 }
7145
7147 {
7149 }
7150
7152 {
7155 else
7157
7159 {
7162 }
7163 else
7164 {
7167
7170 }
7171
7173 }
7174
7176 {
7178 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7179 }
7180
7182 {
7184 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7186 }
7187
7189 {
7191 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7192 }
7193
7195 {
7198
7199 OverheatingParticle OP = new OverheatingParticle();
7204
7206 }
7207
7209 {
7212
7213 return -1;
7214 }
7215
7217 {
7219 {
7222
7223 for (int i = count; i > 0; --i)
7224 {
7225 int id = i - 1;
7228
7231
7232 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7233 {
7234 if (p)
7235 {
7238 }
7239 }
7240 }
7241 }
7242 }
7243
7245 {
7247 {
7249 {
7250 int id = i - 1;
7252
7253 if (OP)
7254 {
7256
7257 if (p)
7258 {
7260 }
7261
7262 delete OP;
7263 }
7264 }
7265
7268 }
7269 }
7270
7273 {
7274 return 0.0;
7275 }
7276
7277
7279 {
7280 return 250;
7281 }
7282
7284 {
7285 return 0;
7286 }
7287
7290 {
7292 return true;
7293
7294 return false;
7295 }
7296
7299 {
7302
7304 {
7306 }
7307 else
7308 {
7309
7311 }
7312
7314 }
7315
7322 {
7323 return -1;
7324 }
7325
7326
7327
7328
7330 {
7332 {
7334 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7335
7336 if (r_index >= 0)
7337 {
7338 InventoryLocation r_il = new InventoryLocation;
7339 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7340
7341 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7344 {
7345 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7346 }
7348 {
7349 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7350 }
7351
7352 }
7353
7354 player.GetHumanInventory().ClearUserReservedLocation(this);
7355 }
7356
7359 }
7360
7361
7362
7363
7365 {
7366 return ItemBase.m_DebugActionsMask;
7367 }
7368
7370 {
7371 return ItemBase.m_DebugActionsMask & mask;
7372 }
7373
7375 {
7376 ItemBase.m_DebugActionsMask = mask;
7377 }
7378
7380 {
7381 ItemBase.m_DebugActionsMask |= mask;
7382 }
7383
7385 {
7386 ItemBase.m_DebugActionsMask &= ~mask;
7387 }
7388
7390 {
7392 {
7394 }
7395 else
7396 {
7398 }
7399 }
7400
7401
7403 {
7404 if (GetEconomyProfile())
7405 {
7406 float q_max = GetEconomyProfile().GetQuantityMax();
7407 if (q_max > 0)
7408 {
7409 float q_min = GetEconomyProfile().GetQuantityMin();
7410 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7411
7413 {
7414 ComponentEnergyManager comp = GetCompEM();
7416 {
7418 }
7419 }
7421 {
7423
7424 }
7425
7426 }
7427 }
7428 }
7429
7432 {
7433 EntityAI parent = GetHierarchyParent();
7434
7435 if (parent)
7436 {
7437 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7438 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7439 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7440 }
7441 }
7442
7445 {
7446 EntityAI parent = GetHierarchyParent();
7447
7448 if (parent)
7449 {
7450 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7451 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7452 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7453 }
7454 }
7455
7457 {
7458
7459
7460
7461
7463
7465 {
7466 if (ScriptInputUserData.CanStoreInputUserData())
7467 {
7468 ScriptInputUserData ctx = new ScriptInputUserData;
7474 ctx.
Write(use_stack_max);
7477
7479 {
7480 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7481 }
7482 }
7483 }
7484 else if (!
GetGame().IsMultiplayer())
7485 {
7487 }
7488 }
7489
7491 {
7493 }
7494
7496 {
7498 }
7499
7501 {
7503 }
7504
7506 {
7507
7508 return false;
7509 }
7510
7512 {
7513 return false;
7514 }
7515
7519 {
7520 return false;
7521 }
7522
7524 {
7525 return "";
7526 }
7527
7529
7531 {
7532 return false;
7533 }
7534
7536 {
7537 return true;
7538 }
7539
7540
7541
7543 {
7544 return true;
7545 }
7546
7548 {
7549 return true;
7550 }
7551
7553 {
7554 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7556 }
7557
7559 {
7561 }
7562
7564 {
7566 if (!is_being_placed)
7568 SetSynchDirty();
7569 }
7570
7571
7573
7575 {
7577 }
7578
7580 {
7582 }
7583
7585 {
7586 return 1;
7587 }
7588
7590 {
7591 return false;
7592 }
7593
7595 {
7597 SetSynchDirty();
7598 }
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7635 {
7636 super.OnMovedInsideCargo(container);
7637
7638 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7639 }
7640
7641 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7642 {
7643 super.EEItemLocationChanged(oldLoc,newLoc);
7644
7645 PlayerBase new_player = null;
7646 PlayerBase old_player = null;
7647
7648 if (newLoc.GetParent())
7649 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7650
7651 if (oldLoc.GetParent())
7652 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7653
7655 {
7656 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7657
7658 if (r_index >= 0)
7659 {
7660 InventoryLocation r_il = new InventoryLocation;
7661 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7662
7663 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7666 {
7667 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7668 }
7670 {
7671 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7672 }
7673
7674 }
7675 }
7676
7678 {
7679 if (new_player)
7680 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7681
7682 if (new_player == old_player)
7683 {
7684
7685 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7686 {
7688 {
7689 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7690 {
7691 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7692 }
7693 }
7694 else
7695 {
7696 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7697 }
7698 }
7699
7700 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7701 {
7702 int type = oldLoc.GetType();
7704 {
7705 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7706 }
7708 {
7709 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7710 }
7711 }
7712 if (!m_OldLocation)
7713 {
7714 m_OldLocation = new InventoryLocation;
7715 }
7716 m_OldLocation.Copy(oldLoc);
7717 }
7718 else
7719 {
7720 if (m_OldLocation)
7721 {
7722 m_OldLocation.Reset();
7723 }
7724 }
7725
7727 }
7728 else
7729 {
7730 if (new_player)
7731 {
7732 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7733 if (res_index >= 0)
7734 {
7735 InventoryLocation il = new InventoryLocation;
7736 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7738 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7741 {
7742 il.
GetParent().GetOnReleaseLock().Invoke(it);
7743 }
7745 {
7747 }
7748
7749 }
7750 }
7752 {
7753
7755 }
7756
7757 if (m_OldLocation)
7758 {
7759 m_OldLocation.Reset();
7760 }
7761 }
7762 }
7763
7764 override void EOnContact(IEntity other, Contact extra)
7765 {
7767 {
7768 int liquidType = -1;
7770 if (impactSpeed > 0.0)
7771 {
7773 #ifndef SERVER
7775 #else
7777 SetSynchDirty();
7778 #endif
7780 }
7781 }
7782
7783 #ifdef SERVER
7784 if (GetCompEM() && GetCompEM().IsPlugged())
7785 {
7786 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7787 GetCompEM().UnplugThis();
7788 }
7789 #endif
7790 }
7791
7793
7795 {
7797 }
7798
7800 {
7801
7802 }
7803
7805 {
7806 super.OnItemLocationChanged(old_owner, new_owner);
7807
7808 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7809 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7810
7811 if (!relatedPlayer && playerNew)
7812 relatedPlayer = playerNew;
7813
7814 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7815 {
7817 if (actionMgr)
7818 {
7819 ActionBase currentAction = actionMgr.GetRunningAction();
7820 if (currentAction)
7822 }
7823 }
7824
7825 Man ownerPlayerOld = null;
7826 Man ownerPlayerNew = null;
7827
7828 if (old_owner)
7829 {
7830 if (old_owner.
IsMan())
7831 {
7832 ownerPlayerOld = Man.Cast(old_owner);
7833 }
7834 else
7835 {
7836 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7837 }
7838 }
7839 else
7840 {
7842 {
7844
7845 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7846 {
7847 GetCompEM().UnplugThis();
7848 }
7849 }
7850 }
7851
7852 if (new_owner)
7853 {
7854 if (new_owner.
IsMan())
7855 {
7856 ownerPlayerNew = Man.Cast(new_owner);
7857 }
7858 else
7859 {
7860 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7861 }
7862 }
7863
7864 if (ownerPlayerOld != ownerPlayerNew)
7865 {
7866 if (ownerPlayerOld)
7867 {
7868 array<EntityAI> subItemsExit = new array<EntityAI>;
7870 for (int i = 0; i < subItemsExit.Count(); i++)
7871 {
7874 }
7875 }
7876
7877 if (ownerPlayerNew)
7878 {
7879 array<EntityAI> subItemsEnter = new array<EntityAI>;
7881 for (int j = 0; j < subItemsEnter.Count(); j++)
7882 {
7885 }
7886 }
7887 }
7888 else if (ownerPlayerNew != null)
7889 {
7890 PlayerBase nplayer;
7891 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7892 {
7893 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7895 for (int k = 0; k < subItemsUpdate.Count(); k++)
7896 {
7898 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7899 }
7900 }
7901 }
7902
7903 if (old_owner)
7904 old_owner.OnChildItemRemoved(this);
7905 if (new_owner)
7906 new_owner.OnChildItemReceived(this);
7907 }
7908
7909
7911 {
7912 super.EEDelete(parent);
7913 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7914 if (player)
7915 {
7917
7918 if (player.IsAlive())
7919 {
7920 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7921 if (r_index >= 0)
7922 {
7923 InventoryLocation r_il = new InventoryLocation;
7924 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7925
7926 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7929 {
7930 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7931 }
7933 {
7934 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7935 }
7936
7937 }
7938
7939 player.RemoveQuickBarEntityShortcut(this);
7940 }
7941 }
7942 }
7943
7945 {
7946 super.EEKilled(killer);
7947
7950 {
7951 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7952 {
7953 if (IsMagazine())
7954 {
7955 if (Magazine.Cast(this).GetAmmoCount() > 0)
7956 {
7958 }
7959 }
7960 else
7961 {
7963 }
7964 }
7965 }
7966 }
7967
7969 {
7970 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7971
7972 super.OnWasAttached(parent, slot_id);
7973
7976
7978 }
7979
7981 {
7982 super.OnWasDetached(parent, slot_id);
7983
7986 }
7987
7989 {
7990 int idx;
7993
7994 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7995 if (inventory_slots.Count() < 1)
7996 {
7997 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7998 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7999 }
8000 else
8001 {
8002 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8003 }
8004
8005 idx = inventory_slots.Find(slot);
8006 if (idx < 0)
8007 return "";
8008
8009 return attach_types.Get(idx);
8010 }
8011
8013 {
8014 int idx = -1;
8015 string slot;
8016
8019
8020 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8021 if (inventory_slots.Count() < 1)
8022 {
8023 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8024 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8025 }
8026 else
8027 {
8028 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8029 if (detach_types.Count() < 1)
8030 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8031 }
8032
8033 for (int i = 0; i < inventory_slots.Count(); i++)
8034 {
8035 slot = inventory_slots.Get(i);
8036 }
8037
8038 if (slot != "")
8039 {
8040 if (detach_types.Count() == 1)
8041 idx = 0;
8042 else
8043 idx = inventory_slots.Find(slot);
8044 }
8045 if (idx < 0)
8046 return "";
8047
8048 return detach_types.Get(idx);
8049 }
8050
8052 {
8053
8055
8056
8057 float min_time = 1;
8058 float max_time = 3;
8059 float delay = Math.RandomFloat(min_time, max_time);
8060
8061 explode_timer.Run(delay, this, "DoAmmoExplosion");
8062 }
8063
8065 {
8066 Magazine magazine = Magazine.Cast(this);
8067 int pop_sounds_count = 6;
8068 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8069
8070
8071 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8072 string sound_name = pop_sounds[ sound_idx ];
8074
8075
8076 magazine.ServerAddAmmoCount(-1);
8077
8078
8079 float min_temp_to_explode = 100;
8080
8081 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8082 {
8084 }
8085 }
8086
8087
8088 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8089 {
8090 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8091
8092 const int CHANCE_DAMAGE_CARGO = 4;
8093 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8094 const int CHANCE_DAMAGE_NOTHING = 2;
8095
8097 {
8098 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8099 int chances;
8100 int rnd;
8101
8102 if (GetInventory().GetCargo())
8103 {
8104 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8105 rnd = Math.RandomInt(0,chances);
8106
8107 if (rnd < CHANCE_DAMAGE_CARGO)
8108 {
8110 }
8111 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8112 {
8114 }
8115 }
8116 else
8117 {
8118 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8119 rnd = Math.RandomInt(0,chances);
8120
8121 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8122 {
8124 }
8125 }
8126 }
8127 }
8128
8130 {
8131 if (GetInventory().GetCargo())
8132 {
8133 int item_count = GetInventory().GetCargo().GetItemCount();
8134 if (item_count > 0)
8135 {
8136 int random_pick = Math.RandomInt(0, item_count);
8138 if (!item.IsExplosive())
8139 {
8140 item.AddHealth("","",damage);
8141 return true;
8142 }
8143 }
8144 }
8145 return false;
8146 }
8147
8149 {
8150 int attachment_count = GetInventory().AttachmentCount();
8151 if (attachment_count > 0)
8152 {
8153 int random_pick = Math.RandomInt(0, attachment_count);
8154 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8155 if (!attachment.IsExplosive())
8156 {
8157 attachment.AddHealth("","",damage);
8158 return true;
8159 }
8160 }
8161 return false;
8162 }
8163
8165 {
8167 }
8168
8170 {
8172 return GetInventory().CanRemoveEntity();
8173
8174 return false;
8175 }
8176
8178 {
8180 return;
8181
8183 {
8184 if (ScriptInputUserData.CanStoreInputUserData())
8185 {
8186 ScriptInputUserData ctx = new ScriptInputUserData;
8191 ctx.
Write(destination_entity);
8195 }
8196 }
8197 else if (!
GetGame().IsMultiplayer())
8198 {
8200 }
8201 }
8202
8204 {
8206 return;
8207
8208 float split_quantity_new;
8212 InventoryLocation loc = new InventoryLocation;
8213
8214 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8215 {
8217 split_quantity_new = stack_max;
8218 else
8220
8221 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8222 if (new_item)
8223 {
8224 new_item.SetResultOfSplit(true);
8225 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8227 new_item.SetQuantity(split_quantity_new);
8228 }
8229 }
8230 else if (destination_entity && slot_id == -1)
8231 {
8232 if (quantity > stack_max)
8233 split_quantity_new = stack_max;
8234 else
8235 split_quantity_new = quantity;
8236
8238 {
8241 }
8242
8243 if (new_item)
8244 {
8245 new_item.SetResultOfSplit(true);
8246 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8248 new_item.SetQuantity(split_quantity_new);
8249 }
8250 }
8251 else
8252 {
8253 if (stack_max != 0)
8254 {
8256 {
8258 }
8259
8260 if (split_quantity_new == 0)
8261 {
8262 if (!
GetGame().IsMultiplayer())
8263 player.PhysicalPredictiveDropItem(this);
8264 else
8265 player.ServerDropEntity(this);
8266 return;
8267 }
8268
8270
8271 if (new_item)
8272 {
8273 new_item.SetResultOfSplit(true);
8274 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8276 new_item.SetQuantity(stack_max);
8277 new_item.PlaceOnSurface();
8278 }
8279 }
8280 }
8281 }
8282
8284 {
8286 return;
8287
8288 float split_quantity_new;
8292 InventoryLocation loc = new InventoryLocation;
8293
8294 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8295 {
8297 split_quantity_new = stack_max;
8298 else
8300
8301 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8302 if (new_item)
8303 {
8304 new_item.SetResultOfSplit(true);
8305 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8307 new_item.SetQuantity(split_quantity_new);
8308 }
8309 }
8310 else if (destination_entity && slot_id == -1)
8311 {
8312 if (quantity > stack_max)
8313 split_quantity_new = stack_max;
8314 else
8315 split_quantity_new = quantity;
8316
8318 {
8321 }
8322
8323 if (new_item)
8324 {
8325 new_item.SetResultOfSplit(true);
8326 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8328 new_item.SetQuantity(split_quantity_new);
8329 }
8330 }
8331 else
8332 {
8333 if (stack_max != 0)
8334 {
8336 {
8338 }
8339
8341
8342 if (new_item)
8343 {
8344 new_item.SetResultOfSplit(true);
8345 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8347 new_item.SetQuantity(stack_max);
8348 new_item.PlaceOnSurface();
8349 }
8350 }
8351 }
8352 }
8353
8355 {
8357 return;
8358
8360 {
8361 if (ScriptInputUserData.CanStoreInputUserData())
8362 {
8363 ScriptInputUserData ctx = new ScriptInputUserData;
8368 dst.WriteToContext(ctx);
8370 }
8371 }
8372 else if (!
GetGame().IsMultiplayer())
8373 {
8375 }
8376 }
8377
8379 {
8381 return;
8382
8384 {
8385 if (ScriptInputUserData.CanStoreInputUserData())
8386 {
8387 ScriptInputUserData ctx = new ScriptInputUserData;
8392 ctx.
Write(destination_entity);
8398 }
8399 }
8400 else if (!
GetGame().IsMultiplayer())
8401 {
8403 }
8404 }
8405
8407 {
8409 }
8410
8412 {
8414 return this;
8415
8417 float split_quantity_new;
8419 if (dst.IsValid())
8420 {
8421 int slot_id = dst.GetSlot();
8423
8424 if (quantity > stack_max)
8425 split_quantity_new = stack_max;
8426 else
8427 split_quantity_new = quantity;
8428
8430
8431 if (new_item)
8432 {
8433 new_item.SetResultOfSplit(true);
8434 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8437 }
8438
8439 return new_item;
8440 }
8441
8442 return null;
8443 }
8444
8446 {
8448 return;
8449
8451 float split_quantity_new;
8453 if (destination_entity)
8454 {
8456 if (quantity > stackable)
8457 split_quantity_new = stackable;
8458 else
8459 split_quantity_new = quantity;
8460
8461 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8462 if (new_item)
8463 {
8464 new_item.SetResultOfSplit(true);
8465 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8467 new_item.SetQuantity(split_quantity_new);
8468 }
8469 }
8470 }
8471
8473 {
8475 return;
8476
8478 {
8479 if (ScriptInputUserData.CanStoreInputUserData())
8480 {
8481 ScriptInputUserData ctx = new ScriptInputUserData;
8486 ItemBase destination_entity =
this;
8487 ctx.
Write(destination_entity);
8491 }
8492 }
8493 else if (!
GetGame().IsMultiplayer())
8494 {
8496 }
8497 }
8498
8500 {
8502 return;
8503
8505 float split_quantity_new;
8507 if (player)
8508 {
8510 if (quantity > stackable)
8511 split_quantity_new = stackable;
8512 else
8513 split_quantity_new = quantity;
8514
8515 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8516 new_item =
ItemBase.Cast(in_hands);
8517 if (new_item)
8518 {
8519 new_item.SetResultOfSplit(true);
8520 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8522 new_item.SetQuantity(split_quantity_new);
8523 }
8524 }
8525 }
8526
8528 {
8530 return;
8531
8533 float split_quantity_new = Math.Floor(quantity * 0.5);
8534
8536
8537 if (new_item)
8538 {
8539 if (new_item.GetQuantityMax() < split_quantity_new)
8540 {
8541 split_quantity_new = new_item.GetQuantityMax();
8542 }
8543
8544 new_item.SetResultOfSplit(true);
8545 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8546
8548 {
8551 }
8552 else
8553 {
8556 }
8557 }
8558 }
8559
8561 {
8563 return;
8564
8566 float split_quantity_new = Math.Floor(quantity / 2);
8567
8568 InventoryLocation invloc = new InventoryLocation;
8570
8572 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8573
8574 if (new_item)
8575 {
8576 if (new_item.GetQuantityMax() < split_quantity_new)
8577 {
8578 split_quantity_new = new_item.GetQuantityMax();
8579 }
8581 {
8584 }
8585 else
8586 {
8589 }
8590 }
8591 }
8592
8595 {
8596 SetWeightDirty();
8598
8599 if (parent)
8600 parent.OnAttachmentQuantityChangedEx(this, delta);
8601
8603 {
8605 {
8607 }
8609 {
8610 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8612 }
8613 }
8614
8615 }
8616
8619 {
8620
8621 }
8622
8625 {
8627 }
8628
8630 {
8631 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8632
8634 {
8635 if (newLevel == GameConstants.STATE_RUINED)
8636 {
8638 EntityAI parent = GetHierarchyParent();
8639 if (parent && parent.IsFireplace())
8640 {
8641 CargoBase cargo = GetInventory().GetCargo();
8642 if (cargo)
8643 {
8645 {
8647 }
8648 }
8649 }
8650 }
8651
8653 {
8654
8656 return;
8657 }
8658
8659 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8660 {
8662 }
8663 }
8664 }
8665
8666
8668 {
8669 super.OnRightClick();
8670
8672 {
8674 {
8675 if (ScriptInputUserData.CanStoreInputUserData())
8676 {
8677 vector m4[4];
8679
8680 EntityAI root = GetHierarchyRoot();
8681
8682 InventoryLocation dst = new InventoryLocation;
8684 {
8685 if (root)
8686 {
8687 root.GetTransform(m4);
8689 }
8690 else
8691 GetInventory().GetCurrentInventoryLocation(dst);
8692 }
8693 else
8694 {
8696
8697
8698 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8699 {
8700 if (root)
8701 {
8702 root.GetTransform(m4);
8704 }
8705 else
8706 GetInventory().GetCurrentInventoryLocation(dst);
8707 }
8708 else
8709 {
8710 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8711 }
8712 }
8713
8714 ScriptInputUserData ctx = new ScriptInputUserData;
8722 }
8723 }
8724 else if (!
GetGame().IsMultiplayer())
8725 {
8727 }
8728 }
8729 }
8730
8731 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8732 {
8733
8734 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8735 return false;
8736
8737 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8738 return false;
8739
8740
8742 return false;
8743
8744
8745 Magazine mag = Magazine.Cast(this);
8746 if (mag)
8747 {
8748 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8749 return false;
8750
8751 if (stack_max_limit)
8752 {
8753 Magazine other_mag = Magazine.Cast(other_item);
8754 if (other_item)
8755 {
8756 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8757 return false;
8758 }
8759
8760 }
8761 }
8762 else
8763 {
8764
8766 return false;
8767
8769 return false;
8770 }
8771
8772 PlayerBase player = null;
8773 if (CastTo(player, GetHierarchyRootPlayer()))
8774 {
8775 if (player.GetInventory().HasAttachment(this))
8776 return false;
8777
8778 if (player.IsItemsToDelete())
8779 return false;
8780 }
8781
8782 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8783 return false;
8784
8785 int slotID;
8787 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8788 return false;
8789
8790 return true;
8791 }
8792
8794 {
8796 }
8797
8799 {
8800 return m_IsResultOfSplit;
8801 }
8802
8804 {
8805 m_IsResultOfSplit = value;
8806 }
8807
8809 {
8811 }
8812
8814 {
8815 float other_item_quantity = other_item.GetQuantity();
8816 float this_free_space;
8817
8819
8821
8822 if (other_item_quantity > this_free_space)
8823 {
8824 return this_free_space;
8825 }
8826 else
8827 {
8828 return other_item_quantity;
8829 }
8830 }
8831
8833 {
8835 }
8836
8838 {
8840 return;
8841
8842 if (!IsMagazine() && other_item)
8843 {
8845 if (quantity_used != 0)
8846 {
8847 float hp1 = GetHealth01("","");
8848 float hp2 = other_item.GetHealth01("","");
8849 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8850 hpResult = hpResult / (
GetQuantity() + quantity_used);
8851
8852 hpResult *= GetMaxHealth();
8853 Math.Round(hpResult);
8854 SetHealth("", "Health", hpResult);
8855
8857 other_item.AddQuantity(-quantity_used);
8858 }
8859 }
8861 }
8862
8864 {
8865 #ifdef SERVER
8866 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8867 GetHierarchyParent().IncreaseLifetimeUp();
8868 #endif
8869 };
8870
8872 {
8873 PlayerBase p = PlayerBase.Cast(player);
8874
8875 array<int> recipesIds = p.m_Recipes;
8876 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8877 if (moduleRecipesManager)
8878 {
8879 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8880 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8881 }
8882
8883 for (int i = 0;i < recipesIds.Count(); i++)
8884 {
8885 int key = recipesIds.Get(i);
8886 string recipeName = moduleRecipesManager.GetRecipeName(key);
8888 }
8889 }
8890
8891
8892 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8893 {
8894 super.GetDebugActions(outputList);
8895
8896
8901
8902
8906
8910
8911
8914
8915
8917 {
8920 }
8921
8923
8926
8930 }
8931
8932
8933
8934
8936 {
8937 super.OnAction(action_id, player, ctx);
8938 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8939 {
8940 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8941 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8942 PlayerBase p = PlayerBase.Cast(player);
8943 if (
EActions.RECIPES_RANGE_START < 1000)
8944 {
8945 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8946 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8947 }
8948 }
8949 #ifndef SERVER
8950 else if (action_id ==
EActions.WATCH_PLAYER)
8951 {
8952 PluginDeveloper.SetDeveloperItemClientEx(player);
8953 }
8954 #endif
8956 {
8957 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8958 {
8959 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8960 OnDebugButtonPressServer(id + 1);
8961 }
8962
8963 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8964 {
8965 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8967 }
8968
8969 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8970 {
8971 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8973 }
8974
8975 else if (action_id ==
EActions.ADD_QUANTITY)
8976 {
8977 if (IsMagazine())
8978 {
8979 Magazine mag = Magazine.Cast(this);
8980 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8981 }
8982 else
8983 {
8985 }
8986
8987 if (m_EM)
8988 {
8989 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8990 }
8991
8992 }
8993
8994 else if (action_id ==
EActions.REMOVE_QUANTITY)
8995 {
8996 if (IsMagazine())
8997 {
8998 Magazine mag2 = Magazine.Cast(this);
8999 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9000 }
9001 else
9002 {
9004 }
9005 if (m_EM)
9006 {
9007 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9008 }
9009
9010 }
9011
9012 else if (action_id ==
EActions.SET_QUANTITY_0)
9013 {
9015
9016 if (m_EM)
9017 {
9018 m_EM.SetEnergy(0);
9019 }
9020 }
9021
9022 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9023 {
9025
9026 if (m_EM)
9027 {
9028 m_EM.SetEnergy(m_EM.GetEnergyMax());
9029 }
9030 }
9031
9032 else if (action_id ==
EActions.ADD_HEALTH)
9033 {
9034 AddHealth("","",GetMaxHealth("","Health")/5);
9035 }
9036 else if (action_id ==
EActions.REMOVE_HEALTH)
9037 {
9038 AddHealth("","",-GetMaxHealth("","Health")/5);
9039 }
9040 else if (action_id ==
EActions.DESTROY_HEALTH)
9041 {
9042 SetHealth01("","",0);
9043 }
9044 else if (action_id ==
EActions.WATCH_ITEM)
9045 {
9047 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9048 #ifdef DEVELOPER
9049 SetDebugDeveloper_item(this);
9050 #endif
9051 }
9052
9053 else if (action_id ==
EActions.ADD_TEMPERATURE)
9054 {
9055 AddTemperature(20);
9056
9057 }
9058
9059 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9060 {
9061 AddTemperature(-20);
9062
9063 }
9064
9065 else if (action_id ==
EActions.FLIP_FROZEN)
9066 {
9067 SetFrozen(!GetIsFrozen());
9068
9069 }
9070
9071 else if (action_id ==
EActions.ADD_WETNESS)
9072 {
9074
9075 }
9076
9077 else if (action_id ==
EActions.REMOVE_WETNESS)
9078 {
9080
9081 }
9082
9083 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9084 {
9087
9088
9089 }
9090
9091 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9092 {
9095 }
9096
9097 else if (action_id ==
EActions.MAKE_SPECIAL)
9098 {
9099 auto debugParams = DebugSpawnParams.WithPlayer(player);
9100 OnDebugSpawnEx(debugParams);
9101 }
9102
9103 else if (action_id ==
EActions.DELETE)
9104 {
9105 Delete();
9106 }
9107
9108 }
9109
9110
9111 return false;
9112 }
9113
9114
9115
9116
9120
9123
9124
9125
9127 {
9128 return false;
9129 }
9130
9131
9133 {
9134 return true;
9135 }
9136
9137
9139 {
9140 return true;
9141 }
9142
9143
9144
9146 {
9147 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9149 }
9150
9153 {
9154 return null;
9155 }
9156
9158 {
9159 return false;
9160 }
9161
9163 {
9164 return false;
9165 }
9166
9170
9171
9173 {
9174 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9175 return module_repairing.CanRepair(this, item_repair_kit);
9176 }
9177
9178
9179 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9180 {
9181 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9182 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9183 }
9184
9185
9187 {
9188
9189
9190
9191
9192
9193
9194
9195
9196 return 1;
9197 }
9198
9199
9200
9202 {
9204 }
9205
9206
9207
9209 {
9211 }
9212
9213
9222 {
9223 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9224
9225 if (player)
9226 {
9227 player.MessageStatus(text);
9228 }
9229 }
9230
9231
9240 {
9241 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9242
9243 if (player)
9244 {
9245 player.MessageAction(text);
9246 }
9247 }
9248
9249
9258 {
9259 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9260
9261 if (player)
9262 {
9263 player.MessageFriendly(text);
9264 }
9265 }
9266
9267
9276 {
9277 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9278
9279 if (player)
9280 {
9281 player.MessageImportant(text);
9282 }
9283 }
9284
9286 {
9287 return true;
9288 }
9289
9290
9291 override bool KindOf(
string tag)
9292 {
9293 bool found = false;
9294 string item_name = this.
GetType();
9297
9298 int array_size = item_tag_array.Count();
9299 for (int i = 0; i < array_size; i++)
9300 {
9301 if (item_tag_array.Get(i) == tag)
9302 {
9303 found = true;
9304 break;
9305 }
9306 }
9307 return found;
9308 }
9309
9310
9312 {
9313
9314 super.OnRPC(sender, rpc_type,ctx);
9315
9316
9317 switch (rpc_type)
9318 {
9319 #ifndef SERVER
9320 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9321 Param2<bool, string> p = new Param2<bool, string>(false, "");
9322
9324 return;
9325
9326 bool play = p.param1;
9327 string soundSet = p.param2;
9328
9329 if (play)
9330 {
9332 {
9334 {
9336 }
9337 }
9338 else
9339 {
9341 }
9342 }
9343 else
9344 {
9346 }
9347
9348 break;
9349 #endif
9350
9351 }
9352
9354 {
9356 }
9357 }
9358
9359
9360
9361
9363 {
9364 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9365 return plugin.GetID(
name);
9366 }
9367
9369 {
9370 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9371 return plugin.GetName(id);
9372 }
9373
9376 {
9377
9378
9379 int varFlags;
9380 if (!ctx.
Read(varFlags))
9381 return;
9382
9383 if (varFlags & ItemVariableFlags.FLOAT)
9384 {
9386 }
9387 }
9388
9390 {
9391
9392 super.SerializeNumericalVars(floats_out);
9393
9394
9395
9397 {
9399 }
9400
9402 {
9404 }
9405
9407 {
9409 }
9410
9412 {
9417 }
9418
9420 {
9422 }
9423 }
9424
9426 {
9427
9428 super.DeSerializeNumericalVars(floats);
9429
9430
9431 int index = 0;
9432 int mask = Math.Round(floats.Get(index));
9433
9434 index++;
9435
9437 {
9439 {
9441 }
9442 else
9443 {
9444 float quantity = floats.Get(index);
9446 }
9447 index++;
9448 }
9449
9451 {
9452 float wet = floats.Get(index);
9454 index++;
9455 }
9456
9458 {
9459 int liquidtype = Math.Round(floats.Get(index));
9461 index++;
9462 }
9463
9465 {
9467 index++;
9469 index++;
9471 index++;
9473 index++;
9474 }
9475
9477 {
9478 int cleanness = Math.Round(floats.Get(index));
9480 index++;
9481 }
9482 }
9483
9485 {
9486 super.WriteVarsToCTX(ctx);
9487
9488
9490 {
9492 }
9493
9495 {
9497 }
9498
9500 {
9502 }
9503
9505 {
9506 int r,g,b,a;
9512 }
9513
9515 {
9517 }
9518 }
9519
9521 {
9522 if (!super.ReadVarsFromCTX(ctx,version))
9523 return false;
9524
9525 int intValue;
9526 float value;
9527
9528 if (version < 140)
9529 {
9530 if (!ctx.
Read(intValue))
9531 return false;
9532
9533 m_VariablesMask = intValue;
9534 }
9535
9537 {
9538 if (!ctx.
Read(value))
9539 return false;
9540
9542 {
9544 }
9545 else
9546 {
9548 }
9549 }
9550
9551 if (version < 140)
9552 {
9554 {
9555 if (!ctx.
Read(value))
9556 return false;
9557 SetTemperatureDirect(value);
9558 }
9559 }
9560
9562 {
9563 if (!ctx.
Read(value))
9564 return false;
9566 }
9567
9569 {
9570 if (!ctx.
Read(intValue))
9571 return false;
9573 }
9574
9576 {
9577 int r,g,b,a;
9579 return false;
9581 return false;
9583 return false;
9585 return false;
9586
9588 }
9589
9591 {
9592 if (!ctx.
Read(intValue))
9593 return false;
9595 }
9596
9597 if (version >= 138 && version < 140)
9598 {
9600 {
9601 if (!ctx.
Read(intValue))
9602 return false;
9603 SetFrozen(intValue);
9604 }
9605 }
9606
9607 return true;
9608 }
9609
9610
9612 {
9615 {
9617 }
9618
9619 if (!super.OnStoreLoad(ctx, version))
9620 {
9622 return false;
9623 }
9624
9625 if (version >= 114)
9626 {
9627 bool hasQuickBarIndexSaved;
9628
9629 if (!ctx.
Read(hasQuickBarIndexSaved))
9630 {
9632 return false;
9633 }
9634
9635 if (hasQuickBarIndexSaved)
9636 {
9637 int itmQBIndex;
9638
9639
9640 if (!ctx.
Read(itmQBIndex))
9641 {
9643 return false;
9644 }
9645
9646 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9647 if (itmQBIndex != -1 && parentPlayer)
9648 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9649 }
9650 }
9651 else
9652 {
9653
9654 PlayerBase player;
9655 int itemQBIndex;
9656 if (version ==
int.
MAX)
9657 {
9658 if (!ctx.
Read(itemQBIndex))
9659 {
9661 return false;
9662 }
9663 }
9664 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9665 {
9666
9667 if (!ctx.
Read(itemQBIndex))
9668 {
9670 return false;
9671 }
9672 if (itemQBIndex != -1 && player)
9673 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9674 }
9675 }
9676
9677 if (version < 140)
9678 {
9679
9680 if (!LoadVariables(ctx, version))
9681 {
9683 return false;
9684 }
9685 }
9686
9687
9689 {
9691 return false;
9692 }
9693 if (version >= 132)
9694 {
9696 if (raib)
9697 {
9699 {
9701 return false;
9702 }
9703 }
9704 }
9705
9707 return true;
9708 }
9709
9710
9711
9713 {
9714 super.OnStoreSave(ctx);
9715
9716 PlayerBase player;
9717 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9718 {
9720
9721 int itemQBIndex = -1;
9722 itemQBIndex = player.FindQuickBarEntityIndex(this);
9723 ctx.
Write(itemQBIndex);
9724 }
9725 else
9726 {
9728 }
9729
9731
9733 if (raib)
9734 {
9736 }
9737 }
9738
9739
9741 {
9742 super.AfterStoreLoad();
9743
9745 {
9747 }
9748
9750 {
9753 }
9754 }
9755
9757 {
9758 super.EEOnAfterLoad();
9759
9761 {
9763 }
9764
9767 }
9768
9770 {
9771 return false;
9772 }
9773
9774
9775
9777 {
9779 {
9780 #ifdef PLATFORM_CONSOLE
9781
9783 {
9785 if (menu)
9786 {
9788 }
9789 }
9790 #endif
9791 }
9792
9794 {
9797 }
9798
9800 {
9801 SetWeightDirty();
9803 }
9805 {
9808 }
9809
9811 {
9814 }
9816 {
9819 }
9820
9821 super.OnVariablesSynchronized();
9822 }
9823
9824
9825
9827 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9828 {
9829 if (!IsServerCheck(allow_client))
9830 return false;
9831
9833 return false;
9834
9837
9838 if (value <= (min + 0.001))
9839 value = min;
9840
9841 if (value == min)
9842 {
9843 if (destroy_config)
9844 {
9845 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9846 if (dstr)
9847 {
9849 this.Delete();
9850 return true;
9851 }
9852 }
9853 else if (destroy_forced)
9854 {
9856 this.Delete();
9857 return true;
9858 }
9859
9861 }
9862
9865
9867 {
9869
9870 if (delta)
9872 }
9873
9875
9876 return false;
9877 }
9878
9879
9881 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9882 {
9884 }
9885
9887 {
9890 }
9891
9893 {
9896 }
9897
9900 {
9901 float value_clamped = Math.Clamp(value, 0, 1);
9903 SetQuantity(result, destroy_config, destroy_forced);
9904 }
9905
9906
9909 {
9911 }
9912
9914 {
9916 }
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9928 {
9929 int slot = -1;
9930 if (GetInventory())
9931 {
9932 InventoryLocation il = new InventoryLocation;
9933 GetInventory().GetCurrentInventoryLocation(il);
9935 }
9936
9938 }
9939
9941 {
9942 float quantity_max = 0;
9943
9945 {
9946 if (attSlotID != -1)
9947 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9948
9949 if (quantity_max <= 0)
9951 }
9952
9953 if (quantity_max <= 0)
9955
9956 return quantity_max;
9957 }
9958
9960 {
9962 }
9963
9965 {
9967 }
9968
9969
9971 {
9973 }
9974
9976 {
9978 }
9979
9981 {
9983 }
9984
9985
9987 {
9988
9989 float weightEx = GetWeightEx();
9990 float special = GetInventoryAndCargoWeight();
9991 return weightEx - special;
9992 }
9993
9994
9996 {
9998 }
9999
10001 {
10003 {
10004 #ifdef DEVELOPER
10005 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10006 {
10007 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10009 }
10010 #endif
10011
10012 return GetQuantity() * GetConfigWeightModified();
10013 }
10014 else if (HasEnergyManager())
10015 {
10016 #ifdef DEVELOPER
10017 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10018 {
10019 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10020 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10021 }
10022 #endif
10023 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10024 }
10025 else
10026 {
10027 #ifdef DEVELOPER
10028 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10029 {
10030 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10031 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10032 }
10033 #endif
10034 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10035 }
10036 }
10037
10040 {
10041 int item_count = 0;
10043
10044 if (GetInventory().GetCargo() != NULL)
10045 {
10046 item_count = GetInventory().GetCargo().GetItemCount();
10047 }
10048
10049 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10050 {
10051 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10052 if (item)
10053 item_count += item.GetNumberOfItems();
10054 }
10055 return item_count;
10056 }
10057
10060 {
10061 float weight = 0;
10062 float wetness = 1;
10063 if (include_wetness)
10066 {
10067 weight = wetness * m_ConfigWeight;
10068 }
10070 {
10071 weight = 1;
10072 }
10073 return weight;
10074 }
10075
10076
10077
10079 {
10080 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10081 {
10082 GameInventory inv = GetInventory();
10083 array<EntityAI> items = new array<EntityAI>;
10085 for (int i = 0; i < items.Count(); i++)
10086 {
10088 if (item)
10089 {
10091 }
10092 }
10093 }
10094 }
10095
10096
10097
10098
10100 {
10101 float energy = 0;
10102 if (HasEnergyManager())
10103 {
10104 energy = GetCompEM().GetEnergy();
10105 }
10106 return energy;
10107 }
10108
10109
10111 {
10112 super.OnEnergyConsumed();
10113
10115 }
10116
10118 {
10119 super.OnEnergyAdded();
10120
10122 }
10123
10124
10126 {
10127 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10128 {
10130 {
10131 float energy_0to1 = GetCompEM().GetEnergy0To1();
10133 }
10134 }
10135 }
10136
10137
10139 {
10140 return ConfigGetFloat("heatIsolation");
10141 }
10142
10144 {
10146 }
10147
10149 {
10150 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10151 if (
GetGame().ConfigIsExisting(paramPath))
10153
10154 return 0.0;
10155 }
10156
10158 {
10159 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10160 if (
GetGame().ConfigIsExisting(paramPath))
10162
10163 return 0.0;
10164 }
10165
10166 override void SetWet(
float value,
bool allow_client =
false)
10167 {
10168 if (!IsServerCheck(allow_client))
10169 return;
10170
10173
10175
10176 m_VarWet = Math.Clamp(value, min, max);
10177
10179 {
10182 }
10183 }
10184
10185 override void AddWet(
float value)
10186 {
10188 }
10189
10191 {
10193 }
10194
10196 {
10198 }
10199
10201 {
10203 }
10204
10206 {
10208 }
10209
10211 {
10213 }
10214
10215 override void OnWetChanged(
float newVal,
float oldVal)
10216 {
10219 if (newLevel != oldLevel)
10220 {
10222 }
10223 }
10224
10226 {
10227 SetWeightDirty();
10228 }
10229
10231 {
10232 return GetWetLevelInternal(
m_VarWet);
10233 }
10234
10235
10236
10238 {
10240 }
10241
10243 {
10245 }
10246
10248 {
10250 }
10251
10253 {
10255 }
10256
10257
10258
10260 {
10261 if (ConfigIsExisting("itemModelLength"))
10262 {
10263 return ConfigGetFloat("itemModelLength");
10264 }
10265 return 0;
10266 }
10267
10269 {
10270 if (ConfigIsExisting("itemAttachOffset"))
10271 {
10272 return ConfigGetFloat("itemAttachOffset");
10273 }
10274 return 0;
10275 }
10276
10277 override void SetCleanness(
int value,
bool allow_client =
false)
10278 {
10279 if (!IsServerCheck(allow_client))
10280 return;
10281
10283
10285
10288 }
10289
10291 {
10293 }
10294
10296 {
10297 return true;
10298 }
10299
10300
10301
10302
10304 {
10306 }
10307
10309 {
10311 }
10312
10313
10314
10315
10316 override void SetColor(
int r,
int g,
int b,
int a)
10317 {
10323 }
10325 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10326 {
10331 }
10332
10334 {
10336 }
10337
10340 {
10341 int r,g,b,a;
10343 r = r/255;
10344 g = g/255;
10345 b = b/255;
10346 a = a/255;
10347 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10348 }
10349
10350
10351
10352 override void SetLiquidType(
int value,
bool allow_client =
false)
10353 {
10354 if (!IsServerCheck(allow_client))
10355 return;
10356
10361 }
10362
10364 {
10365 return ConfigGetInt("varLiquidTypeInit");
10366 }
10367
10369 {
10371 }
10372
10374 {
10376 SetFrozen(false);
10377 }
10378
10381 {
10382 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10383 }
10384
10385
10388 {
10389 PlayerBase nplayer;
10390 if (PlayerBase.CastTo(nplayer, player))
10391 {
10393
10394 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10395 }
10396 }
10397
10398
10401 {
10402 PlayerBase nplayer;
10403 if (PlayerBase.CastTo(nplayer,player))
10404 {
10405
10406 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10407
10408 }
10409
10410
10411 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10412
10413
10414 if (HasEnergyManager())
10415 {
10416 GetCompEM().UpdatePlugState();
10417 }
10418 }
10419
10420
10422 {
10423 super.OnPlacementStarted(player);
10424
10426 }
10427
10428 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10429 {
10431 {
10432 m_AdminLog.OnPlacementComplete(player,
this);
10433 }
10434
10435 super.OnPlacementComplete(player, position, orientation);
10436 }
10437
10438
10439
10440
10441
10443 {
10445 {
10446 return true;
10447 }
10448 else
10449 {
10450 return false;
10451 }
10452 }
10453
10454
10456 {
10458 {
10460 }
10461 }
10462
10463
10465 {
10467 }
10468
10470 {
10472 }
10473
10474 override void InsertAgent(
int agent,
float count = 1)
10475 {
10476 if (count < 1)
10477 return;
10478
10480 }
10481
10484 {
10486 }
10487
10488
10490 {
10492 }
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10536 {
10538 return false;
10539 return true;
10540 }
10541
10543 {
10544
10546 }
10547
10548
10551 {
10552 super.CheckForRoofLimited(timeTresholdMS);
10553
10555 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10556 {
10557 m_PreviousRoofTestTime = time;
10558 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10559 }
10560 }
10561
10562
10564 {
10566 {
10567 return 0;
10568 }
10569
10570 if (GetInventory().GetAttachmentSlotsCount() != 0)
10571 {
10572 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10573 if (filter)
10574 return filter.GetProtectionLevel(type, false, system);
10575 else
10576 return 0;
10577 }
10578
10579 string subclassPath, entryName;
10580
10581 switch (type)
10582 {
10584 entryName = "biological";
10585 break;
10587 entryName = "chemical";
10588 break;
10589 default:
10590 entryName = "biological";
10591 break;
10592 }
10593
10594 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10595
10597 }
10598
10599
10600
10603 {
10604 if (!IsMagazine())
10606
10608 }
10609
10610
10611
10612
10613
10618 {
10619 return true;
10620 }
10621
10623 {
10625 }
10626
10627
10628
10629
10630
10632 {
10633 if (parent)
10634 {
10635 if (parent.IsInherited(DayZInfected))
10636 return true;
10637
10638 if (!parent.IsRuined())
10639 return true;
10640 }
10641
10642 return true;
10643 }
10644
10646 {
10647 if (!super.CanPutAsAttachment(parent))
10648 {
10649 return false;
10650 }
10651
10652 if (!IsRuined() && !parent.IsRuined())
10653 {
10654 return true;
10655 }
10656
10657 return false;
10658 }
10659
10661 {
10662
10663
10664
10665
10666 return super.CanReceiveItemIntoCargo(item);
10667 }
10668
10670 {
10671
10672
10673
10674
10675 GameInventory attachmentInv = attachment.GetInventory();
10677 {
10678 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10679 return false;
10680 }
10681
10682 InventoryLocation loc = new InventoryLocation();
10683 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10684 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10685 return false;
10686
10687 return super.CanReceiveAttachment(attachment, slotId);
10688 }
10689
10691 {
10692 if (!super.CanReleaseAttachment(attachment))
10693 return false;
10694
10695 return GetInventory().AreChildrenAccessible();
10696 }
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10719 {
10720 int id = muzzle_owner.GetMuzzleID();
10721 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10722
10723 if (WPOF_array)
10724 {
10725 for (int i = 0; i < WPOF_array.Count(); i++)
10726 {
10727 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10728
10729 if (WPOF)
10730 {
10731 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10732 }
10733 }
10734 }
10735 }
10736
10737
10739 {
10740 int id = muzzle_owner.GetMuzzleID();
10742
10743 if (WPOBE_array)
10744 {
10745 for (int i = 0; i < WPOBE_array.Count(); i++)
10746 {
10747 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10748
10749 if (WPOBE)
10750 {
10751 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10752 }
10753 }
10754 }
10755 }
10756
10757
10759 {
10760 int id = muzzle_owner.GetMuzzleID();
10761 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10762
10763 if (WPOOH_array)
10764 {
10765 for (int i = 0; i < WPOOH_array.Count(); i++)
10766 {
10767 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10768
10769 if (WPOOH)
10770 {
10771 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10772 }
10773 }
10774 }
10775 }
10776
10777
10779 {
10780 int id = muzzle_owner.GetMuzzleID();
10781 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10782
10783 if (WPOOH_array)
10784 {
10785 for (int i = 0; i < WPOOH_array.Count(); i++)
10786 {
10787 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10788
10789 if (WPOOH)
10790 {
10791 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10792 }
10793 }
10794 }
10795 }
10796
10797
10799 {
10800 int id = muzzle_owner.GetMuzzleID();
10801 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10802
10803 if (WPOOH_array)
10804 {
10805 for (int i = 0; i < WPOOH_array.Count(); i++)
10806 {
10807 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10808
10809 if (WPOOH)
10810 {
10811 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10812 }
10813 }
10814 }
10815 }
10816
10817
10818
10820 {
10822 {
10823 return true;
10824 }
10825
10826 return false;
10827 }
10828
10830 {
10832 {
10833 return true;
10834 }
10835
10836 return false;
10837 }
10838
10840 {
10842 {
10843 return true;
10844 }
10845
10846 return false;
10847 }
10848
10850 {
10851 return false;
10852 }
10853
10856 {
10857 return UATimeSpent.DEFAULT_DEPLOY;
10858 }
10859
10860
10861
10862
10864 {
10866 SetSynchDirty();
10867 }
10868
10870 {
10872 }
10873
10874
10876 {
10877 return false;
10878 }
10879
10882 {
10883 string att_type = "None";
10884
10885 if (ConfigIsExisting("soundAttType"))
10886 {
10887 att_type = ConfigGetString("soundAttType");
10888 }
10889
10891 }
10892
10894 {
10896 }
10897
10898
10899
10900
10901
10905
10907 {
10910
10912 }
10913
10914
10916 {
10918 return;
10919
10921
10924
10927
10928 SoundParameters params = new SoundParameters();
10932 }
10933
10934
10936 {
10938 return;
10939
10941 SetSynchDirty();
10942
10945 }
10946
10947
10949 {
10951 return;
10952
10954 SetSynchDirty();
10955
10958 }
10959
10961 {
10963 }
10964
10966 {
10968 }
10969
10972 {
10973 if (!
GetGame().IsDedicatedServer())
10974 {
10975 if (ConfigIsExisting("attachSoundSet"))
10976 {
10977 string cfg_path = "";
10978 string soundset = "";
10979 string type_name =
GetType();
10980
10983 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10984 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10985
10986 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10987 {
10988 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10989 {
10990 if (cfg_slot_array[i] == slot_type)
10991 {
10992 soundset = cfg_soundset_array[i];
10993 break;
10994 }
10995 }
10996 }
10997
10998 if (soundset != "")
10999 {
11000 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11002 }
11003 }
11004 }
11005 }
11006
11008 {
11009
11010 }
11011
11012 void OnApply(PlayerBase player);
11013
11015 {
11016 return 1.0;
11017 };
11018
11020 {
11022 }
11023
11025 {
11027 }
11028
11030
11032 {
11033 SetDynamicPhysicsLifeTime(0.01);
11035 }
11036
11038 {
11039 array<string> zone_names = new array<string>;
11040 GetDamageZones(zone_names);
11041 for (int i = 0; i < zone_names.Count(); i++)
11042 {
11043 SetHealthMax(zone_names.Get(i),"Health");
11044 }
11045 SetHealthMax("","Health");
11046 }
11047
11050 {
11051 float global_health = GetHealth01("","Health");
11052 array<string> zones = new array<string>;
11053 GetDamageZones(zones);
11054
11055 for (int i = 0; i < zones.Count(); i++)
11056 {
11057 SetHealth01(zones.Get(i),"Health",global_health);
11058 }
11059 }
11060
11063 {
11064 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11065 }
11066
11068 {
11069 if (!hasRootAsPlayer)
11070 {
11071 if (refParentIB)
11072 {
11073
11074 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11075 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11076
11077 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11078 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11079
11082 }
11083 else
11084 {
11085
11088 }
11089 }
11090 }
11091
11093 {
11095 {
11096 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11097 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11098 {
11099 float heatPermCoef = 1.0;
11101 while (ent)
11102 {
11103 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11104 ent = ent.GetHierarchyParent();
11105 }
11106
11107 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11108 }
11109 }
11110 }
11111
11113 {
11114
11115 EntityAI parent = GetHierarchyParent();
11116 if (!parent)
11117 {
11118 hasParent = false;
11119 hasRootAsPlayer = false;
11120 }
11121 else
11122 {
11123 hasParent = true;
11124 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11125 refParentIB =
ItemBase.Cast(parent);
11126 }
11127 }
11128
11129 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11130 {
11131
11132 }
11133
11135 {
11136
11137 return false;
11138 }
11139
11141 {
11142
11143
11144 return false;
11145 }
11146
11148 {
11149
11150 return false;
11151 }
11152
11155 {
11156 return !GetIsFrozen() &&
IsOpen();
11157 }
11158
11160 {
11161 bool hasParent = false, hasRootAsPlayer = false;
11163
11164 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11165 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11166
11167 if (wwtu || foodDecay)
11168 {
11172
11173 if (processWetness || processTemperature || processDecay)
11174 {
11176
11177 if (processWetness)
11178 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11179
11180 if (processTemperature)
11182
11183 if (processDecay)
11184 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11185 }
11186 }
11187 }
11188
11191 {
11193 }
11194
11196 {
11199
11200 return super.GetTemperatureFreezeThreshold();
11201 }
11202
11204 {
11207
11208 return super.GetTemperatureThawThreshold();
11209 }
11210
11212 {
11215
11216 return super.GetItemOverheatThreshold();
11217 }
11218
11220 {
11222 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11223
11224 return super.GetTemperatureFreezeTime();
11225 }
11226
11228 {
11230 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11231
11232 return super.GetTemperatureThawTime();
11233 }
11234
11239
11241 {
11242 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11243 }
11244
11246 {
11247 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11248 }
11249
11252 {
11254 }
11255
11257 {
11259 }
11260
11262 {
11264 }
11265
11268 {
11269 return null;
11270 }
11271
11274 {
11275 return false;
11276 }
11277
11279 {
11281 {
11284 if (!trg)
11285 {
11287 explosive = this;
11288 }
11289
11290 explosive.PairRemote(trg);
11292
11293 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11294 trg.SetPersistentPairID(persistentID);
11295 explosive.SetPersistentPairID(persistentID);
11296
11297 return true;
11298 }
11299 return false;
11300 }
11301
11304 {
11305 float ret = 1.0;
11308 ret *= GetHealth01();
11309
11310 return ret;
11311 }
11312
11313 #ifdef DEVELOPER
11314 override void SetDebugItem()
11315 {
11316 super.SetDebugItem();
11317 _itemBase = this;
11318 }
11319
11321 {
11322 string text = super.GetDebugText();
11323
11325 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11326
11327 return text;
11328 }
11329 #endif
11330
11332 {
11333 return true;
11334 }
11335
11337
11339
11341 {
11344 }
11345
11346
11354
11370}
11371
11373{
11375 if (entity)
11376 {
11377 bool is_item = entity.IsInherited(
ItemBase);
11378 if (is_item && full_quantity)
11379 {
11382 }
11383 }
11384 else
11385 {
11387 return NULL;
11388 }
11389 return entity;
11390}
11391
11393{
11394 if (item)
11395 {
11396 if (health > 0)
11397 item.SetHealth("", "", health);
11398
11399 if (item.CanHaveTemperature())
11400 {
11402 if (item.CanFreeze())
11403 item.SetFrozen(false);
11404 }
11405
11406 if (item.HasEnergyManager())
11407 {
11408 if (quantity >= 0)
11409 {
11410 item.GetCompEM().SetEnergy0To1(quantity);
11411 }
11412 else
11413 {
11415 }
11416 }
11417 else if (item.IsMagazine())
11418 {
11419 Magazine mag = Magazine.Cast(item);
11420 if (quantity >= 0)
11421 {
11422 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11423 }
11424 else
11425 {
11427 }
11428
11429 }
11430 else
11431 {
11432 if (quantity >= 0)
11433 {
11434 item.SetQuantityNormalized(quantity, false);
11435 }
11436 else
11437 {
11439 }
11440
11441 }
11442 }
11443}
11444
11445#ifdef DEVELOPER
11447#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.