6981{
6983 {
6984 return true;
6985 }
6986};
6987
6988
6989
6991{
6995
6997
7000
7001
7002
7003
7004
7013
7019
7024
7029
7050 protected bool m_IsResultOfSplit
7051
7053
7058
7059
7060
7062
7066
7067
7068
7070
7073
7074
7075
7081
7082
7090
7093
7094
7096
7097
7099
7100
7105
7106
7111
7112
7114
7115
7117 {
7122
7123 if (!
GetGame().IsDedicatedServer())
7124 {
7126 {
7128
7130 {
7132 }
7133 }
7134
7137 }
7138
7139 m_OldLocation = null;
7140
7142 {
7144 }
7145
7146 if (ConfigIsExisting("headSelectionsToHide"))
7147 {
7150 }
7151
7153 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7154 {
7156 }
7157
7159
7160 m_IsResultOfSplit = false;
7161
7163 }
7164
7166 {
7167 super.InitItemVariables();
7168
7174 m_Count = ConfigGetInt(
"count");
7175
7178
7183
7186
7191
7203
7207
7208
7211 if (ConfigIsExisting("canBeSplit"))
7212 {
7215 }
7216
7218 if (ConfigIsExisting("itemBehaviour"))
7220
7221
7224 RegisterNetSyncVariableInt("m_VarLiquidType");
7225 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7226
7227 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7228 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7229 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7230
7231 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7232 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7233 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7234 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7235
7236 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7237 RegisterNetSyncVariableBool("m_IsTakeable");
7238 RegisterNetSyncVariableBool("m_IsHologram");
7239
7242 {
7245 }
7246
7248
7250 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7252
7253 }
7254
7256 {
7258 }
7259
7261 {
7264 {
7269 }
7270 }
7271
7272 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7273 {
7275 {
7278 }
7279
7281 }
7282
7284 {
7290 }
7291
7293
7295 {
7297
7298 if (!action)
7299 {
7300 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7301 return;
7302 }
7303
7305 if (!ai)
7306 {
7308 return;
7309 }
7310
7312 if (!action_array)
7313 {
7314 action_array = new array<ActionBase_Basic>;
7316 }
7317 if (LogManager.IsActionLogEnable())
7318 {
7319 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7320 }
7321
7322 if (action_array.Find(action) != -1)
7323 {
7324 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7325 }
7326 else
7327 {
7328 action_array.Insert(action);
7329 }
7330 }
7331
7333 {
7335 ActionBase action = player.GetActionManager().GetAction(actionName);
7338
7339 if (action_array)
7340 {
7341 action_array.RemoveItem(action);
7342 }
7343 }
7344
7345
7346
7348 {
7349 ActionOverrideData overrideData = new ActionOverrideData();
7353
7355 if (!actionMap)
7356 {
7359 }
7360
7361 actionMap.Insert(this.
Type(), overrideData);
7362
7363 }
7364
7366
7368
7369
7371 {
7374
7377
7378 string config_to_search = "CfgVehicles";
7379 string muzzle_owner_config;
7380
7382 {
7383 if (IsInherited(Weapon))
7384 config_to_search = "CfgWeapons";
7385
7386 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7387
7388 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7389
7391
7392 if (config_OnFire_subclass_count > 0)
7393 {
7394 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7395
7396 for (int i = 0; i < config_OnFire_subclass_count; i++)
7397 {
7398 string particle_class = "";
7400 string config_OnFire_entry = config_OnFire_class + particle_class;
7401 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7402 WPOF_array.Insert(WPOF);
7403 }
7404
7405
7407 }
7408 }
7409
7411 {
7412 config_to_search = "CfgWeapons";
7413 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7414
7415 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7416
7418
7419 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7420 {
7421 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7422
7423 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7424 {
7425 string particle_class2 = "";
7427 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7428 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7429 WPOBE_array.Insert(WPOBE);
7430 }
7431
7432
7434 }
7435 }
7436 }
7437
7438
7440 {
7443
7445 {
7446 string config_to_search = "CfgVehicles";
7447
7448 if (IsInherited(Weapon))
7449 config_to_search = "CfgWeapons";
7450
7451 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7452 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7453
7454 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7455 {
7456
7458
7460 {
7462 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7464 return;
7465 }
7466
7469
7470
7471
7473 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7474
7475 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7476 {
7477 string particle_class = "";
7479 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7481
7482 if (entry_type == CT_CLASS)
7483 {
7484 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7485 WPOOH_array.Insert(WPOF);
7486 }
7487 }
7488
7489
7491 }
7492 }
7493 }
7494
7496 {
7498 }
7499
7501 {
7503 {
7505
7508
7511
7512 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7513 }
7514 }
7515
7517 {
7519 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7520
7522 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7523
7525 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7526
7528 {
7530 }
7531 }
7532
7534 {
7536 }
7537
7539 {
7542 else
7544
7546 {
7549 }
7550 else
7551 {
7554
7557 }
7558
7560 }
7561
7563 {
7565 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7566 }
7567
7569 {
7571 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7573 }
7574
7576 {
7578 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7579 }
7580
7582 {
7585
7586 OverheatingParticle OP = new OverheatingParticle();
7591
7593 }
7594
7596 {
7599
7600 return -1;
7601 }
7602
7604 {
7606 {
7609
7610 for (int i = count; i > 0; --i)
7611 {
7612 int id = i - 1;
7615
7618
7619 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7620 {
7621 if (p)
7622 {
7625 }
7626 }
7627 }
7628 }
7629 }
7630
7632 {
7634 {
7636 {
7637 int id = i - 1;
7639
7640 if (OP)
7641 {
7643
7644 if (p)
7645 {
7647 }
7648
7649 delete OP;
7650 }
7651 }
7652
7655 }
7656 }
7657
7660 {
7661 return 0.0;
7662 }
7663
7664
7666 {
7667 return 250;
7668 }
7669
7671 {
7672 return 0;
7673 }
7674
7677 {
7679 return true;
7680
7681 return false;
7682 }
7683
7686 {
7689
7691 {
7693 }
7694 else
7695 {
7696
7698 }
7699
7701 }
7702
7709 {
7710 return -1;
7711 }
7712
7713
7714
7715
7717 {
7719 {
7721 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7722
7723 if (r_index >= 0)
7724 {
7725 InventoryLocation r_il = new InventoryLocation;
7726 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7727
7728 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7731 {
7732 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7733 }
7735 {
7736 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7737 }
7738
7739 }
7740
7741 player.GetHumanInventory().ClearUserReservedLocation(this);
7742 }
7743
7746 }
7747
7748
7749
7750
7752 {
7753 return ItemBase.m_DebugActionsMask;
7754 }
7755
7757 {
7758 return ItemBase.m_DebugActionsMask & mask;
7759 }
7760
7762 {
7763 ItemBase.m_DebugActionsMask = mask;
7764 }
7765
7767 {
7768 ItemBase.m_DebugActionsMask |= mask;
7769 }
7770
7772 {
7773 ItemBase.m_DebugActionsMask &= ~mask;
7774 }
7775
7777 {
7779 {
7781 }
7782 else
7783 {
7785 }
7786 }
7787
7788
7790 {
7791 if (GetEconomyProfile())
7792 {
7793 float q_max = GetEconomyProfile().GetQuantityMax();
7794 if (q_max > 0)
7795 {
7796 float q_min = GetEconomyProfile().GetQuantityMin();
7797 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7798
7800 {
7801 ComponentEnergyManager comp = GetCompEM();
7803 {
7805 }
7806 }
7808 {
7810
7811 }
7812
7813 }
7814 }
7815 }
7816
7819 {
7820 EntityAI parent = GetHierarchyParent();
7821
7822 if (parent)
7823 {
7824 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7825 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7826 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7827 }
7828 }
7829
7832 {
7833 EntityAI parent = GetHierarchyParent();
7834
7835 if (parent)
7836 {
7837 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7838 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7839 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7840 }
7841 }
7842
7844 {
7845
7846
7847
7848
7850
7852 {
7853 if (ScriptInputUserData.CanStoreInputUserData())
7854 {
7855 ScriptInputUserData ctx = new ScriptInputUserData;
7861 ctx.
Write(use_stack_max);
7864
7866 {
7867 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7868 }
7869 }
7870 }
7871 else if (!
GetGame().IsMultiplayer())
7872 {
7874 }
7875 }
7876
7878 {
7880 }
7881
7883 {
7885 }
7886
7888 {
7890 }
7891
7893 {
7894
7895 return false;
7896 }
7897
7899 {
7900 return false;
7901 }
7902
7906 {
7907 return false;
7908 }
7909
7911 {
7912 return "";
7913 }
7914
7916
7918 {
7919 return false;
7920 }
7921
7923 {
7924 return true;
7925 }
7926
7927
7928
7930 {
7931 return true;
7932 }
7933
7935 {
7936 return true;
7937 }
7938
7940 {
7941 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7943 }
7944
7946 {
7948 }
7949
7951 {
7953 if (!is_being_placed)
7955 SetSynchDirty();
7956 }
7957
7958
7960
7962 {
7964 }
7965
7967 {
7969 }
7970
7972 {
7973 return 1;
7974 }
7975
7977 {
7978 return false;
7979 }
7980
7982 {
7984 SetSynchDirty();
7985 }
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8022 {
8023 super.OnMovedInsideCargo(container);
8024
8025 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8026 }
8027
8028 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8029 {
8030 super.EEItemLocationChanged(oldLoc,newLoc);
8031
8032 PlayerBase new_player = null;
8033 PlayerBase old_player = null;
8034
8035 if (newLoc.GetParent())
8036 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8037
8038 if (oldLoc.GetParent())
8039 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8040
8042 {
8043 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8044
8045 if (r_index >= 0)
8046 {
8047 InventoryLocation r_il = new InventoryLocation;
8048 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8049
8050 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8053 {
8054 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8055 }
8057 {
8058 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8059 }
8060
8061 }
8062 }
8063
8065 {
8066 if (new_player)
8067 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8068
8069 if (new_player == old_player)
8070 {
8071
8072 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8073 {
8075 {
8076 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8077 {
8078 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8079 }
8080 }
8081 else
8082 {
8083 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8084 }
8085 }
8086
8087 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8088 {
8089 int type = oldLoc.GetType();
8091 {
8092 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8093 }
8095 {
8096 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8097 }
8098 }
8099 if (!m_OldLocation)
8100 {
8101 m_OldLocation = new InventoryLocation;
8102 }
8103 m_OldLocation.Copy(oldLoc);
8104 }
8105 else
8106 {
8107 if (m_OldLocation)
8108 {
8109 m_OldLocation.Reset();
8110 }
8111 }
8112
8114 }
8115 else
8116 {
8117 if (new_player)
8118 {
8119 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8120 if (res_index >= 0)
8121 {
8122 InventoryLocation il = new InventoryLocation;
8123 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8125 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8128 {
8129 il.
GetParent().GetOnReleaseLock().Invoke(it);
8130 }
8132 {
8134 }
8135
8136 }
8137 }
8139 {
8140
8142 }
8143
8144 if (m_OldLocation)
8145 {
8146 m_OldLocation.Reset();
8147 }
8148 }
8149 }
8150
8151 override void EOnContact(IEntity other, Contact extra)
8152 {
8154 {
8155 int liquidType = -1;
8157 if (impactSpeed > 0.0)
8158 {
8160 #ifndef SERVER
8162 #else
8164 SetSynchDirty();
8165 #endif
8167 }
8168 }
8169
8170 #ifdef SERVER
8171 if (GetCompEM() && GetCompEM().IsPlugged())
8172 {
8173 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8174 GetCompEM().UnplugThis();
8175 }
8176 #endif
8177 }
8178
8180
8182 {
8184 }
8185
8187 {
8188
8189 }
8190
8192 {
8193 super.OnItemLocationChanged(old_owner, new_owner);
8194
8195 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8196 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8197
8198 if (!relatedPlayer && playerNew)
8199 relatedPlayer = playerNew;
8200
8201 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8202 {
8204 if (actionMgr)
8205 {
8206 ActionBase currentAction = actionMgr.GetRunningAction();
8207 if (currentAction)
8209 }
8210 }
8211
8212 Man ownerPlayerOld = null;
8213 Man ownerPlayerNew = null;
8214
8215 if (old_owner)
8216 {
8217 if (old_owner.
IsMan())
8218 {
8219 ownerPlayerOld = Man.Cast(old_owner);
8220 }
8221 else
8222 {
8223 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8224 }
8225 }
8226 else
8227 {
8229 {
8231
8232 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8233 {
8234 GetCompEM().UnplugThis();
8235 }
8236 }
8237 }
8238
8239 if (new_owner)
8240 {
8241 if (new_owner.
IsMan())
8242 {
8243 ownerPlayerNew = Man.Cast(new_owner);
8244 }
8245 else
8246 {
8247 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8248 }
8249 }
8250
8251 if (ownerPlayerOld != ownerPlayerNew)
8252 {
8253 if (ownerPlayerOld)
8254 {
8255 array<EntityAI> subItemsExit = new array<EntityAI>;
8257 for (int i = 0; i < subItemsExit.Count(); i++)
8258 {
8261 }
8262 }
8263
8264 if (ownerPlayerNew)
8265 {
8266 array<EntityAI> subItemsEnter = new array<EntityAI>;
8268 for (int j = 0; j < subItemsEnter.Count(); j++)
8269 {
8272 }
8273 }
8274 }
8275 else if (ownerPlayerNew != null)
8276 {
8277 PlayerBase nplayer;
8278 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8279 {
8280 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8282 for (int k = 0; k < subItemsUpdate.Count(); k++)
8283 {
8285 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8286 }
8287 }
8288 }
8289
8290 if (old_owner)
8291 old_owner.OnChildItemRemoved(this);
8292 if (new_owner)
8293 new_owner.OnChildItemReceived(this);
8294 }
8295
8296
8298 {
8299 super.EEDelete(parent);
8300 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8301 if (player)
8302 {
8304
8305 if (player.IsAlive())
8306 {
8307 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8308 if (r_index >= 0)
8309 {
8310 InventoryLocation r_il = new InventoryLocation;
8311 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8312
8313 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8316 {
8317 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8318 }
8320 {
8321 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8322 }
8323
8324 }
8325
8326 player.RemoveQuickBarEntityShortcut(this);
8327 }
8328 }
8329 }
8330
8332 {
8333 super.EEKilled(killer);
8334
8337 {
8338 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8339 {
8340 if (IsMagazine())
8341 {
8342 if (Magazine.Cast(this).GetAmmoCount() > 0)
8343 {
8345 }
8346 }
8347 else
8348 {
8350 }
8351 }
8352 }
8353 }
8354
8356 {
8357 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8358
8359 super.OnWasAttached(parent, slot_id);
8360
8363
8365 }
8366
8368 {
8369 super.OnWasDetached(parent, slot_id);
8370
8373 }
8374
8376 {
8377 int idx;
8380
8381 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8382 if (inventory_slots.Count() < 1)
8383 {
8384 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8385 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8386 }
8387 else
8388 {
8389 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8390 }
8391
8392 idx = inventory_slots.Find(slot);
8393 if (idx < 0)
8394 return "";
8395
8396 return attach_types.Get(idx);
8397 }
8398
8400 {
8401 int idx = -1;
8402 string slot;
8403
8406
8407 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8408 if (inventory_slots.Count() < 1)
8409 {
8410 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8411 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8412 }
8413 else
8414 {
8415 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8416 if (detach_types.Count() < 1)
8417 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8418 }
8419
8420 for (int i = 0; i < inventory_slots.Count(); i++)
8421 {
8422 slot = inventory_slots.Get(i);
8423 }
8424
8425 if (slot != "")
8426 {
8427 if (detach_types.Count() == 1)
8428 idx = 0;
8429 else
8430 idx = inventory_slots.Find(slot);
8431 }
8432 if (idx < 0)
8433 return "";
8434
8435 return detach_types.Get(idx);
8436 }
8437
8439 {
8440
8442
8443
8444 float min_time = 1;
8445 float max_time = 3;
8446 float delay = Math.RandomFloat(min_time, max_time);
8447
8448 explode_timer.Run(delay, this, "DoAmmoExplosion");
8449 }
8450
8452 {
8453 Magazine magazine = Magazine.Cast(this);
8454 int pop_sounds_count = 6;
8455 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8456
8457
8458 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8459 string sound_name = pop_sounds[ sound_idx ];
8461
8462
8463 magazine.ServerAddAmmoCount(-1);
8464
8465
8466 float min_temp_to_explode = 100;
8467
8468 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8469 {
8471 }
8472 }
8473
8474
8475 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8476 {
8477 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8478
8479 const int CHANCE_DAMAGE_CARGO = 4;
8480 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8481 const int CHANCE_DAMAGE_NOTHING = 2;
8482
8484 {
8485 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8486 int chances;
8487 int rnd;
8488
8489 if (GetInventory().GetCargo())
8490 {
8491 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8492 rnd = Math.RandomInt(0,chances);
8493
8494 if (rnd < CHANCE_DAMAGE_CARGO)
8495 {
8497 }
8498 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8499 {
8501 }
8502 }
8503 else
8504 {
8505 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8506 rnd = Math.RandomInt(0,chances);
8507
8508 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8509 {
8511 }
8512 }
8513 }
8514 }
8515
8517 {
8518 if (GetInventory().GetCargo())
8519 {
8520 int item_count = GetInventory().GetCargo().GetItemCount();
8521 if (item_count > 0)
8522 {
8523 int random_pick = Math.RandomInt(0, item_count);
8525 if (!item.IsExplosive())
8526 {
8527 item.AddHealth("","",damage);
8528 return true;
8529 }
8530 }
8531 }
8532 return false;
8533 }
8534
8536 {
8537 int attachment_count = GetInventory().AttachmentCount();
8538 if (attachment_count > 0)
8539 {
8540 int random_pick = Math.RandomInt(0, attachment_count);
8541 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8542 if (!attachment.IsExplosive())
8543 {
8544 attachment.AddHealth("","",damage);
8545 return true;
8546 }
8547 }
8548 return false;
8549 }
8550
8552 {
8554 }
8555
8557 {
8559 return GetInventory().CanRemoveEntity();
8560
8561 return false;
8562 }
8563
8565 {
8567 return;
8568
8570 {
8571 if (ScriptInputUserData.CanStoreInputUserData())
8572 {
8573 ScriptInputUserData ctx = new ScriptInputUserData;
8578 ctx.
Write(destination_entity);
8582 }
8583 }
8584 else if (!
GetGame().IsMultiplayer())
8585 {
8587 }
8588 }
8589
8591 {
8593 return;
8594
8595 float split_quantity_new;
8599 InventoryLocation loc = new InventoryLocation;
8600
8601 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8602 {
8604 split_quantity_new = stack_max;
8605 else
8607
8608 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8609 if (new_item)
8610 {
8611 new_item.SetResultOfSplit(true);
8612 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8614 new_item.SetQuantity(split_quantity_new);
8615 }
8616 }
8617 else if (destination_entity && slot_id == -1)
8618 {
8619 if (quantity > stack_max)
8620 split_quantity_new = stack_max;
8621 else
8622 split_quantity_new = quantity;
8623
8625 {
8628 }
8629
8630 if (new_item)
8631 {
8632 new_item.SetResultOfSplit(true);
8633 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8635 new_item.SetQuantity(split_quantity_new);
8636 }
8637 }
8638 else
8639 {
8640 if (stack_max != 0)
8641 {
8643 {
8645 }
8646
8647 if (split_quantity_new == 0)
8648 {
8649 if (!
GetGame().IsMultiplayer())
8650 player.PhysicalPredictiveDropItem(this);
8651 else
8652 player.ServerDropEntity(this);
8653 return;
8654 }
8655
8657
8658 if (new_item)
8659 {
8660 new_item.SetResultOfSplit(true);
8661 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8663 new_item.SetQuantity(stack_max);
8664 new_item.PlaceOnSurface();
8665 }
8666 }
8667 }
8668 }
8669
8671 {
8673 return;
8674
8675 float split_quantity_new;
8679 InventoryLocation loc = new InventoryLocation;
8680
8681 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8682 {
8684 split_quantity_new = stack_max;
8685 else
8687
8688 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8689 if (new_item)
8690 {
8691 new_item.SetResultOfSplit(true);
8692 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8694 new_item.SetQuantity(split_quantity_new);
8695 }
8696 }
8697 else if (destination_entity && slot_id == -1)
8698 {
8699 if (quantity > stack_max)
8700 split_quantity_new = stack_max;
8701 else
8702 split_quantity_new = quantity;
8703
8705 {
8708 }
8709
8710 if (new_item)
8711 {
8712 new_item.SetResultOfSplit(true);
8713 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8715 new_item.SetQuantity(split_quantity_new);
8716 }
8717 }
8718 else
8719 {
8720 if (stack_max != 0)
8721 {
8723 {
8725 }
8726
8728
8729 if (new_item)
8730 {
8731 new_item.SetResultOfSplit(true);
8732 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8734 new_item.SetQuantity(stack_max);
8735 new_item.PlaceOnSurface();
8736 }
8737 }
8738 }
8739 }
8740
8742 {
8744 return;
8745
8747 {
8748 if (ScriptInputUserData.CanStoreInputUserData())
8749 {
8750 ScriptInputUserData ctx = new ScriptInputUserData;
8755 dst.WriteToContext(ctx);
8757 }
8758 }
8759 else if (!
GetGame().IsMultiplayer())
8760 {
8762 }
8763 }
8764
8766 {
8768 return;
8769
8771 {
8772 if (ScriptInputUserData.CanStoreInputUserData())
8773 {
8774 ScriptInputUserData ctx = new ScriptInputUserData;
8779 ctx.
Write(destination_entity);
8785 }
8786 }
8787 else if (!
GetGame().IsMultiplayer())
8788 {
8790 }
8791 }
8792
8794 {
8796 }
8797
8799 {
8801 return this;
8802
8804 float split_quantity_new;
8806 if (dst.IsValid())
8807 {
8808 int slot_id = dst.GetSlot();
8810
8811 if (quantity > stack_max)
8812 split_quantity_new = stack_max;
8813 else
8814 split_quantity_new = quantity;
8815
8817
8818 if (new_item)
8819 {
8820 new_item.SetResultOfSplit(true);
8821 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8824 }
8825
8826 return new_item;
8827 }
8828
8829 return null;
8830 }
8831
8833 {
8835 return;
8836
8838 float split_quantity_new;
8840 if (destination_entity)
8841 {
8843 if (quantity > stackable)
8844 split_quantity_new = stackable;
8845 else
8846 split_quantity_new = quantity;
8847
8848 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8849 if (new_item)
8850 {
8851 new_item.SetResultOfSplit(true);
8852 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8854 new_item.SetQuantity(split_quantity_new);
8855 }
8856 }
8857 }
8858
8860 {
8862 return;
8863
8865 {
8866 if (ScriptInputUserData.CanStoreInputUserData())
8867 {
8868 ScriptInputUserData ctx = new ScriptInputUserData;
8873 ItemBase destination_entity =
this;
8874 ctx.
Write(destination_entity);
8878 }
8879 }
8880 else if (!
GetGame().IsMultiplayer())
8881 {
8883 }
8884 }
8885
8887 {
8889 return;
8890
8892 float split_quantity_new;
8894 if (player)
8895 {
8897 if (quantity > stackable)
8898 split_quantity_new = stackable;
8899 else
8900 split_quantity_new = quantity;
8901
8902 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8903 new_item =
ItemBase.Cast(in_hands);
8904 if (new_item)
8905 {
8906 new_item.SetResultOfSplit(true);
8907 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8909 new_item.SetQuantity(split_quantity_new);
8910 }
8911 }
8912 }
8913
8915 {
8917 return;
8918
8920 float split_quantity_new = Math.Floor(quantity * 0.5);
8921
8923
8924 if (new_item)
8925 {
8926 if (new_item.GetQuantityMax() < split_quantity_new)
8927 {
8928 split_quantity_new = new_item.GetQuantityMax();
8929 }
8930
8931 new_item.SetResultOfSplit(true);
8932 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8933
8935 {
8938 }
8939 else
8940 {
8943 }
8944 }
8945 }
8946
8948 {
8950 return;
8951
8953 float split_quantity_new = Math.Floor(quantity / 2);
8954
8955 InventoryLocation invloc = new InventoryLocation;
8957
8959 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8960
8961 if (new_item)
8962 {
8963 if (new_item.GetQuantityMax() < split_quantity_new)
8964 {
8965 split_quantity_new = new_item.GetQuantityMax();
8966 }
8968 {
8971 }
8972 else
8973 {
8976 }
8977 }
8978 }
8979
8982 {
8983 SetWeightDirty();
8985
8986 if (parent)
8987 parent.OnAttachmentQuantityChangedEx(this, delta);
8988
8990 {
8992 {
8994 }
8996 {
8997 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8999 }
9000 }
9001
9002 }
9003
9006 {
9007
9008 }
9009
9012 {
9014 }
9015
9017 {
9018 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9019
9021 {
9022 if (newLevel == GameConstants.STATE_RUINED)
9023 {
9025 EntityAI parent = GetHierarchyParent();
9026 if (parent && parent.IsFireplace())
9027 {
9028 CargoBase cargo = GetInventory().GetCargo();
9029 if (cargo)
9030 {
9032 {
9034 }
9035 }
9036 }
9037 }
9038
9040 {
9041
9043 return;
9044 }
9045
9046 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9047 {
9049 }
9050 }
9051 }
9052
9053
9055 {
9056 super.OnRightClick();
9057
9059 {
9061 {
9062 if (ScriptInputUserData.CanStoreInputUserData())
9063 {
9064 vector m4[4];
9066
9067 EntityAI root = GetHierarchyRoot();
9068
9069 InventoryLocation dst = new InventoryLocation;
9071 {
9072 if (root)
9073 {
9074 root.GetTransform(m4);
9076 }
9077 else
9078 GetInventory().GetCurrentInventoryLocation(dst);
9079 }
9080 else
9081 {
9083
9084
9085 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9086 {
9087 if (root)
9088 {
9089 root.GetTransform(m4);
9091 }
9092 else
9093 GetInventory().GetCurrentInventoryLocation(dst);
9094 }
9095 else
9096 {
9097 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9098 }
9099 }
9100
9101 ScriptInputUserData ctx = new ScriptInputUserData;
9109 }
9110 }
9111 else if (!
GetGame().IsMultiplayer())
9112 {
9114 }
9115 }
9116 }
9117
9118 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9119 {
9120
9121 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9122 return false;
9123
9124 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9125 return false;
9126
9127
9129 return false;
9130
9131
9132 Magazine mag = Magazine.Cast(this);
9133 if (mag)
9134 {
9135 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9136 return false;
9137
9138 if (stack_max_limit)
9139 {
9140 Magazine other_mag = Magazine.Cast(other_item);
9141 if (other_item)
9142 {
9143 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9144 return false;
9145 }
9146
9147 }
9148 }
9149 else
9150 {
9151
9153 return false;
9154
9156 return false;
9157 }
9158
9159 PlayerBase player = null;
9160 if (CastTo(player, GetHierarchyRootPlayer()))
9161 {
9162 if (player.GetInventory().HasAttachment(this))
9163 return false;
9164
9165 if (player.IsItemsToDelete())
9166 return false;
9167 }
9168
9169 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9170 return false;
9171
9172 int slotID;
9174 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9175 return false;
9176
9177 return true;
9178 }
9179
9181 {
9183 }
9184
9186 {
9187 return m_IsResultOfSplit;
9188 }
9189
9191 {
9192 m_IsResultOfSplit = value;
9193 }
9194
9196 {
9198 }
9199
9201 {
9202 float other_item_quantity = other_item.GetQuantity();
9203 float this_free_space;
9204
9206
9208
9209 if (other_item_quantity > this_free_space)
9210 {
9211 return this_free_space;
9212 }
9213 else
9214 {
9215 return other_item_quantity;
9216 }
9217 }
9218
9220 {
9222 }
9223
9225 {
9227 return;
9228
9229 if (!IsMagazine() && other_item)
9230 {
9232 if (quantity_used != 0)
9233 {
9234 float hp1 = GetHealth01("","");
9235 float hp2 = other_item.GetHealth01("","");
9236 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9237 hpResult = hpResult / (
GetQuantity() + quantity_used);
9238
9239 hpResult *= GetMaxHealth();
9240 Math.Round(hpResult);
9241 SetHealth("", "Health", hpResult);
9242
9244 other_item.AddQuantity(-quantity_used);
9245 }
9246 }
9248 }
9249
9251 {
9252 #ifdef SERVER
9253 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9254 GetHierarchyParent().IncreaseLifetimeUp();
9255 #endif
9256 };
9257
9259 {
9260 PlayerBase p = PlayerBase.Cast(player);
9261
9262 array<int> recipesIds = p.m_Recipes;
9263 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9264 if (moduleRecipesManager)
9265 {
9266 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9267 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9268 }
9269
9270 for (int i = 0;i < recipesIds.Count(); i++)
9271 {
9272 int key = recipesIds.Get(i);
9273 string recipeName = moduleRecipesManager.GetRecipeName(key);
9275 }
9276 }
9277
9278
9279 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9280 {
9281 super.GetDebugActions(outputList);
9282
9283
9288
9289
9293
9297
9298
9301
9302
9304 {
9307 }
9308
9310
9313
9317 }
9318
9319
9320
9321
9323 {
9324 super.OnAction(action_id, player, ctx);
9325 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9326 {
9327 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9328 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9329 PlayerBase p = PlayerBase.Cast(player);
9330 if (
EActions.RECIPES_RANGE_START < 1000)
9331 {
9332 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9333 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9334 }
9335 }
9336 #ifndef SERVER
9337 else if (action_id ==
EActions.WATCH_PLAYER)
9338 {
9339 PluginDeveloper.SetDeveloperItemClientEx(player);
9340 }
9341 #endif
9343 {
9344 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9345 {
9346 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9347 OnDebugButtonPressServer(id + 1);
9348 }
9349
9350 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9351 {
9352 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9354 }
9355
9356 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9357 {
9358 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9360 }
9361
9362 else if (action_id ==
EActions.ADD_QUANTITY)
9363 {
9364 if (IsMagazine())
9365 {
9366 Magazine mag = Magazine.Cast(this);
9367 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9368 }
9369 else
9370 {
9372 }
9373
9374 if (m_EM)
9375 {
9376 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9377 }
9378
9379 }
9380
9381 else if (action_id ==
EActions.REMOVE_QUANTITY)
9382 {
9383 if (IsMagazine())
9384 {
9385 Magazine mag2 = Magazine.Cast(this);
9386 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9387 }
9388 else
9389 {
9391 }
9392 if (m_EM)
9393 {
9394 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9395 }
9396
9397 }
9398
9399 else if (action_id ==
EActions.SET_QUANTITY_0)
9400 {
9402
9403 if (m_EM)
9404 {
9405 m_EM.SetEnergy(0);
9406 }
9407 }
9408
9409 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9410 {
9412
9413 if (m_EM)
9414 {
9415 m_EM.SetEnergy(m_EM.GetEnergyMax());
9416 }
9417 }
9418
9419 else if (action_id ==
EActions.ADD_HEALTH)
9420 {
9421 AddHealth("","",GetMaxHealth("","Health")/5);
9422 }
9423 else if (action_id ==
EActions.REMOVE_HEALTH)
9424 {
9425 AddHealth("","",-GetMaxHealth("","Health")/5);
9426 }
9427 else if (action_id ==
EActions.DESTROY_HEALTH)
9428 {
9429 SetHealth01("","",0);
9430 }
9431 else if (action_id ==
EActions.WATCH_ITEM)
9432 {
9434 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9435 #ifdef DEVELOPER
9436 SetDebugDeveloper_item(this);
9437 #endif
9438 }
9439
9440 else if (action_id ==
EActions.ADD_TEMPERATURE)
9441 {
9442 AddTemperature(20);
9443
9444 }
9445
9446 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9447 {
9448 AddTemperature(-20);
9449
9450 }
9451
9452 else if (action_id ==
EActions.FLIP_FROZEN)
9453 {
9454 SetFrozen(!GetIsFrozen());
9455
9456 }
9457
9458 else if (action_id ==
EActions.ADD_WETNESS)
9459 {
9461
9462 }
9463
9464 else if (action_id ==
EActions.REMOVE_WETNESS)
9465 {
9467
9468 }
9469
9470 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9471 {
9474
9475
9476 }
9477
9478 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9479 {
9482 }
9483
9484 else if (action_id ==
EActions.MAKE_SPECIAL)
9485 {
9486 auto debugParams = DebugSpawnParams.WithPlayer(player);
9487 OnDebugSpawnEx(debugParams);
9488 }
9489
9490 else if (action_id ==
EActions.DELETE)
9491 {
9492 Delete();
9493 }
9494
9495 }
9496
9497
9498 return false;
9499 }
9500
9501
9502
9503
9507
9510
9511
9512
9514 {
9515 return false;
9516 }
9517
9518
9520 {
9521 return true;
9522 }
9523
9524
9526 {
9527 return true;
9528 }
9529
9530
9531
9533 {
9534 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9536 }
9537
9540 {
9541 return null;
9542 }
9543
9545 {
9546 return false;
9547 }
9548
9550 {
9551 return false;
9552 }
9553
9557
9558
9560 {
9561 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9562 return module_repairing.CanRepair(this, item_repair_kit);
9563 }
9564
9565
9566 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9567 {
9568 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9569 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9570 }
9571
9572
9574 {
9575
9576
9577
9578
9579
9580
9581
9582
9583 return 1;
9584 }
9585
9586
9587
9589 {
9591 }
9592
9593
9594
9596 {
9598 }
9599
9600
9609 {
9610 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9611
9612 if (player)
9613 {
9614 player.MessageStatus(text);
9615 }
9616 }
9617
9618
9627 {
9628 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9629
9630 if (player)
9631 {
9632 player.MessageAction(text);
9633 }
9634 }
9635
9636
9645 {
9646 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9647
9648 if (player)
9649 {
9650 player.MessageFriendly(text);
9651 }
9652 }
9653
9654
9663 {
9664 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9665
9666 if (player)
9667 {
9668 player.MessageImportant(text);
9669 }
9670 }
9671
9673 {
9674 return true;
9675 }
9676
9677
9678 override bool KindOf(
string tag)
9679 {
9680 bool found = false;
9681 string item_name = this.
GetType();
9684
9685 int array_size = item_tag_array.Count();
9686 for (int i = 0; i < array_size; i++)
9687 {
9688 if (item_tag_array.Get(i) == tag)
9689 {
9690 found = true;
9691 break;
9692 }
9693 }
9694 return found;
9695 }
9696
9697
9699 {
9700
9701 super.OnRPC(sender, rpc_type,ctx);
9702
9703
9704 switch (rpc_type)
9705 {
9706 #ifndef SERVER
9707 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9708 Param2<bool, string> p = new Param2<bool, string>(false, "");
9709
9711 return;
9712
9713 bool play = p.param1;
9714 string soundSet = p.param2;
9715
9716 if (play)
9717 {
9719 {
9721 {
9723 }
9724 }
9725 else
9726 {
9728 }
9729 }
9730 else
9731 {
9733 }
9734
9735 break;
9736 #endif
9737
9738 }
9739
9741 {
9743 }
9744 }
9745
9746
9747
9748
9750 {
9751 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9752 return plugin.GetID(
name);
9753 }
9754
9756 {
9757 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9758 return plugin.GetName(id);
9759 }
9760
9763 {
9764
9765
9766 int varFlags;
9767 if (!ctx.
Read(varFlags))
9768 return;
9769
9770 if (varFlags & ItemVariableFlags.FLOAT)
9771 {
9773 }
9774 }
9775
9777 {
9778
9779 super.SerializeNumericalVars(floats_out);
9780
9781
9782
9784 {
9786 }
9787
9789 {
9791 }
9792
9794 {
9796 }
9797
9799 {
9804 }
9805
9807 {
9809 }
9810 }
9811
9813 {
9814
9815 super.DeSerializeNumericalVars(floats);
9816
9817
9818 int index = 0;
9819 int mask = Math.Round(floats.Get(index));
9820
9821 index++;
9822
9824 {
9826 {
9828 }
9829 else
9830 {
9831 float quantity = floats.Get(index);
9833 }
9834 index++;
9835 }
9836
9838 {
9839 float wet = floats.Get(index);
9841 index++;
9842 }
9843
9845 {
9846 int liquidtype = Math.Round(floats.Get(index));
9848 index++;
9849 }
9850
9852 {
9854 index++;
9856 index++;
9858 index++;
9860 index++;
9861 }
9862
9864 {
9865 int cleanness = Math.Round(floats.Get(index));
9867 index++;
9868 }
9869 }
9870
9872 {
9873 super.WriteVarsToCTX(ctx);
9874
9875
9877 {
9879 }
9880
9882 {
9884 }
9885
9887 {
9889 }
9890
9892 {
9893 int r,g,b,a;
9899 }
9900
9902 {
9904 }
9905 }
9906
9908 {
9909 if (!super.ReadVarsFromCTX(ctx,version))
9910 return false;
9911
9912 int intValue;
9913 float value;
9914
9915 if (version < 140)
9916 {
9917 if (!ctx.
Read(intValue))
9918 return false;
9919
9920 m_VariablesMask = intValue;
9921 }
9922
9924 {
9925 if (!ctx.
Read(value))
9926 return false;
9927
9929 {
9931 }
9932 else
9933 {
9935 }
9936 }
9937
9938 if (version < 140)
9939 {
9941 {
9942 if (!ctx.
Read(value))
9943 return false;
9944 SetTemperatureDirect(value);
9945 }
9946 }
9947
9949 {
9950 if (!ctx.
Read(value))
9951 return false;
9953 }
9954
9956 {
9957 if (!ctx.
Read(intValue))
9958 return false;
9960 }
9961
9963 {
9964 int r,g,b,a;
9966 return false;
9968 return false;
9970 return false;
9972 return false;
9973
9975 }
9976
9978 {
9979 if (!ctx.
Read(intValue))
9980 return false;
9982 }
9983
9984 if (version >= 138 && version < 140)
9985 {
9987 {
9988 if (!ctx.
Read(intValue))
9989 return false;
9990 SetFrozen(intValue);
9991 }
9992 }
9993
9994 return true;
9995 }
9996
9997
9999 {
10002 {
10004 }
10005
10006 if (!super.OnStoreLoad(ctx, version))
10007 {
10009 return false;
10010 }
10011
10012 if (version >= 114)
10013 {
10014 bool hasQuickBarIndexSaved;
10015
10016 if (!ctx.
Read(hasQuickBarIndexSaved))
10017 {
10019 return false;
10020 }
10021
10022 if (hasQuickBarIndexSaved)
10023 {
10024 int itmQBIndex;
10025
10026
10027 if (!ctx.
Read(itmQBIndex))
10028 {
10030 return false;
10031 }
10032
10033 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10034 if (itmQBIndex != -1 && parentPlayer)
10035 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10036 }
10037 }
10038 else
10039 {
10040
10041 PlayerBase player;
10042 int itemQBIndex;
10043 if (version ==
int.
MAX)
10044 {
10045 if (!ctx.
Read(itemQBIndex))
10046 {
10048 return false;
10049 }
10050 }
10051 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10052 {
10053
10054 if (!ctx.
Read(itemQBIndex))
10055 {
10057 return false;
10058 }
10059 if (itemQBIndex != -1 && player)
10060 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10061 }
10062 }
10063
10064 if (version < 140)
10065 {
10066
10067 if (!LoadVariables(ctx, version))
10068 {
10070 return false;
10071 }
10072 }
10073
10074
10076 {
10078 return false;
10079 }
10080 if (version >= 132)
10081 {
10083 if (raib)
10084 {
10086 {
10088 return false;
10089 }
10090 }
10091 }
10092
10094 return true;
10095 }
10096
10097
10098
10100 {
10101 super.OnStoreSave(ctx);
10102
10103 PlayerBase player;
10104 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10105 {
10107
10108 int itemQBIndex = -1;
10109 itemQBIndex = player.FindQuickBarEntityIndex(this);
10110 ctx.
Write(itemQBIndex);
10111 }
10112 else
10113 {
10115 }
10116
10118
10120 if (raib)
10121 {
10123 }
10124 }
10125
10126
10128 {
10129 super.AfterStoreLoad();
10130
10132 {
10134 }
10135
10137 {
10140 }
10141 }
10142
10144 {
10145 super.EEOnAfterLoad();
10146
10148 {
10150 }
10151
10154 }
10155
10157 {
10158 return false;
10159 }
10160
10161
10162
10164 {
10166 {
10167 #ifdef PLATFORM_CONSOLE
10168
10170 {
10172 if (menu)
10173 {
10175 }
10176 }
10177 #endif
10178 }
10179
10181 {
10184 }
10185
10187 {
10188 SetWeightDirty();
10190 }
10192 {
10195 }
10196
10198 {
10201 }
10203 {
10206 }
10207
10208 super.OnVariablesSynchronized();
10209 }
10210
10211
10212
10214 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10215 {
10216 if (!IsServerCheck(allow_client))
10217 return false;
10218
10220 return false;
10221
10224
10225 if (value <= (min + 0.001))
10226 value = min;
10227
10228 if (value == min)
10229 {
10230 if (destroy_config)
10231 {
10232 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10233 if (dstr)
10234 {
10236 this.Delete();
10237 return true;
10238 }
10239 }
10240 else if (destroy_forced)
10241 {
10243 this.Delete();
10244 return true;
10245 }
10246
10248 }
10249
10252
10254 {
10256
10257 if (delta)
10259 }
10260
10262
10263 return false;
10264 }
10265
10266
10268 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10269 {
10271 }
10272
10274 {
10277 }
10278
10280 {
10283 }
10284
10287 {
10288 float value_clamped = Math.Clamp(value, 0, 1);
10290 SetQuantity(result, destroy_config, destroy_forced);
10291 }
10292
10293
10296 {
10298 }
10299
10301 {
10303 }
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10315 {
10316 int slot = -1;
10317 if (GetInventory())
10318 {
10319 InventoryLocation il = new InventoryLocation;
10320 GetInventory().GetCurrentInventoryLocation(il);
10322 }
10323
10325 }
10326
10328 {
10329 float quantity_max = 0;
10330
10332 {
10333 if (attSlotID != -1)
10334 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10335
10336 if (quantity_max <= 0)
10338 }
10339
10340 if (quantity_max <= 0)
10342
10343 return quantity_max;
10344 }
10345
10347 {
10349 }
10350
10352 {
10354 }
10355
10356
10358 {
10360 }
10361
10363 {
10365 }
10366
10368 {
10370 }
10371
10372
10374 {
10375
10376 float weightEx = GetWeightEx();
10377 float special = GetInventoryAndCargoWeight();
10378 return weightEx - special;
10379 }
10380
10381
10383 {
10385 }
10386
10388 {
10390 {
10391 #ifdef DEVELOPER
10392 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10393 {
10394 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10396 }
10397 #endif
10398
10399 return GetQuantity() * GetConfigWeightModified();
10400 }
10401 else if (HasEnergyManager())
10402 {
10403 #ifdef DEVELOPER
10404 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10405 {
10406 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10407 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10408 }
10409 #endif
10410 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10411 }
10412 else
10413 {
10414 #ifdef DEVELOPER
10415 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10416 {
10417 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10418 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10419 }
10420 #endif
10421 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10422 }
10423 }
10424
10427 {
10428 int item_count = 0;
10430
10431 if (GetInventory().GetCargo() != NULL)
10432 {
10433 item_count = GetInventory().GetCargo().GetItemCount();
10434 }
10435
10436 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10437 {
10438 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10439 if (item)
10440 item_count += item.GetNumberOfItems();
10441 }
10442 return item_count;
10443 }
10444
10447 {
10448 float weight = 0;
10449 float wetness = 1;
10450 if (include_wetness)
10453 {
10454 weight = wetness * m_ConfigWeight;
10455 }
10457 {
10458 weight = 1;
10459 }
10460 return weight;
10461 }
10462
10463
10464
10466 {
10467 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10468 {
10469 GameInventory inv = GetInventory();
10470 array<EntityAI> items = new array<EntityAI>;
10472 for (int i = 0; i < items.Count(); i++)
10473 {
10475 if (item)
10476 {
10478 }
10479 }
10480 }
10481 }
10482
10483
10484
10485
10487 {
10488 float energy = 0;
10489 if (HasEnergyManager())
10490 {
10491 energy = GetCompEM().GetEnergy();
10492 }
10493 return energy;
10494 }
10495
10496
10498 {
10499 super.OnEnergyConsumed();
10500
10502 }
10503
10505 {
10506 super.OnEnergyAdded();
10507
10509 }
10510
10511
10513 {
10514 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10515 {
10517 {
10518 float energy_0to1 = GetCompEM().GetEnergy0To1();
10520 }
10521 }
10522 }
10523
10524
10526 {
10527 return ConfigGetFloat("heatIsolation");
10528 }
10529
10531 {
10533 }
10534
10536 {
10537 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10538 if (
GetGame().ConfigIsExisting(paramPath))
10540
10541 return 0.0;
10542 }
10543
10545 {
10546 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10547 if (
GetGame().ConfigIsExisting(paramPath))
10549
10550 return 0.0;
10551 }
10552
10553 override void SetWet(
float value,
bool allow_client =
false)
10554 {
10555 if (!IsServerCheck(allow_client))
10556 return;
10557
10560
10562
10563 m_VarWet = Math.Clamp(value, min, max);
10564
10566 {
10569 }
10570 }
10571
10572 override void AddWet(
float value)
10573 {
10575 }
10576
10578 {
10580 }
10581
10583 {
10585 }
10586
10588 {
10590 }
10591
10593 {
10595 }
10596
10598 {
10600 }
10601
10602 override void OnWetChanged(
float newVal,
float oldVal)
10603 {
10606 if (newLevel != oldLevel)
10607 {
10609 }
10610 }
10611
10613 {
10614 SetWeightDirty();
10615 }
10616
10618 {
10619 return GetWetLevelInternal(
m_VarWet);
10620 }
10621
10622
10623
10625 {
10627 }
10628
10630 {
10632 }
10633
10635 {
10637 }
10638
10640 {
10642 }
10643
10644
10645
10647 {
10648 if (ConfigIsExisting("itemModelLength"))
10649 {
10650 return ConfigGetFloat("itemModelLength");
10651 }
10652 return 0;
10653 }
10654
10656 {
10657 if (ConfigIsExisting("itemAttachOffset"))
10658 {
10659 return ConfigGetFloat("itemAttachOffset");
10660 }
10661 return 0;
10662 }
10663
10664 override void SetCleanness(
int value,
bool allow_client =
false)
10665 {
10666 if (!IsServerCheck(allow_client))
10667 return;
10668
10670
10672
10675 }
10676
10678 {
10680 }
10681
10683 {
10684 return true;
10685 }
10686
10687
10688
10689
10691 {
10693 }
10694
10696 {
10698 }
10699
10700
10701
10702
10703 override void SetColor(
int r,
int g,
int b,
int a)
10704 {
10710 }
10712 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10713 {
10718 }
10719
10721 {
10723 }
10724
10727 {
10728 int r,g,b,a;
10730 r = r/255;
10731 g = g/255;
10732 b = b/255;
10733 a = a/255;
10734 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10735 }
10736
10737
10738
10739 override void SetLiquidType(
int value,
bool allow_client =
false)
10740 {
10741 if (!IsServerCheck(allow_client))
10742 return;
10743
10748 }
10749
10751 {
10752 return ConfigGetInt("varLiquidTypeInit");
10753 }
10754
10756 {
10758 }
10759
10761 {
10763 SetFrozen(false);
10764 }
10765
10768 {
10769 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10770 }
10771
10772
10775 {
10776 PlayerBase nplayer;
10777 if (PlayerBase.CastTo(nplayer, player))
10778 {
10780
10781 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10782 }
10783 }
10784
10785
10788 {
10789 PlayerBase nplayer;
10790 if (PlayerBase.CastTo(nplayer,player))
10791 {
10792
10793 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10794
10795 }
10796
10797
10798 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10799
10800
10801 if (HasEnergyManager())
10802 {
10803 GetCompEM().UpdatePlugState();
10804 }
10805 }
10806
10807
10809 {
10810 super.OnPlacementStarted(player);
10811
10813 }
10814
10815 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10816 {
10818 {
10819 m_AdminLog.OnPlacementComplete(player,
this);
10820 }
10821
10822 super.OnPlacementComplete(player, position, orientation);
10823 }
10824
10825
10826
10827
10828
10830 {
10832 {
10833 return true;
10834 }
10835 else
10836 {
10837 return false;
10838 }
10839 }
10840
10841
10843 {
10845 {
10847 }
10848 }
10849
10850
10852 {
10854 }
10855
10857 {
10859 }
10860
10861 override void InsertAgent(
int agent,
float count = 1)
10862 {
10863 if (count < 1)
10864 return;
10865
10867 }
10868
10871 {
10873 }
10874
10875
10877 {
10879 }
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10923 {
10925 return false;
10926 return true;
10927 }
10928
10930 {
10931
10933 }
10934
10935
10938 {
10939 super.CheckForRoofLimited(timeTresholdMS);
10940
10942 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10943 {
10944 m_PreviousRoofTestTime = time;
10945 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10946 }
10947 }
10948
10949
10951 {
10953 {
10954 return 0;
10955 }
10956
10957 if (GetInventory().GetAttachmentSlotsCount() != 0)
10958 {
10959 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10960 if (filter)
10961 return filter.GetProtectionLevel(type, false, system);
10962 else
10963 return 0;
10964 }
10965
10966 string subclassPath, entryName;
10967
10968 switch (type)
10969 {
10971 entryName = "biological";
10972 break;
10974 entryName = "chemical";
10975 break;
10976 default:
10977 entryName = "biological";
10978 break;
10979 }
10980
10981 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10982
10984 }
10985
10986
10987
10990 {
10991 if (!IsMagazine())
10993
10995 }
10996
10997
10998
10999
11000
11005 {
11006 return true;
11007 }
11008
11010 {
11012 }
11013
11014
11015
11016
11017
11019 {
11020 if (parent)
11021 {
11022 if (parent.IsInherited(DayZInfected))
11023 return true;
11024
11025 if (!parent.IsRuined())
11026 return true;
11027 }
11028
11029 return true;
11030 }
11031
11033 {
11034 if (!super.CanPutAsAttachment(parent))
11035 {
11036 return false;
11037 }
11038
11039 if (!IsRuined() && !parent.IsRuined())
11040 {
11041 return true;
11042 }
11043
11044 return false;
11045 }
11046
11048 {
11049
11050
11051
11052
11053 return super.CanReceiveItemIntoCargo(item);
11054 }
11055
11057 {
11058
11059
11060
11061
11062 GameInventory attachmentInv = attachment.GetInventory();
11064 {
11065 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11066 return false;
11067 }
11068
11069 InventoryLocation loc = new InventoryLocation();
11070 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11071 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11072 return false;
11073
11074 return super.CanReceiveAttachment(attachment, slotId);
11075 }
11076
11078 {
11079 if (!super.CanReleaseAttachment(attachment))
11080 return false;
11081
11082 return GetInventory().AreChildrenAccessible();
11083 }
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11106 {
11107 int id = muzzle_owner.GetMuzzleID();
11108 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11109
11110 if (WPOF_array)
11111 {
11112 for (int i = 0; i < WPOF_array.Count(); i++)
11113 {
11114 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11115
11116 if (WPOF)
11117 {
11118 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11119 }
11120 }
11121 }
11122 }
11123
11124
11126 {
11127 int id = muzzle_owner.GetMuzzleID();
11129
11130 if (WPOBE_array)
11131 {
11132 for (int i = 0; i < WPOBE_array.Count(); i++)
11133 {
11134 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11135
11136 if (WPOBE)
11137 {
11138 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11139 }
11140 }
11141 }
11142 }
11143
11144
11146 {
11147 int id = muzzle_owner.GetMuzzleID();
11148 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11149
11150 if (WPOOH_array)
11151 {
11152 for (int i = 0; i < WPOOH_array.Count(); i++)
11153 {
11154 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11155
11156 if (WPOOH)
11157 {
11158 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11159 }
11160 }
11161 }
11162 }
11163
11164
11166 {
11167 int id = muzzle_owner.GetMuzzleID();
11168 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11169
11170 if (WPOOH_array)
11171 {
11172 for (int i = 0; i < WPOOH_array.Count(); i++)
11173 {
11174 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11175
11176 if (WPOOH)
11177 {
11178 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11179 }
11180 }
11181 }
11182 }
11183
11184
11186 {
11187 int id = muzzle_owner.GetMuzzleID();
11188 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11189
11190 if (WPOOH_array)
11191 {
11192 for (int i = 0; i < WPOOH_array.Count(); i++)
11193 {
11194 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11195
11196 if (WPOOH)
11197 {
11198 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11199 }
11200 }
11201 }
11202 }
11203
11204
11205
11207 {
11209 {
11210 return true;
11211 }
11212
11213 return false;
11214 }
11215
11217 {
11219 {
11220 return true;
11221 }
11222
11223 return false;
11224 }
11225
11227 {
11229 {
11230 return true;
11231 }
11232
11233 return false;
11234 }
11235
11237 {
11238 return false;
11239 }
11240
11243 {
11244 return UATimeSpent.DEFAULT_DEPLOY;
11245 }
11246
11247
11248
11249
11251 {
11253 SetSynchDirty();
11254 }
11255
11257 {
11259 }
11260
11261
11263 {
11264 return false;
11265 }
11266
11269 {
11270 string att_type = "None";
11271
11272 if (ConfigIsExisting("soundAttType"))
11273 {
11274 att_type = ConfigGetString("soundAttType");
11275 }
11276
11278 }
11279
11281 {
11283 }
11284
11285
11286
11287
11288
11292
11294 {
11297
11299 }
11300
11301
11303 {
11305 return;
11306
11308
11311
11314
11315 SoundParameters params = new SoundParameters();
11319 }
11320
11321
11323 {
11325 return;
11326
11328 SetSynchDirty();
11329
11332 }
11333
11334
11336 {
11338 return;
11339
11341 SetSynchDirty();
11342
11345 }
11346
11348 {
11350 }
11351
11353 {
11355 }
11356
11359 {
11360 if (!
GetGame().IsDedicatedServer())
11361 {
11362 if (ConfigIsExisting("attachSoundSet"))
11363 {
11364 string cfg_path = "";
11365 string soundset = "";
11366 string type_name =
GetType();
11367
11370 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11371 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11372
11373 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11374 {
11375 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11376 {
11377 if (cfg_slot_array[i] == slot_type)
11378 {
11379 soundset = cfg_soundset_array[i];
11380 break;
11381 }
11382 }
11383 }
11384
11385 if (soundset != "")
11386 {
11387 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11389 }
11390 }
11391 }
11392 }
11393
11395 {
11396
11397 }
11398
11399 void OnApply(PlayerBase player);
11400
11402 {
11403 return 1.0;
11404 };
11405
11407 {
11409 }
11410
11412 {
11414 }
11415
11417
11419 {
11420 SetDynamicPhysicsLifeTime(0.01);
11422 }
11423
11425 {
11426 array<string> zone_names = new array<string>;
11427 GetDamageZones(zone_names);
11428 for (int i = 0; i < zone_names.Count(); i++)
11429 {
11430 SetHealthMax(zone_names.Get(i),"Health");
11431 }
11432 SetHealthMax("","Health");
11433 }
11434
11437 {
11438 float global_health = GetHealth01("","Health");
11439 array<string> zones = new array<string>;
11440 GetDamageZones(zones);
11441
11442 for (int i = 0; i < zones.Count(); i++)
11443 {
11444 SetHealth01(zones.Get(i),"Health",global_health);
11445 }
11446 }
11447
11450 {
11451 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11452 }
11453
11455 {
11456 if (!hasRootAsPlayer)
11457 {
11458 if (refParentIB)
11459 {
11460
11461 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11462 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11463
11464 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11465 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11466
11469 }
11470 else
11471 {
11472
11475 }
11476 }
11477 }
11478
11480 {
11482 {
11483 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11484 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11485 {
11486 float heatPermCoef = 1.0;
11488 while (ent)
11489 {
11490 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11491 ent = ent.GetHierarchyParent();
11492 }
11493
11494 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11495 }
11496 }
11497 }
11498
11500 {
11501
11502 EntityAI parent = GetHierarchyParent();
11503 if (!parent)
11504 {
11505 hasParent = false;
11506 hasRootAsPlayer = false;
11507 }
11508 else
11509 {
11510 hasParent = true;
11511 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11512 refParentIB =
ItemBase.Cast(parent);
11513 }
11514 }
11515
11516 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11517 {
11518
11519 }
11520
11522 {
11523
11524 return false;
11525 }
11526
11528 {
11529
11530
11531 return false;
11532 }
11533
11535 {
11536
11537 return false;
11538 }
11539
11542 {
11543 return !GetIsFrozen() &&
IsOpen();
11544 }
11545
11547 {
11548 bool hasParent = false, hasRootAsPlayer = false;
11550
11551 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11552 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11553
11554 if (wwtu || foodDecay)
11555 {
11559
11560 if (processWetness || processTemperature || processDecay)
11561 {
11563
11564 if (processWetness)
11565 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11566
11567 if (processTemperature)
11569
11570 if (processDecay)
11571 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11572 }
11573 }
11574 }
11575
11578 {
11580 }
11581
11583 {
11586
11587 return super.GetTemperatureFreezeThreshold();
11588 }
11589
11591 {
11594
11595 return super.GetTemperatureThawThreshold();
11596 }
11597
11599 {
11602
11603 return super.GetItemOverheatThreshold();
11604 }
11605
11607 {
11609 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11610
11611 return super.GetTemperatureFreezeTime();
11612 }
11613
11615 {
11617 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11618
11619 return super.GetTemperatureThawTime();
11620 }
11621
11626
11628 {
11629 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11630 }
11631
11633 {
11634 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11635 }
11636
11639 {
11641 }
11642
11644 {
11646 }
11647
11649 {
11651 }
11652
11655 {
11656 return null;
11657 }
11658
11661 {
11662 return false;
11663 }
11664
11666 {
11668 {
11671 if (!trg)
11672 {
11674 explosive = this;
11675 }
11676
11677 explosive.PairRemote(trg);
11679
11680 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11681 trg.SetPersistentPairID(persistentID);
11682 explosive.SetPersistentPairID(persistentID);
11683
11684 return true;
11685 }
11686 return false;
11687 }
11688
11691 {
11692 float ret = 1.0;
11695 ret *= GetHealth01();
11696
11697 return ret;
11698 }
11699
11700 #ifdef DEVELOPER
11701 override void SetDebugItem()
11702 {
11703 super.SetDebugItem();
11704 _itemBase = this;
11705 }
11706
11708 {
11709 string text = super.GetDebugText();
11710
11712 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11713
11714 return text;
11715 }
11716 #endif
11717
11719 {
11720 return true;
11721 }
11722
11724
11726
11728 {
11731 }
11732
11733
11741
11757}
11758
11760{
11762 if (entity)
11763 {
11764 bool is_item = entity.IsInherited(
ItemBase);
11765 if (is_item && full_quantity)
11766 {
11769 }
11770 }
11771 else
11772 {
11774 return NULL;
11775 }
11776 return entity;
11777}
11778
11780{
11781 if (item)
11782 {
11783 if (health > 0)
11784 item.SetHealth("", "", health);
11785
11786 if (item.CanHaveTemperature())
11787 {
11789 if (item.CanFreeze())
11790 item.SetFrozen(false);
11791 }
11792
11793 if (item.HasEnergyManager())
11794 {
11795 if (quantity >= 0)
11796 {
11797 item.GetCompEM().SetEnergy0To1(quantity);
11798 }
11799 else
11800 {
11802 }
11803 }
11804 else if (item.IsMagazine())
11805 {
11806 Magazine mag = Magazine.Cast(item);
11807 if (quantity >= 0)
11808 {
11809 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11810 }
11811 else
11812 {
11814 }
11815
11816 }
11817 else
11818 {
11819 if (quantity >= 0)
11820 {
11821 item.SetQuantityNormalized(quantity, false);
11822 }
11823 else
11824 {
11826 }
11827
11828 }
11829 }
11830}
11831
11832#ifdef DEVELOPER
11834#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
override int GetLiquidType()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
void Open()
Implementations only.
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void EEOnCECreate()
Called when entity is being created as new by CE/ Debug.
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.