6723{
6725 {
6726 return true;
6727 }
6728};
6729
6730
6731
6733{
6737
6739
6742
6743
6744
6745
6746
6755
6761
6766
6771
6792 protected bool m_IsResultOfSplit
6793
6795
6800
6801
6802
6804
6808
6809
6810
6812
6815
6816
6817
6823
6824
6832
6835
6836
6838
6839
6841
6842
6847
6848
6853
6854
6856
6857
6859 {
6864
6865 if (!
GetGame().IsDedicatedServer())
6866 {
6868 {
6870
6872 {
6874 }
6875 }
6876
6879 }
6880
6881 m_OldLocation = null;
6882
6884 {
6886 }
6887
6888 if (ConfigIsExisting("headSelectionsToHide"))
6889 {
6892 }
6893
6895 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6896 {
6898 }
6899
6901
6902 m_IsResultOfSplit = false;
6903
6905 }
6906
6908 {
6909 super.InitItemVariables();
6910
6916 m_Count = ConfigGetInt(
"count");
6917
6920
6925
6928
6933
6945
6949
6950
6953 if (ConfigIsExisting("canBeSplit"))
6954 {
6957 }
6958
6960 if (ConfigIsExisting("itemBehaviour"))
6962
6963
6966 RegisterNetSyncVariableInt("m_VarLiquidType");
6967 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6968
6969 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6970 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6971 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6972
6973 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6974 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6975 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6976 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6977
6978 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6979 RegisterNetSyncVariableBool("m_IsTakeable");
6980 RegisterNetSyncVariableBool("m_IsHologram");
6981
6984 {
6987 }
6988
6990
6992 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6994
6995 }
6996
6998 {
7000 }
7001
7003 {
7006 {
7011 }
7012 }
7013
7014 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7015 {
7017 {
7020 }
7021
7023 }
7024
7026 {
7032 }
7033
7035
7037 {
7039
7040 if (!action)
7041 {
7042 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7043 return;
7044 }
7045
7047 if (!ai)
7048 {
7050 return;
7051 }
7052
7054 if (!action_array)
7055 {
7056 action_array = new array<ActionBase_Basic>;
7058 }
7059 if (LogManager.IsActionLogEnable())
7060 {
7061 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7062 }
7063
7064 if (action_array.Find(action) != -1)
7065 {
7066 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7067 }
7068 else
7069 {
7070 action_array.Insert(action);
7071 }
7072 }
7073
7075 {
7077 ActionBase action = player.GetActionManager().GetAction(actionName);
7080
7081 if (action_array)
7082 {
7083 action_array.RemoveItem(action);
7084 }
7085 }
7086
7087
7088
7090 {
7091 ActionOverrideData overrideData = new ActionOverrideData();
7095
7097 if (!actionMap)
7098 {
7101 }
7102
7103 actionMap.Insert(this.
Type(), overrideData);
7104
7105 }
7106
7108
7110
7111
7113 {
7116
7119
7120 string config_to_search = "CfgVehicles";
7121 string muzzle_owner_config;
7122
7124 {
7125 if (IsInherited(Weapon))
7126 config_to_search = "CfgWeapons";
7127
7128 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7129
7130 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7131
7133
7134 if (config_OnFire_subclass_count > 0)
7135 {
7136 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7137
7138 for (int i = 0; i < config_OnFire_subclass_count; i++)
7139 {
7140 string particle_class = "";
7142 string config_OnFire_entry = config_OnFire_class + particle_class;
7143 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7144 WPOF_array.Insert(WPOF);
7145 }
7146
7147
7149 }
7150 }
7151
7153 {
7154 config_to_search = "CfgWeapons";
7155 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7156
7157 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7158
7160
7161 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7162 {
7163 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7164
7165 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7166 {
7167 string particle_class2 = "";
7169 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7170 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7171 WPOBE_array.Insert(WPOBE);
7172 }
7173
7174
7176 }
7177 }
7178 }
7179
7180
7182 {
7185
7187 {
7188 string config_to_search = "CfgVehicles";
7189
7190 if (IsInherited(Weapon))
7191 config_to_search = "CfgWeapons";
7192
7193 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7194 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7195
7196 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7197 {
7198
7200
7202 {
7204 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7206 return;
7207 }
7208
7211
7212
7213
7215 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7216
7217 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7218 {
7219 string particle_class = "";
7221 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7223
7224 if (entry_type == CT_CLASS)
7225 {
7226 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7227 WPOOH_array.Insert(WPOF);
7228 }
7229 }
7230
7231
7233 }
7234 }
7235 }
7236
7238 {
7240 }
7241
7243 {
7245 {
7247
7250
7253
7254 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7255 }
7256 }
7257
7259 {
7261 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7262
7264 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7265
7267 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7268
7270 {
7272 }
7273 }
7274
7276 {
7278 }
7279
7281 {
7284 else
7286
7288 {
7291 }
7292 else
7293 {
7296
7299 }
7300
7302 }
7303
7305 {
7307 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7308 }
7309
7311 {
7313 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7315 }
7316
7318 {
7320 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7321 }
7322
7324 {
7327
7328 OverheatingParticle OP = new OverheatingParticle();
7333
7335 }
7336
7338 {
7341
7342 return -1;
7343 }
7344
7346 {
7348 {
7351
7352 for (int i = count; i > 0; --i)
7353 {
7354 int id = i - 1;
7357
7360
7361 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7362 {
7363 if (p)
7364 {
7367 }
7368 }
7369 }
7370 }
7371 }
7372
7374 {
7376 {
7378 {
7379 int id = i - 1;
7381
7382 if (OP)
7383 {
7385
7386 if (p)
7387 {
7389 }
7390
7391 delete OP;
7392 }
7393 }
7394
7397 }
7398 }
7399
7402 {
7403 return 0.0;
7404 }
7405
7406
7408 {
7409 return 250;
7410 }
7411
7413 {
7414 return 0;
7415 }
7416
7419 {
7421 return true;
7422
7423 return false;
7424 }
7425
7428 {
7431
7433 {
7435 }
7436 else
7437 {
7438
7440 }
7441
7443 }
7444
7451 {
7452 return -1;
7453 }
7454
7455
7456
7457
7459 {
7461 {
7463 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7464
7465 if (r_index >= 0)
7466 {
7467 InventoryLocation r_il = new InventoryLocation;
7468 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7469
7470 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7473 {
7474 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7475 }
7477 {
7478 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7479 }
7480
7481 }
7482
7483 player.GetHumanInventory().ClearUserReservedLocation(this);
7484 }
7485
7488 }
7489
7490
7491
7492
7494 {
7495 return ItemBase.m_DebugActionsMask;
7496 }
7497
7499 {
7500 return ItemBase.m_DebugActionsMask & mask;
7501 }
7502
7504 {
7505 ItemBase.m_DebugActionsMask = mask;
7506 }
7507
7509 {
7510 ItemBase.m_DebugActionsMask |= mask;
7511 }
7512
7514 {
7515 ItemBase.m_DebugActionsMask &= ~mask;
7516 }
7517
7519 {
7521 {
7523 }
7524 else
7525 {
7527 }
7528 }
7529
7530
7532 {
7533 if (GetEconomyProfile())
7534 {
7535 float q_max = GetEconomyProfile().GetQuantityMax();
7536 if (q_max > 0)
7537 {
7538 float q_min = GetEconomyProfile().GetQuantityMin();
7539 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7540
7542 {
7543 ComponentEnergyManager comp = GetCompEM();
7545 {
7547 }
7548 }
7550 {
7552
7553 }
7554
7555 }
7556 }
7557 }
7558
7561 {
7562 EntityAI parent = GetHierarchyParent();
7563
7564 if (parent)
7565 {
7566 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7567 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7568 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7569 }
7570 }
7571
7574 {
7575 EntityAI parent = GetHierarchyParent();
7576
7577 if (parent)
7578 {
7579 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7580 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7581 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7582 }
7583 }
7584
7586 {
7587
7588
7589
7590
7592
7594 {
7595 if (ScriptInputUserData.CanStoreInputUserData())
7596 {
7597 ScriptInputUserData ctx = new ScriptInputUserData;
7603 ctx.
Write(use_stack_max);
7606
7608 {
7609 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7610 }
7611 }
7612 }
7613 else if (!
GetGame().IsMultiplayer())
7614 {
7616 }
7617 }
7618
7620 {
7622 }
7623
7625 {
7627 }
7628
7630 {
7632 }
7633
7635 {
7636
7637 return false;
7638 }
7639
7641 {
7642 return false;
7643 }
7644
7648 {
7649 return false;
7650 }
7651
7653 {
7654 return "";
7655 }
7656
7658
7660 {
7661 return false;
7662 }
7663
7665 {
7666 return true;
7667 }
7668
7669
7670
7672 {
7673 return true;
7674 }
7675
7677 {
7678 return true;
7679 }
7680
7682 {
7683 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7685 }
7686
7688 {
7690 }
7691
7693 {
7695 if (!is_being_placed)
7697 SetSynchDirty();
7698 }
7699
7700
7702
7704 {
7706 }
7707
7709 {
7711 }
7712
7714 {
7715 return 1;
7716 }
7717
7719 {
7720 return false;
7721 }
7722
7724 {
7726 SetSynchDirty();
7727 }
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7764 {
7765 super.OnMovedInsideCargo(container);
7766
7767 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7768 }
7769
7770 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7771 {
7772 super.EEItemLocationChanged(oldLoc,newLoc);
7773
7774 PlayerBase new_player = null;
7775 PlayerBase old_player = null;
7776
7777 if (newLoc.GetParent())
7778 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7779
7780 if (oldLoc.GetParent())
7781 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7782
7784 {
7785 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7786
7787 if (r_index >= 0)
7788 {
7789 InventoryLocation r_il = new InventoryLocation;
7790 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7791
7792 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7795 {
7796 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7797 }
7799 {
7800 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7801 }
7802
7803 }
7804 }
7805
7807 {
7808 if (new_player)
7809 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7810
7811 if (new_player == old_player)
7812 {
7813
7814 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7815 {
7817 {
7818 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7819 {
7820 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7821 }
7822 }
7823 else
7824 {
7825 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7826 }
7827 }
7828
7829 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7830 {
7831 int type = oldLoc.GetType();
7833 {
7834 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7835 }
7837 {
7838 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7839 }
7840 }
7841 if (!m_OldLocation)
7842 {
7843 m_OldLocation = new InventoryLocation;
7844 }
7845 m_OldLocation.Copy(oldLoc);
7846 }
7847 else
7848 {
7849 if (m_OldLocation)
7850 {
7851 m_OldLocation.Reset();
7852 }
7853 }
7854
7856 }
7857 else
7858 {
7859 if (new_player)
7860 {
7861 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7862 if (res_index >= 0)
7863 {
7864 InventoryLocation il = new InventoryLocation;
7865 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7867 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7870 {
7871 il.
GetParent().GetOnReleaseLock().Invoke(it);
7872 }
7874 {
7876 }
7877
7878 }
7879 }
7881 {
7882
7884 }
7885
7886 if (m_OldLocation)
7887 {
7888 m_OldLocation.Reset();
7889 }
7890 }
7891 }
7892
7893 override void EOnContact(IEntity other, Contact extra)
7894 {
7896 {
7897 int liquidType = -1;
7899 if (impactSpeed > 0.0)
7900 {
7902 #ifndef SERVER
7904 #else
7906 SetSynchDirty();
7907 #endif
7909 }
7910 }
7911
7912 #ifdef SERVER
7913 if (GetCompEM() && GetCompEM().IsPlugged())
7914 {
7915 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7916 GetCompEM().UnplugThis();
7917 }
7918 #endif
7919 }
7920
7922
7924 {
7926 }
7927
7929 {
7930
7931 }
7932
7934 {
7935 super.OnItemLocationChanged(old_owner, new_owner);
7936
7937 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7938 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7939
7940 if (!relatedPlayer && playerNew)
7941 relatedPlayer = playerNew;
7942
7943 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7944 {
7946 if (actionMgr)
7947 {
7948 ActionBase currentAction = actionMgr.GetRunningAction();
7949 if (currentAction)
7951 }
7952 }
7953
7954 Man ownerPlayerOld = null;
7955 Man ownerPlayerNew = null;
7956
7957 if (old_owner)
7958 {
7959 if (old_owner.
IsMan())
7960 {
7961 ownerPlayerOld = Man.Cast(old_owner);
7962 }
7963 else
7964 {
7965 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7966 }
7967 }
7968 else
7969 {
7971 {
7973
7974 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7975 {
7976 GetCompEM().UnplugThis();
7977 }
7978 }
7979 }
7980
7981 if (new_owner)
7982 {
7983 if (new_owner.
IsMan())
7984 {
7985 ownerPlayerNew = Man.Cast(new_owner);
7986 }
7987 else
7988 {
7989 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7990 }
7991 }
7992
7993 if (ownerPlayerOld != ownerPlayerNew)
7994 {
7995 if (ownerPlayerOld)
7996 {
7997 array<EntityAI> subItemsExit = new array<EntityAI>;
7999 for (int i = 0; i < subItemsExit.Count(); i++)
8000 {
8003 }
8004 }
8005
8006 if (ownerPlayerNew)
8007 {
8008 array<EntityAI> subItemsEnter = new array<EntityAI>;
8010 for (int j = 0; j < subItemsEnter.Count(); j++)
8011 {
8014 }
8015 }
8016 }
8017 else if (ownerPlayerNew != null)
8018 {
8019 PlayerBase nplayer;
8020 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8021 {
8022 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8024 for (int k = 0; k < subItemsUpdate.Count(); k++)
8025 {
8027 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8028 }
8029 }
8030 }
8031
8032 if (old_owner)
8033 old_owner.OnChildItemRemoved(this);
8034 if (new_owner)
8035 new_owner.OnChildItemReceived(this);
8036 }
8037
8038
8040 {
8041 super.EEDelete(parent);
8042 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8043 if (player)
8044 {
8046
8047 if (player.IsAlive())
8048 {
8049 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8050 if (r_index >= 0)
8051 {
8052 InventoryLocation r_il = new InventoryLocation;
8053 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8054
8055 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8058 {
8059 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8060 }
8062 {
8063 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8064 }
8065
8066 }
8067
8068 player.RemoveQuickBarEntityShortcut(this);
8069 }
8070 }
8071 }
8072
8074 {
8075 super.EEKilled(killer);
8076
8079 {
8080 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8081 {
8082 if (IsMagazine())
8083 {
8084 if (Magazine.Cast(this).GetAmmoCount() > 0)
8085 {
8087 }
8088 }
8089 else
8090 {
8092 }
8093 }
8094 }
8095 }
8096
8098 {
8099 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8100
8101 super.OnWasAttached(parent, slot_id);
8102
8105
8107 }
8108
8110 {
8111 super.OnWasDetached(parent, slot_id);
8112
8115 }
8116
8118 {
8119 int idx;
8122
8123 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8124 if (inventory_slots.Count() < 1)
8125 {
8126 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8127 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8128 }
8129 else
8130 {
8131 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8132 }
8133
8134 idx = inventory_slots.Find(slot);
8135 if (idx < 0)
8136 return "";
8137
8138 return attach_types.Get(idx);
8139 }
8140
8142 {
8143 int idx = -1;
8144 string slot;
8145
8148
8149 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8150 if (inventory_slots.Count() < 1)
8151 {
8152 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8153 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8154 }
8155 else
8156 {
8157 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8158 if (detach_types.Count() < 1)
8159 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8160 }
8161
8162 for (int i = 0; i < inventory_slots.Count(); i++)
8163 {
8164 slot = inventory_slots.Get(i);
8165 }
8166
8167 if (slot != "")
8168 {
8169 if (detach_types.Count() == 1)
8170 idx = 0;
8171 else
8172 idx = inventory_slots.Find(slot);
8173 }
8174 if (idx < 0)
8175 return "";
8176
8177 return detach_types.Get(idx);
8178 }
8179
8181 {
8182
8184
8185
8186 float min_time = 1;
8187 float max_time = 3;
8188 float delay = Math.RandomFloat(min_time, max_time);
8189
8190 explode_timer.Run(delay, this, "DoAmmoExplosion");
8191 }
8192
8194 {
8195 Magazine magazine = Magazine.Cast(this);
8196 int pop_sounds_count = 6;
8197 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8198
8199
8200 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8201 string sound_name = pop_sounds[ sound_idx ];
8203
8204
8205 magazine.ServerAddAmmoCount(-1);
8206
8207
8208 float min_temp_to_explode = 100;
8209
8210 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
8211 {
8213 }
8214 }
8215
8216
8217 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8218 {
8219 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8220
8221 const int CHANCE_DAMAGE_CARGO = 4;
8222 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8223 const int CHANCE_DAMAGE_NOTHING = 2;
8224
8226 {
8227 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8228 int chances;
8229 int rnd;
8230
8231 if (GetInventory().GetCargo())
8232 {
8233 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8234 rnd = Math.RandomInt(0,chances);
8235
8236 if (rnd < CHANCE_DAMAGE_CARGO)
8237 {
8239 }
8240 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8241 {
8243 }
8244 }
8245 else
8246 {
8247 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8248 rnd = Math.RandomInt(0,chances);
8249
8250 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8251 {
8253 }
8254 }
8255 }
8256 }
8257
8259 {
8260 if (GetInventory().GetCargo())
8261 {
8262 int item_count = GetInventory().GetCargo().GetItemCount();
8263 if (item_count > 0)
8264 {
8265 int random_pick = Math.RandomInt(0, item_count);
8267 if (!item.IsExplosive())
8268 {
8269 item.AddHealth("","",damage);
8270 return true;
8271 }
8272 }
8273 }
8274 return false;
8275 }
8276
8278 {
8279 int attachment_count = GetInventory().AttachmentCount();
8280 if (attachment_count > 0)
8281 {
8282 int random_pick = Math.RandomInt(0, attachment_count);
8283 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8284 if (!attachment.IsExplosive())
8285 {
8286 attachment.AddHealth("","",damage);
8287 return true;
8288 }
8289 }
8290 return false;
8291 }
8292
8294 {
8296 }
8297
8299 {
8301 return GetInventory().CanRemoveEntity();
8302
8303 return false;
8304 }
8305
8307 {
8308
8310 return false;
8311
8312
8314 return false;
8315
8316
8317
8319 if (delta == 0)
8320 return false;
8321
8322
8323 return true;
8324 }
8325
8327 {
8329 {
8330 if (ScriptInputUserData.CanStoreInputUserData())
8331 {
8332 ScriptInputUserData ctx = new ScriptInputUserData;
8337 ctx.
Write(destination_entity);
8341 }
8342 }
8343 else if (!
GetGame().IsMultiplayer())
8344 {
8346 }
8347 }
8348
8350 {
8351 float split_quantity_new;
8355 InventoryLocation loc = new InventoryLocation;
8356
8357 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8358 {
8360 split_quantity_new = stack_max;
8361 else
8363
8365 {
8366 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8367 if (new_item)
8368 {
8369 new_item.SetResultOfSplit(true);
8370 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8372 new_item.
SetQuantity(split_quantity_new,
false,
true);
8373 }
8374 }
8375 }
8376 else if (destination_entity && slot_id == -1)
8377 {
8378 if (quantity > stack_max)
8379 split_quantity_new = stack_max;
8380 else
8381 split_quantity_new = quantity;
8382
8384 {
8386 {
8389 }
8390
8391 if (new_item)
8392 {
8393 new_item.SetResultOfSplit(true);
8394 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8396 new_item.
SetQuantity(split_quantity_new,
false,
true);
8397 }
8398 }
8399 }
8400 else
8401 {
8402 if (stack_max != 0)
8403 {
8405 {
8407 }
8408
8409 if (split_quantity_new == 0)
8410 {
8411 if (!
GetGame().IsMultiplayer())
8412 player.PhysicalPredictiveDropItem(this);
8413 else
8414 player.ServerDropEntity(this);
8415 return;
8416 }
8417
8419 {
8421
8422 if (new_item)
8423 {
8424 new_item.SetResultOfSplit(true);
8425 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8428 new_item.PlaceOnSurface();
8429 }
8430 }
8431 }
8432 }
8433 }
8434
8436 {
8437 float split_quantity_new;
8441 InventoryLocation loc = new InventoryLocation;
8442
8443 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8444 {
8446 split_quantity_new = stack_max;
8447 else
8449
8451 {
8452 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8453 if (new_item)
8454 {
8455 new_item.SetResultOfSplit(true);
8456 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8458 new_item.
SetQuantity(split_quantity_new,
false,
true);
8459 }
8460 }
8461 }
8462 else if (destination_entity && slot_id == -1)
8463 {
8464 if (quantity > stack_max)
8465 split_quantity_new = stack_max;
8466 else
8467 split_quantity_new = quantity;
8468
8470 {
8472 {
8475 }
8476
8477 if (new_item)
8478 {
8479 new_item.SetResultOfSplit(true);
8480 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8482 new_item.
SetQuantity(split_quantity_new,
false,
true);
8483 }
8484 }
8485 }
8486 else
8487 {
8488 if (stack_max != 0)
8489 {
8491 {
8493 }
8494
8496 {
8498
8499 if (new_item)
8500 {
8501 new_item.SetResultOfSplit(true);
8502 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8505 new_item.PlaceOnSurface();
8506 }
8507 }
8508 }
8509 }
8510 }
8511
8513 {
8515 {
8516 if (ScriptInputUserData.CanStoreInputUserData())
8517 {
8518 ScriptInputUserData ctx = new ScriptInputUserData;
8523 dst.WriteToContext(ctx);
8525 }
8526 }
8527 else if (!
GetGame().IsMultiplayer())
8528 {
8530 }
8531 }
8532
8534 {
8536 {
8537 if (ScriptInputUserData.CanStoreInputUserData())
8538 {
8539 ScriptInputUserData ctx = new ScriptInputUserData;
8544 ctx.
Write(destination_entity);
8550 }
8551 }
8552 else if (!
GetGame().IsMultiplayer())
8553 {
8555 }
8556 }
8557
8559 {
8561 }
8562
8564 {
8566 float split_quantity_new;
8568 if (dst.IsValid())
8569 {
8570 int slot_id = dst.GetSlot();
8572
8573 if (quantity > stack_max)
8574 split_quantity_new = stack_max;
8575 else
8576 split_quantity_new = quantity;
8577
8579 {
8581
8582 if (new_item)
8583 {
8584 new_item.SetResultOfSplit(true);
8585 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8587 new_item.
SetQuantity(split_quantity_new,
false,
true);
8588 }
8589
8590 return new_item;
8591 }
8592 }
8593
8594 return null;
8595 }
8596
8598 {
8600 float split_quantity_new;
8602 if (destination_entity)
8603 {
8605 if (quantity > stackable)
8606 split_quantity_new = stackable;
8607 else
8608 split_quantity_new = quantity;
8609
8611 {
8612 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8613 if (new_item)
8614 {
8615 new_item.SetResultOfSplit(true);
8616 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8618 new_item.
SetQuantity(split_quantity_new,
false,
true);
8619 }
8620 }
8621 }
8622 }
8623
8625 {
8627 {
8628 if (ScriptInputUserData.CanStoreInputUserData())
8629 {
8630 ScriptInputUserData ctx = new ScriptInputUserData;
8635 ItemBase destination_entity =
this;
8636 ctx.
Write(destination_entity);
8640 }
8641 }
8642 else if (!
GetGame().IsMultiplayer())
8643 {
8645 }
8646 }
8647
8649 {
8651 float split_quantity_new;
8653 if (player)
8654 {
8656 if (quantity > stackable)
8657 split_quantity_new = stackable;
8658 else
8659 split_quantity_new = quantity;
8660
8662 {
8663 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8664 new_item =
ItemBase.Cast(in_hands);
8665 if (new_item)
8666 {
8667 new_item.SetResultOfSplit(true);
8668 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8670 new_item.SetQuantity(split_quantity_new, false, true);
8671 }
8672 }
8673 }
8674 }
8675
8677 {
8679 float split_quantity_new = Math.Floor(quantity * 0.5);
8680
8682 return;
8683
8685
8686 if (new_item)
8687 {
8688 if (new_item.GetQuantityMax() < split_quantity_new)
8689 {
8690 split_quantity_new = new_item.GetQuantityMax();
8691 }
8692
8693 new_item.SetResultOfSplit(true);
8694 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8695
8697 {
8700 }
8701 else
8702 {
8704 new_item.
SetQuantity(split_quantity_new,
false,
true);
8705 }
8706 }
8707 }
8708
8710 {
8712 float split_quantity_new = Math.Floor(quantity / 2);
8713
8715 return;
8716
8717 InventoryLocation invloc = new InventoryLocation;
8719
8721 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8722
8723 if (new_item)
8724 {
8725 if (new_item.GetQuantityMax() < split_quantity_new)
8726 {
8727 split_quantity_new = new_item.GetQuantityMax();
8728 }
8730 {
8733 }
8734 else if (split_quantity_new > 1)
8735 {
8737 new_item.
SetQuantity(split_quantity_new,
false,
true);
8738 }
8739 }
8740 }
8741
8744 {
8745 SetWeightDirty();
8747
8748 if (parent)
8749 parent.OnAttachmentQuantityChangedEx(this, delta);
8750
8752 {
8754 {
8756 }
8758 {
8759 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8761 }
8762 }
8763
8764 }
8765
8768 {
8769
8770 }
8771
8774 {
8776 }
8777
8779 {
8780 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8781
8783 {
8784 if (newLevel == GameConstants.STATE_RUINED)
8785 {
8787 EntityAI parent = GetHierarchyParent();
8788 if (parent && parent.IsFireplace())
8789 {
8790 CargoBase cargo = GetInventory().GetCargo();
8791 if (cargo)
8792 {
8794 {
8796 }
8797 }
8798 }
8799 }
8800
8802 {
8803
8805 return;
8806 }
8807
8808 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8809 {
8811 }
8812 }
8813 }
8814
8815
8817 {
8818 super.OnRightClick();
8819
8821 {
8823 {
8824 if (ScriptInputUserData.CanStoreInputUserData())
8825 {
8826 EntityAI root = GetHierarchyRoot();
8827 Man playerOwner = GetHierarchyRootPlayer();
8828 InventoryLocation dst = new InventoryLocation;
8829
8830
8831 if (!playerOwner && root && root == this)
8832 {
8834 }
8835 else
8836 {
8837
8838 GetInventory().GetCurrentInventoryLocation(dst);
8840 {
8843 {
8845 }
8846 else
8847 {
8849
8850
8851 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8852 {
8854 }
8855 else
8856 {
8857 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8858 }
8859 }
8860 }
8861 }
8862
8863 ScriptInputUserData ctx = new ScriptInputUserData;
8871 }
8872 }
8873 else if (!
GetGame().IsMultiplayer())
8874 {
8876 }
8877 }
8878 }
8879
8881 {
8882 if (root)
8883 {
8884 vector m4[4];
8885 root.GetTransform(m4);
8886 dst.SetGround(this, m4);
8887 }
8888 else
8889 {
8890 GetInventory().GetCurrentInventoryLocation(dst);
8891 }
8892 }
8893
8894 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8895 {
8896
8897 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8898 return false;
8899
8900 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8901 return false;
8902
8903
8905 return false;
8906
8907
8908 Magazine mag = Magazine.Cast(this);
8909 if (mag)
8910 {
8911 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8912 return false;
8913
8914 if (stack_max_limit)
8915 {
8916 Magazine other_mag = Magazine.Cast(other_item);
8917 if (other_item)
8918 {
8919 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8920 return false;
8921 }
8922
8923 }
8924 }
8925 else
8926 {
8927
8929 return false;
8930
8932 return false;
8933 }
8934
8935 PlayerBase player = null;
8936 if (CastTo(player, GetHierarchyRootPlayer()))
8937 {
8938 if (player.GetInventory().HasAttachment(this))
8939 return false;
8940
8941 if (player.IsItemsToDelete())
8942 return false;
8943 }
8944
8945 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8946 return false;
8947
8948 int slotID;
8950 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8951 return false;
8952
8953 return true;
8954 }
8955
8957 {
8959 }
8960
8962 {
8963 return m_IsResultOfSplit;
8964 }
8965
8967 {
8968 m_IsResultOfSplit = value;
8969 }
8970
8972 {
8974 }
8975
8977 {
8978 float other_item_quantity = other_item.GetQuantity();
8979 float this_free_space;
8980
8982
8984
8985 if (other_item_quantity > this_free_space)
8986 {
8987 return this_free_space;
8988 }
8989 else
8990 {
8991 return other_item_quantity;
8992 }
8993 }
8994
8996 {
8998 }
8999
9001 {
9003 return;
9004
9005 if (!IsMagazine() && other_item)
9006 {
9008 if (quantity_used != 0)
9009 {
9010 float hp1 = GetHealth01("","");
9011 float hp2 = other_item.GetHealth01("","");
9012 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9013 hpResult = hpResult / (
GetQuantity() + quantity_used);
9014
9015 hpResult *= GetMaxHealth();
9016 Math.Round(hpResult);
9017 SetHealth("", "Health", hpResult);
9018
9020 other_item.AddQuantity(-quantity_used);
9021 }
9022 }
9024 }
9025
9027 {
9028 #ifdef SERVER
9029 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9030 GetHierarchyParent().IncreaseLifetimeUp();
9031 #endif
9032 };
9033
9035 {
9036 PlayerBase p = PlayerBase.Cast(player);
9037
9038 array<int> recipesIds = p.m_Recipes;
9039 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9040 if (moduleRecipesManager)
9041 {
9042 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9043 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9044 }
9045
9046 for (int i = 0;i < recipesIds.Count(); i++)
9047 {
9048 int key = recipesIds.Get(i);
9049 string recipeName = moduleRecipesManager.GetRecipeName(key);
9051 }
9052 }
9053
9054
9055 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9056 {
9057 super.GetDebugActions(outputList);
9058
9059
9065
9066
9071
9076
9077
9081
9082
9084 {
9088 }
9089
9092
9093
9097
9099
9100 InventoryLocation loc = new InventoryLocation();
9101 GetInventory().GetCurrentInventoryLocation(loc);
9103 {
9104 if (Gizmo_IsSupported())
9107 }
9108
9110 }
9111
9112
9113
9114
9116 {
9117 super.OnAction(action_id, player, ctx);
9118
9120 {
9121 switch (action_id)
9122 {
9125 return true;
9128 return true;
9129 }
9130 }
9131
9133 {
9134 switch (action_id)
9135 {
9137 Delete();
9138 return true;
9139 }
9140 }
9141
9142 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9143 {
9144 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9145 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9146 PlayerBase p = PlayerBase.Cast(player);
9147 if (
EActions.RECIPES_RANGE_START < 1000)
9148 {
9149 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9150 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9151 }
9152 }
9153 #ifndef SERVER
9154 else if (action_id ==
EActions.WATCH_PLAYER)
9155 {
9156 PluginDeveloper.SetDeveloperItemClientEx(player);
9157 }
9158 #endif
9160 {
9161 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9162 {
9163 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9164 OnDebugButtonPressServer(id + 1);
9165 }
9166
9167 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9168 {
9169 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9171 }
9172
9173 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9174 {
9175 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9177 }
9178
9179 else if (action_id ==
EActions.ADD_QUANTITY)
9180 {
9181 if (IsMagazine())
9182 {
9183 Magazine mag = Magazine.Cast(this);
9184 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9185 }
9186 else
9187 {
9189 }
9190
9191 if (m_EM)
9192 {
9193 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9194 }
9195
9196 }
9197
9198 else if (action_id ==
EActions.REMOVE_QUANTITY)
9199 {
9200 if (IsMagazine())
9201 {
9202 Magazine mag2 = Magazine.Cast(this);
9203 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9204 }
9205 else
9206 {
9208 }
9209 if (m_EM)
9210 {
9211 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9212 }
9213
9214 }
9215
9216 else if (action_id ==
EActions.SET_QUANTITY_0)
9217 {
9219
9220 if (m_EM)
9221 {
9222 m_EM.SetEnergy(0);
9223 }
9224 }
9225
9226 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9227 {
9229
9230 if (m_EM)
9231 {
9232 m_EM.SetEnergy(m_EM.GetEnergyMax());
9233 }
9234 }
9235
9236 else if (action_id ==
EActions.ADD_HEALTH)
9237 {
9238 AddHealth("","",GetMaxHealth("","Health")/5);
9239 }
9240 else if (action_id ==
EActions.REMOVE_HEALTH)
9241 {
9242 AddHealth("","",-GetMaxHealth("","Health")/5);
9243 }
9244 else if (action_id ==
EActions.DESTROY_HEALTH)
9245 {
9246 SetHealth01("","",0);
9247 }
9248 else if (action_id ==
EActions.WATCH_ITEM)
9249 {
9251 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9252 #ifdef DEVELOPER
9253 SetDebugDeveloper_item(this);
9254 #endif
9255 }
9256
9257 else if (action_id ==
EActions.ADD_TEMPERATURE)
9258 {
9259 AddTemperature(20);
9260
9261 }
9262
9263 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9264 {
9265 AddTemperature(-20);
9266
9267 }
9268
9269 else if (action_id ==
EActions.FLIP_FROZEN)
9270 {
9271 SetFrozen(!GetIsFrozen());
9272
9273 }
9274
9275 else if (action_id ==
EActions.ADD_WETNESS)
9276 {
9278
9279 }
9280
9281 else if (action_id ==
EActions.REMOVE_WETNESS)
9282 {
9284
9285 }
9286
9287 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9288 {
9291
9292
9293 }
9294
9295 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9296 {
9299 }
9300
9301 else if (action_id ==
EActions.MAKE_SPECIAL)
9302 {
9303 auto debugParams = DebugSpawnParams.WithPlayer(player);
9304 OnDebugSpawnEx(debugParams);
9305 }
9306
9307 }
9308
9309
9310 return false;
9311 }
9312
9313
9314
9315
9319
9322
9323
9324
9326 {
9327 return false;
9328 }
9329
9330
9332 {
9333 return true;
9334 }
9335
9336
9338 {
9339 return true;
9340 }
9341
9342
9343
9345 {
9346 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9348 }
9349
9352 {
9353 return null;
9354 }
9355
9357 {
9358 return false;
9359 }
9360
9362 {
9363 return false;
9364 }
9365
9369
9370
9372 {
9373 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9374 return module_repairing.CanRepair(this, item_repair_kit);
9375 }
9376
9377
9378 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9379 {
9380 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9381 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9382 }
9383
9384
9386 {
9387
9388
9389
9390
9391
9392
9393
9394
9395 return 1;
9396 }
9397
9398
9399
9401 {
9403 }
9404
9405
9406
9408 {
9410 }
9411
9412
9421 {
9422 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9423
9424 if (player)
9425 {
9426 player.MessageStatus(text);
9427 }
9428 }
9429
9430
9439 {
9440 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9441
9442 if (player)
9443 {
9444 player.MessageAction(text);
9445 }
9446 }
9447
9448
9457 {
9458 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9459
9460 if (player)
9461 {
9462 player.MessageFriendly(text);
9463 }
9464 }
9465
9466
9475 {
9476 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9477
9478 if (player)
9479 {
9480 player.MessageImportant(text);
9481 }
9482 }
9483
9485 {
9486 return true;
9487 }
9488
9489
9490 override bool KindOf(
string tag)
9491 {
9492 bool found = false;
9493 string item_name = this.
GetType();
9496
9497 int array_size = item_tag_array.Count();
9498 for (int i = 0; i < array_size; i++)
9499 {
9500 if (item_tag_array.Get(i) == tag)
9501 {
9502 found = true;
9503 break;
9504 }
9505 }
9506 return found;
9507 }
9508
9509
9511 {
9512
9513 super.OnRPC(sender, rpc_type,ctx);
9514
9515
9516 switch (rpc_type)
9517 {
9518 #ifndef SERVER
9519 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9520 Param2<bool, string> p = new Param2<bool, string>(false, "");
9521
9523 return;
9524
9525 bool play = p.param1;
9526 string soundSet = p.param2;
9527
9528 if (play)
9529 {
9531 {
9533 {
9535 }
9536 }
9537 else
9538 {
9540 }
9541 }
9542 else
9543 {
9545 }
9546
9547 break;
9548 #endif
9549
9550 }
9551
9553 {
9555 }
9556 }
9557
9558
9559
9560
9562 {
9563 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9564 return plugin.GetID(
name);
9565 }
9566
9568 {
9569 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9570 return plugin.GetName(id);
9571 }
9572
9575 {
9576
9577
9578 int varFlags;
9579 if (!ctx.
Read(varFlags))
9580 return;
9581
9582 if (varFlags & ItemVariableFlags.FLOAT)
9583 {
9585 }
9586 }
9587
9589 {
9590
9591 super.SerializeNumericalVars(floats_out);
9592
9593
9594
9596 {
9598 }
9599
9601 {
9603 }
9604
9606 {
9608 }
9609
9611 {
9616 }
9617
9619 {
9621 }
9622 }
9623
9625 {
9626
9627 super.DeSerializeNumericalVars(floats);
9628
9629
9630 int index = 0;
9631 int mask = Math.Round(floats.Get(index));
9632
9633 index++;
9634
9636 {
9638 {
9640 }
9641 else
9642 {
9643 float quantity = floats.Get(index);
9645 }
9646 index++;
9647 }
9648
9650 {
9651 float wet = floats.Get(index);
9653 index++;
9654 }
9655
9657 {
9658 int liquidtype = Math.Round(floats.Get(index));
9660 index++;
9661 }
9662
9664 {
9666 index++;
9668 index++;
9670 index++;
9672 index++;
9673 }
9674
9676 {
9677 int cleanness = Math.Round(floats.Get(index));
9679 index++;
9680 }
9681 }
9682
9684 {
9685 super.WriteVarsToCTX(ctx);
9686
9687
9689 {
9691 }
9692
9694 {
9696 }
9697
9699 {
9701 }
9702
9704 {
9705 int r,g,b,a;
9711 }
9712
9714 {
9716 }
9717 }
9718
9720 {
9721 if (!super.ReadVarsFromCTX(ctx,version))
9722 return false;
9723
9724 int intValue;
9725 float value;
9726
9727 if (version < 140)
9728 {
9729 if (!ctx.
Read(intValue))
9730 return false;
9731
9732 m_VariablesMask = intValue;
9733 }
9734
9736 {
9737 if (!ctx.
Read(value))
9738 return false;
9739
9741 {
9743 }
9744 else
9745 {
9747 }
9748 }
9749
9750 if (version < 140)
9751 {
9753 {
9754 if (!ctx.
Read(value))
9755 return false;
9756 SetTemperatureDirect(value);
9757 }
9758 }
9759
9761 {
9762 if (!ctx.
Read(value))
9763 return false;
9765 }
9766
9768 {
9769 if (!ctx.
Read(intValue))
9770 return false;
9772 }
9773
9775 {
9776 int r,g,b,a;
9778 return false;
9780 return false;
9782 return false;
9784 return false;
9785
9787 }
9788
9790 {
9791 if (!ctx.
Read(intValue))
9792 return false;
9794 }
9795
9796 if (version >= 138 && version < 140)
9797 {
9799 {
9800 if (!ctx.
Read(intValue))
9801 return false;
9802 SetFrozen(intValue);
9803 }
9804 }
9805
9806 return true;
9807 }
9808
9809
9811 {
9814 {
9816 }
9817
9818 if (!super.OnStoreLoad(ctx, version))
9819 {
9821 return false;
9822 }
9823
9824 if (version >= 114)
9825 {
9826 bool hasQuickBarIndexSaved;
9827
9828 if (!ctx.
Read(hasQuickBarIndexSaved))
9829 {
9831 return false;
9832 }
9833
9834 if (hasQuickBarIndexSaved)
9835 {
9836 int itmQBIndex;
9837
9838
9839 if (!ctx.
Read(itmQBIndex))
9840 {
9842 return false;
9843 }
9844
9845 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9846 if (itmQBIndex != -1 && parentPlayer)
9847 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9848 }
9849 }
9850 else
9851 {
9852
9853 PlayerBase player;
9854 int itemQBIndex;
9855 if (version ==
int.
MAX)
9856 {
9857 if (!ctx.
Read(itemQBIndex))
9858 {
9860 return false;
9861 }
9862 }
9863 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9864 {
9865
9866 if (!ctx.
Read(itemQBIndex))
9867 {
9869 return false;
9870 }
9871 if (itemQBIndex != -1 && player)
9872 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9873 }
9874 }
9875
9876 if (version < 140)
9877 {
9878
9879 if (!LoadVariables(ctx, version))
9880 {
9882 return false;
9883 }
9884 }
9885
9886
9888 {
9890 return false;
9891 }
9892 if (version >= 132)
9893 {
9895 if (raib)
9896 {
9898 {
9900 return false;
9901 }
9902 }
9903 }
9904
9906 return true;
9907 }
9908
9909
9910
9912 {
9913 super.OnStoreSave(ctx);
9914
9915 PlayerBase player;
9916 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9917 {
9919
9920 int itemQBIndex = -1;
9921 itemQBIndex = player.FindQuickBarEntityIndex(this);
9922 ctx.
Write(itemQBIndex);
9923 }
9924 else
9925 {
9927 }
9928
9930
9932 if (raib)
9933 {
9935 }
9936 }
9937
9938
9940 {
9941 super.AfterStoreLoad();
9942
9944 {
9946 }
9947
9949 {
9952 }
9953 }
9954
9956 {
9957 super.EEOnAfterLoad();
9958
9960 {
9962 }
9963
9966 }
9967
9969 {
9970 return false;
9971 }
9972
9973
9974
9976 {
9978 {
9979 #ifdef PLATFORM_CONSOLE
9980
9982 {
9984 if (menu)
9985 {
9987 }
9988 }
9989 #endif
9990 }
9991
9993 {
9996 }
9997
9999 {
10000 SetWeightDirty();
10002 }
10004 {
10007 }
10008
10010 {
10013 }
10015 {
10018 }
10019
10020 super.OnVariablesSynchronized();
10021 }
10022
10023
10024
10026 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10027 {
10028 if (!IsServerCheck(allow_client))
10029 return false;
10030
10032 return false;
10033
10036
10037 if (value <= (min + 0.001))
10038 value = min;
10039
10040 if (value == min)
10041 {
10042 if (destroy_config)
10043 {
10044 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10045 if (dstr)
10046 {
10048 this.Delete();
10049 return true;
10050 }
10051 }
10052 else if (destroy_forced)
10053 {
10055 this.Delete();
10056 return true;
10057 }
10058
10060 }
10061
10064
10066 {
10068
10069 if (delta)
10071 }
10072
10074
10075 return false;
10076 }
10077
10078
10080 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10081 {
10083 }
10084
10086 {
10089 }
10090
10092 {
10095 }
10096
10098 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10099 {
10100 float value_clamped = Math.Clamp(value, 0, 1);
10102 SetQuantity(result, destroy_config, destroy_forced);
10103 }
10104
10105
10108 {
10110 }
10111
10113 {
10115 }
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10127 {
10128 int slot = -1;
10129 if (GetInventory())
10130 {
10131 InventoryLocation il = new InventoryLocation;
10132 GetInventory().GetCurrentInventoryLocation(il);
10134 }
10135
10137 }
10138
10140 {
10141 float quantity_max = 0;
10142
10144 {
10145 if (attSlotID != -1)
10146 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10147
10148 if (quantity_max <= 0)
10150 }
10151
10152 if (quantity_max <= 0)
10154
10155 return quantity_max;
10156 }
10157
10159 {
10161 }
10162
10164 {
10166 }
10167
10168
10170 {
10172 }
10173
10175 {
10177 }
10178
10180 {
10182 }
10183
10184
10186 {
10187
10188 float weightEx = GetWeightEx();
10189 float special = GetInventoryAndCargoWeight();
10190 return weightEx - special;
10191 }
10192
10193
10195 {
10197 }
10198
10200 {
10202 {
10203 #ifdef DEVELOPER
10204 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10205 {
10206 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10208 }
10209 #endif
10210
10211 return GetQuantity() * GetConfigWeightModified();
10212 }
10213 else if (HasEnergyManager())
10214 {
10215 #ifdef DEVELOPER
10216 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10217 {
10218 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10219 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10220 }
10221 #endif
10222 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
10223 }
10224 else
10225 {
10226 #ifdef DEVELOPER
10227 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10228 {
10229 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10230 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10231 }
10232 #endif
10233 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
10234 }
10235 }
10236
10239 {
10240 int item_count = 0;
10242
10243 if (GetInventory().GetCargo() != NULL)
10244 {
10245 item_count = GetInventory().GetCargo().GetItemCount();
10246 }
10247
10248 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10249 {
10250 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10251 if (item)
10252 item_count += item.GetNumberOfItems();
10253 }
10254 return item_count;
10255 }
10256
10259 {
10260 float weight = 0;
10261 float wetness = 1;
10262 if (include_wetness)
10265 {
10266 weight = wetness * m_ConfigWeight;
10267 }
10269 {
10270 weight = 1;
10271 }
10272 return weight;
10273 }
10274
10275
10276
10278 {
10279 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10280 {
10281 GameInventory inv = GetInventory();
10282 array<EntityAI> items = new array<EntityAI>;
10284 for (int i = 0; i < items.Count(); i++)
10285 {
10287 if (item)
10288 {
10290 }
10291 }
10292 }
10293 }
10294
10295
10296
10297
10299 {
10300 float energy = 0;
10301 if (HasEnergyManager())
10302 {
10303 energy = GetCompEM().GetEnergy();
10304 }
10305 return energy;
10306 }
10307
10308
10310 {
10311 super.OnEnergyConsumed();
10312
10314 }
10315
10317 {
10318 super.OnEnergyAdded();
10319
10321 }
10322
10323
10325 {
10326 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10327 {
10329 {
10330 float energy_0to1 = GetCompEM().GetEnergy0To1();
10332 }
10333 }
10334 }
10335
10336
10338 {
10339 return ConfigGetFloat("heatIsolation");
10340 }
10341
10343 {
10345 }
10346
10348 {
10349 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10350 if (
GetGame().ConfigIsExisting(paramPath))
10352
10353 return 0.0;
10354 }
10355
10357 {
10358 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10359 if (
GetGame().ConfigIsExisting(paramPath))
10361
10362 return 0.0;
10363 }
10364
10365 override void SetWet(
float value,
bool allow_client =
false)
10366 {
10367 if (!IsServerCheck(allow_client))
10368 return;
10369
10372
10374
10375 m_VarWet = Math.Clamp(value, min, max);
10376
10378 {
10381 }
10382 }
10383
10384 override void AddWet(
float value)
10385 {
10387 }
10388
10390 {
10392 }
10393
10395 {
10397 }
10398
10400 {
10402 }
10403
10405 {
10407 }
10408
10410 {
10412 }
10413
10414 override void OnWetChanged(
float newVal,
float oldVal)
10415 {
10418 if (newLevel != oldLevel)
10419 {
10421 }
10422 }
10423
10425 {
10426 SetWeightDirty();
10427 }
10428
10430 {
10431 return GetWetLevelInternal(
m_VarWet);
10432 }
10433
10434
10435
10437 {
10439 }
10440
10442 {
10444 }
10445
10447 {
10449 }
10450
10452 {
10454 }
10455
10456
10457
10459 {
10460 if (ConfigIsExisting("itemModelLength"))
10461 {
10462 return ConfigGetFloat("itemModelLength");
10463 }
10464 return 0;
10465 }
10466
10468 {
10469 if (ConfigIsExisting("itemAttachOffset"))
10470 {
10471 return ConfigGetFloat("itemAttachOffset");
10472 }
10473 return 0;
10474 }
10475
10476 override void SetCleanness(
int value,
bool allow_client =
false)
10477 {
10478 if (!IsServerCheck(allow_client))
10479 return;
10480
10482
10484
10487 }
10488
10490 {
10492 }
10493
10495 {
10496 return true;
10497 }
10498
10499
10500
10501
10503 {
10505 }
10506
10508 {
10510 }
10511
10512
10513
10514
10515 override void SetColor(
int r,
int g,
int b,
int a)
10516 {
10522 }
10524 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10525 {
10530 }
10531
10533 {
10535 }
10536
10539 {
10540 int r,g,b,a;
10542 r = r/255;
10543 g = g/255;
10544 b = b/255;
10545 a = a/255;
10546 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10547 }
10548
10549
10550
10551 override void SetLiquidType(
int value,
bool allow_client =
false)
10552 {
10553 if (!IsServerCheck(allow_client))
10554 return;
10555
10560 }
10561
10563 {
10564 return ConfigGetInt("varLiquidTypeInit");
10565 }
10566
10568 {
10570 }
10571
10573 {
10575 SetFrozen(false);
10576 }
10577
10580 {
10581 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10582 }
10583
10584
10587 {
10588 PlayerBase nplayer;
10589 if (PlayerBase.CastTo(nplayer, player))
10590 {
10592
10593 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10594 }
10595 }
10596
10597
10600 {
10601 PlayerBase nplayer;
10602 if (PlayerBase.CastTo(nplayer,player))
10603 {
10604
10605 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10606
10607 }
10608
10609
10610 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10611
10612
10613 if (HasEnergyManager())
10614 {
10615 GetCompEM().UpdatePlugState();
10616 }
10617 }
10618
10619
10621 {
10622 super.OnPlacementStarted(player);
10623
10625 }
10626
10627 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10628 {
10630 {
10631 m_AdminLog.OnPlacementComplete(player,
this);
10632 }
10633
10634 super.OnPlacementComplete(player, position, orientation);
10635 }
10636
10637
10638
10639
10640
10642 {
10644 {
10645 return true;
10646 }
10647 else
10648 {
10649 return false;
10650 }
10651 }
10652
10653
10655 {
10657 {
10659 }
10660 }
10661
10662
10664 {
10666 }
10667
10669 {
10671 }
10672
10673 override void InsertAgent(
int agent,
float count = 1)
10674 {
10675 if (count < 1)
10676 return;
10677
10679 }
10680
10683 {
10685 }
10686
10687
10689 {
10691 }
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10735 {
10737 return false;
10738 return true;
10739 }
10740
10742 {
10743
10745 }
10746
10747
10750 {
10751 super.CheckForRoofLimited(timeTresholdMS);
10752
10754 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10755 {
10756 m_PreviousRoofTestTime = time;
10757 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10758 }
10759 }
10760
10761
10763 {
10765 {
10766 return 0;
10767 }
10768
10769 if (GetInventory().GetAttachmentSlotsCount() != 0)
10770 {
10771 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10772 if (filter)
10773 return filter.GetProtectionLevel(type, false, system);
10774 else
10775 return 0;
10776 }
10777
10778 string subclassPath, entryName;
10779
10780 switch (type)
10781 {
10783 entryName = "biological";
10784 break;
10786 entryName = "chemical";
10787 break;
10788 default:
10789 entryName = "biological";
10790 break;
10791 }
10792
10793 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10794
10796 }
10797
10798
10799
10802 {
10803 if (!IsMagazine())
10805
10807 }
10808
10809
10810
10811
10812
10817 {
10818 return true;
10819 }
10820
10822 {
10824 }
10825
10826
10827
10828
10829
10831 {
10832 if (parent)
10833 {
10834 if (parent.IsInherited(DayZInfected))
10835 return true;
10836
10837 if (!parent.IsRuined())
10838 return true;
10839 }
10840
10841 return true;
10842 }
10843
10845 {
10846 if (!super.CanPutAsAttachment(parent))
10847 {
10848 return false;
10849 }
10850
10851 if (!IsRuined() && !parent.IsRuined())
10852 {
10853 return true;
10854 }
10855
10856 return false;
10857 }
10858
10860 {
10861
10862
10863
10864
10865 return super.CanReceiveItemIntoCargo(item);
10866 }
10867
10869 {
10870
10871
10872
10873
10874 GameInventory attachmentInv = attachment.GetInventory();
10876 {
10877 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10878 return false;
10879 }
10880
10881 InventoryLocation loc = new InventoryLocation();
10882 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10883 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10884 return false;
10885
10886 return super.CanReceiveAttachment(attachment, slotId);
10887 }
10888
10890 {
10891 if (!super.CanReleaseAttachment(attachment))
10892 return false;
10893
10894 return GetInventory().AreChildrenAccessible();
10895 }
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10918 {
10919 int id = muzzle_owner.GetMuzzleID();
10920 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10921
10922 if (WPOF_array)
10923 {
10924 for (int i = 0; i < WPOF_array.Count(); i++)
10925 {
10926 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10927
10928 if (WPOF)
10929 {
10930 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10931 }
10932 }
10933 }
10934 }
10935
10936
10938 {
10939 int id = muzzle_owner.GetMuzzleID();
10941
10942 if (WPOBE_array)
10943 {
10944 for (int i = 0; i < WPOBE_array.Count(); i++)
10945 {
10946 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10947
10948 if (WPOBE)
10949 {
10950 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10951 }
10952 }
10953 }
10954 }
10955
10956
10958 {
10959 int id = muzzle_owner.GetMuzzleID();
10960 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10961
10962 if (WPOOH_array)
10963 {
10964 for (int i = 0; i < WPOOH_array.Count(); i++)
10965 {
10966 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10967
10968 if (WPOOH)
10969 {
10970 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10971 }
10972 }
10973 }
10974 }
10975
10976
10978 {
10979 int id = muzzle_owner.GetMuzzleID();
10980 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10981
10982 if (WPOOH_array)
10983 {
10984 for (int i = 0; i < WPOOH_array.Count(); i++)
10985 {
10986 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10987
10988 if (WPOOH)
10989 {
10990 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10991 }
10992 }
10993 }
10994 }
10995
10996
10998 {
10999 int id = muzzle_owner.GetMuzzleID();
11000 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11001
11002 if (WPOOH_array)
11003 {
11004 for (int i = 0; i < WPOOH_array.Count(); i++)
11005 {
11006 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11007
11008 if (WPOOH)
11009 {
11010 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11011 }
11012 }
11013 }
11014 }
11015
11016
11017
11019 {
11021 {
11022 return true;
11023 }
11024
11025 return false;
11026 }
11027
11029 {
11031 {
11032 return true;
11033 }
11034
11035 return false;
11036 }
11037
11039 {
11041 {
11042 return true;
11043 }
11044
11045 return false;
11046 }
11047
11049 {
11050 return false;
11051 }
11052
11055 {
11056 return UATimeSpent.DEFAULT_DEPLOY;
11057 }
11058
11059
11060
11061
11063 {
11065 SetSynchDirty();
11066 }
11067
11069 {
11071 }
11072
11073
11075 {
11076 return false;
11077 }
11078
11081 {
11082 string att_type = "None";
11083
11084 if (ConfigIsExisting("soundAttType"))
11085 {
11086 att_type = ConfigGetString("soundAttType");
11087 }
11088
11090 }
11091
11093 {
11095 }
11096
11097
11098
11099
11100
11106
11108 {
11111
11113 }
11114
11115
11117 {
11119 return;
11120
11122
11125
11128
11129 SoundParameters params = new SoundParameters();
11133 }
11134
11135
11137 {
11139 return;
11140
11142 SetSynchDirty();
11143
11146 }
11147
11148
11150 {
11152 return;
11153
11155 SetSynchDirty();
11156
11159 }
11160
11162 {
11164 }
11165
11167 {
11169 }
11170
11173 {
11174 if (!
GetGame().IsDedicatedServer())
11175 {
11176 if (ConfigIsExisting("attachSoundSet"))
11177 {
11178 string cfg_path = "";
11179 string soundset = "";
11180 string type_name =
GetType();
11181
11184 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11185 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11186
11187 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11188 {
11189 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11190 {
11191 if (cfg_slot_array[i] == slot_type)
11192 {
11193 soundset = cfg_soundset_array[i];
11194 break;
11195 }
11196 }
11197 }
11198
11199 if (soundset != "")
11200 {
11201 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11203 }
11204 }
11205 }
11206 }
11207
11209 {
11210
11211 }
11212
11213 void OnApply(PlayerBase player);
11214
11216 {
11217 return 1.0;
11218 };
11219
11221 {
11223 }
11224
11226 {
11228 }
11229
11231
11233 {
11234 SetDynamicPhysicsLifeTime(0.01);
11236 }
11237
11239 {
11240 array<string> zone_names = new array<string>;
11241 GetDamageZones(zone_names);
11242 for (int i = 0; i < zone_names.Count(); i++)
11243 {
11244 SetHealthMax(zone_names.Get(i),"Health");
11245 }
11246 SetHealthMax("","Health");
11247 }
11248
11251 {
11252 float global_health = GetHealth01("","Health");
11253 array<string> zones = new array<string>;
11254 GetDamageZones(zones);
11255
11256 for (int i = 0; i < zones.Count(); i++)
11257 {
11258 SetHealth01(zones.Get(i),"Health",global_health);
11259 }
11260 }
11261
11264 {
11265 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11266 }
11267
11269 {
11270 if (!hasRootAsPlayer)
11271 {
11272 if (refParentIB)
11273 {
11274
11275 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11276 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11277
11278 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11279 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11280
11283 }
11284 else
11285 {
11286
11289 }
11290 }
11291 }
11292
11294 {
11296 {
11297 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11298 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
11299 {
11300 float heatPermCoef = 1.0;
11302 while (ent)
11303 {
11304 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11305 ent = ent.GetHierarchyParent();
11306 }
11307
11308 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11309 }
11310 }
11311 }
11312
11314 {
11315
11316 EntityAI parent = GetHierarchyParent();
11317 if (!parent)
11318 {
11319 hasParent = false;
11320 hasRootAsPlayer = false;
11321 }
11322 else
11323 {
11324 hasParent = true;
11325 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11326 refParentIB =
ItemBase.Cast(parent);
11327 }
11328 }
11329
11330 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11331 {
11332
11333 }
11334
11336 {
11337
11338 return false;
11339 }
11340
11342 {
11343
11344
11345 return false;
11346 }
11347
11349 {
11350
11351 return false;
11352 }
11353
11356 {
11357 return !GetIsFrozen() &&
IsOpen();
11358 }
11359
11361 {
11362 bool hasParent = false, hasRootAsPlayer = false;
11364
11365 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11366 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11367
11368 if (wwtu || foodDecay)
11369 {
11373
11374 if (processWetness || processTemperature || processDecay)
11375 {
11377
11378 if (processWetness)
11379 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11380
11381 if (processTemperature)
11383
11384 if (processDecay)
11385 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11386 }
11387 }
11388 }
11389
11392 {
11394 }
11395
11397 {
11400
11401 return super.GetTemperatureFreezeThreshold();
11402 }
11403
11405 {
11408
11409 return super.GetTemperatureThawThreshold();
11410 }
11411
11413 {
11416
11417 return super.GetItemOverheatThreshold();
11418 }
11419
11421 {
11423 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11424
11425 return super.GetTemperatureFreezeTime();
11426 }
11427
11429 {
11431 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11432
11433 return super.GetTemperatureThawTime();
11434 }
11435
11440
11442 {
11443 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11444 }
11445
11447 {
11448 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11449 }
11450
11453 {
11455 }
11456
11458 {
11460 }
11461
11463 {
11465 }
11466
11469 {
11470 return null;
11471 }
11472
11475 {
11476 return false;
11477 }
11478
11480 {
11482 {
11485 if (!trg)
11486 {
11488 explosive = this;
11489 }
11490
11491 explosive.PairRemote(trg);
11493
11494 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11495 trg.SetPersistentPairID(persistentID);
11496 explosive.SetPersistentPairID(persistentID);
11497
11498 return true;
11499 }
11500 return false;
11501 }
11502
11505 {
11506 float ret = 1.0;
11509 ret *= GetHealth01();
11510
11511 return ret;
11512 }
11513
11514 #ifdef DEVELOPER
11515 override void SetDebugItem()
11516 {
11517 super.SetDebugItem();
11518 _itemBase = this;
11519 }
11520
11522 {
11523 string text = super.GetDebugText();
11524
11526 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11527
11528 return text;
11529 }
11530 #endif
11531
11533 {
11534 return true;
11535 }
11536
11538
11540
11542 {
11545 }
11546
11547
11555
11571}
11572
11574{
11576 if (entity)
11577 {
11578 bool is_item = entity.IsInherited(
ItemBase);
11579 if (is_item && full_quantity)
11580 {
11583 }
11584 }
11585 else
11586 {
11588 return NULL;
11589 }
11590 return entity;
11591}
11592
11594{
11595 if (item)
11596 {
11597 if (health > 0)
11598 item.SetHealth("", "", health);
11599
11600 if (item.CanHaveTemperature())
11601 {
11603 if (item.CanFreeze())
11604 item.SetFrozen(false);
11605 }
11606
11607 if (item.HasEnergyManager())
11608 {
11609 if (quantity >= 0)
11610 {
11611 item.GetCompEM().SetEnergy0To1(quantity);
11612 }
11613 else
11614 {
11616 }
11617 }
11618 else if (item.IsMagazine())
11619 {
11620 Magazine mag = Magazine.Cast(item);
11621 if (quantity >= 0)
11622 {
11623 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11624 }
11625 else
11626 {
11628 }
11629
11630 }
11631 else
11632 {
11633 if (quantity >= 0)
11634 {
11635 item.SetQuantityNormalized(quantity, false);
11636 }
11637 else
11638 {
11640 }
11641
11642 }
11643 }
11644}
11645
11646#ifdef DEVELOPER
11648#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.