7015{
7017 {
7018 return true;
7019 }
7020};
7021
7022
7023
7025{
7029
7031
7034
7035
7036
7037
7038
7047
7053
7058
7063
7084 protected bool m_IsResultOfSplit
7085
7087
7092
7093
7094
7096
7100
7101
7102
7104
7107
7108
7109
7115
7116
7124
7127
7128
7130
7131
7133
7134
7139
7140
7145
7146
7148
7149
7151 {
7156
7157 if (!
GetGame().IsDedicatedServer())
7158 {
7160 {
7162
7164 {
7166 }
7167 }
7168
7171 }
7172
7173 m_OldLocation = null;
7174
7176 {
7178 }
7179
7180 if (ConfigIsExisting("headSelectionsToHide"))
7181 {
7184 }
7185
7187 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7188 {
7190 }
7191
7193
7194 m_IsResultOfSplit = false;
7195
7197 }
7198
7200 {
7201 super.InitItemVariables();
7202
7208 m_Count = ConfigGetInt(
"count");
7209
7212
7217
7220
7225
7237
7241
7242
7245 if (ConfigIsExisting("canBeSplit"))
7246 {
7249 }
7250
7252 if (ConfigIsExisting("itemBehaviour"))
7254
7255
7258 RegisterNetSyncVariableInt("m_VarLiquidType");
7259 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7260
7261 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7262 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7263 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7264
7265 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7266 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7267 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7268 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7269
7270 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7271 RegisterNetSyncVariableBool("m_IsTakeable");
7272 RegisterNetSyncVariableBool("m_IsHologram");
7273
7276 {
7279 }
7280
7282
7284 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7286
7287 }
7288
7290 {
7292 }
7293
7295 {
7298 {
7303 }
7304 }
7305
7306 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7307 {
7309 {
7312 }
7313
7315 }
7316
7318 {
7324 }
7325
7327
7329 {
7331
7332 if (!action)
7333 {
7334 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7335 return;
7336 }
7337
7339 if (!ai)
7340 {
7342 return;
7343 }
7344
7346 if (!action_array)
7347 {
7348 action_array = new array<ActionBase_Basic>;
7350 }
7351 if (LogManager.IsActionLogEnable())
7352 {
7353 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7354 }
7355
7356 if (action_array.Find(action) != -1)
7357 {
7358 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7359 }
7360 else
7361 {
7362 action_array.Insert(action);
7363 }
7364 }
7365
7367 {
7369 ActionBase action = player.GetActionManager().GetAction(actionName);
7372
7373 if (action_array)
7374 {
7375 action_array.RemoveItem(action);
7376 }
7377 }
7378
7379
7380
7382 {
7383 ActionOverrideData overrideData = new ActionOverrideData();
7387
7389 if (!actionMap)
7390 {
7393 }
7394
7395 actionMap.Insert(this.
Type(), overrideData);
7396
7397 }
7398
7400
7402
7403
7405 {
7408
7411
7412 string config_to_search = "CfgVehicles";
7413 string muzzle_owner_config;
7414
7416 {
7417 if (IsInherited(Weapon))
7418 config_to_search = "CfgWeapons";
7419
7420 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7421
7422 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7423
7425
7426 if (config_OnFire_subclass_count > 0)
7427 {
7428 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7429
7430 for (int i = 0; i < config_OnFire_subclass_count; i++)
7431 {
7432 string particle_class = "";
7434 string config_OnFire_entry = config_OnFire_class + particle_class;
7435 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7436 WPOF_array.Insert(WPOF);
7437 }
7438
7439
7441 }
7442 }
7443
7445 {
7446 config_to_search = "CfgWeapons";
7447 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7448
7449 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7450
7452
7453 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7454 {
7455 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7456
7457 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7458 {
7459 string particle_class2 = "";
7461 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7462 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7463 WPOBE_array.Insert(WPOBE);
7464 }
7465
7466
7468 }
7469 }
7470 }
7471
7472
7474 {
7477
7479 {
7480 string config_to_search = "CfgVehicles";
7481
7482 if (IsInherited(Weapon))
7483 config_to_search = "CfgWeapons";
7484
7485 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7486 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7487
7488 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7489 {
7490
7492
7494 {
7496 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7498 return;
7499 }
7500
7503
7504
7505
7507 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7508
7509 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7510 {
7511 string particle_class = "";
7513 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7515
7516 if (entry_type == CT_CLASS)
7517 {
7518 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7519 WPOOH_array.Insert(WPOF);
7520 }
7521 }
7522
7523
7525 }
7526 }
7527 }
7528
7530 {
7532 }
7533
7535 {
7537 {
7539
7542
7545
7546 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7547 }
7548 }
7549
7551 {
7553 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7554
7556 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7557
7559 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7560
7562 {
7564 }
7565 }
7566
7568 {
7570 }
7571
7573 {
7576 else
7578
7580 {
7583 }
7584 else
7585 {
7588
7591 }
7592
7594 }
7595
7597 {
7599 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7600 }
7601
7603 {
7605 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7607 }
7608
7610 {
7612 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7613 }
7614
7616 {
7619
7620 OverheatingParticle OP = new OverheatingParticle();
7625
7627 }
7628
7630 {
7633
7634 return -1;
7635 }
7636
7638 {
7640 {
7643
7644 for (int i = count; i > 0; --i)
7645 {
7646 int id = i - 1;
7649
7652
7653 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7654 {
7655 if (p)
7656 {
7659 }
7660 }
7661 }
7662 }
7663 }
7664
7666 {
7668 {
7670 {
7671 int id = i - 1;
7673
7674 if (OP)
7675 {
7677
7678 if (p)
7679 {
7681 }
7682
7683 delete OP;
7684 }
7685 }
7686
7689 }
7690 }
7691
7694 {
7695 return 0.0;
7696 }
7697
7698
7700 {
7701 return 250;
7702 }
7703
7705 {
7706 return 0;
7707 }
7708
7711 {
7713 return true;
7714
7715 return false;
7716 }
7717
7720 {
7723
7725 {
7727 }
7728 else
7729 {
7730
7732 }
7733
7735 }
7736
7743 {
7744 return -1;
7745 }
7746
7747
7748
7749
7751 {
7753 {
7755 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7756
7757 if (r_index >= 0)
7758 {
7759 InventoryLocation r_il = new InventoryLocation;
7760 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7761
7762 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7765 {
7766 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7767 }
7769 {
7770 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7771 }
7772
7773 }
7774
7775 player.GetHumanInventory().ClearUserReservedLocation(this);
7776 }
7777
7780 }
7781
7782
7783
7784
7786 {
7787 return ItemBase.m_DebugActionsMask;
7788 }
7789
7791 {
7792 return ItemBase.m_DebugActionsMask & mask;
7793 }
7794
7796 {
7797 ItemBase.m_DebugActionsMask = mask;
7798 }
7799
7801 {
7802 ItemBase.m_DebugActionsMask |= mask;
7803 }
7804
7806 {
7807 ItemBase.m_DebugActionsMask &= ~mask;
7808 }
7809
7811 {
7813 {
7815 }
7816 else
7817 {
7819 }
7820 }
7821
7822
7824 {
7825 if (GetEconomyProfile())
7826 {
7827 float q_max = GetEconomyProfile().GetQuantityMax();
7828 if (q_max > 0)
7829 {
7830 float q_min = GetEconomyProfile().GetQuantityMin();
7831 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7832
7834 {
7835 ComponentEnergyManager comp = GetCompEM();
7837 {
7839 }
7840 }
7842 {
7844
7845 }
7846
7847 }
7848 }
7849 }
7850
7853 {
7854 EntityAI parent = GetHierarchyParent();
7855
7856 if (parent)
7857 {
7858 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7859 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7860 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7861 }
7862 }
7863
7866 {
7867 EntityAI parent = GetHierarchyParent();
7868
7869 if (parent)
7870 {
7871 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7872 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7873 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7874 }
7875 }
7876
7878 {
7879
7880
7881
7882
7884
7886 {
7887 if (ScriptInputUserData.CanStoreInputUserData())
7888 {
7889 ScriptInputUserData ctx = new ScriptInputUserData;
7895 ctx.
Write(use_stack_max);
7898
7900 {
7901 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7902 }
7903 }
7904 }
7905 else if (!
GetGame().IsMultiplayer())
7906 {
7908 }
7909 }
7910
7912 {
7914 }
7915
7917 {
7919 }
7920
7922 {
7924 }
7925
7927 {
7928
7929 return false;
7930 }
7931
7933 {
7934 return false;
7935 }
7936
7940 {
7941 return false;
7942 }
7943
7945 {
7946 return "";
7947 }
7948
7950
7952 {
7953 return false;
7954 }
7955
7957 {
7958 return true;
7959 }
7960
7961
7962
7964 {
7965 return true;
7966 }
7967
7969 {
7970 return true;
7971 }
7972
7974 {
7975 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
7977 }
7978
7980 {
7982 }
7983
7985 {
7987 if (!is_being_placed)
7989 SetSynchDirty();
7990 }
7991
7992
7994
7996 {
7998 }
7999
8001 {
8003 }
8004
8006 {
8007 return 1;
8008 }
8009
8011 {
8012 return false;
8013 }
8014
8016 {
8018 SetSynchDirty();
8019 }
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8056 {
8057 super.OnMovedInsideCargo(container);
8058
8059 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8060 }
8061
8062 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8063 {
8064 super.EEItemLocationChanged(oldLoc,newLoc);
8065
8066 PlayerBase new_player = null;
8067 PlayerBase old_player = null;
8068
8069 if (newLoc.GetParent())
8070 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8071
8072 if (oldLoc.GetParent())
8073 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8074
8076 {
8077 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8078
8079 if (r_index >= 0)
8080 {
8081 InventoryLocation r_il = new InventoryLocation;
8082 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8083
8084 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8087 {
8088 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8089 }
8091 {
8092 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8093 }
8094
8095 }
8096 }
8097
8099 {
8100 if (new_player)
8101 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8102
8103 if (new_player == old_player)
8104 {
8105
8106 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8107 {
8109 {
8110 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8111 {
8112 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8113 }
8114 }
8115 else
8116 {
8117 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8118 }
8119 }
8120
8121 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8122 {
8123 int type = oldLoc.GetType();
8125 {
8126 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8127 }
8129 {
8130 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8131 }
8132 }
8133 if (!m_OldLocation)
8134 {
8135 m_OldLocation = new InventoryLocation;
8136 }
8137 m_OldLocation.Copy(oldLoc);
8138 }
8139 else
8140 {
8141 if (m_OldLocation)
8142 {
8143 m_OldLocation.Reset();
8144 }
8145 }
8146
8148 }
8149 else
8150 {
8151 if (new_player)
8152 {
8153 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8154 if (res_index >= 0)
8155 {
8156 InventoryLocation il = new InventoryLocation;
8157 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8159 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8162 {
8163 il.
GetParent().GetOnReleaseLock().Invoke(it);
8164 }
8166 {
8168 }
8169
8170 }
8171 }
8173 {
8174
8176 }
8177
8178 if (m_OldLocation)
8179 {
8180 m_OldLocation.Reset();
8181 }
8182 }
8183 }
8184
8185 override void EOnContact(IEntity other, Contact extra)
8186 {
8188 {
8189 int liquidType = -1;
8191 if (impactSpeed > 0.0)
8192 {
8194 #ifndef SERVER
8196 #else
8198 SetSynchDirty();
8199 #endif
8201 }
8202 }
8203
8204 #ifdef SERVER
8205 if (GetCompEM() && GetCompEM().IsPlugged())
8206 {
8207 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8208 GetCompEM().UnplugThis();
8209 }
8210 #endif
8211 }
8212
8214
8216 {
8218 }
8219
8221 {
8222
8223 }
8224
8226 {
8227 super.OnItemLocationChanged(old_owner, new_owner);
8228
8229 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8230 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8231
8232 if (!relatedPlayer && playerNew)
8233 relatedPlayer = playerNew;
8234
8235 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8236 {
8238 if (actionMgr)
8239 {
8240 ActionBase currentAction = actionMgr.GetRunningAction();
8241 if (currentAction)
8243 }
8244 }
8245
8246 Man ownerPlayerOld = null;
8247 Man ownerPlayerNew = null;
8248
8249 if (old_owner)
8250 {
8251 if (old_owner.
IsMan())
8252 {
8253 ownerPlayerOld = Man.Cast(old_owner);
8254 }
8255 else
8256 {
8257 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8258 }
8259 }
8260 else
8261 {
8263 {
8265
8266 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8267 {
8268 GetCompEM().UnplugThis();
8269 }
8270 }
8271 }
8272
8273 if (new_owner)
8274 {
8275 if (new_owner.
IsMan())
8276 {
8277 ownerPlayerNew = Man.Cast(new_owner);
8278 }
8279 else
8280 {
8281 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8282 }
8283 }
8284
8285 if (ownerPlayerOld != ownerPlayerNew)
8286 {
8287 if (ownerPlayerOld)
8288 {
8289 array<EntityAI> subItemsExit = new array<EntityAI>;
8291 for (int i = 0; i < subItemsExit.Count(); i++)
8292 {
8295 }
8296 }
8297
8298 if (ownerPlayerNew)
8299 {
8300 array<EntityAI> subItemsEnter = new array<EntityAI>;
8302 for (int j = 0; j < subItemsEnter.Count(); j++)
8303 {
8306 }
8307 }
8308 }
8309 else if (ownerPlayerNew != null)
8310 {
8311 PlayerBase nplayer;
8312 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8313 {
8314 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8316 for (int k = 0; k < subItemsUpdate.Count(); k++)
8317 {
8319 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8320 }
8321 }
8322 }
8323
8324 if (old_owner)
8325 old_owner.OnChildItemRemoved(this);
8326 if (new_owner)
8327 new_owner.OnChildItemReceived(this);
8328 }
8329
8330
8332 {
8333 super.EEDelete(parent);
8334 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8335 if (player)
8336 {
8338
8339 if (player.IsAlive())
8340 {
8341 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8342 if (r_index >= 0)
8343 {
8344 InventoryLocation r_il = new InventoryLocation;
8345 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8346
8347 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8350 {
8351 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8352 }
8354 {
8355 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8356 }
8357
8358 }
8359
8360 player.RemoveQuickBarEntityShortcut(this);
8361 }
8362 }
8363 }
8364
8366 {
8367 super.EEKilled(killer);
8368
8371 {
8372 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8373 {
8374 if (IsMagazine())
8375 {
8376 if (Magazine.Cast(this).GetAmmoCount() > 0)
8377 {
8379 }
8380 }
8381 else
8382 {
8384 }
8385 }
8386 }
8387 }
8388
8390 {
8391 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8392
8393 super.OnWasAttached(parent, slot_id);
8394
8397
8399 }
8400
8402 {
8403 super.OnWasDetached(parent, slot_id);
8404
8407 }
8408
8410 {
8411 int idx;
8414
8415 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8416 if (inventory_slots.Count() < 1)
8417 {
8418 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8419 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8420 }
8421 else
8422 {
8423 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8424 }
8425
8426 idx = inventory_slots.Find(slot);
8427 if (idx < 0)
8428 return "";
8429
8430 return attach_types.Get(idx);
8431 }
8432
8434 {
8435 int idx = -1;
8436 string slot;
8437
8440
8441 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8442 if (inventory_slots.Count() < 1)
8443 {
8444 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8445 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8446 }
8447 else
8448 {
8449 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8450 if (detach_types.Count() < 1)
8451 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8452 }
8453
8454 for (int i = 0; i < inventory_slots.Count(); i++)
8455 {
8456 slot = inventory_slots.Get(i);
8457 }
8458
8459 if (slot != "")
8460 {
8461 if (detach_types.Count() == 1)
8462 idx = 0;
8463 else
8464 idx = inventory_slots.Find(slot);
8465 }
8466 if (idx < 0)
8467 return "";
8468
8469 return detach_types.Get(idx);
8470 }
8471
8473 {
8474
8476
8477
8478 float min_time = 1;
8479 float max_time = 3;
8480 float delay = Math.RandomFloat(min_time, max_time);
8481
8482 explode_timer.Run(delay, this, "DoAmmoExplosion");
8483 }
8484
8486 {
8487 Magazine magazine = Magazine.Cast(this);
8488 int pop_sounds_count = 6;
8489 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8490
8491
8492 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8493 string sound_name = pop_sounds[ sound_idx ];
8495
8496
8497 magazine.ServerAddAmmoCount(-1);
8498
8499
8500 float min_temp_to_explode = 100;
8501
8502 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8503 {
8505 }
8506 }
8507
8508
8509 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8510 {
8511 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8512
8513 const int CHANCE_DAMAGE_CARGO = 4;
8514 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8515 const int CHANCE_DAMAGE_NOTHING = 2;
8516
8518 {
8519 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8520 int chances;
8521 int rnd;
8522
8523 if (GetInventory().GetCargo())
8524 {
8525 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8526 rnd = Math.RandomInt(0,chances);
8527
8528 if (rnd < CHANCE_DAMAGE_CARGO)
8529 {
8531 }
8532 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8533 {
8535 }
8536 }
8537 else
8538 {
8539 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8540 rnd = Math.RandomInt(0,chances);
8541
8542 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8543 {
8545 }
8546 }
8547 }
8548 }
8549
8551 {
8552 if (GetInventory().GetCargo())
8553 {
8554 int item_count = GetInventory().GetCargo().GetItemCount();
8555 if (item_count > 0)
8556 {
8557 int random_pick = Math.RandomInt(0, item_count);
8559 if (!item.IsExplosive())
8560 {
8561 item.AddHealth("","",damage);
8562 return true;
8563 }
8564 }
8565 }
8566 return false;
8567 }
8568
8570 {
8571 int attachment_count = GetInventory().AttachmentCount();
8572 if (attachment_count > 0)
8573 {
8574 int random_pick = Math.RandomInt(0, attachment_count);
8575 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8576 if (!attachment.IsExplosive())
8577 {
8578 attachment.AddHealth("","",damage);
8579 return true;
8580 }
8581 }
8582 return false;
8583 }
8584
8586 {
8588 }
8589
8591 {
8593 return GetInventory().CanRemoveEntity();
8594
8595 return false;
8596 }
8597
8599 {
8601 return;
8602
8604 {
8605 if (ScriptInputUserData.CanStoreInputUserData())
8606 {
8607 ScriptInputUserData ctx = new ScriptInputUserData;
8612 ctx.
Write(destination_entity);
8616 }
8617 }
8618 else if (!
GetGame().IsMultiplayer())
8619 {
8621 }
8622 }
8623
8625 {
8627 return;
8628
8629 float split_quantity_new;
8633 InventoryLocation loc = new InventoryLocation;
8634
8635 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8636 {
8638 split_quantity_new = stack_max;
8639 else
8641
8642 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8643 if (new_item)
8644 {
8645 new_item.SetResultOfSplit(true);
8646 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8648 new_item.SetQuantity(split_quantity_new);
8649 }
8650 }
8651 else if (destination_entity && slot_id == -1)
8652 {
8653 if (quantity > stack_max)
8654 split_quantity_new = stack_max;
8655 else
8656 split_quantity_new = quantity;
8657
8659 {
8662 }
8663
8664 if (new_item)
8665 {
8666 new_item.SetResultOfSplit(true);
8667 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8669 new_item.SetQuantity(split_quantity_new);
8670 }
8671 }
8672 else
8673 {
8674 if (stack_max != 0)
8675 {
8677 {
8679 }
8680
8681 if (split_quantity_new == 0)
8682 {
8683 if (!
GetGame().IsMultiplayer())
8684 player.PhysicalPredictiveDropItem(this);
8685 else
8686 player.ServerDropEntity(this);
8687 return;
8688 }
8689
8691
8692 if (new_item)
8693 {
8694 new_item.SetResultOfSplit(true);
8695 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8697 new_item.SetQuantity(stack_max);
8698 new_item.PlaceOnSurface();
8699 }
8700 }
8701 }
8702 }
8703
8705 {
8707 return;
8708
8709 float split_quantity_new;
8713 InventoryLocation loc = new InventoryLocation;
8714
8715 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8716 {
8718 split_quantity_new = stack_max;
8719 else
8721
8722 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8723 if (new_item)
8724 {
8725 new_item.SetResultOfSplit(true);
8726 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8728 new_item.SetQuantity(split_quantity_new);
8729 }
8730 }
8731 else if (destination_entity && slot_id == -1)
8732 {
8733 if (quantity > stack_max)
8734 split_quantity_new = stack_max;
8735 else
8736 split_quantity_new = quantity;
8737
8739 {
8742 }
8743
8744 if (new_item)
8745 {
8746 new_item.SetResultOfSplit(true);
8747 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8749 new_item.SetQuantity(split_quantity_new);
8750 }
8751 }
8752 else
8753 {
8754 if (stack_max != 0)
8755 {
8757 {
8759 }
8760
8762
8763 if (new_item)
8764 {
8765 new_item.SetResultOfSplit(true);
8766 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8768 new_item.SetQuantity(stack_max);
8769 new_item.PlaceOnSurface();
8770 }
8771 }
8772 }
8773 }
8774
8776 {
8778 return;
8779
8781 {
8782 if (ScriptInputUserData.CanStoreInputUserData())
8783 {
8784 ScriptInputUserData ctx = new ScriptInputUserData;
8789 dst.WriteToContext(ctx);
8791 }
8792 }
8793 else if (!
GetGame().IsMultiplayer())
8794 {
8796 }
8797 }
8798
8800 {
8802 return;
8803
8805 {
8806 if (ScriptInputUserData.CanStoreInputUserData())
8807 {
8808 ScriptInputUserData ctx = new ScriptInputUserData;
8813 ctx.
Write(destination_entity);
8819 }
8820 }
8821 else if (!
GetGame().IsMultiplayer())
8822 {
8824 }
8825 }
8826
8828 {
8830 }
8831
8833 {
8835 return this;
8836
8838 float split_quantity_new;
8840 if (dst.IsValid())
8841 {
8842 int slot_id = dst.GetSlot();
8844
8845 if (quantity > stack_max)
8846 split_quantity_new = stack_max;
8847 else
8848 split_quantity_new = quantity;
8849
8851
8852 if (new_item)
8853 {
8854 new_item.SetResultOfSplit(true);
8855 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8858 }
8859
8860 return new_item;
8861 }
8862
8863 return null;
8864 }
8865
8867 {
8869 return;
8870
8872 float split_quantity_new;
8874 if (destination_entity)
8875 {
8877 if (quantity > stackable)
8878 split_quantity_new = stackable;
8879 else
8880 split_quantity_new = quantity;
8881
8882 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8883 if (new_item)
8884 {
8885 new_item.SetResultOfSplit(true);
8886 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8888 new_item.SetQuantity(split_quantity_new);
8889 }
8890 }
8891 }
8892
8894 {
8896 return;
8897
8899 {
8900 if (ScriptInputUserData.CanStoreInputUserData())
8901 {
8902 ScriptInputUserData ctx = new ScriptInputUserData;
8907 ItemBase destination_entity =
this;
8908 ctx.
Write(destination_entity);
8912 }
8913 }
8914 else if (!
GetGame().IsMultiplayer())
8915 {
8917 }
8918 }
8919
8921 {
8923 return;
8924
8926 float split_quantity_new;
8928 if (player)
8929 {
8931 if (quantity > stackable)
8932 split_quantity_new = stackable;
8933 else
8934 split_quantity_new = quantity;
8935
8936 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8937 new_item =
ItemBase.Cast(in_hands);
8938 if (new_item)
8939 {
8940 new_item.SetResultOfSplit(true);
8941 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8943 new_item.SetQuantity(split_quantity_new);
8944 }
8945 }
8946 }
8947
8949 {
8951 return;
8952
8954 float split_quantity_new = Math.Floor(quantity * 0.5);
8955
8957
8958 if (new_item)
8959 {
8960 if (new_item.GetQuantityMax() < split_quantity_new)
8961 {
8962 split_quantity_new = new_item.GetQuantityMax();
8963 }
8964
8965 new_item.SetResultOfSplit(true);
8966 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8967
8969 {
8972 }
8973 else
8974 {
8977 }
8978 }
8979 }
8980
8982 {
8984 return;
8985
8987 float split_quantity_new = Math.Floor(quantity / 2);
8988
8989 InventoryLocation invloc = new InventoryLocation;
8991
8993 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
8994
8995 if (new_item)
8996 {
8997 if (new_item.GetQuantityMax() < split_quantity_new)
8998 {
8999 split_quantity_new = new_item.GetQuantityMax();
9000 }
9002 {
9005 }
9006 else
9007 {
9010 }
9011 }
9012 }
9013
9016 {
9017 SetWeightDirty();
9019
9020 if (parent)
9021 parent.OnAttachmentQuantityChangedEx(this, delta);
9022
9024 {
9026 {
9028 }
9030 {
9031 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9033 }
9034 }
9035
9036 }
9037
9040 {
9041
9042 }
9043
9046 {
9048 }
9049
9051 {
9052 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9053
9055 {
9056 if (newLevel == GameConstants.STATE_RUINED)
9057 {
9059 EntityAI parent = GetHierarchyParent();
9060 if (parent && parent.IsFireplace())
9061 {
9062 CargoBase cargo = GetInventory().GetCargo();
9063 if (cargo)
9064 {
9066 {
9068 }
9069 }
9070 }
9071 }
9072
9074 {
9075
9077 return;
9078 }
9079
9080 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9081 {
9083 }
9084 }
9085 }
9086
9087
9089 {
9090 super.OnRightClick();
9091
9093 {
9095 {
9096 if (ScriptInputUserData.CanStoreInputUserData())
9097 {
9098 vector m4[4];
9100
9101 EntityAI root = GetHierarchyRoot();
9102
9103 InventoryLocation dst = new InventoryLocation;
9105 {
9106 if (root)
9107 {
9108 root.GetTransform(m4);
9110 }
9111 else
9112 GetInventory().GetCurrentInventoryLocation(dst);
9113 }
9114 else
9115 {
9117
9118
9119 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9120 {
9121 if (root)
9122 {
9123 root.GetTransform(m4);
9125 }
9126 else
9127 GetInventory().GetCurrentInventoryLocation(dst);
9128 }
9129 else
9130 {
9131 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9132 }
9133 }
9134
9135 ScriptInputUserData ctx = new ScriptInputUserData;
9143 }
9144 }
9145 else if (!
GetGame().IsMultiplayer())
9146 {
9148 }
9149 }
9150 }
9151
9152 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9153 {
9154
9155 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9156 return false;
9157
9158 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9159 return false;
9160
9161
9163 return false;
9164
9165
9166 Magazine mag = Magazine.Cast(this);
9167 if (mag)
9168 {
9169 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9170 return false;
9171
9172 if (stack_max_limit)
9173 {
9174 Magazine other_mag = Magazine.Cast(other_item);
9175 if (other_item)
9176 {
9177 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9178 return false;
9179 }
9180
9181 }
9182 }
9183 else
9184 {
9185
9187 return false;
9188
9190 return false;
9191 }
9192
9193 PlayerBase player = null;
9194 if (CastTo(player, GetHierarchyRootPlayer()))
9195 {
9196 if (player.GetInventory().HasAttachment(this))
9197 return false;
9198
9199 if (player.IsItemsToDelete())
9200 return false;
9201 }
9202
9203 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9204 return false;
9205
9206 int slotID;
9208 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9209 return false;
9210
9211 return true;
9212 }
9213
9215 {
9217 }
9218
9220 {
9221 return m_IsResultOfSplit;
9222 }
9223
9225 {
9226 m_IsResultOfSplit = value;
9227 }
9228
9230 {
9232 }
9233
9235 {
9236 float other_item_quantity = other_item.GetQuantity();
9237 float this_free_space;
9238
9240
9242
9243 if (other_item_quantity > this_free_space)
9244 {
9245 return this_free_space;
9246 }
9247 else
9248 {
9249 return other_item_quantity;
9250 }
9251 }
9252
9254 {
9256 }
9257
9259 {
9261 return;
9262
9263 if (!IsMagazine() && other_item)
9264 {
9266 if (quantity_used != 0)
9267 {
9268 float hp1 = GetHealth01("","");
9269 float hp2 = other_item.GetHealth01("","");
9270 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9271 hpResult = hpResult / (
GetQuantity() + quantity_used);
9272
9273 hpResult *= GetMaxHealth();
9274 Math.Round(hpResult);
9275 SetHealth("", "Health", hpResult);
9276
9278 other_item.AddQuantity(-quantity_used);
9279 }
9280 }
9282 }
9283
9285 {
9286 #ifdef SERVER
9287 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9288 GetHierarchyParent().IncreaseLifetimeUp();
9289 #endif
9290 };
9291
9293 {
9294 PlayerBase p = PlayerBase.Cast(player);
9295
9296 array<int> recipesIds = p.m_Recipes;
9297 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9298 if (moduleRecipesManager)
9299 {
9300 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9301 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9302 }
9303
9304 for (int i = 0;i < recipesIds.Count(); i++)
9305 {
9306 int key = recipesIds.Get(i);
9307 string recipeName = moduleRecipesManager.GetRecipeName(key);
9309 }
9310 }
9311
9312
9313 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9314 {
9315 super.GetDebugActions(outputList);
9316
9317
9322
9323
9327
9331
9332
9335
9336
9338 {
9341 }
9342
9344
9347
9351 }
9352
9353
9354
9355
9357 {
9358 super.OnAction(action_id, player, ctx);
9359 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9360 {
9361 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9362 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9363 PlayerBase p = PlayerBase.Cast(player);
9364 if (
EActions.RECIPES_RANGE_START < 1000)
9365 {
9366 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9367 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9368 }
9369 }
9370 #ifndef SERVER
9371 else if (action_id ==
EActions.WATCH_PLAYER)
9372 {
9373 PluginDeveloper.SetDeveloperItemClientEx(player);
9374 }
9375 #endif
9377 {
9378 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9379 {
9380 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9381 OnDebugButtonPressServer(id + 1);
9382 }
9383
9384 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9385 {
9386 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9388 }
9389
9390 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9391 {
9392 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9394 }
9395
9396 else if (action_id ==
EActions.ADD_QUANTITY)
9397 {
9398 if (IsMagazine())
9399 {
9400 Magazine mag = Magazine.Cast(this);
9401 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9402 }
9403 else
9404 {
9406 }
9407
9408 if (m_EM)
9409 {
9410 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9411 }
9412
9413 }
9414
9415 else if (action_id ==
EActions.REMOVE_QUANTITY)
9416 {
9417 if (IsMagazine())
9418 {
9419 Magazine mag2 = Magazine.Cast(this);
9420 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9421 }
9422 else
9423 {
9425 }
9426 if (m_EM)
9427 {
9428 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9429 }
9430
9431 }
9432
9433 else if (action_id ==
EActions.SET_QUANTITY_0)
9434 {
9436
9437 if (m_EM)
9438 {
9439 m_EM.SetEnergy(0);
9440 }
9441 }
9442
9443 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9444 {
9446
9447 if (m_EM)
9448 {
9449 m_EM.SetEnergy(m_EM.GetEnergyMax());
9450 }
9451 }
9452
9453 else if (action_id ==
EActions.ADD_HEALTH)
9454 {
9455 AddHealth("","",GetMaxHealth("","Health")/5);
9456 }
9457 else if (action_id ==
EActions.REMOVE_HEALTH)
9458 {
9459 AddHealth("","",-GetMaxHealth("","Health")/5);
9460 }
9461 else if (action_id ==
EActions.DESTROY_HEALTH)
9462 {
9463 SetHealth01("","",0);
9464 }
9465 else if (action_id ==
EActions.WATCH_ITEM)
9466 {
9468 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9469 #ifdef DEVELOPER
9470 SetDebugDeveloper_item(this);
9471 #endif
9472 }
9473
9474 else if (action_id ==
EActions.ADD_TEMPERATURE)
9475 {
9476 AddTemperature(20);
9477
9478 }
9479
9480 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9481 {
9482 AddTemperature(-20);
9483
9484 }
9485
9486 else if (action_id ==
EActions.FLIP_FROZEN)
9487 {
9488 SetFrozen(!GetIsFrozen());
9489
9490 }
9491
9492 else if (action_id ==
EActions.ADD_WETNESS)
9493 {
9495
9496 }
9497
9498 else if (action_id ==
EActions.REMOVE_WETNESS)
9499 {
9501
9502 }
9503
9504 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9505 {
9508
9509
9510 }
9511
9512 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9513 {
9516 }
9517
9518 else if (action_id ==
EActions.MAKE_SPECIAL)
9519 {
9520 auto debugParams = DebugSpawnParams.WithPlayer(player);
9521 OnDebugSpawnEx(debugParams);
9522 }
9523
9524 else if (action_id ==
EActions.DELETE)
9525 {
9526 Delete();
9527 }
9528
9529 }
9530
9531
9532 return false;
9533 }
9534
9535
9536
9537
9541
9544
9545
9546
9548 {
9549 return false;
9550 }
9551
9552
9554 {
9555 return true;
9556 }
9557
9558
9560 {
9561 return true;
9562 }
9563
9564
9565
9567 {
9568 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9570 }
9571
9574 {
9575 return null;
9576 }
9577
9579 {
9580 return false;
9581 }
9582
9584 {
9585 return false;
9586 }
9587
9591
9592
9594 {
9595 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9596 return module_repairing.CanRepair(this, item_repair_kit);
9597 }
9598
9599
9600 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9601 {
9602 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9603 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9604 }
9605
9606
9608 {
9609
9610
9611
9612
9613
9614
9615
9616
9617 return 1;
9618 }
9619
9620
9621
9623 {
9625 }
9626
9627
9628
9630 {
9632 }
9633
9634
9643 {
9644 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9645
9646 if (player)
9647 {
9648 player.MessageStatus(text);
9649 }
9650 }
9651
9652
9661 {
9662 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9663
9664 if (player)
9665 {
9666 player.MessageAction(text);
9667 }
9668 }
9669
9670
9679 {
9680 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9681
9682 if (player)
9683 {
9684 player.MessageFriendly(text);
9685 }
9686 }
9687
9688
9697 {
9698 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9699
9700 if (player)
9701 {
9702 player.MessageImportant(text);
9703 }
9704 }
9705
9707 {
9708 return true;
9709 }
9710
9711
9712 override bool KindOf(
string tag)
9713 {
9714 bool found = false;
9715 string item_name = this.
GetType();
9718
9719 int array_size = item_tag_array.Count();
9720 for (int i = 0; i < array_size; i++)
9721 {
9722 if (item_tag_array.Get(i) == tag)
9723 {
9724 found = true;
9725 break;
9726 }
9727 }
9728 return found;
9729 }
9730
9731
9733 {
9734
9735 super.OnRPC(sender, rpc_type,ctx);
9736
9737
9738 switch (rpc_type)
9739 {
9740 #ifndef SERVER
9741 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9742 Param2<bool, string> p = new Param2<bool, string>(false, "");
9743
9745 return;
9746
9747 bool play = p.param1;
9748 string soundSet = p.param2;
9749
9750 if (play)
9751 {
9753 {
9755 {
9757 }
9758 }
9759 else
9760 {
9762 }
9763 }
9764 else
9765 {
9767 }
9768
9769 break;
9770 #endif
9771
9772 }
9773
9775 {
9777 }
9778 }
9779
9780
9781
9782
9784 {
9785 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9786 return plugin.GetID(
name);
9787 }
9788
9790 {
9791 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9792 return plugin.GetName(id);
9793 }
9794
9797 {
9798
9799
9800 int varFlags;
9801 if (!ctx.
Read(varFlags))
9802 return;
9803
9804 if (varFlags & ItemVariableFlags.FLOAT)
9805 {
9807 }
9808 }
9809
9811 {
9812
9813 super.SerializeNumericalVars(floats_out);
9814
9815
9816
9818 {
9820 }
9821
9823 {
9825 }
9826
9828 {
9830 }
9831
9833 {
9838 }
9839
9841 {
9843 }
9844 }
9845
9847 {
9848
9849 super.DeSerializeNumericalVars(floats);
9850
9851
9852 int index = 0;
9853 int mask = Math.Round(floats.Get(index));
9854
9855 index++;
9856
9858 {
9860 {
9862 }
9863 else
9864 {
9865 float quantity = floats.Get(index);
9867 }
9868 index++;
9869 }
9870
9872 {
9873 float wet = floats.Get(index);
9875 index++;
9876 }
9877
9879 {
9880 int liquidtype = Math.Round(floats.Get(index));
9882 index++;
9883 }
9884
9886 {
9888 index++;
9890 index++;
9892 index++;
9894 index++;
9895 }
9896
9898 {
9899 int cleanness = Math.Round(floats.Get(index));
9901 index++;
9902 }
9903 }
9904
9906 {
9907 super.WriteVarsToCTX(ctx);
9908
9909
9911 {
9913 }
9914
9916 {
9918 }
9919
9921 {
9923 }
9924
9926 {
9927 int r,g,b,a;
9933 }
9934
9936 {
9938 }
9939 }
9940
9942 {
9943 if (!super.ReadVarsFromCTX(ctx,version))
9944 return false;
9945
9946 int intValue;
9947 float value;
9948
9949 if (version < 140)
9950 {
9951 if (!ctx.
Read(intValue))
9952 return false;
9953
9954 m_VariablesMask = intValue;
9955 }
9956
9958 {
9959 if (!ctx.
Read(value))
9960 return false;
9961
9963 {
9965 }
9966 else
9967 {
9969 }
9970 }
9971
9972 if (version < 140)
9973 {
9975 {
9976 if (!ctx.
Read(value))
9977 return false;
9978 SetTemperatureDirect(value);
9979 }
9980 }
9981
9983 {
9984 if (!ctx.
Read(value))
9985 return false;
9987 }
9988
9990 {
9991 if (!ctx.
Read(intValue))
9992 return false;
9994 }
9995
9997 {
9998 int r,g,b,a;
10000 return false;
10002 return false;
10004 return false;
10006 return false;
10007
10009 }
10010
10012 {
10013 if (!ctx.
Read(intValue))
10014 return false;
10016 }
10017
10018 if (version >= 138 && version < 140)
10019 {
10021 {
10022 if (!ctx.
Read(intValue))
10023 return false;
10024 SetFrozen(intValue);
10025 }
10026 }
10027
10028 return true;
10029 }
10030
10031
10033 {
10036 {
10038 }
10039
10040 if (!super.OnStoreLoad(ctx, version))
10041 {
10043 return false;
10044 }
10045
10046 if (version >= 114)
10047 {
10048 bool hasQuickBarIndexSaved;
10049
10050 if (!ctx.
Read(hasQuickBarIndexSaved))
10051 {
10053 return false;
10054 }
10055
10056 if (hasQuickBarIndexSaved)
10057 {
10058 int itmQBIndex;
10059
10060
10061 if (!ctx.
Read(itmQBIndex))
10062 {
10064 return false;
10065 }
10066
10067 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10068 if (itmQBIndex != -1 && parentPlayer)
10069 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10070 }
10071 }
10072 else
10073 {
10074
10075 PlayerBase player;
10076 int itemQBIndex;
10077 if (version ==
int.
MAX)
10078 {
10079 if (!ctx.
Read(itemQBIndex))
10080 {
10082 return false;
10083 }
10084 }
10085 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10086 {
10087
10088 if (!ctx.
Read(itemQBIndex))
10089 {
10091 return false;
10092 }
10093 if (itemQBIndex != -1 && player)
10094 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10095 }
10096 }
10097
10098 if (version < 140)
10099 {
10100
10101 if (!LoadVariables(ctx, version))
10102 {
10104 return false;
10105 }
10106 }
10107
10108
10110 {
10112 return false;
10113 }
10114 if (version >= 132)
10115 {
10117 if (raib)
10118 {
10120 {
10122 return false;
10123 }
10124 }
10125 }
10126
10128 return true;
10129 }
10130
10131
10132
10134 {
10135 super.OnStoreSave(ctx);
10136
10137 PlayerBase player;
10138 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10139 {
10141
10142 int itemQBIndex = -1;
10143 itemQBIndex = player.FindQuickBarEntityIndex(this);
10144 ctx.
Write(itemQBIndex);
10145 }
10146 else
10147 {
10149 }
10150
10152
10154 if (raib)
10155 {
10157 }
10158 }
10159
10160
10162 {
10163 super.AfterStoreLoad();
10164
10166 {
10168 }
10169
10171 {
10174 }
10175 }
10176
10178 {
10179 super.EEOnAfterLoad();
10180
10182 {
10184 }
10185
10188 }
10189
10191 {
10192 return false;
10193 }
10194
10195
10196
10198 {
10200 {
10201 #ifdef PLATFORM_CONSOLE
10202
10204 {
10206 if (menu)
10207 {
10209 }
10210 }
10211 #endif
10212 }
10213
10215 {
10218 }
10219
10221 {
10222 SetWeightDirty();
10224 }
10226 {
10229 }
10230
10232 {
10235 }
10237 {
10240 }
10241
10242 super.OnVariablesSynchronized();
10243 }
10244
10245
10246
10248 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10249 {
10250 if (!IsServerCheck(allow_client))
10251 return false;
10252
10254 return false;
10255
10258
10259 if (value <= (min + 0.001))
10260 value = min;
10261
10262 if (value == min)
10263 {
10264 if (destroy_config)
10265 {
10266 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10267 if (dstr)
10268 {
10270 this.Delete();
10271 return true;
10272 }
10273 }
10274 else if (destroy_forced)
10275 {
10277 this.Delete();
10278 return true;
10279 }
10280
10282 }
10283
10286
10288 {
10290
10291 if (delta)
10293 }
10294
10296
10297 return false;
10298 }
10299
10300
10302 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10303 {
10305 }
10306
10308 {
10311 }
10312
10314 {
10317 }
10318
10321 {
10322 float value_clamped = Math.Clamp(value, 0, 1);
10324 SetQuantity(result, destroy_config, destroy_forced);
10325 }
10326
10327
10330 {
10332 }
10333
10335 {
10337 }
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10349 {
10350 int slot = -1;
10351 if (GetInventory())
10352 {
10353 InventoryLocation il = new InventoryLocation;
10354 GetInventory().GetCurrentInventoryLocation(il);
10356 }
10357
10359 }
10360
10362 {
10363 float quantity_max = 0;
10364
10366 {
10367 if (attSlotID != -1)
10368 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10369
10370 if (quantity_max <= 0)
10372 }
10373
10374 if (quantity_max <= 0)
10376
10377 return quantity_max;
10378 }
10379
10381 {
10383 }
10384
10386 {
10388 }
10389
10390
10392 {
10394 }
10395
10397 {
10399 }
10400
10402 {
10404 }
10405
10406
10408 {
10409
10410 float weightEx = GetWeightEx();
10411 float special = GetInventoryAndCargoWeight();
10412 return weightEx - special;
10413 }
10414
10415
10417 {
10419 }
10420
10422 {
10424 {
10425 #ifdef DEVELOPER
10426 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10427 {
10428 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10430 }
10431 #endif
10432
10433 return GetQuantity() * GetConfigWeightModified();
10434 }
10435 else if (HasEnergyManager())
10436 {
10437 #ifdef DEVELOPER
10438 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10439 {
10440 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10441 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10442 }
10443 #endif
10444 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10445 }
10446 else
10447 {
10448 #ifdef DEVELOPER
10449 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10450 {
10451 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10452 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10453 }
10454 #endif
10455 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10456 }
10457 }
10458
10461 {
10462 int item_count = 0;
10464
10465 if (GetInventory().GetCargo() != NULL)
10466 {
10467 item_count = GetInventory().GetCargo().GetItemCount();
10468 }
10469
10470 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10471 {
10472 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10473 if (item)
10474 item_count += item.GetNumberOfItems();
10475 }
10476 return item_count;
10477 }
10478
10481 {
10482 float weight = 0;
10483 float wetness = 1;
10484 if (include_wetness)
10487 {
10488 weight = wetness * m_ConfigWeight;
10489 }
10491 {
10492 weight = 1;
10493 }
10494 return weight;
10495 }
10496
10497
10498
10500 {
10501 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10502 {
10503 GameInventory inv = GetInventory();
10504 array<EntityAI> items = new array<EntityAI>;
10506 for (int i = 0; i < items.Count(); i++)
10507 {
10509 if (item)
10510 {
10512 }
10513 }
10514 }
10515 }
10516
10517
10518
10519
10521 {
10522 float energy = 0;
10523 if (HasEnergyManager())
10524 {
10525 energy = GetCompEM().GetEnergy();
10526 }
10527 return energy;
10528 }
10529
10530
10532 {
10533 super.OnEnergyConsumed();
10534
10536 }
10537
10539 {
10540 super.OnEnergyAdded();
10541
10543 }
10544
10545
10547 {
10548 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10549 {
10551 {
10552 float energy_0to1 = GetCompEM().GetEnergy0To1();
10554 }
10555 }
10556 }
10557
10558
10560 {
10561 return ConfigGetFloat("heatIsolation");
10562 }
10563
10565 {
10567 }
10568
10570 {
10571 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10572 if (
GetGame().ConfigIsExisting(paramPath))
10574
10575 return 0.0;
10576 }
10577
10579 {
10580 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10581 if (
GetGame().ConfigIsExisting(paramPath))
10583
10584 return 0.0;
10585 }
10586
10587 override void SetWet(
float value,
bool allow_client =
false)
10588 {
10589 if (!IsServerCheck(allow_client))
10590 return;
10591
10594
10596
10597 m_VarWet = Math.Clamp(value, min, max);
10598
10600 {
10603 }
10604 }
10605
10606 override void AddWet(
float value)
10607 {
10609 }
10610
10612 {
10614 }
10615
10617 {
10619 }
10620
10622 {
10624 }
10625
10627 {
10629 }
10630
10632 {
10634 }
10635
10636 override void OnWetChanged(
float newVal,
float oldVal)
10637 {
10640 if (newLevel != oldLevel)
10641 {
10643 }
10644 }
10645
10647 {
10648 SetWeightDirty();
10649 }
10650
10652 {
10653 return GetWetLevelInternal(
m_VarWet);
10654 }
10655
10656
10657
10659 {
10661 }
10662
10664 {
10666 }
10667
10669 {
10671 }
10672
10674 {
10676 }
10677
10678
10679
10681 {
10682 if (ConfigIsExisting("itemModelLength"))
10683 {
10684 return ConfigGetFloat("itemModelLength");
10685 }
10686 return 0;
10687 }
10688
10690 {
10691 if (ConfigIsExisting("itemAttachOffset"))
10692 {
10693 return ConfigGetFloat("itemAttachOffset");
10694 }
10695 return 0;
10696 }
10697
10698 override void SetCleanness(
int value,
bool allow_client =
false)
10699 {
10700 if (!IsServerCheck(allow_client))
10701 return;
10702
10704
10706
10709 }
10710
10712 {
10714 }
10715
10717 {
10718 return true;
10719 }
10720
10721
10722
10723
10725 {
10727 }
10728
10730 {
10732 }
10733
10734
10735
10736
10737 override void SetColor(
int r,
int g,
int b,
int a)
10738 {
10744 }
10746 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10747 {
10752 }
10753
10755 {
10757 }
10758
10761 {
10762 int r,g,b,a;
10764 r = r/255;
10765 g = g/255;
10766 b = b/255;
10767 a = a/255;
10768 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10769 }
10770
10771
10772
10773 override void SetLiquidType(
int value,
bool allow_client =
false)
10774 {
10775 if (!IsServerCheck(allow_client))
10776 return;
10777
10782 }
10783
10785 {
10786 return ConfigGetInt("varLiquidTypeInit");
10787 }
10788
10790 {
10792 }
10793
10795 {
10797 SetFrozen(false);
10798 }
10799
10802 {
10803 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10804 }
10805
10806
10809 {
10810 PlayerBase nplayer;
10811 if (PlayerBase.CastTo(nplayer, player))
10812 {
10814
10815 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10816 }
10817 }
10818
10819
10822 {
10823 PlayerBase nplayer;
10824 if (PlayerBase.CastTo(nplayer,player))
10825 {
10826
10827 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10828
10829 }
10830
10831
10832 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10833
10834
10835 if (HasEnergyManager())
10836 {
10837 GetCompEM().UpdatePlugState();
10838 }
10839 }
10840
10841
10843 {
10844 super.OnPlacementStarted(player);
10845
10847 }
10848
10849 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10850 {
10852 {
10853 m_AdminLog.OnPlacementComplete(player,
this);
10854 }
10855
10856 super.OnPlacementComplete(player, position, orientation);
10857 }
10858
10859
10860
10861
10862
10864 {
10866 {
10867 return true;
10868 }
10869 else
10870 {
10871 return false;
10872 }
10873 }
10874
10875
10877 {
10879 {
10881 }
10882 }
10883
10884
10886 {
10888 }
10889
10891 {
10893 }
10894
10895 override void InsertAgent(
int agent,
float count = 1)
10896 {
10897 if (count < 1)
10898 return;
10899
10901 }
10902
10905 {
10907 }
10908
10909
10911 {
10913 }
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10957 {
10959 return false;
10960 return true;
10961 }
10962
10964 {
10965
10967 }
10968
10969
10972 {
10973 super.CheckForRoofLimited(timeTresholdMS);
10974
10976 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
10977 {
10978 m_PreviousRoofTestTime = time;
10979 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
10980 }
10981 }
10982
10983
10985 {
10987 {
10988 return 0;
10989 }
10990
10991 if (GetInventory().GetAttachmentSlotsCount() != 0)
10992 {
10993 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
10994 if (filter)
10995 return filter.GetProtectionLevel(type, false, system);
10996 else
10997 return 0;
10998 }
10999
11000 string subclassPath, entryName;
11001
11002 switch (type)
11003 {
11005 entryName = "biological";
11006 break;
11008 entryName = "chemical";
11009 break;
11010 default:
11011 entryName = "biological";
11012 break;
11013 }
11014
11015 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11016
11018 }
11019
11020
11021
11024 {
11025 if (!IsMagazine())
11027
11029 }
11030
11031
11032
11033
11034
11039 {
11040 return true;
11041 }
11042
11044 {
11046 }
11047
11048
11049
11050
11051
11053 {
11054 if (parent)
11055 {
11056 if (parent.IsInherited(DayZInfected))
11057 return true;
11058
11059 if (!parent.IsRuined())
11060 return true;
11061 }
11062
11063 return true;
11064 }
11065
11067 {
11068 if (!super.CanPutAsAttachment(parent))
11069 {
11070 return false;
11071 }
11072
11073 if (!IsRuined() && !parent.IsRuined())
11074 {
11075 return true;
11076 }
11077
11078 return false;
11079 }
11080
11082 {
11083
11084
11085
11086
11087 return super.CanReceiveItemIntoCargo(item);
11088 }
11089
11091 {
11092
11093
11094
11095
11096 GameInventory attachmentInv = attachment.GetInventory();
11098 {
11099 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11100 return false;
11101 }
11102
11103 InventoryLocation loc = new InventoryLocation();
11104 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11105 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11106 return false;
11107
11108 return super.CanReceiveAttachment(attachment, slotId);
11109 }
11110
11112 {
11113 if (!super.CanReleaseAttachment(attachment))
11114 return false;
11115
11116 return GetInventory().AreChildrenAccessible();
11117 }
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11140 {
11141 int id = muzzle_owner.GetMuzzleID();
11142 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11143
11144 if (WPOF_array)
11145 {
11146 for (int i = 0; i < WPOF_array.Count(); i++)
11147 {
11148 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11149
11150 if (WPOF)
11151 {
11152 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11153 }
11154 }
11155 }
11156 }
11157
11158
11160 {
11161 int id = muzzle_owner.GetMuzzleID();
11163
11164 if (WPOBE_array)
11165 {
11166 for (int i = 0; i < WPOBE_array.Count(); i++)
11167 {
11168 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11169
11170 if (WPOBE)
11171 {
11172 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11173 }
11174 }
11175 }
11176 }
11177
11178
11180 {
11181 int id = muzzle_owner.GetMuzzleID();
11182 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11183
11184 if (WPOOH_array)
11185 {
11186 for (int i = 0; i < WPOOH_array.Count(); i++)
11187 {
11188 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11189
11190 if (WPOOH)
11191 {
11192 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11193 }
11194 }
11195 }
11196 }
11197
11198
11200 {
11201 int id = muzzle_owner.GetMuzzleID();
11202 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11203
11204 if (WPOOH_array)
11205 {
11206 for (int i = 0; i < WPOOH_array.Count(); i++)
11207 {
11208 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11209
11210 if (WPOOH)
11211 {
11212 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11213 }
11214 }
11215 }
11216 }
11217
11218
11220 {
11221 int id = muzzle_owner.GetMuzzleID();
11222 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11223
11224 if (WPOOH_array)
11225 {
11226 for (int i = 0; i < WPOOH_array.Count(); i++)
11227 {
11228 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11229
11230 if (WPOOH)
11231 {
11232 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11233 }
11234 }
11235 }
11236 }
11237
11238
11239
11241 {
11243 {
11244 return true;
11245 }
11246
11247 return false;
11248 }
11249
11251 {
11253 {
11254 return true;
11255 }
11256
11257 return false;
11258 }
11259
11261 {
11263 {
11264 return true;
11265 }
11266
11267 return false;
11268 }
11269
11271 {
11272 return false;
11273 }
11274
11277 {
11278 return UATimeSpent.DEFAULT_DEPLOY;
11279 }
11280
11281
11282
11283
11285 {
11287 SetSynchDirty();
11288 }
11289
11291 {
11293 }
11294
11295
11297 {
11298 return false;
11299 }
11300
11303 {
11304 string att_type = "None";
11305
11306 if (ConfigIsExisting("soundAttType"))
11307 {
11308 att_type = ConfigGetString("soundAttType");
11309 }
11310
11312 }
11313
11315 {
11317 }
11318
11319
11320
11321
11322
11326
11328 {
11331
11333 }
11334
11335
11337 {
11339 return;
11340
11342
11345
11348
11349 SoundParameters params = new SoundParameters();
11353 }
11354
11355
11357 {
11359 return;
11360
11362 SetSynchDirty();
11363
11366 }
11367
11368
11370 {
11372 return;
11373
11375 SetSynchDirty();
11376
11379 }
11380
11382 {
11384 }
11385
11387 {
11389 }
11390
11393 {
11394 if (!
GetGame().IsDedicatedServer())
11395 {
11396 if (ConfigIsExisting("attachSoundSet"))
11397 {
11398 string cfg_path = "";
11399 string soundset = "";
11400 string type_name =
GetType();
11401
11404 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11405 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11406
11407 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11408 {
11409 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11410 {
11411 if (cfg_slot_array[i] == slot_type)
11412 {
11413 soundset = cfg_soundset_array[i];
11414 break;
11415 }
11416 }
11417 }
11418
11419 if (soundset != "")
11420 {
11421 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11423 }
11424 }
11425 }
11426 }
11427
11429 {
11430
11431 }
11432
11433 void OnApply(PlayerBase player);
11434
11436 {
11437 return 1.0;
11438 };
11439
11441 {
11443 }
11444
11446 {
11448 }
11449
11451
11453 {
11454 SetDynamicPhysicsLifeTime(0.01);
11456 }
11457
11459 {
11460 array<string> zone_names = new array<string>;
11461 GetDamageZones(zone_names);
11462 for (int i = 0; i < zone_names.Count(); i++)
11463 {
11464 SetHealthMax(zone_names.Get(i),"Health");
11465 }
11466 SetHealthMax("","Health");
11467 }
11468
11471 {
11472 float global_health = GetHealth01("","Health");
11473 array<string> zones = new array<string>;
11474 GetDamageZones(zones);
11475
11476 for (int i = 0; i < zones.Count(); i++)
11477 {
11478 SetHealth01(zones.Get(i),"Health",global_health);
11479 }
11480 }
11481
11484 {
11485 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11486 }
11487
11489 {
11490 if (!hasRootAsPlayer)
11491 {
11492 if (refParentIB)
11493 {
11494
11495 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11496 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11497
11498 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11499 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11500
11503 }
11504 else
11505 {
11506
11509 }
11510 }
11511 }
11512
11514 {
11516 {
11517 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11518 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11519 {
11520 float heatPermCoef = 1.0;
11522 while (ent)
11523 {
11524 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11525 ent = ent.GetHierarchyParent();
11526 }
11527
11528 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11529 }
11530 }
11531 }
11532
11534 {
11535
11536 EntityAI parent = GetHierarchyParent();
11537 if (!parent)
11538 {
11539 hasParent = false;
11540 hasRootAsPlayer = false;
11541 }
11542 else
11543 {
11544 hasParent = true;
11545 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11546 refParentIB =
ItemBase.Cast(parent);
11547 }
11548 }
11549
11550 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11551 {
11552
11553 }
11554
11556 {
11557
11558 return false;
11559 }
11560
11562 {
11563
11564
11565 return false;
11566 }
11567
11569 {
11570
11571 return false;
11572 }
11573
11576 {
11577 return !GetIsFrozen() &&
IsOpen();
11578 }
11579
11581 {
11582 bool hasParent = false, hasRootAsPlayer = false;
11584
11585 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11586 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11587
11588 if (wwtu || foodDecay)
11589 {
11593
11594 if (processWetness || processTemperature || processDecay)
11595 {
11597
11598 if (processWetness)
11599 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11600
11601 if (processTemperature)
11603
11604 if (processDecay)
11605 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11606 }
11607 }
11608 }
11609
11612 {
11614 }
11615
11617 {
11620
11621 return super.GetTemperatureFreezeThreshold();
11622 }
11623
11625 {
11628
11629 return super.GetTemperatureThawThreshold();
11630 }
11631
11633 {
11636
11637 return super.GetItemOverheatThreshold();
11638 }
11639
11641 {
11643 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11644
11645 return super.GetTemperatureFreezeTime();
11646 }
11647
11649 {
11651 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11652
11653 return super.GetTemperatureThawTime();
11654 }
11655
11660
11662 {
11663 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11664 }
11665
11667 {
11668 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11669 }
11670
11673 {
11675 }
11676
11678 {
11680 }
11681
11683 {
11685 }
11686
11689 {
11690 return null;
11691 }
11692
11695 {
11696 return false;
11697 }
11698
11700 {
11702 {
11705 if (!trg)
11706 {
11708 explosive = this;
11709 }
11710
11711 explosive.PairRemote(trg);
11713
11714 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11715 trg.SetPersistentPairID(persistentID);
11716 explosive.SetPersistentPairID(persistentID);
11717
11718 return true;
11719 }
11720 return false;
11721 }
11722
11725 {
11726 float ret = 1.0;
11729 ret *= GetHealth01();
11730
11731 return ret;
11732 }
11733
11734 #ifdef DEVELOPER
11735 override void SetDebugItem()
11736 {
11737 super.SetDebugItem();
11738 _itemBase = this;
11739 }
11740
11742 {
11743 string text = super.GetDebugText();
11744
11746 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11747
11748 return text;
11749 }
11750 #endif
11751
11753 {
11754 return true;
11755 }
11756
11758
11760
11762 {
11765 }
11766
11767
11775
11791}
11792
11794{
11796 if (entity)
11797 {
11798 bool is_item = entity.IsInherited(
ItemBase);
11799 if (is_item && full_quantity)
11800 {
11803 }
11804 }
11805 else
11806 {
11808 return NULL;
11809 }
11810 return entity;
11811}
11812
11814{
11815 if (item)
11816 {
11817 if (health > 0)
11818 item.SetHealth("", "", health);
11819
11820 if (item.CanHaveTemperature())
11821 {
11823 if (item.CanFreeze())
11824 item.SetFrozen(false);
11825 }
11826
11827 if (item.HasEnergyManager())
11828 {
11829 if (quantity >= 0)
11830 {
11831 item.GetCompEM().SetEnergy0To1(quantity);
11832 }
11833 else
11834 {
11836 }
11837 }
11838 else if (item.IsMagazine())
11839 {
11840 Magazine mag = Magazine.Cast(item);
11841 if (quantity >= 0)
11842 {
11843 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11844 }
11845 else
11846 {
11848 }
11849
11850 }
11851 else
11852 {
11853 if (quantity >= 0)
11854 {
11855 item.SetQuantityNormalized(quantity, false);
11856 }
11857 else
11858 {
11860 }
11861
11862 }
11863 }
11864}
11865
11866#ifdef DEVELOPER
11868#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.