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 {
8147 return;
8148
8150 {
8151 if (ScriptInputUserData.CanStoreInputUserData())
8152 {
8153 ScriptInputUserData ctx = new ScriptInputUserData;
8158 ctx.
Write(destination_entity);
8162 }
8163 }
8164 else if (!
GetGame().IsMultiplayer())
8165 {
8167 }
8168 }
8169
8171 {
8173 return;
8174
8175 float split_quantity_new;
8179 InventoryLocation loc = new InventoryLocation;
8180
8181 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8182 {
8184 split_quantity_new = stack_max;
8185 else
8187
8188 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8189 if (new_item)
8190 {
8191 new_item.SetResultOfSplit(true);
8192 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8194 new_item.SetQuantity(split_quantity_new);
8195 }
8196 }
8197 else if (destination_entity && slot_id == -1)
8198 {
8199 if (quantity > stack_max)
8200 split_quantity_new = stack_max;
8201 else
8202 split_quantity_new = quantity;
8203
8205 {
8208 }
8209
8210 if (new_item)
8211 {
8212 new_item.SetResultOfSplit(true);
8213 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8215 new_item.SetQuantity(split_quantity_new);
8216 }
8217 }
8218 else
8219 {
8220 if (stack_max != 0)
8221 {
8223 {
8225 }
8226
8227 if (split_quantity_new == 0)
8228 {
8229 if (!
GetGame().IsMultiplayer())
8230 player.PhysicalPredictiveDropItem(this);
8231 else
8232 player.ServerDropEntity(this);
8233 return;
8234 }
8235
8237
8238 if (new_item)
8239 {
8240 new_item.SetResultOfSplit(true);
8241 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8243 new_item.SetQuantity(stack_max);
8244 new_item.PlaceOnSurface();
8245 }
8246 }
8247 }
8248 }
8249
8251 {
8253 return;
8254
8255 float split_quantity_new;
8259 InventoryLocation loc = new InventoryLocation;
8260
8261 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8262 {
8264 split_quantity_new = stack_max;
8265 else
8267
8268 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8269 if (new_item)
8270 {
8271 new_item.SetResultOfSplit(true);
8272 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8274 new_item.SetQuantity(split_quantity_new);
8275 }
8276 }
8277 else if (destination_entity && slot_id == -1)
8278 {
8279 if (quantity > stack_max)
8280 split_quantity_new = stack_max;
8281 else
8282 split_quantity_new = quantity;
8283
8285 {
8288 }
8289
8290 if (new_item)
8291 {
8292 new_item.SetResultOfSplit(true);
8293 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8295 new_item.SetQuantity(split_quantity_new);
8296 }
8297 }
8298 else
8299 {
8300 if (stack_max != 0)
8301 {
8303 {
8305 }
8306
8308
8309 if (new_item)
8310 {
8311 new_item.SetResultOfSplit(true);
8312 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8314 new_item.SetQuantity(stack_max);
8315 new_item.PlaceOnSurface();
8316 }
8317 }
8318 }
8319 }
8320
8322 {
8324 return;
8325
8327 {
8328 if (ScriptInputUserData.CanStoreInputUserData())
8329 {
8330 ScriptInputUserData ctx = new ScriptInputUserData;
8335 dst.WriteToContext(ctx);
8337 }
8338 }
8339 else if (!
GetGame().IsMultiplayer())
8340 {
8342 }
8343 }
8344
8346 {
8348 return;
8349
8351 {
8352 if (ScriptInputUserData.CanStoreInputUserData())
8353 {
8354 ScriptInputUserData ctx = new ScriptInputUserData;
8359 ctx.
Write(destination_entity);
8365 }
8366 }
8367 else if (!
GetGame().IsMultiplayer())
8368 {
8370 }
8371 }
8372
8374 {
8376 }
8377
8379 {
8381 return this;
8382
8384 float split_quantity_new;
8386 if (dst.IsValid())
8387 {
8388 int slot_id = dst.GetSlot();
8390
8391 if (quantity > stack_max)
8392 split_quantity_new = stack_max;
8393 else
8394 split_quantity_new = quantity;
8395
8397
8398 if (new_item)
8399 {
8400 new_item.SetResultOfSplit(true);
8401 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8404 }
8405
8406 return new_item;
8407 }
8408
8409 return null;
8410 }
8411
8413 {
8415 return;
8416
8418 float split_quantity_new;
8420 if (destination_entity)
8421 {
8423 if (quantity > stackable)
8424 split_quantity_new = stackable;
8425 else
8426 split_quantity_new = quantity;
8427
8428 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8429 if (new_item)
8430 {
8431 new_item.SetResultOfSplit(true);
8432 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8434 new_item.SetQuantity(split_quantity_new);
8435 }
8436 }
8437 }
8438
8440 {
8442 return;
8443
8445 {
8446 if (ScriptInputUserData.CanStoreInputUserData())
8447 {
8448 ScriptInputUserData ctx = new ScriptInputUserData;
8453 ItemBase destination_entity =
this;
8454 ctx.
Write(destination_entity);
8458 }
8459 }
8460 else if (!
GetGame().IsMultiplayer())
8461 {
8463 }
8464 }
8465
8467 {
8469 return;
8470
8472 float split_quantity_new;
8474 if (player)
8475 {
8477 if (quantity > stackable)
8478 split_quantity_new = stackable;
8479 else
8480 split_quantity_new = quantity;
8481
8482 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8483 new_item =
ItemBase.Cast(in_hands);
8484 if (new_item)
8485 {
8486 new_item.SetResultOfSplit(true);
8487 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8489 new_item.SetQuantity(split_quantity_new);
8490 }
8491 }
8492 }
8493
8495 {
8497 return;
8498
8500 float split_quantity_new = Math.Floor(quantity * 0.5);
8501
8503
8504 if (new_item)
8505 {
8506 if (new_item.GetQuantityMax() < split_quantity_new)
8507 {
8508 split_quantity_new = new_item.GetQuantityMax();
8509 }
8510
8511 new_item.SetResultOfSplit(true);
8512 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8513
8515 {
8518 }
8519 else
8520 {
8523 }
8524 }
8525 }
8526
8528 {
8530 return;
8531
8533 float split_quantity_new = Math.Floor(quantity / 2);
8534
8535 InventoryLocation invloc = new InventoryLocation;
8537
8539 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8540
8541 if (new_item)
8542 {
8543 if (new_item.GetQuantityMax() < split_quantity_new)
8544 {
8545 split_quantity_new = new_item.GetQuantityMax();
8546 }
8548 {
8551 }
8552 else
8553 {
8556 }
8557 }
8558 }
8559
8562 {
8563 SetWeightDirty();
8565
8566 if (parent)
8567 parent.OnAttachmentQuantityChangedEx(this, delta);
8568
8570 {
8572 {
8574 }
8576 {
8577 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8579 }
8580 }
8581
8582 }
8583
8586 {
8587
8588 }
8589
8592 {
8594 }
8595
8597 {
8598 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8599
8601 {
8602 if (newLevel == GameConstants.STATE_RUINED)
8603 {
8605 EntityAI parent = GetHierarchyParent();
8606 if (parent && parent.IsFireplace())
8607 {
8608 CargoBase cargo = GetInventory().GetCargo();
8609 if (cargo)
8610 {
8612 {
8614 }
8615 }
8616 }
8617 }
8618
8620 {
8621
8623 return;
8624 }
8625
8626 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8627 {
8629 }
8630 }
8631 }
8632
8633
8635 {
8636 super.OnRightClick();
8637
8639 {
8641 {
8642 if (ScriptInputUserData.CanStoreInputUserData())
8643 {
8644 vector m4[4];
8646
8647 EntityAI root = GetHierarchyRoot();
8648
8649 InventoryLocation dst = new InventoryLocation;
8651 {
8652 if (root)
8653 {
8654 root.GetTransform(m4);
8656 }
8657 else
8658 GetInventory().GetCurrentInventoryLocation(dst);
8659 }
8660 else
8661 {
8663
8664
8665 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8666 {
8667 if (root)
8668 {
8669 root.GetTransform(m4);
8671 }
8672 else
8673 GetInventory().GetCurrentInventoryLocation(dst);
8674 }
8675 else
8676 {
8677 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8678 }
8679 }
8680
8681 ScriptInputUserData ctx = new ScriptInputUserData;
8689 }
8690 }
8691 else if (!
GetGame().IsMultiplayer())
8692 {
8694 }
8695 }
8696 }
8697
8698 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8699 {
8700
8701 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8702 return false;
8703
8704 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8705 return false;
8706
8707
8709 return false;
8710
8711
8712 Magazine mag = Magazine.Cast(this);
8713 if (mag)
8714 {
8715 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8716 return false;
8717
8718 if (stack_max_limit)
8719 {
8720 Magazine other_mag = Magazine.Cast(other_item);
8721 if (other_item)
8722 {
8723 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8724 return false;
8725 }
8726
8727 }
8728 }
8729 else
8730 {
8731
8733 return false;
8734
8736 return false;
8737 }
8738
8739 PlayerBase player = null;
8740 if (CastTo(player, GetHierarchyRootPlayer()))
8741 {
8742 if (player.GetInventory().HasAttachment(this))
8743 return false;
8744
8745 if (player.IsItemsToDelete())
8746 return false;
8747 }
8748
8749 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
8750 return false;
8751
8752 int slotID;
8754 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
8755 return false;
8756
8757 return true;
8758 }
8759
8761 {
8763 }
8764
8766 {
8767 return m_IsResultOfSplit;
8768 }
8769
8771 {
8772 m_IsResultOfSplit = value;
8773 }
8774
8776 {
8778 }
8779
8781 {
8782 float other_item_quantity = other_item.GetQuantity();
8783 float this_free_space;
8784
8786
8788
8789 if (other_item_quantity > this_free_space)
8790 {
8791 return this_free_space;
8792 }
8793 else
8794 {
8795 return other_item_quantity;
8796 }
8797 }
8798
8800 {
8802 }
8803
8805 {
8807 return;
8808
8809 if (!IsMagazine() && other_item)
8810 {
8812 if (quantity_used != 0)
8813 {
8814 float hp1 = GetHealth01("","");
8815 float hp2 = other_item.GetHealth01("","");
8816 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
8817 hpResult = hpResult / (
GetQuantity() + quantity_used);
8818
8819 hpResult *= GetMaxHealth();
8820 Math.Round(hpResult);
8821 SetHealth("", "Health", hpResult);
8822
8824 other_item.AddQuantity(-quantity_used);
8825 }
8826 }
8828 }
8829
8831 {
8832 #ifdef SERVER
8833 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
8834 GetHierarchyParent().IncreaseLifetimeUp();
8835 #endif
8836 };
8837
8839 {
8840 PlayerBase p = PlayerBase.Cast(player);
8841
8842 array<int> recipesIds = p.m_Recipes;
8843 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8844 if (moduleRecipesManager)
8845 {
8846 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
8847 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
8848 }
8849
8850 for (int i = 0;i < recipesIds.Count(); i++)
8851 {
8852 int key = recipesIds.Get(i);
8853 string recipeName = moduleRecipesManager.GetRecipeName(key);
8855 }
8856 }
8857
8858
8859 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
8860 {
8861 super.GetDebugActions(outputList);
8862
8863
8868
8869
8873
8877
8878
8881
8882
8884 {
8887 }
8888
8890
8893
8897 }
8898
8899
8900
8901
8903 {
8904 super.OnAction(action_id, player, ctx);
8905 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
8906 {
8907 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
8908 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
8909 PlayerBase p = PlayerBase.Cast(player);
8910 if (
EActions.RECIPES_RANGE_START < 1000)
8911 {
8912 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
8913 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
8914 }
8915 }
8916 #ifndef SERVER
8917 else if (action_id ==
EActions.WATCH_PLAYER)
8918 {
8919 PluginDeveloper.SetDeveloperItemClientEx(player);
8920 }
8921 #endif
8923 {
8924 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
8925 {
8926 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
8927 OnDebugButtonPressServer(id + 1);
8928 }
8929
8930 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
8931 {
8932 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
8934 }
8935
8936 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
8937 {
8938 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
8940 }
8941
8942 else if (action_id ==
EActions.ADD_QUANTITY)
8943 {
8944 if (IsMagazine())
8945 {
8946 Magazine mag = Magazine.Cast(this);
8947 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
8948 }
8949 else
8950 {
8952 }
8953
8954 if (m_EM)
8955 {
8956 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
8957 }
8958
8959 }
8960
8961 else if (action_id ==
EActions.REMOVE_QUANTITY)
8962 {
8963 if (IsMagazine())
8964 {
8965 Magazine mag2 = Magazine.Cast(this);
8966 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
8967 }
8968 else
8969 {
8971 }
8972 if (m_EM)
8973 {
8974 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
8975 }
8976
8977 }
8978
8979 else if (action_id ==
EActions.SET_QUANTITY_0)
8980 {
8982
8983 if (m_EM)
8984 {
8985 m_EM.SetEnergy(0);
8986 }
8987 }
8988
8989 else if (action_id ==
EActions.SET_MAX_QUANTITY)
8990 {
8992
8993 if (m_EM)
8994 {
8995 m_EM.SetEnergy(m_EM.GetEnergyMax());
8996 }
8997 }
8998
8999 else if (action_id ==
EActions.ADD_HEALTH)
9000 {
9001 AddHealth("","",GetMaxHealth("","Health")/5);
9002 }
9003 else if (action_id ==
EActions.REMOVE_HEALTH)
9004 {
9005 AddHealth("","",-GetMaxHealth("","Health")/5);
9006 }
9007 else if (action_id ==
EActions.DESTROY_HEALTH)
9008 {
9009 SetHealth01("","",0);
9010 }
9011 else if (action_id ==
EActions.WATCH_ITEM)
9012 {
9014 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9015 #ifdef DEVELOPER
9016 SetDebugDeveloper_item(this);
9017 #endif
9018 }
9019
9020 else if (action_id ==
EActions.ADD_TEMPERATURE)
9021 {
9022 AddTemperature(20);
9023
9024 }
9025
9026 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9027 {
9028 AddTemperature(-20);
9029
9030 }
9031
9032 else if (action_id ==
EActions.FLIP_FROZEN)
9033 {
9034 SetFrozen(!GetIsFrozen());
9035
9036 }
9037
9038 else if (action_id ==
EActions.ADD_WETNESS)
9039 {
9041
9042 }
9043
9044 else if (action_id ==
EActions.REMOVE_WETNESS)
9045 {
9047
9048 }
9049
9050 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9051 {
9054
9055
9056 }
9057
9058 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9059 {
9062 }
9063
9064 else if (action_id ==
EActions.MAKE_SPECIAL)
9065 {
9066 auto debugParams = DebugSpawnParams.WithPlayer(player);
9067 OnDebugSpawnEx(debugParams);
9068 }
9069
9070 else if (action_id ==
EActions.DELETE)
9071 {
9072 Delete();
9073 }
9074
9075 }
9076
9077
9078 return false;
9079 }
9080
9081
9082
9083
9087
9090
9091
9092
9094 {
9095 return false;
9096 }
9097
9098
9100 {
9101 return true;
9102 }
9103
9104
9106 {
9107 return true;
9108 }
9109
9110
9111
9113 {
9114 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9116 }
9117
9120 {
9121 return null;
9122 }
9123
9125 {
9126 return false;
9127 }
9128
9130 {
9131 return false;
9132 }
9133
9137
9138
9140 {
9141 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9142 return module_repairing.CanRepair(this, item_repair_kit);
9143 }
9144
9145
9146 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9147 {
9148 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9149 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9150 }
9151
9152
9154 {
9155
9156
9157
9158
9159
9160
9161
9162
9163 return 1;
9164 }
9165
9166
9167
9169 {
9171 }
9172
9173
9174
9176 {
9178 }
9179
9180
9189 {
9190 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9191
9192 if (player)
9193 {
9194 player.MessageStatus(text);
9195 }
9196 }
9197
9198
9207 {
9208 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9209
9210 if (player)
9211 {
9212 player.MessageAction(text);
9213 }
9214 }
9215
9216
9225 {
9226 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9227
9228 if (player)
9229 {
9230 player.MessageFriendly(text);
9231 }
9232 }
9233
9234
9243 {
9244 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9245
9246 if (player)
9247 {
9248 player.MessageImportant(text);
9249 }
9250 }
9251
9253 {
9254 return true;
9255 }
9256
9257
9258 override bool KindOf(
string tag)
9259 {
9260 bool found = false;
9261 string item_name = this.
GetType();
9264
9265 int array_size = item_tag_array.Count();
9266 for (int i = 0; i < array_size; i++)
9267 {
9268 if (item_tag_array.Get(i) == tag)
9269 {
9270 found = true;
9271 break;
9272 }
9273 }
9274 return found;
9275 }
9276
9277
9279 {
9280
9281 super.OnRPC(sender, rpc_type,ctx);
9282
9283
9284 switch (rpc_type)
9285 {
9286 #ifndef SERVER
9287 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9288 Param2<bool, string> p = new Param2<bool, string>(false, "");
9289
9291 return;
9292
9293 bool play = p.param1;
9294 string soundSet = p.param2;
9295
9296 if (play)
9297 {
9299 {
9301 {
9303 }
9304 }
9305 else
9306 {
9308 }
9309 }
9310 else
9311 {
9313 }
9314
9315 break;
9316 #endif
9317
9318 }
9319
9321 {
9323 }
9324 }
9325
9326
9327
9328
9330 {
9331 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9332 return plugin.GetID(
name);
9333 }
9334
9336 {
9337 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9338 return plugin.GetName(id);
9339 }
9340
9343 {
9344
9345
9346 int varFlags;
9347 if (!ctx.
Read(varFlags))
9348 return;
9349
9350 if (varFlags & ItemVariableFlags.FLOAT)
9351 {
9353 }
9354 }
9355
9357 {
9358
9359 super.SerializeNumericalVars(floats_out);
9360
9361
9362
9364 {
9366 }
9367
9369 {
9371 }
9372
9374 {
9376 }
9377
9379 {
9384 }
9385
9387 {
9389 }
9390 }
9391
9393 {
9394
9395 super.DeSerializeNumericalVars(floats);
9396
9397
9398 int index = 0;
9399 int mask = Math.Round(floats.Get(index));
9400
9401 index++;
9402
9404 {
9406 {
9408 }
9409 else
9410 {
9411 float quantity = floats.Get(index);
9413 }
9414 index++;
9415 }
9416
9418 {
9419 float wet = floats.Get(index);
9421 index++;
9422 }
9423
9425 {
9426 int liquidtype = Math.Round(floats.Get(index));
9428 index++;
9429 }
9430
9432 {
9434 index++;
9436 index++;
9438 index++;
9440 index++;
9441 }
9442
9444 {
9445 int cleanness = Math.Round(floats.Get(index));
9447 index++;
9448 }
9449 }
9450
9452 {
9453 super.WriteVarsToCTX(ctx);
9454
9455
9457 {
9459 }
9460
9462 {
9464 }
9465
9467 {
9469 }
9470
9472 {
9473 int r,g,b,a;
9479 }
9480
9482 {
9484 }
9485 }
9486
9488 {
9489 if (!super.ReadVarsFromCTX(ctx,version))
9490 return false;
9491
9492 int intValue;
9493 float value;
9494
9495 if (version < 140)
9496 {
9497 if (!ctx.
Read(intValue))
9498 return false;
9499
9500 m_VariablesMask = intValue;
9501 }
9502
9504 {
9505 if (!ctx.
Read(value))
9506 return false;
9507
9509 {
9511 }
9512 else
9513 {
9515 }
9516 }
9517
9518 if (version < 140)
9519 {
9521 {
9522 if (!ctx.
Read(value))
9523 return false;
9524 SetTemperatureDirect(value);
9525 }
9526 }
9527
9529 {
9530 if (!ctx.
Read(value))
9531 return false;
9533 }
9534
9536 {
9537 if (!ctx.
Read(intValue))
9538 return false;
9540 }
9541
9543 {
9544 int r,g,b,a;
9546 return false;
9548 return false;
9550 return false;
9552 return false;
9553
9555 }
9556
9558 {
9559 if (!ctx.
Read(intValue))
9560 return false;
9562 }
9563
9564 if (version >= 138 && version < 140)
9565 {
9567 {
9568 if (!ctx.
Read(intValue))
9569 return false;
9570 SetFrozen(intValue);
9571 }
9572 }
9573
9574 return true;
9575 }
9576
9577
9579 {
9582 {
9584 }
9585
9586 if (!super.OnStoreLoad(ctx, version))
9587 {
9589 return false;
9590 }
9591
9592 if (version >= 114)
9593 {
9594 bool hasQuickBarIndexSaved;
9595
9596 if (!ctx.
Read(hasQuickBarIndexSaved))
9597 {
9599 return false;
9600 }
9601
9602 if (hasQuickBarIndexSaved)
9603 {
9604 int itmQBIndex;
9605
9606
9607 if (!ctx.
Read(itmQBIndex))
9608 {
9610 return false;
9611 }
9612
9613 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9614 if (itmQBIndex != -1 && parentPlayer)
9615 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9616 }
9617 }
9618 else
9619 {
9620
9621 PlayerBase player;
9622 int itemQBIndex;
9623 if (version ==
int.
MAX)
9624 {
9625 if (!ctx.
Read(itemQBIndex))
9626 {
9628 return false;
9629 }
9630 }
9631 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9632 {
9633
9634 if (!ctx.
Read(itemQBIndex))
9635 {
9637 return false;
9638 }
9639 if (itemQBIndex != -1 && player)
9640 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9641 }
9642 }
9643
9644 if (version < 140)
9645 {
9646
9647 if (!LoadVariables(ctx, version))
9648 {
9650 return false;
9651 }
9652 }
9653
9654
9656 {
9658 return false;
9659 }
9660 if (version >= 132)
9661 {
9663 if (raib)
9664 {
9666 {
9668 return false;
9669 }
9670 }
9671 }
9672
9674 return true;
9675 }
9676
9677
9678
9680 {
9681 super.OnStoreSave(ctx);
9682
9683 PlayerBase player;
9684 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9685 {
9687
9688 int itemQBIndex = -1;
9689 itemQBIndex = player.FindQuickBarEntityIndex(this);
9690 ctx.
Write(itemQBIndex);
9691 }
9692 else
9693 {
9695 }
9696
9698
9700 if (raib)
9701 {
9703 }
9704 }
9705
9706
9708 {
9709 super.AfterStoreLoad();
9710
9712 {
9714 }
9715
9717 {
9720 }
9721 }
9722
9724 {
9725 super.EEOnAfterLoad();
9726
9728 {
9730 }
9731
9734 }
9735
9737 {
9738 return false;
9739 }
9740
9741
9742
9744 {
9746 {
9747 #ifdef PLATFORM_CONSOLE
9748
9750 {
9752 if (menu)
9753 {
9755 }
9756 }
9757 #endif
9758 }
9759
9761 {
9764 }
9765
9767 {
9768 SetWeightDirty();
9770 }
9772 {
9775 }
9776
9778 {
9781 }
9783 {
9786 }
9787
9788 super.OnVariablesSynchronized();
9789 }
9790
9791
9792
9794 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
9795 {
9796 if (!IsServerCheck(allow_client))
9797 return false;
9798
9800 return false;
9801
9804
9805 if (value <= (min + 0.001))
9806 value = min;
9807
9808 if (value == min)
9809 {
9810 if (destroy_config)
9811 {
9812 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
9813 if (dstr)
9814 {
9816 this.Delete();
9817 return true;
9818 }
9819 }
9820 else if (destroy_forced)
9821 {
9823 this.Delete();
9824 return true;
9825 }
9826
9828 }
9829
9832
9834 {
9836
9837 if (delta)
9839 }
9840
9842
9843 return false;
9844 }
9845
9846
9848 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
9849 {
9851 }
9852
9854 {
9857 }
9858
9860 {
9863 }
9864
9867 {
9868 float value_clamped = Math.Clamp(value, 0, 1);
9870 SetQuantity(result, destroy_config, destroy_forced);
9871 }
9872
9873
9876 {
9878 }
9879
9881 {
9883 }
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9895 {
9896 int slot = -1;
9897 if (GetInventory())
9898 {
9899 InventoryLocation il = new InventoryLocation;
9900 GetInventory().GetCurrentInventoryLocation(il);
9902 }
9903
9905 }
9906
9908 {
9909 float quantity_max = 0;
9910
9912 {
9913 if (attSlotID != -1)
9914 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
9915
9916 if (quantity_max <= 0)
9918 }
9919
9920 if (quantity_max <= 0)
9922
9923 return quantity_max;
9924 }
9925
9927 {
9929 }
9930
9932 {
9934 }
9935
9936
9938 {
9940 }
9941
9943 {
9945 }
9946
9948 {
9950 }
9951
9952
9954 {
9955
9956 float weightEx = GetWeightEx();
9957 float special = GetInventoryAndCargoWeight();
9958 return weightEx - special;
9959 }
9960
9961
9963 {
9965 }
9966
9968 {
9970 {
9971 #ifdef DEVELOPER
9972 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9973 {
9974 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
9976 }
9977 #endif
9978
9980 }
9981 else if (HasEnergyManager())
9982 {
9983 #ifdef DEVELOPER
9984 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9985 {
9986 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
9987 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
9988 }
9989 #endif
9990 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
9991 }
9992 else
9993 {
9994 #ifdef DEVELOPER
9995 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
9996 {
9997 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
9998 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
9999 }
10000 #endif
10001 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10002 }
10003 }
10004
10007 {
10008 int item_count = 0;
10010
10011 if (GetInventory().GetCargo() != NULL)
10012 {
10013 item_count = GetInventory().GetCargo().GetItemCount();
10014 }
10015
10016 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10017 {
10018 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10019 if (item)
10020 item_count += item.GetNumberOfItems();
10021 }
10022 return item_count;
10023 }
10024
10027 {
10028 float weight = 0;
10029 float wetness = 1;
10030 if (include_wetness)
10033 {
10034 weight = wetness * m_ConfigWeight;
10035 }
10037 {
10038 weight = 1;
10039 }
10040 return weight;
10041 }
10042
10043
10044
10046 {
10047 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10048 {
10049 GameInventory inv = GetInventory();
10050 array<EntityAI> items = new array<EntityAI>;
10052 for (int i = 0; i < items.Count(); i++)
10053 {
10055 if (item)
10056 {
10058 }
10059 }
10060 }
10061 }
10062
10063
10064
10065
10067 {
10068 float energy = 0;
10069 if (HasEnergyManager())
10070 {
10071 energy = GetCompEM().GetEnergy();
10072 }
10073 return energy;
10074 }
10075
10076
10078 {
10079 super.OnEnergyConsumed();
10080
10082 }
10083
10085 {
10086 super.OnEnergyAdded();
10087
10089 }
10090
10091
10093 {
10094 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10095 {
10097 {
10098 float energy_0to1 = GetCompEM().GetEnergy0To1();
10100 }
10101 }
10102 }
10103
10104
10106 {
10107 return ConfigGetFloat("heatIsolation");
10108 }
10109
10111 {
10113 }
10114
10116 {
10117 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10118 if (
GetGame().ConfigIsExisting(paramPath))
10120
10121 return 0.0;
10122 }
10123
10125 {
10126 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10127 if (
GetGame().ConfigIsExisting(paramPath))
10129
10130 return 0.0;
10131 }
10132
10133 override void SetWet(
float value,
bool allow_client =
false)
10134 {
10135 if (!IsServerCheck(allow_client))
10136 return;
10137
10140
10142
10143 m_VarWet = Math.Clamp(value, min, max);
10144
10146 {
10149 }
10150 }
10151
10152 override void AddWet(
float value)
10153 {
10155 }
10156
10158 {
10160 }
10161
10163 {
10165 }
10166
10168 {
10170 }
10171
10173 {
10175 }
10176
10178 {
10180 }
10181
10182 override void OnWetChanged(
float newVal,
float oldVal)
10183 {
10186 if (newLevel != oldLevel)
10187 {
10189 }
10190 }
10191
10193 {
10194 SetWeightDirty();
10195 }
10196
10198 {
10199 return GetWetLevelInternal(
m_VarWet);
10200 }
10201
10202
10203
10205 {
10207 }
10208
10210 {
10212 }
10213
10215 {
10217 }
10218
10220 {
10222 }
10223
10224
10225
10227 {
10228 if (ConfigIsExisting("itemModelLength"))
10229 {
10230 return ConfigGetFloat("itemModelLength");
10231 }
10232 return 0;
10233 }
10234
10236 {
10237 if (ConfigIsExisting("itemAttachOffset"))
10238 {
10239 return ConfigGetFloat("itemAttachOffset");
10240 }
10241 return 0;
10242 }
10243
10244 override void SetCleanness(
int value,
bool allow_client =
false)
10245 {
10246 if (!IsServerCheck(allow_client))
10247 return;
10248
10250
10252
10255 }
10256
10258 {
10260 }
10261
10263 {
10264 return true;
10265 }
10266
10267
10268
10269
10271 {
10273 }
10274
10276 {
10278 }
10279
10280
10281
10282
10283 override void SetColor(
int r,
int g,
int b,
int a)
10284 {
10290 }
10292 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10293 {
10298 }
10299
10301 {
10303 }
10304
10307 {
10308 int r,g,b,a;
10310 r = r/255;
10311 g = g/255;
10312 b = b/255;
10313 a = a/255;
10314 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10315 }
10316
10317
10318
10319 override void SetLiquidType(
int value,
bool allow_client =
false)
10320 {
10321 if (!IsServerCheck(allow_client))
10322 return;
10323
10328 }
10329
10331 {
10332 return ConfigGetInt("varLiquidTypeInit");
10333 }
10334
10336 {
10338 }
10339
10341 {
10343 SetFrozen(false);
10344 }
10345
10348 {
10349 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10350 }
10351
10352
10355 {
10356 PlayerBase nplayer;
10357 if (PlayerBase.CastTo(nplayer, player))
10358 {
10360
10361 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10362 }
10363 }
10364
10365
10368 {
10369 PlayerBase nplayer;
10370 if (PlayerBase.CastTo(nplayer,player))
10371 {
10372
10373 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10374
10375 }
10376
10377
10378 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10379
10380
10381 if (HasEnergyManager())
10382 {
10383 GetCompEM().UpdatePlugState();
10384 }
10385 }
10386
10387
10389 {
10390 super.OnPlacementStarted(player);
10391
10393 }
10394
10395 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10396 {
10398 {
10399 m_AdminLog.OnPlacementComplete(player,
this);
10400 }
10401
10402 super.OnPlacementComplete(player, position, orientation);
10403 }
10404
10405
10406
10407
10408
10410 {
10412 {
10413 return true;
10414 }
10415 else
10416 {
10417 return false;
10418 }
10419 }
10420
10421
10423 {
10425 {
10427 }
10428 }
10429
10430
10432 {
10434 }
10435
10437 {
10439 }
10440
10441 override void InsertAgent(
int agent,
float count = 1)
10442 {
10443 if (count < 1)
10444 return;
10445
10447 }
10448
10451 {
10453 }
10454
10455
10457 {
10459 }
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10503 {
10505 return false;
10506 return true;
10507 }
10508
10510 {
10511
10513 }
10514
10515
10518 {
10519 super.CheckForRoofLimited(timeTresholdMS);
10520
10522 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10523 {
10524 m_PreviousRoofTestTime = time;
10525 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10526 }
10527 }
10528
10529
10531 {
10533 {
10534 return 0;
10535 }
10536
10537 if (GetInventory().GetAttachmentSlotsCount() != 0)
10538 {
10539 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10540 if (filter)
10541 return filter.GetProtectionLevel(type, false, system);
10542 else
10543 return 0;
10544 }
10545
10546 string subclassPath, entryName;
10547
10548 switch (type)
10549 {
10551 entryName = "biological";
10552 break;
10554 entryName = "chemical";
10555 break;
10556 default:
10557 entryName = "biological";
10558 break;
10559 }
10560
10561 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10562
10564 }
10565
10566
10567
10570 {
10571 if (!IsMagazine())
10573
10575 }
10576
10577
10578
10579
10580
10585 {
10586 return true;
10587 }
10588
10590 {
10592 }
10593
10594
10595
10596
10597
10599 {
10600 if (parent)
10601 {
10602 if (parent.IsInherited(DayZInfected))
10603 return true;
10604
10605 if (!parent.IsRuined())
10606 return true;
10607 }
10608
10609 return true;
10610 }
10611
10613 {
10614 if (!super.CanPutAsAttachment(parent))
10615 {
10616 return false;
10617 }
10618
10619 if (!IsRuined() && !parent.IsRuined())
10620 {
10621 return true;
10622 }
10623
10624 return false;
10625 }
10626
10628 {
10629
10630
10631
10632
10633 return super.CanReceiveItemIntoCargo(item);
10634 }
10635
10637 {
10638
10639
10640
10641
10642 GameInventory attachmentInv = attachment.GetInventory();
10644 {
10645 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10646 return false;
10647 }
10648
10649 InventoryLocation loc = new InventoryLocation();
10650 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10651 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10652 return false;
10653
10654 return super.CanReceiveAttachment(attachment, slotId);
10655 }
10656
10658 {
10659 if (!super.CanReleaseAttachment(attachment))
10660 return false;
10661
10662 return GetInventory().AreChildrenAccessible();
10663 }
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10686 {
10687 int id = muzzle_owner.GetMuzzleID();
10688 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
10689
10690 if (WPOF_array)
10691 {
10692 for (int i = 0; i < WPOF_array.Count(); i++)
10693 {
10694 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
10695
10696 if (WPOF)
10697 {
10698 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
10699 }
10700 }
10701 }
10702 }
10703
10704
10706 {
10707 int id = muzzle_owner.GetMuzzleID();
10709
10710 if (WPOBE_array)
10711 {
10712 for (int i = 0; i < WPOBE_array.Count(); i++)
10713 {
10714 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
10715
10716 if (WPOBE)
10717 {
10718 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10719 }
10720 }
10721 }
10722 }
10723
10724
10726 {
10727 int id = muzzle_owner.GetMuzzleID();
10728 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10729
10730 if (WPOOH_array)
10731 {
10732 for (int i = 0; i < WPOOH_array.Count(); i++)
10733 {
10734 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10735
10736 if (WPOOH)
10737 {
10738 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
10739 }
10740 }
10741 }
10742 }
10743
10744
10746 {
10747 int id = muzzle_owner.GetMuzzleID();
10748 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10749
10750 if (WPOOH_array)
10751 {
10752 for (int i = 0; i < WPOOH_array.Count(); i++)
10753 {
10754 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10755
10756 if (WPOOH)
10757 {
10758 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10759 }
10760 }
10761 }
10762 }
10763
10764
10766 {
10767 int id = muzzle_owner.GetMuzzleID();
10768 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
10769
10770 if (WPOOH_array)
10771 {
10772 for (int i = 0; i < WPOOH_array.Count(); i++)
10773 {
10774 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
10775
10776 if (WPOOH)
10777 {
10778 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
10779 }
10780 }
10781 }
10782 }
10783
10784
10785
10787 {
10789 {
10790 return true;
10791 }
10792
10793 return false;
10794 }
10795
10797 {
10799 {
10800 return true;
10801 }
10802
10803 return false;
10804 }
10805
10807 {
10809 {
10810 return true;
10811 }
10812
10813 return false;
10814 }
10815
10817 {
10818 return false;
10819 }
10820
10823 {
10824 return UATimeSpent.DEFAULT_DEPLOY;
10825 }
10826
10827
10828
10829
10831 {
10833 SetSynchDirty();
10834 }
10835
10837 {
10839 }
10840
10841
10843 {
10844 return false;
10845 }
10846
10849 {
10850 string att_type = "None";
10851
10852 if (ConfigIsExisting("soundAttType"))
10853 {
10854 att_type = ConfigGetString("soundAttType");
10855 }
10856
10858 }
10859
10861 {
10863 }
10864
10865
10866
10867
10868
10872
10874 {
10877
10879 }
10880
10881
10883 {
10885 return;
10886
10888
10891
10894
10895 SoundParameters params = new SoundParameters();
10899 }
10900
10901
10903 {
10905 return;
10906
10908 SetSynchDirty();
10909
10912 }
10913
10914
10916 {
10918 return;
10919
10921 SetSynchDirty();
10922
10925 }
10926
10928 {
10930 }
10931
10933 {
10935 }
10936
10939 {
10940 if (!
GetGame().IsDedicatedServer())
10941 {
10942 if (ConfigIsExisting("attachSoundSet"))
10943 {
10944 string cfg_path = "";
10945 string soundset = "";
10946 string type_name =
GetType();
10947
10950 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
10951 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
10952
10953 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
10954 {
10955 for (int i = 0; i < cfg_soundset_array.Count(); i++)
10956 {
10957 if (cfg_slot_array[i] == slot_type)
10958 {
10959 soundset = cfg_soundset_array[i];
10960 break;
10961 }
10962 }
10963 }
10964
10965 if (soundset != "")
10966 {
10967 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
10969 }
10970 }
10971 }
10972 }
10973
10975 {
10976
10977 }
10978
10979 void OnApply(PlayerBase player);
10980
10982 {
10983 return 1.0;
10984 };
10985
10987 {
10989 }
10990
10992 {
10994 }
10995
10997
10999 {
11000 SetDynamicPhysicsLifeTime(0.01);
11002 }
11003
11005 {
11006 array<string> zone_names = new array<string>;
11007 GetDamageZones(zone_names);
11008 for (int i = 0; i < zone_names.Count(); i++)
11009 {
11010 SetHealthMax(zone_names.Get(i),"Health");
11011 }
11012 SetHealthMax("","Health");
11013 }
11014
11017 {
11018 float global_health = GetHealth01("","Health");
11019 array<string> zones = new array<string>;
11020 GetDamageZones(zones);
11021
11022 for (int i = 0; i < zones.Count(); i++)
11023 {
11024 SetHealth01(zones.Get(i),"Health",global_health);
11025 }
11026 }
11027
11030 {
11031 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11032 }
11033
11035 {
11036 if (!hasRootAsPlayer)
11037 {
11038 if (refParentIB)
11039 {
11040
11041 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11042 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11043
11044 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11045 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11046
11049 }
11050 else
11051 {
11052
11055 }
11056 }
11057 }
11058
11060 {
11062 {
11063 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11064 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11065 {
11066 float heatPermCoef = 1.0;
11068 while (ent)
11069 {
11070 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11071 ent = ent.GetHierarchyParent();
11072 }
11073
11074 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11075 }
11076 }
11077 }
11078
11080 {
11081
11082 EntityAI parent = GetHierarchyParent();
11083 if (!parent)
11084 {
11085 hasParent = false;
11086 hasRootAsPlayer = false;
11087 }
11088 else
11089 {
11090 hasParent = true;
11091 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11092 refParentIB =
ItemBase.Cast(parent);
11093 }
11094 }
11095
11096 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11097 {
11098
11099 }
11100
11102 {
11103
11104 return false;
11105 }
11106
11108 {
11109
11110
11111 return false;
11112 }
11113
11115 {
11116
11117 return false;
11118 }
11119
11122 {
11123 return !GetIsFrozen() &&
IsOpen();
11124 }
11125
11127 {
11128 bool hasParent = false, hasRootAsPlayer = false;
11130
11131 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11132 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11133
11134 if (wwtu || foodDecay)
11135 {
11139
11140 if (processWetness || processTemperature || processDecay)
11141 {
11143
11144 if (processWetness)
11145 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11146
11147 if (processTemperature)
11149
11150 if (processDecay)
11151 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11152 }
11153 }
11154 }
11155
11158 {
11160 }
11161
11163 {
11166
11167 return super.GetTemperatureFreezeThreshold();
11168 }
11169
11171 {
11174
11175 return super.GetTemperatureThawThreshold();
11176 }
11177
11179 {
11182
11183 return super.GetItemOverheatThreshold();
11184 }
11185
11187 {
11189 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11190
11191 return super.GetTemperatureFreezeTime();
11192 }
11193
11195 {
11197 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11198
11199 return super.GetTemperatureThawTime();
11200 }
11201
11206
11208 {
11209 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11210 }
11211
11213 {
11214 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11215 }
11216
11219 {
11221 }
11222
11224 {
11226 }
11227
11229 {
11231 }
11232
11235 {
11236 return null;
11237 }
11238
11241 {
11242 return false;
11243 }
11244
11246 {
11248 {
11251 if (!trg)
11252 {
11254 explosive = this;
11255 }
11256
11257 explosive.PairRemote(trg);
11259
11260 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11261 trg.SetPersistentPairID(persistentID);
11262 explosive.SetPersistentPairID(persistentID);
11263
11264 return true;
11265 }
11266 return false;
11267 }
11268
11271 {
11272 float ret = 1.0;
11275 ret *= GetHealth01();
11276
11277 return ret;
11278 }
11279
11280 #ifdef DEVELOPER
11281 override void SetDebugItem()
11282 {
11283 super.SetDebugItem();
11284 _itemBase = this;
11285 }
11286
11288 {
11289 string text = super.GetDebugText();
11290
11292 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11293
11294 return text;
11295 }
11296 #endif
11297
11299 {
11300 return true;
11301 }
11302
11304
11306
11308 {
11311 }
11312
11313
11321
11337}
11338
11340{
11342 if (entity)
11343 {
11344 bool is_item = entity.IsInherited(
ItemBase);
11345 if (is_item && full_quantity)
11346 {
11349 }
11350 }
11351 else
11352 {
11354 return NULL;
11355 }
11356 return entity;
11357}
11358
11360{
11361 if (item)
11362 {
11363 if (health > 0)
11364 item.SetHealth("", "", health);
11365
11366 if (item.CanHaveTemperature())
11367 {
11369 if (item.CanFreeze())
11370 item.SetFrozen(false);
11371 }
11372
11373 if (item.HasEnergyManager())
11374 {
11375 if (quantity >= 0)
11376 {
11377 item.GetCompEM().SetEnergy0To1(quantity);
11378 }
11379 else
11380 {
11382 }
11383 }
11384 else if (item.IsMagazine())
11385 {
11386 Magazine mag = Magazine.Cast(item);
11387 if (quantity >= 0)
11388 {
11389 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11390 }
11391 else
11392 {
11394 }
11395
11396 }
11397 else
11398 {
11399 if (quantity >= 0)
11400 {
11401 item.SetQuantityNormalized(quantity, false);
11402 }
11403 else
11404 {
11406 }
11407
11408 }
11409 }
11410}
11411
11412#ifdef DEVELOPER
11414#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.