7075{
7077 {
7078 return true;
7079 }
7080};
7081
7082
7083
7085{
7089
7091
7094
7095
7096
7097
7098
7107
7113
7118
7123
7144 protected bool m_IsResultOfSplit
7145
7147
7152
7153
7154
7156
7160
7161
7162
7164
7167
7168
7169
7175
7176
7184
7187
7188
7190
7191
7193
7194
7199
7200
7205
7206
7208
7209
7211 {
7216
7217 if (!
GetGame().IsDedicatedServer())
7218 {
7220 {
7222
7224 {
7226 }
7227 }
7228
7231 }
7232
7233 m_OldLocation = null;
7234
7236 {
7238 }
7239
7240 if (ConfigIsExisting("headSelectionsToHide"))
7241 {
7244 }
7245
7247 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7248 {
7250 }
7251
7253
7254 m_IsResultOfSplit = false;
7255
7257 }
7258
7260 {
7261 super.InitItemVariables();
7262
7268 m_Count = ConfigGetInt(
"count");
7269
7272
7277
7280
7285
7297
7301
7302
7305 if (ConfigIsExisting("canBeSplit"))
7306 {
7309 }
7310
7312 if (ConfigIsExisting("itemBehaviour"))
7314
7315
7318 RegisterNetSyncVariableInt("m_VarLiquidType");
7319 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7320
7321 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7322 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7323 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7324
7325 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7326 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7327 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7328 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7329
7330 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7331 RegisterNetSyncVariableBool("m_IsTakeable");
7332 RegisterNetSyncVariableBool("m_IsHologram");
7333
7336 {
7339 }
7340
7342
7344 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7346
7347 }
7348
7350 {
7352 }
7353
7355 {
7358 {
7363 }
7364 }
7365
7366 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7367 {
7369 {
7372 }
7373
7375 }
7376
7378 {
7384 }
7385
7387
7389 {
7391
7392 if (!action)
7393 {
7394 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7395 return;
7396 }
7397
7399 if (!ai)
7400 {
7402 return;
7403 }
7404
7406 if (!action_array)
7407 {
7408 action_array = new array<ActionBase_Basic>;
7410 }
7411 if (LogManager.IsActionLogEnable())
7412 {
7413 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7414 }
7415
7416 if (action_array.Find(action) != -1)
7417 {
7418 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7419 }
7420 else
7421 {
7422 action_array.Insert(action);
7423 }
7424 }
7425
7427 {
7429 ActionBase action = player.GetActionManager().GetAction(actionName);
7432
7433 if (action_array)
7434 {
7435 action_array.RemoveItem(action);
7436 }
7437 }
7438
7439
7440
7442 {
7443 ActionOverrideData overrideData = new ActionOverrideData();
7447
7449 if (!actionMap)
7450 {
7453 }
7454
7455 actionMap.Insert(this.
Type(), overrideData);
7456
7457 }
7458
7460
7462
7463
7465 {
7468
7471
7472 string config_to_search = "CfgVehicles";
7473 string muzzle_owner_config;
7474
7476 {
7477 if (IsInherited(Weapon))
7478 config_to_search = "CfgWeapons";
7479
7480 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7481
7482 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7483
7485
7486 if (config_OnFire_subclass_count > 0)
7487 {
7488 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7489
7490 for (int i = 0; i < config_OnFire_subclass_count; i++)
7491 {
7492 string particle_class = "";
7494 string config_OnFire_entry = config_OnFire_class + particle_class;
7495 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7496 WPOF_array.Insert(WPOF);
7497 }
7498
7499
7501 }
7502 }
7503
7505 {
7506 config_to_search = "CfgWeapons";
7507 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7508
7509 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7510
7512
7513 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7514 {
7515 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7516
7517 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7518 {
7519 string particle_class2 = "";
7521 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7522 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7523 WPOBE_array.Insert(WPOBE);
7524 }
7525
7526
7528 }
7529 }
7530 }
7531
7532
7534 {
7537
7539 {
7540 string config_to_search = "CfgVehicles";
7541
7542 if (IsInherited(Weapon))
7543 config_to_search = "CfgWeapons";
7544
7545 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7546 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7547
7548 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7549 {
7550
7552
7554 {
7556 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7558 return;
7559 }
7560
7563
7564
7565
7567 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7568
7569 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7570 {
7571 string particle_class = "";
7573 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7575
7576 if (entry_type == CT_CLASS)
7577 {
7578 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7579 WPOOH_array.Insert(WPOF);
7580 }
7581 }
7582
7583
7585 }
7586 }
7587 }
7588
7590 {
7592 }
7593
7595 {
7597 {
7599
7602
7605
7606 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7607 }
7608 }
7609
7611 {
7613 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7614
7616 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7617
7619 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7620
7622 {
7624 }
7625 }
7626
7628 {
7630 }
7631
7633 {
7636 else
7638
7640 {
7643 }
7644 else
7645 {
7648
7651 }
7652
7654 }
7655
7657 {
7659 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7660 }
7661
7663 {
7665 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7667 }
7668
7670 {
7672 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7673 }
7674
7676 {
7679
7680 OverheatingParticle OP = new OverheatingParticle();
7685
7687 }
7688
7690 {
7693
7694 return -1;
7695 }
7696
7698 {
7700 {
7703
7704 for (int i = count; i > 0; --i)
7705 {
7706 int id = i - 1;
7709
7712
7713 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7714 {
7715 if (p)
7716 {
7719 }
7720 }
7721 }
7722 }
7723 }
7724
7726 {
7728 {
7730 {
7731 int id = i - 1;
7733
7734 if (OP)
7735 {
7737
7738 if (p)
7739 {
7741 }
7742
7743 delete OP;
7744 }
7745 }
7746
7749 }
7750 }
7751
7754 {
7755 return 0.0;
7756 }
7757
7758
7760 {
7761 return 250;
7762 }
7763
7765 {
7766 return 0;
7767 }
7768
7771 {
7773 return true;
7774
7775 return false;
7776 }
7777
7780 {
7783
7785 {
7787 }
7788 else
7789 {
7790
7792 }
7793
7795 }
7796
7803 {
7804 return -1;
7805 }
7806
7807
7808
7809
7811 {
7813 {
7815 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7816
7817 if (r_index >= 0)
7818 {
7819 InventoryLocation r_il = new InventoryLocation;
7820 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7821
7822 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7825 {
7826 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7827 }
7829 {
7830 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7831 }
7832
7833 }
7834
7835 player.GetHumanInventory().ClearUserReservedLocation(this);
7836 }
7837
7840 }
7841
7842
7843
7844
7846 {
7847 return ItemBase.m_DebugActionsMask;
7848 }
7849
7851 {
7852 return ItemBase.m_DebugActionsMask & mask;
7853 }
7854
7856 {
7857 ItemBase.m_DebugActionsMask = mask;
7858 }
7859
7861 {
7862 ItemBase.m_DebugActionsMask |= mask;
7863 }
7864
7866 {
7867 ItemBase.m_DebugActionsMask &= ~mask;
7868 }
7869
7871 {
7873 {
7875 }
7876 else
7877 {
7879 }
7880 }
7881
7882
7884 {
7885 if (GetEconomyProfile())
7886 {
7887 float q_max = GetEconomyProfile().GetQuantityMax();
7888 if (q_max > 0)
7889 {
7890 float q_min = GetEconomyProfile().GetQuantityMin();
7891 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7892
7894 {
7895 ComponentEnergyManager comp = GetCompEM();
7897 {
7899 }
7900 }
7902 {
7904
7905 }
7906
7907 }
7908 }
7909 }
7910
7913 {
7914 EntityAI parent = GetHierarchyParent();
7915
7916 if (parent)
7917 {
7918 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7919 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7920 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7921 }
7922 }
7923
7926 {
7927 EntityAI parent = GetHierarchyParent();
7928
7929 if (parent)
7930 {
7931 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7932 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7933 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7934 }
7935 }
7936
7938 {
7939
7940
7941
7942
7944
7946 {
7947 if (ScriptInputUserData.CanStoreInputUserData())
7948 {
7949 ScriptInputUserData ctx = new ScriptInputUserData;
7955 ctx.
Write(use_stack_max);
7958
7960 {
7961 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7962 }
7963 }
7964 }
7965 else if (!
GetGame().IsMultiplayer())
7966 {
7968 }
7969 }
7970
7972 {
7974 }
7975
7977 {
7979 }
7980
7982 {
7984 }
7985
7987 {
7988
7989 return false;
7990 }
7991
7993 {
7994 return false;
7995 }
7996
8000 {
8001 return false;
8002 }
8003
8005 {
8006 return "";
8007 }
8008
8010
8012 {
8013 return false;
8014 }
8015
8017 {
8018 return true;
8019 }
8020
8021
8022
8024 {
8025 return true;
8026 }
8027
8029 {
8030 return true;
8031 }
8032
8034 {
8035 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8037 }
8038
8040 {
8042 }
8043
8045 {
8047 if (!is_being_placed)
8049 SetSynchDirty();
8050 }
8051
8052
8054
8056 {
8058 }
8059
8061 {
8063 }
8064
8066 {
8067 return 1;
8068 }
8069
8071 {
8072 return false;
8073 }
8074
8076 {
8078 SetSynchDirty();
8079 }
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8116 {
8117 super.OnMovedInsideCargo(container);
8118
8119 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8120 }
8121
8122 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8123 {
8124 super.EEItemLocationChanged(oldLoc,newLoc);
8125
8126 PlayerBase new_player = null;
8127 PlayerBase old_player = null;
8128
8129 if (newLoc.GetParent())
8130 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8131
8132 if (oldLoc.GetParent())
8133 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8134
8136 {
8137 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8138
8139 if (r_index >= 0)
8140 {
8141 InventoryLocation r_il = new InventoryLocation;
8142 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8143
8144 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8147 {
8148 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8149 }
8151 {
8152 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8153 }
8154
8155 }
8156 }
8157
8159 {
8160 if (new_player)
8161 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8162
8163 if (new_player == old_player)
8164 {
8165
8166 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8167 {
8169 {
8170 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8171 {
8172 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8173 }
8174 }
8175 else
8176 {
8177 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8178 }
8179 }
8180
8181 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8182 {
8183 int type = oldLoc.GetType();
8185 {
8186 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8187 }
8189 {
8190 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8191 }
8192 }
8193 if (!m_OldLocation)
8194 {
8195 m_OldLocation = new InventoryLocation;
8196 }
8197 m_OldLocation.Copy(oldLoc);
8198 }
8199 else
8200 {
8201 if (m_OldLocation)
8202 {
8203 m_OldLocation.Reset();
8204 }
8205 }
8206
8208 }
8209 else
8210 {
8211 if (new_player)
8212 {
8213 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8214 if (res_index >= 0)
8215 {
8216 InventoryLocation il = new InventoryLocation;
8217 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8219 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8222 {
8223 il.
GetParent().GetOnReleaseLock().Invoke(it);
8224 }
8226 {
8228 }
8229
8230 }
8231 }
8233 {
8234
8236 }
8237
8238 if (m_OldLocation)
8239 {
8240 m_OldLocation.Reset();
8241 }
8242 }
8243 }
8244
8245 override void EOnContact(IEntity other, Contact extra)
8246 {
8248 {
8249 int liquidType = -1;
8251 if (impactSpeed > 0.0)
8252 {
8254 #ifndef SERVER
8256 #else
8258 SetSynchDirty();
8259 #endif
8261 }
8262 }
8263
8264 #ifdef SERVER
8265 if (GetCompEM() && GetCompEM().IsPlugged())
8266 {
8267 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8268 GetCompEM().UnplugThis();
8269 }
8270 #endif
8271 }
8272
8274
8276 {
8278 }
8279
8281 {
8282
8283 }
8284
8286 {
8287 super.OnItemLocationChanged(old_owner, new_owner);
8288
8289 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8290 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8291
8292 if (!relatedPlayer && playerNew)
8293 relatedPlayer = playerNew;
8294
8295 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8296 {
8298 if (actionMgr)
8299 {
8300 ActionBase currentAction = actionMgr.GetRunningAction();
8301 if (currentAction)
8303 }
8304 }
8305
8306 Man ownerPlayerOld = null;
8307 Man ownerPlayerNew = null;
8308
8309 if (old_owner)
8310 {
8311 if (old_owner.
IsMan())
8312 {
8313 ownerPlayerOld = Man.Cast(old_owner);
8314 }
8315 else
8316 {
8317 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8318 }
8319 }
8320 else
8321 {
8323 {
8325
8326 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8327 {
8328 GetCompEM().UnplugThis();
8329 }
8330 }
8331 }
8332
8333 if (new_owner)
8334 {
8335 if (new_owner.
IsMan())
8336 {
8337 ownerPlayerNew = Man.Cast(new_owner);
8338 }
8339 else
8340 {
8341 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8342 }
8343 }
8344
8345 if (ownerPlayerOld != ownerPlayerNew)
8346 {
8347 if (ownerPlayerOld)
8348 {
8349 array<EntityAI> subItemsExit = new array<EntityAI>;
8351 for (int i = 0; i < subItemsExit.Count(); i++)
8352 {
8355 }
8356 }
8357
8358 if (ownerPlayerNew)
8359 {
8360 array<EntityAI> subItemsEnter = new array<EntityAI>;
8362 for (int j = 0; j < subItemsEnter.Count(); j++)
8363 {
8366 }
8367 }
8368 }
8369 else if (ownerPlayerNew != null)
8370 {
8371 PlayerBase nplayer;
8372 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8373 {
8374 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8376 for (int k = 0; k < subItemsUpdate.Count(); k++)
8377 {
8379 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8380 }
8381 }
8382 }
8383
8384 if (old_owner)
8385 old_owner.OnChildItemRemoved(this);
8386 if (new_owner)
8387 new_owner.OnChildItemReceived(this);
8388 }
8389
8390
8392 {
8393 super.EEDelete(parent);
8394 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8395 if (player)
8396 {
8398
8399 if (player.IsAlive())
8400 {
8401 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8402 if (r_index >= 0)
8403 {
8404 InventoryLocation r_il = new InventoryLocation;
8405 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8406
8407 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8410 {
8411 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8412 }
8414 {
8415 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8416 }
8417
8418 }
8419
8420 player.RemoveQuickBarEntityShortcut(this);
8421 }
8422 }
8423 }
8424
8426 {
8427 super.EEKilled(killer);
8428
8431 {
8432 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8433 {
8434 if (IsMagazine())
8435 {
8436 if (Magazine.Cast(this).GetAmmoCount() > 0)
8437 {
8439 }
8440 }
8441 else
8442 {
8444 }
8445 }
8446 }
8447 }
8448
8450 {
8451 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8452
8453 super.OnWasAttached(parent, slot_id);
8454
8457
8459 }
8460
8462 {
8463 super.OnWasDetached(parent, slot_id);
8464
8467 }
8468
8470 {
8471 int idx;
8474
8475 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8476 if (inventory_slots.Count() < 1)
8477 {
8478 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8479 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8480 }
8481 else
8482 {
8483 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8484 }
8485
8486 idx = inventory_slots.Find(slot);
8487 if (idx < 0)
8488 return "";
8489
8490 return attach_types.Get(idx);
8491 }
8492
8494 {
8495 int idx = -1;
8496 string slot;
8497
8500
8501 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8502 if (inventory_slots.Count() < 1)
8503 {
8504 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8505 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8506 }
8507 else
8508 {
8509 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8510 if (detach_types.Count() < 1)
8511 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8512 }
8513
8514 for (int i = 0; i < inventory_slots.Count(); i++)
8515 {
8516 slot = inventory_slots.Get(i);
8517 }
8518
8519 if (slot != "")
8520 {
8521 if (detach_types.Count() == 1)
8522 idx = 0;
8523 else
8524 idx = inventory_slots.Find(slot);
8525 }
8526 if (idx < 0)
8527 return "";
8528
8529 return detach_types.Get(idx);
8530 }
8531
8533 {
8534
8536
8537
8538 float min_time = 1;
8539 float max_time = 3;
8540 float delay = Math.RandomFloat(min_time, max_time);
8541
8542 explode_timer.Run(delay, this, "DoAmmoExplosion");
8543 }
8544
8546 {
8547 Magazine magazine = Magazine.Cast(this);
8548 int pop_sounds_count = 6;
8549 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8550
8551
8552 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8553 string sound_name = pop_sounds[ sound_idx ];
8555
8556
8557 magazine.ServerAddAmmoCount(-1);
8558
8559
8560 float min_temp_to_explode = 100;
8561
8562 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8563 {
8565 }
8566 }
8567
8568
8569 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8570 {
8571 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8572
8573 const int CHANCE_DAMAGE_CARGO = 4;
8574 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8575 const int CHANCE_DAMAGE_NOTHING = 2;
8576
8578 {
8579 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8580 int chances;
8581 int rnd;
8582
8583 if (GetInventory().GetCargo())
8584 {
8585 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8586 rnd = Math.RandomInt(0,chances);
8587
8588 if (rnd < CHANCE_DAMAGE_CARGO)
8589 {
8591 }
8592 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8593 {
8595 }
8596 }
8597 else
8598 {
8599 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8600 rnd = Math.RandomInt(0,chances);
8601
8602 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8603 {
8605 }
8606 }
8607 }
8608 }
8609
8611 {
8612 if (GetInventory().GetCargo())
8613 {
8614 int item_count = GetInventory().GetCargo().GetItemCount();
8615 if (item_count > 0)
8616 {
8617 int random_pick = Math.RandomInt(0, item_count);
8619 if (!item.IsExplosive())
8620 {
8621 item.AddHealth("","",damage);
8622 return true;
8623 }
8624 }
8625 }
8626 return false;
8627 }
8628
8630 {
8631 int attachment_count = GetInventory().AttachmentCount();
8632 if (attachment_count > 0)
8633 {
8634 int random_pick = Math.RandomInt(0, attachment_count);
8635 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8636 if (!attachment.IsExplosive())
8637 {
8638 attachment.AddHealth("","",damage);
8639 return true;
8640 }
8641 }
8642 return false;
8643 }
8644
8646 {
8648 }
8649
8651 {
8653 return GetInventory().CanRemoveEntity();
8654
8655 return false;
8656 }
8657
8659 {
8661 return;
8662
8664 {
8665 if (ScriptInputUserData.CanStoreInputUserData())
8666 {
8667 ScriptInputUserData ctx = new ScriptInputUserData;
8672 ctx.
Write(destination_entity);
8676 }
8677 }
8678 else if (!
GetGame().IsMultiplayer())
8679 {
8681 }
8682 }
8683
8685 {
8687 return;
8688
8689 float split_quantity_new;
8693 InventoryLocation loc = new InventoryLocation;
8694
8695 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8696 {
8698 split_quantity_new = stack_max;
8699 else
8701
8702 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8703 if (new_item)
8704 {
8705 new_item.SetResultOfSplit(true);
8706 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8708 new_item.SetQuantity(split_quantity_new);
8709 }
8710 }
8711 else if (destination_entity && slot_id == -1)
8712 {
8713 if (quantity > stack_max)
8714 split_quantity_new = stack_max;
8715 else
8716 split_quantity_new = quantity;
8717
8719 {
8722 }
8723
8724 if (new_item)
8725 {
8726 new_item.SetResultOfSplit(true);
8727 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8729 new_item.SetQuantity(split_quantity_new);
8730 }
8731 }
8732 else
8733 {
8734 if (stack_max != 0)
8735 {
8737 {
8739 }
8740
8741 if (split_quantity_new == 0)
8742 {
8743 if (!
GetGame().IsMultiplayer())
8744 player.PhysicalPredictiveDropItem(this);
8745 else
8746 player.ServerDropEntity(this);
8747 return;
8748 }
8749
8751
8752 if (new_item)
8753 {
8754 new_item.SetResultOfSplit(true);
8755 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8757 new_item.SetQuantity(stack_max);
8758 new_item.PlaceOnSurface();
8759 }
8760 }
8761 }
8762 }
8763
8765 {
8767 return;
8768
8769 float split_quantity_new;
8773 InventoryLocation loc = new InventoryLocation;
8774
8775 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8776 {
8778 split_quantity_new = stack_max;
8779 else
8781
8782 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8783 if (new_item)
8784 {
8785 new_item.SetResultOfSplit(true);
8786 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8788 new_item.SetQuantity(split_quantity_new);
8789 }
8790 }
8791 else if (destination_entity && slot_id == -1)
8792 {
8793 if (quantity > stack_max)
8794 split_quantity_new = stack_max;
8795 else
8796 split_quantity_new = quantity;
8797
8799 {
8802 }
8803
8804 if (new_item)
8805 {
8806 new_item.SetResultOfSplit(true);
8807 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8809 new_item.SetQuantity(split_quantity_new);
8810 }
8811 }
8812 else
8813 {
8814 if (stack_max != 0)
8815 {
8817 {
8819 }
8820
8822
8823 if (new_item)
8824 {
8825 new_item.SetResultOfSplit(true);
8826 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8828 new_item.SetQuantity(stack_max);
8829 new_item.PlaceOnSurface();
8830 }
8831 }
8832 }
8833 }
8834
8836 {
8838 return;
8839
8841 {
8842 if (ScriptInputUserData.CanStoreInputUserData())
8843 {
8844 ScriptInputUserData ctx = new ScriptInputUserData;
8849 dst.WriteToContext(ctx);
8851 }
8852 }
8853 else if (!
GetGame().IsMultiplayer())
8854 {
8856 }
8857 }
8858
8860 {
8862 return;
8863
8865 {
8866 if (ScriptInputUserData.CanStoreInputUserData())
8867 {
8868 ScriptInputUserData ctx = new ScriptInputUserData;
8873 ctx.
Write(destination_entity);
8879 }
8880 }
8881 else if (!
GetGame().IsMultiplayer())
8882 {
8884 }
8885 }
8886
8888 {
8890 }
8891
8893 {
8895 return this;
8896
8898 float split_quantity_new;
8900 if (dst.IsValid())
8901 {
8902 int slot_id = dst.GetSlot();
8904
8905 if (quantity > stack_max)
8906 split_quantity_new = stack_max;
8907 else
8908 split_quantity_new = quantity;
8909
8911
8912 if (new_item)
8913 {
8914 new_item.SetResultOfSplit(true);
8915 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8918 }
8919
8920 return new_item;
8921 }
8922
8923 return null;
8924 }
8925
8927 {
8929 return;
8930
8932 float split_quantity_new;
8934 if (destination_entity)
8935 {
8937 if (quantity > stackable)
8938 split_quantity_new = stackable;
8939 else
8940 split_quantity_new = quantity;
8941
8942 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8943 if (new_item)
8944 {
8945 new_item.SetResultOfSplit(true);
8946 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8948 new_item.SetQuantity(split_quantity_new);
8949 }
8950 }
8951 }
8952
8954 {
8956 return;
8957
8959 {
8960 if (ScriptInputUserData.CanStoreInputUserData())
8961 {
8962 ScriptInputUserData ctx = new ScriptInputUserData;
8967 ItemBase destination_entity =
this;
8968 ctx.
Write(destination_entity);
8972 }
8973 }
8974 else if (!
GetGame().IsMultiplayer())
8975 {
8977 }
8978 }
8979
8981 {
8983 return;
8984
8986 float split_quantity_new;
8988 if (player)
8989 {
8991 if (quantity > stackable)
8992 split_quantity_new = stackable;
8993 else
8994 split_quantity_new = quantity;
8995
8996 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8997 new_item =
ItemBase.Cast(in_hands);
8998 if (new_item)
8999 {
9000 new_item.SetResultOfSplit(true);
9001 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9003 new_item.SetQuantity(split_quantity_new);
9004 }
9005 }
9006 }
9007
9009 {
9011 return;
9012
9014 float split_quantity_new = Math.Floor(quantity * 0.5);
9015
9017
9018 if (new_item)
9019 {
9020 if (new_item.GetQuantityMax() < split_quantity_new)
9021 {
9022 split_quantity_new = new_item.GetQuantityMax();
9023 }
9024
9025 new_item.SetResultOfSplit(true);
9026 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9027
9029 {
9032 }
9033 else
9034 {
9037 }
9038 }
9039 }
9040
9042 {
9044 return;
9045
9047 float split_quantity_new = Math.Floor(quantity / 2);
9048
9049 InventoryLocation invloc = new InventoryLocation;
9051
9053 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9054
9055 if (new_item)
9056 {
9057 if (new_item.GetQuantityMax() < split_quantity_new)
9058 {
9059 split_quantity_new = new_item.GetQuantityMax();
9060 }
9062 {
9065 }
9066 else
9067 {
9070 }
9071 }
9072 }
9073
9076 {
9077 SetWeightDirty();
9079
9080 if (parent)
9081 parent.OnAttachmentQuantityChangedEx(this, delta);
9082
9084 {
9086 {
9088 }
9090 {
9091 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9093 }
9094 }
9095
9096 }
9097
9100 {
9101
9102 }
9103
9106 {
9108 }
9109
9111 {
9112 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9113
9115 {
9116 if (newLevel == GameConstants.STATE_RUINED)
9117 {
9119 EntityAI parent = GetHierarchyParent();
9120 if (parent && parent.IsFireplace())
9121 {
9122 CargoBase cargo = GetInventory().GetCargo();
9123 if (cargo)
9124 {
9126 {
9128 }
9129 }
9130 }
9131 }
9132
9134 {
9135
9137 return;
9138 }
9139
9140 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9141 {
9143 }
9144 }
9145 }
9146
9147
9149 {
9150 super.OnRightClick();
9151
9153 {
9155 {
9156 if (ScriptInputUserData.CanStoreInputUserData())
9157 {
9158 vector m4[4];
9160
9161 EntityAI root = GetHierarchyRoot();
9162
9163 InventoryLocation dst = new InventoryLocation;
9165 {
9166 if (root)
9167 {
9168 root.GetTransform(m4);
9170 }
9171 else
9172 GetInventory().GetCurrentInventoryLocation(dst);
9173 }
9174 else
9175 {
9177
9178
9179 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9180 {
9181 if (root)
9182 {
9183 root.GetTransform(m4);
9185 }
9186 else
9187 GetInventory().GetCurrentInventoryLocation(dst);
9188 }
9189 else
9190 {
9191 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9192 }
9193 }
9194
9195 ScriptInputUserData ctx = new ScriptInputUserData;
9203 }
9204 }
9205 else if (!
GetGame().IsMultiplayer())
9206 {
9208 }
9209 }
9210 }
9211
9212 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9213 {
9214
9215 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9216 return false;
9217
9218 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9219 return false;
9220
9221
9223 return false;
9224
9225
9226 Magazine mag = Magazine.Cast(this);
9227 if (mag)
9228 {
9229 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9230 return false;
9231
9232 if (stack_max_limit)
9233 {
9234 Magazine other_mag = Magazine.Cast(other_item);
9235 if (other_item)
9236 {
9237 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9238 return false;
9239 }
9240
9241 }
9242 }
9243 else
9244 {
9245
9247 return false;
9248
9250 return false;
9251 }
9252
9253 PlayerBase player = null;
9254 if (CastTo(player, GetHierarchyRootPlayer()))
9255 {
9256 if (player.GetInventory().HasAttachment(this))
9257 return false;
9258
9259 if (player.IsItemsToDelete())
9260 return false;
9261 }
9262
9263 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9264 return false;
9265
9266 int slotID;
9268 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9269 return false;
9270
9271 return true;
9272 }
9273
9275 {
9277 }
9278
9280 {
9281 return m_IsResultOfSplit;
9282 }
9283
9285 {
9286 m_IsResultOfSplit = value;
9287 }
9288
9290 {
9292 }
9293
9295 {
9296 float other_item_quantity = other_item.GetQuantity();
9297 float this_free_space;
9298
9300
9302
9303 if (other_item_quantity > this_free_space)
9304 {
9305 return this_free_space;
9306 }
9307 else
9308 {
9309 return other_item_quantity;
9310 }
9311 }
9312
9314 {
9316 }
9317
9319 {
9321 return;
9322
9323 if (!IsMagazine() && other_item)
9324 {
9326 if (quantity_used != 0)
9327 {
9328 float hp1 = GetHealth01("","");
9329 float hp2 = other_item.GetHealth01("","");
9330 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9331 hpResult = hpResult / (
GetQuantity() + quantity_used);
9332
9333 hpResult *= GetMaxHealth();
9334 Math.Round(hpResult);
9335 SetHealth("", "Health", hpResult);
9336
9338 other_item.AddQuantity(-quantity_used);
9339 }
9340 }
9342 }
9343
9345 {
9346 #ifdef SERVER
9347 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9348 GetHierarchyParent().IncreaseLifetimeUp();
9349 #endif
9350 };
9351
9353 {
9354 PlayerBase p = PlayerBase.Cast(player);
9355
9356 array<int> recipesIds = p.m_Recipes;
9357 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9358 if (moduleRecipesManager)
9359 {
9360 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9361 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9362 }
9363
9364 for (int i = 0;i < recipesIds.Count(); i++)
9365 {
9366 int key = recipesIds.Get(i);
9367 string recipeName = moduleRecipesManager.GetRecipeName(key);
9369 }
9370 }
9371
9372
9373 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9374 {
9375 super.GetDebugActions(outputList);
9376
9377
9382
9383
9387
9391
9392
9395
9396
9398 {
9401 }
9402
9404
9407
9411 }
9412
9413
9414
9415
9417 {
9418 super.OnAction(action_id, player, ctx);
9419 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9420 {
9421 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9422 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9423 PlayerBase p = PlayerBase.Cast(player);
9424 if (
EActions.RECIPES_RANGE_START < 1000)
9425 {
9426 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9427 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9428 }
9429 }
9430 #ifndef SERVER
9431 else if (action_id ==
EActions.WATCH_PLAYER)
9432 {
9433 PluginDeveloper.SetDeveloperItemClientEx(player);
9434 }
9435 #endif
9437 {
9438 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9439 {
9440 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9441 OnDebugButtonPressServer(id + 1);
9442 }
9443
9444 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9445 {
9446 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9448 }
9449
9450 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9451 {
9452 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9454 }
9455
9456 else if (action_id ==
EActions.ADD_QUANTITY)
9457 {
9458 if (IsMagazine())
9459 {
9460 Magazine mag = Magazine.Cast(this);
9461 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9462 }
9463 else
9464 {
9466 }
9467
9468 if (m_EM)
9469 {
9470 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9471 }
9472
9473 }
9474
9475 else if (action_id ==
EActions.REMOVE_QUANTITY)
9476 {
9477 if (IsMagazine())
9478 {
9479 Magazine mag2 = Magazine.Cast(this);
9480 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9481 }
9482 else
9483 {
9485 }
9486 if (m_EM)
9487 {
9488 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9489 }
9490
9491 }
9492
9493 else if (action_id ==
EActions.SET_QUANTITY_0)
9494 {
9496
9497 if (m_EM)
9498 {
9499 m_EM.SetEnergy(0);
9500 }
9501 }
9502
9503 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9504 {
9506
9507 if (m_EM)
9508 {
9509 m_EM.SetEnergy(m_EM.GetEnergyMax());
9510 }
9511 }
9512
9513 else if (action_id ==
EActions.ADD_HEALTH)
9514 {
9515 AddHealth("","",GetMaxHealth("","Health")/5);
9516 }
9517 else if (action_id ==
EActions.REMOVE_HEALTH)
9518 {
9519 AddHealth("","",-GetMaxHealth("","Health")/5);
9520 }
9521 else if (action_id ==
EActions.DESTROY_HEALTH)
9522 {
9523 SetHealth01("","",0);
9524 }
9525 else if (action_id ==
EActions.WATCH_ITEM)
9526 {
9528 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9529 #ifdef DEVELOPER
9530 SetDebugDeveloper_item(this);
9531 #endif
9532 }
9533
9534 else if (action_id ==
EActions.ADD_TEMPERATURE)
9535 {
9536 AddTemperature(20);
9537
9538 }
9539
9540 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9541 {
9542 AddTemperature(-20);
9543
9544 }
9545
9546 else if (action_id ==
EActions.FLIP_FROZEN)
9547 {
9548 SetFrozen(!GetIsFrozen());
9549
9550 }
9551
9552 else if (action_id ==
EActions.ADD_WETNESS)
9553 {
9555
9556 }
9557
9558 else if (action_id ==
EActions.REMOVE_WETNESS)
9559 {
9561
9562 }
9563
9564 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9565 {
9568
9569
9570 }
9571
9572 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9573 {
9576 }
9577
9578 else if (action_id ==
EActions.MAKE_SPECIAL)
9579 {
9580 auto debugParams = DebugSpawnParams.WithPlayer(player);
9581 OnDebugSpawnEx(debugParams);
9582 }
9583
9584 else if (action_id ==
EActions.DELETE)
9585 {
9586 Delete();
9587 }
9588
9589 }
9590
9591
9592 return false;
9593 }
9594
9595
9596
9597
9601
9604
9605
9606
9608 {
9609 return false;
9610 }
9611
9612
9614 {
9615 return true;
9616 }
9617
9618
9620 {
9621 return true;
9622 }
9623
9624
9625
9627 {
9628 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9630 }
9631
9634 {
9635 return null;
9636 }
9637
9639 {
9640 return false;
9641 }
9642
9644 {
9645 return false;
9646 }
9647
9651
9652
9654 {
9655 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9656 return module_repairing.CanRepair(this, item_repair_kit);
9657 }
9658
9659
9660 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9661 {
9662 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9663 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9664 }
9665
9666
9668 {
9669
9670
9671
9672
9673
9674
9675
9676
9677 return 1;
9678 }
9679
9680
9681
9683 {
9685 }
9686
9687
9688
9690 {
9692 }
9693
9694
9703 {
9704 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9705
9706 if (player)
9707 {
9708 player.MessageStatus(text);
9709 }
9710 }
9711
9712
9721 {
9722 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9723
9724 if (player)
9725 {
9726 player.MessageAction(text);
9727 }
9728 }
9729
9730
9739 {
9740 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9741
9742 if (player)
9743 {
9744 player.MessageFriendly(text);
9745 }
9746 }
9747
9748
9757 {
9758 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9759
9760 if (player)
9761 {
9762 player.MessageImportant(text);
9763 }
9764 }
9765
9767 {
9768 return true;
9769 }
9770
9771
9772 override bool KindOf(
string tag)
9773 {
9774 bool found = false;
9775 string item_name = this.
GetType();
9778
9779 int array_size = item_tag_array.Count();
9780 for (int i = 0; i < array_size; i++)
9781 {
9782 if (item_tag_array.Get(i) == tag)
9783 {
9784 found = true;
9785 break;
9786 }
9787 }
9788 return found;
9789 }
9790
9791
9793 {
9794
9795 super.OnRPC(sender, rpc_type,ctx);
9796
9797
9798 switch (rpc_type)
9799 {
9800 #ifndef SERVER
9801 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9802 Param2<bool, string> p = new Param2<bool, string>(false, "");
9803
9805 return;
9806
9807 bool play = p.param1;
9808 string soundSet = p.param2;
9809
9810 if (play)
9811 {
9813 {
9815 {
9817 }
9818 }
9819 else
9820 {
9822 }
9823 }
9824 else
9825 {
9827 }
9828
9829 break;
9830 #endif
9831
9832 }
9833
9835 {
9837 }
9838 }
9839
9840
9841
9842
9844 {
9845 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9846 return plugin.GetID(
name);
9847 }
9848
9850 {
9851 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9852 return plugin.GetName(id);
9853 }
9854
9857 {
9858
9859
9860 int varFlags;
9861 if (!ctx.
Read(varFlags))
9862 return;
9863
9864 if (varFlags & ItemVariableFlags.FLOAT)
9865 {
9867 }
9868 }
9869
9871 {
9872
9873 super.SerializeNumericalVars(floats_out);
9874
9875
9876
9878 {
9880 }
9881
9883 {
9885 }
9886
9888 {
9890 }
9891
9893 {
9898 }
9899
9901 {
9903 }
9904 }
9905
9907 {
9908
9909 super.DeSerializeNumericalVars(floats);
9910
9911
9912 int index = 0;
9913 int mask = Math.Round(floats.Get(index));
9914
9915 index++;
9916
9918 {
9920 {
9922 }
9923 else
9924 {
9925 float quantity = floats.Get(index);
9927 }
9928 index++;
9929 }
9930
9932 {
9933 float wet = floats.Get(index);
9935 index++;
9936 }
9937
9939 {
9940 int liquidtype = Math.Round(floats.Get(index));
9942 index++;
9943 }
9944
9946 {
9948 index++;
9950 index++;
9952 index++;
9954 index++;
9955 }
9956
9958 {
9959 int cleanness = Math.Round(floats.Get(index));
9961 index++;
9962 }
9963 }
9964
9966 {
9967 super.WriteVarsToCTX(ctx);
9968
9969
9971 {
9973 }
9974
9976 {
9978 }
9979
9981 {
9983 }
9984
9986 {
9987 int r,g,b,a;
9993 }
9994
9996 {
9998 }
9999 }
10000
10002 {
10003 if (!super.ReadVarsFromCTX(ctx,version))
10004 return false;
10005
10006 int intValue;
10007 float value;
10008
10009 if (version < 140)
10010 {
10011 if (!ctx.
Read(intValue))
10012 return false;
10013
10014 m_VariablesMask = intValue;
10015 }
10016
10018 {
10019 if (!ctx.
Read(value))
10020 return false;
10021
10023 {
10025 }
10026 else
10027 {
10029 }
10030 }
10031
10032 if (version < 140)
10033 {
10035 {
10036 if (!ctx.
Read(value))
10037 return false;
10038 SetTemperatureDirect(value);
10039 }
10040 }
10041
10043 {
10044 if (!ctx.
Read(value))
10045 return false;
10047 }
10048
10050 {
10051 if (!ctx.
Read(intValue))
10052 return false;
10054 }
10055
10057 {
10058 int r,g,b,a;
10060 return false;
10062 return false;
10064 return false;
10066 return false;
10067
10069 }
10070
10072 {
10073 if (!ctx.
Read(intValue))
10074 return false;
10076 }
10077
10078 if (version >= 138 && version < 140)
10079 {
10081 {
10082 if (!ctx.
Read(intValue))
10083 return false;
10084 SetFrozen(intValue);
10085 }
10086 }
10087
10088 return true;
10089 }
10090
10091
10093 {
10096 {
10098 }
10099
10100 if (!super.OnStoreLoad(ctx, version))
10101 {
10103 return false;
10104 }
10105
10106 if (version >= 114)
10107 {
10108 bool hasQuickBarIndexSaved;
10109
10110 if (!ctx.
Read(hasQuickBarIndexSaved))
10111 {
10113 return false;
10114 }
10115
10116 if (hasQuickBarIndexSaved)
10117 {
10118 int itmQBIndex;
10119
10120
10121 if (!ctx.
Read(itmQBIndex))
10122 {
10124 return false;
10125 }
10126
10127 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10128 if (itmQBIndex != -1 && parentPlayer)
10129 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10130 }
10131 }
10132 else
10133 {
10134
10135 PlayerBase player;
10136 int itemQBIndex;
10137 if (version ==
int.
MAX)
10138 {
10139 if (!ctx.
Read(itemQBIndex))
10140 {
10142 return false;
10143 }
10144 }
10145 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10146 {
10147
10148 if (!ctx.
Read(itemQBIndex))
10149 {
10151 return false;
10152 }
10153 if (itemQBIndex != -1 && player)
10154 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10155 }
10156 }
10157
10158 if (version < 140)
10159 {
10160
10161 if (!LoadVariables(ctx, version))
10162 {
10164 return false;
10165 }
10166 }
10167
10168
10170 {
10172 return false;
10173 }
10174 if (version >= 132)
10175 {
10177 if (raib)
10178 {
10180 {
10182 return false;
10183 }
10184 }
10185 }
10186
10188 return true;
10189 }
10190
10191
10192
10194 {
10195 super.OnStoreSave(ctx);
10196
10197 PlayerBase player;
10198 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10199 {
10201
10202 int itemQBIndex = -1;
10203 itemQBIndex = player.FindQuickBarEntityIndex(this);
10204 ctx.
Write(itemQBIndex);
10205 }
10206 else
10207 {
10209 }
10210
10212
10214 if (raib)
10215 {
10217 }
10218 }
10219
10220
10222 {
10223 super.AfterStoreLoad();
10224
10226 {
10228 }
10229
10231 {
10234 }
10235 }
10236
10238 {
10239 super.EEOnAfterLoad();
10240
10242 {
10244 }
10245
10248 }
10249
10251 {
10252 return false;
10253 }
10254
10255
10256
10258 {
10260 {
10261 #ifdef PLATFORM_CONSOLE
10262
10264 {
10266 if (menu)
10267 {
10269 }
10270 }
10271 #endif
10272 }
10273
10275 {
10278 }
10279
10281 {
10282 SetWeightDirty();
10284 }
10286 {
10289 }
10290
10292 {
10295 }
10297 {
10300 }
10301
10302 super.OnVariablesSynchronized();
10303 }
10304
10305
10306
10308 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10309 {
10310 if (!IsServerCheck(allow_client))
10311 return false;
10312
10314 return false;
10315
10318
10319 if (value <= (min + 0.001))
10320 value = min;
10321
10322 if (value == min)
10323 {
10324 if (destroy_config)
10325 {
10326 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10327 if (dstr)
10328 {
10330 this.Delete();
10331 return true;
10332 }
10333 }
10334 else if (destroy_forced)
10335 {
10337 this.Delete();
10338 return true;
10339 }
10340
10342 }
10343
10346
10348 {
10350
10351 if (delta)
10353 }
10354
10356
10357 return false;
10358 }
10359
10360
10362 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10363 {
10365 }
10366
10368 {
10371 }
10372
10374 {
10377 }
10378
10381 {
10382 float value_clamped = Math.Clamp(value, 0, 1);
10384 SetQuantity(result, destroy_config, destroy_forced);
10385 }
10386
10387
10390 {
10392 }
10393
10395 {
10397 }
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10409 {
10410 int slot = -1;
10411 if (GetInventory())
10412 {
10413 InventoryLocation il = new InventoryLocation;
10414 GetInventory().GetCurrentInventoryLocation(il);
10416 }
10417
10419 }
10420
10422 {
10423 float quantity_max = 0;
10424
10426 {
10427 if (attSlotID != -1)
10428 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10429
10430 if (quantity_max <= 0)
10432 }
10433
10434 if (quantity_max <= 0)
10436
10437 return quantity_max;
10438 }
10439
10441 {
10443 }
10444
10446 {
10448 }
10449
10450
10452 {
10454 }
10455
10457 {
10459 }
10460
10462 {
10464 }
10465
10466
10468 {
10469
10470 float weightEx = GetWeightEx();
10471 float special = GetInventoryAndCargoWeight();
10472 return weightEx - special;
10473 }
10474
10475
10477 {
10479 }
10480
10482 {
10484 {
10485 #ifdef DEVELOPER
10486 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10487 {
10488 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10490 }
10491 #endif
10492
10493 return GetQuantity() * GetConfigWeightModified();
10494 }
10495 else if (HasEnergyManager())
10496 {
10497 #ifdef DEVELOPER
10498 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10499 {
10500 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10501 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10502 }
10503 #endif
10504 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10505 }
10506 else
10507 {
10508 #ifdef DEVELOPER
10509 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10510 {
10511 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10512 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10513 }
10514 #endif
10515 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10516 }
10517 }
10518
10521 {
10522 int item_count = 0;
10524
10525 if (GetInventory().GetCargo() != NULL)
10526 {
10527 item_count = GetInventory().GetCargo().GetItemCount();
10528 }
10529
10530 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10531 {
10532 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10533 if (item)
10534 item_count += item.GetNumberOfItems();
10535 }
10536 return item_count;
10537 }
10538
10541 {
10542 float weight = 0;
10543 float wetness = 1;
10544 if (include_wetness)
10547 {
10548 weight = wetness * m_ConfigWeight;
10549 }
10551 {
10552 weight = 1;
10553 }
10554 return weight;
10555 }
10556
10557
10558
10560 {
10561 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10562 {
10563 GameInventory inv = GetInventory();
10564 array<EntityAI> items = new array<EntityAI>;
10566 for (int i = 0; i < items.Count(); i++)
10567 {
10569 if (item)
10570 {
10572 }
10573 }
10574 }
10575 }
10576
10577
10578
10579
10581 {
10582 float energy = 0;
10583 if (HasEnergyManager())
10584 {
10585 energy = GetCompEM().GetEnergy();
10586 }
10587 return energy;
10588 }
10589
10590
10592 {
10593 super.OnEnergyConsumed();
10594
10596 }
10597
10599 {
10600 super.OnEnergyAdded();
10601
10603 }
10604
10605
10607 {
10608 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10609 {
10611 {
10612 float energy_0to1 = GetCompEM().GetEnergy0To1();
10614 }
10615 }
10616 }
10617
10618
10620 {
10621 return ConfigGetFloat("heatIsolation");
10622 }
10623
10625 {
10627 }
10628
10630 {
10631 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10632 if (
GetGame().ConfigIsExisting(paramPath))
10634
10635 return 0.0;
10636 }
10637
10639 {
10640 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10641 if (
GetGame().ConfigIsExisting(paramPath))
10643
10644 return 0.0;
10645 }
10646
10647 override void SetWet(
float value,
bool allow_client =
false)
10648 {
10649 if (!IsServerCheck(allow_client))
10650 return;
10651
10654
10656
10657 m_VarWet = Math.Clamp(value, min, max);
10658
10660 {
10663 }
10664 }
10665
10666 override void AddWet(
float value)
10667 {
10669 }
10670
10672 {
10674 }
10675
10677 {
10679 }
10680
10682 {
10684 }
10685
10687 {
10689 }
10690
10692 {
10694 }
10695
10696 override void OnWetChanged(
float newVal,
float oldVal)
10697 {
10700 if (newLevel != oldLevel)
10701 {
10703 }
10704 }
10705
10707 {
10708 SetWeightDirty();
10709 }
10710
10712 {
10713 return GetWetLevelInternal(
m_VarWet);
10714 }
10715
10716
10717
10719 {
10721 }
10722
10724 {
10726 }
10727
10729 {
10731 }
10732
10734 {
10736 }
10737
10738
10739
10741 {
10742 if (ConfigIsExisting("itemModelLength"))
10743 {
10744 return ConfigGetFloat("itemModelLength");
10745 }
10746 return 0;
10747 }
10748
10750 {
10751 if (ConfigIsExisting("itemAttachOffset"))
10752 {
10753 return ConfigGetFloat("itemAttachOffset");
10754 }
10755 return 0;
10756 }
10757
10758 override void SetCleanness(
int value,
bool allow_client =
false)
10759 {
10760 if (!IsServerCheck(allow_client))
10761 return;
10762
10764
10766
10769 }
10770
10772 {
10774 }
10775
10777 {
10778 return true;
10779 }
10780
10781
10782
10783
10785 {
10787 }
10788
10790 {
10792 }
10793
10794
10795
10796
10797 override void SetColor(
int r,
int g,
int b,
int a)
10798 {
10804 }
10806 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10807 {
10812 }
10813
10815 {
10817 }
10818
10821 {
10822 int r,g,b,a;
10824 r = r/255;
10825 g = g/255;
10826 b = b/255;
10827 a = a/255;
10828 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10829 }
10830
10831
10832
10833 override void SetLiquidType(
int value,
bool allow_client =
false)
10834 {
10835 if (!IsServerCheck(allow_client))
10836 return;
10837
10842 }
10843
10845 {
10846 return ConfigGetInt("varLiquidTypeInit");
10847 }
10848
10850 {
10852 }
10853
10855 {
10857 SetFrozen(false);
10858 }
10859
10862 {
10863 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10864 }
10865
10866
10869 {
10870 PlayerBase nplayer;
10871 if (PlayerBase.CastTo(nplayer, player))
10872 {
10874
10875 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10876 }
10877 }
10878
10879
10882 {
10883 PlayerBase nplayer;
10884 if (PlayerBase.CastTo(nplayer,player))
10885 {
10886
10887 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10888
10889 }
10890
10891
10892 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10893
10894
10895 if (HasEnergyManager())
10896 {
10897 GetCompEM().UpdatePlugState();
10898 }
10899 }
10900
10901
10903 {
10904 super.OnPlacementStarted(player);
10905
10907 }
10908
10909 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10910 {
10912 {
10913 m_AdminLog.OnPlacementComplete(player,
this);
10914 }
10915
10916 super.OnPlacementComplete(player, position, orientation);
10917 }
10918
10919
10920
10921
10922
10924 {
10926 {
10927 return true;
10928 }
10929 else
10930 {
10931 return false;
10932 }
10933 }
10934
10935
10937 {
10939 {
10941 }
10942 }
10943
10944
10946 {
10948 }
10949
10951 {
10953 }
10954
10955 override void InsertAgent(
int agent,
float count = 1)
10956 {
10957 if (count < 1)
10958 return;
10959
10961 }
10962
10965 {
10967 }
10968
10969
10971 {
10973 }
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11017 {
11019 return false;
11020 return true;
11021 }
11022
11024 {
11025
11027 }
11028
11029
11032 {
11033 super.CheckForRoofLimited(timeTresholdMS);
11034
11036 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11037 {
11038 m_PreviousRoofTestTime = time;
11039 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11040 }
11041 }
11042
11043
11045 {
11047 {
11048 return 0;
11049 }
11050
11051 if (GetInventory().GetAttachmentSlotsCount() != 0)
11052 {
11053 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11054 if (filter)
11055 return filter.GetProtectionLevel(type, false, system);
11056 else
11057 return 0;
11058 }
11059
11060 string subclassPath, entryName;
11061
11062 switch (type)
11063 {
11065 entryName = "biological";
11066 break;
11068 entryName = "chemical";
11069 break;
11070 default:
11071 entryName = "biological";
11072 break;
11073 }
11074
11075 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11076
11078 }
11079
11080
11081
11084 {
11085 if (!IsMagazine())
11087
11089 }
11090
11091
11092
11093
11094
11099 {
11100 return true;
11101 }
11102
11104 {
11106 }
11107
11108
11109
11110
11111
11113 {
11114 if (parent)
11115 {
11116 if (parent.IsInherited(DayZInfected))
11117 return true;
11118
11119 if (!parent.IsRuined())
11120 return true;
11121 }
11122
11123 return true;
11124 }
11125
11127 {
11128 if (!super.CanPutAsAttachment(parent))
11129 {
11130 return false;
11131 }
11132
11133 if (!IsRuined() && !parent.IsRuined())
11134 {
11135 return true;
11136 }
11137
11138 return false;
11139 }
11140
11142 {
11143
11144
11145
11146
11147 return super.CanReceiveItemIntoCargo(item);
11148 }
11149
11151 {
11152
11153
11154
11155
11156 GameInventory attachmentInv = attachment.GetInventory();
11158 {
11159 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11160 return false;
11161 }
11162
11163 InventoryLocation loc = new InventoryLocation();
11164 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11165 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11166 return false;
11167
11168 return super.CanReceiveAttachment(attachment, slotId);
11169 }
11170
11172 {
11173 if (!super.CanReleaseAttachment(attachment))
11174 return false;
11175
11176 return GetInventory().AreChildrenAccessible();
11177 }
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11200 {
11201 int id = muzzle_owner.GetMuzzleID();
11202 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11203
11204 if (WPOF_array)
11205 {
11206 for (int i = 0; i < WPOF_array.Count(); i++)
11207 {
11208 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11209
11210 if (WPOF)
11211 {
11212 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11213 }
11214 }
11215 }
11216 }
11217
11218
11220 {
11221 int id = muzzle_owner.GetMuzzleID();
11223
11224 if (WPOBE_array)
11225 {
11226 for (int i = 0; i < WPOBE_array.Count(); i++)
11227 {
11228 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11229
11230 if (WPOBE)
11231 {
11232 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11233 }
11234 }
11235 }
11236 }
11237
11238
11240 {
11241 int id = muzzle_owner.GetMuzzleID();
11242 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11243
11244 if (WPOOH_array)
11245 {
11246 for (int i = 0; i < WPOOH_array.Count(); i++)
11247 {
11248 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11249
11250 if (WPOOH)
11251 {
11252 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11253 }
11254 }
11255 }
11256 }
11257
11258
11260 {
11261 int id = muzzle_owner.GetMuzzleID();
11262 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11263
11264 if (WPOOH_array)
11265 {
11266 for (int i = 0; i < WPOOH_array.Count(); i++)
11267 {
11268 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11269
11270 if (WPOOH)
11271 {
11272 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11273 }
11274 }
11275 }
11276 }
11277
11278
11280 {
11281 int id = muzzle_owner.GetMuzzleID();
11282 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11283
11284 if (WPOOH_array)
11285 {
11286 for (int i = 0; i < WPOOH_array.Count(); i++)
11287 {
11288 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11289
11290 if (WPOOH)
11291 {
11292 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11293 }
11294 }
11295 }
11296 }
11297
11298
11299
11301 {
11303 {
11304 return true;
11305 }
11306
11307 return false;
11308 }
11309
11311 {
11313 {
11314 return true;
11315 }
11316
11317 return false;
11318 }
11319
11321 {
11323 {
11324 return true;
11325 }
11326
11327 return false;
11328 }
11329
11331 {
11332 return false;
11333 }
11334
11337 {
11338 return UATimeSpent.DEFAULT_DEPLOY;
11339 }
11340
11341
11342
11343
11345 {
11347 SetSynchDirty();
11348 }
11349
11351 {
11353 }
11354
11355
11357 {
11358 return false;
11359 }
11360
11363 {
11364 string att_type = "None";
11365
11366 if (ConfigIsExisting("soundAttType"))
11367 {
11368 att_type = ConfigGetString("soundAttType");
11369 }
11370
11372 }
11373
11375 {
11377 }
11378
11379
11380
11381
11382
11386
11388 {
11391
11393 }
11394
11395
11397 {
11399 return;
11400
11402
11405
11408
11409 SoundParameters params = new SoundParameters();
11413 }
11414
11415
11417 {
11419 return;
11420
11422 SetSynchDirty();
11423
11426 }
11427
11428
11430 {
11432 return;
11433
11435 SetSynchDirty();
11436
11439 }
11440
11442 {
11444 }
11445
11447 {
11449 }
11450
11453 {
11454 if (!
GetGame().IsDedicatedServer())
11455 {
11456 if (ConfigIsExisting("attachSoundSet"))
11457 {
11458 string cfg_path = "";
11459 string soundset = "";
11460 string type_name =
GetType();
11461
11464 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11465 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11466
11467 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11468 {
11469 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11470 {
11471 if (cfg_slot_array[i] == slot_type)
11472 {
11473 soundset = cfg_soundset_array[i];
11474 break;
11475 }
11476 }
11477 }
11478
11479 if (soundset != "")
11480 {
11481 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11483 }
11484 }
11485 }
11486 }
11487
11489 {
11490
11491 }
11492
11493 void OnApply(PlayerBase player);
11494
11496 {
11497 return 1.0;
11498 };
11499
11501 {
11503 }
11504
11506 {
11508 }
11509
11511
11513 {
11514 SetDynamicPhysicsLifeTime(0.01);
11516 }
11517
11519 {
11520 array<string> zone_names = new array<string>;
11521 GetDamageZones(zone_names);
11522 for (int i = 0; i < zone_names.Count(); i++)
11523 {
11524 SetHealthMax(zone_names.Get(i),"Health");
11525 }
11526 SetHealthMax("","Health");
11527 }
11528
11531 {
11532 float global_health = GetHealth01("","Health");
11533 array<string> zones = new array<string>;
11534 GetDamageZones(zones);
11535
11536 for (int i = 0; i < zones.Count(); i++)
11537 {
11538 SetHealth01(zones.Get(i),"Health",global_health);
11539 }
11540 }
11541
11544 {
11545 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11546 }
11547
11549 {
11550 if (!hasRootAsPlayer)
11551 {
11552 if (refParentIB)
11553 {
11554
11555 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11556 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11557
11558 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11559 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11560
11563 }
11564 else
11565 {
11566
11569 }
11570 }
11571 }
11572
11574 {
11576 {
11577 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11578 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11579 {
11580 float heatPermCoef = 1.0;
11582 while (ent)
11583 {
11584 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11585 ent = ent.GetHierarchyParent();
11586 }
11587
11588 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11589 }
11590 }
11591 }
11592
11594 {
11595
11596 EntityAI parent = GetHierarchyParent();
11597 if (!parent)
11598 {
11599 hasParent = false;
11600 hasRootAsPlayer = false;
11601 }
11602 else
11603 {
11604 hasParent = true;
11605 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11606 refParentIB =
ItemBase.Cast(parent);
11607 }
11608 }
11609
11610 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11611 {
11612
11613 }
11614
11616 {
11617
11618 return false;
11619 }
11620
11622 {
11623
11624
11625 return false;
11626 }
11627
11629 {
11630
11631 return false;
11632 }
11633
11636 {
11637 return !GetIsFrozen() &&
IsOpen();
11638 }
11639
11641 {
11642 bool hasParent = false, hasRootAsPlayer = false;
11644
11645 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11646 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11647
11648 if (wwtu || foodDecay)
11649 {
11653
11654 if (processWetness || processTemperature || processDecay)
11655 {
11657
11658 if (processWetness)
11659 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11660
11661 if (processTemperature)
11663
11664 if (processDecay)
11665 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11666 }
11667 }
11668 }
11669
11672 {
11674 }
11675
11677 {
11680
11681 return super.GetTemperatureFreezeThreshold();
11682 }
11683
11685 {
11688
11689 return super.GetTemperatureThawThreshold();
11690 }
11691
11693 {
11696
11697 return super.GetItemOverheatThreshold();
11698 }
11699
11701 {
11703 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11704
11705 return super.GetTemperatureFreezeTime();
11706 }
11707
11709 {
11711 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11712
11713 return super.GetTemperatureThawTime();
11714 }
11715
11720
11722 {
11723 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11724 }
11725
11727 {
11728 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11729 }
11730
11733 {
11735 }
11736
11738 {
11740 }
11741
11743 {
11745 }
11746
11749 {
11750 return null;
11751 }
11752
11755 {
11756 return false;
11757 }
11758
11760 {
11762 {
11765 if (!trg)
11766 {
11768 explosive = this;
11769 }
11770
11771 explosive.PairRemote(trg);
11773
11774 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11775 trg.SetPersistentPairID(persistentID);
11776 explosive.SetPersistentPairID(persistentID);
11777
11778 return true;
11779 }
11780 return false;
11781 }
11782
11785 {
11786 float ret = 1.0;
11789 ret *= GetHealth01();
11790
11791 return ret;
11792 }
11793
11794 #ifdef DEVELOPER
11795 override void SetDebugItem()
11796 {
11797 super.SetDebugItem();
11798 _itemBase = this;
11799 }
11800
11802 {
11803 string text = super.GetDebugText();
11804
11806 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11807
11808 return text;
11809 }
11810 #endif
11811
11813 {
11814 return true;
11815 }
11816
11818
11820
11822 {
11825 }
11826
11827
11835
11851}
11852
11854{
11856 if (entity)
11857 {
11858 bool is_item = entity.IsInherited(
ItemBase);
11859 if (is_item && full_quantity)
11860 {
11863 }
11864 }
11865 else
11866 {
11868 return NULL;
11869 }
11870 return entity;
11871}
11872
11874{
11875 if (item)
11876 {
11877 if (health > 0)
11878 item.SetHealth("", "", health);
11879
11880 if (item.CanHaveTemperature())
11881 {
11883 if (item.CanFreeze())
11884 item.SetFrozen(false);
11885 }
11886
11887 if (item.HasEnergyManager())
11888 {
11889 if (quantity >= 0)
11890 {
11891 item.GetCompEM().SetEnergy0To1(quantity);
11892 }
11893 else
11894 {
11896 }
11897 }
11898 else if (item.IsMagazine())
11899 {
11900 Magazine mag = Magazine.Cast(item);
11901 if (quantity >= 0)
11902 {
11903 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11904 }
11905 else
11906 {
11908 }
11909
11910 }
11911 else
11912 {
11913 if (quantity >= 0)
11914 {
11915 item.SetQuantityNormalized(quantity, false);
11916 }
11917 else
11918 {
11920 }
11921
11922 }
11923 }
11924}
11925
11926#ifdef DEVELOPER
11928#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.