6802{
6804 {
6805 return true;
6806 }
6807};
6808
6809
6810
6812{
6816
6818
6821
6822
6823
6824
6825
6834
6840
6845
6850
6871 protected bool m_IsResultOfSplit
6872
6874
6879
6880
6881
6883
6887
6888
6889
6891
6894
6895
6896
6902
6903
6911
6914
6915
6917
6918
6920
6921
6926
6927
6932
6933
6935
6936
6938 {
6943
6944 if (!
GetGame().IsDedicatedServer())
6945 {
6947 {
6949
6951 {
6953 }
6954 }
6955
6958 }
6959
6960 m_OldLocation = null;
6961
6963 {
6965 }
6966
6967 if (ConfigIsExisting("headSelectionsToHide"))
6968 {
6971 }
6972
6974 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
6975 {
6977 }
6978
6980
6981 m_IsResultOfSplit = false;
6982
6984 }
6985
6987 {
6988 super.InitItemVariables();
6989
6995 m_Count = ConfigGetInt(
"count");
6996
6999
7004
7007
7012
7024
7028
7029
7032 if (ConfigIsExisting("canBeSplit"))
7033 {
7036 }
7037
7039 if (ConfigIsExisting("itemBehaviour"))
7041
7042
7045 RegisterNetSyncVariableInt("m_VarLiquidType");
7046 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7047
7048 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7049 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7050 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7051
7052 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7053 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7054 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7055 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7056
7057 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7058 RegisterNetSyncVariableBool("m_IsTakeable");
7059 RegisterNetSyncVariableBool("m_IsHologram");
7060
7063 {
7066 }
7067
7069
7071 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7073
7074 }
7075
7077 {
7079 }
7080
7082 {
7085 {
7090 }
7091 }
7092
7093 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7094 {
7096 {
7099 }
7100
7102 }
7103
7105 {
7111 }
7112
7114
7116 {
7118
7119 if (!action)
7120 {
7121 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7122 return;
7123 }
7124
7126 if (!ai)
7127 {
7129 return;
7130 }
7131
7133 if (!action_array)
7134 {
7135 action_array = new array<ActionBase_Basic>;
7137 }
7138 if (LogManager.IsActionLogEnable())
7139 {
7140 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7141 }
7142
7143 if (action_array.Find(action) != -1)
7144 {
7145 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7146 }
7147 else
7148 {
7149 action_array.Insert(action);
7150 }
7151 }
7152
7154 {
7156 ActionBase action = player.GetActionManager().GetAction(actionName);
7159
7160 if (action_array)
7161 {
7162 action_array.RemoveItem(action);
7163 }
7164 }
7165
7166
7167
7169 {
7170 ActionOverrideData overrideData = new ActionOverrideData();
7174
7176 if (!actionMap)
7177 {
7180 }
7181
7182 actionMap.Insert(this.
Type(), overrideData);
7183
7184 }
7185
7187
7189
7190
7192 {
7195
7198
7199 string config_to_search = "CfgVehicles";
7200 string muzzle_owner_config;
7201
7203 {
7204 if (IsInherited(Weapon))
7205 config_to_search = "CfgWeapons";
7206
7207 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7208
7209 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7210
7212
7213 if (config_OnFire_subclass_count > 0)
7214 {
7215 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7216
7217 for (int i = 0; i < config_OnFire_subclass_count; i++)
7218 {
7219 string particle_class = "";
7221 string config_OnFire_entry = config_OnFire_class + particle_class;
7222 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7223 WPOF_array.Insert(WPOF);
7224 }
7225
7226
7228 }
7229 }
7230
7232 {
7233 config_to_search = "CfgWeapons";
7234 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7235
7236 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7237
7239
7240 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7241 {
7242 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7243
7244 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7245 {
7246 string particle_class2 = "";
7248 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7249 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7250 WPOBE_array.Insert(WPOBE);
7251 }
7252
7253
7255 }
7256 }
7257 }
7258
7259
7261 {
7264
7266 {
7267 string config_to_search = "CfgVehicles";
7268
7269 if (IsInherited(Weapon))
7270 config_to_search = "CfgWeapons";
7271
7272 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7273 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7274
7275 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7276 {
7277
7279
7281 {
7283 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7285 return;
7286 }
7287
7290
7291
7292
7294 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7295
7296 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7297 {
7298 string particle_class = "";
7300 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7302
7303 if (entry_type == CT_CLASS)
7304 {
7305 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7306 WPOOH_array.Insert(WPOF);
7307 }
7308 }
7309
7310
7312 }
7313 }
7314 }
7315
7317 {
7319 }
7320
7322 {
7324 {
7326
7329
7332
7333 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7334 }
7335 }
7336
7338 {
7340 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7341
7343 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7344
7346 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7347
7349 {
7351 }
7352 }
7353
7355 {
7357 }
7358
7360 {
7363 else
7365
7367 {
7370 }
7371 else
7372 {
7375
7378 }
7379
7381 }
7382
7384 {
7386 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7387 }
7388
7390 {
7392 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7394 }
7395
7397 {
7399 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7400 }
7401
7403 {
7406
7407 OverheatingParticle OP = new OverheatingParticle();
7412
7414 }
7415
7417 {
7420
7421 return -1;
7422 }
7423
7425 {
7427 {
7430
7431 for (int i = count; i > 0; --i)
7432 {
7433 int id = i - 1;
7436
7439
7440 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7441 {
7442 if (p)
7443 {
7446 }
7447 }
7448 }
7449 }
7450 }
7451
7453 {
7455 {
7457 {
7458 int id = i - 1;
7460
7461 if (OP)
7462 {
7464
7465 if (p)
7466 {
7468 }
7469
7470 delete OP;
7471 }
7472 }
7473
7476 }
7477 }
7478
7481 {
7482 return 0.0;
7483 }
7484
7485
7487 {
7488 return 250;
7489 }
7490
7492 {
7493 return 0;
7494 }
7495
7498 {
7500 return true;
7501
7502 return false;
7503 }
7504
7507 {
7510
7512 {
7514 }
7515 else
7516 {
7517
7519 }
7520
7522 }
7523
7530 {
7531 return -1;
7532 }
7533
7534
7535
7536
7538 {
7540 {
7542 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7543
7544 if (r_index >= 0)
7545 {
7546 InventoryLocation r_il = new InventoryLocation;
7547 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7548
7549 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7552 {
7553 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7554 }
7556 {
7557 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7558 }
7559
7560 }
7561
7562 player.GetHumanInventory().ClearUserReservedLocation(this);
7563 }
7564
7567 }
7568
7569
7570
7571
7573 {
7574 return ItemBase.m_DebugActionsMask;
7575 }
7576
7578 {
7579 return ItemBase.m_DebugActionsMask & mask;
7580 }
7581
7583 {
7584 ItemBase.m_DebugActionsMask = mask;
7585 }
7586
7588 {
7589 ItemBase.m_DebugActionsMask |= mask;
7590 }
7591
7593 {
7594 ItemBase.m_DebugActionsMask &= ~mask;
7595 }
7596
7598 {
7600 {
7602 }
7603 else
7604 {
7606 }
7607 }
7608
7609
7611 {
7612 if (GetEconomyProfile())
7613 {
7614 float q_max = GetEconomyProfile().GetQuantityMax();
7615 if (q_max > 0)
7616 {
7617 float q_min = GetEconomyProfile().GetQuantityMin();
7618 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7619
7621 {
7622 ComponentEnergyManager comp = GetCompEM();
7624 {
7626 }
7627 }
7629 {
7631
7632 }
7633
7634 }
7635 }
7636 }
7637
7640 {
7641 EntityAI parent = GetHierarchyParent();
7642
7643 if (parent)
7644 {
7645 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7646 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7647 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7648 }
7649 }
7650
7653 {
7654 EntityAI parent = GetHierarchyParent();
7655
7656 if (parent)
7657 {
7658 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7659 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7660 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7661 }
7662 }
7663
7665 {
7666
7667
7668
7669
7671
7673 {
7674 if (ScriptInputUserData.CanStoreInputUserData())
7675 {
7676 ScriptInputUserData ctx = new ScriptInputUserData;
7682 ctx.
Write(use_stack_max);
7685
7687 {
7688 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7689 }
7690 }
7691 }
7692 else if (!
GetGame().IsMultiplayer())
7693 {
7695 }
7696 }
7697
7699 {
7701 }
7702
7704 {
7706 }
7707
7709 {
7711 }
7712
7714 {
7715
7716 return false;
7717 }
7718
7720 {
7721 return false;
7722 }
7723
7727 {
7728 return false;
7729 }
7730
7732 {
7733 return "";
7734 }
7735
7737
7739 {
7740 return false;
7741 }
7742
7744 {
7745 return true;
7746 }
7747
7748
7749
7751 {
7752 return true;
7753 }
7754
7756 {
7757 return true;
7758 }
7759
7761 {
7762 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7764 }
7765
7767 {
7769 }
7770
7772 {
7774 if (!is_being_placed)
7776 SetSynchDirty();
7777 }
7778
7779
7781
7783 {
7785 }
7786
7788 {
7790 }
7791
7793 {
7794 return 1;
7795 }
7796
7798 {
7799 return false;
7800 }
7801
7803 {
7805 SetSynchDirty();
7806 }
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7843 {
7844 super.OnMovedInsideCargo(container);
7845
7846 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
7847 }
7848
7849 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
7850 {
7851 super.EEItemLocationChanged(oldLoc,newLoc);
7852
7853 PlayerBase new_player = null;
7854 PlayerBase old_player = null;
7855
7856 if (newLoc.GetParent())
7857 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
7858
7859 if (oldLoc.GetParent())
7860 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
7861
7863 {
7864 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
7865
7866 if (r_index >= 0)
7867 {
7868 InventoryLocation r_il = new InventoryLocation;
7869 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7870
7871 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7874 {
7875 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7876 }
7878 {
7879 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7880 }
7881
7882 }
7883 }
7884
7886 {
7887 if (new_player)
7888 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
7889
7890 if (new_player == old_player)
7891 {
7892
7893 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
7894 {
7896 {
7897 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
7898 {
7899 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7900 }
7901 }
7902 else
7903 {
7904 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
7905 }
7906 }
7907
7908 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
7909 {
7910 int type = oldLoc.GetType();
7912 {
7913 oldLoc.GetParent().GetOnSetLock().Invoke(this);
7914 }
7916 {
7917 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
7918 }
7919 }
7920 if (!m_OldLocation)
7921 {
7922 m_OldLocation = new InventoryLocation;
7923 }
7924 m_OldLocation.Copy(oldLoc);
7925 }
7926 else
7927 {
7928 if (m_OldLocation)
7929 {
7930 m_OldLocation.Reset();
7931 }
7932 }
7933
7935 }
7936 else
7937 {
7938 if (new_player)
7939 {
7940 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
7941 if (res_index >= 0)
7942 {
7943 InventoryLocation il = new InventoryLocation;
7944 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
7946 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
7949 {
7950 il.
GetParent().GetOnReleaseLock().Invoke(it);
7951 }
7953 {
7955 }
7956
7957 }
7958 }
7960 {
7961
7963 }
7964
7965 if (m_OldLocation)
7966 {
7967 m_OldLocation.Reset();
7968 }
7969 }
7970 }
7971
7972 override void EOnContact(IEntity other, Contact extra)
7973 {
7975 {
7976 int liquidType = -1;
7978 if (impactSpeed > 0.0)
7979 {
7981 #ifndef SERVER
7983 #else
7985 SetSynchDirty();
7986 #endif
7988 }
7989 }
7990
7991 #ifdef SERVER
7992 if (GetCompEM() && GetCompEM().IsPlugged())
7993 {
7994 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
7995 GetCompEM().UnplugThis();
7996 }
7997 #endif
7998 }
7999
8001
8003 {
8005 }
8006
8008 {
8009
8010 }
8011
8013 {
8014 super.OnItemLocationChanged(old_owner, new_owner);
8015
8016 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8017 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8018
8019 if (!relatedPlayer && playerNew)
8020 relatedPlayer = playerNew;
8021
8022 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8023 {
8025 if (actionMgr)
8026 {
8027 ActionBase currentAction = actionMgr.GetRunningAction();
8028 if (currentAction)
8030 }
8031 }
8032
8033 Man ownerPlayerOld = null;
8034 Man ownerPlayerNew = null;
8035
8036 if (old_owner)
8037 {
8038 if (old_owner.
IsMan())
8039 {
8040 ownerPlayerOld = Man.Cast(old_owner);
8041 }
8042 else
8043 {
8044 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8045 }
8046 }
8047 else
8048 {
8050 {
8052
8053 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8054 {
8055 GetCompEM().UnplugThis();
8056 }
8057 }
8058 }
8059
8060 if (new_owner)
8061 {
8062 if (new_owner.
IsMan())
8063 {
8064 ownerPlayerNew = Man.Cast(new_owner);
8065 }
8066 else
8067 {
8068 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8069 }
8070 }
8071
8072 if (ownerPlayerOld != ownerPlayerNew)
8073 {
8074 if (ownerPlayerOld)
8075 {
8076 array<EntityAI> subItemsExit = new array<EntityAI>;
8078 for (int i = 0; i < subItemsExit.Count(); i++)
8079 {
8082 }
8083 }
8084
8085 if (ownerPlayerNew)
8086 {
8087 array<EntityAI> subItemsEnter = new array<EntityAI>;
8089 for (int j = 0; j < subItemsEnter.Count(); j++)
8090 {
8093 }
8094 }
8095 }
8096 else if (ownerPlayerNew != null)
8097 {
8098 PlayerBase nplayer;
8099 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8100 {
8101 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8103 for (int k = 0; k < subItemsUpdate.Count(); k++)
8104 {
8106 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8107 }
8108 }
8109 }
8110
8111 if (old_owner)
8112 old_owner.OnChildItemRemoved(this);
8113 if (new_owner)
8114 new_owner.OnChildItemReceived(this);
8115 }
8116
8117
8119 {
8120 super.EEDelete(parent);
8121 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8122 if (player)
8123 {
8125
8126 if (player.IsAlive())
8127 {
8128 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8129 if (r_index >= 0)
8130 {
8131 InventoryLocation r_il = new InventoryLocation;
8132 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8133
8134 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8137 {
8138 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8139 }
8141 {
8142 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8143 }
8144
8145 }
8146
8147 player.RemoveQuickBarEntityShortcut(this);
8148 }
8149 }
8150 }
8151
8153 {
8154 super.EEKilled(killer);
8155
8158 {
8159 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8160 {
8161 if (IsMagazine())
8162 {
8163 if (Magazine.Cast(this).GetAmmoCount() > 0)
8164 {
8166 }
8167 }
8168 else
8169 {
8171 }
8172 }
8173 }
8174 }
8175
8177 {
8178 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8179
8180 super.OnWasAttached(parent, slot_id);
8181
8184
8186 }
8187
8189 {
8190 super.OnWasDetached(parent, slot_id);
8191
8194 }
8195
8197 {
8198 int idx;
8201
8202 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8203 if (inventory_slots.Count() < 1)
8204 {
8205 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8206 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8207 }
8208 else
8209 {
8210 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8211 }
8212
8213 idx = inventory_slots.Find(slot);
8214 if (idx < 0)
8215 return "";
8216
8217 return attach_types.Get(idx);
8218 }
8219
8221 {
8222 int idx = -1;
8223 string slot;
8224
8227
8228 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8229 if (inventory_slots.Count() < 1)
8230 {
8231 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8232 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8233 }
8234 else
8235 {
8236 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8237 if (detach_types.Count() < 1)
8238 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8239 }
8240
8241 for (int i = 0; i < inventory_slots.Count(); i++)
8242 {
8243 slot = inventory_slots.Get(i);
8244 }
8245
8246 if (slot != "")
8247 {
8248 if (detach_types.Count() == 1)
8249 idx = 0;
8250 else
8251 idx = inventory_slots.Find(slot);
8252 }
8253 if (idx < 0)
8254 return "";
8255
8256 return detach_types.Get(idx);
8257 }
8258
8260 {
8261
8263
8264
8265 float min_time = 1;
8266 float max_time = 3;
8267 float delay = Math.RandomFloat(min_time, max_time);
8268
8269 explode_timer.Run(delay, this, "DoAmmoExplosion");
8270 }
8271
8273 {
8274 Magazine magazine = Magazine.Cast(this);
8275 int pop_sounds_count = 6;
8276 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8277
8278
8279 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8280 string sound_name = pop_sounds[ sound_idx ];
8282
8283
8284 magazine.ServerAddAmmoCount(-1);
8285
8286
8287 float min_temp_to_explode = 100;
8288
8289 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
8290 {
8292 }
8293 }
8294
8295
8296 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8297 {
8298 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8299
8300 const int CHANCE_DAMAGE_CARGO = 4;
8301 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8302 const int CHANCE_DAMAGE_NOTHING = 2;
8303
8305 {
8306 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8307 int chances;
8308 int rnd;
8309
8310 if (GetInventory().GetCargo())
8311 {
8312 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8313 rnd = Math.RandomInt(0,chances);
8314
8315 if (rnd < CHANCE_DAMAGE_CARGO)
8316 {
8318 }
8319 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8320 {
8322 }
8323 }
8324 else
8325 {
8326 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8327 rnd = Math.RandomInt(0,chances);
8328
8329 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8330 {
8332 }
8333 }
8334 }
8335 }
8336
8338 {
8339 if (GetInventory().GetCargo())
8340 {
8341 int item_count = GetInventory().GetCargo().GetItemCount();
8342 if (item_count > 0)
8343 {
8344 int random_pick = Math.RandomInt(0, item_count);
8346 if (!item.IsExplosive())
8347 {
8348 item.AddHealth("","",damage);
8349 return true;
8350 }
8351 }
8352 }
8353 return false;
8354 }
8355
8357 {
8358 int attachment_count = GetInventory().AttachmentCount();
8359 if (attachment_count > 0)
8360 {
8361 int random_pick = Math.RandomInt(0, attachment_count);
8362 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8363 if (!attachment.IsExplosive())
8364 {
8365 attachment.AddHealth("","",damage);
8366 return true;
8367 }
8368 }
8369 return false;
8370 }
8371
8373 {
8375 }
8376
8378 {
8380 return GetInventory().CanRemoveEntity();
8381
8382 return false;
8383 }
8384
8386 {
8387
8389 return false;
8390
8391
8393 return false;
8394
8395
8396
8398 if (delta == 0)
8399 return false;
8400
8401
8402 return true;
8403 }
8404
8406 {
8408 {
8409 if (ScriptInputUserData.CanStoreInputUserData())
8410 {
8411 ScriptInputUserData ctx = new ScriptInputUserData;
8416 ctx.
Write(destination_entity);
8420 }
8421 }
8422 else if (!
GetGame().IsMultiplayer())
8423 {
8425 }
8426 }
8427
8429 {
8430 float split_quantity_new;
8434 InventoryLocation loc = new InventoryLocation;
8435
8436 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8437 {
8439 split_quantity_new = stack_max;
8440 else
8442
8444 {
8445 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8446 if (new_item)
8447 {
8448 new_item.SetResultOfSplit(true);
8449 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8451 new_item.
SetQuantity(split_quantity_new,
false,
true);
8452 }
8453 }
8454 }
8455 else if (destination_entity && slot_id == -1)
8456 {
8457 if (quantity > stack_max)
8458 split_quantity_new = stack_max;
8459 else
8460 split_quantity_new = quantity;
8461
8463 {
8465 {
8468 }
8469
8470 if (new_item)
8471 {
8472 new_item.SetResultOfSplit(true);
8473 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8475 new_item.
SetQuantity(split_quantity_new,
false,
true);
8476 }
8477 }
8478 }
8479 else
8480 {
8481 if (stack_max != 0)
8482 {
8484 {
8486 }
8487
8488 if (split_quantity_new == 0)
8489 {
8490 if (!
GetGame().IsMultiplayer())
8491 player.PhysicalPredictiveDropItem(this);
8492 else
8493 player.ServerDropEntity(this);
8494 return;
8495 }
8496
8498 {
8500
8501 if (new_item)
8502 {
8503 new_item.SetResultOfSplit(true);
8504 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8507 new_item.PlaceOnSurface();
8508 }
8509 }
8510 }
8511 }
8512 }
8513
8515 {
8516 float split_quantity_new;
8520 InventoryLocation loc = new InventoryLocation;
8521
8522 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8523 {
8525 split_quantity_new = stack_max;
8526 else
8528
8530 {
8531 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8532 if (new_item)
8533 {
8534 new_item.SetResultOfSplit(true);
8535 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8537 new_item.
SetQuantity(split_quantity_new,
false,
true);
8538 }
8539 }
8540 }
8541 else if (destination_entity && slot_id == -1)
8542 {
8543 if (quantity > stack_max)
8544 split_quantity_new = stack_max;
8545 else
8546 split_quantity_new = quantity;
8547
8549 {
8551 {
8554 }
8555
8556 if (new_item)
8557 {
8558 new_item.SetResultOfSplit(true);
8559 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8561 new_item.
SetQuantity(split_quantity_new,
false,
true);
8562 }
8563 }
8564 }
8565 else
8566 {
8567 if (stack_max != 0)
8568 {
8570 {
8572 }
8573
8575 {
8577
8578 if (new_item)
8579 {
8580 new_item.SetResultOfSplit(true);
8581 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8584 new_item.PlaceOnSurface();
8585 }
8586 }
8587 }
8588 }
8589 }
8590
8592 {
8594 {
8595 if (ScriptInputUserData.CanStoreInputUserData())
8596 {
8597 ScriptInputUserData ctx = new ScriptInputUserData;
8602 dst.WriteToContext(ctx);
8604 }
8605 }
8606 else if (!
GetGame().IsMultiplayer())
8607 {
8609 }
8610 }
8611
8613 {
8615 {
8616 if (ScriptInputUserData.CanStoreInputUserData())
8617 {
8618 ScriptInputUserData ctx = new ScriptInputUserData;
8623 ctx.
Write(destination_entity);
8629 }
8630 }
8631 else if (!
GetGame().IsMultiplayer())
8632 {
8634 }
8635 }
8636
8638 {
8640 }
8641
8643 {
8645 float split_quantity_new;
8647 if (dst.IsValid())
8648 {
8649 int slot_id = dst.GetSlot();
8651
8652 if (quantity > stack_max)
8653 split_quantity_new = stack_max;
8654 else
8655 split_quantity_new = quantity;
8656
8658 {
8660
8661 if (new_item)
8662 {
8663 new_item.SetResultOfSplit(true);
8664 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8666 new_item.
SetQuantity(split_quantity_new,
false,
true);
8667 }
8668
8669 return new_item;
8670 }
8671 }
8672
8673 return null;
8674 }
8675
8677 {
8679 float split_quantity_new;
8681 if (destination_entity)
8682 {
8684 if (quantity > stackable)
8685 split_quantity_new = stackable;
8686 else
8687 split_quantity_new = quantity;
8688
8690 {
8691 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8692 if (new_item)
8693 {
8694 new_item.SetResultOfSplit(true);
8695 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8697 new_item.
SetQuantity(split_quantity_new,
false,
true);
8698 }
8699 }
8700 }
8701 }
8702
8704 {
8706 {
8707 if (ScriptInputUserData.CanStoreInputUserData())
8708 {
8709 ScriptInputUserData ctx = new ScriptInputUserData;
8714 ItemBase destination_entity =
this;
8715 ctx.
Write(destination_entity);
8719 }
8720 }
8721 else if (!
GetGame().IsMultiplayer())
8722 {
8724 }
8725 }
8726
8728 {
8730 float split_quantity_new;
8732 if (player)
8733 {
8735 if (quantity > stackable)
8736 split_quantity_new = stackable;
8737 else
8738 split_quantity_new = quantity;
8739
8741 {
8742 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8743 new_item =
ItemBase.Cast(in_hands);
8744 if (new_item)
8745 {
8746 new_item.SetResultOfSplit(true);
8747 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8749 new_item.SetQuantity(split_quantity_new, false, true);
8750 }
8751 }
8752 }
8753 }
8754
8756 {
8758 float split_quantity_new = Math.Floor(quantity * 0.5);
8759
8761 return;
8762
8764
8765 if (new_item)
8766 {
8767 if (new_item.GetQuantityMax() < split_quantity_new)
8768 {
8769 split_quantity_new = new_item.GetQuantityMax();
8770 }
8771
8772 new_item.SetResultOfSplit(true);
8773 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8774
8776 {
8779 }
8780 else
8781 {
8783 new_item.
SetQuantity(split_quantity_new,
false,
true);
8784 }
8785 }
8786 }
8787
8789 {
8791 float split_quantity_new = Math.Floor(quantity / 2);
8792
8794 return;
8795
8796 InventoryLocation invloc = new InventoryLocation;
8798
8800 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8801
8802 if (new_item)
8803 {
8804 if (new_item.GetQuantityMax() < split_quantity_new)
8805 {
8806 split_quantity_new = new_item.GetQuantityMax();
8807 }
8809 {
8812 }
8813 else if (split_quantity_new > 1)
8814 {
8816 new_item.
SetQuantity(split_quantity_new,
false,
true);
8817 }
8818 }
8819 }
8820
8823 {
8824 SetWeightDirty();
8826
8827 if (parent)
8828 parent.OnAttachmentQuantityChangedEx(this, delta);
8829
8831 {
8833 {
8835 }
8837 {
8838 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
8840 }
8841 }
8842
8843 }
8844
8847 {
8848
8849 }
8850
8853 {
8855 }
8856
8858 {
8859 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
8860
8862 {
8863 if (newLevel == GameConstants.STATE_RUINED)
8864 {
8866 EntityAI parent = GetHierarchyParent();
8867 if (parent && parent.IsFireplace())
8868 {
8869 CargoBase cargo = GetInventory().GetCargo();
8870 if (cargo)
8871 {
8873 {
8875 }
8876 }
8877 }
8878 }
8879
8881 {
8882
8884 return;
8885 }
8886
8887 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
8888 {
8890 }
8891 }
8892 }
8893
8894
8896 {
8897 super.OnRightClick();
8898
8900 {
8902 {
8903 if (ScriptInputUserData.CanStoreInputUserData())
8904 {
8905 EntityAI root = GetHierarchyRoot();
8906 Man playerOwner = GetHierarchyRootPlayer();
8907 InventoryLocation dst = new InventoryLocation;
8908
8909
8910 if (!playerOwner && root && root == this)
8911 {
8913 }
8914 else
8915 {
8916
8917 GetInventory().GetCurrentInventoryLocation(dst);
8919 {
8922 {
8924 }
8925 else
8926 {
8928
8929
8930 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
8931 {
8933 }
8934 else
8935 {
8936 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
8937 }
8938 }
8939 }
8940 }
8941
8942 ScriptInputUserData ctx = new ScriptInputUserData;
8950 }
8951 }
8952 else if (!
GetGame().IsMultiplayer())
8953 {
8955 }
8956 }
8957 }
8958
8960 {
8961 if (root)
8962 {
8963 vector m4[4];
8964 root.GetTransform(m4);
8965 dst.SetGround(this, m4);
8966 }
8967 else
8968 {
8969 GetInventory().GetCurrentInventoryLocation(dst);
8970 }
8971 }
8972
8973 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
8974 {
8975
8976 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
8977 return false;
8978
8979 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
8980 return false;
8981
8982
8984 return false;
8985
8986
8987 Magazine mag = Magazine.Cast(this);
8988 if (mag)
8989 {
8990 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
8991 return false;
8992
8993 if (stack_max_limit)
8994 {
8995 Magazine other_mag = Magazine.Cast(other_item);
8996 if (other_item)
8997 {
8998 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
8999 return false;
9000 }
9001
9002 }
9003 }
9004 else
9005 {
9006
9008 return false;
9009
9011 return false;
9012 }
9013
9014 PlayerBase player = null;
9015 if (CastTo(player, GetHierarchyRootPlayer()))
9016 {
9017 if (player.GetInventory().HasAttachment(this))
9018 return false;
9019
9020 if (player.IsItemsToDelete())
9021 return false;
9022 }
9023
9024 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9025 return false;
9026
9027 int slotID;
9029 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9030 return false;
9031
9032 return true;
9033 }
9034
9036 {
9038 }
9039
9041 {
9042 return m_IsResultOfSplit;
9043 }
9044
9046 {
9047 m_IsResultOfSplit = value;
9048 }
9049
9051 {
9053 }
9054
9056 {
9057 float other_item_quantity = other_item.GetQuantity();
9058 float this_free_space;
9059
9061
9063
9064 if (other_item_quantity > this_free_space)
9065 {
9066 return this_free_space;
9067 }
9068 else
9069 {
9070 return other_item_quantity;
9071 }
9072 }
9073
9075 {
9077 }
9078
9080 {
9082 return;
9083
9084 if (!IsMagazine() && other_item)
9085 {
9087 if (quantity_used != 0)
9088 {
9089 float hp1 = GetHealth01("","");
9090 float hp2 = other_item.GetHealth01("","");
9091 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9092 hpResult = hpResult / (
GetQuantity() + quantity_used);
9093
9094 hpResult *= GetMaxHealth();
9095 Math.Round(hpResult);
9096 SetHealth("", "Health", hpResult);
9097
9099 other_item.AddQuantity(-quantity_used);
9100 }
9101 }
9103 }
9104
9106 {
9107 #ifdef SERVER
9108 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9109 GetHierarchyParent().IncreaseLifetimeUp();
9110 #endif
9111 };
9112
9114 {
9115 PlayerBase p = PlayerBase.Cast(player);
9116
9117 array<int> recipesIds = p.m_Recipes;
9118 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9119 if (moduleRecipesManager)
9120 {
9121 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9122 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9123 }
9124
9125 for (int i = 0;i < recipesIds.Count(); i++)
9126 {
9127 int key = recipesIds.Get(i);
9128 string recipeName = moduleRecipesManager.GetRecipeName(key);
9130 }
9131 }
9132
9133
9134 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9135 {
9136 super.GetDebugActions(outputList);
9137
9138
9144
9145
9150
9155
9156
9160
9161
9163 {
9167 }
9168
9171
9172
9176
9178
9179 InventoryLocation loc = new InventoryLocation();
9180 GetInventory().GetCurrentInventoryLocation(loc);
9182 {
9183 if (Gizmo_IsSupported())
9186 }
9187
9189 }
9190
9191
9192
9193
9195 {
9196 super.OnAction(action_id, player, ctx);
9197
9199 {
9200 switch (action_id)
9201 {
9204 return true;
9207 return true;
9208 }
9209 }
9210
9212 {
9213 switch (action_id)
9214 {
9216 Delete();
9217 return true;
9218 }
9219 }
9220
9221 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9222 {
9223 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9224 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9225 PlayerBase p = PlayerBase.Cast(player);
9226 if (
EActions.RECIPES_RANGE_START < 1000)
9227 {
9228 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9229 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9230 }
9231 }
9232 #ifndef SERVER
9233 else if (action_id ==
EActions.WATCH_PLAYER)
9234 {
9235 PluginDeveloper.SetDeveloperItemClientEx(player);
9236 }
9237 #endif
9239 {
9240 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9241 {
9242 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9243 OnDebugButtonPressServer(id + 1);
9244 }
9245
9246 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9247 {
9248 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9250 }
9251
9252 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9253 {
9254 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9256 }
9257
9258 else if (action_id ==
EActions.ADD_QUANTITY)
9259 {
9260 if (IsMagazine())
9261 {
9262 Magazine mag = Magazine.Cast(this);
9263 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9264 }
9265 else
9266 {
9268 }
9269
9270 if (m_EM)
9271 {
9272 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9273 }
9274
9275 }
9276
9277 else if (action_id ==
EActions.REMOVE_QUANTITY)
9278 {
9279 if (IsMagazine())
9280 {
9281 Magazine mag2 = Magazine.Cast(this);
9282 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9283 }
9284 else
9285 {
9287 }
9288 if (m_EM)
9289 {
9290 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9291 }
9292
9293 }
9294
9295 else if (action_id ==
EActions.SET_QUANTITY_0)
9296 {
9298
9299 if (m_EM)
9300 {
9301 m_EM.SetEnergy(0);
9302 }
9303 }
9304
9305 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9306 {
9308
9309 if (m_EM)
9310 {
9311 m_EM.SetEnergy(m_EM.GetEnergyMax());
9312 }
9313 }
9314
9315 else if (action_id ==
EActions.ADD_HEALTH)
9316 {
9317 AddHealth("","",GetMaxHealth("","Health")/5);
9318 }
9319 else if (action_id ==
EActions.REMOVE_HEALTH)
9320 {
9321 AddHealth("","",-GetMaxHealth("","Health")/5);
9322 }
9323 else if (action_id ==
EActions.DESTROY_HEALTH)
9324 {
9325 SetHealth01("","",0);
9326 }
9327 else if (action_id ==
EActions.WATCH_ITEM)
9328 {
9330 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9331 #ifdef DEVELOPER
9332 SetDebugDeveloper_item(this);
9333 #endif
9334 }
9335
9336 else if (action_id ==
EActions.ADD_TEMPERATURE)
9337 {
9338 AddTemperature(20);
9339
9340 }
9341
9342 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9343 {
9344 AddTemperature(-20);
9345
9346 }
9347
9348 else if (action_id ==
EActions.FLIP_FROZEN)
9349 {
9350 SetFrozen(!GetIsFrozen());
9351
9352 }
9353
9354 else if (action_id ==
EActions.ADD_WETNESS)
9355 {
9357
9358 }
9359
9360 else if (action_id ==
EActions.REMOVE_WETNESS)
9361 {
9363
9364 }
9365
9366 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9367 {
9370
9371
9372 }
9373
9374 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9375 {
9378 }
9379
9380 else if (action_id ==
EActions.MAKE_SPECIAL)
9381 {
9382 auto debugParams = DebugSpawnParams.WithPlayer(player);
9383 OnDebugSpawnEx(debugParams);
9384 }
9385
9386 }
9387
9388
9389 return false;
9390 }
9391
9392
9393
9394
9398
9401
9402
9403
9405 {
9406 return false;
9407 }
9408
9409
9411 {
9412 return true;
9413 }
9414
9415
9417 {
9418 return true;
9419 }
9420
9421
9422
9424 {
9425 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9427 }
9428
9431 {
9432 return null;
9433 }
9434
9436 {
9437 return false;
9438 }
9439
9441 {
9442 return false;
9443 }
9444
9448
9449
9451 {
9452 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9453 return module_repairing.CanRepair(this, item_repair_kit);
9454 }
9455
9456
9457 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9458 {
9459 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9460 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9461 }
9462
9463
9465 {
9466
9467
9468
9469
9470
9471
9472
9473
9474 return 1;
9475 }
9476
9477
9478
9480 {
9482 }
9483
9484
9485
9487 {
9489 }
9490
9491
9500 {
9501 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9502
9503 if (player)
9504 {
9505 player.MessageStatus(text);
9506 }
9507 }
9508
9509
9518 {
9519 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9520
9521 if (player)
9522 {
9523 player.MessageAction(text);
9524 }
9525 }
9526
9527
9536 {
9537 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9538
9539 if (player)
9540 {
9541 player.MessageFriendly(text);
9542 }
9543 }
9544
9545
9554 {
9555 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9556
9557 if (player)
9558 {
9559 player.MessageImportant(text);
9560 }
9561 }
9562
9564 {
9565 return true;
9566 }
9567
9568
9569 override bool KindOf(
string tag)
9570 {
9571 bool found = false;
9572 string item_name = this.
GetType();
9575
9576 int array_size = item_tag_array.Count();
9577 for (int i = 0; i < array_size; i++)
9578 {
9579 if (item_tag_array.Get(i) == tag)
9580 {
9581 found = true;
9582 break;
9583 }
9584 }
9585 return found;
9586 }
9587
9588
9590 {
9591
9592 super.OnRPC(sender, rpc_type,ctx);
9593
9594
9595 switch (rpc_type)
9596 {
9597 #ifndef SERVER
9598 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9599 Param2<bool, string> p = new Param2<bool, string>(false, "");
9600
9602 return;
9603
9604 bool play = p.param1;
9605 string soundSet = p.param2;
9606
9607 if (play)
9608 {
9610 {
9612 {
9614 }
9615 }
9616 else
9617 {
9619 }
9620 }
9621 else
9622 {
9624 }
9625
9626 break;
9627 #endif
9628
9629 }
9630
9632 {
9634 }
9635 }
9636
9637
9638
9639
9641 {
9642 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9643 return plugin.GetID(
name);
9644 }
9645
9647 {
9648 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9649 return plugin.GetName(id);
9650 }
9651
9654 {
9655
9656
9657 int varFlags;
9658 if (!ctx.
Read(varFlags))
9659 return;
9660
9661 if (varFlags & ItemVariableFlags.FLOAT)
9662 {
9664 }
9665 }
9666
9668 {
9669
9670 super.SerializeNumericalVars(floats_out);
9671
9672
9673
9675 {
9677 }
9678
9680 {
9682 }
9683
9685 {
9687 }
9688
9690 {
9695 }
9696
9698 {
9700 }
9701 }
9702
9704 {
9705
9706 super.DeSerializeNumericalVars(floats);
9707
9708
9709 int index = 0;
9710 int mask = Math.Round(floats.Get(index));
9711
9712 index++;
9713
9715 {
9717 {
9719 }
9720 else
9721 {
9722 float quantity = floats.Get(index);
9724 }
9725 index++;
9726 }
9727
9729 {
9730 float wet = floats.Get(index);
9732 index++;
9733 }
9734
9736 {
9737 int liquidtype = Math.Round(floats.Get(index));
9739 index++;
9740 }
9741
9743 {
9745 index++;
9747 index++;
9749 index++;
9751 index++;
9752 }
9753
9755 {
9756 int cleanness = Math.Round(floats.Get(index));
9758 index++;
9759 }
9760 }
9761
9763 {
9764 super.WriteVarsToCTX(ctx);
9765
9766
9768 {
9770 }
9771
9773 {
9775 }
9776
9778 {
9780 }
9781
9783 {
9784 int r,g,b,a;
9790 }
9791
9793 {
9795 }
9796 }
9797
9799 {
9800 if (!super.ReadVarsFromCTX(ctx,version))
9801 return false;
9802
9803 int intValue;
9804 float value;
9805
9806 if (version < 140)
9807 {
9808 if (!ctx.
Read(intValue))
9809 return false;
9810
9811 m_VariablesMask = intValue;
9812 }
9813
9815 {
9816 if (!ctx.
Read(value))
9817 return false;
9818
9820 {
9822 }
9823 else
9824 {
9826 }
9827 }
9828
9829 if (version < 140)
9830 {
9832 {
9833 if (!ctx.
Read(value))
9834 return false;
9835 SetTemperatureDirect(value);
9836 }
9837 }
9838
9840 {
9841 if (!ctx.
Read(value))
9842 return false;
9844 }
9845
9847 {
9848 if (!ctx.
Read(intValue))
9849 return false;
9851 }
9852
9854 {
9855 int r,g,b,a;
9857 return false;
9859 return false;
9861 return false;
9863 return false;
9864
9866 }
9867
9869 {
9870 if (!ctx.
Read(intValue))
9871 return false;
9873 }
9874
9875 if (version >= 138 && version < 140)
9876 {
9878 {
9879 if (!ctx.
Read(intValue))
9880 return false;
9881 SetFrozen(intValue);
9882 }
9883 }
9884
9885 return true;
9886 }
9887
9888
9890 {
9893 {
9895 }
9896
9897 if (!super.OnStoreLoad(ctx, version))
9898 {
9900 return false;
9901 }
9902
9903 if (version >= 114)
9904 {
9905 bool hasQuickBarIndexSaved;
9906
9907 if (!ctx.
Read(hasQuickBarIndexSaved))
9908 {
9910 return false;
9911 }
9912
9913 if (hasQuickBarIndexSaved)
9914 {
9915 int itmQBIndex;
9916
9917
9918 if (!ctx.
Read(itmQBIndex))
9919 {
9921 return false;
9922 }
9923
9924 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
9925 if (itmQBIndex != -1 && parentPlayer)
9926 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
9927 }
9928 }
9929 else
9930 {
9931
9932 PlayerBase player;
9933 int itemQBIndex;
9934 if (version ==
int.
MAX)
9935 {
9936 if (!ctx.
Read(itemQBIndex))
9937 {
9939 return false;
9940 }
9941 }
9942 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
9943 {
9944
9945 if (!ctx.
Read(itemQBIndex))
9946 {
9948 return false;
9949 }
9950 if (itemQBIndex != -1 && player)
9951 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
9952 }
9953 }
9954
9955 if (version < 140)
9956 {
9957
9958 if (!LoadVariables(ctx, version))
9959 {
9961 return false;
9962 }
9963 }
9964
9965
9967 {
9969 return false;
9970 }
9971 if (version >= 132)
9972 {
9974 if (raib)
9975 {
9977 {
9979 return false;
9980 }
9981 }
9982 }
9983
9985 return true;
9986 }
9987
9988
9989
9991 {
9992 super.OnStoreSave(ctx);
9993
9994 PlayerBase player;
9995 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
9996 {
9998
9999 int itemQBIndex = -1;
10000 itemQBIndex = player.FindQuickBarEntityIndex(this);
10001 ctx.
Write(itemQBIndex);
10002 }
10003 else
10004 {
10006 }
10007
10009
10011 if (raib)
10012 {
10014 }
10015 }
10016
10017
10019 {
10020 super.AfterStoreLoad();
10021
10023 {
10025 }
10026
10028 {
10031 }
10032 }
10033
10035 {
10036 super.EEOnAfterLoad();
10037
10039 {
10041 }
10042
10045 }
10046
10048 {
10049 return false;
10050 }
10051
10052
10053
10055 {
10057 {
10058 #ifdef PLATFORM_CONSOLE
10059
10061 {
10063 if (menu)
10064 {
10066 }
10067 }
10068 #endif
10069 }
10070
10072 {
10075 }
10076
10078 {
10079 SetWeightDirty();
10081 }
10083 {
10086 }
10087
10089 {
10092 }
10094 {
10097 }
10098
10099 super.OnVariablesSynchronized();
10100 }
10101
10102
10103
10105 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10106 {
10107 if (!IsServerCheck(allow_client))
10108 return false;
10109
10111 return false;
10112
10115
10116 if (value <= (min + 0.001))
10117 value = min;
10118
10119 if (value == min)
10120 {
10121 if (destroy_config)
10122 {
10123 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10124 if (dstr)
10125 {
10127 this.Delete();
10128 return true;
10129 }
10130 }
10131 else if (destroy_forced)
10132 {
10134 this.Delete();
10135 return true;
10136 }
10137
10139 }
10140
10143
10145 {
10147
10148 if (delta)
10150 }
10151
10153
10154 return false;
10155 }
10156
10157
10159 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10160 {
10162 }
10163
10165 {
10168 }
10169
10171 {
10174 }
10175
10177 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10178 {
10179 float value_clamped = Math.Clamp(value, 0, 1);
10181 SetQuantity(result, destroy_config, destroy_forced);
10182 }
10183
10184
10187 {
10189 }
10190
10192 {
10194 }
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10206 {
10207 int slot = -1;
10208 if (GetInventory())
10209 {
10210 InventoryLocation il = new InventoryLocation;
10211 GetInventory().GetCurrentInventoryLocation(il);
10213 }
10214
10216 }
10217
10219 {
10220 float quantity_max = 0;
10221
10223 {
10224 if (attSlotID != -1)
10225 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10226
10227 if (quantity_max <= 0)
10229 }
10230
10231 if (quantity_max <= 0)
10233
10234 return quantity_max;
10235 }
10236
10238 {
10240 }
10241
10243 {
10245 }
10246
10247
10249 {
10251 }
10252
10254 {
10256 }
10257
10259 {
10261 }
10262
10263
10265 {
10266
10267 float weightEx = GetWeightEx();
10268 float special = GetInventoryAndCargoWeight();
10269 return weightEx - special;
10270 }
10271
10272
10274 {
10276 }
10277
10279 {
10281 {
10282 #ifdef DEVELOPER
10283 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10284 {
10285 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10287 }
10288 #endif
10289
10290 return GetQuantity() * GetConfigWeightModified();
10291 }
10292 else if (HasEnergyManager())
10293 {
10294 #ifdef DEVELOPER
10295 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10296 {
10297 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10298 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10299 }
10300 #endif
10301 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
10302 }
10303 else
10304 {
10305 #ifdef DEVELOPER
10306 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10307 {
10308 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10309 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10310 }
10311 #endif
10312 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
10313 }
10314 }
10315
10318 {
10319 int item_count = 0;
10321
10322 if (GetInventory().GetCargo() != NULL)
10323 {
10324 item_count = GetInventory().GetCargo().GetItemCount();
10325 }
10326
10327 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10328 {
10329 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10330 if (item)
10331 item_count += item.GetNumberOfItems();
10332 }
10333 return item_count;
10334 }
10335
10338 {
10339 float weight = 0;
10340 float wetness = 1;
10341 if (include_wetness)
10344 {
10345 weight = wetness * m_ConfigWeight;
10346 }
10348 {
10349 weight = 1;
10350 }
10351 return weight;
10352 }
10353
10354
10355
10357 {
10358 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10359 {
10360 GameInventory inv = GetInventory();
10361 array<EntityAI> items = new array<EntityAI>;
10363 for (int i = 0; i < items.Count(); i++)
10364 {
10366 if (item)
10367 {
10369 }
10370 }
10371 }
10372 }
10373
10374
10375
10376
10378 {
10379 float energy = 0;
10380 if (HasEnergyManager())
10381 {
10382 energy = GetCompEM().GetEnergy();
10383 }
10384 return energy;
10385 }
10386
10387
10389 {
10390 super.OnEnergyConsumed();
10391
10393 }
10394
10396 {
10397 super.OnEnergyAdded();
10398
10400 }
10401
10402
10404 {
10405 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10406 {
10408 {
10409 float energy_0to1 = GetCompEM().GetEnergy0To1();
10411 }
10412 }
10413 }
10414
10415
10417 {
10418 return ConfigGetFloat("heatIsolation");
10419 }
10420
10422 {
10424 }
10425
10427 {
10428 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10429 if (
GetGame().ConfigIsExisting(paramPath))
10431
10432 return 0.0;
10433 }
10434
10436 {
10437 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10438 if (
GetGame().ConfigIsExisting(paramPath))
10440
10441 return 0.0;
10442 }
10443
10444 override void SetWet(
float value,
bool allow_client =
false)
10445 {
10446 if (!IsServerCheck(allow_client))
10447 return;
10448
10451
10453
10454 m_VarWet = Math.Clamp(value, min, max);
10455
10457 {
10460 }
10461 }
10462
10463 override void AddWet(
float value)
10464 {
10466 }
10467
10469 {
10471 }
10472
10474 {
10476 }
10477
10479 {
10481 }
10482
10484 {
10486 }
10487
10489 {
10491 }
10492
10493 override void OnWetChanged(
float newVal,
float oldVal)
10494 {
10497 if (newLevel != oldLevel)
10498 {
10500 }
10501 }
10502
10504 {
10505 SetWeightDirty();
10506 }
10507
10509 {
10510 return GetWetLevelInternal(
m_VarWet);
10511 }
10512
10513
10514
10516 {
10518 }
10519
10521 {
10523 }
10524
10526 {
10528 }
10529
10531 {
10533 }
10534
10535
10536
10538 {
10539 if (ConfigIsExisting("itemModelLength"))
10540 {
10541 return ConfigGetFloat("itemModelLength");
10542 }
10543 return 0;
10544 }
10545
10547 {
10548 if (ConfigIsExisting("itemAttachOffset"))
10549 {
10550 return ConfigGetFloat("itemAttachOffset");
10551 }
10552 return 0;
10553 }
10554
10555 override void SetCleanness(
int value,
bool allow_client =
false)
10556 {
10557 if (!IsServerCheck(allow_client))
10558 return;
10559
10561
10563
10566 }
10567
10569 {
10571 }
10572
10574 {
10575 return true;
10576 }
10577
10578
10579
10580
10582 {
10584 }
10585
10587 {
10589 }
10590
10591
10592
10593
10594 override void SetColor(
int r,
int g,
int b,
int a)
10595 {
10601 }
10603 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10604 {
10609 }
10610
10612 {
10614 }
10615
10618 {
10619 int r,g,b,a;
10621 r = r/255;
10622 g = g/255;
10623 b = b/255;
10624 a = a/255;
10625 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10626 }
10627
10628
10629
10630 override void SetLiquidType(
int value,
bool allow_client =
false)
10631 {
10632 if (!IsServerCheck(allow_client))
10633 return;
10634
10639 }
10640
10642 {
10643 return ConfigGetInt("varLiquidTypeInit");
10644 }
10645
10647 {
10649 }
10650
10652 {
10654 SetFrozen(false);
10655 }
10656
10659 {
10660 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10661 }
10662
10663
10666 {
10667 PlayerBase nplayer;
10668 if (PlayerBase.CastTo(nplayer, player))
10669 {
10671
10672 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10673 }
10674 }
10675
10676
10679 {
10680 PlayerBase nplayer;
10681 if (PlayerBase.CastTo(nplayer,player))
10682 {
10683
10684 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10685
10686 }
10687
10688
10689 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10690
10691
10692 if (HasEnergyManager())
10693 {
10694 GetCompEM().UpdatePlugState();
10695 }
10696 }
10697
10698
10700 {
10701 super.OnPlacementStarted(player);
10702
10704 }
10705
10706 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10707 {
10709 {
10710 m_AdminLog.OnPlacementComplete(player,
this);
10711 }
10712
10713 super.OnPlacementComplete(player, position, orientation);
10714 }
10715
10716
10717
10718
10719
10721 {
10723 {
10724 return true;
10725 }
10726 else
10727 {
10728 return false;
10729 }
10730 }
10731
10732
10734 {
10736 {
10738 }
10739 }
10740
10741
10743 {
10745 }
10746
10748 {
10750 }
10751
10752 override void InsertAgent(
int agent,
float count = 1)
10753 {
10754 if (count < 1)
10755 return;
10756
10758 }
10759
10762 {
10764 }
10765
10766
10768 {
10770 }
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10814 {
10816 return false;
10817 return true;
10818 }
10819
10821 {
10822
10824 }
10825
10826
10829 {
10830 super.CheckForRoofLimited(timeTresholdMS);
10831
10833 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10834 {
10835 m_PreviousRoofTestTime = time;
10836 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10837 }
10838 }
10839
10840
10842 {
10844 {
10845 return 0;
10846 }
10847
10848 if (GetInventory().GetAttachmentSlotsCount() != 0)
10849 {
10850 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10851 if (filter)
10852 return filter.GetProtectionLevel(type, false, system);
10853 else
10854 return 0;
10855 }
10856
10857 string subclassPath, entryName;
10858
10859 switch (type)
10860 {
10862 entryName = "biological";
10863 break;
10865 entryName = "chemical";
10866 break;
10867 default:
10868 entryName = "biological";
10869 break;
10870 }
10871
10872 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
10873
10875 }
10876
10877
10878
10881 {
10882 if (!IsMagazine())
10884
10886 }
10887
10888
10889
10890
10891
10896 {
10897 return true;
10898 }
10899
10901 {
10903 }
10904
10905
10906
10907
10908
10910 {
10911 if (parent)
10912 {
10913 if (parent.IsInherited(DayZInfected))
10914 return true;
10915
10916 if (!parent.IsRuined())
10917 return true;
10918 }
10919
10920 return true;
10921 }
10922
10924 {
10925 if (!super.CanPutAsAttachment(parent))
10926 {
10927 return false;
10928 }
10929
10930 if (!IsRuined() && !parent.IsRuined())
10931 {
10932 return true;
10933 }
10934
10935 return false;
10936 }
10937
10939 {
10940
10941
10942
10943
10944 return super.CanReceiveItemIntoCargo(item);
10945 }
10946
10948 {
10949
10950
10951
10952
10953 GameInventory attachmentInv = attachment.GetInventory();
10955 {
10956 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
10957 return false;
10958 }
10959
10960 InventoryLocation loc = new InventoryLocation();
10961 attachment.GetInventory().GetCurrentInventoryLocation(loc);
10962 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
10963 return false;
10964
10965 return super.CanReceiveAttachment(attachment, slotId);
10966 }
10967
10969 {
10970 if (!super.CanReleaseAttachment(attachment))
10971 return false;
10972
10973 return GetInventory().AreChildrenAccessible();
10974 }
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10997 {
10998 int id = muzzle_owner.GetMuzzleID();
10999 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11000
11001 if (WPOF_array)
11002 {
11003 for (int i = 0; i < WPOF_array.Count(); i++)
11004 {
11005 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11006
11007 if (WPOF)
11008 {
11009 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11010 }
11011 }
11012 }
11013 }
11014
11015
11017 {
11018 int id = muzzle_owner.GetMuzzleID();
11020
11021 if (WPOBE_array)
11022 {
11023 for (int i = 0; i < WPOBE_array.Count(); i++)
11024 {
11025 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11026
11027 if (WPOBE)
11028 {
11029 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11030 }
11031 }
11032 }
11033 }
11034
11035
11037 {
11038 int id = muzzle_owner.GetMuzzleID();
11039 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11040
11041 if (WPOOH_array)
11042 {
11043 for (int i = 0; i < WPOOH_array.Count(); i++)
11044 {
11045 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11046
11047 if (WPOOH)
11048 {
11049 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11050 }
11051 }
11052 }
11053 }
11054
11055
11057 {
11058 int id = muzzle_owner.GetMuzzleID();
11059 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11060
11061 if (WPOOH_array)
11062 {
11063 for (int i = 0; i < WPOOH_array.Count(); i++)
11064 {
11065 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11066
11067 if (WPOOH)
11068 {
11069 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11070 }
11071 }
11072 }
11073 }
11074
11075
11077 {
11078 int id = muzzle_owner.GetMuzzleID();
11079 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11080
11081 if (WPOOH_array)
11082 {
11083 for (int i = 0; i < WPOOH_array.Count(); i++)
11084 {
11085 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11086
11087 if (WPOOH)
11088 {
11089 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11090 }
11091 }
11092 }
11093 }
11094
11095
11096
11098 {
11100 {
11101 return true;
11102 }
11103
11104 return false;
11105 }
11106
11108 {
11110 {
11111 return true;
11112 }
11113
11114 return false;
11115 }
11116
11118 {
11120 {
11121 return true;
11122 }
11123
11124 return false;
11125 }
11126
11128 {
11129 return false;
11130 }
11131
11134 {
11135 return UATimeSpent.DEFAULT_DEPLOY;
11136 }
11137
11138
11139
11140
11142 {
11144 SetSynchDirty();
11145 }
11146
11148 {
11150 }
11151
11152
11154 {
11155 return false;
11156 }
11157
11160 {
11161 string att_type = "None";
11162
11163 if (ConfigIsExisting("soundAttType"))
11164 {
11165 att_type = ConfigGetString("soundAttType");
11166 }
11167
11169 }
11170
11172 {
11174 }
11175
11176
11177
11178
11179
11185
11187 {
11190
11192 }
11193
11194
11196 {
11198 return;
11199
11201
11204
11207
11208 SoundParameters params = new SoundParameters();
11212 }
11213
11214
11216 {
11218 return;
11219
11221 SetSynchDirty();
11222
11225 }
11226
11227
11229 {
11231 return;
11232
11234 SetSynchDirty();
11235
11238 }
11239
11241 {
11243 }
11244
11246 {
11248 }
11249
11252 {
11253 if (!
GetGame().IsDedicatedServer())
11254 {
11255 if (ConfigIsExisting("attachSoundSet"))
11256 {
11257 string cfg_path = "";
11258 string soundset = "";
11259 string type_name =
GetType();
11260
11263 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11264 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11265
11266 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11267 {
11268 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11269 {
11270 if (cfg_slot_array[i] == slot_type)
11271 {
11272 soundset = cfg_soundset_array[i];
11273 break;
11274 }
11275 }
11276 }
11277
11278 if (soundset != "")
11279 {
11280 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11282 }
11283 }
11284 }
11285 }
11286
11288 {
11289
11290 }
11291
11292 void OnApply(PlayerBase player);
11293
11295 {
11296 return 1.0;
11297 };
11298
11300 {
11302 }
11303
11305 {
11307 }
11308
11310
11312 {
11313 SetDynamicPhysicsLifeTime(0.01);
11315 }
11316
11318 {
11319 array<string> zone_names = new array<string>;
11320 GetDamageZones(zone_names);
11321 for (int i = 0; i < zone_names.Count(); i++)
11322 {
11323 SetHealthMax(zone_names.Get(i),"Health");
11324 }
11325 SetHealthMax("","Health");
11326 }
11327
11330 {
11331 float global_health = GetHealth01("","Health");
11332 array<string> zones = new array<string>;
11333 GetDamageZones(zones);
11334
11335 for (int i = 0; i < zones.Count(); i++)
11336 {
11337 SetHealth01(zones.Get(i),"Health",global_health);
11338 }
11339 }
11340
11343 {
11344 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11345 }
11346
11348 {
11349 if (!hasRootAsPlayer)
11350 {
11351 if (refParentIB)
11352 {
11353
11354 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11355 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11356
11357 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11358 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11359
11362 }
11363 else
11364 {
11365
11368 }
11369 }
11370 }
11371
11373 {
11375 {
11376 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11377 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
11378 {
11379 float heatPermCoef = 1.0;
11381 while (ent)
11382 {
11383 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11384 ent = ent.GetHierarchyParent();
11385 }
11386
11387 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11388 }
11389 }
11390 }
11391
11393 {
11394
11395 EntityAI parent = GetHierarchyParent();
11396 if (!parent)
11397 {
11398 hasParent = false;
11399 hasRootAsPlayer = false;
11400 }
11401 else
11402 {
11403 hasParent = true;
11404 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11405 refParentIB =
ItemBase.Cast(parent);
11406 }
11407 }
11408
11409 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11410 {
11411
11412 }
11413
11415 {
11416
11417 return false;
11418 }
11419
11421 {
11422
11423
11424 return false;
11425 }
11426
11428 {
11429
11430 return false;
11431 }
11432
11435 {
11436 return !GetIsFrozen() &&
IsOpen();
11437 }
11438
11440 {
11441 bool hasParent = false, hasRootAsPlayer = false;
11443
11444 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11445 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11446
11447 if (wwtu || foodDecay)
11448 {
11452
11453 if (processWetness || processTemperature || processDecay)
11454 {
11456
11457 if (processWetness)
11458 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11459
11460 if (processTemperature)
11462
11463 if (processDecay)
11464 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11465 }
11466 }
11467 }
11468
11471 {
11473 }
11474
11476 {
11479
11480 return super.GetTemperatureFreezeThreshold();
11481 }
11482
11484 {
11487
11488 return super.GetTemperatureThawThreshold();
11489 }
11490
11492 {
11495
11496 return super.GetItemOverheatThreshold();
11497 }
11498
11500 {
11502 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11503
11504 return super.GetTemperatureFreezeTime();
11505 }
11506
11508 {
11510 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11511
11512 return super.GetTemperatureThawTime();
11513 }
11514
11519
11521 {
11522 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11523 }
11524
11526 {
11527 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11528 }
11529
11532 {
11534 }
11535
11537 {
11539 }
11540
11542 {
11544 }
11545
11548 {
11549 return null;
11550 }
11551
11554 {
11555 return false;
11556 }
11557
11559 {
11561 {
11564 if (!trg)
11565 {
11567 explosive = this;
11568 }
11569
11570 explosive.PairRemote(trg);
11572
11573 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11574 trg.SetPersistentPairID(persistentID);
11575 explosive.SetPersistentPairID(persistentID);
11576
11577 return true;
11578 }
11579 return false;
11580 }
11581
11584 {
11585 float ret = 1.0;
11588 ret *= GetHealth01();
11589
11590 return ret;
11591 }
11592
11593 #ifdef DEVELOPER
11594 override void SetDebugItem()
11595 {
11596 super.SetDebugItem();
11597 _itemBase = this;
11598 }
11599
11601 {
11602 string text = super.GetDebugText();
11603
11605 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11606
11607 return text;
11608 }
11609 #endif
11610
11612 {
11613 return true;
11614 }
11615
11617
11619
11621 {
11624 }
11625
11626
11634
11650}
11651
11653{
11655 if (entity)
11656 {
11657 bool is_item = entity.IsInherited(
ItemBase);
11658 if (is_item && full_quantity)
11659 {
11662 }
11663 }
11664 else
11665 {
11667 return NULL;
11668 }
11669 return entity;
11670}
11671
11673{
11674 if (item)
11675 {
11676 if (health > 0)
11677 item.SetHealth("", "", health);
11678
11679 if (item.CanHaveTemperature())
11680 {
11682 if (item.CanFreeze())
11683 item.SetFrozen(false);
11684 }
11685
11686 if (item.HasEnergyManager())
11687 {
11688 if (quantity >= 0)
11689 {
11690 item.GetCompEM().SetEnergy0To1(quantity);
11691 }
11692 else
11693 {
11695 }
11696 }
11697 else if (item.IsMagazine())
11698 {
11699 Magazine mag = Magazine.Cast(item);
11700 if (quantity >= 0)
11701 {
11702 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11703 }
11704 else
11705 {
11707 }
11708
11709 }
11710 else
11711 {
11712 if (quantity >= 0)
11713 {
11714 item.SetQuantityNormalized(quantity, false);
11715 }
11716 else
11717 {
11719 }
11720
11721 }
11722 }
11723}
11724
11725#ifdef DEVELOPER
11727#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.