6561{
6563 {
6564 return true;
6565 }
6566};
6567
6568
6569
6571{
6575
6577
6580
6581
6582
6583
6584
6593
6599
6604
6609
6630 protected bool m_IsResultOfSplit
6631
6633
6638
6639
6640
6642
6646
6647
6648
6650
6653
6654
6655
6661
6662
6670
6673
6674
6676
6677
6679
6680
6685
6686
6691
6692
6694
6695
6697 {
6702
6703 if (!
GetGame().IsDedicatedServer())
6704 {
6706 {
6708
6710 {
6712 }
6713 }
6714
6717 }
6718
6719 m_OldLocation = null;
6720
6722 {
6724 }
6725
6726 if (ConfigIsExisting("headSelectionsToHide"))
6727 {
6730 }
6731
6733 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6734 {
6736 }
6737
6739
6740 m_IsResultOfSplit = false;
6741
6743 }
6744
6746 {
6747 super.InitItemVariables();
6748
6754 m_Count = ConfigGetInt(
"count");
6755
6758
6763
6766
6771
6783
6787
6788
6791 if (ConfigIsExisting("canBeSplit"))
6792 {
6795 }
6796
6798 if (ConfigIsExisting("itemBehaviour"))
6800
6801
6804 RegisterNetSyncVariableInt("m_VarLiquidType");
6805 RegisterNetSyncVariableInt("m_Cleanness",0,1);
6806
6807 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
6808 RegisterNetSyncVariableFloat("m_ImpactSpeed");
6809 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
6810
6811 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
6812 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
6813 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
6814 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
6815
6816 RegisterNetSyncVariableBool("m_IsBeingPlaced");
6817 RegisterNetSyncVariableBool("m_IsTakeable");
6818 RegisterNetSyncVariableBool("m_IsHologram");
6819
6822 {
6825 }
6826
6828
6830 if (ConfigIsExisting("temperaturePerQuantityWeight"))
6832
6833 }
6834
6836 {
6838 }
6839
6841 {
6844 {
6849 }
6850 }
6851
6852 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
6853 {
6855 {
6858 }
6859
6861 }
6862
6864 {
6870 }
6871
6873
6875 {
6877
6878 if (!action)
6879 {
6880 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
6881 return;
6882 }
6883
6885 if (!ai)
6886 {
6888 return;
6889 }
6890
6892 if (!action_array)
6893 {
6894 action_array = new array<ActionBase_Basic>;
6896 }
6897 if (LogManager.IsActionLogEnable())
6898 {
6899 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
6900 }
6901
6902 if (action_array.Find(action) != -1)
6903 {
6904 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
6905 }
6906 else
6907 {
6908 action_array.Insert(action);
6909 }
6910 }
6911
6913 {
6915 ActionBase action = player.GetActionManager().GetAction(actionName);
6918
6919 if (action_array)
6920 {
6921 action_array.RemoveItem(action);
6922 }
6923 }
6924
6925
6926
6928 {
6929 ActionOverrideData overrideData = new ActionOverrideData();
6933
6935 if (!actionMap)
6936 {
6939 }
6940
6941 actionMap.Insert(this.
Type(), overrideData);
6942
6943 }
6944
6946
6948
6949
6951 {
6954
6957
6958 string config_to_search = "CfgVehicles";
6959 string muzzle_owner_config;
6960
6962 {
6963 if (IsInherited(Weapon))
6964 config_to_search = "CfgWeapons";
6965
6966 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6967
6968 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
6969
6971
6972 if (config_OnFire_subclass_count > 0)
6973 {
6974 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
6975
6976 for (int i = 0; i < config_OnFire_subclass_count; i++)
6977 {
6978 string particle_class = "";
6980 string config_OnFire_entry = config_OnFire_class + particle_class;
6981 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
6982 WPOF_array.Insert(WPOF);
6983 }
6984
6985
6987 }
6988 }
6989
6991 {
6992 config_to_search = "CfgWeapons";
6993 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
6994
6995 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
6996
6998
6999 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7000 {
7001 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7002
7003 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7004 {
7005 string particle_class2 = "";
7007 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7008 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7009 WPOBE_array.Insert(WPOBE);
7010 }
7011
7012
7014 }
7015 }
7016 }
7017
7018
7020 {
7023
7025 {
7026 string config_to_search = "CfgVehicles";
7027
7028 if (IsInherited(Weapon))
7029 config_to_search = "CfgWeapons";
7030
7031 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7032 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7033
7034 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7035 {
7036
7038
7040 {
7042 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7044 return;
7045 }
7046
7049
7050
7051
7053 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7054
7055 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7056 {
7057 string particle_class = "";
7059 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7061
7062 if (entry_type == CT_CLASS)
7063 {
7064 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7065 WPOOH_array.Insert(WPOF);
7066 }
7067 }
7068
7069
7071 }
7072 }
7073 }
7074
7076 {
7078 }
7079
7081 {
7083 {
7085
7088
7091
7092 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7093 }
7094 }
7095
7097 {
7099 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7100
7102 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7103
7105 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7106
7108 {
7110 }
7111 }
7112
7114 {
7116 }
7117
7119 {
7122 else
7124
7126 {
7129 }
7130 else
7131 {
7134
7137 }
7138
7140 }
7141
7143 {
7145 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7146 }
7147
7149 {
7151 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7153 }
7154
7156 {
7158 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7159 }
7160
7162 {
7165
7166 OverheatingParticle OP = new OverheatingParticle();
7171
7173 }
7174
7176 {
7179
7180 return -1;
7181 }
7182
7184 {
7186 {
7189
7190 for (int i = count; i > 0; --i)
7191 {
7192 int id = i - 1;
7195
7198
7199 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7200 {
7201 if (p)
7202 {
7205 }
7206 }
7207 }
7208 }
7209 }
7210
7212 {
7214 {
7216 {
7217 int id = i - 1;
7219
7220 if (OP)
7221 {
7223
7224 if (p)
7225 {
7227 }
7228
7229 delete OP;
7230 }
7231 }
7232
7235 }
7236 }
7237
7240 {
7241 return 0.0;
7242 }
7243
7244
7246 {
7247 return 250;
7248 }
7249
7251 {
7252 return 0;
7253 }
7254
7257 {
7259 return true;
7260
7261 return false;
7262 }
7263
7266 {
7269
7271 {
7273 }
7274 else
7275 {
7276
7278 }
7279
7281 }
7282
7289 {
7290 return -1;
7291 }
7292
7293
7294
7295
7297 {
7299 {
7301 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7302
7303 if (r_index >= 0)
7304 {
7305 InventoryLocation r_il = new InventoryLocation;
7306 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7307
7308 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7311 {
7312 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7313 }
7315 {
7316 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7317 }
7318
7319 }
7320
7321 player.GetHumanInventory().ClearUserReservedLocation(this);
7322 }
7323
7326 }
7327
7328
7329
7330
7332 {
7333 return ItemBase.m_DebugActionsMask;
7334 }
7335
7337 {
7338 return ItemBase.m_DebugActionsMask & mask;
7339 }
7340
7342 {
7343 ItemBase.m_DebugActionsMask = mask;
7344 }
7345
7347 {
7348 ItemBase.m_DebugActionsMask |= mask;
7349 }
7350
7352 {
7353 ItemBase.m_DebugActionsMask &= ~mask;
7354 }
7355
7357 {
7359 {
7361 }
7362 else
7363 {
7365 }
7366 }
7367
7368
7370 {
7371 if (GetEconomyProfile())
7372 {
7373 float q_max = GetEconomyProfile().GetQuantityMax();
7374 if (q_max > 0)
7375 {
7376 float q_min = GetEconomyProfile().GetQuantityMin();
7377 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7378
7380 {
7381 ComponentEnergyManager comp = GetCompEM();
7383 {
7385 }
7386 }
7388 {
7390
7391 }
7392
7393 }
7394 }
7395 }
7396
7399 {
7400 EntityAI parent = GetHierarchyParent();
7401
7402 if (parent)
7403 {
7404 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7405 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7406 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7407 }
7408 }
7409
7412 {
7413 EntityAI parent = GetHierarchyParent();
7414
7415 if (parent)
7416 {
7417 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7418 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7419 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7420 }
7421 }
7422
7424 {
7425
7426
7427
7428
7430
7432 {
7433 if (ScriptInputUserData.CanStoreInputUserData())
7434 {
7435 ScriptInputUserData ctx = new ScriptInputUserData;
7441 ctx.
Write(use_stack_max);
7444
7446 {
7447 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7448 }
7449 }
7450 }
7451 else if (!
GetGame().IsMultiplayer())
7452 {
7454 }
7455 }
7456
7458 {
7460 }
7461
7463 {
7465 }
7466
7468 {
7470 }
7471
7473 {
7474
7475 return false;
7476 }
7477
7479 {
7480 return false;
7481 }
7482
7486 {
7487 return false;
7488 }
7489
7491 {
7492 return "";
7493 }
7494
7496
7498 {
7499 return false;
7500 }
7501
7503 {
7504 return true;
7505 }
7506
7507
7508
7510 {
7511 return true;
7512 }
7513
7515 {
7516 return true;
7517 }
7518
7520 {
7521 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7523 }
7524
7526 {
7528 }
7529
7531 {
7533 if (!is_being_placed)
7535 SetSynchDirty();
7536 }
7537
7538
7540
7542 {
7544 }
7545
7547 {
7549 }
7550
7552 {
7553 return 1;
7554 }
7555
7557 {
7558 return false;
7559 }
7560
7562 {
7564 SetSynchDirty();
7565 }
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7602 {
7603 super.OnMovedInsideCargo(container);
7604
7605 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7606 }
7607
7608 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7609 {
7610 super.EEItemLocationChanged(oldLoc,newLoc);
7611
7612 PlayerBase new_player = null;
7613 PlayerBase old_player = null;
7614
7615 if (newLoc.GetParent())
7616 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7617
7618 if (oldLoc.GetParent())
7619 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7620
7622 {
7623 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7624
7625 if (r_index >= 0)
7626 {
7627 InventoryLocation r_il = new InventoryLocation;
7628 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7629
7630 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7633 {
7634 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7635 }
7637 {
7638 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7639 }
7640
7641 }
7642 }
7643
7645 {
7646 if (new_player)
7647 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7648
7649 if (new_player == old_player)
7650 {
7651
7652 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7653 {
7655 {
7656 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7657 {
7658 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7659 }
7660 }
7661 else
7662 {
7663 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7664 }
7665 }
7666
7667 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7668 {
7669 int type = oldLoc.GetType();
7671 {
7672 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7673 }
7675 {
7676 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7677 }
7678 }
7679 if (!m_OldLocation)
7680 {
7681 m_OldLocation = new InventoryLocation;
7682 }
7683 m_OldLocation.Copy(oldLoc);
7684 }
7685 else
7686 {
7687 if (m_OldLocation)
7688 {
7689 m_OldLocation.Reset();
7690 }
7691 }
7692
7694 }
7695 else
7696 {
7697 if (new_player)
7698 {
7699 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7700 if (res_index >= 0)
7701 {
7702 InventoryLocation il = new InventoryLocation;
7703 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7705 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7708 {
7709 il.
GetParent().GetOnReleaseLock().Invoke(it);
7710 }
7712 {
7714 }
7715
7716 }
7717 }
7719 {
7720
7722 }
7723
7724 if (m_OldLocation)
7725 {
7726 m_OldLocation.Reset();
7727 }
7728 }
7729 }
7730
7731 override void EOnContact(IEntity other, Contact extra)
7732 {
7734 {
7735 int liquidType = -1;
7737 if (impactSpeed > 0.0)
7738 {
7740 #ifndef SERVER
7742 #else
7744 SetSynchDirty();
7745 #endif
7747 }
7748 }
7749
7750 #ifdef SERVER
7751 if (GetCompEM() && GetCompEM().IsPlugged())
7752 {
7753 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7754 GetCompEM().UnplugThis();
7755 }
7756 #endif
7757 }
7758
7760
7762 {
7764 }
7765
7767 {
7768
7769 }
7770
7772 {
7773 super.OnItemLocationChanged(old_owner, new_owner);
7774
7775 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
7776 PlayerBase playerNew = PlayerBase.Cast(new_owner);
7777
7778 if (!relatedPlayer && playerNew)
7779 relatedPlayer = playerNew;
7780
7781 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
7782 {
7784 if (actionMgr)
7785 {
7786 ActionBase currentAction = actionMgr.GetRunningAction();
7787 if (currentAction)
7789 }
7790 }
7791
7792 Man ownerPlayerOld = null;
7793 Man ownerPlayerNew = null;
7794
7795 if (old_owner)
7796 {
7797 if (old_owner.
IsMan())
7798 {
7799 ownerPlayerOld = Man.Cast(old_owner);
7800 }
7801 else
7802 {
7803 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
7804 }
7805 }
7806 else
7807 {
7809 {
7811
7812 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
7813 {
7814 GetCompEM().UnplugThis();
7815 }
7816 }
7817 }
7818
7819 if (new_owner)
7820 {
7821 if (new_owner.
IsMan())
7822 {
7823 ownerPlayerNew = Man.Cast(new_owner);
7824 }
7825 else
7826 {
7827 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
7828 }
7829 }
7830
7831 if (ownerPlayerOld != ownerPlayerNew)
7832 {
7833 if (ownerPlayerOld)
7834 {
7835 array<EntityAI> subItemsExit = new array<EntityAI>;
7837 for (int i = 0; i < subItemsExit.Count(); i++)
7838 {
7841 }
7842 }
7843
7844 if (ownerPlayerNew)
7845 {
7846 array<EntityAI> subItemsEnter = new array<EntityAI>;
7848 for (int j = 0; j < subItemsEnter.Count(); j++)
7849 {
7852 }
7853 }
7854 }
7855 else if (ownerPlayerNew != null)
7856 {
7857 PlayerBase nplayer;
7858 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
7859 {
7860 array<EntityAI> subItemsUpdate = new array<EntityAI>;
7862 for (int k = 0; k < subItemsUpdate.Count(); k++)
7863 {
7865 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
7866 }
7867 }
7868 }
7869
7870 if (old_owner)
7871 old_owner.OnChildItemRemoved(this);
7872 if (new_owner)
7873 new_owner.OnChildItemReceived(this);
7874 }
7875
7876
7878 {
7879 super.EEDelete(parent);
7880 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
7881 if (player)
7882 {
7884
7885 if (player.IsAlive())
7886 {
7887 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7888 if (r_index >= 0)
7889 {
7890 InventoryLocation r_il = new InventoryLocation;
7891 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7892
7893 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7896 {
7897 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7898 }
7900 {
7901 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7902 }
7903
7904 }
7905
7906 player.RemoveQuickBarEntityShortcut(this);
7907 }
7908 }
7909 }
7910
7912 {
7913 super.EEKilled(killer);
7914
7917 {
7918 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
7919 {
7920 if (IsMagazine())
7921 {
7922 if (Magazine.Cast(this).GetAmmoCount() > 0)
7923 {
7925 }
7926 }
7927 else
7928 {
7930 }
7931 }
7932 }
7933 }
7934
7936 {
7937 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7938
7939 super.OnWasAttached(parent, slot_id);
7940
7943
7945 }
7946
7948 {
7949 super.OnWasDetached(parent, slot_id);
7950
7953 }
7954
7956 {
7957 int idx;
7960
7961 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7962 if (inventory_slots.Count() < 1)
7963 {
7964 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
7965 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
7966 }
7967 else
7968 {
7969 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
7970 }
7971
7972 idx = inventory_slots.Find(slot);
7973 if (idx < 0)
7974 return "";
7975
7976 return attach_types.Get(idx);
7977 }
7978
7980 {
7981 int idx = -1;
7982 string slot;
7983
7986
7987 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
7988 if (inventory_slots.Count() < 1)
7989 {
7990 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
7991 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7992 }
7993 else
7994 {
7995 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
7996 if (detach_types.Count() < 1)
7997 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
7998 }
7999
8000 for (int i = 0; i < inventory_slots.Count(); i++)
8001 {
8002 slot = inventory_slots.Get(i);
8003 }
8004
8005 if (slot != "")
8006 {
8007 if (detach_types.Count() == 1)
8008 idx = 0;
8009 else
8010 idx = inventory_slots.Find(slot);
8011 }
8012 if (idx < 0)
8013 return "";
8014
8015 return detach_types.Get(idx);
8016 }
8017
8019 {
8020
8022
8023
8024 float min_time = 1;
8025 float max_time = 3;
8026 float delay = Math.RandomFloat(min_time, max_time);
8027
8028 explode_timer.Run(delay, this, "DoAmmoExplosion");
8029 }
8030
8032 {
8033 Magazine magazine = Magazine.Cast(this);
8034 int pop_sounds_count = 6;
8035 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8036
8037
8038 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8039 string sound_name = pop_sounds[ sound_idx ];
8041
8042
8043 magazine.ServerAddAmmoCount(-1);
8044
8045
8046 float min_temp_to_explode = 100;
8047
8048 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
8049 {
8051 }
8052 }
8053
8054
8055 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8056 {
8057 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8058
8059 const int CHANCE_DAMAGE_CARGO = 4;
8060 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8061 const int CHANCE_DAMAGE_NOTHING = 2;
8062
8064 {
8065 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8066 int chances;
8067 int rnd;
8068
8069 if (GetInventory().GetCargo())
8070 {
8071 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8072 rnd = Math.RandomInt(0,chances);
8073
8074 if (rnd < CHANCE_DAMAGE_CARGO)
8075 {
8077 }
8078 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8079 {
8081 }
8082 }
8083 else
8084 {
8085 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8086 rnd = Math.RandomInt(0,chances);
8087
8088 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8089 {
8091 }
8092 }
8093 }
8094 }
8095
8097 {
8098 if (GetInventory().GetCargo())
8099 {
8100 int item_count = GetInventory().GetCargo().GetItemCount();
8101 if (item_count > 0)
8102 {
8103 int random_pick = Math.RandomInt(0, item_count);
8105 if (!item.IsExplosive())
8106 {
8107 item.AddHealth("","",damage);
8108 return true;
8109 }
8110 }
8111 }
8112 return false;
8113 }
8114
8116 {
8117 int attachment_count = GetInventory().AttachmentCount();
8118 if (attachment_count > 0)
8119 {
8120 int random_pick = Math.RandomInt(0, attachment_count);
8121 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8122 if (!attachment.IsExplosive())
8123 {
8124 attachment.AddHealth("","",damage);
8125 return true;
8126 }
8127 }
8128 return false;
8129 }
8130
8132 {
8134 }
8135
8137 {
8139 return GetInventory().CanRemoveEntity();
8140
8141 return false;
8142 }
8143
8145 {
8146
8148 return false;
8149
8150
8152 return false;
8153
8154
8155
8157 if (delta == 0)
8158 return false;
8159
8160
8161 return true;
8162 }
8163
8165 {
8167 {
8168 if (ScriptInputUserData.CanStoreInputUserData())
8169 {
8170 ScriptInputUserData ctx = new ScriptInputUserData;
8175 ctx.
Write(destination_entity);
8179 }
8180 }
8181 else if (!
GetGame().IsMultiplayer())
8182 {
8184 }
8185 }
8186
8188 {
8189 float split_quantity_new;
8193 InventoryLocation loc = new InventoryLocation;
8194
8195 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8196 {
8198 split_quantity_new = stack_max;
8199 else
8201
8203 {
8204 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8205 if (new_item)
8206 {
8207 new_item.SetResultOfSplit(true);
8208 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8210 new_item.
SetQuantity(split_quantity_new,
false,
true);
8211 }
8212 }
8213 }
8214 else if (destination_entity && slot_id == -1)
8215 {
8216 if (quantity > stack_max)
8217 split_quantity_new = stack_max;
8218 else
8219 split_quantity_new = quantity;
8220
8222 {
8224 {
8227 }
8228
8229 if (new_item)
8230 {
8231 new_item.SetResultOfSplit(true);
8232 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8234 new_item.
SetQuantity(split_quantity_new,
false,
true);
8235 }
8236 }
8237 }
8238 else
8239 {
8240 if (stack_max != 0)
8241 {
8243 {
8245 }
8246
8247 if (split_quantity_new == 0)
8248 {
8249 if (!
GetGame().IsMultiplayer())
8250 player.PhysicalPredictiveDropItem(this);
8251 else
8252 player.ServerDropEntity(this);
8253 return;
8254 }
8255
8257 {
8259
8260 if (new_item)
8261 {
8262 new_item.SetResultOfSplit(true);
8263 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8266 new_item.PlaceOnSurface();
8267 }
8268 }
8269 }
8270 }
8271 }
8272
8274 {
8275 float split_quantity_new;
8279 InventoryLocation loc = new InventoryLocation;
8280
8281 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8282 {
8284 split_quantity_new = stack_max;
8285 else
8287
8289 {
8290 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8291 if (new_item)
8292 {
8293 new_item.SetResultOfSplit(true);
8294 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8296 new_item.
SetQuantity(split_quantity_new,
false,
true);
8297 }
8298 }
8299 }
8300 else if (destination_entity && slot_id == -1)
8301 {
8302 if (quantity > stack_max)
8303 split_quantity_new = stack_max;
8304 else
8305 split_quantity_new = quantity;
8306
8308 {
8310 {
8313 }
8314
8315 if (new_item)
8316 {
8317 new_item.SetResultOfSplit(true);
8318 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8320 new_item.
SetQuantity(split_quantity_new,
false,
true);
8321 }
8322 }
8323 }
8324 else
8325 {
8326 if (stack_max != 0)
8327 {
8329 {
8331 }
8332
8334 {
8336
8337 if (new_item)
8338 {
8339 new_item.SetResultOfSplit(true);
8340 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8343 new_item.PlaceOnSurface();
8344 }
8345 }
8346 }
8347 }
8348 }
8349
8351 {
8353 {
8354 if (ScriptInputUserData.CanStoreInputUserData())
8355 {
8356 ScriptInputUserData ctx = new ScriptInputUserData;
8361 dst.WriteToContext(ctx);
8363 }
8364 }
8365 else if (!
GetGame().IsMultiplayer())
8366 {
8368 }
8369 }
8370
8372 {
8374 {
8375 if (ScriptInputUserData.CanStoreInputUserData())
8376 {
8377 ScriptInputUserData ctx = new ScriptInputUserData;
8382 ctx.
Write(destination_entity);
8388 }
8389 }
8390 else if (!
GetGame().IsMultiplayer())
8391 {
8393 }
8394 }
8395
8397 {
8399 }
8400
8402 {
8404 float split_quantity_new;
8406 if (dst.IsValid())
8407 {
8408 int slot_id = dst.GetSlot();
8410
8411 if (quantity > stack_max)
8412 split_quantity_new = stack_max;
8413 else
8414 split_quantity_new = quantity;
8415
8417 {
8419
8420 if (new_item)
8421 {
8422 new_item.SetResultOfSplit(true);
8423 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8425 new_item.
SetQuantity(split_quantity_new,
false,
true);
8426 }
8427
8428 return new_item;
8429 }
8430 }
8431
8432 return null;
8433 }
8434
8436 {
8438 float split_quantity_new;
8440 if (destination_entity)
8441 {
8443 if (quantity > stackable)
8444 split_quantity_new = stackable;
8445 else
8446 split_quantity_new = quantity;
8447
8449 {
8450 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8451 if (new_item)
8452 {
8453 new_item.SetResultOfSplit(true);
8454 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8456 new_item.
SetQuantity(split_quantity_new,
false,
true);
8457 }
8458 }
8459 }
8460 }
8461
8463 {
8465 {
8466 if (ScriptInputUserData.CanStoreInputUserData())
8467 {
8468 ScriptInputUserData ctx = new ScriptInputUserData;
8473 ItemBase destination_entity =
this;
8474 ctx.
Write(destination_entity);
8478 }
8479 }
8480 else if (!
GetGame().IsMultiplayer())
8481 {
8483 }
8484 }
8485
8487 {
8489 float split_quantity_new;
8491 if (player)
8492 {
8494 if (quantity > stackable)
8495 split_quantity_new = stackable;
8496 else
8497 split_quantity_new = quantity;
8498
8500 {
8501 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8502 new_item =
ItemBase.Cast(in_hands);
8503 if (new_item)
8504 {
8505 new_item.SetResultOfSplit(true);
8506 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8508 new_item.SetQuantity(split_quantity_new, false, true);
8509 }
8510 }
8511 }
8512 }
8513
8515 {
8517 float split_quantity_new = Math.Floor(quantity * 0.5);
8518
8520 return;
8521
8523
8524 if (new_item)
8525 {
8526 if (new_item.GetQuantityMax() < split_quantity_new)
8527 {
8528 split_quantity_new = new_item.GetQuantityMax();
8529 }
8530
8531 new_item.SetResultOfSplit(true);
8532 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8533
8535 {
8538 }
8539 else
8540 {
8542 new_item.
SetQuantity(split_quantity_new,
false,
true);
8543 }
8544 }
8545 }
8546
8548 {
8550 float split_quantity_new = Math.Floor(quantity / 2);
8551
8553 return;
8554
8555 InventoryLocation invloc = new InventoryLocation;
8557
8559 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8560
8561 if (new_item)
8562 {
8563 if (new_item.GetQuantityMax() < split_quantity_new)
8564 {
8565 split_quantity_new = new_item.GetQuantityMax();
8566 }
8568 {
8571 }
8572 else if (split_quantity_new > 1)
8573 {
8575 new_item.
SetQuantity(split_quantity_new,
false,
true);
8576 }
8577 }
8578 }
8579
8582 {
8583 SetWeightDirty();
8585
8586 if (parent)
8587 parent.OnAttachmentQuantityChangedEx(this, delta);
8588
8590 {
8592 {
8594 }
8596 {
8597 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8599 }
8600 }
8601
8602 }
8603
8606 {
8607
8608 }
8609
8612 {
8614 }
8615
8617 {
8618 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8619
8621 {
8622 if (newLevel == GameConstants.STATE_RUINED)
8623 {
8625 EntityAI parent = GetHierarchyParent();
8626 if (parent && parent.IsFireplace())
8627 {
8628 CargoBase cargo = GetInventory().GetCargo();
8629 if (cargo)
8630 {
8632 {
8634 }
8635 }
8636 }
8637 }
8638
8640 {
8641
8643 return;
8644 }
8645
8646 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8647 {
8649 }
8650 }
8651 }
8652
8653
8655 {
8656 super.OnRightClick();
8657
8659 {
8661 {
8662 if (ScriptInputUserData.CanStoreInputUserData())
8663 {
8664 EntityAI root = GetHierarchyRoot();
8665 Man playerOwner = GetHierarchyRootPlayer();
8666 InventoryLocation dst = new InventoryLocation;
8667
8668
8669 if (!playerOwner && root && root == this)
8670 {
8672 }
8673 else
8674 {
8675
8676 GetInventory().GetCurrentInventoryLocation(dst);
8678 {
8681 {
8683 }
8684 else
8685 {
8687
8688
8689 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8690 {
8692 }
8693 else
8694 {
8695 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8696 }
8697 }
8698 }
8699 }
8700
8701 ScriptInputUserData ctx = new ScriptInputUserData;
8709 }
8710 }
8711 else if (!
GetGame().IsMultiplayer())
8712 {
8714 }
8715 }
8716 }
8717
8719 {
8720 if (root)
8721 {
8722 vector m4[4];
8723 root.GetTransform(m4);
8724 dst.SetGround(this, m4);
8725 }
8726 else
8727 {
8728 GetInventory().GetCurrentInventoryLocation(dst);
8729 }
8730 }
8731
8732 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8733 {
8734
8735 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8736 return false;
8737
8738 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8739 return false;
8740
8741
8743 return false;
8744
8745
8746 Magazine mag = Magazine.Cast(this);
8747 if (mag)
8748 {
8749 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8750 return false;
8751
8752 if (stack_max_limit)
8753 {
8754 Magazine other_mag = Magazine.Cast(other_item);
8755 if (other_item)
8756 {
8757 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8758 return false;
8759 }
8760
8761 }
8762 }
8763 else
8764 {
8765
8767 return false;
8768
8770 return false;
8771 }
8772
8773 PlayerBase player = null;
8774 if (CastTo(player, GetHierarchyRootPlayer()))
8775 {
8776 if (player.GetInventory().HasAttachment(this))
8777 return false;
8778
8779 if (player.IsItemsToDelete())
8780 return false;
8781 }
8782
8783 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8784 return false;
8785
8786 int slotID;
8788 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8789 return false;
8790
8791 return true;
8792 }
8793
8795 {
8797 }
8798
8800 {
8801 return m_IsResultOfSplit;
8802 }
8803
8805 {
8806 m_IsResultOfSplit = value;
8807 }
8808
8810 {
8812 }
8813
8815 {
8816 float other_item_quantity = other_item.GetQuantity();
8817 float this_free_space;
8818
8820
8822
8823 if (other_item_quantity > this_free_space)
8824 {
8825 return this_free_space;
8826 }
8827 else
8828 {
8829 return other_item_quantity;
8830 }
8831 }
8832
8834 {
8836 }
8837
8839 {
8841 return;
8842
8843 if (!IsMagazine() && other_item)
8844 {
8846 if (quantity_used != 0)
8847 {
8848 float hp1 = GetHealth01("","");
8849 float hp2 = other_item.GetHealth01("","");
8850 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8851 hpResult = hpResult / (
GetQuantity() + quantity_used);
8852
8853 hpResult *= GetMaxHealth();
8854 Math.Round(hpResult);
8855 SetHealth("", "Health", hpResult);
8856
8858 other_item.AddQuantity(-quantity_used);
8859 }
8860 }
8862 }
8863
8865 {
8866 #ifdef SERVER
8867 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8868 GetHierarchyParent().IncreaseLifetimeUp();
8869 #endif
8870 };
8871
8873 {
8874 PlayerBase p = PlayerBase.Cast(player);
8875
8876 array<int> recipesIds = p.m_Recipes;
8877 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8878 if (moduleRecipesManager)
8879 {
8880 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8881 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8882 }
8883
8884 for (int i = 0;i < recipesIds.Count(); i++)
8885 {
8886 int key = recipesIds.Get(i);
8887 string recipeName = moduleRecipesManager.GetRecipeName(key);
8889 }
8890 }
8891
8892
8893 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8894 {
8895 super.GetDebugActions(outputList);
8896
8897
8903
8904
8909
8914
8915
8919
8920
8922 {
8926 }
8927
8930
8931
8935
8937
8938 InventoryLocation loc = new InventoryLocation();
8939 GetInventory().GetCurrentInventoryLocation(loc);
8941 {
8942 if (Gizmo_IsSupported())
8945 }
8946
8948 }
8949
8950
8951
8952
8954 {
8955 super.OnAction(action_id, player, ctx);
8956
8958 {
8959 switch (action_id)
8960 {
8963 return true;
8966 return true;
8967 }
8968 }
8969
8971 {
8972 switch (action_id)
8973 {
8975 Delete();
8976 return true;
8977 }
8978 }
8979
8980 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8981 {
8982 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8983 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8984 PlayerBase p = PlayerBase.Cast(player);
8985 if (
EActions.RECIPES_RANGE_START < 1000)
8986 {
8987 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8988 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8989 }
8990 }
8991 #ifndef SERVER
8992 else if (action_id ==
EActions.WATCH_PLAYER)
8993 {
8994 PluginDeveloper.SetDeveloperItemClientEx(player);
8995 }
8996 #endif
8998 {
8999 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9000 {
9001 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9002 OnDebugButtonPressServer(id + 1);
9003 }
9004
9005 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9006 {
9007 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9009 }
9010
9011 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9012 {
9013 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9015 }
9016
9017 else if (action_id ==
EActions.ADD_QUANTITY)
9018 {
9019 if (IsMagazine())
9020 {
9021 Magazine mag = Magazine.Cast(this);
9022 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9023 }
9024 else
9025 {
9027 }
9028
9029 if (m_EM)
9030 {
9031 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9032 }
9033
9034 }
9035
9036 else if (action_id ==
EActions.REMOVE_QUANTITY)
9037 {
9038 if (IsMagazine())
9039 {
9040 Magazine mag2 = Magazine.Cast(this);
9041 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9042 }
9043 else
9044 {
9046 }
9047 if (m_EM)
9048 {
9049 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9050 }
9051
9052 }
9053
9054 else if (action_id ==
EActions.SET_QUANTITY_0)
9055 {
9057
9058 if (m_EM)
9059 {
9060 m_EM.SetEnergy(0);
9061 }
9062 }
9063
9064 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9065 {
9067
9068 if (m_EM)
9069 {
9070 m_EM.SetEnergy(m_EM.GetEnergyMax());
9071 }
9072 }
9073
9074 else if (action_id ==
EActions.ADD_HEALTH)
9075 {
9076 AddHealth("","",GetMaxHealth("","Health")/5);
9077 }
9078 else if (action_id ==
EActions.REMOVE_HEALTH)
9079 {
9080 AddHealth("","",-GetMaxHealth("","Health")/5);
9081 }
9082 else if (action_id ==
EActions.DESTROY_HEALTH)
9083 {
9084 SetHealth01("","",0);
9085 }
9086 else if (action_id ==
EActions.WATCH_ITEM)
9087 {
9089 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9090 #ifdef DEVELOPER
9091 SetDebugDeveloper_item(this);
9092 #endif
9093 }
9094
9095 else if (action_id ==
EActions.ADD_TEMPERATURE)
9096 {
9097 AddTemperature(20);
9098
9099 }
9100
9101 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9102 {
9103 AddTemperature(-20);
9104
9105 }
9106
9107 else if (action_id ==
EActions.FLIP_FROZEN)
9108 {
9109 SetFrozen(!GetIsFrozen());
9110
9111 }
9112
9113 else if (action_id ==
EActions.ADD_WETNESS)
9114 {
9116
9117 }
9118
9119 else if (action_id ==
EActions.REMOVE_WETNESS)
9120 {
9122
9123 }
9124
9125 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9126 {
9129
9130
9131 }
9132
9133 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9134 {
9137 }
9138
9139 else if (action_id ==
EActions.MAKE_SPECIAL)
9140 {
9141 auto debugParams = DebugSpawnParams.WithPlayer(player);
9142 OnDebugSpawnEx(debugParams);
9143 }
9144
9145 }
9146
9147
9148 return false;
9149 }
9150
9151
9152
9153
9157
9160
9161
9162
9164 {
9165 return false;
9166 }
9167
9168
9170 {
9171 return true;
9172 }
9173
9174
9176 {
9177 return true;
9178 }
9179
9180
9181
9183 {
9184 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9186 }
9187
9190 {
9191 return null;
9192 }
9193
9195 {
9196 return false;
9197 }
9198
9200 {
9201 return false;
9202 }
9203
9207
9208
9210 {
9211 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9212 return module_repairing.CanRepair(this, item_repair_kit);
9213 }
9214
9215
9216 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9217 {
9218 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9219 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9220 }
9221
9222
9224 {
9225
9226
9227
9228
9229
9230
9231
9232
9233 return 1;
9234 }
9235
9236
9237
9239 {
9241 }
9242
9243
9244
9246 {
9248 }
9249
9250
9259 {
9260 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9261
9262 if (player)
9263 {
9264 player.MessageStatus(text);
9265 }
9266 }
9267
9268
9277 {
9278 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9279
9280 if (player)
9281 {
9282 player.MessageAction(text);
9283 }
9284 }
9285
9286
9295 {
9296 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9297
9298 if (player)
9299 {
9300 player.MessageFriendly(text);
9301 }
9302 }
9303
9304
9313 {
9314 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9315
9316 if (player)
9317 {
9318 player.MessageImportant(text);
9319 }
9320 }
9321
9323 {
9324 return true;
9325 }
9326
9327
9328 override bool KindOf(
string tag)
9329 {
9330 bool found = false;
9331 string item_name = this.
GetType();
9334
9335 int array_size = item_tag_array.Count();
9336 for (int i = 0; i < array_size; i++)
9337 {
9338 if (item_tag_array.Get(i) == tag)
9339 {
9340 found = true;
9341 break;
9342 }
9343 }
9344 return found;
9345 }
9346
9347
9349 {
9350
9351 super.OnRPC(sender, rpc_type,ctx);
9352
9353
9354 switch (rpc_type)
9355 {
9356 #ifndef SERVER
9357 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9358 Param2<bool, string> p = new Param2<bool, string>(false, "");
9359
9361 return;
9362
9363 bool play = p.param1;
9364 string soundSet = p.param2;
9365
9366 if (play)
9367 {
9369 {
9371 {
9373 }
9374 }
9375 else
9376 {
9378 }
9379 }
9380 else
9381 {
9383 }
9384
9385 break;
9386 #endif
9387
9388 }
9389
9391 {
9393 }
9394 }
9395
9396
9397
9398
9400 {
9401 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9402 return plugin.GetID(
name);
9403 }
9404
9406 {
9407 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9408 return plugin.GetName(id);
9409 }
9410
9413 {
9414
9415
9416 int varFlags;
9417 if (!ctx.
Read(varFlags))
9418 return;
9419
9420 if (varFlags & ItemVariableFlags.FLOAT)
9421 {
9423 }
9424 }
9425
9427 {
9428
9429 super.SerializeNumericalVars(floats_out);
9430
9431
9432
9434 {
9436 }
9437
9439 {
9441 }
9442
9444 {
9446 }
9447
9449 {
9454 }
9455
9457 {
9459 }
9460 }
9461
9463 {
9464
9465 super.DeSerializeNumericalVars(floats);
9466
9467
9468 int index = 0;
9469 int mask = Math.Round(floats.Get(index));
9470
9471 index++;
9472
9474 {
9476 {
9478 }
9479 else
9480 {
9481 float quantity = floats.Get(index);
9483 }
9484 index++;
9485 }
9486
9488 {
9489 float wet = floats.Get(index);
9491 index++;
9492 }
9493
9495 {
9496 int liquidtype = Math.Round(floats.Get(index));
9498 index++;
9499 }
9500
9502 {
9504 index++;
9506 index++;
9508 index++;
9510 index++;
9511 }
9512
9514 {
9515 int cleanness = Math.Round(floats.Get(index));
9517 index++;
9518 }
9519 }
9520
9522 {
9523 super.WriteVarsToCTX(ctx);
9524
9525
9527 {
9529 }
9530
9532 {
9534 }
9535
9537 {
9539 }
9540
9542 {
9543 int r,g,b,a;
9549 }
9550
9552 {
9554 }
9555 }
9556
9558 {
9559 if (!super.ReadVarsFromCTX(ctx,version))
9560 return false;
9561
9562 int intValue;
9563 float value;
9564
9565 if (version < 140)
9566 {
9567 if (!ctx.
Read(intValue))
9568 return false;
9569
9570 m_VariablesMask = intValue;
9571 }
9572
9574 {
9575 if (!ctx.
Read(value))
9576 return false;
9577
9579 {
9581 }
9582 else
9583 {
9585 }
9586 }
9587
9588 if (version < 140)
9589 {
9591 {
9592 if (!ctx.
Read(value))
9593 return false;
9594 SetTemperatureDirect(value);
9595 }
9596 }
9597
9599 {
9600 if (!ctx.
Read(value))
9601 return false;
9603 }
9604
9606 {
9607 if (!ctx.
Read(intValue))
9608 return false;
9610 }
9611
9613 {
9614 int r,g,b,a;
9616 return false;
9618 return false;
9620 return false;
9622 return false;
9623
9625 }
9626
9628 {
9629 if (!ctx.
Read(intValue))
9630 return false;
9632 }
9633
9634 if (version >= 138 && version < 140)
9635 {
9637 {
9638 if (!ctx.
Read(intValue))
9639 return false;
9640 SetFrozen(intValue);
9641 }
9642 }
9643
9644 return true;
9645 }
9646
9647
9649 {
9652 {
9654 }
9655
9656 if (!super.OnStoreLoad(ctx, version))
9657 {
9659 return false;
9660 }
9661
9662 if (version >= 114)
9663 {
9664 bool hasQuickBarIndexSaved;
9665
9666 if (!ctx.
Read(hasQuickBarIndexSaved))
9667 {
9669 return false;
9670 }
9671
9672 if (hasQuickBarIndexSaved)
9673 {
9674 int itmQBIndex;
9675
9676
9677 if (!ctx.
Read(itmQBIndex))
9678 {
9680 return false;
9681 }
9682
9683 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9684 if (itmQBIndex != -1 && parentPlayer)
9685 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9686 }
9687 }
9688 else
9689 {
9690
9691 PlayerBase player;
9692 int itemQBIndex;
9693 if (version ==
int.
MAX)
9694 {
9695 if (!ctx.
Read(itemQBIndex))
9696 {
9698 return false;
9699 }
9700 }
9701 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9702 {
9703
9704 if (!ctx.
Read(itemQBIndex))
9705 {
9707 return false;
9708 }
9709 if (itemQBIndex != -1 && player)
9710 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9711 }
9712 }
9713
9714 if (version < 140)
9715 {
9716
9717 if (!LoadVariables(ctx, version))
9718 {
9720 return false;
9721 }
9722 }
9723
9724
9726 {
9728 return false;
9729 }
9730 if (version >= 132)
9731 {
9733 if (raib)
9734 {
9736 {
9738 return false;
9739 }
9740 }
9741 }
9742
9744 return true;
9745 }
9746
9747
9748
9750 {
9751 super.OnStoreSave(ctx);
9752
9753 PlayerBase player;
9754 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9755 {
9757
9758 int itemQBIndex = -1;
9759 itemQBIndex = player.FindQuickBarEntityIndex(this);
9760 ctx.
Write(itemQBIndex);
9761 }
9762 else
9763 {
9765 }
9766
9768
9770 if (raib)
9771 {
9773 }
9774 }
9775
9776
9778 {
9779 super.AfterStoreLoad();
9780
9782 {
9784 }
9785
9787 {
9790 }
9791 }
9792
9794 {
9795 super.EEOnAfterLoad();
9796
9798 {
9800 }
9801
9804 }
9805
9807 {
9808 return false;
9809 }
9810
9811
9812
9814 {
9816 {
9817 #ifdef PLATFORM_CONSOLE
9818
9820 {
9822 if (menu)
9823 {
9825 }
9826 }
9827 #endif
9828 }
9829
9831 {
9834 }
9835
9837 {
9838 SetWeightDirty();
9840 }
9842 {
9845 }
9846
9848 {
9851 }
9853 {
9856 }
9857
9858 super.OnVariablesSynchronized();
9859 }
9860
9861
9862
9864 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9865 {
9866 if (!IsServerCheck(allow_client))
9867 return false;
9868
9870 return false;
9871
9874
9875 if (value <= (min + 0.001))
9876 value = min;
9877
9878 if (value == min)
9879 {
9880 if (destroy_config)
9881 {
9882 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9883 if (dstr)
9884 {
9886 this.Delete();
9887 return true;
9888 }
9889 }
9890 else if (destroy_forced)
9891 {
9893 this.Delete();
9894 return true;
9895 }
9896
9898 }
9899
9902
9904 {
9906
9907 if (delta)
9909 }
9910
9912
9913 return false;
9914 }
9915
9916
9918 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9919 {
9921 }
9922
9924 {
9927 }
9928
9930 {
9933 }
9934
9936 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9937 {
9938 float value_clamped = Math.Clamp(value, 0, 1);
9940 SetQuantity(result, destroy_config, destroy_forced);
9941 }
9942
9943
9946 {
9948 }
9949
9951 {
9953 }
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9965 {
9966 int slot = -1;
9967 if (GetInventory())
9968 {
9969 InventoryLocation il = new InventoryLocation;
9970 GetInventory().GetCurrentInventoryLocation(il);
9972 }
9973
9975 }
9976
9978 {
9979 float quantity_max = 0;
9980
9982 {
9983 if (attSlotID != -1)
9984 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9985
9986 if (quantity_max <= 0)
9988 }
9989
9990 if (quantity_max <= 0)
9992
9993 return quantity_max;
9994 }
9995
9997 {
9999 }
10000
10002 {
10004 }
10005
10006
10008 {
10010 }
10011
10013 {
10015 }
10016
10018 {
10020 }
10021
10022
10024 {
10025
10026 float weightEx = GetWeightEx();
10027 float special = GetInventoryAndCargoWeight();
10028 return weightEx - special;
10029 }
10030
10031
10033 {
10035 }
10036
10038 {
10040 {
10041 #ifdef DEVELOPER
10042 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10043 {
10044 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10046 }
10047 #endif
10048
10049 return GetQuantity() * GetConfigWeightModified();
10050 }
10051 else if (HasEnergyManager())
10052 {
10053 #ifdef DEVELOPER
10054 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10055 {
10056 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10057 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10058 }
10059 #endif
10060 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
10061 }
10062 else
10063 {
10064 #ifdef DEVELOPER
10065 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10066 {
10067 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10068 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10069 }
10070 #endif
10071 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
10072 }
10073 }
10074
10077 {
10078 int item_count = 0;
10080
10081 if (GetInventory().GetCargo() != NULL)
10082 {
10083 item_count = GetInventory().GetCargo().GetItemCount();
10084 }
10085
10086 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10087 {
10088 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10089 if (item)
10090 item_count += item.GetNumberOfItems();
10091 }
10092 return item_count;
10093 }
10094
10097 {
10098 float weight = 0;
10099 float wetness = 1;
10100 if (include_wetness)
10103 {
10104 weight = wetness * m_ConfigWeight;
10105 }
10107 {
10108 weight = 1;
10109 }
10110 return weight;
10111 }
10112
10113
10114
10116 {
10117 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10118 {
10119 GameInventory inv = GetInventory();
10120 array<EntityAI> items = new array<EntityAI>;
10122 for (int i = 0; i < items.Count(); i++)
10123 {
10125 if (item)
10126 {
10128 }
10129 }
10130 }
10131 }
10132
10133
10134
10135
10137 {
10138 float energy = 0;
10139 if (HasEnergyManager())
10140 {
10141 energy = GetCompEM().GetEnergy();
10142 }
10143 return energy;
10144 }
10145
10146
10148 {
10149 super.OnEnergyConsumed();
10150
10152 }
10153
10155 {
10156 super.OnEnergyAdded();
10157
10159 }
10160
10161
10163 {
10164 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10165 {
10167 {
10168 float energy_0to1 = GetCompEM().GetEnergy0To1();
10170 }
10171 }
10172 }
10173
10174
10176 {
10177 return ConfigGetFloat("heatIsolation");
10178 }
10179
10181 {
10183 }
10184
10186 {
10187 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10188 if (
GetGame().ConfigIsExisting(paramPath))
10190
10191 return 0.0;
10192 }
10193
10195 {
10196 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10197 if (
GetGame().ConfigIsExisting(paramPath))
10199
10200 return 0.0;
10201 }
10202
10203 override void SetWet(
float value,
bool allow_client =
false)
10204 {
10205 if (!IsServerCheck(allow_client))
10206 return;
10207
10210
10212
10213 m_VarWet = Math.Clamp(value, min, max);
10214
10216 {
10219 }
10220 }
10221
10222 override void AddWet(
float value)
10223 {
10225 }
10226
10228 {
10230 }
10231
10233 {
10235 }
10236
10238 {
10240 }
10241
10243 {
10245 }
10246
10248 {
10250 }
10251
10252 override void OnWetChanged(
float newVal,
float oldVal)
10253 {
10256 if (newLevel != oldLevel)
10257 {
10259 }
10260 }
10261
10263 {
10264 SetWeightDirty();
10265 }
10266
10268 {
10269 return GetWetLevelInternal(
m_VarWet);
10270 }
10271
10272
10273
10275 {
10277 }
10278
10280 {
10282 }
10283
10285 {
10287 }
10288
10290 {
10292 }
10293
10294
10295
10297 {
10298 if (ConfigIsExisting("itemModelLength"))
10299 {
10300 return ConfigGetFloat("itemModelLength");
10301 }
10302 return 0;
10303 }
10304
10306 {
10307 if (ConfigIsExisting("itemAttachOffset"))
10308 {
10309 return ConfigGetFloat("itemAttachOffset");
10310 }
10311 return 0;
10312 }
10313
10314 override void SetCleanness(
int value,
bool allow_client =
false)
10315 {
10316 if (!IsServerCheck(allow_client))
10317 return;
10318
10320
10322
10325 }
10326
10328 {
10330 }
10331
10333 {
10334 return true;
10335 }
10336
10337
10338
10339
10341 {
10343 }
10344
10346 {
10348 }
10349
10350
10351
10352
10353 override void SetColor(
int r,
int g,
int b,
int a)
10354 {
10360 }
10362 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10363 {
10368 }
10369
10371 {
10373 }
10374
10377 {
10378 int r,g,b,a;
10380 r = r/255;
10381 g = g/255;
10382 b = b/255;
10383 a = a/255;
10384 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10385 }
10386
10387
10388
10389 override void SetLiquidType(
int value,
bool allow_client =
false)
10390 {
10391 if (!IsServerCheck(allow_client))
10392 return;
10393
10398 }
10399
10401 {
10402 return ConfigGetInt("varLiquidTypeInit");
10403 }
10404
10406 {
10408 }
10409
10411 {
10413 SetFrozen(false);
10414 }
10415
10418 {
10419 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10420 }
10421
10422
10425 {
10426 PlayerBase nplayer;
10427 if (PlayerBase.CastTo(nplayer, player))
10428 {
10430
10431 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10432 }
10433 }
10434
10435
10438 {
10439 PlayerBase nplayer;
10440 if (PlayerBase.CastTo(nplayer,player))
10441 {
10442
10443 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10444
10445 }
10446
10447
10448 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10449
10450
10451 if (HasEnergyManager())
10452 {
10453 GetCompEM().UpdatePlugState();
10454 }
10455 }
10456
10457
10459 {
10460 super.OnPlacementStarted(player);
10461
10463 }
10464
10465 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10466 {
10468 {
10469 m_AdminLog.OnPlacementComplete(player,
this);
10470 }
10471
10472 super.OnPlacementComplete(player, position, orientation);
10473 }
10474
10475
10476
10477
10478
10480 {
10482 {
10483 return true;
10484 }
10485 else
10486 {
10487 return false;
10488 }
10489 }
10490
10491
10493 {
10495 {
10497 }
10498 }
10499
10500
10502 {
10504 }
10505
10507 {
10509 }
10510
10511 override void InsertAgent(
int agent,
float count = 1)
10512 {
10513 if (count < 1)
10514 return;
10515
10517 }
10518
10521 {
10523 }
10524
10525
10527 {
10529 }
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10573 {
10575 return false;
10576 return true;
10577 }
10578
10580 {
10581
10583 }
10584
10585
10588 {
10589 super.CheckForRoofLimited(timeTresholdMS);
10590
10592 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10593 {
10594 m_PreviousRoofTestTime = time;
10595 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10596 }
10597 }
10598
10599
10601 {
10603 {
10604 return 0;
10605 }
10606
10607 if (GetInventory().GetAttachmentSlotsCount() != 0)
10608 {
10609 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10610 if (filter)
10611 return filter.GetProtectionLevel(type, false, system);
10612 else
10613 return 0;
10614 }
10615
10616 string subclassPath, entryName;
10617
10618 switch (type)
10619 {
10621 entryName = "biological";
10622 break;
10624 entryName = "chemical";
10625 break;
10626 default:
10627 entryName = "biological";
10628 break;
10629 }
10630
10631 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10632
10634 }
10635
10636
10637
10640 {
10641 if (!IsMagazine())
10643
10645 }
10646
10647
10648
10649
10650
10655 {
10656 return true;
10657 }
10658
10660 {
10662 }
10663
10664
10665
10666
10667
10669 {
10670 if (parent)
10671 {
10672 if (parent.IsInherited(DayZInfected))
10673 return true;
10674
10675 if (!parent.IsRuined())
10676 return true;
10677 }
10678
10679 return true;
10680 }
10681
10683 {
10684 if (!super.CanPutAsAttachment(parent))
10685 {
10686 return false;
10687 }
10688
10689 if (!IsRuined() && !parent.IsRuined())
10690 {
10691 return true;
10692 }
10693
10694 return false;
10695 }
10696
10698 {
10699
10700
10701
10702
10703 return super.CanReceiveItemIntoCargo(item);
10704 }
10705
10707 {
10708
10709
10710
10711
10712 GameInventory attachmentInv = attachment.GetInventory();
10714 {
10715 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10716 return false;
10717 }
10718
10719 InventoryLocation loc = new InventoryLocation();
10720 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10721 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10722 return false;
10723
10724 return super.CanReceiveAttachment(attachment, slotId);
10725 }
10726
10728 {
10729 if (!super.CanReleaseAttachment(attachment))
10730 return false;
10731
10732 return GetInventory().AreChildrenAccessible();
10733 }
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10756 {
10757 int id = muzzle_owner.GetMuzzleID();
10758 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10759
10760 if (WPOF_array)
10761 {
10762 for (int i = 0; i < WPOF_array.Count(); i++)
10763 {
10764 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10765
10766 if (WPOF)
10767 {
10768 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10769 }
10770 }
10771 }
10772 }
10773
10774
10776 {
10777 int id = muzzle_owner.GetMuzzleID();
10779
10780 if (WPOBE_array)
10781 {
10782 for (int i = 0; i < WPOBE_array.Count(); i++)
10783 {
10784 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10785
10786 if (WPOBE)
10787 {
10788 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10789 }
10790 }
10791 }
10792 }
10793
10794
10796 {
10797 int id = muzzle_owner.GetMuzzleID();
10798 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10799
10800 if (WPOOH_array)
10801 {
10802 for (int i = 0; i < WPOOH_array.Count(); i++)
10803 {
10804 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10805
10806 if (WPOOH)
10807 {
10808 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10809 }
10810 }
10811 }
10812 }
10813
10814
10816 {
10817 int id = muzzle_owner.GetMuzzleID();
10818 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10819
10820 if (WPOOH_array)
10821 {
10822 for (int i = 0; i < WPOOH_array.Count(); i++)
10823 {
10824 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10825
10826 if (WPOOH)
10827 {
10828 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10829 }
10830 }
10831 }
10832 }
10833
10834
10836 {
10837 int id = muzzle_owner.GetMuzzleID();
10838 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10839
10840 if (WPOOH_array)
10841 {
10842 for (int i = 0; i < WPOOH_array.Count(); i++)
10843 {
10844 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10845
10846 if (WPOOH)
10847 {
10848 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10849 }
10850 }
10851 }
10852 }
10853
10854
10855
10857 {
10859 {
10860 return true;
10861 }
10862
10863 return false;
10864 }
10865
10867 {
10869 {
10870 return true;
10871 }
10872
10873 return false;
10874 }
10875
10877 {
10879 {
10880 return true;
10881 }
10882
10883 return false;
10884 }
10885
10887 {
10888 return false;
10889 }
10890
10893 {
10894 return UATimeSpent.DEFAULT_DEPLOY;
10895 }
10896
10897
10898
10899
10901 {
10903 SetSynchDirty();
10904 }
10905
10907 {
10909 }
10910
10911
10913 {
10914 return false;
10915 }
10916
10919 {
10920 string att_type = "None";
10921
10922 if (ConfigIsExisting("soundAttType"))
10923 {
10924 att_type = ConfigGetString("soundAttType");
10925 }
10926
10928 }
10929
10931 {
10933 }
10934
10935
10936
10937
10938
10944
10946 {
10949
10951 }
10952
10953
10955 {
10957 return;
10958
10960
10963
10966
10967 SoundParameters params = new SoundParameters();
10971 }
10972
10973
10975 {
10977 return;
10978
10980 SetSynchDirty();
10981
10984 }
10985
10986
10988 {
10990 return;
10991
10993 SetSynchDirty();
10994
10997 }
10998
11000 {
11002 }
11003
11005 {
11007 }
11008
11011 {
11012 if (!
GetGame().IsDedicatedServer())
11013 {
11014 if (ConfigIsExisting("attachSoundSet"))
11015 {
11016 string cfg_path = "";
11017 string soundset = "";
11018 string type_name =
GetType();
11019
11022 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11023 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11024
11025 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11026 {
11027 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11028 {
11029 if (cfg_slot_array[i] == slot_type)
11030 {
11031 soundset = cfg_soundset_array[i];
11032 break;
11033 }
11034 }
11035 }
11036
11037 if (soundset != "")
11038 {
11039 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11041 }
11042 }
11043 }
11044 }
11045
11047 {
11048
11049 }
11050
11051 void OnApply(PlayerBase player);
11052
11054 {
11055 return 1.0;
11056 };
11057
11059 {
11061 }
11062
11064 {
11066 }
11067
11069
11071 {
11072 SetDynamicPhysicsLifeTime(0.01);
11074 }
11075
11077 {
11078 array<string> zone_names = new array<string>;
11079 GetDamageZones(zone_names);
11080 for (int i = 0; i < zone_names.Count(); i++)
11081 {
11082 SetHealthMax(zone_names.Get(i),"Health");
11083 }
11084 SetHealthMax("","Health");
11085 }
11086
11089 {
11090 float global_health = GetHealth01("","Health");
11091 array<string> zones = new array<string>;
11092 GetDamageZones(zones);
11093
11094 for (int i = 0; i < zones.Count(); i++)
11095 {
11096 SetHealth01(zones.Get(i),"Health",global_health);
11097 }
11098 }
11099
11102 {
11103 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11104 }
11105
11107 {
11108 if (!hasRootAsPlayer)
11109 {
11110 if (refParentIB)
11111 {
11112
11113 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11114 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11115
11116 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11117 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11118
11121 }
11122 else
11123 {
11124
11127 }
11128 }
11129 }
11130
11132 {
11134 {
11135 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11136 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
11137 {
11138 float heatPermCoef = 1.0;
11140 while (ent)
11141 {
11142 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11143 ent = ent.GetHierarchyParent();
11144 }
11145
11146 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11147 }
11148 }
11149 }
11150
11152 {
11153
11154 EntityAI parent = GetHierarchyParent();
11155 if (!parent)
11156 {
11157 hasParent = false;
11158 hasRootAsPlayer = false;
11159 }
11160 else
11161 {
11162 hasParent = true;
11163 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11164 refParentIB =
ItemBase.Cast(parent);
11165 }
11166 }
11167
11168 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11169 {
11170
11171 }
11172
11174 {
11175
11176 return false;
11177 }
11178
11180 {
11181
11182
11183 return false;
11184 }
11185
11187 {
11188
11189 return false;
11190 }
11191
11194 {
11195 return !GetIsFrozen() &&
IsOpen();
11196 }
11197
11199 {
11200 bool hasParent = false, hasRootAsPlayer = false;
11202
11203 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11204 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11205
11206 if (wwtu || foodDecay)
11207 {
11211
11212 if (processWetness || processTemperature || processDecay)
11213 {
11215
11216 if (processWetness)
11217 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11218
11219 if (processTemperature)
11221
11222 if (processDecay)
11223 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11224 }
11225 }
11226 }
11227
11230 {
11232 }
11233
11235 {
11238
11239 return super.GetTemperatureFreezeThreshold();
11240 }
11241
11243 {
11246
11247 return super.GetTemperatureThawThreshold();
11248 }
11249
11251 {
11254
11255 return super.GetItemOverheatThreshold();
11256 }
11257
11259 {
11261 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11262
11263 return super.GetTemperatureFreezeTime();
11264 }
11265
11267 {
11269 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11270
11271 return super.GetTemperatureThawTime();
11272 }
11273
11278
11280 {
11281 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11282 }
11283
11285 {
11286 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11287 }
11288
11291 {
11293 }
11294
11296 {
11298 }
11299
11301 {
11303 }
11304
11307 {
11308 return null;
11309 }
11310
11313 {
11314 return false;
11315 }
11316
11318 {
11320 {
11323 if (!trg)
11324 {
11326 explosive = this;
11327 }
11328
11329 explosive.PairRemote(trg);
11331
11332 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11333 trg.SetPersistentPairID(persistentID);
11334 explosive.SetPersistentPairID(persistentID);
11335
11336 return true;
11337 }
11338 return false;
11339 }
11340
11343 {
11344 float ret = 1.0;
11347 ret *= GetHealth01();
11348
11349 return ret;
11350 }
11351
11352 #ifdef DEVELOPER
11353 override void SetDebugItem()
11354 {
11355 super.SetDebugItem();
11356 _itemBase = this;
11357 }
11358
11360 {
11361 string text = super.GetDebugText();
11362
11364 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11365
11366 return text;
11367 }
11368 #endif
11369
11371 {
11372 return true;
11373 }
11374
11376
11378
11380 {
11383 }
11384
11385
11393
11409}
11410
11412{
11414 if (entity)
11415 {
11416 bool is_item = entity.IsInherited(
ItemBase);
11417 if (is_item && full_quantity)
11418 {
11421 }
11422 }
11423 else
11424 {
11426 return NULL;
11427 }
11428 return entity;
11429}
11430
11432{
11433 if (item)
11434 {
11435 if (health > 0)
11436 item.SetHealth("", "", health);
11437
11438 if (item.CanHaveTemperature())
11439 {
11441 if (item.CanFreeze())
11442 item.SetFrozen(false);
11443 }
11444
11445 if (item.HasEnergyManager())
11446 {
11447 if (quantity >= 0)
11448 {
11449 item.GetCompEM().SetEnergy0To1(quantity);
11450 }
11451 else
11452 {
11454 }
11455 }
11456 else if (item.IsMagazine())
11457 {
11458 Magazine mag = Magazine.Cast(item);
11459 if (quantity >= 0)
11460 {
11461 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11462 }
11463 else
11464 {
11466 }
11467
11468 }
11469 else
11470 {
11471 if (quantity >= 0)
11472 {
11473 item.SetQuantityNormalized(quantity, false);
11474 }
11475 else
11476 {
11478 }
11479
11480 }
11481 }
11482}
11483
11484#ifdef DEVELOPER
11486#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.