6750{
6752 {
6753 return true;
6754 }
6755};
6756
6757
6758
6760{
6764
6766
6769
6770
6771
6772
6773
6782
6788
6793
6798
6819 protected bool m_IsResultOfSplit
6820
6822
6827
6828
6829
6831
6835
6836
6837
6839
6842
6843
6844
6850
6851
6859
6862
6863
6865
6866
6868
6869
6874
6875
6880
6881
6883
6884
6886 {
6891
6892 if (!
GetGame().IsDedicatedServer())
6893 {
6895 {
6897
6899 {
6901 }
6902 }
6903
6906 }
6907
6908 m_OldLocation = null;
6909
6911 {
6913 }
6914
6915 if (ConfigIsExisting("headSelectionsToHide"))
6916 {
6919 }
6920
6922 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6923 {
6925 }
6926
6928
6929 m_IsResultOfSplit = false;
6930
6932 }
6933
6935 {
6936 super.InitItemVariables();
6937
6943 m_Count = ConfigGetInt(
"count");
6944
6947
6952
6955
6960
6972
6976
6977
6980 if (ConfigIsExisting("canBeSplit"))
6981 {
6984 }
6985
6987 if (ConfigIsExisting("itemBehaviour"))
6989
6990
6993 RegisterNetSyncVariableInt("m_VarLiquidType");
6994 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6995
6996 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6997 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6998 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6999
7000 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7001 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7002 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7003 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7004
7005 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7006 RegisterNetSyncVariableBool("m_IsTakeable");
7007 RegisterNetSyncVariableBool("m_IsHologram");
7008
7011 {
7014 }
7015
7017
7019 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7021
7022 }
7023
7025 {
7027 }
7028
7030 {
7033 {
7038 }
7039 }
7040
7041 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7042 {
7044 {
7047 }
7048
7050 }
7051
7053 {
7059 }
7060
7062
7064 {
7066
7067 if (!action)
7068 {
7069 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7070 return;
7071 }
7072
7074 if (!ai)
7075 {
7077 return;
7078 }
7079
7081 if (!action_array)
7082 {
7083 action_array = new array<ActionBase_Basic>;
7085 }
7086 if (LogManager.IsActionLogEnable())
7087 {
7088 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7089 }
7090
7091 if (action_array.Find(action) != -1)
7092 {
7093 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7094 }
7095 else
7096 {
7097 action_array.Insert(action);
7098 }
7099 }
7100
7102 {
7104 ActionBase action = player.GetActionManager().GetAction(actionName);
7107
7108 if (action_array)
7109 {
7110 action_array.RemoveItem(action);
7111 }
7112 }
7113
7114
7115
7117 {
7118 ActionOverrideData overrideData = new ActionOverrideData();
7122
7124 if (!actionMap)
7125 {
7128 }
7129
7130 actionMap.Insert(this.
Type(), overrideData);
7131
7132 }
7133
7135
7137
7138
7140 {
7143
7146
7147 string config_to_search = "CfgVehicles";
7148 string muzzle_owner_config;
7149
7151 {
7152 if (IsInherited(Weapon))
7153 config_to_search = "CfgWeapons";
7154
7155 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7156
7157 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7158
7160
7161 if (config_OnFire_subclass_count > 0)
7162 {
7163 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7164
7165 for (int i = 0; i < config_OnFire_subclass_count; i++)
7166 {
7167 string particle_class = "";
7169 string config_OnFire_entry = config_OnFire_class + particle_class;
7170 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7171 WPOF_array.Insert(WPOF);
7172 }
7173
7174
7176 }
7177 }
7178
7180 {
7181 config_to_search = "CfgWeapons";
7182 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7183
7184 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7185
7187
7188 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7189 {
7190 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7191
7192 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7193 {
7194 string particle_class2 = "";
7196 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7197 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7198 WPOBE_array.Insert(WPOBE);
7199 }
7200
7201
7203 }
7204 }
7205 }
7206
7207
7209 {
7212
7214 {
7215 string config_to_search = "CfgVehicles";
7216
7217 if (IsInherited(Weapon))
7218 config_to_search = "CfgWeapons";
7219
7220 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7221 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7222
7223 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7224 {
7225
7227
7229 {
7231 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7233 return;
7234 }
7235
7238
7239
7240
7242 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7243
7244 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7245 {
7246 string particle_class = "";
7248 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7250
7251 if (entry_type == CT_CLASS)
7252 {
7253 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7254 WPOOH_array.Insert(WPOF);
7255 }
7256 }
7257
7258
7260 }
7261 }
7262 }
7263
7265 {
7267 }
7268
7270 {
7272 {
7274
7277
7280
7281 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7282 }
7283 }
7284
7286 {
7288 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7289
7291 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7292
7294 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7295
7297 {
7299 }
7300 }
7301
7303 {
7305 }
7306
7308 {
7311 else
7313
7315 {
7318 }
7319 else
7320 {
7323
7326 }
7327
7329 }
7330
7332 {
7334 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7335 }
7336
7338 {
7340 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7342 }
7343
7345 {
7347 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7348 }
7349
7351 {
7354
7355 OverheatingParticle OP = new OverheatingParticle();
7360
7362 }
7363
7365 {
7368
7369 return -1;
7370 }
7371
7373 {
7375 {
7378
7379 for (int i = count; i > 0; --i)
7380 {
7381 int id = i - 1;
7384
7387
7388 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7389 {
7390 if (p)
7391 {
7394 }
7395 }
7396 }
7397 }
7398 }
7399
7401 {
7403 {
7405 {
7406 int id = i - 1;
7408
7409 if (OP)
7410 {
7412
7413 if (p)
7414 {
7416 }
7417
7418 delete OP;
7419 }
7420 }
7421
7424 }
7425 }
7426
7429 {
7430 return 0.0;
7431 }
7432
7433
7435 {
7436 return 250;
7437 }
7438
7440 {
7441 return 0;
7442 }
7443
7446 {
7448 return true;
7449
7450 return false;
7451 }
7452
7455 {
7458
7460 {
7462 }
7463 else
7464 {
7465
7467 }
7468
7470 }
7471
7478 {
7479 return -1;
7480 }
7481
7482
7483
7484
7486 {
7488 {
7490 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7491
7492 if (r_index >= 0)
7493 {
7494 InventoryLocation r_il = new InventoryLocation;
7495 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7496
7497 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7500 {
7501 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7502 }
7504 {
7505 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7506 }
7507
7508 }
7509
7510 player.GetHumanInventory().ClearUserReservedLocation(this);
7511 }
7512
7515 }
7516
7517
7518
7519
7521 {
7522 return ItemBase.m_DebugActionsMask;
7523 }
7524
7526 {
7527 return ItemBase.m_DebugActionsMask & mask;
7528 }
7529
7531 {
7532 ItemBase.m_DebugActionsMask = mask;
7533 }
7534
7536 {
7537 ItemBase.m_DebugActionsMask |= mask;
7538 }
7539
7541 {
7542 ItemBase.m_DebugActionsMask &= ~mask;
7543 }
7544
7546 {
7548 {
7550 }
7551 else
7552 {
7554 }
7555 }
7556
7557
7559 {
7560 if (GetEconomyProfile())
7561 {
7562 float q_max = GetEconomyProfile().GetQuantityMax();
7563 if (q_max > 0)
7564 {
7565 float q_min = GetEconomyProfile().GetQuantityMin();
7566 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7567
7569 {
7570 ComponentEnergyManager comp = GetCompEM();
7572 {
7574 }
7575 }
7577 {
7579
7580 }
7581
7582 }
7583 }
7584 }
7585
7588 {
7589 EntityAI parent = GetHierarchyParent();
7590
7591 if (parent)
7592 {
7593 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7594 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7595 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7596 }
7597 }
7598
7601 {
7602 EntityAI parent = GetHierarchyParent();
7603
7604 if (parent)
7605 {
7606 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7607 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7608 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7609 }
7610 }
7611
7613 {
7614
7615
7616
7617
7619
7621 {
7622 if (ScriptInputUserData.CanStoreInputUserData())
7623 {
7624 ScriptInputUserData ctx = new ScriptInputUserData;
7630 ctx.
Write(use_stack_max);
7633
7635 {
7636 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7637 }
7638 }
7639 }
7640 else if (!
GetGame().IsMultiplayer())
7641 {
7643 }
7644 }
7645
7647 {
7649 }
7650
7652 {
7654 }
7655
7657 {
7659 }
7660
7662 {
7663
7664 return false;
7665 }
7666
7668 {
7669 return false;
7670 }
7671
7675 {
7676 return false;
7677 }
7678
7680 {
7681 return "";
7682 }
7683
7685
7687 {
7688 return false;
7689 }
7690
7692 {
7693 return true;
7694 }
7695
7696
7697
7699 {
7700 return true;
7701 }
7702
7704 {
7705 return true;
7706 }
7707
7709 {
7710 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7712 }
7713
7715 {
7717 }
7718
7720 {
7722 if (!is_being_placed)
7724 SetSynchDirty();
7725 }
7726
7727
7729
7731 {
7733 }
7734
7736 {
7738 }
7739
7741 {
7742 return 1;
7743 }
7744
7746 {
7747 return false;
7748 }
7749
7751 {
7753 SetSynchDirty();
7754 }
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7791 {
7792 super.OnMovedInsideCargo(container);
7793
7794 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7795 }
7796
7797 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7798 {
7799 super.EEItemLocationChanged(oldLoc,newLoc);
7800
7801 PlayerBase new_player = null;
7802 PlayerBase old_player = null;
7803
7804 if (newLoc.GetParent())
7805 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7806
7807 if (oldLoc.GetParent())
7808 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7809
7811 {
7812 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7813
7814 if (r_index >= 0)
7815 {
7816 InventoryLocation r_il = new InventoryLocation;
7817 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7818
7819 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7822 {
7823 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7824 }
7826 {
7827 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7828 }
7829
7830 }
7831 }
7832
7834 {
7835 if (new_player)
7836 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7837
7838 if (new_player == old_player)
7839 {
7840
7841 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7842 {
7844 {
7845 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7846 {
7847 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7848 }
7849 }
7850 else
7851 {
7852 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7853 }
7854 }
7855
7856 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7857 {
7858 int type = oldLoc.GetType();
7860 {
7861 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7862 }
7864 {
7865 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7866 }
7867 }
7868 if (!m_OldLocation)
7869 {
7870 m_OldLocation = new InventoryLocation;
7871 }
7872 m_OldLocation.Copy(oldLoc);
7873 }
7874 else
7875 {
7876 if (m_OldLocation)
7877 {
7878 m_OldLocation.Reset();
7879 }
7880 }
7881
7883 }
7884 else
7885 {
7886 if (new_player)
7887 {
7888 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7889 if (res_index >= 0)
7890 {
7891 InventoryLocation il = new InventoryLocation;
7892 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7894 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7897 {
7898 il.
GetParent().GetOnReleaseLock().Invoke(it);
7899 }
7901 {
7903 }
7904
7905 }
7906 }
7908 {
7909
7911 }
7912
7913 if (m_OldLocation)
7914 {
7915 m_OldLocation.Reset();
7916 }
7917 }
7918 }
7919
7920 override void EOnContact(IEntity other, Contact extra)
7921 {
7923 {
7924 int liquidType = -1;
7926 if (impactSpeed > 0.0)
7927 {
7929 #ifndef SERVER
7931 #else
7933 SetSynchDirty();
7934 #endif
7936 }
7937 }
7938
7939 #ifdef SERVER
7940 if (GetCompEM() && GetCompEM().IsPlugged())
7941 {
7942 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7943 GetCompEM().UnplugThis();
7944 }
7945 #endif
7946 }
7947
7949
7951 {
7953 }
7954
7956 {
7957
7958 }
7959
7961 {
7962 super.OnItemLocationChanged(old_owner, new_owner);
7963
7964 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7965 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7966
7967 if (!relatedPlayer && playerNew)
7968 relatedPlayer = playerNew;
7969
7970 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7971 {
7973 if (actionMgr)
7974 {
7975 ActionBase currentAction = actionMgr.GetRunningAction();
7976 if (currentAction)
7978 }
7979 }
7980
7981 Man ownerPlayerOld = null;
7982 Man ownerPlayerNew = null;
7983
7984 if (old_owner)
7985 {
7986 if (old_owner.
IsMan())
7987 {
7988 ownerPlayerOld = Man.Cast(old_owner);
7989 }
7990 else
7991 {
7992 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7993 }
7994 }
7995 else
7996 {
7998 {
8000
8001 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8002 {
8003 GetCompEM().UnplugThis();
8004 }
8005 }
8006 }
8007
8008 if (new_owner)
8009 {
8010 if (new_owner.
IsMan())
8011 {
8012 ownerPlayerNew = Man.Cast(new_owner);
8013 }
8014 else
8015 {
8016 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8017 }
8018 }
8019
8020 if (ownerPlayerOld != ownerPlayerNew)
8021 {
8022 if (ownerPlayerOld)
8023 {
8024 array<EntityAI> subItemsExit = new array<EntityAI>;
8026 for (int i = 0; i < subItemsExit.Count(); i++)
8027 {
8030 }
8031 }
8032
8033 if (ownerPlayerNew)
8034 {
8035 array<EntityAI> subItemsEnter = new array<EntityAI>;
8037 for (int j = 0; j < subItemsEnter.Count(); j++)
8038 {
8041 }
8042 }
8043 }
8044 else if (ownerPlayerNew != null)
8045 {
8046 PlayerBase nplayer;
8047 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8048 {
8049 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8051 for (int k = 0; k < subItemsUpdate.Count(); k++)
8052 {
8054 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8055 }
8056 }
8057 }
8058
8059 if (old_owner)
8060 old_owner.OnChildItemRemoved(this);
8061 if (new_owner)
8062 new_owner.OnChildItemReceived(this);
8063 }
8064
8065
8067 {
8068 super.EEDelete(parent);
8069 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8070 if (player)
8071 {
8073
8074 if (player.IsAlive())
8075 {
8076 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8077 if (r_index >= 0)
8078 {
8079 InventoryLocation r_il = new InventoryLocation;
8080 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8081
8082 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8085 {
8086 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8087 }
8089 {
8090 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8091 }
8092
8093 }
8094
8095 player.RemoveQuickBarEntityShortcut(this);
8096 }
8097 }
8098 }
8099
8101 {
8102 super.EEKilled(killer);
8103
8106 {
8107 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8108 {
8109 if (IsMagazine())
8110 {
8111 if (Magazine.Cast(this).GetAmmoCount() > 0)
8112 {
8114 }
8115 }
8116 else
8117 {
8119 }
8120 }
8121 }
8122 }
8123
8125 {
8126 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8127
8128 super.OnWasAttached(parent, slot_id);
8129
8132
8134 }
8135
8137 {
8138 super.OnWasDetached(parent, slot_id);
8139
8142 }
8143
8145 {
8146 int idx;
8149
8150 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8151 if (inventory_slots.Count() < 1)
8152 {
8153 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8154 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8155 }
8156 else
8157 {
8158 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8159 }
8160
8161 idx = inventory_slots.Find(slot);
8162 if (idx < 0)
8163 return "";
8164
8165 return attach_types.Get(idx);
8166 }
8167
8169 {
8170 int idx = -1;
8171 string slot;
8172
8175
8176 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8177 if (inventory_slots.Count() < 1)
8178 {
8179 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8180 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8181 }
8182 else
8183 {
8184 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8185 if (detach_types.Count() < 1)
8186 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8187 }
8188
8189 for (int i = 0; i < inventory_slots.Count(); i++)
8190 {
8191 slot = inventory_slots.Get(i);
8192 }
8193
8194 if (slot != "")
8195 {
8196 if (detach_types.Count() == 1)
8197 idx = 0;
8198 else
8199 idx = inventory_slots.Find(slot);
8200 }
8201 if (idx < 0)
8202 return "";
8203
8204 return detach_types.Get(idx);
8205 }
8206
8208 {
8209
8211
8212
8213 float min_time = 1;
8214 float max_time = 3;
8215 float delay = Math.RandomFloat(min_time, max_time);
8216
8217 explode_timer.Run(delay, this, "DoAmmoExplosion");
8218 }
8219
8221 {
8222 Magazine magazine = Magazine.Cast(this);
8223 int pop_sounds_count = 6;
8224 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8225
8226
8227 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8228 string sound_name = pop_sounds[ sound_idx ];
8230
8231
8232 magazine.ServerAddAmmoCount(-1);
8233
8234
8235 float min_temp_to_explode = 100;
8236
8237 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
8238 {
8240 }
8241 }
8242
8243
8244 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8245 {
8246 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8247
8248 const int CHANCE_DAMAGE_CARGO = 4;
8249 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8250 const int CHANCE_DAMAGE_NOTHING = 2;
8251
8253 {
8254 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8255 int chances;
8256 int rnd;
8257
8258 if (GetInventory().GetCargo())
8259 {
8260 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8261 rnd = Math.RandomInt(0,chances);
8262
8263 if (rnd < CHANCE_DAMAGE_CARGO)
8264 {
8266 }
8267 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8268 {
8270 }
8271 }
8272 else
8273 {
8274 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8275 rnd = Math.RandomInt(0,chances);
8276
8277 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8278 {
8280 }
8281 }
8282 }
8283 }
8284
8286 {
8287 if (GetInventory().GetCargo())
8288 {
8289 int item_count = GetInventory().GetCargo().GetItemCount();
8290 if (item_count > 0)
8291 {
8292 int random_pick = Math.RandomInt(0, item_count);
8294 if (!item.IsExplosive())
8295 {
8296 item.AddHealth("","",damage);
8297 return true;
8298 }
8299 }
8300 }
8301 return false;
8302 }
8303
8305 {
8306 int attachment_count = GetInventory().AttachmentCount();
8307 if (attachment_count > 0)
8308 {
8309 int random_pick = Math.RandomInt(0, attachment_count);
8310 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8311 if (!attachment.IsExplosive())
8312 {
8313 attachment.AddHealth("","",damage);
8314 return true;
8315 }
8316 }
8317 return false;
8318 }
8319
8321 {
8323 }
8324
8326 {
8328 return GetInventory().CanRemoveEntity();
8329
8330 return false;
8331 }
8332
8334 {
8335
8337 return false;
8338
8339
8341 return false;
8342
8343
8344
8346 if (delta == 0)
8347 return false;
8348
8349
8350 return true;
8351 }
8352
8354 {
8356 {
8357 if (ScriptInputUserData.CanStoreInputUserData())
8358 {
8359 ScriptInputUserData ctx = new ScriptInputUserData;
8364 ctx.
Write(destination_entity);
8368 }
8369 }
8370 else if (!
GetGame().IsMultiplayer())
8371 {
8373 }
8374 }
8375
8377 {
8378 float split_quantity_new;
8382 InventoryLocation loc = new InventoryLocation;
8383
8384 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8385 {
8387 split_quantity_new = stack_max;
8388 else
8390
8392 {
8393 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8394 if (new_item)
8395 {
8396 new_item.SetResultOfSplit(true);
8397 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8399 new_item.
SetQuantity(split_quantity_new,
false,
true);
8400 }
8401 }
8402 }
8403 else if (destination_entity && slot_id == -1)
8404 {
8405 if (quantity > stack_max)
8406 split_quantity_new = stack_max;
8407 else
8408 split_quantity_new = quantity;
8409
8411 {
8413 {
8416 }
8417
8418 if (new_item)
8419 {
8420 new_item.SetResultOfSplit(true);
8421 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8423 new_item.
SetQuantity(split_quantity_new,
false,
true);
8424 }
8425 }
8426 }
8427 else
8428 {
8429 if (stack_max != 0)
8430 {
8432 {
8434 }
8435
8436 if (split_quantity_new == 0)
8437 {
8438 if (!
GetGame().IsMultiplayer())
8439 player.PhysicalPredictiveDropItem(this);
8440 else
8441 player.ServerDropEntity(this);
8442 return;
8443 }
8444
8446 {
8448
8449 if (new_item)
8450 {
8451 new_item.SetResultOfSplit(true);
8452 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8455 new_item.PlaceOnSurface();
8456 }
8457 }
8458 }
8459 }
8460 }
8461
8463 {
8464 float split_quantity_new;
8468 InventoryLocation loc = new InventoryLocation;
8469
8470 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8471 {
8473 split_quantity_new = stack_max;
8474 else
8476
8478 {
8479 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8480 if (new_item)
8481 {
8482 new_item.SetResultOfSplit(true);
8483 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8485 new_item.
SetQuantity(split_quantity_new,
false,
true);
8486 }
8487 }
8488 }
8489 else if (destination_entity && slot_id == -1)
8490 {
8491 if (quantity > stack_max)
8492 split_quantity_new = stack_max;
8493 else
8494 split_quantity_new = quantity;
8495
8497 {
8499 {
8502 }
8503
8504 if (new_item)
8505 {
8506 new_item.SetResultOfSplit(true);
8507 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8509 new_item.
SetQuantity(split_quantity_new,
false,
true);
8510 }
8511 }
8512 }
8513 else
8514 {
8515 if (stack_max != 0)
8516 {
8518 {
8520 }
8521
8523 {
8525
8526 if (new_item)
8527 {
8528 new_item.SetResultOfSplit(true);
8529 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8532 new_item.PlaceOnSurface();
8533 }
8534 }
8535 }
8536 }
8537 }
8538
8540 {
8542 {
8543 if (ScriptInputUserData.CanStoreInputUserData())
8544 {
8545 ScriptInputUserData ctx = new ScriptInputUserData;
8550 dst.WriteToContext(ctx);
8552 }
8553 }
8554 else if (!
GetGame().IsMultiplayer())
8555 {
8557 }
8558 }
8559
8561 {
8563 {
8564 if (ScriptInputUserData.CanStoreInputUserData())
8565 {
8566 ScriptInputUserData ctx = new ScriptInputUserData;
8571 ctx.
Write(destination_entity);
8577 }
8578 }
8579 else if (!
GetGame().IsMultiplayer())
8580 {
8582 }
8583 }
8584
8586 {
8588 }
8589
8591 {
8593 float split_quantity_new;
8595 if (dst.IsValid())
8596 {
8597 int slot_id = dst.GetSlot();
8599
8600 if (quantity > stack_max)
8601 split_quantity_new = stack_max;
8602 else
8603 split_quantity_new = quantity;
8604
8606 {
8608
8609 if (new_item)
8610 {
8611 new_item.SetResultOfSplit(true);
8612 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8614 new_item.
SetQuantity(split_quantity_new,
false,
true);
8615 }
8616
8617 return new_item;
8618 }
8619 }
8620
8621 return null;
8622 }
8623
8625 {
8627 float split_quantity_new;
8629 if (destination_entity)
8630 {
8632 if (quantity > stackable)
8633 split_quantity_new = stackable;
8634 else
8635 split_quantity_new = quantity;
8636
8638 {
8639 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8640 if (new_item)
8641 {
8642 new_item.SetResultOfSplit(true);
8643 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8645 new_item.
SetQuantity(split_quantity_new,
false,
true);
8646 }
8647 }
8648 }
8649 }
8650
8652 {
8654 {
8655 if (ScriptInputUserData.CanStoreInputUserData())
8656 {
8657 ScriptInputUserData ctx = new ScriptInputUserData;
8662 ItemBase destination_entity =
this;
8663 ctx.
Write(destination_entity);
8667 }
8668 }
8669 else if (!
GetGame().IsMultiplayer())
8670 {
8672 }
8673 }
8674
8676 {
8678 float split_quantity_new;
8680 if (player)
8681 {
8683 if (quantity > stackable)
8684 split_quantity_new = stackable;
8685 else
8686 split_quantity_new = quantity;
8687
8689 {
8690 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8691 new_item =
ItemBase.Cast(in_hands);
8692 if (new_item)
8693 {
8694 new_item.SetResultOfSplit(true);
8695 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8697 new_item.SetQuantity(split_quantity_new, false, true);
8698 }
8699 }
8700 }
8701 }
8702
8704 {
8706 float split_quantity_new = Math.Floor(quantity * 0.5);
8707
8709 return;
8710
8712
8713 if (new_item)
8714 {
8715 if (new_item.GetQuantityMax() < split_quantity_new)
8716 {
8717 split_quantity_new = new_item.GetQuantityMax();
8718 }
8719
8720 new_item.SetResultOfSplit(true);
8721 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8722
8724 {
8727 }
8728 else
8729 {
8731 new_item.
SetQuantity(split_quantity_new,
false,
true);
8732 }
8733 }
8734 }
8735
8737 {
8739 float split_quantity_new = Math.Floor(quantity / 2);
8740
8742 return;
8743
8744 InventoryLocation invloc = new InventoryLocation;
8746
8748 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8749
8750 if (new_item)
8751 {
8752 if (new_item.GetQuantityMax() < split_quantity_new)
8753 {
8754 split_quantity_new = new_item.GetQuantityMax();
8755 }
8757 {
8760 }
8761 else if (split_quantity_new > 1)
8762 {
8764 new_item.
SetQuantity(split_quantity_new,
false,
true);
8765 }
8766 }
8767 }
8768
8771 {
8772 SetWeightDirty();
8774
8775 if (parent)
8776 parent.OnAttachmentQuantityChangedEx(this, delta);
8777
8779 {
8781 {
8783 }
8785 {
8786 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8788 }
8789 }
8790
8791 }
8792
8795 {
8796
8797 }
8798
8801 {
8803 }
8804
8806 {
8807 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8808
8810 {
8811 if (newLevel == GameConstants.STATE_RUINED)
8812 {
8814 EntityAI parent = GetHierarchyParent();
8815 if (parent && parent.IsFireplace())
8816 {
8817 CargoBase cargo = GetInventory().GetCargo();
8818 if (cargo)
8819 {
8821 {
8823 }
8824 }
8825 }
8826 }
8827
8829 {
8830
8832 return;
8833 }
8834
8835 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8836 {
8838 }
8839 }
8840 }
8841
8842
8844 {
8845 super.OnRightClick();
8846
8848 {
8850 {
8851 if (ScriptInputUserData.CanStoreInputUserData())
8852 {
8853 EntityAI root = GetHierarchyRoot();
8854 Man playerOwner = GetHierarchyRootPlayer();
8855 InventoryLocation dst = new InventoryLocation;
8856
8857
8858 if (!playerOwner && root && root == this)
8859 {
8861 }
8862 else
8863 {
8864
8865 GetInventory().GetCurrentInventoryLocation(dst);
8867 {
8870 {
8872 }
8873 else
8874 {
8876
8877
8878 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8879 {
8881 }
8882 else
8883 {
8884 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8885 }
8886 }
8887 }
8888 }
8889
8890 ScriptInputUserData ctx = new ScriptInputUserData;
8898 }
8899 }
8900 else if (!
GetGame().IsMultiplayer())
8901 {
8903 }
8904 }
8905 }
8906
8908 {
8909 if (root)
8910 {
8911 vector m4[4];
8912 root.GetTransform(m4);
8913 dst.SetGround(this, m4);
8914 }
8915 else
8916 {
8917 GetInventory().GetCurrentInventoryLocation(dst);
8918 }
8919 }
8920
8921 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8922 {
8923
8924 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8925 return false;
8926
8927 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8928 return false;
8929
8930
8932 return false;
8933
8934
8935 Magazine mag = Magazine.Cast(this);
8936 if (mag)
8937 {
8938 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8939 return false;
8940
8941 if (stack_max_limit)
8942 {
8943 Magazine other_mag = Magazine.Cast(other_item);
8944 if (other_item)
8945 {
8946 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8947 return false;
8948 }
8949
8950 }
8951 }
8952 else
8953 {
8954
8956 return false;
8957
8959 return false;
8960 }
8961
8962 PlayerBase player = null;
8963 if (CastTo(player, GetHierarchyRootPlayer()))
8964 {
8965 if (player.GetInventory().HasAttachment(this))
8966 return false;
8967
8968 if (player.IsItemsToDelete())
8969 return false;
8970 }
8971
8972 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8973 return false;
8974
8975 int slotID;
8977 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8978 return false;
8979
8980 return true;
8981 }
8982
8984 {
8986 }
8987
8989 {
8990 return m_IsResultOfSplit;
8991 }
8992
8994 {
8995 m_IsResultOfSplit = value;
8996 }
8997
8999 {
9001 }
9002
9004 {
9005 float other_item_quantity = other_item.GetQuantity();
9006 float this_free_space;
9007
9009
9011
9012 if (other_item_quantity > this_free_space)
9013 {
9014 return this_free_space;
9015 }
9016 else
9017 {
9018 return other_item_quantity;
9019 }
9020 }
9021
9023 {
9025 }
9026
9028 {
9030 return;
9031
9032 if (!IsMagazine() && other_item)
9033 {
9035 if (quantity_used != 0)
9036 {
9037 float hp1 = GetHealth01("","");
9038 float hp2 = other_item.GetHealth01("","");
9039 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9040 hpResult = hpResult / (
GetQuantity() + quantity_used);
9041
9042 hpResult *= GetMaxHealth();
9043 Math.Round(hpResult);
9044 SetHealth("", "Health", hpResult);
9045
9047 other_item.AddQuantity(-quantity_used);
9048 }
9049 }
9051 }
9052
9054 {
9055 #ifdef SERVER
9056 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9057 GetHierarchyParent().IncreaseLifetimeUp();
9058 #endif
9059 };
9060
9062 {
9063 PlayerBase p = PlayerBase.Cast(player);
9064
9065 array<int> recipesIds = p.m_Recipes;
9066 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9067 if (moduleRecipesManager)
9068 {
9069 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9070 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9071 }
9072
9073 for (int i = 0;i < recipesIds.Count(); i++)
9074 {
9075 int key = recipesIds.Get(i);
9076 string recipeName = moduleRecipesManager.GetRecipeName(key);
9078 }
9079 }
9080
9081
9082 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9083 {
9084 super.GetDebugActions(outputList);
9085
9086
9092
9093
9098
9103
9104
9108
9109
9111 {
9115 }
9116
9119
9120
9124
9126
9127 InventoryLocation loc = new InventoryLocation();
9128 GetInventory().GetCurrentInventoryLocation(loc);
9130 {
9131 if (Gizmo_IsSupported())
9134 }
9135
9137 }
9138
9139
9140
9141
9143 {
9144 super.OnAction(action_id, player, ctx);
9145
9147 {
9148 switch (action_id)
9149 {
9152 return true;
9155 return true;
9156 }
9157 }
9158
9160 {
9161 switch (action_id)
9162 {
9164 Delete();
9165 return true;
9166 }
9167 }
9168
9169 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9170 {
9171 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9172 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9173 PlayerBase p = PlayerBase.Cast(player);
9174 if (
EActions.RECIPES_RANGE_START < 1000)
9175 {
9176 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9177 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9178 }
9179 }
9180 #ifndef SERVER
9181 else if (action_id ==
EActions.WATCH_PLAYER)
9182 {
9183 PluginDeveloper.SetDeveloperItemClientEx(player);
9184 }
9185 #endif
9187 {
9188 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9189 {
9190 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9191 OnDebugButtonPressServer(id + 1);
9192 }
9193
9194 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9195 {
9196 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9198 }
9199
9200 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9201 {
9202 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9204 }
9205
9206 else if (action_id ==
EActions.ADD_QUANTITY)
9207 {
9208 if (IsMagazine())
9209 {
9210 Magazine mag = Magazine.Cast(this);
9211 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9212 }
9213 else
9214 {
9216 }
9217
9218 if (m_EM)
9219 {
9220 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9221 }
9222
9223 }
9224
9225 else if (action_id ==
EActions.REMOVE_QUANTITY)
9226 {
9227 if (IsMagazine())
9228 {
9229 Magazine mag2 = Magazine.Cast(this);
9230 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9231 }
9232 else
9233 {
9235 }
9236 if (m_EM)
9237 {
9238 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9239 }
9240
9241 }
9242
9243 else if (action_id ==
EActions.SET_QUANTITY_0)
9244 {
9246
9247 if (m_EM)
9248 {
9249 m_EM.SetEnergy(0);
9250 }
9251 }
9252
9253 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9254 {
9256
9257 if (m_EM)
9258 {
9259 m_EM.SetEnergy(m_EM.GetEnergyMax());
9260 }
9261 }
9262
9263 else if (action_id ==
EActions.ADD_HEALTH)
9264 {
9265 AddHealth("","",GetMaxHealth("","Health")/5);
9266 }
9267 else if (action_id ==
EActions.REMOVE_HEALTH)
9268 {
9269 AddHealth("","",-GetMaxHealth("","Health")/5);
9270 }
9271 else if (action_id ==
EActions.DESTROY_HEALTH)
9272 {
9273 SetHealth01("","",0);
9274 }
9275 else if (action_id ==
EActions.WATCH_ITEM)
9276 {
9278 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9279 #ifdef DEVELOPER
9280 SetDebugDeveloper_item(this);
9281 #endif
9282 }
9283
9284 else if (action_id ==
EActions.ADD_TEMPERATURE)
9285 {
9286 AddTemperature(20);
9287
9288 }
9289
9290 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9291 {
9292 AddTemperature(-20);
9293
9294 }
9295
9296 else if (action_id ==
EActions.FLIP_FROZEN)
9297 {
9298 SetFrozen(!GetIsFrozen());
9299
9300 }
9301
9302 else if (action_id ==
EActions.ADD_WETNESS)
9303 {
9305
9306 }
9307
9308 else if (action_id ==
EActions.REMOVE_WETNESS)
9309 {
9311
9312 }
9313
9314 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9315 {
9318
9319
9320 }
9321
9322 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9323 {
9326 }
9327
9328 else if (action_id ==
EActions.MAKE_SPECIAL)
9329 {
9330 auto debugParams = DebugSpawnParams.WithPlayer(player);
9331 OnDebugSpawnEx(debugParams);
9332 }
9333
9334 }
9335
9336
9337 return false;
9338 }
9339
9340
9341
9342
9346
9349
9350
9351
9353 {
9354 return false;
9355 }
9356
9357
9359 {
9360 return true;
9361 }
9362
9363
9365 {
9366 return true;
9367 }
9368
9369
9370
9372 {
9373 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9375 }
9376
9379 {
9380 return null;
9381 }
9382
9384 {
9385 return false;
9386 }
9387
9389 {
9390 return false;
9391 }
9392
9396
9397
9399 {
9400 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9401 return module_repairing.CanRepair(this, item_repair_kit);
9402 }
9403
9404
9405 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9406 {
9407 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9408 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9409 }
9410
9411
9413 {
9414
9415
9416
9417
9418
9419
9420
9421
9422 return 1;
9423 }
9424
9425
9426
9428 {
9430 }
9431
9432
9433
9435 {
9437 }
9438
9439
9448 {
9449 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9450
9451 if (player)
9452 {
9453 player.MessageStatus(text);
9454 }
9455 }
9456
9457
9466 {
9467 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9468
9469 if (player)
9470 {
9471 player.MessageAction(text);
9472 }
9473 }
9474
9475
9484 {
9485 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9486
9487 if (player)
9488 {
9489 player.MessageFriendly(text);
9490 }
9491 }
9492
9493
9502 {
9503 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9504
9505 if (player)
9506 {
9507 player.MessageImportant(text);
9508 }
9509 }
9510
9512 {
9513 return true;
9514 }
9515
9516
9517 override bool KindOf(
string tag)
9518 {
9519 bool found = false;
9520 string item_name = this.
GetType();
9523
9524 int array_size = item_tag_array.Count();
9525 for (int i = 0; i < array_size; i++)
9526 {
9527 if (item_tag_array.Get(i) == tag)
9528 {
9529 found = true;
9530 break;
9531 }
9532 }
9533 return found;
9534 }
9535
9536
9538 {
9539
9540 super.OnRPC(sender, rpc_type,ctx);
9541
9542
9543 switch (rpc_type)
9544 {
9545 #ifndef SERVER
9546 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9547 Param2<bool, string> p = new Param2<bool, string>(false, "");
9548
9550 return;
9551
9552 bool play = p.param1;
9553 string soundSet = p.param2;
9554
9555 if (play)
9556 {
9558 {
9560 {
9562 }
9563 }
9564 else
9565 {
9567 }
9568 }
9569 else
9570 {
9572 }
9573
9574 break;
9575 #endif
9576
9577 }
9578
9580 {
9582 }
9583 }
9584
9585
9586
9587
9589 {
9590 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9591 return plugin.GetID(
name);
9592 }
9593
9595 {
9596 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9597 return plugin.GetName(id);
9598 }
9599
9602 {
9603
9604
9605 int varFlags;
9606 if (!ctx.
Read(varFlags))
9607 return;
9608
9609 if (varFlags & ItemVariableFlags.FLOAT)
9610 {
9612 }
9613 }
9614
9616 {
9617
9618 super.SerializeNumericalVars(floats_out);
9619
9620
9621
9623 {
9625 }
9626
9628 {
9630 }
9631
9633 {
9635 }
9636
9638 {
9643 }
9644
9646 {
9648 }
9649 }
9650
9652 {
9653
9654 super.DeSerializeNumericalVars(floats);
9655
9656
9657 int index = 0;
9658 int mask = Math.Round(floats.Get(index));
9659
9660 index++;
9661
9663 {
9665 {
9667 }
9668 else
9669 {
9670 float quantity = floats.Get(index);
9672 }
9673 index++;
9674 }
9675
9677 {
9678 float wet = floats.Get(index);
9680 index++;
9681 }
9682
9684 {
9685 int liquidtype = Math.Round(floats.Get(index));
9687 index++;
9688 }
9689
9691 {
9693 index++;
9695 index++;
9697 index++;
9699 index++;
9700 }
9701
9703 {
9704 int cleanness = Math.Round(floats.Get(index));
9706 index++;
9707 }
9708 }
9709
9711 {
9712 super.WriteVarsToCTX(ctx);
9713
9714
9716 {
9718 }
9719
9721 {
9723 }
9724
9726 {
9728 }
9729
9731 {
9732 int r,g,b,a;
9738 }
9739
9741 {
9743 }
9744 }
9745
9747 {
9748 if (!super.ReadVarsFromCTX(ctx,version))
9749 return false;
9750
9751 int intValue;
9752 float value;
9753
9754 if (version < 140)
9755 {
9756 if (!ctx.
Read(intValue))
9757 return false;
9758
9759 m_VariablesMask = intValue;
9760 }
9761
9763 {
9764 if (!ctx.
Read(value))
9765 return false;
9766
9768 {
9770 }
9771 else
9772 {
9774 }
9775 }
9776
9777 if (version < 140)
9778 {
9780 {
9781 if (!ctx.
Read(value))
9782 return false;
9783 SetTemperatureDirect(value);
9784 }
9785 }
9786
9788 {
9789 if (!ctx.
Read(value))
9790 return false;
9792 }
9793
9795 {
9796 if (!ctx.
Read(intValue))
9797 return false;
9799 }
9800
9802 {
9803 int r,g,b,a;
9805 return false;
9807 return false;
9809 return false;
9811 return false;
9812
9814 }
9815
9817 {
9818 if (!ctx.
Read(intValue))
9819 return false;
9821 }
9822
9823 if (version >= 138 && version < 140)
9824 {
9826 {
9827 if (!ctx.
Read(intValue))
9828 return false;
9829 SetFrozen(intValue);
9830 }
9831 }
9832
9833 return true;
9834 }
9835
9836
9838 {
9841 {
9843 }
9844
9845 if (!super.OnStoreLoad(ctx, version))
9846 {
9848 return false;
9849 }
9850
9851 if (version >= 114)
9852 {
9853 bool hasQuickBarIndexSaved;
9854
9855 if (!ctx.
Read(hasQuickBarIndexSaved))
9856 {
9858 return false;
9859 }
9860
9861 if (hasQuickBarIndexSaved)
9862 {
9863 int itmQBIndex;
9864
9865
9866 if (!ctx.
Read(itmQBIndex))
9867 {
9869 return false;
9870 }
9871
9872 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9873 if (itmQBIndex != -1 && parentPlayer)
9874 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9875 }
9876 }
9877 else
9878 {
9879
9880 PlayerBase player;
9881 int itemQBIndex;
9882 if (version ==
int.
MAX)
9883 {
9884 if (!ctx.
Read(itemQBIndex))
9885 {
9887 return false;
9888 }
9889 }
9890 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9891 {
9892
9893 if (!ctx.
Read(itemQBIndex))
9894 {
9896 return false;
9897 }
9898 if (itemQBIndex != -1 && player)
9899 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9900 }
9901 }
9902
9903 if (version < 140)
9904 {
9905
9906 if (!LoadVariables(ctx, version))
9907 {
9909 return false;
9910 }
9911 }
9912
9913
9915 {
9917 return false;
9918 }
9919 if (version >= 132)
9920 {
9922 if (raib)
9923 {
9925 {
9927 return false;
9928 }
9929 }
9930 }
9931
9933 return true;
9934 }
9935
9936
9937
9939 {
9940 super.OnStoreSave(ctx);
9941
9942 PlayerBase player;
9943 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9944 {
9946
9947 int itemQBIndex = -1;
9948 itemQBIndex = player.FindQuickBarEntityIndex(this);
9949 ctx.
Write(itemQBIndex);
9950 }
9951 else
9952 {
9954 }
9955
9957
9959 if (raib)
9960 {
9962 }
9963 }
9964
9965
9967 {
9968 super.AfterStoreLoad();
9969
9971 {
9973 }
9974
9976 {
9979 }
9980 }
9981
9983 {
9984 super.EEOnAfterLoad();
9985
9987 {
9989 }
9990
9993 }
9994
9996 {
9997 return false;
9998 }
9999
10000
10001
10003 {
10005 {
10006 #ifdef PLATFORM_CONSOLE
10007
10009 {
10011 if (menu)
10012 {
10014 }
10015 }
10016 #endif
10017 }
10018
10020 {
10023 }
10024
10026 {
10027 SetWeightDirty();
10029 }
10031 {
10034 }
10035
10037 {
10040 }
10042 {
10045 }
10046
10047 super.OnVariablesSynchronized();
10048 }
10049
10050
10051
10053 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10054 {
10055 if (!IsServerCheck(allow_client))
10056 return false;
10057
10059 return false;
10060
10063
10064 if (value <= (min + 0.001))
10065 value = min;
10066
10067 if (value == min)
10068 {
10069 if (destroy_config)
10070 {
10071 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10072 if (dstr)
10073 {
10075 this.Delete();
10076 return true;
10077 }
10078 }
10079 else if (destroy_forced)
10080 {
10082 this.Delete();
10083 return true;
10084 }
10085
10087 }
10088
10091
10093 {
10095
10096 if (delta)
10098 }
10099
10101
10102 return false;
10103 }
10104
10105
10107 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10108 {
10110 }
10111
10113 {
10116 }
10117
10119 {
10122 }
10123
10125 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10126 {
10127 float value_clamped = Math.Clamp(value, 0, 1);
10129 SetQuantity(result, destroy_config, destroy_forced);
10130 }
10131
10132
10135 {
10137 }
10138
10140 {
10142 }
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10154 {
10155 int slot = -1;
10156 if (GetInventory())
10157 {
10158 InventoryLocation il = new InventoryLocation;
10159 GetInventory().GetCurrentInventoryLocation(il);
10161 }
10162
10164 }
10165
10167 {
10168 float quantity_max = 0;
10169
10171 {
10172 if (attSlotID != -1)
10173 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10174
10175 if (quantity_max <= 0)
10177 }
10178
10179 if (quantity_max <= 0)
10181
10182 return quantity_max;
10183 }
10184
10186 {
10188 }
10189
10191 {
10193 }
10194
10195
10197 {
10199 }
10200
10202 {
10204 }
10205
10207 {
10209 }
10210
10211
10213 {
10214
10215 float weightEx = GetWeightEx();
10216 float special = GetInventoryAndCargoWeight();
10217 return weightEx - special;
10218 }
10219
10220
10222 {
10224 }
10225
10227 {
10229 {
10230 #ifdef DEVELOPER
10231 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10232 {
10233 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10235 }
10236 #endif
10237
10238 return GetQuantity() * GetConfigWeightModified();
10239 }
10240 else if (HasEnergyManager())
10241 {
10242 #ifdef DEVELOPER
10243 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10244 {
10245 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10246 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10247 }
10248 #endif
10249 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
10250 }
10251 else
10252 {
10253 #ifdef DEVELOPER
10254 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10255 {
10256 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10257 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10258 }
10259 #endif
10260 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
10261 }
10262 }
10263
10266 {
10267 int item_count = 0;
10269
10270 if (GetInventory().GetCargo() != NULL)
10271 {
10272 item_count = GetInventory().GetCargo().GetItemCount();
10273 }
10274
10275 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10276 {
10277 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10278 if (item)
10279 item_count += item.GetNumberOfItems();
10280 }
10281 return item_count;
10282 }
10283
10286 {
10287 float weight = 0;
10288 float wetness = 1;
10289 if (include_wetness)
10292 {
10293 weight = wetness * m_ConfigWeight;
10294 }
10296 {
10297 weight = 1;
10298 }
10299 return weight;
10300 }
10301
10302
10303
10305 {
10306 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10307 {
10308 GameInventory inv = GetInventory();
10309 array<EntityAI> items = new array<EntityAI>;
10311 for (int i = 0; i < items.Count(); i++)
10312 {
10314 if (item)
10315 {
10317 }
10318 }
10319 }
10320 }
10321
10322
10323
10324
10326 {
10327 float energy = 0;
10328 if (HasEnergyManager())
10329 {
10330 energy = GetCompEM().GetEnergy();
10331 }
10332 return energy;
10333 }
10334
10335
10337 {
10338 super.OnEnergyConsumed();
10339
10341 }
10342
10344 {
10345 super.OnEnergyAdded();
10346
10348 }
10349
10350
10352 {
10353 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10354 {
10356 {
10357 float energy_0to1 = GetCompEM().GetEnergy0To1();
10359 }
10360 }
10361 }
10362
10363
10365 {
10366 return ConfigGetFloat("heatIsolation");
10367 }
10368
10370 {
10372 }
10373
10375 {
10376 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10377 if (
GetGame().ConfigIsExisting(paramPath))
10379
10380 return 0.0;
10381 }
10382
10384 {
10385 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10386 if (
GetGame().ConfigIsExisting(paramPath))
10388
10389 return 0.0;
10390 }
10391
10392 override void SetWet(
float value,
bool allow_client =
false)
10393 {
10394 if (!IsServerCheck(allow_client))
10395 return;
10396
10399
10401
10402 m_VarWet = Math.Clamp(value, min, max);
10403
10405 {
10408 }
10409 }
10410
10411 override void AddWet(
float value)
10412 {
10414 }
10415
10417 {
10419 }
10420
10422 {
10424 }
10425
10427 {
10429 }
10430
10432 {
10434 }
10435
10437 {
10439 }
10440
10441 override void OnWetChanged(
float newVal,
float oldVal)
10442 {
10445 if (newLevel != oldLevel)
10446 {
10448 }
10449 }
10450
10452 {
10453 SetWeightDirty();
10454 }
10455
10457 {
10458 return GetWetLevelInternal(
m_VarWet);
10459 }
10460
10461
10462
10464 {
10466 }
10467
10469 {
10471 }
10472
10474 {
10476 }
10477
10479 {
10481 }
10482
10483
10484
10486 {
10487 if (ConfigIsExisting("itemModelLength"))
10488 {
10489 return ConfigGetFloat("itemModelLength");
10490 }
10491 return 0;
10492 }
10493
10495 {
10496 if (ConfigIsExisting("itemAttachOffset"))
10497 {
10498 return ConfigGetFloat("itemAttachOffset");
10499 }
10500 return 0;
10501 }
10502
10503 override void SetCleanness(
int value,
bool allow_client =
false)
10504 {
10505 if (!IsServerCheck(allow_client))
10506 return;
10507
10509
10511
10514 }
10515
10517 {
10519 }
10520
10522 {
10523 return true;
10524 }
10525
10526
10527
10528
10530 {
10532 }
10533
10535 {
10537 }
10538
10539
10540
10541
10542 override void SetColor(
int r,
int g,
int b,
int a)
10543 {
10549 }
10551 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10552 {
10557 }
10558
10560 {
10562 }
10563
10566 {
10567 int r,g,b,a;
10569 r = r/255;
10570 g = g/255;
10571 b = b/255;
10572 a = a/255;
10573 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10574 }
10575
10576
10577
10578 override void SetLiquidType(
int value,
bool allow_client =
false)
10579 {
10580 if (!IsServerCheck(allow_client))
10581 return;
10582
10587 }
10588
10590 {
10591 return ConfigGetInt("varLiquidTypeInit");
10592 }
10593
10595 {
10597 }
10598
10600 {
10602 SetFrozen(false);
10603 }
10604
10607 {
10608 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10609 }
10610
10611
10614 {
10615 PlayerBase nplayer;
10616 if (PlayerBase.CastTo(nplayer, player))
10617 {
10619
10620 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10621 }
10622 }
10623
10624
10627 {
10628 PlayerBase nplayer;
10629 if (PlayerBase.CastTo(nplayer,player))
10630 {
10631
10632 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10633
10634 }
10635
10636
10637 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10638
10639
10640 if (HasEnergyManager())
10641 {
10642 GetCompEM().UpdatePlugState();
10643 }
10644 }
10645
10646
10648 {
10649 super.OnPlacementStarted(player);
10650
10652 }
10653
10654 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10655 {
10657 {
10658 m_AdminLog.OnPlacementComplete(player,
this);
10659 }
10660
10661 super.OnPlacementComplete(player, position, orientation);
10662 }
10663
10664
10665
10666
10667
10669 {
10671 {
10672 return true;
10673 }
10674 else
10675 {
10676 return false;
10677 }
10678 }
10679
10680
10682 {
10684 {
10686 }
10687 }
10688
10689
10691 {
10693 }
10694
10696 {
10698 }
10699
10700 override void InsertAgent(
int agent,
float count = 1)
10701 {
10702 if (count < 1)
10703 return;
10704
10706 }
10707
10710 {
10712 }
10713
10714
10716 {
10718 }
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10762 {
10764 return false;
10765 return true;
10766 }
10767
10769 {
10770
10772 }
10773
10774
10777 {
10778 super.CheckForRoofLimited(timeTresholdMS);
10779
10781 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10782 {
10783 m_PreviousRoofTestTime = time;
10784 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10785 }
10786 }
10787
10788
10790 {
10792 {
10793 return 0;
10794 }
10795
10796 if (GetInventory().GetAttachmentSlotsCount() != 0)
10797 {
10798 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10799 if (filter)
10800 return filter.GetProtectionLevel(type, false, system);
10801 else
10802 return 0;
10803 }
10804
10805 string subclassPath, entryName;
10806
10807 switch (type)
10808 {
10810 entryName = "biological";
10811 break;
10813 entryName = "chemical";
10814 break;
10815 default:
10816 entryName = "biological";
10817 break;
10818 }
10819
10820 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10821
10823 }
10824
10825
10826
10829 {
10830 if (!IsMagazine())
10832
10834 }
10835
10836
10837
10838
10839
10844 {
10845 return true;
10846 }
10847
10849 {
10851 }
10852
10853
10854
10855
10856
10858 {
10859 if (parent)
10860 {
10861 if (parent.IsInherited(DayZInfected))
10862 return true;
10863
10864 if (!parent.IsRuined())
10865 return true;
10866 }
10867
10868 return true;
10869 }
10870
10872 {
10873 if (!super.CanPutAsAttachment(parent))
10874 {
10875 return false;
10876 }
10877
10878 if (!IsRuined() && !parent.IsRuined())
10879 {
10880 return true;
10881 }
10882
10883 return false;
10884 }
10885
10887 {
10888
10889
10890
10891
10892 return super.CanReceiveItemIntoCargo(item);
10893 }
10894
10896 {
10897
10898
10899
10900
10901 GameInventory attachmentInv = attachment.GetInventory();
10903 {
10904 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10905 return false;
10906 }
10907
10908 InventoryLocation loc = new InventoryLocation();
10909 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10910 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10911 return false;
10912
10913 return super.CanReceiveAttachment(attachment, slotId);
10914 }
10915
10917 {
10918 if (!super.CanReleaseAttachment(attachment))
10919 return false;
10920
10921 return GetInventory().AreChildrenAccessible();
10922 }
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10945 {
10946 int id = muzzle_owner.GetMuzzleID();
10947 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10948
10949 if (WPOF_array)
10950 {
10951 for (int i = 0; i < WPOF_array.Count(); i++)
10952 {
10953 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10954
10955 if (WPOF)
10956 {
10957 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10958 }
10959 }
10960 }
10961 }
10962
10963
10965 {
10966 int id = muzzle_owner.GetMuzzleID();
10968
10969 if (WPOBE_array)
10970 {
10971 for (int i = 0; i < WPOBE_array.Count(); i++)
10972 {
10973 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10974
10975 if (WPOBE)
10976 {
10977 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10978 }
10979 }
10980 }
10981 }
10982
10983
10985 {
10986 int id = muzzle_owner.GetMuzzleID();
10987 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10988
10989 if (WPOOH_array)
10990 {
10991 for (int i = 0; i < WPOOH_array.Count(); i++)
10992 {
10993 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10994
10995 if (WPOOH)
10996 {
10997 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10998 }
10999 }
11000 }
11001 }
11002
11003
11005 {
11006 int id = muzzle_owner.GetMuzzleID();
11007 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11008
11009 if (WPOOH_array)
11010 {
11011 for (int i = 0; i < WPOOH_array.Count(); i++)
11012 {
11013 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11014
11015 if (WPOOH)
11016 {
11017 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11018 }
11019 }
11020 }
11021 }
11022
11023
11025 {
11026 int id = muzzle_owner.GetMuzzleID();
11027 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11028
11029 if (WPOOH_array)
11030 {
11031 for (int i = 0; i < WPOOH_array.Count(); i++)
11032 {
11033 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11034
11035 if (WPOOH)
11036 {
11037 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11038 }
11039 }
11040 }
11041 }
11042
11043
11044
11046 {
11048 {
11049 return true;
11050 }
11051
11052 return false;
11053 }
11054
11056 {
11058 {
11059 return true;
11060 }
11061
11062 return false;
11063 }
11064
11066 {
11068 {
11069 return true;
11070 }
11071
11072 return false;
11073 }
11074
11076 {
11077 return false;
11078 }
11079
11082 {
11083 return UATimeSpent.DEFAULT_DEPLOY;
11084 }
11085
11086
11087
11088
11090 {
11092 SetSynchDirty();
11093 }
11094
11096 {
11098 }
11099
11100
11102 {
11103 return false;
11104 }
11105
11108 {
11109 string att_type = "None";
11110
11111 if (ConfigIsExisting("soundAttType"))
11112 {
11113 att_type = ConfigGetString("soundAttType");
11114 }
11115
11117 }
11118
11120 {
11122 }
11123
11124
11125
11126
11127
11133
11135 {
11138
11140 }
11141
11142
11144 {
11146 return;
11147
11149
11152
11155
11156 SoundParameters params = new SoundParameters();
11160 }
11161
11162
11164 {
11166 return;
11167
11169 SetSynchDirty();
11170
11173 }
11174
11175
11177 {
11179 return;
11180
11182 SetSynchDirty();
11183
11186 }
11187
11189 {
11191 }
11192
11194 {
11196 }
11197
11200 {
11201 if (!
GetGame().IsDedicatedServer())
11202 {
11203 if (ConfigIsExisting("attachSoundSet"))
11204 {
11205 string cfg_path = "";
11206 string soundset = "";
11207 string type_name =
GetType();
11208
11211 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11212 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11213
11214 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11215 {
11216 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11217 {
11218 if (cfg_slot_array[i] == slot_type)
11219 {
11220 soundset = cfg_soundset_array[i];
11221 break;
11222 }
11223 }
11224 }
11225
11226 if (soundset != "")
11227 {
11228 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11230 }
11231 }
11232 }
11233 }
11234
11236 {
11237
11238 }
11239
11240 void OnApply(PlayerBase player);
11241
11243 {
11244 return 1.0;
11245 };
11246
11248 {
11250 }
11251
11253 {
11255 }
11256
11258
11260 {
11261 SetDynamicPhysicsLifeTime(0.01);
11263 }
11264
11266 {
11267 array<string> zone_names = new array<string>;
11268 GetDamageZones(zone_names);
11269 for (int i = 0; i < zone_names.Count(); i++)
11270 {
11271 SetHealthMax(zone_names.Get(i),"Health");
11272 }
11273 SetHealthMax("","Health");
11274 }
11275
11278 {
11279 float global_health = GetHealth01("","Health");
11280 array<string> zones = new array<string>;
11281 GetDamageZones(zones);
11282
11283 for (int i = 0; i < zones.Count(); i++)
11284 {
11285 SetHealth01(zones.Get(i),"Health",global_health);
11286 }
11287 }
11288
11291 {
11292 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11293 }
11294
11296 {
11297 if (!hasRootAsPlayer)
11298 {
11299 if (refParentIB)
11300 {
11301
11302 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11303 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11304
11305 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11306 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11307
11310 }
11311 else
11312 {
11313
11316 }
11317 }
11318 }
11319
11321 {
11323 {
11324 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11325 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
11326 {
11327 float heatPermCoef = 1.0;
11329 while (ent)
11330 {
11331 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11332 ent = ent.GetHierarchyParent();
11333 }
11334
11335 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11336 }
11337 }
11338 }
11339
11341 {
11342
11343 EntityAI parent = GetHierarchyParent();
11344 if (!parent)
11345 {
11346 hasParent = false;
11347 hasRootAsPlayer = false;
11348 }
11349 else
11350 {
11351 hasParent = true;
11352 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11353 refParentIB =
ItemBase.Cast(parent);
11354 }
11355 }
11356
11357 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11358 {
11359
11360 }
11361
11363 {
11364
11365 return false;
11366 }
11367
11369 {
11370
11371
11372 return false;
11373 }
11374
11376 {
11377
11378 return false;
11379 }
11380
11383 {
11384 return !GetIsFrozen() &&
IsOpen();
11385 }
11386
11388 {
11389 bool hasParent = false, hasRootAsPlayer = false;
11391
11392 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11393 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11394
11395 if (wwtu || foodDecay)
11396 {
11400
11401 if (processWetness || processTemperature || processDecay)
11402 {
11404
11405 if (processWetness)
11406 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11407
11408 if (processTemperature)
11410
11411 if (processDecay)
11412 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11413 }
11414 }
11415 }
11416
11419 {
11421 }
11422
11424 {
11427
11428 return super.GetTemperatureFreezeThreshold();
11429 }
11430
11432 {
11435
11436 return super.GetTemperatureThawThreshold();
11437 }
11438
11440 {
11443
11444 return super.GetItemOverheatThreshold();
11445 }
11446
11448 {
11450 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11451
11452 return super.GetTemperatureFreezeTime();
11453 }
11454
11456 {
11458 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11459
11460 return super.GetTemperatureThawTime();
11461 }
11462
11467
11469 {
11470 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11471 }
11472
11474 {
11475 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11476 }
11477
11480 {
11482 }
11483
11485 {
11487 }
11488
11490 {
11492 }
11493
11496 {
11497 return null;
11498 }
11499
11502 {
11503 return false;
11504 }
11505
11507 {
11509 {
11512 if (!trg)
11513 {
11515 explosive = this;
11516 }
11517
11518 explosive.PairRemote(trg);
11520
11521 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11522 trg.SetPersistentPairID(persistentID);
11523 explosive.SetPersistentPairID(persistentID);
11524
11525 return true;
11526 }
11527 return false;
11528 }
11529
11532 {
11533 float ret = 1.0;
11536 ret *= GetHealth01();
11537
11538 return ret;
11539 }
11540
11541 #ifdef DEVELOPER
11542 override void SetDebugItem()
11543 {
11544 super.SetDebugItem();
11545 _itemBase = this;
11546 }
11547
11549 {
11550 string text = super.GetDebugText();
11551
11553 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11554
11555 return text;
11556 }
11557 #endif
11558
11560 {
11561 return true;
11562 }
11563
11565
11567
11569 {
11572 }
11573
11574
11582
11598}
11599
11601{
11603 if (entity)
11604 {
11605 bool is_item = entity.IsInherited(
ItemBase);
11606 if (is_item && full_quantity)
11607 {
11610 }
11611 }
11612 else
11613 {
11615 return NULL;
11616 }
11617 return entity;
11618}
11619
11621{
11622 if (item)
11623 {
11624 if (health > 0)
11625 item.SetHealth("", "", health);
11626
11627 if (item.CanHaveTemperature())
11628 {
11630 if (item.CanFreeze())
11631 item.SetFrozen(false);
11632 }
11633
11634 if (item.HasEnergyManager())
11635 {
11636 if (quantity >= 0)
11637 {
11638 item.GetCompEM().SetEnergy0To1(quantity);
11639 }
11640 else
11641 {
11643 }
11644 }
11645 else if (item.IsMagazine())
11646 {
11647 Magazine mag = Magazine.Cast(item);
11648 if (quantity >= 0)
11649 {
11650 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11651 }
11652 else
11653 {
11655 }
11656
11657 }
11658 else
11659 {
11660 if (quantity >= 0)
11661 {
11662 item.SetQuantityNormalized(quantity, false);
11663 }
11664 else
11665 {
11667 }
11668
11669 }
11670 }
11671}
11672
11673#ifdef DEVELOPER
11675#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.