6914{
6916 {
6917 return true;
6918 }
6919};
6920
6921
6922
6924{
6928
6930
6933
6934
6935
6936
6937
6946
6952
6957
6962
6983 protected bool m_IsResultOfSplit
6984
6986
6991
6992
6993
6995
6999
7000
7001
7003
7006
7007
7008
7014
7015
7023
7026
7027
7029
7030
7032
7033
7038
7039
7044
7045
7047
7048
7050 {
7055
7056 if (!
GetGame().IsDedicatedServer())
7057 {
7059 {
7061
7063 {
7065 }
7066 }
7067
7070 }
7071
7072 m_OldLocation = null;
7073
7075 {
7077 }
7078
7079 if (ConfigIsExisting("headSelectionsToHide"))
7080 {
7083 }
7084
7086 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7087 {
7089 }
7090
7092
7093 m_IsResultOfSplit = false;
7094
7096 }
7097
7099 {
7100 super.InitItemVariables();
7101
7107 m_Count = ConfigGetInt(
"count");
7108
7111
7116
7119
7124
7136
7140
7141
7144 if (ConfigIsExisting("canBeSplit"))
7145 {
7148 }
7149
7151 if (ConfigIsExisting("itemBehaviour"))
7153
7154
7157 RegisterNetSyncVariableInt("m_VarLiquidType");
7158 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7159
7160 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7161 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7162 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7163
7164 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7165 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7166 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7167 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7168
7169 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7170 RegisterNetSyncVariableBool("m_IsTakeable");
7171 RegisterNetSyncVariableBool("m_IsHologram");
7172
7175 {
7178 }
7179
7181
7183 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7185
7186 }
7187
7189 {
7191 }
7192
7194 {
7197 {
7202 }
7203 }
7204
7205 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7206 {
7208 {
7211 }
7212
7214 }
7215
7217 {
7223 }
7224
7226
7228 {
7230
7231 if (!action)
7232 {
7233 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7234 return;
7235 }
7236
7238 if (!ai)
7239 {
7241 return;
7242 }
7243
7245 if (!action_array)
7246 {
7247 action_array = new array<ActionBase_Basic>;
7249 }
7250 if (LogManager.IsActionLogEnable())
7251 {
7252 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7253 }
7254
7255 if (action_array.Find(action) != -1)
7256 {
7257 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7258 }
7259 else
7260 {
7261 action_array.Insert(action);
7262 }
7263 }
7264
7266 {
7268 ActionBase action = player.GetActionManager().GetAction(actionName);
7271
7272 if (action_array)
7273 {
7274 action_array.RemoveItem(action);
7275 }
7276 }
7277
7278
7279
7281 {
7282 ActionOverrideData overrideData = new ActionOverrideData();
7286
7288 if (!actionMap)
7289 {
7292 }
7293
7294 actionMap.Insert(this.
Type(), overrideData);
7295
7296 }
7297
7299
7301
7302
7304 {
7307
7310
7311 string config_to_search = "CfgVehicles";
7312 string muzzle_owner_config;
7313
7315 {
7316 if (IsInherited(Weapon))
7317 config_to_search = "CfgWeapons";
7318
7319 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7320
7321 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7322
7324
7325 if (config_OnFire_subclass_count > 0)
7326 {
7327 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7328
7329 for (int i = 0; i < config_OnFire_subclass_count; i++)
7330 {
7331 string particle_class = "";
7333 string config_OnFire_entry = config_OnFire_class + particle_class;
7334 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7335 WPOF_array.Insert(WPOF);
7336 }
7337
7338
7340 }
7341 }
7342
7344 {
7345 config_to_search = "CfgWeapons";
7346 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7347
7348 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7349
7351
7352 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7353 {
7354 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7355
7356 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7357 {
7358 string particle_class2 = "";
7360 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7361 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7362 WPOBE_array.Insert(WPOBE);
7363 }
7364
7365
7367 }
7368 }
7369 }
7370
7371
7373 {
7376
7378 {
7379 string config_to_search = "CfgVehicles";
7380
7381 if (IsInherited(Weapon))
7382 config_to_search = "CfgWeapons";
7383
7384 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7385 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7386
7387 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7388 {
7389
7391
7393 {
7395 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7397 return;
7398 }
7399
7402
7403
7404
7406 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7407
7408 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7409 {
7410 string particle_class = "";
7412 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7414
7415 if (entry_type == CT_CLASS)
7416 {
7417 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7418 WPOOH_array.Insert(WPOF);
7419 }
7420 }
7421
7422
7424 }
7425 }
7426 }
7427
7429 {
7431 }
7432
7434 {
7436 {
7438
7441
7444
7445 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7446 }
7447 }
7448
7450 {
7452 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7453
7455 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7456
7458 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7459
7461 {
7463 }
7464 }
7465
7467 {
7469 }
7470
7472 {
7475 else
7477
7479 {
7482 }
7483 else
7484 {
7487
7490 }
7491
7493 }
7494
7496 {
7498 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7499 }
7500
7502 {
7504 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7506 }
7507
7509 {
7511 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7512 }
7513
7515 {
7518
7519 OverheatingParticle OP = new OverheatingParticle();
7524
7526 }
7527
7529 {
7532
7533 return -1;
7534 }
7535
7537 {
7539 {
7542
7543 for (int i = count; i > 0; --i)
7544 {
7545 int id = i - 1;
7548
7551
7552 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7553 {
7554 if (p)
7555 {
7558 }
7559 }
7560 }
7561 }
7562 }
7563
7565 {
7567 {
7569 {
7570 int id = i - 1;
7572
7573 if (OP)
7574 {
7576
7577 if (p)
7578 {
7580 }
7581
7582 delete OP;
7583 }
7584 }
7585
7588 }
7589 }
7590
7593 {
7594 return 0.0;
7595 }
7596
7597
7599 {
7600 return 250;
7601 }
7602
7604 {
7605 return 0;
7606 }
7607
7610 {
7612 return true;
7613
7614 return false;
7615 }
7616
7619 {
7622
7624 {
7626 }
7627 else
7628 {
7629
7631 }
7632
7634 }
7635
7642 {
7643 return -1;
7644 }
7645
7646
7647
7648
7650 {
7652 {
7654 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7655
7656 if (r_index >= 0)
7657 {
7658 InventoryLocation r_il = new InventoryLocation;
7659 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7660
7661 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7664 {
7665 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7666 }
7668 {
7669 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7670 }
7671
7672 }
7673
7674 player.GetHumanInventory().ClearUserReservedLocation(this);
7675 }
7676
7679 }
7680
7681
7682
7683
7685 {
7686 return ItemBase.m_DebugActionsMask;
7687 }
7688
7690 {
7691 return ItemBase.m_DebugActionsMask & mask;
7692 }
7693
7695 {
7696 ItemBase.m_DebugActionsMask = mask;
7697 }
7698
7700 {
7701 ItemBase.m_DebugActionsMask |= mask;
7702 }
7703
7705 {
7706 ItemBase.m_DebugActionsMask &= ~mask;
7707 }
7708
7710 {
7712 {
7714 }
7715 else
7716 {
7718 }
7719 }
7720
7721
7723 {
7724 if (GetEconomyProfile())
7725 {
7726 float q_max = GetEconomyProfile().GetQuantityMax();
7727 if (q_max > 0)
7728 {
7729 float q_min = GetEconomyProfile().GetQuantityMin();
7730 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7731
7733 {
7734 ComponentEnergyManager comp = GetCompEM();
7736 {
7738 }
7739 }
7741 {
7743
7744 }
7745
7746 }
7747 }
7748 }
7749
7752 {
7753 EntityAI parent = GetHierarchyParent();
7754
7755 if (parent)
7756 {
7757 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7758 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7759 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7760 }
7761 }
7762
7765 {
7766 EntityAI parent = GetHierarchyParent();
7767
7768 if (parent)
7769 {
7770 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7771 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7772 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7773 }
7774 }
7775
7777 {
7778
7779
7780
7781
7783
7785 {
7786 if (ScriptInputUserData.CanStoreInputUserData())
7787 {
7788 ScriptInputUserData ctx = new ScriptInputUserData;
7794 ctx.
Write(use_stack_max);
7797
7799 {
7800 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7801 }
7802 }
7803 }
7804 else if (!
GetGame().IsMultiplayer())
7805 {
7807 }
7808 }
7809
7811 {
7813 }
7814
7816 {
7818 }
7819
7821 {
7823 }
7824
7826 {
7827
7828 return false;
7829 }
7830
7832 {
7833 return false;
7834 }
7835
7839 {
7840 return false;
7841 }
7842
7844 {
7845 return "";
7846 }
7847
7849
7851 {
7852 return false;
7853 }
7854
7856 {
7857 return true;
7858 }
7859
7860
7861
7863 {
7864 return true;
7865 }
7866
7868 {
7869 return true;
7870 }
7871
7873 {
7874 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7876 }
7877
7879 {
7881 }
7882
7884 {
7886 if (!is_being_placed)
7888 SetSynchDirty();
7889 }
7890
7891
7893
7895 {
7897 }
7898
7900 {
7902 }
7903
7905 {
7906 return 1;
7907 }
7908
7910 {
7911 return false;
7912 }
7913
7915 {
7917 SetSynchDirty();
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
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7955 {
7956 super.OnMovedInsideCargo(container);
7957
7958 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7959 }
7960
7961 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7962 {
7963 super.EEItemLocationChanged(oldLoc,newLoc);
7964
7965 PlayerBase new_player = null;
7966 PlayerBase old_player = null;
7967
7968 if (newLoc.GetParent())
7969 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7970
7971 if (oldLoc.GetParent())
7972 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7973
7975 {
7976 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7977
7978 if (r_index >= 0)
7979 {
7980 InventoryLocation r_il = new InventoryLocation;
7981 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7982
7983 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7986 {
7987 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7988 }
7990 {
7991 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7992 }
7993
7994 }
7995 }
7996
7998 {
7999 if (new_player)
8000 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8001
8002 if (new_player == old_player)
8003 {
8004
8005 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8006 {
8008 {
8009 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8010 {
8011 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8012 }
8013 }
8014 else
8015 {
8016 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8017 }
8018 }
8019
8020 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8021 {
8022 int type = oldLoc.GetType();
8024 {
8025 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8026 }
8028 {
8029 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8030 }
8031 }
8032 if (!m_OldLocation)
8033 {
8034 m_OldLocation = new InventoryLocation;
8035 }
8036 m_OldLocation.Copy(oldLoc);
8037 }
8038 else
8039 {
8040 if (m_OldLocation)
8041 {
8042 m_OldLocation.Reset();
8043 }
8044 }
8045
8047 }
8048 else
8049 {
8050 if (new_player)
8051 {
8052 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8053 if (res_index >= 0)
8054 {
8055 InventoryLocation il = new InventoryLocation;
8056 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8058 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8061 {
8062 il.
GetParent().GetOnReleaseLock().Invoke(it);
8063 }
8065 {
8067 }
8068
8069 }
8070 }
8072 {
8073
8075 }
8076
8077 if (m_OldLocation)
8078 {
8079 m_OldLocation.Reset();
8080 }
8081 }
8082 }
8083
8084 override void EOnContact(IEntity other, Contact extra)
8085 {
8087 {
8088 int liquidType = -1;
8090 if (impactSpeed > 0.0)
8091 {
8093 #ifndef SERVER
8095 #else
8097 SetSynchDirty();
8098 #endif
8100 }
8101 }
8102
8103 #ifdef SERVER
8104 if (GetCompEM() && GetCompEM().IsPlugged())
8105 {
8106 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8107 GetCompEM().UnplugThis();
8108 }
8109 #endif
8110 }
8111
8113
8115 {
8117 }
8118
8120 {
8121
8122 }
8123
8125 {
8126 super.OnItemLocationChanged(old_owner, new_owner);
8127
8128 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8129 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8130
8131 if (!relatedPlayer && playerNew)
8132 relatedPlayer = playerNew;
8133
8134 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8135 {
8137 if (actionMgr)
8138 {
8139 ActionBase currentAction = actionMgr.GetRunningAction();
8140 if (currentAction)
8142 }
8143 }
8144
8145 Man ownerPlayerOld = null;
8146 Man ownerPlayerNew = null;
8147
8148 if (old_owner)
8149 {
8150 if (old_owner.
IsMan())
8151 {
8152 ownerPlayerOld = Man.Cast(old_owner);
8153 }
8154 else
8155 {
8156 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8157 }
8158 }
8159 else
8160 {
8162 {
8164
8165 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8166 {
8167 GetCompEM().UnplugThis();
8168 }
8169 }
8170 }
8171
8172 if (new_owner)
8173 {
8174 if (new_owner.
IsMan())
8175 {
8176 ownerPlayerNew = Man.Cast(new_owner);
8177 }
8178 else
8179 {
8180 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8181 }
8182 }
8183
8184 if (ownerPlayerOld != ownerPlayerNew)
8185 {
8186 if (ownerPlayerOld)
8187 {
8188 array<EntityAI> subItemsExit = new array<EntityAI>;
8190 for (int i = 0; i < subItemsExit.Count(); i++)
8191 {
8194 }
8195 }
8196
8197 if (ownerPlayerNew)
8198 {
8199 array<EntityAI> subItemsEnter = new array<EntityAI>;
8201 for (int j = 0; j < subItemsEnter.Count(); j++)
8202 {
8205 }
8206 }
8207 }
8208 else if (ownerPlayerNew != null)
8209 {
8210 PlayerBase nplayer;
8211 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8212 {
8213 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8215 for (int k = 0; k < subItemsUpdate.Count(); k++)
8216 {
8218 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8219 }
8220 }
8221 }
8222
8223 if (old_owner)
8224 old_owner.OnChildItemRemoved(this);
8225 if (new_owner)
8226 new_owner.OnChildItemReceived(this);
8227 }
8228
8229
8231 {
8232 super.EEDelete(parent);
8233 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8234 if (player)
8235 {
8237
8238 if (player.IsAlive())
8239 {
8240 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8241 if (r_index >= 0)
8242 {
8243 InventoryLocation r_il = new InventoryLocation;
8244 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8245
8246 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8249 {
8250 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8251 }
8253 {
8254 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8255 }
8256
8257 }
8258
8259 player.RemoveQuickBarEntityShortcut(this);
8260 }
8261 }
8262 }
8263
8265 {
8266 super.EEKilled(killer);
8267
8270 {
8271 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8272 {
8273 if (IsMagazine())
8274 {
8275 if (Magazine.Cast(this).GetAmmoCount() > 0)
8276 {
8278 }
8279 }
8280 else
8281 {
8283 }
8284 }
8285 }
8286 }
8287
8289 {
8290 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8291
8292 super.OnWasAttached(parent, slot_id);
8293
8296
8298 }
8299
8301 {
8302 super.OnWasDetached(parent, slot_id);
8303
8306 }
8307
8309 {
8310 int idx;
8313
8314 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8315 if (inventory_slots.Count() < 1)
8316 {
8317 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8318 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8319 }
8320 else
8321 {
8322 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8323 }
8324
8325 idx = inventory_slots.Find(slot);
8326 if (idx < 0)
8327 return "";
8328
8329 return attach_types.Get(idx);
8330 }
8331
8333 {
8334 int idx = -1;
8335 string slot;
8336
8339
8340 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8341 if (inventory_slots.Count() < 1)
8342 {
8343 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8344 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8345 }
8346 else
8347 {
8348 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8349 if (detach_types.Count() < 1)
8350 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8351 }
8352
8353 for (int i = 0; i < inventory_slots.Count(); i++)
8354 {
8355 slot = inventory_slots.Get(i);
8356 }
8357
8358 if (slot != "")
8359 {
8360 if (detach_types.Count() == 1)
8361 idx = 0;
8362 else
8363 idx = inventory_slots.Find(slot);
8364 }
8365 if (idx < 0)
8366 return "";
8367
8368 return detach_types.Get(idx);
8369 }
8370
8372 {
8373
8375
8376
8377 float min_time = 1;
8378 float max_time = 3;
8379 float delay = Math.RandomFloat(min_time, max_time);
8380
8381 explode_timer.Run(delay, this, "DoAmmoExplosion");
8382 }
8383
8385 {
8386 Magazine magazine = Magazine.Cast(this);
8387 int pop_sounds_count = 6;
8388 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8389
8390
8391 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8392 string sound_name = pop_sounds[ sound_idx ];
8394
8395
8396 magazine.ServerAddAmmoCount(-1);
8397
8398
8399 float min_temp_to_explode = 100;
8400
8401 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8402 {
8404 }
8405 }
8406
8407
8408 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8409 {
8410 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8411
8412 const int CHANCE_DAMAGE_CARGO = 4;
8413 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8414 const int CHANCE_DAMAGE_NOTHING = 2;
8415
8417 {
8418 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8419 int chances;
8420 int rnd;
8421
8422 if (GetInventory().GetCargo())
8423 {
8424 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8425 rnd = Math.RandomInt(0,chances);
8426
8427 if (rnd < CHANCE_DAMAGE_CARGO)
8428 {
8430 }
8431 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8432 {
8434 }
8435 }
8436 else
8437 {
8438 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8439 rnd = Math.RandomInt(0,chances);
8440
8441 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8442 {
8444 }
8445 }
8446 }
8447 }
8448
8450 {
8451 if (GetInventory().GetCargo())
8452 {
8453 int item_count = GetInventory().GetCargo().GetItemCount();
8454 if (item_count > 0)
8455 {
8456 int random_pick = Math.RandomInt(0, item_count);
8458 if (!item.IsExplosive())
8459 {
8460 item.AddHealth("","",damage);
8461 return true;
8462 }
8463 }
8464 }
8465 return false;
8466 }
8467
8469 {
8470 int attachment_count = GetInventory().AttachmentCount();
8471 if (attachment_count > 0)
8472 {
8473 int random_pick = Math.RandomInt(0, attachment_count);
8474 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8475 if (!attachment.IsExplosive())
8476 {
8477 attachment.AddHealth("","",damage);
8478 return true;
8479 }
8480 }
8481 return false;
8482 }
8483
8485 {
8487 }
8488
8490 {
8492 return GetInventory().CanRemoveEntity();
8493
8494 return false;
8495 }
8496
8498 {
8500 return;
8501
8503 {
8504 if (ScriptInputUserData.CanStoreInputUserData())
8505 {
8506 ScriptInputUserData ctx = new ScriptInputUserData;
8511 ctx.
Write(destination_entity);
8515 }
8516 }
8517 else if (!
GetGame().IsMultiplayer())
8518 {
8520 }
8521 }
8522
8524 {
8526 return;
8527
8528 float split_quantity_new;
8532 InventoryLocation loc = new InventoryLocation;
8533
8534 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8535 {
8537 split_quantity_new = stack_max;
8538 else
8540
8541 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8542 if (new_item)
8543 {
8544 new_item.SetResultOfSplit(true);
8545 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8547 new_item.SetQuantity(split_quantity_new);
8548 }
8549 }
8550 else if (destination_entity && slot_id == -1)
8551 {
8552 if (quantity > stack_max)
8553 split_quantity_new = stack_max;
8554 else
8555 split_quantity_new = quantity;
8556
8558 {
8561 }
8562
8563 if (new_item)
8564 {
8565 new_item.SetResultOfSplit(true);
8566 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8568 new_item.SetQuantity(split_quantity_new);
8569 }
8570 }
8571 else
8572 {
8573 if (stack_max != 0)
8574 {
8576 {
8578 }
8579
8580 if (split_quantity_new == 0)
8581 {
8582 if (!
GetGame().IsMultiplayer())
8583 player.PhysicalPredictiveDropItem(this);
8584 else
8585 player.ServerDropEntity(this);
8586 return;
8587 }
8588
8590
8591 if (new_item)
8592 {
8593 new_item.SetResultOfSplit(true);
8594 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8596 new_item.SetQuantity(stack_max);
8597 new_item.PlaceOnSurface();
8598 }
8599 }
8600 }
8601 }
8602
8604 {
8606 return;
8607
8608 float split_quantity_new;
8612 InventoryLocation loc = new InventoryLocation;
8613
8614 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8615 {
8617 split_quantity_new = stack_max;
8618 else
8620
8621 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8622 if (new_item)
8623 {
8624 new_item.SetResultOfSplit(true);
8625 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8627 new_item.SetQuantity(split_quantity_new);
8628 }
8629 }
8630 else if (destination_entity && slot_id == -1)
8631 {
8632 if (quantity > stack_max)
8633 split_quantity_new = stack_max;
8634 else
8635 split_quantity_new = quantity;
8636
8638 {
8641 }
8642
8643 if (new_item)
8644 {
8645 new_item.SetResultOfSplit(true);
8646 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8648 new_item.SetQuantity(split_quantity_new);
8649 }
8650 }
8651 else
8652 {
8653 if (stack_max != 0)
8654 {
8656 {
8658 }
8659
8661
8662 if (new_item)
8663 {
8664 new_item.SetResultOfSplit(true);
8665 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8667 new_item.SetQuantity(stack_max);
8668 new_item.PlaceOnSurface();
8669 }
8670 }
8671 }
8672 }
8673
8675 {
8677 return;
8678
8680 {
8681 if (ScriptInputUserData.CanStoreInputUserData())
8682 {
8683 ScriptInputUserData ctx = new ScriptInputUserData;
8688 dst.WriteToContext(ctx);
8690 }
8691 }
8692 else if (!
GetGame().IsMultiplayer())
8693 {
8695 }
8696 }
8697
8699 {
8701 return;
8702
8704 {
8705 if (ScriptInputUserData.CanStoreInputUserData())
8706 {
8707 ScriptInputUserData ctx = new ScriptInputUserData;
8712 ctx.
Write(destination_entity);
8718 }
8719 }
8720 else if (!
GetGame().IsMultiplayer())
8721 {
8723 }
8724 }
8725
8727 {
8729 }
8730
8732 {
8734 return this;
8735
8737 float split_quantity_new;
8739 if (dst.IsValid())
8740 {
8741 int slot_id = dst.GetSlot();
8743
8744 if (quantity > stack_max)
8745 split_quantity_new = stack_max;
8746 else
8747 split_quantity_new = quantity;
8748
8750
8751 if (new_item)
8752 {
8753 new_item.SetResultOfSplit(true);
8754 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8757 }
8758
8759 return new_item;
8760 }
8761
8762 return null;
8763 }
8764
8766 {
8768 return;
8769
8771 float split_quantity_new;
8773 if (destination_entity)
8774 {
8776 if (quantity > stackable)
8777 split_quantity_new = stackable;
8778 else
8779 split_quantity_new = quantity;
8780
8781 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8782 if (new_item)
8783 {
8784 new_item.SetResultOfSplit(true);
8785 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8787 new_item.SetQuantity(split_quantity_new);
8788 }
8789 }
8790 }
8791
8793 {
8795 return;
8796
8798 {
8799 if (ScriptInputUserData.CanStoreInputUserData())
8800 {
8801 ScriptInputUserData ctx = new ScriptInputUserData;
8806 ItemBase destination_entity =
this;
8807 ctx.
Write(destination_entity);
8811 }
8812 }
8813 else if (!
GetGame().IsMultiplayer())
8814 {
8816 }
8817 }
8818
8820 {
8822 return;
8823
8825 float split_quantity_new;
8827 if (player)
8828 {
8830 if (quantity > stackable)
8831 split_quantity_new = stackable;
8832 else
8833 split_quantity_new = quantity;
8834
8835 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8836 new_item =
ItemBase.Cast(in_hands);
8837 if (new_item)
8838 {
8839 new_item.SetResultOfSplit(true);
8840 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8842 new_item.SetQuantity(split_quantity_new);
8843 }
8844 }
8845 }
8846
8848 {
8850 return;
8851
8853 float split_quantity_new = Math.Floor(quantity * 0.5);
8854
8856
8857 if (new_item)
8858 {
8859 if (new_item.GetQuantityMax() < split_quantity_new)
8860 {
8861 split_quantity_new = new_item.GetQuantityMax();
8862 }
8863
8864 new_item.SetResultOfSplit(true);
8865 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8866
8868 {
8871 }
8872 else
8873 {
8876 }
8877 }
8878 }
8879
8881 {
8883 return;
8884
8886 float split_quantity_new = Math.Floor(quantity / 2);
8887
8888 InventoryLocation invloc = new InventoryLocation;
8890
8892 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8893
8894 if (new_item)
8895 {
8896 if (new_item.GetQuantityMax() < split_quantity_new)
8897 {
8898 split_quantity_new = new_item.GetQuantityMax();
8899 }
8901 {
8904 }
8905 else
8906 {
8909 }
8910 }
8911 }
8912
8915 {
8916 SetWeightDirty();
8918
8919 if (parent)
8920 parent.OnAttachmentQuantityChangedEx(this, delta);
8921
8923 {
8925 {
8927 }
8929 {
8930 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8932 }
8933 }
8934
8935 }
8936
8939 {
8940
8941 }
8942
8945 {
8947 }
8948
8950 {
8951 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8952
8954 {
8955 if (newLevel == GameConstants.STATE_RUINED)
8956 {
8958 EntityAI parent = GetHierarchyParent();
8959 if (parent && parent.IsFireplace())
8960 {
8961 CargoBase cargo = GetInventory().GetCargo();
8962 if (cargo)
8963 {
8965 {
8967 }
8968 }
8969 }
8970 }
8971
8973 {
8974
8976 return;
8977 }
8978
8979 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8980 {
8982 }
8983 }
8984 }
8985
8986
8988 {
8989 super.OnRightClick();
8990
8992 {
8994 {
8995 if (ScriptInputUserData.CanStoreInputUserData())
8996 {
8997 vector m4[4];
8999
9000 EntityAI root = GetHierarchyRoot();
9001
9002 InventoryLocation dst = new InventoryLocation;
9004 {
9005 if (root)
9006 {
9007 root.GetTransform(m4);
9009 }
9010 else
9011 GetInventory().GetCurrentInventoryLocation(dst);
9012 }
9013 else
9014 {
9016
9017
9018 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9019 {
9020 if (root)
9021 {
9022 root.GetTransform(m4);
9024 }
9025 else
9026 GetInventory().GetCurrentInventoryLocation(dst);
9027 }
9028 else
9029 {
9030 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9031 }
9032 }
9033
9034 ScriptInputUserData ctx = new ScriptInputUserData;
9042 }
9043 }
9044 else if (!
GetGame().IsMultiplayer())
9045 {
9047 }
9048 }
9049 }
9050
9051 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9052 {
9053
9054 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9055 return false;
9056
9057 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9058 return false;
9059
9060
9062 return false;
9063
9064
9065 Magazine mag = Magazine.Cast(this);
9066 if (mag)
9067 {
9068 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9069 return false;
9070
9071 if (stack_max_limit)
9072 {
9073 Magazine other_mag = Magazine.Cast(other_item);
9074 if (other_item)
9075 {
9076 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9077 return false;
9078 }
9079
9080 }
9081 }
9082 else
9083 {
9084
9086 return false;
9087
9089 return false;
9090 }
9091
9092 PlayerBase player = null;
9093 if (CastTo(player, GetHierarchyRootPlayer()))
9094 {
9095 if (player.GetInventory().HasAttachment(this))
9096 return false;
9097
9098 if (player.IsItemsToDelete())
9099 return false;
9100 }
9101
9102 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9103 return false;
9104
9105 int slotID;
9107 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9108 return false;
9109
9110 return true;
9111 }
9112
9114 {
9116 }
9117
9119 {
9120 return m_IsResultOfSplit;
9121 }
9122
9124 {
9125 m_IsResultOfSplit = value;
9126 }
9127
9129 {
9131 }
9132
9134 {
9135 float other_item_quantity = other_item.GetQuantity();
9136 float this_free_space;
9137
9139
9141
9142 if (other_item_quantity > this_free_space)
9143 {
9144 return this_free_space;
9145 }
9146 else
9147 {
9148 return other_item_quantity;
9149 }
9150 }
9151
9153 {
9155 }
9156
9158 {
9160 return;
9161
9162 if (!IsMagazine() && other_item)
9163 {
9165 if (quantity_used != 0)
9166 {
9167 float hp1 = GetHealth01("","");
9168 float hp2 = other_item.GetHealth01("","");
9169 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9170 hpResult = hpResult / (
GetQuantity() + quantity_used);
9171
9172 hpResult *= GetMaxHealth();
9173 Math.Round(hpResult);
9174 SetHealth("", "Health", hpResult);
9175
9177 other_item.AddQuantity(-quantity_used);
9178 }
9179 }
9181 }
9182
9184 {
9185 #ifdef SERVER
9186 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9187 GetHierarchyParent().IncreaseLifetimeUp();
9188 #endif
9189 };
9190
9192 {
9193 PlayerBase p = PlayerBase.Cast(player);
9194
9195 array<int> recipesIds = p.m_Recipes;
9196 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9197 if (moduleRecipesManager)
9198 {
9199 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9200 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9201 }
9202
9203 for (int i = 0;i < recipesIds.Count(); i++)
9204 {
9205 int key = recipesIds.Get(i);
9206 string recipeName = moduleRecipesManager.GetRecipeName(key);
9208 }
9209 }
9210
9211
9212 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9213 {
9214 super.GetDebugActions(outputList);
9215
9216
9221
9222
9226
9230
9231
9234
9235
9237 {
9240 }
9241
9243
9246
9250 }
9251
9252
9253
9254
9256 {
9257 super.OnAction(action_id, player, ctx);
9258 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9259 {
9260 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9261 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9262 PlayerBase p = PlayerBase.Cast(player);
9263 if (
EActions.RECIPES_RANGE_START < 1000)
9264 {
9265 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9266 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9267 }
9268 }
9269 #ifndef SERVER
9270 else if (action_id ==
EActions.WATCH_PLAYER)
9271 {
9272 PluginDeveloper.SetDeveloperItemClientEx(player);
9273 }
9274 #endif
9276 {
9277 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9278 {
9279 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9280 OnDebugButtonPressServer(id + 1);
9281 }
9282
9283 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9284 {
9285 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9287 }
9288
9289 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9290 {
9291 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9293 }
9294
9295 else if (action_id ==
EActions.ADD_QUANTITY)
9296 {
9297 if (IsMagazine())
9298 {
9299 Magazine mag = Magazine.Cast(this);
9300 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9301 }
9302 else
9303 {
9305 }
9306
9307 if (m_EM)
9308 {
9309 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9310 }
9311
9312 }
9313
9314 else if (action_id ==
EActions.REMOVE_QUANTITY)
9315 {
9316 if (IsMagazine())
9317 {
9318 Magazine mag2 = Magazine.Cast(this);
9319 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9320 }
9321 else
9322 {
9324 }
9325 if (m_EM)
9326 {
9327 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9328 }
9329
9330 }
9331
9332 else if (action_id ==
EActions.SET_QUANTITY_0)
9333 {
9335
9336 if (m_EM)
9337 {
9338 m_EM.SetEnergy(0);
9339 }
9340 }
9341
9342 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9343 {
9345
9346 if (m_EM)
9347 {
9348 m_EM.SetEnergy(m_EM.GetEnergyMax());
9349 }
9350 }
9351
9352 else if (action_id ==
EActions.ADD_HEALTH)
9353 {
9354 AddHealth("","",GetMaxHealth("","Health")/5);
9355 }
9356 else if (action_id ==
EActions.REMOVE_HEALTH)
9357 {
9358 AddHealth("","",-GetMaxHealth("","Health")/5);
9359 }
9360 else if (action_id ==
EActions.DESTROY_HEALTH)
9361 {
9362 SetHealth01("","",0);
9363 }
9364 else if (action_id ==
EActions.WATCH_ITEM)
9365 {
9367 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9368 #ifdef DEVELOPER
9369 SetDebugDeveloper_item(this);
9370 #endif
9371 }
9372
9373 else if (action_id ==
EActions.ADD_TEMPERATURE)
9374 {
9375 AddTemperature(20);
9376
9377 }
9378
9379 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9380 {
9381 AddTemperature(-20);
9382
9383 }
9384
9385 else if (action_id ==
EActions.FLIP_FROZEN)
9386 {
9387 SetFrozen(!GetIsFrozen());
9388
9389 }
9390
9391 else if (action_id ==
EActions.ADD_WETNESS)
9392 {
9394
9395 }
9396
9397 else if (action_id ==
EActions.REMOVE_WETNESS)
9398 {
9400
9401 }
9402
9403 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9404 {
9407
9408
9409 }
9410
9411 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9412 {
9415 }
9416
9417 else if (action_id ==
EActions.MAKE_SPECIAL)
9418 {
9419 auto debugParams = DebugSpawnParams.WithPlayer(player);
9420 OnDebugSpawnEx(debugParams);
9421 }
9422
9423 else if (action_id ==
EActions.DELETE)
9424 {
9425 Delete();
9426 }
9427
9428 }
9429
9430
9431 return false;
9432 }
9433
9434
9435
9436
9440
9443
9444
9445
9447 {
9448 return false;
9449 }
9450
9451
9453 {
9454 return true;
9455 }
9456
9457
9459 {
9460 return true;
9461 }
9462
9463
9464
9466 {
9467 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9469 }
9470
9473 {
9474 return null;
9475 }
9476
9478 {
9479 return false;
9480 }
9481
9483 {
9484 return false;
9485 }
9486
9490
9491
9493 {
9494 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9495 return module_repairing.CanRepair(this, item_repair_kit);
9496 }
9497
9498
9499 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9500 {
9501 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9502 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9503 }
9504
9505
9507 {
9508
9509
9510
9511
9512
9513
9514
9515
9516 return 1;
9517 }
9518
9519
9520
9522 {
9524 }
9525
9526
9527
9529 {
9531 }
9532
9533
9542 {
9543 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9544
9545 if (player)
9546 {
9547 player.MessageStatus(text);
9548 }
9549 }
9550
9551
9560 {
9561 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9562
9563 if (player)
9564 {
9565 player.MessageAction(text);
9566 }
9567 }
9568
9569
9578 {
9579 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9580
9581 if (player)
9582 {
9583 player.MessageFriendly(text);
9584 }
9585 }
9586
9587
9596 {
9597 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9598
9599 if (player)
9600 {
9601 player.MessageImportant(text);
9602 }
9603 }
9604
9606 {
9607 return true;
9608 }
9609
9610
9611 override bool KindOf(
string tag)
9612 {
9613 bool found = false;
9614 string item_name = this.
GetType();
9617
9618 int array_size = item_tag_array.Count();
9619 for (int i = 0; i < array_size; i++)
9620 {
9621 if (item_tag_array.Get(i) == tag)
9622 {
9623 found = true;
9624 break;
9625 }
9626 }
9627 return found;
9628 }
9629
9630
9632 {
9633
9634 super.OnRPC(sender, rpc_type,ctx);
9635
9636
9637 switch (rpc_type)
9638 {
9639 #ifndef SERVER
9640 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9641 Param2<bool, string> p = new Param2<bool, string>(false, "");
9642
9644 return;
9645
9646 bool play = p.param1;
9647 string soundSet = p.param2;
9648
9649 if (play)
9650 {
9652 {
9654 {
9656 }
9657 }
9658 else
9659 {
9661 }
9662 }
9663 else
9664 {
9666 }
9667
9668 break;
9669 #endif
9670
9671 }
9672
9674 {
9676 }
9677 }
9678
9679
9680
9681
9683 {
9684 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9685 return plugin.GetID(
name);
9686 }
9687
9689 {
9690 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9691 return plugin.GetName(id);
9692 }
9693
9696 {
9697
9698
9699 int varFlags;
9700 if (!ctx.
Read(varFlags))
9701 return;
9702
9703 if (varFlags & ItemVariableFlags.FLOAT)
9704 {
9706 }
9707 }
9708
9710 {
9711
9712 super.SerializeNumericalVars(floats_out);
9713
9714
9715
9717 {
9719 }
9720
9722 {
9724 }
9725
9727 {
9729 }
9730
9732 {
9737 }
9738
9740 {
9742 }
9743 }
9744
9746 {
9747
9748 super.DeSerializeNumericalVars(floats);
9749
9750
9751 int index = 0;
9752 int mask = Math.Round(floats.Get(index));
9753
9754 index++;
9755
9757 {
9759 {
9761 }
9762 else
9763 {
9764 float quantity = floats.Get(index);
9766 }
9767 index++;
9768 }
9769
9771 {
9772 float wet = floats.Get(index);
9774 index++;
9775 }
9776
9778 {
9779 int liquidtype = Math.Round(floats.Get(index));
9781 index++;
9782 }
9783
9785 {
9787 index++;
9789 index++;
9791 index++;
9793 index++;
9794 }
9795
9797 {
9798 int cleanness = Math.Round(floats.Get(index));
9800 index++;
9801 }
9802 }
9803
9805 {
9806 super.WriteVarsToCTX(ctx);
9807
9808
9810 {
9812 }
9813
9815 {
9817 }
9818
9820 {
9822 }
9823
9825 {
9826 int r,g,b,a;
9832 }
9833
9835 {
9837 }
9838 }
9839
9841 {
9842 if (!super.ReadVarsFromCTX(ctx,version))
9843 return false;
9844
9845 int intValue;
9846 float value;
9847
9848 if (version < 140)
9849 {
9850 if (!ctx.
Read(intValue))
9851 return false;
9852
9853 m_VariablesMask = intValue;
9854 }
9855
9857 {
9858 if (!ctx.
Read(value))
9859 return false;
9860
9862 {
9864 }
9865 else
9866 {
9868 }
9869 }
9870
9871 if (version < 140)
9872 {
9874 {
9875 if (!ctx.
Read(value))
9876 return false;
9877 SetTemperatureDirect(value);
9878 }
9879 }
9880
9882 {
9883 if (!ctx.
Read(value))
9884 return false;
9886 }
9887
9889 {
9890 if (!ctx.
Read(intValue))
9891 return false;
9893 }
9894
9896 {
9897 int r,g,b,a;
9899 return false;
9901 return false;
9903 return false;
9905 return false;
9906
9908 }
9909
9911 {
9912 if (!ctx.
Read(intValue))
9913 return false;
9915 }
9916
9917 if (version >= 138 && version < 140)
9918 {
9920 {
9921 if (!ctx.
Read(intValue))
9922 return false;
9923 SetFrozen(intValue);
9924 }
9925 }
9926
9927 return true;
9928 }
9929
9930
9932 {
9935 {
9937 }
9938
9939 if (!super.OnStoreLoad(ctx, version))
9940 {
9942 return false;
9943 }
9944
9945 if (version >= 114)
9946 {
9947 bool hasQuickBarIndexSaved;
9948
9949 if (!ctx.
Read(hasQuickBarIndexSaved))
9950 {
9952 return false;
9953 }
9954
9955 if (hasQuickBarIndexSaved)
9956 {
9957 int itmQBIndex;
9958
9959
9960 if (!ctx.
Read(itmQBIndex))
9961 {
9963 return false;
9964 }
9965
9966 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9967 if (itmQBIndex != -1 && parentPlayer)
9968 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9969 }
9970 }
9971 else
9972 {
9973
9974 PlayerBase player;
9975 int itemQBIndex;
9976 if (version ==
int.
MAX)
9977 {
9978 if (!ctx.
Read(itemQBIndex))
9979 {
9981 return false;
9982 }
9983 }
9984 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9985 {
9986
9987 if (!ctx.
Read(itemQBIndex))
9988 {
9990 return false;
9991 }
9992 if (itemQBIndex != -1 && player)
9993 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9994 }
9995 }
9996
9997 if (version < 140)
9998 {
9999
10000 if (!LoadVariables(ctx, version))
10001 {
10003 return false;
10004 }
10005 }
10006
10007
10009 {
10011 return false;
10012 }
10013 if (version >= 132)
10014 {
10016 if (raib)
10017 {
10019 {
10021 return false;
10022 }
10023 }
10024 }
10025
10027 return true;
10028 }
10029
10030
10031
10033 {
10034 super.OnStoreSave(ctx);
10035
10036 PlayerBase player;
10037 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10038 {
10040
10041 int itemQBIndex = -1;
10042 itemQBIndex = player.FindQuickBarEntityIndex(this);
10043 ctx.
Write(itemQBIndex);
10044 }
10045 else
10046 {
10048 }
10049
10051
10053 if (raib)
10054 {
10056 }
10057 }
10058
10059
10061 {
10062 super.AfterStoreLoad();
10063
10065 {
10067 }
10068
10070 {
10073 }
10074 }
10075
10077 {
10078 super.EEOnAfterLoad();
10079
10081 {
10083 }
10084
10087 }
10088
10090 {
10091 return false;
10092 }
10093
10094
10095
10097 {
10099 {
10100 #ifdef PLATFORM_CONSOLE
10101
10103 {
10105 if (menu)
10106 {
10108 }
10109 }
10110 #endif
10111 }
10112
10114 {
10117 }
10118
10120 {
10121 SetWeightDirty();
10123 }
10125 {
10128 }
10129
10131 {
10134 }
10136 {
10139 }
10140
10141 super.OnVariablesSynchronized();
10142 }
10143
10144
10145
10147 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10148 {
10149 if (!IsServerCheck(allow_client))
10150 return false;
10151
10153 return false;
10154
10157
10158 if (value <= (min + 0.001))
10159 value = min;
10160
10161 if (value == min)
10162 {
10163 if (destroy_config)
10164 {
10165 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10166 if (dstr)
10167 {
10169 this.Delete();
10170 return true;
10171 }
10172 }
10173 else if (destroy_forced)
10174 {
10176 this.Delete();
10177 return true;
10178 }
10179
10181 }
10182
10185
10187 {
10189
10190 if (delta)
10192 }
10193
10195
10196 return false;
10197 }
10198
10199
10201 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10202 {
10204 }
10205
10207 {
10210 }
10211
10213 {
10216 }
10217
10220 {
10221 float value_clamped = Math.Clamp(value, 0, 1);
10223 SetQuantity(result, destroy_config, destroy_forced);
10224 }
10225
10226
10229 {
10231 }
10232
10234 {
10236 }
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10248 {
10249 int slot = -1;
10250 if (GetInventory())
10251 {
10252 InventoryLocation il = new InventoryLocation;
10253 GetInventory().GetCurrentInventoryLocation(il);
10255 }
10256
10258 }
10259
10261 {
10262 float quantity_max = 0;
10263
10265 {
10266 if (attSlotID != -1)
10267 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10268
10269 if (quantity_max <= 0)
10271 }
10272
10273 if (quantity_max <= 0)
10275
10276 return quantity_max;
10277 }
10278
10280 {
10282 }
10283
10285 {
10287 }
10288
10289
10291 {
10293 }
10294
10296 {
10298 }
10299
10301 {
10303 }
10304
10305
10307 {
10308
10309 float weightEx = GetWeightEx();
10310 float special = GetInventoryAndCargoWeight();
10311 return weightEx - special;
10312 }
10313
10314
10316 {
10318 }
10319
10321 {
10323 {
10324 #ifdef DEVELOPER
10325 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10326 {
10327 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10329 }
10330 #endif
10331
10332 return GetQuantity() * GetConfigWeightModified();
10333 }
10334 else if (HasEnergyManager())
10335 {
10336 #ifdef DEVELOPER
10337 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10338 {
10339 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10340 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10341 }
10342 #endif
10343 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10344 }
10345 else
10346 {
10347 #ifdef DEVELOPER
10348 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10349 {
10350 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10351 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10352 }
10353 #endif
10354 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10355 }
10356 }
10357
10360 {
10361 int item_count = 0;
10363
10364 if (GetInventory().GetCargo() != NULL)
10365 {
10366 item_count = GetInventory().GetCargo().GetItemCount();
10367 }
10368
10369 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10370 {
10371 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10372 if (item)
10373 item_count += item.GetNumberOfItems();
10374 }
10375 return item_count;
10376 }
10377
10380 {
10381 float weight = 0;
10382 float wetness = 1;
10383 if (include_wetness)
10386 {
10387 weight = wetness * m_ConfigWeight;
10388 }
10390 {
10391 weight = 1;
10392 }
10393 return weight;
10394 }
10395
10396
10397
10399 {
10400 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10401 {
10402 GameInventory inv = GetInventory();
10403 array<EntityAI> items = new array<EntityAI>;
10405 for (int i = 0; i < items.Count(); i++)
10406 {
10408 if (item)
10409 {
10411 }
10412 }
10413 }
10414 }
10415
10416
10417
10418
10420 {
10421 float energy = 0;
10422 if (HasEnergyManager())
10423 {
10424 energy = GetCompEM().GetEnergy();
10425 }
10426 return energy;
10427 }
10428
10429
10431 {
10432 super.OnEnergyConsumed();
10433
10435 }
10436
10438 {
10439 super.OnEnergyAdded();
10440
10442 }
10443
10444
10446 {
10447 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10448 {
10450 {
10451 float energy_0to1 = GetCompEM().GetEnergy0To1();
10453 }
10454 }
10455 }
10456
10457
10459 {
10460 return ConfigGetFloat("heatIsolation");
10461 }
10462
10464 {
10466 }
10467
10469 {
10470 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10471 if (
GetGame().ConfigIsExisting(paramPath))
10473
10474 return 0.0;
10475 }
10476
10478 {
10479 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10480 if (
GetGame().ConfigIsExisting(paramPath))
10482
10483 return 0.0;
10484 }
10485
10486 override void SetWet(
float value,
bool allow_client =
false)
10487 {
10488 if (!IsServerCheck(allow_client))
10489 return;
10490
10493
10495
10496 m_VarWet = Math.Clamp(value, min, max);
10497
10499 {
10502 }
10503 }
10504
10505 override void AddWet(
float value)
10506 {
10508 }
10509
10511 {
10513 }
10514
10516 {
10518 }
10519
10521 {
10523 }
10524
10526 {
10528 }
10529
10531 {
10533 }
10534
10535 override void OnWetChanged(
float newVal,
float oldVal)
10536 {
10539 if (newLevel != oldLevel)
10540 {
10542 }
10543 }
10544
10546 {
10547 SetWeightDirty();
10548 }
10549
10551 {
10552 return GetWetLevelInternal(
m_VarWet);
10553 }
10554
10555
10556
10558 {
10560 }
10561
10563 {
10565 }
10566
10568 {
10570 }
10571
10573 {
10575 }
10576
10577
10578
10580 {
10581 if (ConfigIsExisting("itemModelLength"))
10582 {
10583 return ConfigGetFloat("itemModelLength");
10584 }
10585 return 0;
10586 }
10587
10589 {
10590 if (ConfigIsExisting("itemAttachOffset"))
10591 {
10592 return ConfigGetFloat("itemAttachOffset");
10593 }
10594 return 0;
10595 }
10596
10597 override void SetCleanness(
int value,
bool allow_client =
false)
10598 {
10599 if (!IsServerCheck(allow_client))
10600 return;
10601
10603
10605
10608 }
10609
10611 {
10613 }
10614
10616 {
10617 return true;
10618 }
10619
10620
10621
10622
10624 {
10626 }
10627
10629 {
10631 }
10632
10633
10634
10635
10636 override void SetColor(
int r,
int g,
int b,
int a)
10637 {
10643 }
10645 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10646 {
10651 }
10652
10654 {
10656 }
10657
10660 {
10661 int r,g,b,a;
10663 r = r/255;
10664 g = g/255;
10665 b = b/255;
10666 a = a/255;
10667 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10668 }
10669
10670
10671
10672 override void SetLiquidType(
int value,
bool allow_client =
false)
10673 {
10674 if (!IsServerCheck(allow_client))
10675 return;
10676
10681 }
10682
10684 {
10685 return ConfigGetInt("varLiquidTypeInit");
10686 }
10687
10689 {
10691 }
10692
10694 {
10696 SetFrozen(false);
10697 }
10698
10701 {
10702 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10703 }
10704
10705
10708 {
10709 PlayerBase nplayer;
10710 if (PlayerBase.CastTo(nplayer, player))
10711 {
10713
10714 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10715 }
10716 }
10717
10718
10721 {
10722 PlayerBase nplayer;
10723 if (PlayerBase.CastTo(nplayer,player))
10724 {
10725
10726 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10727
10728 }
10729
10730
10731 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10732
10733
10734 if (HasEnergyManager())
10735 {
10736 GetCompEM().UpdatePlugState();
10737 }
10738 }
10739
10740
10742 {
10743 super.OnPlacementStarted(player);
10744
10746 }
10747
10748 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10749 {
10751 {
10752 m_AdminLog.OnPlacementComplete(player,
this);
10753 }
10754
10755 super.OnPlacementComplete(player, position, orientation);
10756 }
10757
10758
10759
10760
10761
10763 {
10765 {
10766 return true;
10767 }
10768 else
10769 {
10770 return false;
10771 }
10772 }
10773
10774
10776 {
10778 {
10780 }
10781 }
10782
10783
10785 {
10787 }
10788
10790 {
10792 }
10793
10794 override void InsertAgent(
int agent,
float count = 1)
10795 {
10796 if (count < 1)
10797 return;
10798
10800 }
10801
10804 {
10806 }
10807
10808
10810 {
10812 }
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10856 {
10858 return false;
10859 return true;
10860 }
10861
10863 {
10864
10866 }
10867
10868
10871 {
10872 super.CheckForRoofLimited(timeTresholdMS);
10873
10875 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10876 {
10877 m_PreviousRoofTestTime = time;
10878 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10879 }
10880 }
10881
10882
10884 {
10886 {
10887 return 0;
10888 }
10889
10890 if (GetInventory().GetAttachmentSlotsCount() != 0)
10891 {
10892 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10893 if (filter)
10894 return filter.GetProtectionLevel(type, false, system);
10895 else
10896 return 0;
10897 }
10898
10899 string subclassPath, entryName;
10900
10901 switch (type)
10902 {
10904 entryName = "biological";
10905 break;
10907 entryName = "chemical";
10908 break;
10909 default:
10910 entryName = "biological";
10911 break;
10912 }
10913
10914 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10915
10917 }
10918
10919
10920
10923 {
10924 if (!IsMagazine())
10926
10928 }
10929
10930
10931
10932
10933
10938 {
10939 return true;
10940 }
10941
10943 {
10945 }
10946
10947
10948
10949
10950
10952 {
10953 if (parent)
10954 {
10955 if (parent.IsInherited(DayZInfected))
10956 return true;
10957
10958 if (!parent.IsRuined())
10959 return true;
10960 }
10961
10962 return true;
10963 }
10964
10966 {
10967 if (!super.CanPutAsAttachment(parent))
10968 {
10969 return false;
10970 }
10971
10972 if (!IsRuined() && !parent.IsRuined())
10973 {
10974 return true;
10975 }
10976
10977 return false;
10978 }
10979
10981 {
10982
10983
10984
10985
10986 return super.CanReceiveItemIntoCargo(item);
10987 }
10988
10990 {
10991
10992
10993
10994
10995 GameInventory attachmentInv = attachment.GetInventory();
10997 {
10998 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10999 return false;
11000 }
11001
11002 InventoryLocation loc = new InventoryLocation();
11003 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11004 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11005 return false;
11006
11007 return super.CanReceiveAttachment(attachment, slotId);
11008 }
11009
11011 {
11012 if (!super.CanReleaseAttachment(attachment))
11013 return false;
11014
11015 return GetInventory().AreChildrenAccessible();
11016 }
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11039 {
11040 int id = muzzle_owner.GetMuzzleID();
11041 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11042
11043 if (WPOF_array)
11044 {
11045 for (int i = 0; i < WPOF_array.Count(); i++)
11046 {
11047 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11048
11049 if (WPOF)
11050 {
11051 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11052 }
11053 }
11054 }
11055 }
11056
11057
11059 {
11060 int id = muzzle_owner.GetMuzzleID();
11062
11063 if (WPOBE_array)
11064 {
11065 for (int i = 0; i < WPOBE_array.Count(); i++)
11066 {
11067 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11068
11069 if (WPOBE)
11070 {
11071 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11072 }
11073 }
11074 }
11075 }
11076
11077
11079 {
11080 int id = muzzle_owner.GetMuzzleID();
11081 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11082
11083 if (WPOOH_array)
11084 {
11085 for (int i = 0; i < WPOOH_array.Count(); i++)
11086 {
11087 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11088
11089 if (WPOOH)
11090 {
11091 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11092 }
11093 }
11094 }
11095 }
11096
11097
11099 {
11100 int id = muzzle_owner.GetMuzzleID();
11101 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11102
11103 if (WPOOH_array)
11104 {
11105 for (int i = 0; i < WPOOH_array.Count(); i++)
11106 {
11107 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11108
11109 if (WPOOH)
11110 {
11111 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11112 }
11113 }
11114 }
11115 }
11116
11117
11119 {
11120 int id = muzzle_owner.GetMuzzleID();
11121 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11122
11123 if (WPOOH_array)
11124 {
11125 for (int i = 0; i < WPOOH_array.Count(); i++)
11126 {
11127 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11128
11129 if (WPOOH)
11130 {
11131 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11132 }
11133 }
11134 }
11135 }
11136
11137
11138
11140 {
11142 {
11143 return true;
11144 }
11145
11146 return false;
11147 }
11148
11150 {
11152 {
11153 return true;
11154 }
11155
11156 return false;
11157 }
11158
11160 {
11162 {
11163 return true;
11164 }
11165
11166 return false;
11167 }
11168
11170 {
11171 return false;
11172 }
11173
11176 {
11177 return UATimeSpent.DEFAULT_DEPLOY;
11178 }
11179
11180
11181
11182
11184 {
11186 SetSynchDirty();
11187 }
11188
11190 {
11192 }
11193
11194
11196 {
11197 return false;
11198 }
11199
11202 {
11203 string att_type = "None";
11204
11205 if (ConfigIsExisting("soundAttType"))
11206 {
11207 att_type = ConfigGetString("soundAttType");
11208 }
11209
11211 }
11212
11214 {
11216 }
11217
11218
11219
11220
11221
11225
11227 {
11230
11232 }
11233
11234
11236 {
11238 return;
11239
11241
11244
11247
11248 SoundParameters params = new SoundParameters();
11252 }
11253
11254
11256 {
11258 return;
11259
11261 SetSynchDirty();
11262
11265 }
11266
11267
11269 {
11271 return;
11272
11274 SetSynchDirty();
11275
11278 }
11279
11281 {
11283 }
11284
11286 {
11288 }
11289
11292 {
11293 if (!
GetGame().IsDedicatedServer())
11294 {
11295 if (ConfigIsExisting("attachSoundSet"))
11296 {
11297 string cfg_path = "";
11298 string soundset = "";
11299 string type_name =
GetType();
11300
11303 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11304 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11305
11306 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11307 {
11308 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11309 {
11310 if (cfg_slot_array[i] == slot_type)
11311 {
11312 soundset = cfg_soundset_array[i];
11313 break;
11314 }
11315 }
11316 }
11317
11318 if (soundset != "")
11319 {
11320 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11322 }
11323 }
11324 }
11325 }
11326
11328 {
11329
11330 }
11331
11332 void OnApply(PlayerBase player);
11333
11335 {
11336 return 1.0;
11337 };
11338
11340 {
11342 }
11343
11345 {
11347 }
11348
11350
11352 {
11353 SetDynamicPhysicsLifeTime(0.01);
11355 }
11356
11358 {
11359 array<string> zone_names = new array<string>;
11360 GetDamageZones(zone_names);
11361 for (int i = 0; i < zone_names.Count(); i++)
11362 {
11363 SetHealthMax(zone_names.Get(i),"Health");
11364 }
11365 SetHealthMax("","Health");
11366 }
11367
11370 {
11371 float global_health = GetHealth01("","Health");
11372 array<string> zones = new array<string>;
11373 GetDamageZones(zones);
11374
11375 for (int i = 0; i < zones.Count(); i++)
11376 {
11377 SetHealth01(zones.Get(i),"Health",global_health);
11378 }
11379 }
11380
11383 {
11384 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11385 }
11386
11388 {
11389 if (!hasRootAsPlayer)
11390 {
11391 if (refParentIB)
11392 {
11393
11394 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11395 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11396
11397 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11398 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11399
11402 }
11403 else
11404 {
11405
11408 }
11409 }
11410 }
11411
11413 {
11415 {
11416 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11417 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11418 {
11419 float heatPermCoef = 1.0;
11421 while (ent)
11422 {
11423 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11424 ent = ent.GetHierarchyParent();
11425 }
11426
11427 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11428 }
11429 }
11430 }
11431
11433 {
11434
11435 EntityAI parent = GetHierarchyParent();
11436 if (!parent)
11437 {
11438 hasParent = false;
11439 hasRootAsPlayer = false;
11440 }
11441 else
11442 {
11443 hasParent = true;
11444 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11445 refParentIB =
ItemBase.Cast(parent);
11446 }
11447 }
11448
11449 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11450 {
11451
11452 }
11453
11455 {
11456
11457 return false;
11458 }
11459
11461 {
11462
11463
11464 return false;
11465 }
11466
11468 {
11469
11470 return false;
11471 }
11472
11475 {
11476 return !GetIsFrozen() &&
IsOpen();
11477 }
11478
11480 {
11481 bool hasParent = false, hasRootAsPlayer = false;
11483
11484 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11485 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11486
11487 if (wwtu || foodDecay)
11488 {
11492
11493 if (processWetness || processTemperature || processDecay)
11494 {
11496
11497 if (processWetness)
11498 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11499
11500 if (processTemperature)
11502
11503 if (processDecay)
11504 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11505 }
11506 }
11507 }
11508
11511 {
11513 }
11514
11516 {
11519
11520 return super.GetTemperatureFreezeThreshold();
11521 }
11522
11524 {
11527
11528 return super.GetTemperatureThawThreshold();
11529 }
11530
11532 {
11535
11536 return super.GetItemOverheatThreshold();
11537 }
11538
11540 {
11542 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11543
11544 return super.GetTemperatureFreezeTime();
11545 }
11546
11548 {
11550 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11551
11552 return super.GetTemperatureThawTime();
11553 }
11554
11559
11561 {
11562 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11563 }
11564
11566 {
11567 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11568 }
11569
11572 {
11574 }
11575
11577 {
11579 }
11580
11582 {
11584 }
11585
11588 {
11589 return null;
11590 }
11591
11594 {
11595 return false;
11596 }
11597
11599 {
11601 {
11604 if (!trg)
11605 {
11607 explosive = this;
11608 }
11609
11610 explosive.PairRemote(trg);
11612
11613 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11614 trg.SetPersistentPairID(persistentID);
11615 explosive.SetPersistentPairID(persistentID);
11616
11617 return true;
11618 }
11619 return false;
11620 }
11621
11624 {
11625 float ret = 1.0;
11628 ret *= GetHealth01();
11629
11630 return ret;
11631 }
11632
11633 #ifdef DEVELOPER
11634 override void SetDebugItem()
11635 {
11636 super.SetDebugItem();
11637 _itemBase = this;
11638 }
11639
11641 {
11642 string text = super.GetDebugText();
11643
11645 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11646
11647 return text;
11648 }
11649 #endif
11650
11652 {
11653 return true;
11654 }
11655
11657
11659
11661 {
11664 }
11665
11666
11674
11690}
11691
11693{
11695 if (entity)
11696 {
11697 bool is_item = entity.IsInherited(
ItemBase);
11698 if (is_item && full_quantity)
11699 {
11702 }
11703 }
11704 else
11705 {
11707 return NULL;
11708 }
11709 return entity;
11710}
11711
11713{
11714 if (item)
11715 {
11716 if (health > 0)
11717 item.SetHealth("", "", health);
11718
11719 if (item.CanHaveTemperature())
11720 {
11722 if (item.CanFreeze())
11723 item.SetFrozen(false);
11724 }
11725
11726 if (item.HasEnergyManager())
11727 {
11728 if (quantity >= 0)
11729 {
11730 item.GetCompEM().SetEnergy0To1(quantity);
11731 }
11732 else
11733 {
11735 }
11736 }
11737 else if (item.IsMagazine())
11738 {
11739 Magazine mag = Magazine.Cast(item);
11740 if (quantity >= 0)
11741 {
11742 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11743 }
11744 else
11745 {
11747 }
11748
11749 }
11750 else
11751 {
11752 if (quantity >= 0)
11753 {
11754 item.SetQuantityNormalized(quantity, false);
11755 }
11756 else
11757 {
11759 }
11760
11761 }
11762 }
11763}
11764
11765#ifdef DEVELOPER
11767#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.