6942{
6944 {
6945 return true;
6946 }
6947};
6948
6949
6950
6952{
6956
6958
6961
6962
6963
6964
6965
6974
6980
6985
6990
7011 protected bool m_IsResultOfSplit
7012
7014
7019
7020
7021
7023
7027
7028
7029
7031
7034
7035
7036
7042
7043
7051
7054
7055
7057
7058
7060
7061
7066
7067
7072
7073
7075
7076
7078 {
7083
7084 if (!
GetGame().IsDedicatedServer())
7085 {
7087 {
7089
7091 {
7093 }
7094 }
7095
7098 }
7099
7100 m_OldLocation = null;
7101
7103 {
7105 }
7106
7107 if (ConfigIsExisting("headSelectionsToHide"))
7108 {
7111 }
7112
7114 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7115 {
7117 }
7118
7120
7121 m_IsResultOfSplit = false;
7122
7124 }
7125
7127 {
7128 super.InitItemVariables();
7129
7135 m_Count = ConfigGetInt(
"count");
7136
7139
7144
7147
7152
7164
7168
7169
7172 if (ConfigIsExisting("canBeSplit"))
7173 {
7176 }
7177
7179 if (ConfigIsExisting("itemBehaviour"))
7181
7182
7185 RegisterNetSyncVariableInt("m_VarLiquidType");
7186 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7187
7188 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7189 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7190 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7191
7192 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7193 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7194 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7195 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7196
7197 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7198 RegisterNetSyncVariableBool("m_IsTakeable");
7199 RegisterNetSyncVariableBool("m_IsHologram");
7200
7203 {
7206 }
7207
7209
7211 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7213
7214 }
7215
7217 {
7219 }
7220
7222 {
7225 {
7230 }
7231 }
7232
7233 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7234 {
7236 {
7239 }
7240
7242 }
7243
7245 {
7251 }
7252
7254
7256 {
7258
7259 if (!action)
7260 {
7261 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7262 return;
7263 }
7264
7266 if (!ai)
7267 {
7269 return;
7270 }
7271
7273 if (!action_array)
7274 {
7275 action_array = new array<ActionBase_Basic>;
7277 }
7278 if (LogManager.IsActionLogEnable())
7279 {
7280 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7281 }
7282
7283 if (action_array.Find(action) != -1)
7284 {
7285 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7286 }
7287 else
7288 {
7289 action_array.Insert(action);
7290 }
7291 }
7292
7294 {
7296 ActionBase action = player.GetActionManager().GetAction(actionName);
7299
7300 if (action_array)
7301 {
7302 action_array.RemoveItem(action);
7303 }
7304 }
7305
7306
7307
7309 {
7310 ActionOverrideData overrideData = new ActionOverrideData();
7314
7316 if (!actionMap)
7317 {
7320 }
7321
7322 actionMap.Insert(this.
Type(), overrideData);
7323
7324 }
7325
7327
7329
7330
7332 {
7335
7338
7339 string config_to_search = "CfgVehicles";
7340 string muzzle_owner_config;
7341
7343 {
7344 if (IsInherited(Weapon))
7345 config_to_search = "CfgWeapons";
7346
7347 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7348
7349 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7350
7352
7353 if (config_OnFire_subclass_count > 0)
7354 {
7355 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7356
7357 for (int i = 0; i < config_OnFire_subclass_count; i++)
7358 {
7359 string particle_class = "";
7361 string config_OnFire_entry = config_OnFire_class + particle_class;
7362 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7363 WPOF_array.Insert(WPOF);
7364 }
7365
7366
7368 }
7369 }
7370
7372 {
7373 config_to_search = "CfgWeapons";
7374 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7375
7376 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7377
7379
7380 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7381 {
7382 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7383
7384 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7385 {
7386 string particle_class2 = "";
7388 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7389 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7390 WPOBE_array.Insert(WPOBE);
7391 }
7392
7393
7395 }
7396 }
7397 }
7398
7399
7401 {
7404
7406 {
7407 string config_to_search = "CfgVehicles";
7408
7409 if (IsInherited(Weapon))
7410 config_to_search = "CfgWeapons";
7411
7412 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7413 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7414
7415 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7416 {
7417
7419
7421 {
7423 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7425 return;
7426 }
7427
7430
7431
7432
7434 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7435
7436 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7437 {
7438 string particle_class = "";
7440 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7442
7443 if (entry_type == CT_CLASS)
7444 {
7445 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7446 WPOOH_array.Insert(WPOF);
7447 }
7448 }
7449
7450
7452 }
7453 }
7454 }
7455
7457 {
7459 }
7460
7462 {
7464 {
7466
7469
7472
7473 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7474 }
7475 }
7476
7478 {
7480 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7481
7483 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7484
7486 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7487
7489 {
7491 }
7492 }
7493
7495 {
7497 }
7498
7500 {
7503 else
7505
7507 {
7510 }
7511 else
7512 {
7515
7518 }
7519
7521 }
7522
7524 {
7526 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7527 }
7528
7530 {
7532 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7534 }
7535
7537 {
7539 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7540 }
7541
7543 {
7546
7547 OverheatingParticle OP = new OverheatingParticle();
7552
7554 }
7555
7557 {
7560
7561 return -1;
7562 }
7563
7565 {
7567 {
7570
7571 for (int i = count; i > 0; --i)
7572 {
7573 int id = i - 1;
7576
7579
7580 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7581 {
7582 if (p)
7583 {
7586 }
7587 }
7588 }
7589 }
7590 }
7591
7593 {
7595 {
7597 {
7598 int id = i - 1;
7600
7601 if (OP)
7602 {
7604
7605 if (p)
7606 {
7608 }
7609
7610 delete OP;
7611 }
7612 }
7613
7616 }
7617 }
7618
7621 {
7622 return 0.0;
7623 }
7624
7625
7627 {
7628 return 250;
7629 }
7630
7632 {
7633 return 0;
7634 }
7635
7638 {
7640 return true;
7641
7642 return false;
7643 }
7644
7647 {
7650
7652 {
7654 }
7655 else
7656 {
7657
7659 }
7660
7662 }
7663
7670 {
7671 return -1;
7672 }
7673
7674
7675
7676
7678 {
7680 {
7682 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7683
7684 if (r_index >= 0)
7685 {
7686 InventoryLocation r_il = new InventoryLocation;
7687 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7688
7689 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7692 {
7693 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7694 }
7696 {
7697 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7698 }
7699
7700 }
7701
7702 player.GetHumanInventory().ClearUserReservedLocation(this);
7703 }
7704
7707 }
7708
7709
7710
7711
7713 {
7714 return ItemBase.m_DebugActionsMask;
7715 }
7716
7718 {
7719 return ItemBase.m_DebugActionsMask & mask;
7720 }
7721
7723 {
7724 ItemBase.m_DebugActionsMask = mask;
7725 }
7726
7728 {
7729 ItemBase.m_DebugActionsMask |= mask;
7730 }
7731
7733 {
7734 ItemBase.m_DebugActionsMask &= ~mask;
7735 }
7736
7738 {
7740 {
7742 }
7743 else
7744 {
7746 }
7747 }
7748
7749
7751 {
7752 if (GetEconomyProfile())
7753 {
7754 float q_max = GetEconomyProfile().GetQuantityMax();
7755 if (q_max > 0)
7756 {
7757 float q_min = GetEconomyProfile().GetQuantityMin();
7758 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7759
7761 {
7762 ComponentEnergyManager comp = GetCompEM();
7764 {
7766 }
7767 }
7769 {
7771
7772 }
7773
7774 }
7775 }
7776 }
7777
7780 {
7781 EntityAI parent = GetHierarchyParent();
7782
7783 if (parent)
7784 {
7785 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7786 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7787 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7788 }
7789 }
7790
7793 {
7794 EntityAI parent = GetHierarchyParent();
7795
7796 if (parent)
7797 {
7798 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7799 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7800 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7801 }
7802 }
7803
7805 {
7806
7807
7808
7809
7811
7813 {
7814 if (ScriptInputUserData.CanStoreInputUserData())
7815 {
7816 ScriptInputUserData ctx = new ScriptInputUserData;
7822 ctx.
Write(use_stack_max);
7825
7827 {
7828 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7829 }
7830 }
7831 }
7832 else if (!
GetGame().IsMultiplayer())
7833 {
7835 }
7836 }
7837
7839 {
7841 }
7842
7844 {
7846 }
7847
7849 {
7851 }
7852
7854 {
7855
7856 return false;
7857 }
7858
7860 {
7861 return false;
7862 }
7863
7867 {
7868 return false;
7869 }
7870
7872 {
7873 return "";
7874 }
7875
7877
7879 {
7880 return false;
7881 }
7882
7884 {
7885 return true;
7886 }
7887
7888
7889
7891 {
7892 return true;
7893 }
7894
7896 {
7897 return true;
7898 }
7899
7901 {
7902 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7904 }
7905
7907 {
7909 }
7910
7912 {
7914 if (!is_being_placed)
7916 SetSynchDirty();
7917 }
7918
7919
7921
7923 {
7925 }
7926
7928 {
7930 }
7931
7933 {
7934 return 1;
7935 }
7936
7938 {
7939 return false;
7940 }
7941
7943 {
7945 SetSynchDirty();
7946 }
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7983 {
7984 super.OnMovedInsideCargo(container);
7985
7986 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7987 }
7988
7989 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7990 {
7991 super.EEItemLocationChanged(oldLoc,newLoc);
7992
7993 PlayerBase new_player = null;
7994 PlayerBase old_player = null;
7995
7996 if (newLoc.GetParent())
7997 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7998
7999 if (oldLoc.GetParent())
8000 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8001
8003 {
8004 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8005
8006 if (r_index >= 0)
8007 {
8008 InventoryLocation r_il = new InventoryLocation;
8009 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8010
8011 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8014 {
8015 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8016 }
8018 {
8019 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8020 }
8021
8022 }
8023 }
8024
8026 {
8027 if (new_player)
8028 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8029
8030 if (new_player == old_player)
8031 {
8032
8033 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8034 {
8036 {
8037 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8038 {
8039 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8040 }
8041 }
8042 else
8043 {
8044 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8045 }
8046 }
8047
8048 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8049 {
8050 int type = oldLoc.GetType();
8052 {
8053 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8054 }
8056 {
8057 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8058 }
8059 }
8060 if (!m_OldLocation)
8061 {
8062 m_OldLocation = new InventoryLocation;
8063 }
8064 m_OldLocation.Copy(oldLoc);
8065 }
8066 else
8067 {
8068 if (m_OldLocation)
8069 {
8070 m_OldLocation.Reset();
8071 }
8072 }
8073
8075 }
8076 else
8077 {
8078 if (new_player)
8079 {
8080 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8081 if (res_index >= 0)
8082 {
8083 InventoryLocation il = new InventoryLocation;
8084 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8086 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8089 {
8090 il.
GetParent().GetOnReleaseLock().Invoke(it);
8091 }
8093 {
8095 }
8096
8097 }
8098 }
8100 {
8101
8103 }
8104
8105 if (m_OldLocation)
8106 {
8107 m_OldLocation.Reset();
8108 }
8109 }
8110 }
8111
8112 override void EOnContact(IEntity other, Contact extra)
8113 {
8115 {
8116 int liquidType = -1;
8118 if (impactSpeed > 0.0)
8119 {
8121 #ifndef SERVER
8123 #else
8125 SetSynchDirty();
8126 #endif
8128 }
8129 }
8130
8131 #ifdef SERVER
8132 if (GetCompEM() && GetCompEM().IsPlugged())
8133 {
8134 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8135 GetCompEM().UnplugThis();
8136 }
8137 #endif
8138 }
8139
8141
8143 {
8145 }
8146
8148 {
8149
8150 }
8151
8153 {
8154 super.OnItemLocationChanged(old_owner, new_owner);
8155
8156 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8157 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8158
8159 if (!relatedPlayer && playerNew)
8160 relatedPlayer = playerNew;
8161
8162 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8163 {
8165 if (actionMgr)
8166 {
8167 ActionBase currentAction = actionMgr.GetRunningAction();
8168 if (currentAction)
8170 }
8171 }
8172
8173 Man ownerPlayerOld = null;
8174 Man ownerPlayerNew = null;
8175
8176 if (old_owner)
8177 {
8178 if (old_owner.
IsMan())
8179 {
8180 ownerPlayerOld = Man.Cast(old_owner);
8181 }
8182 else
8183 {
8184 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8185 }
8186 }
8187 else
8188 {
8190 {
8192
8193 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8194 {
8195 GetCompEM().UnplugThis();
8196 }
8197 }
8198 }
8199
8200 if (new_owner)
8201 {
8202 if (new_owner.
IsMan())
8203 {
8204 ownerPlayerNew = Man.Cast(new_owner);
8205 }
8206 else
8207 {
8208 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8209 }
8210 }
8211
8212 if (ownerPlayerOld != ownerPlayerNew)
8213 {
8214 if (ownerPlayerOld)
8215 {
8216 array<EntityAI> subItemsExit = new array<EntityAI>;
8218 for (int i = 0; i < subItemsExit.Count(); i++)
8219 {
8222 }
8223 }
8224
8225 if (ownerPlayerNew)
8226 {
8227 array<EntityAI> subItemsEnter = new array<EntityAI>;
8229 for (int j = 0; j < subItemsEnter.Count(); j++)
8230 {
8233 }
8234 }
8235 }
8236 else if (ownerPlayerNew != null)
8237 {
8238 PlayerBase nplayer;
8239 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8240 {
8241 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8243 for (int k = 0; k < subItemsUpdate.Count(); k++)
8244 {
8246 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8247 }
8248 }
8249 }
8250
8251 if (old_owner)
8252 old_owner.OnChildItemRemoved(this);
8253 if (new_owner)
8254 new_owner.OnChildItemReceived(this);
8255 }
8256
8257
8259 {
8260 super.EEDelete(parent);
8261 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8262 if (player)
8263 {
8265
8266 if (player.IsAlive())
8267 {
8268 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8269 if (r_index >= 0)
8270 {
8271 InventoryLocation r_il = new InventoryLocation;
8272 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8273
8274 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8277 {
8278 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8279 }
8281 {
8282 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8283 }
8284
8285 }
8286
8287 player.RemoveQuickBarEntityShortcut(this);
8288 }
8289 }
8290 }
8291
8293 {
8294 super.EEKilled(killer);
8295
8298 {
8299 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8300 {
8301 if (IsMagazine())
8302 {
8303 if (Magazine.Cast(this).GetAmmoCount() > 0)
8304 {
8306 }
8307 }
8308 else
8309 {
8311 }
8312 }
8313 }
8314 }
8315
8317 {
8318 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8319
8320 super.OnWasAttached(parent, slot_id);
8321
8324
8326 }
8327
8329 {
8330 super.OnWasDetached(parent, slot_id);
8331
8334 }
8335
8337 {
8338 int idx;
8341
8342 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8343 if (inventory_slots.Count() < 1)
8344 {
8345 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8346 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8347 }
8348 else
8349 {
8350 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8351 }
8352
8353 idx = inventory_slots.Find(slot);
8354 if (idx < 0)
8355 return "";
8356
8357 return attach_types.Get(idx);
8358 }
8359
8361 {
8362 int idx = -1;
8363 string slot;
8364
8367
8368 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8369 if (inventory_slots.Count() < 1)
8370 {
8371 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8372 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8373 }
8374 else
8375 {
8376 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8377 if (detach_types.Count() < 1)
8378 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8379 }
8380
8381 for (int i = 0; i < inventory_slots.Count(); i++)
8382 {
8383 slot = inventory_slots.Get(i);
8384 }
8385
8386 if (slot != "")
8387 {
8388 if (detach_types.Count() == 1)
8389 idx = 0;
8390 else
8391 idx = inventory_slots.Find(slot);
8392 }
8393 if (idx < 0)
8394 return "";
8395
8396 return detach_types.Get(idx);
8397 }
8398
8400 {
8401
8403
8404
8405 float min_time = 1;
8406 float max_time = 3;
8407 float delay = Math.RandomFloat(min_time, max_time);
8408
8409 explode_timer.Run(delay, this, "DoAmmoExplosion");
8410 }
8411
8413 {
8414 Magazine magazine = Magazine.Cast(this);
8415 int pop_sounds_count = 6;
8416 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8417
8418
8419 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8420 string sound_name = pop_sounds[ sound_idx ];
8422
8423
8424 magazine.ServerAddAmmoCount(-1);
8425
8426
8427 float min_temp_to_explode = 100;
8428
8429 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
8430 {
8432 }
8433 }
8434
8435
8436 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8437 {
8438 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8439
8440 const int CHANCE_DAMAGE_CARGO = 4;
8441 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8442 const int CHANCE_DAMAGE_NOTHING = 2;
8443
8445 {
8446 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8447 int chances;
8448 int rnd;
8449
8450 if (GetInventory().GetCargo())
8451 {
8452 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8453 rnd = Math.RandomInt(0,chances);
8454
8455 if (rnd < CHANCE_DAMAGE_CARGO)
8456 {
8458 }
8459 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8460 {
8462 }
8463 }
8464 else
8465 {
8466 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8467 rnd = Math.RandomInt(0,chances);
8468
8469 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8470 {
8472 }
8473 }
8474 }
8475 }
8476
8478 {
8479 if (GetInventory().GetCargo())
8480 {
8481 int item_count = GetInventory().GetCargo().GetItemCount();
8482 if (item_count > 0)
8483 {
8484 int random_pick = Math.RandomInt(0, item_count);
8486 if (!item.IsExplosive())
8487 {
8488 item.AddHealth("","",damage);
8489 return true;
8490 }
8491 }
8492 }
8493 return false;
8494 }
8495
8497 {
8498 int attachment_count = GetInventory().AttachmentCount();
8499 if (attachment_count > 0)
8500 {
8501 int random_pick = Math.RandomInt(0, attachment_count);
8502 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8503 if (!attachment.IsExplosive())
8504 {
8505 attachment.AddHealth("","",damage);
8506 return true;
8507 }
8508 }
8509 return false;
8510 }
8511
8513 {
8515 }
8516
8518 {
8520 return GetInventory().CanRemoveEntity();
8521
8522 return false;
8523 }
8524
8526 {
8527
8529 return false;
8530
8531
8533 return false;
8534
8535
8536
8538 if (delta == 0)
8539 return false;
8540
8541
8542 return true;
8543 }
8544
8546 {
8548 {
8549 if (ScriptInputUserData.CanStoreInputUserData())
8550 {
8551 ScriptInputUserData ctx = new ScriptInputUserData;
8556 ctx.
Write(destination_entity);
8560 }
8561 }
8562 else if (!
GetGame().IsMultiplayer())
8563 {
8565 }
8566 }
8567
8569 {
8570 float split_quantity_new;
8574 InventoryLocation loc = new InventoryLocation;
8575
8576 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8577 {
8579 split_quantity_new = stack_max;
8580 else
8582
8584 {
8585 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8586 if (new_item)
8587 {
8588 new_item.SetResultOfSplit(true);
8589 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8591 new_item.
SetQuantity(split_quantity_new,
false,
true);
8592 }
8593 }
8594 }
8595 else if (destination_entity && slot_id == -1)
8596 {
8597 if (quantity > stack_max)
8598 split_quantity_new = stack_max;
8599 else
8600 split_quantity_new = quantity;
8601
8603 {
8605 {
8608 }
8609
8610 if (new_item)
8611 {
8612 new_item.SetResultOfSplit(true);
8613 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8615 new_item.
SetQuantity(split_quantity_new,
false,
true);
8616 }
8617 }
8618 }
8619 else
8620 {
8621 if (stack_max != 0)
8622 {
8624 {
8626 }
8627
8628 if (split_quantity_new == 0)
8629 {
8630 if (!
GetGame().IsMultiplayer())
8631 player.PhysicalPredictiveDropItem(this);
8632 else
8633 player.ServerDropEntity(this);
8634 return;
8635 }
8636
8638 {
8640
8641 if (new_item)
8642 {
8643 new_item.SetResultOfSplit(true);
8644 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8647 new_item.PlaceOnSurface();
8648 }
8649 }
8650 }
8651 }
8652 }
8653
8655 {
8656 float split_quantity_new;
8660 InventoryLocation loc = new InventoryLocation;
8661
8662 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8663 {
8665 split_quantity_new = stack_max;
8666 else
8668
8670 {
8671 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8672 if (new_item)
8673 {
8674 new_item.SetResultOfSplit(true);
8675 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8677 new_item.
SetQuantity(split_quantity_new,
false,
true);
8678 }
8679 }
8680 }
8681 else if (destination_entity && slot_id == -1)
8682 {
8683 if (quantity > stack_max)
8684 split_quantity_new = stack_max;
8685 else
8686 split_quantity_new = quantity;
8687
8689 {
8691 {
8694 }
8695
8696 if (new_item)
8697 {
8698 new_item.SetResultOfSplit(true);
8699 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8701 new_item.
SetQuantity(split_quantity_new,
false,
true);
8702 }
8703 }
8704 }
8705 else
8706 {
8707 if (stack_max != 0)
8708 {
8710 {
8712 }
8713
8715 {
8717
8718 if (new_item)
8719 {
8720 new_item.SetResultOfSplit(true);
8721 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8724 new_item.PlaceOnSurface();
8725 }
8726 }
8727 }
8728 }
8729 }
8730
8732 {
8734 {
8735 if (ScriptInputUserData.CanStoreInputUserData())
8736 {
8737 ScriptInputUserData ctx = new ScriptInputUserData;
8742 dst.WriteToContext(ctx);
8744 }
8745 }
8746 else if (!
GetGame().IsMultiplayer())
8747 {
8749 }
8750 }
8751
8753 {
8755 {
8756 if (ScriptInputUserData.CanStoreInputUserData())
8757 {
8758 ScriptInputUserData ctx = new ScriptInputUserData;
8763 ctx.
Write(destination_entity);
8769 }
8770 }
8771 else if (!
GetGame().IsMultiplayer())
8772 {
8774 }
8775 }
8776
8778 {
8780 }
8781
8783 {
8785 float split_quantity_new;
8787 if (dst.IsValid())
8788 {
8789 int slot_id = dst.GetSlot();
8791
8792 if (quantity > stack_max)
8793 split_quantity_new = stack_max;
8794 else
8795 split_quantity_new = quantity;
8796
8798 {
8800
8801 if (new_item)
8802 {
8803 new_item.SetResultOfSplit(true);
8804 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8806 new_item.
SetQuantity(split_quantity_new,
false,
true);
8807 }
8808
8809 return new_item;
8810 }
8811 }
8812
8813 return null;
8814 }
8815
8817 {
8819 float split_quantity_new;
8821 if (destination_entity)
8822 {
8824 if (quantity > stackable)
8825 split_quantity_new = stackable;
8826 else
8827 split_quantity_new = quantity;
8828
8830 {
8831 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8832 if (new_item)
8833 {
8834 new_item.SetResultOfSplit(true);
8835 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8837 new_item.
SetQuantity(split_quantity_new,
false,
true);
8838 }
8839 }
8840 }
8841 }
8842
8844 {
8846 {
8847 if (ScriptInputUserData.CanStoreInputUserData())
8848 {
8849 ScriptInputUserData ctx = new ScriptInputUserData;
8854 ItemBase destination_entity =
this;
8855 ctx.
Write(destination_entity);
8859 }
8860 }
8861 else if (!
GetGame().IsMultiplayer())
8862 {
8864 }
8865 }
8866
8868 {
8870 float split_quantity_new;
8872 if (player)
8873 {
8875 if (quantity > stackable)
8876 split_quantity_new = stackable;
8877 else
8878 split_quantity_new = quantity;
8879
8881 {
8882 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8883 new_item =
ItemBase.Cast(in_hands);
8884 if (new_item)
8885 {
8886 new_item.SetResultOfSplit(true);
8887 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8889 new_item.SetQuantity(split_quantity_new, false, true);
8890 }
8891 }
8892 }
8893 }
8894
8896 {
8898 float split_quantity_new = Math.Floor(quantity * 0.5);
8899
8901 return;
8902
8904
8905 if (new_item)
8906 {
8907 if (new_item.GetQuantityMax() < split_quantity_new)
8908 {
8909 split_quantity_new = new_item.GetQuantityMax();
8910 }
8911
8912 new_item.SetResultOfSplit(true);
8913 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8914
8916 {
8919 }
8920 else
8921 {
8923 new_item.
SetQuantity(split_quantity_new,
false,
true);
8924 }
8925 }
8926 }
8927
8929 {
8931 float split_quantity_new = Math.Floor(quantity / 2);
8932
8934 return;
8935
8936 InventoryLocation invloc = new InventoryLocation;
8938
8940 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8941
8942 if (new_item)
8943 {
8944 if (new_item.GetQuantityMax() < split_quantity_new)
8945 {
8946 split_quantity_new = new_item.GetQuantityMax();
8947 }
8949 {
8952 }
8953 else if (split_quantity_new > 1)
8954 {
8956 new_item.
SetQuantity(split_quantity_new,
false,
true);
8957 }
8958 }
8959 }
8960
8963 {
8964 SetWeightDirty();
8966
8967 if (parent)
8968 parent.OnAttachmentQuantityChangedEx(this, delta);
8969
8971 {
8973 {
8975 }
8977 {
8978 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8980 }
8981 }
8982
8983 }
8984
8987 {
8988
8989 }
8990
8993 {
8995 }
8996
8998 {
8999 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9000
9002 {
9003 if (newLevel == GameConstants.STATE_RUINED)
9004 {
9006 EntityAI parent = GetHierarchyParent();
9007 if (parent && parent.IsFireplace())
9008 {
9009 CargoBase cargo = GetInventory().GetCargo();
9010 if (cargo)
9011 {
9013 {
9015 }
9016 }
9017 }
9018 }
9019
9021 {
9022
9024 return;
9025 }
9026
9027 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9028 {
9030 }
9031 }
9032 }
9033
9034
9036 {
9037 super.OnRightClick();
9038
9040 {
9042 {
9043 if (ScriptInputUserData.CanStoreInputUserData())
9044 {
9045 EntityAI root = GetHierarchyRoot();
9046 Man playerOwner = GetHierarchyRootPlayer();
9047 InventoryLocation dst = new InventoryLocation;
9048
9049
9050 if (!playerOwner && root && root == this)
9051 {
9053 }
9054 else
9055 {
9056
9057 GetInventory().GetCurrentInventoryLocation(dst);
9059 {
9062 {
9064 }
9065 else
9066 {
9068
9069
9070 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9071 {
9073 }
9074 else
9075 {
9076 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9077 }
9078 }
9079 }
9080 }
9081
9082 ScriptInputUserData ctx = new ScriptInputUserData;
9090 }
9091 }
9092 else if (!
GetGame().IsMultiplayer())
9093 {
9095 }
9096 }
9097 }
9098
9100 {
9101 if (root)
9102 {
9103 vector m4[4];
9104 root.GetTransform(m4);
9105 dst.SetGround(this, m4);
9106 }
9107 else
9108 {
9109 GetInventory().GetCurrentInventoryLocation(dst);
9110 }
9111 }
9112
9113 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9114 {
9115
9116 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9117 return false;
9118
9119 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9120 return false;
9121
9122
9124 return false;
9125
9126
9127 Magazine mag = Magazine.Cast(this);
9128 if (mag)
9129 {
9130 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9131 return false;
9132
9133 if (stack_max_limit)
9134 {
9135 Magazine other_mag = Magazine.Cast(other_item);
9136 if (other_item)
9137 {
9138 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9139 return false;
9140 }
9141
9142 }
9143 }
9144 else
9145 {
9146
9148 return false;
9149
9151 return false;
9152 }
9153
9154 PlayerBase player = null;
9155 if (CastTo(player, GetHierarchyRootPlayer()))
9156 {
9157 if (player.GetInventory().HasAttachment(this))
9158 return false;
9159
9160 if (player.IsItemsToDelete())
9161 return false;
9162 }
9163
9164 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9165 return false;
9166
9167 int slotID;
9169 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9170 return false;
9171
9172 return true;
9173 }
9174
9176 {
9178 }
9179
9181 {
9182 return m_IsResultOfSplit;
9183 }
9184
9186 {
9187 m_IsResultOfSplit = value;
9188 }
9189
9191 {
9193 }
9194
9196 {
9197 float other_item_quantity = other_item.GetQuantity();
9198 float this_free_space;
9199
9201
9203
9204 if (other_item_quantity > this_free_space)
9205 {
9206 return this_free_space;
9207 }
9208 else
9209 {
9210 return other_item_quantity;
9211 }
9212 }
9213
9215 {
9217 }
9218
9220 {
9222 return;
9223
9224 if (!IsMagazine() && other_item)
9225 {
9227 if (quantity_used != 0)
9228 {
9229 float hp1 = GetHealth01("","");
9230 float hp2 = other_item.GetHealth01("","");
9231 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9232 hpResult = hpResult / (
GetQuantity() + quantity_used);
9233
9234 hpResult *= GetMaxHealth();
9235 Math.Round(hpResult);
9236 SetHealth("", "Health", hpResult);
9237
9239 other_item.AddQuantity(-quantity_used);
9240 }
9241 }
9243 }
9244
9246 {
9247 #ifdef SERVER
9248 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9249 GetHierarchyParent().IncreaseLifetimeUp();
9250 #endif
9251 };
9252
9254 {
9255 PlayerBase p = PlayerBase.Cast(player);
9256
9257 array<int> recipesIds = p.m_Recipes;
9258 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9259 if (moduleRecipesManager)
9260 {
9261 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9262 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9263 }
9264
9265 for (int i = 0;i < recipesIds.Count(); i++)
9266 {
9267 int key = recipesIds.Get(i);
9268 string recipeName = moduleRecipesManager.GetRecipeName(key);
9270 }
9271 }
9272
9273
9274 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9275 {
9276 super.GetDebugActions(outputList);
9277
9278
9284
9285
9290
9295
9296
9300
9301
9303 {
9307 }
9308
9311
9312
9316
9318
9319 InventoryLocation loc = new InventoryLocation();
9320 GetInventory().GetCurrentInventoryLocation(loc);
9322 {
9323 if (Gizmo_IsSupported())
9326 }
9327
9329 }
9330
9331
9332
9333
9335 {
9336 super.OnAction(action_id, player, ctx);
9337
9339 {
9340 switch (action_id)
9341 {
9344 return true;
9347 return true;
9348 }
9349 }
9350
9352 {
9353 switch (action_id)
9354 {
9356 Delete();
9357 return true;
9358 }
9359 }
9360
9361 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9362 {
9363 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9364 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9365 PlayerBase p = PlayerBase.Cast(player);
9366 if (
EActions.RECIPES_RANGE_START < 1000)
9367 {
9368 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9369 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9370 }
9371 }
9372 #ifndef SERVER
9373 else if (action_id ==
EActions.WATCH_PLAYER)
9374 {
9375 PluginDeveloper.SetDeveloperItemClientEx(player);
9376 }
9377 #endif
9379 {
9380 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9381 {
9382 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9383 OnDebugButtonPressServer(id + 1);
9384 }
9385
9386 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9387 {
9388 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9390 }
9391
9392 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9393 {
9394 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9396 }
9397
9398 else if (action_id ==
EActions.ADD_QUANTITY)
9399 {
9400 if (IsMagazine())
9401 {
9402 Magazine mag = Magazine.Cast(this);
9403 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9404 }
9405 else
9406 {
9408 }
9409
9410 if (m_EM)
9411 {
9412 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9413 }
9414
9415 }
9416
9417 else if (action_id ==
EActions.REMOVE_QUANTITY)
9418 {
9419 if (IsMagazine())
9420 {
9421 Magazine mag2 = Magazine.Cast(this);
9422 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9423 }
9424 else
9425 {
9427 }
9428 if (m_EM)
9429 {
9430 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9431 }
9432
9433 }
9434
9435 else if (action_id ==
EActions.SET_QUANTITY_0)
9436 {
9438
9439 if (m_EM)
9440 {
9441 m_EM.SetEnergy(0);
9442 }
9443 }
9444
9445 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9446 {
9448
9449 if (m_EM)
9450 {
9451 m_EM.SetEnergy(m_EM.GetEnergyMax());
9452 }
9453 }
9454
9455 else if (action_id ==
EActions.ADD_HEALTH)
9456 {
9457 AddHealth("","",GetMaxHealth("","Health")/5);
9458 }
9459 else if (action_id ==
EActions.REMOVE_HEALTH)
9460 {
9461 AddHealth("","",-GetMaxHealth("","Health")/5);
9462 }
9463 else if (action_id ==
EActions.DESTROY_HEALTH)
9464 {
9465 SetHealth01("","",0);
9466 }
9467 else if (action_id ==
EActions.WATCH_ITEM)
9468 {
9470 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9471 #ifdef DEVELOPER
9472 SetDebugDeveloper_item(this);
9473 #endif
9474 }
9475
9476 else if (action_id ==
EActions.ADD_TEMPERATURE)
9477 {
9478 AddTemperature(20);
9479
9480 }
9481
9482 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9483 {
9484 AddTemperature(-20);
9485
9486 }
9487
9488 else if (action_id ==
EActions.FLIP_FROZEN)
9489 {
9490 SetFrozen(!GetIsFrozen());
9491
9492 }
9493
9494 else if (action_id ==
EActions.ADD_WETNESS)
9495 {
9497
9498 }
9499
9500 else if (action_id ==
EActions.REMOVE_WETNESS)
9501 {
9503
9504 }
9505
9506 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9507 {
9510
9511
9512 }
9513
9514 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9515 {
9518 }
9519
9520 else if (action_id ==
EActions.MAKE_SPECIAL)
9521 {
9522 auto debugParams = DebugSpawnParams.WithPlayer(player);
9523 OnDebugSpawnEx(debugParams);
9524 }
9525
9526 }
9527
9528
9529 return false;
9530 }
9531
9532
9533
9534
9538
9541
9542
9543
9545 {
9546 return false;
9547 }
9548
9549
9551 {
9552 return true;
9553 }
9554
9555
9557 {
9558 return true;
9559 }
9560
9561
9562
9564 {
9565 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9567 }
9568
9571 {
9572 return null;
9573 }
9574
9576 {
9577 return false;
9578 }
9579
9581 {
9582 return false;
9583 }
9584
9588
9589
9591 {
9592 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9593 return module_repairing.CanRepair(this, item_repair_kit);
9594 }
9595
9596
9597 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9598 {
9599 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9600 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9601 }
9602
9603
9605 {
9606
9607
9608
9609
9610
9611
9612
9613
9614 return 1;
9615 }
9616
9617
9618
9620 {
9622 }
9623
9624
9625
9627 {
9629 }
9630
9631
9640 {
9641 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9642
9643 if (player)
9644 {
9645 player.MessageStatus(text);
9646 }
9647 }
9648
9649
9658 {
9659 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9660
9661 if (player)
9662 {
9663 player.MessageAction(text);
9664 }
9665 }
9666
9667
9676 {
9677 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9678
9679 if (player)
9680 {
9681 player.MessageFriendly(text);
9682 }
9683 }
9684
9685
9694 {
9695 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9696
9697 if (player)
9698 {
9699 player.MessageImportant(text);
9700 }
9701 }
9702
9704 {
9705 return true;
9706 }
9707
9708
9709 override bool KindOf(
string tag)
9710 {
9711 bool found = false;
9712 string item_name = this.
GetType();
9715
9716 int array_size = item_tag_array.Count();
9717 for (int i = 0; i < array_size; i++)
9718 {
9719 if (item_tag_array.Get(i) == tag)
9720 {
9721 found = true;
9722 break;
9723 }
9724 }
9725 return found;
9726 }
9727
9728
9730 {
9731
9732 super.OnRPC(sender, rpc_type,ctx);
9733
9734
9735 switch (rpc_type)
9736 {
9737 #ifndef SERVER
9738 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9739 Param2<bool, string> p = new Param2<bool, string>(false, "");
9740
9742 return;
9743
9744 bool play = p.param1;
9745 string soundSet = p.param2;
9746
9747 if (play)
9748 {
9750 {
9752 {
9754 }
9755 }
9756 else
9757 {
9759 }
9760 }
9761 else
9762 {
9764 }
9765
9766 break;
9767 #endif
9768
9769 }
9770
9772 {
9774 }
9775 }
9776
9777
9778
9779
9781 {
9782 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9783 return plugin.GetID(
name);
9784 }
9785
9787 {
9788 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9789 return plugin.GetName(id);
9790 }
9791
9794 {
9795
9796
9797 int varFlags;
9798 if (!ctx.
Read(varFlags))
9799 return;
9800
9801 if (varFlags & ItemVariableFlags.FLOAT)
9802 {
9804 }
9805 }
9806
9808 {
9809
9810 super.SerializeNumericalVars(floats_out);
9811
9812
9813
9815 {
9817 }
9818
9820 {
9822 }
9823
9825 {
9827 }
9828
9830 {
9835 }
9836
9838 {
9840 }
9841 }
9842
9844 {
9845
9846 super.DeSerializeNumericalVars(floats);
9847
9848
9849 int index = 0;
9850 int mask = Math.Round(floats.Get(index));
9851
9852 index++;
9853
9855 {
9857 {
9859 }
9860 else
9861 {
9862 float quantity = floats.Get(index);
9864 }
9865 index++;
9866 }
9867
9869 {
9870 float wet = floats.Get(index);
9872 index++;
9873 }
9874
9876 {
9877 int liquidtype = Math.Round(floats.Get(index));
9879 index++;
9880 }
9881
9883 {
9885 index++;
9887 index++;
9889 index++;
9891 index++;
9892 }
9893
9895 {
9896 int cleanness = Math.Round(floats.Get(index));
9898 index++;
9899 }
9900 }
9901
9903 {
9904 super.WriteVarsToCTX(ctx);
9905
9906
9908 {
9910 }
9911
9913 {
9915 }
9916
9918 {
9920 }
9921
9923 {
9924 int r,g,b,a;
9930 }
9931
9933 {
9935 }
9936 }
9937
9939 {
9940 if (!super.ReadVarsFromCTX(ctx,version))
9941 return false;
9942
9943 int intValue;
9944 float value;
9945
9946 if (version < 140)
9947 {
9948 if (!ctx.
Read(intValue))
9949 return false;
9950
9951 m_VariablesMask = intValue;
9952 }
9953
9955 {
9956 if (!ctx.
Read(value))
9957 return false;
9958
9960 {
9962 }
9963 else
9964 {
9966 }
9967 }
9968
9969 if (version < 140)
9970 {
9972 {
9973 if (!ctx.
Read(value))
9974 return false;
9975 SetTemperatureDirect(value);
9976 }
9977 }
9978
9980 {
9981 if (!ctx.
Read(value))
9982 return false;
9984 }
9985
9987 {
9988 if (!ctx.
Read(intValue))
9989 return false;
9991 }
9992
9994 {
9995 int r,g,b,a;
9997 return false;
9999 return false;
10001 return false;
10003 return false;
10004
10006 }
10007
10009 {
10010 if (!ctx.
Read(intValue))
10011 return false;
10013 }
10014
10015 if (version >= 138 && version < 140)
10016 {
10018 {
10019 if (!ctx.
Read(intValue))
10020 return false;
10021 SetFrozen(intValue);
10022 }
10023 }
10024
10025 return true;
10026 }
10027
10028
10030 {
10033 {
10035 }
10036
10037 if (!super.OnStoreLoad(ctx, version))
10038 {
10040 return false;
10041 }
10042
10043 if (version >= 114)
10044 {
10045 bool hasQuickBarIndexSaved;
10046
10047 if (!ctx.
Read(hasQuickBarIndexSaved))
10048 {
10050 return false;
10051 }
10052
10053 if (hasQuickBarIndexSaved)
10054 {
10055 int itmQBIndex;
10056
10057
10058 if (!ctx.
Read(itmQBIndex))
10059 {
10061 return false;
10062 }
10063
10064 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10065 if (itmQBIndex != -1 && parentPlayer)
10066 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10067 }
10068 }
10069 else
10070 {
10071
10072 PlayerBase player;
10073 int itemQBIndex;
10074 if (version ==
int.
MAX)
10075 {
10076 if (!ctx.
Read(itemQBIndex))
10077 {
10079 return false;
10080 }
10081 }
10082 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10083 {
10084
10085 if (!ctx.
Read(itemQBIndex))
10086 {
10088 return false;
10089 }
10090 if (itemQBIndex != -1 && player)
10091 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10092 }
10093 }
10094
10095 if (version < 140)
10096 {
10097
10098 if (!LoadVariables(ctx, version))
10099 {
10101 return false;
10102 }
10103 }
10104
10105
10107 {
10109 return false;
10110 }
10111 if (version >= 132)
10112 {
10114 if (raib)
10115 {
10117 {
10119 return false;
10120 }
10121 }
10122 }
10123
10125 return true;
10126 }
10127
10128
10129
10131 {
10132 super.OnStoreSave(ctx);
10133
10134 PlayerBase player;
10135 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10136 {
10138
10139 int itemQBIndex = -1;
10140 itemQBIndex = player.FindQuickBarEntityIndex(this);
10141 ctx.
Write(itemQBIndex);
10142 }
10143 else
10144 {
10146 }
10147
10149
10151 if (raib)
10152 {
10154 }
10155 }
10156
10157
10159 {
10160 super.AfterStoreLoad();
10161
10163 {
10165 }
10166
10168 {
10171 }
10172 }
10173
10175 {
10176 super.EEOnAfterLoad();
10177
10179 {
10181 }
10182
10185 }
10186
10188 {
10189 return false;
10190 }
10191
10192
10193
10195 {
10197 {
10198 #ifdef PLATFORM_CONSOLE
10199
10201 {
10203 if (menu)
10204 {
10206 }
10207 }
10208 #endif
10209 }
10210
10212 {
10215 }
10216
10218 {
10219 SetWeightDirty();
10221 }
10223 {
10226 }
10227
10229 {
10232 }
10234 {
10237 }
10238
10239 super.OnVariablesSynchronized();
10240 }
10241
10242
10243
10245 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10246 {
10247 if (!IsServerCheck(allow_client))
10248 return false;
10249
10251 return false;
10252
10255
10256 if (value <= (min + 0.001))
10257 value = min;
10258
10259 if (value == min)
10260 {
10261 if (destroy_config)
10262 {
10263 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10264 if (dstr)
10265 {
10267 this.Delete();
10268 return true;
10269 }
10270 }
10271 else if (destroy_forced)
10272 {
10274 this.Delete();
10275 return true;
10276 }
10277
10279 }
10280
10283
10285 {
10287
10288 if (delta)
10290 }
10291
10293
10294 return false;
10295 }
10296
10297
10299 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10300 {
10302 }
10303
10305 {
10308 }
10309
10311 {
10314 }
10315
10317 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10318 {
10319 float value_clamped = Math.Clamp(value, 0, 1);
10321 SetQuantity(result, destroy_config, destroy_forced);
10322 }
10323
10324
10327 {
10329 }
10330
10332 {
10334 }
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10346 {
10347 int slot = -1;
10348 if (GetInventory())
10349 {
10350 InventoryLocation il = new InventoryLocation;
10351 GetInventory().GetCurrentInventoryLocation(il);
10353 }
10354
10356 }
10357
10359 {
10360 float quantity_max = 0;
10361
10363 {
10364 if (attSlotID != -1)
10365 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10366
10367 if (quantity_max <= 0)
10369 }
10370
10371 if (quantity_max <= 0)
10373
10374 return quantity_max;
10375 }
10376
10378 {
10380 }
10381
10383 {
10385 }
10386
10387
10389 {
10391 }
10392
10394 {
10396 }
10397
10399 {
10401 }
10402
10403
10405 {
10406
10407 float weightEx = GetWeightEx();
10408 float special = GetInventoryAndCargoWeight();
10409 return weightEx - special;
10410 }
10411
10412
10414 {
10416 }
10417
10419 {
10421 {
10422 #ifdef DEVELOPER
10423 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10424 {
10425 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10427 }
10428 #endif
10429
10430 return GetQuantity() * GetConfigWeightModified();
10431 }
10432 else if (HasEnergyManager())
10433 {
10434 #ifdef DEVELOPER
10435 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10436 {
10437 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10438 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10439 }
10440 #endif
10441 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
10442 }
10443 else
10444 {
10445 #ifdef DEVELOPER
10446 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10447 {
10448 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10449 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10450 }
10451 #endif
10452 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
10453 }
10454 }
10455
10458 {
10459 int item_count = 0;
10461
10462 if (GetInventory().GetCargo() != NULL)
10463 {
10464 item_count = GetInventory().GetCargo().GetItemCount();
10465 }
10466
10467 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10468 {
10469 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10470 if (item)
10471 item_count += item.GetNumberOfItems();
10472 }
10473 return item_count;
10474 }
10475
10478 {
10479 float weight = 0;
10480 float wetness = 1;
10481 if (include_wetness)
10484 {
10485 weight = wetness * m_ConfigWeight;
10486 }
10488 {
10489 weight = 1;
10490 }
10491 return weight;
10492 }
10493
10494
10495
10497 {
10498 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10499 {
10500 GameInventory inv = GetInventory();
10501 array<EntityAI> items = new array<EntityAI>;
10503 for (int i = 0; i < items.Count(); i++)
10504 {
10506 if (item)
10507 {
10509 }
10510 }
10511 }
10512 }
10513
10514
10515
10516
10518 {
10519 float energy = 0;
10520 if (HasEnergyManager())
10521 {
10522 energy = GetCompEM().GetEnergy();
10523 }
10524 return energy;
10525 }
10526
10527
10529 {
10530 super.OnEnergyConsumed();
10531
10533 }
10534
10536 {
10537 super.OnEnergyAdded();
10538
10540 }
10541
10542
10544 {
10545 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10546 {
10548 {
10549 float energy_0to1 = GetCompEM().GetEnergy0To1();
10551 }
10552 }
10553 }
10554
10555
10557 {
10558 return ConfigGetFloat("heatIsolation");
10559 }
10560
10562 {
10564 }
10565
10567 {
10568 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10569 if (
GetGame().ConfigIsExisting(paramPath))
10571
10572 return 0.0;
10573 }
10574
10576 {
10577 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10578 if (
GetGame().ConfigIsExisting(paramPath))
10580
10581 return 0.0;
10582 }
10583
10584 override void SetWet(
float value,
bool allow_client =
false)
10585 {
10586 if (!IsServerCheck(allow_client))
10587 return;
10588
10591
10593
10594 m_VarWet = Math.Clamp(value, min, max);
10595
10597 {
10600 }
10601 }
10602
10603 override void AddWet(
float value)
10604 {
10606 }
10607
10609 {
10611 }
10612
10614 {
10616 }
10617
10619 {
10621 }
10622
10624 {
10626 }
10627
10629 {
10631 }
10632
10633 override void OnWetChanged(
float newVal,
float oldVal)
10634 {
10637 if (newLevel != oldLevel)
10638 {
10640 }
10641 }
10642
10644 {
10645 SetWeightDirty();
10646 }
10647
10649 {
10650 return GetWetLevelInternal(
m_VarWet);
10651 }
10652
10653
10654
10656 {
10658 }
10659
10661 {
10663 }
10664
10666 {
10668 }
10669
10671 {
10673 }
10674
10675
10676
10678 {
10679 if (ConfigIsExisting("itemModelLength"))
10680 {
10681 return ConfigGetFloat("itemModelLength");
10682 }
10683 return 0;
10684 }
10685
10687 {
10688 if (ConfigIsExisting("itemAttachOffset"))
10689 {
10690 return ConfigGetFloat("itemAttachOffset");
10691 }
10692 return 0;
10693 }
10694
10695 override void SetCleanness(
int value,
bool allow_client =
false)
10696 {
10697 if (!IsServerCheck(allow_client))
10698 return;
10699
10701
10703
10706 }
10707
10709 {
10711 }
10712
10714 {
10715 return true;
10716 }
10717
10718
10719
10720
10722 {
10724 }
10725
10727 {
10729 }
10730
10731
10732
10733
10734 override void SetColor(
int r,
int g,
int b,
int a)
10735 {
10741 }
10743 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10744 {
10749 }
10750
10752 {
10754 }
10755
10758 {
10759 int r,g,b,a;
10761 r = r/255;
10762 g = g/255;
10763 b = b/255;
10764 a = a/255;
10765 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10766 }
10767
10768
10769
10770 override void SetLiquidType(
int value,
bool allow_client =
false)
10771 {
10772 if (!IsServerCheck(allow_client))
10773 return;
10774
10779 }
10780
10782 {
10783 return ConfigGetInt("varLiquidTypeInit");
10784 }
10785
10787 {
10789 }
10790
10792 {
10794 SetFrozen(false);
10795 }
10796
10799 {
10800 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10801 }
10802
10803
10806 {
10807 PlayerBase nplayer;
10808 if (PlayerBase.CastTo(nplayer, player))
10809 {
10811
10812 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10813 }
10814 }
10815
10816
10819 {
10820 PlayerBase nplayer;
10821 if (PlayerBase.CastTo(nplayer,player))
10822 {
10823
10824 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10825
10826 }
10827
10828
10829 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10830
10831
10832 if (HasEnergyManager())
10833 {
10834 GetCompEM().UpdatePlugState();
10835 }
10836 }
10837
10838
10840 {
10841 super.OnPlacementStarted(player);
10842
10844 }
10845
10846 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10847 {
10849 {
10850 m_AdminLog.OnPlacementComplete(player,
this);
10851 }
10852
10853 super.OnPlacementComplete(player, position, orientation);
10854 }
10855
10856
10857
10858
10859
10861 {
10863 {
10864 return true;
10865 }
10866 else
10867 {
10868 return false;
10869 }
10870 }
10871
10872
10874 {
10876 {
10878 }
10879 }
10880
10881
10883 {
10885 }
10886
10888 {
10890 }
10891
10892 override void InsertAgent(
int agent,
float count = 1)
10893 {
10894 if (count < 1)
10895 return;
10896
10898 }
10899
10902 {
10904 }
10905
10906
10908 {
10910 }
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10954 {
10956 return false;
10957 return true;
10958 }
10959
10961 {
10962
10964 }
10965
10966
10969 {
10970 super.CheckForRoofLimited(timeTresholdMS);
10971
10973 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10974 {
10975 m_PreviousRoofTestTime = time;
10976 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10977 }
10978 }
10979
10980
10982 {
10984 {
10985 return 0;
10986 }
10987
10988 if (GetInventory().GetAttachmentSlotsCount() != 0)
10989 {
10990 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10991 if (filter)
10992 return filter.GetProtectionLevel(type, false, system);
10993 else
10994 return 0;
10995 }
10996
10997 string subclassPath, entryName;
10998
10999 switch (type)
11000 {
11002 entryName = "biological";
11003 break;
11005 entryName = "chemical";
11006 break;
11007 default:
11008 entryName = "biological";
11009 break;
11010 }
11011
11012 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11013
11015 }
11016
11017
11018
11021 {
11022 if (!IsMagazine())
11024
11026 }
11027
11028
11029
11030
11031
11036 {
11037 return true;
11038 }
11039
11041 {
11043 }
11044
11045
11046
11047
11048
11050 {
11051 if (parent)
11052 {
11053 if (parent.IsInherited(DayZInfected))
11054 return true;
11055
11056 if (!parent.IsRuined())
11057 return true;
11058 }
11059
11060 return true;
11061 }
11062
11064 {
11065 if (!super.CanPutAsAttachment(parent))
11066 {
11067 return false;
11068 }
11069
11070 if (!IsRuined() && !parent.IsRuined())
11071 {
11072 return true;
11073 }
11074
11075 return false;
11076 }
11077
11079 {
11080
11081
11082
11083
11084 return super.CanReceiveItemIntoCargo(item);
11085 }
11086
11088 {
11089
11090
11091
11092
11093 GameInventory attachmentInv = attachment.GetInventory();
11095 {
11096 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11097 return false;
11098 }
11099
11100 InventoryLocation loc = new InventoryLocation();
11101 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11102 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11103 return false;
11104
11105 return super.CanReceiveAttachment(attachment, slotId);
11106 }
11107
11109 {
11110 if (!super.CanReleaseAttachment(attachment))
11111 return false;
11112
11113 return GetInventory().AreChildrenAccessible();
11114 }
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11137 {
11138 int id = muzzle_owner.GetMuzzleID();
11139 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11140
11141 if (WPOF_array)
11142 {
11143 for (int i = 0; i < WPOF_array.Count(); i++)
11144 {
11145 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11146
11147 if (WPOF)
11148 {
11149 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11150 }
11151 }
11152 }
11153 }
11154
11155
11157 {
11158 int id = muzzle_owner.GetMuzzleID();
11160
11161 if (WPOBE_array)
11162 {
11163 for (int i = 0; i < WPOBE_array.Count(); i++)
11164 {
11165 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11166
11167 if (WPOBE)
11168 {
11169 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11170 }
11171 }
11172 }
11173 }
11174
11175
11177 {
11178 int id = muzzle_owner.GetMuzzleID();
11179 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11180
11181 if (WPOOH_array)
11182 {
11183 for (int i = 0; i < WPOOH_array.Count(); i++)
11184 {
11185 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11186
11187 if (WPOOH)
11188 {
11189 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11190 }
11191 }
11192 }
11193 }
11194
11195
11197 {
11198 int id = muzzle_owner.GetMuzzleID();
11199 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11200
11201 if (WPOOH_array)
11202 {
11203 for (int i = 0; i < WPOOH_array.Count(); i++)
11204 {
11205 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11206
11207 if (WPOOH)
11208 {
11209 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11210 }
11211 }
11212 }
11213 }
11214
11215
11217 {
11218 int id = muzzle_owner.GetMuzzleID();
11219 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11220
11221 if (WPOOH_array)
11222 {
11223 for (int i = 0; i < WPOOH_array.Count(); i++)
11224 {
11225 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11226
11227 if (WPOOH)
11228 {
11229 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11230 }
11231 }
11232 }
11233 }
11234
11235
11236
11238 {
11240 {
11241 return true;
11242 }
11243
11244 return false;
11245 }
11246
11248 {
11250 {
11251 return true;
11252 }
11253
11254 return false;
11255 }
11256
11258 {
11260 {
11261 return true;
11262 }
11263
11264 return false;
11265 }
11266
11268 {
11269 return false;
11270 }
11271
11274 {
11275 return UATimeSpent.DEFAULT_DEPLOY;
11276 }
11277
11278
11279
11280
11282 {
11284 SetSynchDirty();
11285 }
11286
11288 {
11290 }
11291
11292
11294 {
11295 return false;
11296 }
11297
11300 {
11301 string att_type = "None";
11302
11303 if (ConfigIsExisting("soundAttType"))
11304 {
11305 att_type = ConfigGetString("soundAttType");
11306 }
11307
11309 }
11310
11312 {
11314 }
11315
11316
11317
11318
11319
11325
11327 {
11330
11332 }
11333
11334
11336 {
11338 return;
11339
11341
11344
11347
11348 SoundParameters params = new SoundParameters();
11352 }
11353
11354
11356 {
11358 return;
11359
11361 SetSynchDirty();
11362
11365 }
11366
11367
11369 {
11371 return;
11372
11374 SetSynchDirty();
11375
11378 }
11379
11381 {
11383 }
11384
11386 {
11388 }
11389
11392 {
11393 if (!
GetGame().IsDedicatedServer())
11394 {
11395 if (ConfigIsExisting("attachSoundSet"))
11396 {
11397 string cfg_path = "";
11398 string soundset = "";
11399 string type_name =
GetType();
11400
11403 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11404 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11405
11406 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11407 {
11408 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11409 {
11410 if (cfg_slot_array[i] == slot_type)
11411 {
11412 soundset = cfg_soundset_array[i];
11413 break;
11414 }
11415 }
11416 }
11417
11418 if (soundset != "")
11419 {
11420 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11422 }
11423 }
11424 }
11425 }
11426
11428 {
11429
11430 }
11431
11432 void OnApply(PlayerBase player);
11433
11435 {
11436 return 1.0;
11437 };
11438
11440 {
11442 }
11443
11445 {
11447 }
11448
11450
11452 {
11453 SetDynamicPhysicsLifeTime(0.01);
11455 }
11456
11458 {
11459 array<string> zone_names = new array<string>;
11460 GetDamageZones(zone_names);
11461 for (int i = 0; i < zone_names.Count(); i++)
11462 {
11463 SetHealthMax(zone_names.Get(i),"Health");
11464 }
11465 SetHealthMax("","Health");
11466 }
11467
11470 {
11471 float global_health = GetHealth01("","Health");
11472 array<string> zones = new array<string>;
11473 GetDamageZones(zones);
11474
11475 for (int i = 0; i < zones.Count(); i++)
11476 {
11477 SetHealth01(zones.Get(i),"Health",global_health);
11478 }
11479 }
11480
11483 {
11484 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11485 }
11486
11488 {
11489 if (!hasRootAsPlayer)
11490 {
11491 if (refParentIB)
11492 {
11493
11494 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11495 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11496
11497 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11498 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11499
11502 }
11503 else
11504 {
11505
11508 }
11509 }
11510 }
11511
11513 {
11515 {
11516 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11517 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
11518 {
11519 float heatPermCoef = 1.0;
11521 while (ent)
11522 {
11523 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11524 ent = ent.GetHierarchyParent();
11525 }
11526
11527 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11528 }
11529 }
11530 }
11531
11533 {
11534
11535 EntityAI parent = GetHierarchyParent();
11536 if (!parent)
11537 {
11538 hasParent = false;
11539 hasRootAsPlayer = false;
11540 }
11541 else
11542 {
11543 hasParent = true;
11544 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11545 refParentIB =
ItemBase.Cast(parent);
11546 }
11547 }
11548
11549 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11550 {
11551
11552 }
11553
11555 {
11556
11557 return false;
11558 }
11559
11561 {
11562
11563
11564 return false;
11565 }
11566
11568 {
11569
11570 return false;
11571 }
11572
11575 {
11576 return !GetIsFrozen() &&
IsOpen();
11577 }
11578
11580 {
11581 bool hasParent = false, hasRootAsPlayer = false;
11583
11584 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11585 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11586
11587 if (wwtu || foodDecay)
11588 {
11592
11593 if (processWetness || processTemperature || processDecay)
11594 {
11596
11597 if (processWetness)
11598 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11599
11600 if (processTemperature)
11602
11603 if (processDecay)
11604 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11605 }
11606 }
11607 }
11608
11611 {
11613 }
11614
11616 {
11619
11620 return super.GetTemperatureFreezeThreshold();
11621 }
11622
11624 {
11627
11628 return super.GetTemperatureThawThreshold();
11629 }
11630
11632 {
11635
11636 return super.GetItemOverheatThreshold();
11637 }
11638
11640 {
11642 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11643
11644 return super.GetTemperatureFreezeTime();
11645 }
11646
11648 {
11650 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11651
11652 return super.GetTemperatureThawTime();
11653 }
11654
11659
11661 {
11662 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11663 }
11664
11666 {
11667 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11668 }
11669
11672 {
11674 }
11675
11677 {
11679 }
11680
11682 {
11684 }
11685
11688 {
11689 return null;
11690 }
11691
11694 {
11695 return false;
11696 }
11697
11699 {
11701 {
11704 if (!trg)
11705 {
11707 explosive = this;
11708 }
11709
11710 explosive.PairRemote(trg);
11712
11713 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11714 trg.SetPersistentPairID(persistentID);
11715 explosive.SetPersistentPairID(persistentID);
11716
11717 return true;
11718 }
11719 return false;
11720 }
11721
11724 {
11725 float ret = 1.0;
11728 ret *= GetHealth01();
11729
11730 return ret;
11731 }
11732
11733 #ifdef DEVELOPER
11734 override void SetDebugItem()
11735 {
11736 super.SetDebugItem();
11737 _itemBase = this;
11738 }
11739
11741 {
11742 string text = super.GetDebugText();
11743
11745 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11746
11747 return text;
11748 }
11749 #endif
11750
11752 {
11753 return true;
11754 }
11755
11757
11759
11761 {
11764 }
11765
11766
11774
11790}
11791
11793{
11795 if (entity)
11796 {
11797 bool is_item = entity.IsInherited(
ItemBase);
11798 if (is_item && full_quantity)
11799 {
11802 }
11803 }
11804 else
11805 {
11807 return NULL;
11808 }
11809 return entity;
11810}
11811
11813{
11814 if (item)
11815 {
11816 if (health > 0)
11817 item.SetHealth("", "", health);
11818
11819 if (item.CanHaveTemperature())
11820 {
11822 if (item.CanFreeze())
11823 item.SetFrozen(false);
11824 }
11825
11826 if (item.HasEnergyManager())
11827 {
11828 if (quantity >= 0)
11829 {
11830 item.GetCompEM().SetEnergy0To1(quantity);
11831 }
11832 else
11833 {
11835 }
11836 }
11837 else if (item.IsMagazine())
11838 {
11839 Magazine mag = Magazine.Cast(item);
11840 if (quantity >= 0)
11841 {
11842 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11843 }
11844 else
11845 {
11847 }
11848
11849 }
11850 else
11851 {
11852 if (quantity >= 0)
11853 {
11854 item.SetQuantityNormalized(quantity, false);
11855 }
11856 else
11857 {
11859 }
11860
11861 }
11862 }
11863}
11864
11865#ifdef DEVELOPER
11867#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.