6904{
6906 {
6907 return true;
6908 }
6909};
6910
6911
6912
6914{
6918
6920
6923
6924
6925
6926
6927
6936
6942
6947
6952
6973 protected bool m_IsResultOfSplit
6974
6976
6981
6982
6983
6985
6989
6990
6991
6993
6996
6997
6998
7004
7005
7013
7016
7017
7019
7020
7022
7023
7028
7029
7034
7035
7037
7038
7040 {
7045
7046 if (!
GetGame().IsDedicatedServer())
7047 {
7049 {
7051
7053 {
7055 }
7056 }
7057
7060 }
7061
7062 m_OldLocation = null;
7063
7065 {
7067 }
7068
7069 if (ConfigIsExisting("headSelectionsToHide"))
7070 {
7073 }
7074
7076 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7077 {
7079 }
7080
7082
7083 m_IsResultOfSplit = false;
7084
7086 }
7087
7089 {
7090 super.InitItemVariables();
7091
7097 m_Count = ConfigGetInt(
"count");
7098
7101
7106
7109
7114
7126
7130
7131
7134 if (ConfigIsExisting("canBeSplit"))
7135 {
7138 }
7139
7141 if (ConfigIsExisting("itemBehaviour"))
7143
7144
7147 RegisterNetSyncVariableInt("m_VarLiquidType");
7148 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7149
7150 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7151 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7152 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7153
7154 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7155 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7156 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7157 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7158
7159 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7160 RegisterNetSyncVariableBool("m_IsTakeable");
7161 RegisterNetSyncVariableBool("m_IsHologram");
7162
7165 {
7168 }
7169
7171
7173 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7175
7176 }
7177
7179 {
7181 }
7182
7184 {
7187 {
7192 }
7193 }
7194
7195 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7196 {
7198 {
7201 }
7202
7204 }
7205
7207 {
7213 }
7214
7216
7218 {
7220
7221 if (!action)
7222 {
7223 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7224 return;
7225 }
7226
7228 if (!ai)
7229 {
7231 return;
7232 }
7233
7235 if (!action_array)
7236 {
7237 action_array = new array<ActionBase_Basic>;
7239 }
7240 if (LogManager.IsActionLogEnable())
7241 {
7242 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7243 }
7244
7245 if (action_array.Find(action) != -1)
7246 {
7247 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7248 }
7249 else
7250 {
7251 action_array.Insert(action);
7252 }
7253 }
7254
7256 {
7258 ActionBase action = player.GetActionManager().GetAction(actionName);
7261
7262 if (action_array)
7263 {
7264 action_array.RemoveItem(action);
7265 }
7266 }
7267
7268
7269
7271 {
7272 ActionOverrideData overrideData = new ActionOverrideData();
7276
7278 if (!actionMap)
7279 {
7282 }
7283
7284 actionMap.Insert(this.
Type(), overrideData);
7285
7286 }
7287
7289
7291
7292
7294 {
7297
7300
7301 string config_to_search = "CfgVehicles";
7302 string muzzle_owner_config;
7303
7305 {
7306 if (IsInherited(Weapon))
7307 config_to_search = "CfgWeapons";
7308
7309 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7310
7311 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7312
7314
7315 if (config_OnFire_subclass_count > 0)
7316 {
7317 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7318
7319 for (int i = 0; i < config_OnFire_subclass_count; i++)
7320 {
7321 string particle_class = "";
7323 string config_OnFire_entry = config_OnFire_class + particle_class;
7324 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7325 WPOF_array.Insert(WPOF);
7326 }
7327
7328
7330 }
7331 }
7332
7334 {
7335 config_to_search = "CfgWeapons";
7336 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7337
7338 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7339
7341
7342 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7343 {
7344 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7345
7346 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7347 {
7348 string particle_class2 = "";
7350 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7351 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7352 WPOBE_array.Insert(WPOBE);
7353 }
7354
7355
7357 }
7358 }
7359 }
7360
7361
7363 {
7366
7368 {
7369 string config_to_search = "CfgVehicles";
7370
7371 if (IsInherited(Weapon))
7372 config_to_search = "CfgWeapons";
7373
7374 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7375 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7376
7377 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7378 {
7379
7381
7383 {
7385 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7387 return;
7388 }
7389
7392
7393
7394
7396 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7397
7398 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7399 {
7400 string particle_class = "";
7402 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7404
7405 if (entry_type == CT_CLASS)
7406 {
7407 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7408 WPOOH_array.Insert(WPOF);
7409 }
7410 }
7411
7412
7414 }
7415 }
7416 }
7417
7419 {
7421 }
7422
7424 {
7426 {
7428
7431
7434
7435 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7436 }
7437 }
7438
7440 {
7442 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7443
7445 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7446
7448 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7449
7451 {
7453 }
7454 }
7455
7457 {
7459 }
7460
7462 {
7465 else
7467
7469 {
7472 }
7473 else
7474 {
7477
7480 }
7481
7483 }
7484
7486 {
7488 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7489 }
7490
7492 {
7494 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7496 }
7497
7499 {
7501 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7502 }
7503
7505 {
7508
7509 OverheatingParticle OP = new OverheatingParticle();
7514
7516 }
7517
7519 {
7522
7523 return -1;
7524 }
7525
7527 {
7529 {
7532
7533 for (int i = count; i > 0; --i)
7534 {
7535 int id = i - 1;
7538
7541
7542 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7543 {
7544 if (p)
7545 {
7548 }
7549 }
7550 }
7551 }
7552 }
7553
7555 {
7557 {
7559 {
7560 int id = i - 1;
7562
7563 if (OP)
7564 {
7566
7567 if (p)
7568 {
7570 }
7571
7572 delete OP;
7573 }
7574 }
7575
7578 }
7579 }
7580
7583 {
7584 return 0.0;
7585 }
7586
7587
7589 {
7590 return 250;
7591 }
7592
7594 {
7595 return 0;
7596 }
7597
7600 {
7602 return true;
7603
7604 return false;
7605 }
7606
7609 {
7612
7614 {
7616 }
7617 else
7618 {
7619
7621 }
7622
7624 }
7625
7632 {
7633 return -1;
7634 }
7635
7636
7637
7638
7640 {
7642 {
7644 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7645
7646 if (r_index >= 0)
7647 {
7648 InventoryLocation r_il = new InventoryLocation;
7649 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7650
7651 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7654 {
7655 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7656 }
7658 {
7659 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7660 }
7661
7662 }
7663
7664 player.GetHumanInventory().ClearUserReservedLocation(this);
7665 }
7666
7669 }
7670
7671
7672
7673
7675 {
7676 return ItemBase.m_DebugActionsMask;
7677 }
7678
7680 {
7681 return ItemBase.m_DebugActionsMask & mask;
7682 }
7683
7685 {
7686 ItemBase.m_DebugActionsMask = mask;
7687 }
7688
7690 {
7691 ItemBase.m_DebugActionsMask |= mask;
7692 }
7693
7695 {
7696 ItemBase.m_DebugActionsMask &= ~mask;
7697 }
7698
7700 {
7702 {
7704 }
7705 else
7706 {
7708 }
7709 }
7710
7711
7713 {
7714 if (GetEconomyProfile())
7715 {
7716 float q_max = GetEconomyProfile().GetQuantityMax();
7717 if (q_max > 0)
7718 {
7719 float q_min = GetEconomyProfile().GetQuantityMin();
7720 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7721
7723 {
7724 ComponentEnergyManager comp = GetCompEM();
7726 {
7728 }
7729 }
7731 {
7733
7734 }
7735
7736 }
7737 }
7738 }
7739
7742 {
7743 EntityAI parent = GetHierarchyParent();
7744
7745 if (parent)
7746 {
7747 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7748 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7749 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7750 }
7751 }
7752
7755 {
7756 EntityAI parent = GetHierarchyParent();
7757
7758 if (parent)
7759 {
7760 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7761 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7762 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7763 }
7764 }
7765
7767 {
7768
7769
7770
7771
7773
7775 {
7776 if (ScriptInputUserData.CanStoreInputUserData())
7777 {
7778 ScriptInputUserData ctx = new ScriptInputUserData;
7784 ctx.
Write(use_stack_max);
7787
7789 {
7790 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7791 }
7792 }
7793 }
7794 else if (!
GetGame().IsMultiplayer())
7795 {
7797 }
7798 }
7799
7801 {
7803 }
7804
7806 {
7808 }
7809
7811 {
7813 }
7814
7816 {
7817
7818 return false;
7819 }
7820
7822 {
7823 return false;
7824 }
7825
7829 {
7830 return false;
7831 }
7832
7834 {
7835 return "";
7836 }
7837
7839
7841 {
7842 return false;
7843 }
7844
7846 {
7847 return true;
7848 }
7849
7850
7851
7853 {
7854 return true;
7855 }
7856
7858 {
7859 return true;
7860 }
7861
7863 {
7864 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7866 }
7867
7869 {
7871 }
7872
7874 {
7876 if (!is_being_placed)
7878 SetSynchDirty();
7879 }
7880
7881
7883
7885 {
7887 }
7888
7890 {
7892 }
7893
7895 {
7896 return 1;
7897 }
7898
7900 {
7901 return false;
7902 }
7903
7905 {
7907 SetSynchDirty();
7908 }
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7945 {
7946 super.OnMovedInsideCargo(container);
7947
7948 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7949 }
7950
7951 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7952 {
7953 super.EEItemLocationChanged(oldLoc,newLoc);
7954
7955 PlayerBase new_player = null;
7956 PlayerBase old_player = null;
7957
7958 if (newLoc.GetParent())
7959 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7960
7961 if (oldLoc.GetParent())
7962 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7963
7965 {
7966 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7967
7968 if (r_index >= 0)
7969 {
7970 InventoryLocation r_il = new InventoryLocation;
7971 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7972
7973 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7976 {
7977 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7978 }
7980 {
7981 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7982 }
7983
7984 }
7985 }
7986
7988 {
7989 if (new_player)
7990 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7991
7992 if (new_player == old_player)
7993 {
7994
7995 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7996 {
7998 {
7999 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8000 {
8001 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8002 }
8003 }
8004 else
8005 {
8006 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8007 }
8008 }
8009
8010 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8011 {
8012 int type = oldLoc.GetType();
8014 {
8015 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8016 }
8018 {
8019 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8020 }
8021 }
8022 if (!m_OldLocation)
8023 {
8024 m_OldLocation = new InventoryLocation;
8025 }
8026 m_OldLocation.Copy(oldLoc);
8027 }
8028 else
8029 {
8030 if (m_OldLocation)
8031 {
8032 m_OldLocation.Reset();
8033 }
8034 }
8035
8037 }
8038 else
8039 {
8040 if (new_player)
8041 {
8042 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8043 if (res_index >= 0)
8044 {
8045 InventoryLocation il = new InventoryLocation;
8046 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8048 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8051 {
8052 il.
GetParent().GetOnReleaseLock().Invoke(it);
8053 }
8055 {
8057 }
8058
8059 }
8060 }
8062 {
8063
8065 }
8066
8067 if (m_OldLocation)
8068 {
8069 m_OldLocation.Reset();
8070 }
8071 }
8072 }
8073
8074 override void EOnContact(IEntity other, Contact extra)
8075 {
8077 {
8078 int liquidType = -1;
8080 if (impactSpeed > 0.0)
8081 {
8083 #ifndef SERVER
8085 #else
8087 SetSynchDirty();
8088 #endif
8090 }
8091 }
8092
8093 #ifdef SERVER
8094 if (GetCompEM() && GetCompEM().IsPlugged())
8095 {
8096 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8097 GetCompEM().UnplugThis();
8098 }
8099 #endif
8100 }
8101
8103
8105 {
8107 }
8108
8110 {
8111
8112 }
8113
8115 {
8116 super.OnItemLocationChanged(old_owner, new_owner);
8117
8118 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8119 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8120
8121 if (!relatedPlayer && playerNew)
8122 relatedPlayer = playerNew;
8123
8124 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8125 {
8127 if (actionMgr)
8128 {
8129 ActionBase currentAction = actionMgr.GetRunningAction();
8130 if (currentAction)
8132 }
8133 }
8134
8135 Man ownerPlayerOld = null;
8136 Man ownerPlayerNew = null;
8137
8138 if (old_owner)
8139 {
8140 if (old_owner.
IsMan())
8141 {
8142 ownerPlayerOld = Man.Cast(old_owner);
8143 }
8144 else
8145 {
8146 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8147 }
8148 }
8149 else
8150 {
8152 {
8154
8155 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8156 {
8157 GetCompEM().UnplugThis();
8158 }
8159 }
8160 }
8161
8162 if (new_owner)
8163 {
8164 if (new_owner.
IsMan())
8165 {
8166 ownerPlayerNew = Man.Cast(new_owner);
8167 }
8168 else
8169 {
8170 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8171 }
8172 }
8173
8174 if (ownerPlayerOld != ownerPlayerNew)
8175 {
8176 if (ownerPlayerOld)
8177 {
8178 array<EntityAI> subItemsExit = new array<EntityAI>;
8180 for (int i = 0; i < subItemsExit.Count(); i++)
8181 {
8184 }
8185 }
8186
8187 if (ownerPlayerNew)
8188 {
8189 array<EntityAI> subItemsEnter = new array<EntityAI>;
8191 for (int j = 0; j < subItemsEnter.Count(); j++)
8192 {
8195 }
8196 }
8197 }
8198 else if (ownerPlayerNew != null)
8199 {
8200 PlayerBase nplayer;
8201 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8202 {
8203 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8205 for (int k = 0; k < subItemsUpdate.Count(); k++)
8206 {
8208 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8209 }
8210 }
8211 }
8212
8213 if (old_owner)
8214 old_owner.OnChildItemRemoved(this);
8215 if (new_owner)
8216 new_owner.OnChildItemReceived(this);
8217 }
8218
8219
8221 {
8222 super.EEDelete(parent);
8223 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8224 if (player)
8225 {
8227
8228 if (player.IsAlive())
8229 {
8230 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8231 if (r_index >= 0)
8232 {
8233 InventoryLocation r_il = new InventoryLocation;
8234 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8235
8236 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8239 {
8240 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8241 }
8243 {
8244 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8245 }
8246
8247 }
8248
8249 player.RemoveQuickBarEntityShortcut(this);
8250 }
8251 }
8252 }
8253
8255 {
8256 super.EEKilled(killer);
8257
8260 {
8261 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8262 {
8263 if (IsMagazine())
8264 {
8265 if (Magazine.Cast(this).GetAmmoCount() > 0)
8266 {
8268 }
8269 }
8270 else
8271 {
8273 }
8274 }
8275 }
8276 }
8277
8279 {
8280 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8281
8282 super.OnWasAttached(parent, slot_id);
8283
8286
8288 }
8289
8291 {
8292 super.OnWasDetached(parent, slot_id);
8293
8296 }
8297
8299 {
8300 int idx;
8303
8304 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8305 if (inventory_slots.Count() < 1)
8306 {
8307 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8308 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8309 }
8310 else
8311 {
8312 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8313 }
8314
8315 idx = inventory_slots.Find(slot);
8316 if (idx < 0)
8317 return "";
8318
8319 return attach_types.Get(idx);
8320 }
8321
8323 {
8324 int idx = -1;
8325 string slot;
8326
8329
8330 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8331 if (inventory_slots.Count() < 1)
8332 {
8333 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8334 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8335 }
8336 else
8337 {
8338 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8339 if (detach_types.Count() < 1)
8340 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8341 }
8342
8343 for (int i = 0; i < inventory_slots.Count(); i++)
8344 {
8345 slot = inventory_slots.Get(i);
8346 }
8347
8348 if (slot != "")
8349 {
8350 if (detach_types.Count() == 1)
8351 idx = 0;
8352 else
8353 idx = inventory_slots.Find(slot);
8354 }
8355 if (idx < 0)
8356 return "";
8357
8358 return detach_types.Get(idx);
8359 }
8360
8362 {
8363
8365
8366
8367 float min_time = 1;
8368 float max_time = 3;
8369 float delay = Math.RandomFloat(min_time, max_time);
8370
8371 explode_timer.Run(delay, this, "DoAmmoExplosion");
8372 }
8373
8375 {
8376 Magazine magazine = Magazine.Cast(this);
8377 int pop_sounds_count = 6;
8378 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8379
8380
8381 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8382 string sound_name = pop_sounds[ sound_idx ];
8384
8385
8386 magazine.ServerAddAmmoCount(-1);
8387
8388
8389 float min_temp_to_explode = 100;
8390
8391 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
8392 {
8394 }
8395 }
8396
8397
8398 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8399 {
8400 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8401
8402 const int CHANCE_DAMAGE_CARGO = 4;
8403 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8404 const int CHANCE_DAMAGE_NOTHING = 2;
8405
8407 {
8408 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8409 int chances;
8410 int rnd;
8411
8412 if (GetInventory().GetCargo())
8413 {
8414 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8415 rnd = Math.RandomInt(0,chances);
8416
8417 if (rnd < CHANCE_DAMAGE_CARGO)
8418 {
8420 }
8421 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8422 {
8424 }
8425 }
8426 else
8427 {
8428 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8429 rnd = Math.RandomInt(0,chances);
8430
8431 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8432 {
8434 }
8435 }
8436 }
8437 }
8438
8440 {
8441 if (GetInventory().GetCargo())
8442 {
8443 int item_count = GetInventory().GetCargo().GetItemCount();
8444 if (item_count > 0)
8445 {
8446 int random_pick = Math.RandomInt(0, item_count);
8448 if (!item.IsExplosive())
8449 {
8450 item.AddHealth("","",damage);
8451 return true;
8452 }
8453 }
8454 }
8455 return false;
8456 }
8457
8459 {
8460 int attachment_count = GetInventory().AttachmentCount();
8461 if (attachment_count > 0)
8462 {
8463 int random_pick = Math.RandomInt(0, attachment_count);
8464 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8465 if (!attachment.IsExplosive())
8466 {
8467 attachment.AddHealth("","",damage);
8468 return true;
8469 }
8470 }
8471 return false;
8472 }
8473
8475 {
8477 }
8478
8480 {
8482 return GetInventory().CanRemoveEntity();
8483
8484 return false;
8485 }
8486
8488 {
8489
8491 return false;
8492
8493
8495 return false;
8496
8497
8498
8500 if (delta == 0)
8501 return false;
8502
8503
8504 return true;
8505 }
8506
8508 {
8510 {
8511 if (ScriptInputUserData.CanStoreInputUserData())
8512 {
8513 ScriptInputUserData ctx = new ScriptInputUserData;
8518 ctx.
Write(destination_entity);
8522 }
8523 }
8524 else if (!
GetGame().IsMultiplayer())
8525 {
8527 }
8528 }
8529
8531 {
8532 float split_quantity_new;
8536 InventoryLocation loc = new InventoryLocation;
8537
8538 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8539 {
8541 split_quantity_new = stack_max;
8542 else
8544
8546 {
8547 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8548 if (new_item)
8549 {
8550 new_item.SetResultOfSplit(true);
8551 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8553 new_item.
SetQuantity(split_quantity_new,
false,
true);
8554 }
8555 }
8556 }
8557 else if (destination_entity && slot_id == -1)
8558 {
8559 if (quantity > stack_max)
8560 split_quantity_new = stack_max;
8561 else
8562 split_quantity_new = quantity;
8563
8565 {
8567 {
8570 }
8571
8572 if (new_item)
8573 {
8574 new_item.SetResultOfSplit(true);
8575 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8577 new_item.
SetQuantity(split_quantity_new,
false,
true);
8578 }
8579 }
8580 }
8581 else
8582 {
8583 if (stack_max != 0)
8584 {
8586 {
8588 }
8589
8590 if (split_quantity_new == 0)
8591 {
8592 if (!
GetGame().IsMultiplayer())
8593 player.PhysicalPredictiveDropItem(this);
8594 else
8595 player.ServerDropEntity(this);
8596 return;
8597 }
8598
8600 {
8602
8603 if (new_item)
8604 {
8605 new_item.SetResultOfSplit(true);
8606 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8609 new_item.PlaceOnSurface();
8610 }
8611 }
8612 }
8613 }
8614 }
8615
8617 {
8618 float split_quantity_new;
8622 InventoryLocation loc = new InventoryLocation;
8623
8624 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8625 {
8627 split_quantity_new = stack_max;
8628 else
8630
8632 {
8633 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8634 if (new_item)
8635 {
8636 new_item.SetResultOfSplit(true);
8637 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8639 new_item.
SetQuantity(split_quantity_new,
false,
true);
8640 }
8641 }
8642 }
8643 else if (destination_entity && slot_id == -1)
8644 {
8645 if (quantity > stack_max)
8646 split_quantity_new = stack_max;
8647 else
8648 split_quantity_new = quantity;
8649
8651 {
8653 {
8656 }
8657
8658 if (new_item)
8659 {
8660 new_item.SetResultOfSplit(true);
8661 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8663 new_item.
SetQuantity(split_quantity_new,
false,
true);
8664 }
8665 }
8666 }
8667 else
8668 {
8669 if (stack_max != 0)
8670 {
8672 {
8674 }
8675
8677 {
8679
8680 if (new_item)
8681 {
8682 new_item.SetResultOfSplit(true);
8683 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8686 new_item.PlaceOnSurface();
8687 }
8688 }
8689 }
8690 }
8691 }
8692
8694 {
8696 {
8697 if (ScriptInputUserData.CanStoreInputUserData())
8698 {
8699 ScriptInputUserData ctx = new ScriptInputUserData;
8704 dst.WriteToContext(ctx);
8706 }
8707 }
8708 else if (!
GetGame().IsMultiplayer())
8709 {
8711 }
8712 }
8713
8715 {
8717 {
8718 if (ScriptInputUserData.CanStoreInputUserData())
8719 {
8720 ScriptInputUserData ctx = new ScriptInputUserData;
8725 ctx.
Write(destination_entity);
8731 }
8732 }
8733 else if (!
GetGame().IsMultiplayer())
8734 {
8736 }
8737 }
8738
8740 {
8742 }
8743
8745 {
8747 float split_quantity_new;
8749 if (dst.IsValid())
8750 {
8751 int slot_id = dst.GetSlot();
8753
8754 if (quantity > stack_max)
8755 split_quantity_new = stack_max;
8756 else
8757 split_quantity_new = quantity;
8758
8760 {
8762
8763 if (new_item)
8764 {
8765 new_item.SetResultOfSplit(true);
8766 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8768 new_item.
SetQuantity(split_quantity_new,
false,
true);
8769 }
8770
8771 return new_item;
8772 }
8773 }
8774
8775 return null;
8776 }
8777
8779 {
8781 float split_quantity_new;
8783 if (destination_entity)
8784 {
8786 if (quantity > stackable)
8787 split_quantity_new = stackable;
8788 else
8789 split_quantity_new = quantity;
8790
8792 {
8793 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8794 if (new_item)
8795 {
8796 new_item.SetResultOfSplit(true);
8797 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8799 new_item.
SetQuantity(split_quantity_new,
false,
true);
8800 }
8801 }
8802 }
8803 }
8804
8806 {
8808 {
8809 if (ScriptInputUserData.CanStoreInputUserData())
8810 {
8811 ScriptInputUserData ctx = new ScriptInputUserData;
8816 ItemBase destination_entity =
this;
8817 ctx.
Write(destination_entity);
8821 }
8822 }
8823 else if (!
GetGame().IsMultiplayer())
8824 {
8826 }
8827 }
8828
8830 {
8832 float split_quantity_new;
8834 if (player)
8835 {
8837 if (quantity > stackable)
8838 split_quantity_new = stackable;
8839 else
8840 split_quantity_new = quantity;
8841
8843 {
8844 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8845 new_item =
ItemBase.Cast(in_hands);
8846 if (new_item)
8847 {
8848 new_item.SetResultOfSplit(true);
8849 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8851 new_item.SetQuantity(split_quantity_new, false, true);
8852 }
8853 }
8854 }
8855 }
8856
8858 {
8860 float split_quantity_new = Math.Floor(quantity * 0.5);
8861
8863 return;
8864
8866
8867 if (new_item)
8868 {
8869 if (new_item.GetQuantityMax() < split_quantity_new)
8870 {
8871 split_quantity_new = new_item.GetQuantityMax();
8872 }
8873
8874 new_item.SetResultOfSplit(true);
8875 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8876
8878 {
8881 }
8882 else
8883 {
8885 new_item.
SetQuantity(split_quantity_new,
false,
true);
8886 }
8887 }
8888 }
8889
8891 {
8893 float split_quantity_new = Math.Floor(quantity / 2);
8894
8896 return;
8897
8898 InventoryLocation invloc = new InventoryLocation;
8900
8902 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8903
8904 if (new_item)
8905 {
8906 if (new_item.GetQuantityMax() < split_quantity_new)
8907 {
8908 split_quantity_new = new_item.GetQuantityMax();
8909 }
8911 {
8914 }
8915 else if (split_quantity_new > 1)
8916 {
8918 new_item.
SetQuantity(split_quantity_new,
false,
true);
8919 }
8920 }
8921 }
8922
8925 {
8926 SetWeightDirty();
8928
8929 if (parent)
8930 parent.OnAttachmentQuantityChangedEx(this, delta);
8931
8933 {
8935 {
8937 }
8939 {
8940 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8942 }
8943 }
8944
8945 }
8946
8949 {
8950
8951 }
8952
8955 {
8957 }
8958
8960 {
8961 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8962
8964 {
8965 if (newLevel == GameConstants.STATE_RUINED)
8966 {
8968 EntityAI parent = GetHierarchyParent();
8969 if (parent && parent.IsFireplace())
8970 {
8971 CargoBase cargo = GetInventory().GetCargo();
8972 if (cargo)
8973 {
8975 {
8977 }
8978 }
8979 }
8980 }
8981
8983 {
8984
8986 return;
8987 }
8988
8989 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8990 {
8992 }
8993 }
8994 }
8995
8996
8998 {
8999 super.OnRightClick();
9000
9002 {
9004 {
9005 if (ScriptInputUserData.CanStoreInputUserData())
9006 {
9007 EntityAI root = GetHierarchyRoot();
9008 Man playerOwner = GetHierarchyRootPlayer();
9009 InventoryLocation dst = new InventoryLocation;
9010
9011
9012 if (!playerOwner && root && root == this)
9013 {
9015 }
9016 else
9017 {
9018
9019 GetInventory().GetCurrentInventoryLocation(dst);
9021 {
9024 {
9026 }
9027 else
9028 {
9030
9031
9032 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9033 {
9035 }
9036 else
9037 {
9038 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9039 }
9040 }
9041 }
9042 }
9043
9044 ScriptInputUserData ctx = new ScriptInputUserData;
9052 }
9053 }
9054 else if (!
GetGame().IsMultiplayer())
9055 {
9057 }
9058 }
9059 }
9060
9062 {
9063 if (root)
9064 {
9065 vector m4[4];
9066 root.GetTransform(m4);
9067 dst.SetGround(this, m4);
9068 }
9069 else
9070 {
9071 GetInventory().GetCurrentInventoryLocation(dst);
9072 }
9073 }
9074
9075 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9076 {
9077
9078 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9079 return false;
9080
9081 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9082 return false;
9083
9084
9086 return false;
9087
9088
9089 Magazine mag = Magazine.Cast(this);
9090 if (mag)
9091 {
9092 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9093 return false;
9094
9095 if (stack_max_limit)
9096 {
9097 Magazine other_mag = Magazine.Cast(other_item);
9098 if (other_item)
9099 {
9100 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9101 return false;
9102 }
9103
9104 }
9105 }
9106 else
9107 {
9108
9110 return false;
9111
9113 return false;
9114 }
9115
9116 PlayerBase player = null;
9117 if (CastTo(player, GetHierarchyRootPlayer()))
9118 {
9119 if (player.GetInventory().HasAttachment(this))
9120 return false;
9121
9122 if (player.IsItemsToDelete())
9123 return false;
9124 }
9125
9126 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9127 return false;
9128
9129 int slotID;
9131 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9132 return false;
9133
9134 return true;
9135 }
9136
9138 {
9140 }
9141
9143 {
9144 return m_IsResultOfSplit;
9145 }
9146
9148 {
9149 m_IsResultOfSplit = value;
9150 }
9151
9153 {
9155 }
9156
9158 {
9159 float other_item_quantity = other_item.GetQuantity();
9160 float this_free_space;
9161
9163
9165
9166 if (other_item_quantity > this_free_space)
9167 {
9168 return this_free_space;
9169 }
9170 else
9171 {
9172 return other_item_quantity;
9173 }
9174 }
9175
9177 {
9179 }
9180
9182 {
9184 return;
9185
9186 if (!IsMagazine() && other_item)
9187 {
9189 if (quantity_used != 0)
9190 {
9191 float hp1 = GetHealth01("","");
9192 float hp2 = other_item.GetHealth01("","");
9193 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9194 hpResult = hpResult / (
GetQuantity() + quantity_used);
9195
9196 hpResult *= GetMaxHealth();
9197 Math.Round(hpResult);
9198 SetHealth("", "Health", hpResult);
9199
9201 other_item.AddQuantity(-quantity_used);
9202 }
9203 }
9205 }
9206
9208 {
9209 #ifdef SERVER
9210 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9211 GetHierarchyParent().IncreaseLifetimeUp();
9212 #endif
9213 };
9214
9216 {
9217 PlayerBase p = PlayerBase.Cast(player);
9218
9219 array<int> recipesIds = p.m_Recipes;
9220 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9221 if (moduleRecipesManager)
9222 {
9223 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9224 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9225 }
9226
9227 for (int i = 0;i < recipesIds.Count(); i++)
9228 {
9229 int key = recipesIds.Get(i);
9230 string recipeName = moduleRecipesManager.GetRecipeName(key);
9232 }
9233 }
9234
9235
9236 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9237 {
9238 super.GetDebugActions(outputList);
9239
9240
9246
9247
9252
9257
9258
9262
9263
9265 {
9269 }
9270
9273
9274
9278
9280
9281 InventoryLocation loc = new InventoryLocation();
9282 GetInventory().GetCurrentInventoryLocation(loc);
9284 {
9285 if (Gizmo_IsSupported())
9288 }
9289
9291 }
9292
9293
9294
9295
9297 {
9298 super.OnAction(action_id, player, ctx);
9299
9301 {
9302 switch (action_id)
9303 {
9306 return true;
9309 return true;
9310 }
9311 }
9312
9314 {
9315 switch (action_id)
9316 {
9318 Delete();
9319 return true;
9320 }
9321 }
9322
9323 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9324 {
9325 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9326 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9327 PlayerBase p = PlayerBase.Cast(player);
9328 if (
EActions.RECIPES_RANGE_START < 1000)
9329 {
9330 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9331 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9332 }
9333 }
9334 #ifndef SERVER
9335 else if (action_id ==
EActions.WATCH_PLAYER)
9336 {
9337 PluginDeveloper.SetDeveloperItemClientEx(player);
9338 }
9339 #endif
9341 {
9342 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9343 {
9344 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9345 OnDebugButtonPressServer(id + 1);
9346 }
9347
9348 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9349 {
9350 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9352 }
9353
9354 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9355 {
9356 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9358 }
9359
9360 else if (action_id ==
EActions.ADD_QUANTITY)
9361 {
9362 if (IsMagazine())
9363 {
9364 Magazine mag = Magazine.Cast(this);
9365 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9366 }
9367 else
9368 {
9370 }
9371
9372 if (m_EM)
9373 {
9374 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9375 }
9376
9377 }
9378
9379 else if (action_id ==
EActions.REMOVE_QUANTITY)
9380 {
9381 if (IsMagazine())
9382 {
9383 Magazine mag2 = Magazine.Cast(this);
9384 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9385 }
9386 else
9387 {
9389 }
9390 if (m_EM)
9391 {
9392 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9393 }
9394
9395 }
9396
9397 else if (action_id ==
EActions.SET_QUANTITY_0)
9398 {
9400
9401 if (m_EM)
9402 {
9403 m_EM.SetEnergy(0);
9404 }
9405 }
9406
9407 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9408 {
9410
9411 if (m_EM)
9412 {
9413 m_EM.SetEnergy(m_EM.GetEnergyMax());
9414 }
9415 }
9416
9417 else if (action_id ==
EActions.ADD_HEALTH)
9418 {
9419 AddHealth("","",GetMaxHealth("","Health")/5);
9420 }
9421 else if (action_id ==
EActions.REMOVE_HEALTH)
9422 {
9423 AddHealth("","",-GetMaxHealth("","Health")/5);
9424 }
9425 else if (action_id ==
EActions.DESTROY_HEALTH)
9426 {
9427 SetHealth01("","",0);
9428 }
9429 else if (action_id ==
EActions.WATCH_ITEM)
9430 {
9432 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9433 #ifdef DEVELOPER
9434 SetDebugDeveloper_item(this);
9435 #endif
9436 }
9437
9438 else if (action_id ==
EActions.ADD_TEMPERATURE)
9439 {
9440 AddTemperature(20);
9441
9442 }
9443
9444 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9445 {
9446 AddTemperature(-20);
9447
9448 }
9449
9450 else if (action_id ==
EActions.FLIP_FROZEN)
9451 {
9452 SetFrozen(!GetIsFrozen());
9453
9454 }
9455
9456 else if (action_id ==
EActions.ADD_WETNESS)
9457 {
9459
9460 }
9461
9462 else if (action_id ==
EActions.REMOVE_WETNESS)
9463 {
9465
9466 }
9467
9468 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9469 {
9472
9473
9474 }
9475
9476 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9477 {
9480 }
9481
9482 else if (action_id ==
EActions.MAKE_SPECIAL)
9483 {
9484 auto debugParams = DebugSpawnParams.WithPlayer(player);
9485 OnDebugSpawnEx(debugParams);
9486 }
9487
9488 }
9489
9490
9491 return false;
9492 }
9493
9494
9495
9496
9500
9503
9504
9505
9507 {
9508 return false;
9509 }
9510
9511
9513 {
9514 return true;
9515 }
9516
9517
9519 {
9520 return true;
9521 }
9522
9523
9524
9526 {
9527 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9529 }
9530
9533 {
9534 return null;
9535 }
9536
9538 {
9539 return false;
9540 }
9541
9543 {
9544 return false;
9545 }
9546
9550
9551
9553 {
9554 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9555 return module_repairing.CanRepair(this, item_repair_kit);
9556 }
9557
9558
9559 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9560 {
9561 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9562 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9563 }
9564
9565
9567 {
9568
9569
9570
9571
9572
9573
9574
9575
9576 return 1;
9577 }
9578
9579
9580
9582 {
9584 }
9585
9586
9587
9589 {
9591 }
9592
9593
9602 {
9603 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9604
9605 if (player)
9606 {
9607 player.MessageStatus(text);
9608 }
9609 }
9610
9611
9620 {
9621 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9622
9623 if (player)
9624 {
9625 player.MessageAction(text);
9626 }
9627 }
9628
9629
9638 {
9639 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9640
9641 if (player)
9642 {
9643 player.MessageFriendly(text);
9644 }
9645 }
9646
9647
9656 {
9657 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9658
9659 if (player)
9660 {
9661 player.MessageImportant(text);
9662 }
9663 }
9664
9666 {
9667 return true;
9668 }
9669
9670
9671 override bool KindOf(
string tag)
9672 {
9673 bool found = false;
9674 string item_name = this.
GetType();
9677
9678 int array_size = item_tag_array.Count();
9679 for (int i = 0; i < array_size; i++)
9680 {
9681 if (item_tag_array.Get(i) == tag)
9682 {
9683 found = true;
9684 break;
9685 }
9686 }
9687 return found;
9688 }
9689
9690
9692 {
9693
9694 super.OnRPC(sender, rpc_type,ctx);
9695
9696
9697 switch (rpc_type)
9698 {
9699 #ifndef SERVER
9700 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9701 Param2<bool, string> p = new Param2<bool, string>(false, "");
9702
9704 return;
9705
9706 bool play = p.param1;
9707 string soundSet = p.param2;
9708
9709 if (play)
9710 {
9712 {
9714 {
9716 }
9717 }
9718 else
9719 {
9721 }
9722 }
9723 else
9724 {
9726 }
9727
9728 break;
9729 #endif
9730
9731 }
9732
9734 {
9736 }
9737 }
9738
9739
9740
9741
9743 {
9744 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9745 return plugin.GetID(
name);
9746 }
9747
9749 {
9750 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9751 return plugin.GetName(id);
9752 }
9753
9756 {
9757
9758
9759 int varFlags;
9760 if (!ctx.
Read(varFlags))
9761 return;
9762
9763 if (varFlags & ItemVariableFlags.FLOAT)
9764 {
9766 }
9767 }
9768
9770 {
9771
9772 super.SerializeNumericalVars(floats_out);
9773
9774
9775
9777 {
9779 }
9780
9782 {
9784 }
9785
9787 {
9789 }
9790
9792 {
9797 }
9798
9800 {
9802 }
9803 }
9804
9806 {
9807
9808 super.DeSerializeNumericalVars(floats);
9809
9810
9811 int index = 0;
9812 int mask = Math.Round(floats.Get(index));
9813
9814 index++;
9815
9817 {
9819 {
9821 }
9822 else
9823 {
9824 float quantity = floats.Get(index);
9826 }
9827 index++;
9828 }
9829
9831 {
9832 float wet = floats.Get(index);
9834 index++;
9835 }
9836
9838 {
9839 int liquidtype = Math.Round(floats.Get(index));
9841 index++;
9842 }
9843
9845 {
9847 index++;
9849 index++;
9851 index++;
9853 index++;
9854 }
9855
9857 {
9858 int cleanness = Math.Round(floats.Get(index));
9860 index++;
9861 }
9862 }
9863
9865 {
9866 super.WriteVarsToCTX(ctx);
9867
9868
9870 {
9872 }
9873
9875 {
9877 }
9878
9880 {
9882 }
9883
9885 {
9886 int r,g,b,a;
9892 }
9893
9895 {
9897 }
9898 }
9899
9901 {
9902 if (!super.ReadVarsFromCTX(ctx,version))
9903 return false;
9904
9905 int intValue;
9906 float value;
9907
9908 if (version < 140)
9909 {
9910 if (!ctx.
Read(intValue))
9911 return false;
9912
9913 m_VariablesMask = intValue;
9914 }
9915
9917 {
9918 if (!ctx.
Read(value))
9919 return false;
9920
9922 {
9924 }
9925 else
9926 {
9928 }
9929 }
9930
9931 if (version < 140)
9932 {
9934 {
9935 if (!ctx.
Read(value))
9936 return false;
9937 SetTemperatureDirect(value);
9938 }
9939 }
9940
9942 {
9943 if (!ctx.
Read(value))
9944 return false;
9946 }
9947
9949 {
9950 if (!ctx.
Read(intValue))
9951 return false;
9953 }
9954
9956 {
9957 int r,g,b,a;
9959 return false;
9961 return false;
9963 return false;
9965 return false;
9966
9968 }
9969
9971 {
9972 if (!ctx.
Read(intValue))
9973 return false;
9975 }
9976
9977 if (version >= 138 && version < 140)
9978 {
9980 {
9981 if (!ctx.
Read(intValue))
9982 return false;
9983 SetFrozen(intValue);
9984 }
9985 }
9986
9987 return true;
9988 }
9989
9990
9992 {
9995 {
9997 }
9998
9999 if (!super.OnStoreLoad(ctx, version))
10000 {
10002 return false;
10003 }
10004
10005 if (version >= 114)
10006 {
10007 bool hasQuickBarIndexSaved;
10008
10009 if (!ctx.
Read(hasQuickBarIndexSaved))
10010 {
10012 return false;
10013 }
10014
10015 if (hasQuickBarIndexSaved)
10016 {
10017 int itmQBIndex;
10018
10019
10020 if (!ctx.
Read(itmQBIndex))
10021 {
10023 return false;
10024 }
10025
10026 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10027 if (itmQBIndex != -1 && parentPlayer)
10028 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10029 }
10030 }
10031 else
10032 {
10033
10034 PlayerBase player;
10035 int itemQBIndex;
10036 if (version ==
int.
MAX)
10037 {
10038 if (!ctx.
Read(itemQBIndex))
10039 {
10041 return false;
10042 }
10043 }
10044 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10045 {
10046
10047 if (!ctx.
Read(itemQBIndex))
10048 {
10050 return false;
10051 }
10052 if (itemQBIndex != -1 && player)
10053 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10054 }
10055 }
10056
10057 if (version < 140)
10058 {
10059
10060 if (!LoadVariables(ctx, version))
10061 {
10063 return false;
10064 }
10065 }
10066
10067
10069 {
10071 return false;
10072 }
10073 if (version >= 132)
10074 {
10076 if (raib)
10077 {
10079 {
10081 return false;
10082 }
10083 }
10084 }
10085
10087 return true;
10088 }
10089
10090
10091
10093 {
10094 super.OnStoreSave(ctx);
10095
10096 PlayerBase player;
10097 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10098 {
10100
10101 int itemQBIndex = -1;
10102 itemQBIndex = player.FindQuickBarEntityIndex(this);
10103 ctx.
Write(itemQBIndex);
10104 }
10105 else
10106 {
10108 }
10109
10111
10113 if (raib)
10114 {
10116 }
10117 }
10118
10119
10121 {
10122 super.AfterStoreLoad();
10123
10125 {
10127 }
10128
10130 {
10133 }
10134 }
10135
10137 {
10138 super.EEOnAfterLoad();
10139
10141 {
10143 }
10144
10147 }
10148
10150 {
10151 return false;
10152 }
10153
10154
10155
10157 {
10159 {
10160 #ifdef PLATFORM_CONSOLE
10161
10163 {
10165 if (menu)
10166 {
10168 }
10169 }
10170 #endif
10171 }
10172
10174 {
10177 }
10178
10180 {
10181 SetWeightDirty();
10183 }
10185 {
10188 }
10189
10191 {
10194 }
10196 {
10199 }
10200
10201 super.OnVariablesSynchronized();
10202 }
10203
10204
10205
10207 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10208 {
10209 if (!IsServerCheck(allow_client))
10210 return false;
10211
10213 return false;
10214
10217
10218 if (value <= (min + 0.001))
10219 value = min;
10220
10221 if (value == min)
10222 {
10223 if (destroy_config)
10224 {
10225 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10226 if (dstr)
10227 {
10229 this.Delete();
10230 return true;
10231 }
10232 }
10233 else if (destroy_forced)
10234 {
10236 this.Delete();
10237 return true;
10238 }
10239
10241 }
10242
10245
10247 {
10249
10250 if (delta)
10252 }
10253
10255
10256 return false;
10257 }
10258
10259
10261 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10262 {
10264 }
10265
10267 {
10270 }
10271
10273 {
10276 }
10277
10279 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10280 {
10281 float value_clamped = Math.Clamp(value, 0, 1);
10283 SetQuantity(result, destroy_config, destroy_forced);
10284 }
10285
10286
10289 {
10291 }
10292
10294 {
10296 }
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10308 {
10309 int slot = -1;
10310 if (GetInventory())
10311 {
10312 InventoryLocation il = new InventoryLocation;
10313 GetInventory().GetCurrentInventoryLocation(il);
10315 }
10316
10318 }
10319
10321 {
10322 float quantity_max = 0;
10323
10325 {
10326 if (attSlotID != -1)
10327 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10328
10329 if (quantity_max <= 0)
10331 }
10332
10333 if (quantity_max <= 0)
10335
10336 return quantity_max;
10337 }
10338
10340 {
10342 }
10343
10345 {
10347 }
10348
10349
10351 {
10353 }
10354
10356 {
10358 }
10359
10361 {
10363 }
10364
10365
10367 {
10368
10369 float weightEx = GetWeightEx();
10370 float special = GetInventoryAndCargoWeight();
10371 return weightEx - special;
10372 }
10373
10374
10376 {
10378 }
10379
10381 {
10383 {
10384 #ifdef DEVELOPER
10385 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10386 {
10387 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10389 }
10390 #endif
10391
10392 return GetQuantity() * GetConfigWeightModified();
10393 }
10394 else if (HasEnergyManager())
10395 {
10396 #ifdef DEVELOPER
10397 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10398 {
10399 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10400 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10401 }
10402 #endif
10403 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
10404 }
10405 else
10406 {
10407 #ifdef DEVELOPER
10408 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10409 {
10410 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10411 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10412 }
10413 #endif
10414 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
10415 }
10416 }
10417
10420 {
10421 int item_count = 0;
10423
10424 if (GetInventory().GetCargo() != NULL)
10425 {
10426 item_count = GetInventory().GetCargo().GetItemCount();
10427 }
10428
10429 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10430 {
10431 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10432 if (item)
10433 item_count += item.GetNumberOfItems();
10434 }
10435 return item_count;
10436 }
10437
10440 {
10441 float weight = 0;
10442 float wetness = 1;
10443 if (include_wetness)
10446 {
10447 weight = wetness * m_ConfigWeight;
10448 }
10450 {
10451 weight = 1;
10452 }
10453 return weight;
10454 }
10455
10456
10457
10459 {
10460 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10461 {
10462 GameInventory inv = GetInventory();
10463 array<EntityAI> items = new array<EntityAI>;
10465 for (int i = 0; i < items.Count(); i++)
10466 {
10468 if (item)
10469 {
10471 }
10472 }
10473 }
10474 }
10475
10476
10477
10478
10480 {
10481 float energy = 0;
10482 if (HasEnergyManager())
10483 {
10484 energy = GetCompEM().GetEnergy();
10485 }
10486 return energy;
10487 }
10488
10489
10491 {
10492 super.OnEnergyConsumed();
10493
10495 }
10496
10498 {
10499 super.OnEnergyAdded();
10500
10502 }
10503
10504
10506 {
10507 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10508 {
10510 {
10511 float energy_0to1 = GetCompEM().GetEnergy0To1();
10513 }
10514 }
10515 }
10516
10517
10519 {
10520 return ConfigGetFloat("heatIsolation");
10521 }
10522
10524 {
10526 }
10527
10529 {
10530 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10531 if (
GetGame().ConfigIsExisting(paramPath))
10533
10534 return 0.0;
10535 }
10536
10538 {
10539 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10540 if (
GetGame().ConfigIsExisting(paramPath))
10542
10543 return 0.0;
10544 }
10545
10546 override void SetWet(
float value,
bool allow_client =
false)
10547 {
10548 if (!IsServerCheck(allow_client))
10549 return;
10550
10553
10555
10556 m_VarWet = Math.Clamp(value, min, max);
10557
10559 {
10562 }
10563 }
10564
10565 override void AddWet(
float value)
10566 {
10568 }
10569
10571 {
10573 }
10574
10576 {
10578 }
10579
10581 {
10583 }
10584
10586 {
10588 }
10589
10591 {
10593 }
10594
10595 override void OnWetChanged(
float newVal,
float oldVal)
10596 {
10599 if (newLevel != oldLevel)
10600 {
10602 }
10603 }
10604
10606 {
10607 SetWeightDirty();
10608 }
10609
10611 {
10612 return GetWetLevelInternal(
m_VarWet);
10613 }
10614
10615
10616
10618 {
10620 }
10621
10623 {
10625 }
10626
10628 {
10630 }
10631
10633 {
10635 }
10636
10637
10638
10640 {
10641 if (ConfigIsExisting("itemModelLength"))
10642 {
10643 return ConfigGetFloat("itemModelLength");
10644 }
10645 return 0;
10646 }
10647
10649 {
10650 if (ConfigIsExisting("itemAttachOffset"))
10651 {
10652 return ConfigGetFloat("itemAttachOffset");
10653 }
10654 return 0;
10655 }
10656
10657 override void SetCleanness(
int value,
bool allow_client =
false)
10658 {
10659 if (!IsServerCheck(allow_client))
10660 return;
10661
10663
10665
10668 }
10669
10671 {
10673 }
10674
10676 {
10677 return true;
10678 }
10679
10680
10681
10682
10684 {
10686 }
10687
10689 {
10691 }
10692
10693
10694
10695
10696 override void SetColor(
int r,
int g,
int b,
int a)
10697 {
10703 }
10705 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10706 {
10711 }
10712
10714 {
10716 }
10717
10720 {
10721 int r,g,b,a;
10723 r = r/255;
10724 g = g/255;
10725 b = b/255;
10726 a = a/255;
10727 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10728 }
10729
10730
10731
10732 override void SetLiquidType(
int value,
bool allow_client =
false)
10733 {
10734 if (!IsServerCheck(allow_client))
10735 return;
10736
10741 }
10742
10744 {
10745 return ConfigGetInt("varLiquidTypeInit");
10746 }
10747
10749 {
10751 }
10752
10754 {
10756 SetFrozen(false);
10757 }
10758
10761 {
10762 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10763 }
10764
10765
10768 {
10769 PlayerBase nplayer;
10770 if (PlayerBase.CastTo(nplayer, player))
10771 {
10773
10774 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10775 }
10776 }
10777
10778
10781 {
10782 PlayerBase nplayer;
10783 if (PlayerBase.CastTo(nplayer,player))
10784 {
10785
10786 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10787
10788 }
10789
10790
10791 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10792
10793
10794 if (HasEnergyManager())
10795 {
10796 GetCompEM().UpdatePlugState();
10797 }
10798 }
10799
10800
10802 {
10803 super.OnPlacementStarted(player);
10804
10806 }
10807
10808 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10809 {
10811 {
10812 m_AdminLog.OnPlacementComplete(player,
this);
10813 }
10814
10815 super.OnPlacementComplete(player, position, orientation);
10816 }
10817
10818
10819
10820
10821
10823 {
10825 {
10826 return true;
10827 }
10828 else
10829 {
10830 return false;
10831 }
10832 }
10833
10834
10836 {
10838 {
10840 }
10841 }
10842
10843
10845 {
10847 }
10848
10850 {
10852 }
10853
10854 override void InsertAgent(
int agent,
float count = 1)
10855 {
10856 if (count < 1)
10857 return;
10858
10860 }
10861
10864 {
10866 }
10867
10868
10870 {
10872 }
10873
10874
10875
10876
10877
10878
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
10916 {
10918 return false;
10919 return true;
10920 }
10921
10923 {
10924
10926 }
10927
10928
10931 {
10932 super.CheckForRoofLimited(timeTresholdMS);
10933
10935 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10936 {
10937 m_PreviousRoofTestTime = time;
10938 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10939 }
10940 }
10941
10942
10944 {
10946 {
10947 return 0;
10948 }
10949
10950 if (GetInventory().GetAttachmentSlotsCount() != 0)
10951 {
10952 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10953 if (filter)
10954 return filter.GetProtectionLevel(type, false, system);
10955 else
10956 return 0;
10957 }
10958
10959 string subclassPath, entryName;
10960
10961 switch (type)
10962 {
10964 entryName = "biological";
10965 break;
10967 entryName = "chemical";
10968 break;
10969 default:
10970 entryName = "biological";
10971 break;
10972 }
10973
10974 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10975
10977 }
10978
10979
10980
10983 {
10984 if (!IsMagazine())
10986
10988 }
10989
10990
10991
10992
10993
10998 {
10999 return true;
11000 }
11001
11003 {
11005 }
11006
11007
11008
11009
11010
11012 {
11013 if (parent)
11014 {
11015 if (parent.IsInherited(DayZInfected))
11016 return true;
11017
11018 if (!parent.IsRuined())
11019 return true;
11020 }
11021
11022 return true;
11023 }
11024
11026 {
11027 if (!super.CanPutAsAttachment(parent))
11028 {
11029 return false;
11030 }
11031
11032 if (!IsRuined() && !parent.IsRuined())
11033 {
11034 return true;
11035 }
11036
11037 return false;
11038 }
11039
11041 {
11042
11043
11044
11045
11046 return super.CanReceiveItemIntoCargo(item);
11047 }
11048
11050 {
11051
11052
11053
11054
11055 GameInventory attachmentInv = attachment.GetInventory();
11057 {
11058 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11059 return false;
11060 }
11061
11062 InventoryLocation loc = new InventoryLocation();
11063 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11064 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11065 return false;
11066
11067 return super.CanReceiveAttachment(attachment, slotId);
11068 }
11069
11071 {
11072 if (!super.CanReleaseAttachment(attachment))
11073 return false;
11074
11075 return GetInventory().AreChildrenAccessible();
11076 }
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11099 {
11100 int id = muzzle_owner.GetMuzzleID();
11101 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11102
11103 if (WPOF_array)
11104 {
11105 for (int i = 0; i < WPOF_array.Count(); i++)
11106 {
11107 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11108
11109 if (WPOF)
11110 {
11111 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11112 }
11113 }
11114 }
11115 }
11116
11117
11119 {
11120 int id = muzzle_owner.GetMuzzleID();
11122
11123 if (WPOBE_array)
11124 {
11125 for (int i = 0; i < WPOBE_array.Count(); i++)
11126 {
11127 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11128
11129 if (WPOBE)
11130 {
11131 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11132 }
11133 }
11134 }
11135 }
11136
11137
11139 {
11140 int id = muzzle_owner.GetMuzzleID();
11141 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11142
11143 if (WPOOH_array)
11144 {
11145 for (int i = 0; i < WPOOH_array.Count(); i++)
11146 {
11147 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11148
11149 if (WPOOH)
11150 {
11151 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11152 }
11153 }
11154 }
11155 }
11156
11157
11159 {
11160 int id = muzzle_owner.GetMuzzleID();
11161 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11162
11163 if (WPOOH_array)
11164 {
11165 for (int i = 0; i < WPOOH_array.Count(); i++)
11166 {
11167 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11168
11169 if (WPOOH)
11170 {
11171 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11172 }
11173 }
11174 }
11175 }
11176
11177
11179 {
11180 int id = muzzle_owner.GetMuzzleID();
11181 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11182
11183 if (WPOOH_array)
11184 {
11185 for (int i = 0; i < WPOOH_array.Count(); i++)
11186 {
11187 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11188
11189 if (WPOOH)
11190 {
11191 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11192 }
11193 }
11194 }
11195 }
11196
11197
11198
11200 {
11202 {
11203 return true;
11204 }
11205
11206 return false;
11207 }
11208
11210 {
11212 {
11213 return true;
11214 }
11215
11216 return false;
11217 }
11218
11220 {
11222 {
11223 return true;
11224 }
11225
11226 return false;
11227 }
11228
11230 {
11231 return false;
11232 }
11233
11236 {
11237 return UATimeSpent.DEFAULT_DEPLOY;
11238 }
11239
11240
11241
11242
11244 {
11246 SetSynchDirty();
11247 }
11248
11250 {
11252 }
11253
11254
11256 {
11257 return false;
11258 }
11259
11262 {
11263 string att_type = "None";
11264
11265 if (ConfigIsExisting("soundAttType"))
11266 {
11267 att_type = ConfigGetString("soundAttType");
11268 }
11269
11271 }
11272
11274 {
11276 }
11277
11278
11279
11280
11281
11287
11289 {
11292
11294 }
11295
11296
11298 {
11300 return;
11301
11303
11306
11309
11310 SoundParameters params = new SoundParameters();
11314 }
11315
11316
11318 {
11320 return;
11321
11323 SetSynchDirty();
11324
11327 }
11328
11329
11331 {
11333 return;
11334
11336 SetSynchDirty();
11337
11340 }
11341
11343 {
11345 }
11346
11348 {
11350 }
11351
11354 {
11355 if (!
GetGame().IsDedicatedServer())
11356 {
11357 if (ConfigIsExisting("attachSoundSet"))
11358 {
11359 string cfg_path = "";
11360 string soundset = "";
11361 string type_name =
GetType();
11362
11365 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11366 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11367
11368 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11369 {
11370 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11371 {
11372 if (cfg_slot_array[i] == slot_type)
11373 {
11374 soundset = cfg_soundset_array[i];
11375 break;
11376 }
11377 }
11378 }
11379
11380 if (soundset != "")
11381 {
11382 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11384 }
11385 }
11386 }
11387 }
11388
11390 {
11391
11392 }
11393
11394 void OnApply(PlayerBase player);
11395
11397 {
11398 return 1.0;
11399 };
11400
11402 {
11404 }
11405
11407 {
11409 }
11410
11412
11414 {
11415 SetDynamicPhysicsLifeTime(0.01);
11417 }
11418
11420 {
11421 array<string> zone_names = new array<string>;
11422 GetDamageZones(zone_names);
11423 for (int i = 0; i < zone_names.Count(); i++)
11424 {
11425 SetHealthMax(zone_names.Get(i),"Health");
11426 }
11427 SetHealthMax("","Health");
11428 }
11429
11432 {
11433 float global_health = GetHealth01("","Health");
11434 array<string> zones = new array<string>;
11435 GetDamageZones(zones);
11436
11437 for (int i = 0; i < zones.Count(); i++)
11438 {
11439 SetHealth01(zones.Get(i),"Health",global_health);
11440 }
11441 }
11442
11445 {
11446 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11447 }
11448
11450 {
11451 if (!hasRootAsPlayer)
11452 {
11453 if (refParentIB)
11454 {
11455
11456 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11457 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11458
11459 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11460 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11461
11464 }
11465 else
11466 {
11467
11470 }
11471 }
11472 }
11473
11475 {
11477 {
11478 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11479 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
11480 {
11481 float heatPermCoef = 1.0;
11483 while (ent)
11484 {
11485 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11486 ent = ent.GetHierarchyParent();
11487 }
11488
11489 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11490 }
11491 }
11492 }
11493
11495 {
11496
11497 EntityAI parent = GetHierarchyParent();
11498 if (!parent)
11499 {
11500 hasParent = false;
11501 hasRootAsPlayer = false;
11502 }
11503 else
11504 {
11505 hasParent = true;
11506 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11507 refParentIB =
ItemBase.Cast(parent);
11508 }
11509 }
11510
11511 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11512 {
11513
11514 }
11515
11517 {
11518
11519 return false;
11520 }
11521
11523 {
11524
11525
11526 return false;
11527 }
11528
11530 {
11531
11532 return false;
11533 }
11534
11537 {
11538 return !GetIsFrozen() &&
IsOpen();
11539 }
11540
11542 {
11543 bool hasParent = false, hasRootAsPlayer = false;
11545
11546 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11547 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11548
11549 if (wwtu || foodDecay)
11550 {
11554
11555 if (processWetness || processTemperature || processDecay)
11556 {
11558
11559 if (processWetness)
11560 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11561
11562 if (processTemperature)
11564
11565 if (processDecay)
11566 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11567 }
11568 }
11569 }
11570
11573 {
11575 }
11576
11578 {
11581
11582 return super.GetTemperatureFreezeThreshold();
11583 }
11584
11586 {
11589
11590 return super.GetTemperatureThawThreshold();
11591 }
11592
11594 {
11597
11598 return super.GetItemOverheatThreshold();
11599 }
11600
11602 {
11604 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11605
11606 return super.GetTemperatureFreezeTime();
11607 }
11608
11610 {
11612 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11613
11614 return super.GetTemperatureThawTime();
11615 }
11616
11621
11623 {
11624 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11625 }
11626
11628 {
11629 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11630 }
11631
11634 {
11636 }
11637
11639 {
11641 }
11642
11644 {
11646 }
11647
11650 {
11651 return null;
11652 }
11653
11656 {
11657 return false;
11658 }
11659
11661 {
11663 {
11666 if (!trg)
11667 {
11669 explosive = this;
11670 }
11671
11672 explosive.PairRemote(trg);
11674
11675 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11676 trg.SetPersistentPairID(persistentID);
11677 explosive.SetPersistentPairID(persistentID);
11678
11679 return true;
11680 }
11681 return false;
11682 }
11683
11686 {
11687 float ret = 1.0;
11690 ret *= GetHealth01();
11691
11692 return ret;
11693 }
11694
11695 #ifdef DEVELOPER
11696 override void SetDebugItem()
11697 {
11698 super.SetDebugItem();
11699 _itemBase = this;
11700 }
11701
11703 {
11704 string text = super.GetDebugText();
11705
11707 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11708
11709 return text;
11710 }
11711 #endif
11712
11714 {
11715 return true;
11716 }
11717
11719
11721
11723 {
11726 }
11727
11728
11736
11752}
11753
11755{
11757 if (entity)
11758 {
11759 bool is_item = entity.IsInherited(
ItemBase);
11760 if (is_item && full_quantity)
11761 {
11764 }
11765 }
11766 else
11767 {
11769 return NULL;
11770 }
11771 return entity;
11772}
11773
11775{
11776 if (item)
11777 {
11778 if (health > 0)
11779 item.SetHealth("", "", health);
11780
11781 if (item.CanHaveTemperature())
11782 {
11784 if (item.CanFreeze())
11785 item.SetFrozen(false);
11786 }
11787
11788 if (item.HasEnergyManager())
11789 {
11790 if (quantity >= 0)
11791 {
11792 item.GetCompEM().SetEnergy0To1(quantity);
11793 }
11794 else
11795 {
11797 }
11798 }
11799 else if (item.IsMagazine())
11800 {
11801 Magazine mag = Magazine.Cast(item);
11802 if (quantity >= 0)
11803 {
11804 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11805 }
11806 else
11807 {
11809 }
11810
11811 }
11812 else
11813 {
11814 if (quantity >= 0)
11815 {
11816 item.SetQuantityNormalized(quantity, false);
11817 }
11818 else
11819 {
11821 }
11822
11823 }
11824 }
11825}
11826
11827#ifdef DEVELOPER
11829#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.