7054{
7056 {
7057 return true;
7058 }
7059};
7060
7061
7062
7064{
7068
7070
7073
7074
7075
7076
7077
7086
7092
7097
7102
7123 protected bool m_IsResultOfSplit
7124
7126
7131
7132
7133
7135
7139
7140
7141
7143
7146
7147
7148
7154
7155
7163
7166
7167
7169
7170
7172
7173
7178
7179
7184
7185
7187
7188
7190 {
7195
7196 if (!
GetGame().IsDedicatedServer())
7197 {
7199 {
7201
7203 {
7205 }
7206 }
7207
7210 }
7211
7212 m_OldLocation = null;
7213
7215 {
7217 }
7218
7219 if (ConfigIsExisting("headSelectionsToHide"))
7220 {
7223 }
7224
7226 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7227 {
7229 }
7230
7232
7233 m_IsResultOfSplit = false;
7234
7236 }
7237
7239 {
7240 super.InitItemVariables();
7241
7247 m_Count = ConfigGetInt(
"count");
7248
7251
7256
7259
7264
7276
7280
7281
7284 if (ConfigIsExisting("canBeSplit"))
7285 {
7288 }
7289
7291 if (ConfigIsExisting("itemBehaviour"))
7293
7294
7297 RegisterNetSyncVariableInt("m_VarLiquidType");
7298 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7299
7300 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7301 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7302 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7303
7304 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7305 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7306 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7307 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7308
7309 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7310 RegisterNetSyncVariableBool("m_IsTakeable");
7311 RegisterNetSyncVariableBool("m_IsHologram");
7312
7315 {
7318 }
7319
7321
7323 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7325
7326 }
7327
7329 {
7331 }
7332
7334 {
7337 {
7342 }
7343 }
7344
7345 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7346 {
7348 {
7351 }
7352
7354 }
7355
7357 {
7363 }
7364
7366
7368 {
7370
7371 if (!action)
7372 {
7373 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7374 return;
7375 }
7376
7378 if (!ai)
7379 {
7381 return;
7382 }
7383
7385 if (!action_array)
7386 {
7387 action_array = new array<ActionBase_Basic>;
7389 }
7390 if (LogManager.IsActionLogEnable())
7391 {
7392 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7393 }
7394
7395 if (action_array.Find(action) != -1)
7396 {
7397 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7398 }
7399 else
7400 {
7401 action_array.Insert(action);
7402 }
7403 }
7404
7406 {
7408 ActionBase action = player.GetActionManager().GetAction(actionName);
7411
7412 if (action_array)
7413 {
7414 action_array.RemoveItem(action);
7415 }
7416 }
7417
7418
7419
7421 {
7422 ActionOverrideData overrideData = new ActionOverrideData();
7426
7428 if (!actionMap)
7429 {
7432 }
7433
7434 actionMap.Insert(this.
Type(), overrideData);
7435
7436 }
7437
7439
7441
7442
7444 {
7447
7450
7451 string config_to_search = "CfgVehicles";
7452 string muzzle_owner_config;
7453
7455 {
7456 if (IsInherited(Weapon))
7457 config_to_search = "CfgWeapons";
7458
7459 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7460
7461 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7462
7464
7465 if (config_OnFire_subclass_count > 0)
7466 {
7467 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7468
7469 for (int i = 0; i < config_OnFire_subclass_count; i++)
7470 {
7471 string particle_class = "";
7473 string config_OnFire_entry = config_OnFire_class + particle_class;
7474 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7475 WPOF_array.Insert(WPOF);
7476 }
7477
7478
7480 }
7481 }
7482
7484 {
7485 config_to_search = "CfgWeapons";
7486 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7487
7488 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7489
7491
7492 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7493 {
7494 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7495
7496 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7497 {
7498 string particle_class2 = "";
7500 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7501 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7502 WPOBE_array.Insert(WPOBE);
7503 }
7504
7505
7507 }
7508 }
7509 }
7510
7511
7513 {
7516
7518 {
7519 string config_to_search = "CfgVehicles";
7520
7521 if (IsInherited(Weapon))
7522 config_to_search = "CfgWeapons";
7523
7524 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7525 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7526
7527 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7528 {
7529
7531
7533 {
7535 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7537 return;
7538 }
7539
7542
7543
7544
7546 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7547
7548 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7549 {
7550 string particle_class = "";
7552 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7554
7555 if (entry_type == CT_CLASS)
7556 {
7557 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7558 WPOOH_array.Insert(WPOF);
7559 }
7560 }
7561
7562
7564 }
7565 }
7566 }
7567
7569 {
7571 }
7572
7574 {
7576 {
7578
7581
7584
7585 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7586 }
7587 }
7588
7590 {
7592 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7593
7595 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7596
7598 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7599
7601 {
7603 }
7604 }
7605
7607 {
7609 }
7610
7612 {
7615 else
7617
7619 {
7622 }
7623 else
7624 {
7627
7630 }
7631
7633 }
7634
7636 {
7638 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7639 }
7640
7642 {
7644 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7646 }
7647
7649 {
7651 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7652 }
7653
7655 {
7658
7659 OverheatingParticle OP = new OverheatingParticle();
7664
7666 }
7667
7669 {
7672
7673 return -1;
7674 }
7675
7677 {
7679 {
7682
7683 for (int i = count; i > 0; --i)
7684 {
7685 int id = i - 1;
7688
7691
7692 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7693 {
7694 if (p)
7695 {
7698 }
7699 }
7700 }
7701 }
7702 }
7703
7705 {
7707 {
7709 {
7710 int id = i - 1;
7712
7713 if (OP)
7714 {
7716
7717 if (p)
7718 {
7720 }
7721
7722 delete OP;
7723 }
7724 }
7725
7728 }
7729 }
7730
7733 {
7734 return 0.0;
7735 }
7736
7737
7739 {
7740 return 250;
7741 }
7742
7744 {
7745 return 0;
7746 }
7747
7750 {
7752 return true;
7753
7754 return false;
7755 }
7756
7759 {
7762
7764 {
7766 }
7767 else
7768 {
7769
7771 }
7772
7774 }
7775
7782 {
7783 return -1;
7784 }
7785
7786
7787
7788
7790 {
7792 {
7794 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7795
7796 if (r_index >= 0)
7797 {
7798 InventoryLocation r_il = new InventoryLocation;
7799 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7800
7801 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7804 {
7805 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7806 }
7808 {
7809 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7810 }
7811
7812 }
7813
7814 player.GetHumanInventory().ClearUserReservedLocation(this);
7815 }
7816
7819 }
7820
7821
7822
7823
7825 {
7826 return ItemBase.m_DebugActionsMask;
7827 }
7828
7830 {
7831 return ItemBase.m_DebugActionsMask & mask;
7832 }
7833
7835 {
7836 ItemBase.m_DebugActionsMask = mask;
7837 }
7838
7840 {
7841 ItemBase.m_DebugActionsMask |= mask;
7842 }
7843
7845 {
7846 ItemBase.m_DebugActionsMask &= ~mask;
7847 }
7848
7850 {
7852 {
7854 }
7855 else
7856 {
7858 }
7859 }
7860
7861
7863 {
7864 if (GetEconomyProfile())
7865 {
7866 float q_max = GetEconomyProfile().GetQuantityMax();
7867 if (q_max > 0)
7868 {
7869 float q_min = GetEconomyProfile().GetQuantityMin();
7870 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7871
7873 {
7874 ComponentEnergyManager comp = GetCompEM();
7876 {
7878 }
7879 }
7881 {
7883
7884 }
7885
7886 }
7887 }
7888 }
7889
7892 {
7893 EntityAI parent = GetHierarchyParent();
7894
7895 if (parent)
7896 {
7897 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7898 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7899 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7900 }
7901 }
7902
7905 {
7906 EntityAI parent = GetHierarchyParent();
7907
7908 if (parent)
7909 {
7910 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7911 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7912 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7913 }
7914 }
7915
7917 {
7918
7919
7920
7921
7923
7925 {
7926 if (ScriptInputUserData.CanStoreInputUserData())
7927 {
7928 ScriptInputUserData ctx = new ScriptInputUserData;
7934 ctx.
Write(use_stack_max);
7937
7939 {
7940 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
7941 }
7942 }
7943 }
7944 else if (!
GetGame().IsMultiplayer())
7945 {
7947 }
7948 }
7949
7951 {
7953 }
7954
7956 {
7958 }
7959
7961 {
7963 }
7964
7966 {
7967
7968 return false;
7969 }
7970
7972 {
7973 return false;
7974 }
7975
7979 {
7980 return false;
7981 }
7982
7984 {
7985 return "";
7986 }
7987
7989
7991 {
7992 return false;
7993 }
7994
7996 {
7997 return true;
7998 }
7999
8000
8001
8003 {
8004 return true;
8005 }
8006
8008 {
8009 return true;
8010 }
8011
8013 {
8014 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8016 }
8017
8019 {
8021 }
8022
8024 {
8026 if (!is_being_placed)
8028 SetSynchDirty();
8029 }
8030
8031
8033
8035 {
8037 }
8038
8040 {
8042 }
8043
8045 {
8046 return 1;
8047 }
8048
8050 {
8051 return false;
8052 }
8053
8055 {
8057 SetSynchDirty();
8058 }
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8095 {
8096 super.OnMovedInsideCargo(container);
8097
8098 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8099 }
8100
8101 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8102 {
8103 super.EEItemLocationChanged(oldLoc,newLoc);
8104
8105 PlayerBase new_player = null;
8106 PlayerBase old_player = null;
8107
8108 if (newLoc.GetParent())
8109 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8110
8111 if (oldLoc.GetParent())
8112 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8113
8115 {
8116 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8117
8118 if (r_index >= 0)
8119 {
8120 InventoryLocation r_il = new InventoryLocation;
8121 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8122
8123 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8126 {
8127 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8128 }
8130 {
8131 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8132 }
8133
8134 }
8135 }
8136
8138 {
8139 if (new_player)
8140 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8141
8142 if (new_player == old_player)
8143 {
8144
8145 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8146 {
8148 {
8149 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8150 {
8151 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8152 }
8153 }
8154 else
8155 {
8156 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8157 }
8158 }
8159
8160 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8161 {
8162 int type = oldLoc.GetType();
8164 {
8165 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8166 }
8168 {
8169 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8170 }
8171 }
8172 if (!m_OldLocation)
8173 {
8174 m_OldLocation = new InventoryLocation;
8175 }
8176 m_OldLocation.Copy(oldLoc);
8177 }
8178 else
8179 {
8180 if (m_OldLocation)
8181 {
8182 m_OldLocation.Reset();
8183 }
8184 }
8185
8187 }
8188 else
8189 {
8190 if (new_player)
8191 {
8192 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8193 if (res_index >= 0)
8194 {
8195 InventoryLocation il = new InventoryLocation;
8196 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8198 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8201 {
8202 il.
GetParent().GetOnReleaseLock().Invoke(it);
8203 }
8205 {
8207 }
8208
8209 }
8210 }
8212 {
8213
8215 }
8216
8217 if (m_OldLocation)
8218 {
8219 m_OldLocation.Reset();
8220 }
8221 }
8222 }
8223
8224 override void EOnContact(IEntity other, Contact extra)
8225 {
8227 {
8228 int liquidType = -1;
8230 if (impactSpeed > 0.0)
8231 {
8233 #ifndef SERVER
8235 #else
8237 SetSynchDirty();
8238 #endif
8240 }
8241 }
8242
8243 #ifdef SERVER
8244 if (GetCompEM() && GetCompEM().IsPlugged())
8245 {
8246 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8247 GetCompEM().UnplugThis();
8248 }
8249 #endif
8250 }
8251
8253
8255 {
8257 }
8258
8260 {
8261
8262 }
8263
8265 {
8266 super.OnItemLocationChanged(old_owner, new_owner);
8267
8268 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8269 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8270
8271 if (!relatedPlayer && playerNew)
8272 relatedPlayer = playerNew;
8273
8274 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8275 {
8277 if (actionMgr)
8278 {
8279 ActionBase currentAction = actionMgr.GetRunningAction();
8280 if (currentAction)
8282 }
8283 }
8284
8285 Man ownerPlayerOld = null;
8286 Man ownerPlayerNew = null;
8287
8288 if (old_owner)
8289 {
8290 if (old_owner.
IsMan())
8291 {
8292 ownerPlayerOld = Man.Cast(old_owner);
8293 }
8294 else
8295 {
8296 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8297 }
8298 }
8299 else
8300 {
8302 {
8304
8305 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8306 {
8307 GetCompEM().UnplugThis();
8308 }
8309 }
8310 }
8311
8312 if (new_owner)
8313 {
8314 if (new_owner.
IsMan())
8315 {
8316 ownerPlayerNew = Man.Cast(new_owner);
8317 }
8318 else
8319 {
8320 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8321 }
8322 }
8323
8324 if (ownerPlayerOld != ownerPlayerNew)
8325 {
8326 if (ownerPlayerOld)
8327 {
8328 array<EntityAI> subItemsExit = new array<EntityAI>;
8330 for (int i = 0; i < subItemsExit.Count(); i++)
8331 {
8334 }
8335 }
8336
8337 if (ownerPlayerNew)
8338 {
8339 array<EntityAI> subItemsEnter = new array<EntityAI>;
8341 for (int j = 0; j < subItemsEnter.Count(); j++)
8342 {
8345 }
8346 }
8347 }
8348 else if (ownerPlayerNew != null)
8349 {
8350 PlayerBase nplayer;
8351 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8352 {
8353 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8355 for (int k = 0; k < subItemsUpdate.Count(); k++)
8356 {
8358 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8359 }
8360 }
8361 }
8362
8363 if (old_owner)
8364 old_owner.OnChildItemRemoved(this);
8365 if (new_owner)
8366 new_owner.OnChildItemReceived(this);
8367 }
8368
8369
8371 {
8372 super.EEDelete(parent);
8373 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8374 if (player)
8375 {
8377
8378 if (player.IsAlive())
8379 {
8380 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8381 if (r_index >= 0)
8382 {
8383 InventoryLocation r_il = new InventoryLocation;
8384 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8385
8386 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8389 {
8390 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8391 }
8393 {
8394 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8395 }
8396
8397 }
8398
8399 player.RemoveQuickBarEntityShortcut(this);
8400 }
8401 }
8402 }
8403
8405 {
8406 super.EEKilled(killer);
8407
8410 {
8411 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8412 {
8413 if (IsMagazine())
8414 {
8415 if (Magazine.Cast(this).GetAmmoCount() > 0)
8416 {
8418 }
8419 }
8420 else
8421 {
8423 }
8424 }
8425 }
8426 }
8427
8429 {
8430 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8431
8432 super.OnWasAttached(parent, slot_id);
8433
8436
8438 }
8439
8441 {
8442 super.OnWasDetached(parent, slot_id);
8443
8446 }
8447
8449 {
8450 int idx;
8453
8454 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8455 if (inventory_slots.Count() < 1)
8456 {
8457 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8458 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8459 }
8460 else
8461 {
8462 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8463 }
8464
8465 idx = inventory_slots.Find(slot);
8466 if (idx < 0)
8467 return "";
8468
8469 return attach_types.Get(idx);
8470 }
8471
8473 {
8474 int idx = -1;
8475 string slot;
8476
8479
8480 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8481 if (inventory_slots.Count() < 1)
8482 {
8483 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8484 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8485 }
8486 else
8487 {
8488 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8489 if (detach_types.Count() < 1)
8490 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8491 }
8492
8493 for (int i = 0; i < inventory_slots.Count(); i++)
8494 {
8495 slot = inventory_slots.Get(i);
8496 }
8497
8498 if (slot != "")
8499 {
8500 if (detach_types.Count() == 1)
8501 idx = 0;
8502 else
8503 idx = inventory_slots.Find(slot);
8504 }
8505 if (idx < 0)
8506 return "";
8507
8508 return detach_types.Get(idx);
8509 }
8510
8512 {
8513
8515
8516
8517 float min_time = 1;
8518 float max_time = 3;
8519 float delay = Math.RandomFloat(min_time, max_time);
8520
8521 explode_timer.Run(delay, this, "DoAmmoExplosion");
8522 }
8523
8525 {
8526 Magazine magazine = Magazine.Cast(this);
8527 int pop_sounds_count = 6;
8528 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8529
8530
8531 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8532 string sound_name = pop_sounds[ sound_idx ];
8534
8535
8536 magazine.ServerAddAmmoCount(-1);
8537
8538
8539 float min_temp_to_explode = 100;
8540
8541 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8542 {
8544 }
8545 }
8546
8547
8548 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8549 {
8550 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8551
8552 const int CHANCE_DAMAGE_CARGO = 4;
8553 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8554 const int CHANCE_DAMAGE_NOTHING = 2;
8555
8557 {
8558 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8559 int chances;
8560 int rnd;
8561
8562 if (GetInventory().GetCargo())
8563 {
8564 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8565 rnd = Math.RandomInt(0,chances);
8566
8567 if (rnd < CHANCE_DAMAGE_CARGO)
8568 {
8570 }
8571 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8572 {
8574 }
8575 }
8576 else
8577 {
8578 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8579 rnd = Math.RandomInt(0,chances);
8580
8581 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8582 {
8584 }
8585 }
8586 }
8587 }
8588
8590 {
8591 if (GetInventory().GetCargo())
8592 {
8593 int item_count = GetInventory().GetCargo().GetItemCount();
8594 if (item_count > 0)
8595 {
8596 int random_pick = Math.RandomInt(0, item_count);
8598 if (!item.IsExplosive())
8599 {
8600 item.AddHealth("","",damage);
8601 return true;
8602 }
8603 }
8604 }
8605 return false;
8606 }
8607
8609 {
8610 int attachment_count = GetInventory().AttachmentCount();
8611 if (attachment_count > 0)
8612 {
8613 int random_pick = Math.RandomInt(0, attachment_count);
8614 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8615 if (!attachment.IsExplosive())
8616 {
8617 attachment.AddHealth("","",damage);
8618 return true;
8619 }
8620 }
8621 return false;
8622 }
8623
8625 {
8627 }
8628
8630 {
8632 return GetInventory().CanRemoveEntity();
8633
8634 return false;
8635 }
8636
8638 {
8640 return;
8641
8643 {
8644 if (ScriptInputUserData.CanStoreInputUserData())
8645 {
8646 ScriptInputUserData ctx = new ScriptInputUserData;
8651 ctx.
Write(destination_entity);
8655 }
8656 }
8657 else if (!
GetGame().IsMultiplayer())
8658 {
8660 }
8661 }
8662
8664 {
8666 return;
8667
8668 float split_quantity_new;
8672 InventoryLocation loc = new InventoryLocation;
8673
8674 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8675 {
8677 split_quantity_new = stack_max;
8678 else
8680
8681 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8682 if (new_item)
8683 {
8684 new_item.SetResultOfSplit(true);
8685 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8687 new_item.SetQuantity(split_quantity_new);
8688 }
8689 }
8690 else if (destination_entity && slot_id == -1)
8691 {
8692 if (quantity > stack_max)
8693 split_quantity_new = stack_max;
8694 else
8695 split_quantity_new = quantity;
8696
8698 {
8701 }
8702
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
8712 {
8713 if (stack_max != 0)
8714 {
8716 {
8718 }
8719
8720 if (split_quantity_new == 0)
8721 {
8722 if (!
GetGame().IsMultiplayer())
8723 player.PhysicalPredictiveDropItem(this);
8724 else
8725 player.ServerDropEntity(this);
8726 return;
8727 }
8728
8730
8731 if (new_item)
8732 {
8733 new_item.SetResultOfSplit(true);
8734 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8736 new_item.SetQuantity(stack_max);
8737 new_item.PlaceOnSurface();
8738 }
8739 }
8740 }
8741 }
8742
8744 {
8746 return;
8747
8748 float split_quantity_new;
8752 InventoryLocation loc = new InventoryLocation;
8753
8754 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8755 {
8757 split_quantity_new = stack_max;
8758 else
8760
8761 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8762 if (new_item)
8763 {
8764 new_item.SetResultOfSplit(true);
8765 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8767 new_item.SetQuantity(split_quantity_new);
8768 }
8769 }
8770 else if (destination_entity && slot_id == -1)
8771 {
8772 if (quantity > stack_max)
8773 split_quantity_new = stack_max;
8774 else
8775 split_quantity_new = quantity;
8776
8778 {
8781 }
8782
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
8792 {
8793 if (stack_max != 0)
8794 {
8796 {
8798 }
8799
8801
8802 if (new_item)
8803 {
8804 new_item.SetResultOfSplit(true);
8805 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8807 new_item.SetQuantity(stack_max);
8808 new_item.PlaceOnSurface();
8809 }
8810 }
8811 }
8812 }
8813
8815 {
8817 return;
8818
8820 {
8821 if (ScriptInputUserData.CanStoreInputUserData())
8822 {
8823 ScriptInputUserData ctx = new ScriptInputUserData;
8828 dst.WriteToContext(ctx);
8830 }
8831 }
8832 else if (!
GetGame().IsMultiplayer())
8833 {
8835 }
8836 }
8837
8839 {
8841 return;
8842
8844 {
8845 if (ScriptInputUserData.CanStoreInputUserData())
8846 {
8847 ScriptInputUserData ctx = new ScriptInputUserData;
8852 ctx.
Write(destination_entity);
8858 }
8859 }
8860 else if (!
GetGame().IsMultiplayer())
8861 {
8863 }
8864 }
8865
8867 {
8869 }
8870
8872 {
8874 return this;
8875
8877 float split_quantity_new;
8879 if (dst.IsValid())
8880 {
8881 int slot_id = dst.GetSlot();
8883
8884 if (quantity > stack_max)
8885 split_quantity_new = stack_max;
8886 else
8887 split_quantity_new = quantity;
8888
8890
8891 if (new_item)
8892 {
8893 new_item.SetResultOfSplit(true);
8894 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8897 }
8898
8899 return new_item;
8900 }
8901
8902 return null;
8903 }
8904
8906 {
8908 return;
8909
8911 float split_quantity_new;
8913 if (destination_entity)
8914 {
8916 if (quantity > stackable)
8917 split_quantity_new = stackable;
8918 else
8919 split_quantity_new = quantity;
8920
8921 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
8922 if (new_item)
8923 {
8924 new_item.SetResultOfSplit(true);
8925 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8927 new_item.SetQuantity(split_quantity_new);
8928 }
8929 }
8930 }
8931
8933 {
8935 return;
8936
8938 {
8939 if (ScriptInputUserData.CanStoreInputUserData())
8940 {
8941 ScriptInputUserData ctx = new ScriptInputUserData;
8946 ItemBase destination_entity =
this;
8947 ctx.
Write(destination_entity);
8951 }
8952 }
8953 else if (!
GetGame().IsMultiplayer())
8954 {
8956 }
8957 }
8958
8960 {
8962 return;
8963
8965 float split_quantity_new;
8967 if (player)
8968 {
8970 if (quantity > stackable)
8971 split_quantity_new = stackable;
8972 else
8973 split_quantity_new = quantity;
8974
8975 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
8976 new_item =
ItemBase.Cast(in_hands);
8977 if (new_item)
8978 {
8979 new_item.SetResultOfSplit(true);
8980 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8982 new_item.SetQuantity(split_quantity_new);
8983 }
8984 }
8985 }
8986
8988 {
8990 return;
8991
8993 float split_quantity_new = Math.Floor(quantity * 0.5);
8994
8996
8997 if (new_item)
8998 {
8999 if (new_item.GetQuantityMax() < split_quantity_new)
9000 {
9001 split_quantity_new = new_item.GetQuantityMax();
9002 }
9003
9004 new_item.SetResultOfSplit(true);
9005 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9006
9008 {
9011 }
9012 else
9013 {
9016 }
9017 }
9018 }
9019
9021 {
9023 return;
9024
9026 float split_quantity_new = Math.Floor(quantity / 2);
9027
9028 InventoryLocation invloc = new InventoryLocation;
9030
9032 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9033
9034 if (new_item)
9035 {
9036 if (new_item.GetQuantityMax() < split_quantity_new)
9037 {
9038 split_quantity_new = new_item.GetQuantityMax();
9039 }
9041 {
9044 }
9045 else
9046 {
9049 }
9050 }
9051 }
9052
9055 {
9056 SetWeightDirty();
9058
9059 if (parent)
9060 parent.OnAttachmentQuantityChangedEx(this, delta);
9061
9063 {
9065 {
9067 }
9069 {
9070 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9072 }
9073 }
9074
9075 }
9076
9079 {
9080
9081 }
9082
9085 {
9087 }
9088
9090 {
9091 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9092
9094 {
9095 if (newLevel == GameConstants.STATE_RUINED)
9096 {
9098 EntityAI parent = GetHierarchyParent();
9099 if (parent && parent.IsFireplace())
9100 {
9101 CargoBase cargo = GetInventory().GetCargo();
9102 if (cargo)
9103 {
9105 {
9107 }
9108 }
9109 }
9110 }
9111
9113 {
9114
9116 return;
9117 }
9118
9119 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9120 {
9122 }
9123 }
9124 }
9125
9126
9128 {
9129 super.OnRightClick();
9130
9132 {
9134 {
9135 if (ScriptInputUserData.CanStoreInputUserData())
9136 {
9137 vector m4[4];
9139
9140 EntityAI root = GetHierarchyRoot();
9141
9142 InventoryLocation dst = new InventoryLocation;
9144 {
9145 if (root)
9146 {
9147 root.GetTransform(m4);
9149 }
9150 else
9151 GetInventory().GetCurrentInventoryLocation(dst);
9152 }
9153 else
9154 {
9156
9157
9158 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9159 {
9160 if (root)
9161 {
9162 root.GetTransform(m4);
9164 }
9165 else
9166 GetInventory().GetCurrentInventoryLocation(dst);
9167 }
9168 else
9169 {
9170 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9171 }
9172 }
9173
9174 ScriptInputUserData ctx = new ScriptInputUserData;
9182 }
9183 }
9184 else if (!
GetGame().IsMultiplayer())
9185 {
9187 }
9188 }
9189 }
9190
9191 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9192 {
9193
9194 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9195 return false;
9196
9197 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9198 return false;
9199
9200
9202 return false;
9203
9204
9205 Magazine mag = Magazine.Cast(this);
9206 if (mag)
9207 {
9208 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9209 return false;
9210
9211 if (stack_max_limit)
9212 {
9213 Magazine other_mag = Magazine.Cast(other_item);
9214 if (other_item)
9215 {
9216 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9217 return false;
9218 }
9219
9220 }
9221 }
9222 else
9223 {
9224
9226 return false;
9227
9229 return false;
9230 }
9231
9232 PlayerBase player = null;
9233 if (CastTo(player, GetHierarchyRootPlayer()))
9234 {
9235 if (player.GetInventory().HasAttachment(this))
9236 return false;
9237
9238 if (player.IsItemsToDelete())
9239 return false;
9240 }
9241
9242 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9243 return false;
9244
9245 int slotID;
9247 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9248 return false;
9249
9250 return true;
9251 }
9252
9254 {
9256 }
9257
9259 {
9260 return m_IsResultOfSplit;
9261 }
9262
9264 {
9265 m_IsResultOfSplit = value;
9266 }
9267
9269 {
9271 }
9272
9274 {
9275 float other_item_quantity = other_item.GetQuantity();
9276 float this_free_space;
9277
9279
9281
9282 if (other_item_quantity > this_free_space)
9283 {
9284 return this_free_space;
9285 }
9286 else
9287 {
9288 return other_item_quantity;
9289 }
9290 }
9291
9293 {
9295 }
9296
9298 {
9300 return;
9301
9302 if (!IsMagazine() && other_item)
9303 {
9305 if (quantity_used != 0)
9306 {
9307 float hp1 = GetHealth01("","");
9308 float hp2 = other_item.GetHealth01("","");
9309 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9310 hpResult = hpResult / (
GetQuantity() + quantity_used);
9311
9312 hpResult *= GetMaxHealth();
9313 Math.Round(hpResult);
9314 SetHealth("", "Health", hpResult);
9315
9317 other_item.AddQuantity(-quantity_used);
9318 }
9319 }
9321 }
9322
9324 {
9325 #ifdef SERVER
9326 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9327 GetHierarchyParent().IncreaseLifetimeUp();
9328 #endif
9329 };
9330
9332 {
9333 PlayerBase p = PlayerBase.Cast(player);
9334
9335 array<int> recipesIds = p.m_Recipes;
9336 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9337 if (moduleRecipesManager)
9338 {
9339 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9340 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9341 }
9342
9343 for (int i = 0;i < recipesIds.Count(); i++)
9344 {
9345 int key = recipesIds.Get(i);
9346 string recipeName = moduleRecipesManager.GetRecipeName(key);
9348 }
9349 }
9350
9351
9352 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9353 {
9354 super.GetDebugActions(outputList);
9355
9356
9361
9362
9366
9370
9371
9374
9375
9377 {
9380 }
9381
9383
9386
9390 }
9391
9392
9393
9394
9396 {
9397 super.OnAction(action_id, player, ctx);
9398 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9399 {
9400 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9401 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9402 PlayerBase p = PlayerBase.Cast(player);
9403 if (
EActions.RECIPES_RANGE_START < 1000)
9404 {
9405 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9406 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9407 }
9408 }
9409 #ifndef SERVER
9410 else if (action_id ==
EActions.WATCH_PLAYER)
9411 {
9412 PluginDeveloper.SetDeveloperItemClientEx(player);
9413 }
9414 #endif
9416 {
9417 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9418 {
9419 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9420 OnDebugButtonPressServer(id + 1);
9421 }
9422
9423 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9424 {
9425 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9427 }
9428
9429 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9430 {
9431 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9433 }
9434
9435 else if (action_id ==
EActions.ADD_QUANTITY)
9436 {
9437 if (IsMagazine())
9438 {
9439 Magazine mag = Magazine.Cast(this);
9440 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9441 }
9442 else
9443 {
9445 }
9446
9447 if (m_EM)
9448 {
9449 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9450 }
9451
9452 }
9453
9454 else if (action_id ==
EActions.REMOVE_QUANTITY)
9455 {
9456 if (IsMagazine())
9457 {
9458 Magazine mag2 = Magazine.Cast(this);
9459 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9460 }
9461 else
9462 {
9464 }
9465 if (m_EM)
9466 {
9467 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9468 }
9469
9470 }
9471
9472 else if (action_id ==
EActions.SET_QUANTITY_0)
9473 {
9475
9476 if (m_EM)
9477 {
9478 m_EM.SetEnergy(0);
9479 }
9480 }
9481
9482 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9483 {
9485
9486 if (m_EM)
9487 {
9488 m_EM.SetEnergy(m_EM.GetEnergyMax());
9489 }
9490 }
9491
9492 else if (action_id ==
EActions.ADD_HEALTH)
9493 {
9494 AddHealth("","",GetMaxHealth("","Health")/5);
9495 }
9496 else if (action_id ==
EActions.REMOVE_HEALTH)
9497 {
9498 AddHealth("","",-GetMaxHealth("","Health")/5);
9499 }
9500 else if (action_id ==
EActions.DESTROY_HEALTH)
9501 {
9502 SetHealth01("","",0);
9503 }
9504 else if (action_id ==
EActions.WATCH_ITEM)
9505 {
9507 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9508 #ifdef DEVELOPER
9509 SetDebugDeveloper_item(this);
9510 #endif
9511 }
9512
9513 else if (action_id ==
EActions.ADD_TEMPERATURE)
9514 {
9515 AddTemperature(20);
9516
9517 }
9518
9519 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9520 {
9521 AddTemperature(-20);
9522
9523 }
9524
9525 else if (action_id ==
EActions.FLIP_FROZEN)
9526 {
9527 SetFrozen(!GetIsFrozen());
9528
9529 }
9530
9531 else if (action_id ==
EActions.ADD_WETNESS)
9532 {
9534
9535 }
9536
9537 else if (action_id ==
EActions.REMOVE_WETNESS)
9538 {
9540
9541 }
9542
9543 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9544 {
9547
9548
9549 }
9550
9551 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9552 {
9555 }
9556
9557 else if (action_id ==
EActions.MAKE_SPECIAL)
9558 {
9559 auto debugParams = DebugSpawnParams.WithPlayer(player);
9560 OnDebugSpawnEx(debugParams);
9561 }
9562
9563 else if (action_id ==
EActions.DELETE)
9564 {
9565 Delete();
9566 }
9567
9568 }
9569
9570
9571 return false;
9572 }
9573
9574
9575
9576
9580
9583
9584
9585
9587 {
9588 return false;
9589 }
9590
9591
9593 {
9594 return true;
9595 }
9596
9597
9599 {
9600 return true;
9601 }
9602
9603
9604
9606 {
9607 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9609 }
9610
9613 {
9614 return null;
9615 }
9616
9618 {
9619 return false;
9620 }
9621
9623 {
9624 return false;
9625 }
9626
9630
9631
9633 {
9634 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9635 return module_repairing.CanRepair(this, item_repair_kit);
9636 }
9637
9638
9639 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9640 {
9641 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9642 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9643 }
9644
9645
9647 {
9648
9649
9650
9651
9652
9653
9654
9655
9656 return 1;
9657 }
9658
9659
9660
9662 {
9664 }
9665
9666
9667
9669 {
9671 }
9672
9673
9682 {
9683 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9684
9685 if (player)
9686 {
9687 player.MessageStatus(text);
9688 }
9689 }
9690
9691
9700 {
9701 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9702
9703 if (player)
9704 {
9705 player.MessageAction(text);
9706 }
9707 }
9708
9709
9718 {
9719 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9720
9721 if (player)
9722 {
9723 player.MessageFriendly(text);
9724 }
9725 }
9726
9727
9736 {
9737 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9738
9739 if (player)
9740 {
9741 player.MessageImportant(text);
9742 }
9743 }
9744
9746 {
9747 return true;
9748 }
9749
9750
9751 override bool KindOf(
string tag)
9752 {
9753 bool found = false;
9754 string item_name = this.
GetType();
9757
9758 int array_size = item_tag_array.Count();
9759 for (int i = 0; i < array_size; i++)
9760 {
9761 if (item_tag_array.Get(i) == tag)
9762 {
9763 found = true;
9764 break;
9765 }
9766 }
9767 return found;
9768 }
9769
9770
9772 {
9773
9774 super.OnRPC(sender, rpc_type,ctx);
9775
9776
9777 switch (rpc_type)
9778 {
9779 #ifndef SERVER
9780 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9781 Param2<bool, string> p = new Param2<bool, string>(false, "");
9782
9784 return;
9785
9786 bool play = p.param1;
9787 string soundSet = p.param2;
9788
9789 if (play)
9790 {
9792 {
9794 {
9796 }
9797 }
9798 else
9799 {
9801 }
9802 }
9803 else
9804 {
9806 }
9807
9808 break;
9809 #endif
9810
9811 }
9812
9814 {
9816 }
9817 }
9818
9819
9820
9821
9823 {
9824 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9825 return plugin.GetID(
name);
9826 }
9827
9829 {
9830 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9831 return plugin.GetName(id);
9832 }
9833
9836 {
9837
9838
9839 int varFlags;
9840 if (!ctx.
Read(varFlags))
9841 return;
9842
9843 if (varFlags & ItemVariableFlags.FLOAT)
9844 {
9846 }
9847 }
9848
9850 {
9851
9852 super.SerializeNumericalVars(floats_out);
9853
9854
9855
9857 {
9859 }
9860
9862 {
9864 }
9865
9867 {
9869 }
9870
9872 {
9877 }
9878
9880 {
9882 }
9883 }
9884
9886 {
9887
9888 super.DeSerializeNumericalVars(floats);
9889
9890
9891 int index = 0;
9892 int mask = Math.Round(floats.Get(index));
9893
9894 index++;
9895
9897 {
9899 {
9901 }
9902 else
9903 {
9904 float quantity = floats.Get(index);
9906 }
9907 index++;
9908 }
9909
9911 {
9912 float wet = floats.Get(index);
9914 index++;
9915 }
9916
9918 {
9919 int liquidtype = Math.Round(floats.Get(index));
9921 index++;
9922 }
9923
9925 {
9927 index++;
9929 index++;
9931 index++;
9933 index++;
9934 }
9935
9937 {
9938 int cleanness = Math.Round(floats.Get(index));
9940 index++;
9941 }
9942 }
9943
9945 {
9946 super.WriteVarsToCTX(ctx);
9947
9948
9950 {
9952 }
9953
9955 {
9957 }
9958
9960 {
9962 }
9963
9965 {
9966 int r,g,b,a;
9972 }
9973
9975 {
9977 }
9978 }
9979
9981 {
9982 if (!super.ReadVarsFromCTX(ctx,version))
9983 return false;
9984
9985 int intValue;
9986 float value;
9987
9988 if (version < 140)
9989 {
9990 if (!ctx.
Read(intValue))
9991 return false;
9992
9993 m_VariablesMask = intValue;
9994 }
9995
9997 {
9998 if (!ctx.
Read(value))
9999 return false;
10000
10002 {
10004 }
10005 else
10006 {
10008 }
10009 }
10010
10011 if (version < 140)
10012 {
10014 {
10015 if (!ctx.
Read(value))
10016 return false;
10017 SetTemperatureDirect(value);
10018 }
10019 }
10020
10022 {
10023 if (!ctx.
Read(value))
10024 return false;
10026 }
10027
10029 {
10030 if (!ctx.
Read(intValue))
10031 return false;
10033 }
10034
10036 {
10037 int r,g,b,a;
10039 return false;
10041 return false;
10043 return false;
10045 return false;
10046
10048 }
10049
10051 {
10052 if (!ctx.
Read(intValue))
10053 return false;
10055 }
10056
10057 if (version >= 138 && version < 140)
10058 {
10060 {
10061 if (!ctx.
Read(intValue))
10062 return false;
10063 SetFrozen(intValue);
10064 }
10065 }
10066
10067 return true;
10068 }
10069
10070
10072 {
10075 {
10077 }
10078
10079 if (!super.OnStoreLoad(ctx, version))
10080 {
10082 return false;
10083 }
10084
10085 if (version >= 114)
10086 {
10087 bool hasQuickBarIndexSaved;
10088
10089 if (!ctx.
Read(hasQuickBarIndexSaved))
10090 {
10092 return false;
10093 }
10094
10095 if (hasQuickBarIndexSaved)
10096 {
10097 int itmQBIndex;
10098
10099
10100 if (!ctx.
Read(itmQBIndex))
10101 {
10103 return false;
10104 }
10105
10106 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10107 if (itmQBIndex != -1 && parentPlayer)
10108 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10109 }
10110 }
10111 else
10112 {
10113
10114 PlayerBase player;
10115 int itemQBIndex;
10116 if (version ==
int.
MAX)
10117 {
10118 if (!ctx.
Read(itemQBIndex))
10119 {
10121 return false;
10122 }
10123 }
10124 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10125 {
10126
10127 if (!ctx.
Read(itemQBIndex))
10128 {
10130 return false;
10131 }
10132 if (itemQBIndex != -1 && player)
10133 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10134 }
10135 }
10136
10137 if (version < 140)
10138 {
10139
10140 if (!LoadVariables(ctx, version))
10141 {
10143 return false;
10144 }
10145 }
10146
10147
10149 {
10151 return false;
10152 }
10153 if (version >= 132)
10154 {
10156 if (raib)
10157 {
10159 {
10161 return false;
10162 }
10163 }
10164 }
10165
10167 return true;
10168 }
10169
10170
10171
10173 {
10174 super.OnStoreSave(ctx);
10175
10176 PlayerBase player;
10177 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10178 {
10180
10181 int itemQBIndex = -1;
10182 itemQBIndex = player.FindQuickBarEntityIndex(this);
10183 ctx.
Write(itemQBIndex);
10184 }
10185 else
10186 {
10188 }
10189
10191
10193 if (raib)
10194 {
10196 }
10197 }
10198
10199
10201 {
10202 super.AfterStoreLoad();
10203
10205 {
10207 }
10208
10210 {
10213 }
10214 }
10215
10217 {
10218 super.EEOnAfterLoad();
10219
10221 {
10223 }
10224
10227 }
10228
10230 {
10231 return false;
10232 }
10233
10234
10235
10237 {
10239 {
10240 #ifdef PLATFORM_CONSOLE
10241
10243 {
10245 if (menu)
10246 {
10248 }
10249 }
10250 #endif
10251 }
10252
10254 {
10257 }
10258
10260 {
10261 SetWeightDirty();
10263 }
10265 {
10268 }
10269
10271 {
10274 }
10276 {
10279 }
10280
10281 super.OnVariablesSynchronized();
10282 }
10283
10284
10285
10287 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10288 {
10289 if (!IsServerCheck(allow_client))
10290 return false;
10291
10293 return false;
10294
10297
10298 if (value <= (min + 0.001))
10299 value = min;
10300
10301 if (value == min)
10302 {
10303 if (destroy_config)
10304 {
10305 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10306 if (dstr)
10307 {
10309 this.Delete();
10310 return true;
10311 }
10312 }
10313 else if (destroy_forced)
10314 {
10316 this.Delete();
10317 return true;
10318 }
10319
10321 }
10322
10325
10327 {
10329
10330 if (delta)
10332 }
10333
10335
10336 return false;
10337 }
10338
10339
10341 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10342 {
10344 }
10345
10347 {
10350 }
10351
10353 {
10356 }
10357
10360 {
10361 float value_clamped = Math.Clamp(value, 0, 1);
10363 SetQuantity(result, destroy_config, destroy_forced);
10364 }
10365
10366
10369 {
10371 }
10372
10374 {
10376 }
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10388 {
10389 int slot = -1;
10390 if (GetInventory())
10391 {
10392 InventoryLocation il = new InventoryLocation;
10393 GetInventory().GetCurrentInventoryLocation(il);
10395 }
10396
10398 }
10399
10401 {
10402 float quantity_max = 0;
10403
10405 {
10406 if (attSlotID != -1)
10407 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10408
10409 if (quantity_max <= 0)
10411 }
10412
10413 if (quantity_max <= 0)
10415
10416 return quantity_max;
10417 }
10418
10420 {
10422 }
10423
10425 {
10427 }
10428
10429
10431 {
10433 }
10434
10436 {
10438 }
10439
10441 {
10443 }
10444
10445
10447 {
10448
10449 float weightEx = GetWeightEx();
10450 float special = GetInventoryAndCargoWeight();
10451 return weightEx - special;
10452 }
10453
10454
10456 {
10458 }
10459
10461 {
10463 {
10464 #ifdef DEVELOPER
10465 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10466 {
10467 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10469 }
10470 #endif
10471
10472 return GetQuantity() * GetConfigWeightModified();
10473 }
10474 else if (HasEnergyManager())
10475 {
10476 #ifdef DEVELOPER
10477 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10478 {
10479 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10480 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10481 }
10482 #endif
10483 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10484 }
10485 else
10486 {
10487 #ifdef DEVELOPER
10488 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10489 {
10490 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10491 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10492 }
10493 #endif
10494 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10495 }
10496 }
10497
10500 {
10501 int item_count = 0;
10503
10504 if (GetInventory().GetCargo() != NULL)
10505 {
10506 item_count = GetInventory().GetCargo().GetItemCount();
10507 }
10508
10509 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10510 {
10511 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10512 if (item)
10513 item_count += item.GetNumberOfItems();
10514 }
10515 return item_count;
10516 }
10517
10520 {
10521 float weight = 0;
10522 float wetness = 1;
10523 if (include_wetness)
10526 {
10527 weight = wetness * m_ConfigWeight;
10528 }
10530 {
10531 weight = 1;
10532 }
10533 return weight;
10534 }
10535
10536
10537
10539 {
10540 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10541 {
10542 GameInventory inv = GetInventory();
10543 array<EntityAI> items = new array<EntityAI>;
10545 for (int i = 0; i < items.Count(); i++)
10546 {
10548 if (item)
10549 {
10551 }
10552 }
10553 }
10554 }
10555
10556
10557
10558
10560 {
10561 float energy = 0;
10562 if (HasEnergyManager())
10563 {
10564 energy = GetCompEM().GetEnergy();
10565 }
10566 return energy;
10567 }
10568
10569
10571 {
10572 super.OnEnergyConsumed();
10573
10575 }
10576
10578 {
10579 super.OnEnergyAdded();
10580
10582 }
10583
10584
10586 {
10587 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10588 {
10590 {
10591 float energy_0to1 = GetCompEM().GetEnergy0To1();
10593 }
10594 }
10595 }
10596
10597
10599 {
10600 return ConfigGetFloat("heatIsolation");
10601 }
10602
10604 {
10606 }
10607
10609 {
10610 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10611 if (
GetGame().ConfigIsExisting(paramPath))
10613
10614 return 0.0;
10615 }
10616
10618 {
10619 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10620 if (
GetGame().ConfigIsExisting(paramPath))
10622
10623 return 0.0;
10624 }
10625
10626 override void SetWet(
float value,
bool allow_client =
false)
10627 {
10628 if (!IsServerCheck(allow_client))
10629 return;
10630
10633
10635
10636 m_VarWet = Math.Clamp(value, min, max);
10637
10639 {
10642 }
10643 }
10644
10645 override void AddWet(
float value)
10646 {
10648 }
10649
10651 {
10653 }
10654
10656 {
10658 }
10659
10661 {
10663 }
10664
10666 {
10668 }
10669
10671 {
10673 }
10674
10675 override void OnWetChanged(
float newVal,
float oldVal)
10676 {
10679 if (newLevel != oldLevel)
10680 {
10682 }
10683 }
10684
10686 {
10687 SetWeightDirty();
10688 }
10689
10691 {
10692 return GetWetLevelInternal(
m_VarWet);
10693 }
10694
10695
10696
10698 {
10700 }
10701
10703 {
10705 }
10706
10708 {
10710 }
10711
10713 {
10715 }
10716
10717
10718
10720 {
10721 if (ConfigIsExisting("itemModelLength"))
10722 {
10723 return ConfigGetFloat("itemModelLength");
10724 }
10725 return 0;
10726 }
10727
10729 {
10730 if (ConfigIsExisting("itemAttachOffset"))
10731 {
10732 return ConfigGetFloat("itemAttachOffset");
10733 }
10734 return 0;
10735 }
10736
10737 override void SetCleanness(
int value,
bool allow_client =
false)
10738 {
10739 if (!IsServerCheck(allow_client))
10740 return;
10741
10743
10745
10748 }
10749
10751 {
10753 }
10754
10756 {
10757 return true;
10758 }
10759
10760
10761
10762
10764 {
10766 }
10767
10769 {
10771 }
10772
10773
10774
10775
10776 override void SetColor(
int r,
int g,
int b,
int a)
10777 {
10783 }
10785 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10786 {
10791 }
10792
10794 {
10796 }
10797
10800 {
10801 int r,g,b,a;
10803 r = r/255;
10804 g = g/255;
10805 b = b/255;
10806 a = a/255;
10807 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10808 }
10809
10810
10811
10812 override void SetLiquidType(
int value,
bool allow_client =
false)
10813 {
10814 if (!IsServerCheck(allow_client))
10815 return;
10816
10821 }
10822
10824 {
10825 return ConfigGetInt("varLiquidTypeInit");
10826 }
10827
10829 {
10831 }
10832
10834 {
10836 SetFrozen(false);
10837 }
10838
10841 {
10842 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10843 }
10844
10845
10848 {
10849 PlayerBase nplayer;
10850 if (PlayerBase.CastTo(nplayer, player))
10851 {
10853
10854 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10855 }
10856 }
10857
10858
10861 {
10862 PlayerBase nplayer;
10863 if (PlayerBase.CastTo(nplayer,player))
10864 {
10865
10866 nplayer.SetEnableQuickBarEntityShortcut(this,false);
10867
10868 }
10869
10870
10871 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
10872
10873
10874 if (HasEnergyManager())
10875 {
10876 GetCompEM().UpdatePlugState();
10877 }
10878 }
10879
10880
10882 {
10883 super.OnPlacementStarted(player);
10884
10886 }
10887
10888 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
10889 {
10891 {
10892 m_AdminLog.OnPlacementComplete(player,
this);
10893 }
10894
10895 super.OnPlacementComplete(player, position, orientation);
10896 }
10897
10898
10899
10900
10901
10903 {
10905 {
10906 return true;
10907 }
10908 else
10909 {
10910 return false;
10911 }
10912 }
10913
10914
10916 {
10918 {
10920 }
10921 }
10922
10923
10925 {
10927 }
10928
10930 {
10932 }
10933
10934 override void InsertAgent(
int agent,
float count = 1)
10935 {
10936 if (count < 1)
10937 return;
10938
10940 }
10941
10944 {
10946 }
10947
10948
10950 {
10952 }
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10996 {
10998 return false;
10999 return true;
11000 }
11001
11003 {
11004
11006 }
11007
11008
11011 {
11012 super.CheckForRoofLimited(timeTresholdMS);
11013
11015 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11016 {
11017 m_PreviousRoofTestTime = time;
11018 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11019 }
11020 }
11021
11022
11024 {
11026 {
11027 return 0;
11028 }
11029
11030 if (GetInventory().GetAttachmentSlotsCount() != 0)
11031 {
11032 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11033 if (filter)
11034 return filter.GetProtectionLevel(type, false, system);
11035 else
11036 return 0;
11037 }
11038
11039 string subclassPath, entryName;
11040
11041 switch (type)
11042 {
11044 entryName = "biological";
11045 break;
11047 entryName = "chemical";
11048 break;
11049 default:
11050 entryName = "biological";
11051 break;
11052 }
11053
11054 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11055
11057 }
11058
11059
11060
11063 {
11064 if (!IsMagazine())
11066
11068 }
11069
11070
11071
11072
11073
11078 {
11079 return true;
11080 }
11081
11083 {
11085 }
11086
11087
11088
11089
11090
11092 {
11093 if (parent)
11094 {
11095 if (parent.IsInherited(DayZInfected))
11096 return true;
11097
11098 if (!parent.IsRuined())
11099 return true;
11100 }
11101
11102 return true;
11103 }
11104
11106 {
11107 if (!super.CanPutAsAttachment(parent))
11108 {
11109 return false;
11110 }
11111
11112 if (!IsRuined() && !parent.IsRuined())
11113 {
11114 return true;
11115 }
11116
11117 return false;
11118 }
11119
11121 {
11122
11123
11124
11125
11126 return super.CanReceiveItemIntoCargo(item);
11127 }
11128
11130 {
11131
11132
11133
11134
11135 GameInventory attachmentInv = attachment.GetInventory();
11137 {
11138 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11139 return false;
11140 }
11141
11142 InventoryLocation loc = new InventoryLocation();
11143 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11144 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11145 return false;
11146
11147 return super.CanReceiveAttachment(attachment, slotId);
11148 }
11149
11151 {
11152 if (!super.CanReleaseAttachment(attachment))
11153 return false;
11154
11155 return GetInventory().AreChildrenAccessible();
11156 }
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11179 {
11180 int id = muzzle_owner.GetMuzzleID();
11181 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11182
11183 if (WPOF_array)
11184 {
11185 for (int i = 0; i < WPOF_array.Count(); i++)
11186 {
11187 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11188
11189 if (WPOF)
11190 {
11191 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11192 }
11193 }
11194 }
11195 }
11196
11197
11199 {
11200 int id = muzzle_owner.GetMuzzleID();
11202
11203 if (WPOBE_array)
11204 {
11205 for (int i = 0; i < WPOBE_array.Count(); i++)
11206 {
11207 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11208
11209 if (WPOBE)
11210 {
11211 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11212 }
11213 }
11214 }
11215 }
11216
11217
11219 {
11220 int id = muzzle_owner.GetMuzzleID();
11221 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11222
11223 if (WPOOH_array)
11224 {
11225 for (int i = 0; i < WPOOH_array.Count(); i++)
11226 {
11227 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11228
11229 if (WPOOH)
11230 {
11231 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11232 }
11233 }
11234 }
11235 }
11236
11237
11239 {
11240 int id = muzzle_owner.GetMuzzleID();
11241 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11242
11243 if (WPOOH_array)
11244 {
11245 for (int i = 0; i < WPOOH_array.Count(); i++)
11246 {
11247 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11248
11249 if (WPOOH)
11250 {
11251 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11252 }
11253 }
11254 }
11255 }
11256
11257
11259 {
11260 int id = muzzle_owner.GetMuzzleID();
11261 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11262
11263 if (WPOOH_array)
11264 {
11265 for (int i = 0; i < WPOOH_array.Count(); i++)
11266 {
11267 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11268
11269 if (WPOOH)
11270 {
11271 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11272 }
11273 }
11274 }
11275 }
11276
11277
11278
11280 {
11282 {
11283 return true;
11284 }
11285
11286 return false;
11287 }
11288
11290 {
11292 {
11293 return true;
11294 }
11295
11296 return false;
11297 }
11298
11300 {
11302 {
11303 return true;
11304 }
11305
11306 return false;
11307 }
11308
11310 {
11311 return false;
11312 }
11313
11316 {
11317 return UATimeSpent.DEFAULT_DEPLOY;
11318 }
11319
11320
11321
11322
11324 {
11326 SetSynchDirty();
11327 }
11328
11330 {
11332 }
11333
11334
11336 {
11337 return false;
11338 }
11339
11342 {
11343 string att_type = "None";
11344
11345 if (ConfigIsExisting("soundAttType"))
11346 {
11347 att_type = ConfigGetString("soundAttType");
11348 }
11349
11351 }
11352
11354 {
11356 }
11357
11358
11359
11360
11361
11365
11367 {
11370
11372 }
11373
11374
11376 {
11378 return;
11379
11381
11384
11387
11388 SoundParameters params = new SoundParameters();
11392 }
11393
11394
11396 {
11398 return;
11399
11401 SetSynchDirty();
11402
11405 }
11406
11407
11409 {
11411 return;
11412
11414 SetSynchDirty();
11415
11418 }
11419
11421 {
11423 }
11424
11426 {
11428 }
11429
11432 {
11433 if (!
GetGame().IsDedicatedServer())
11434 {
11435 if (ConfigIsExisting("attachSoundSet"))
11436 {
11437 string cfg_path = "";
11438 string soundset = "";
11439 string type_name =
GetType();
11440
11443 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11444 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11445
11446 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11447 {
11448 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11449 {
11450 if (cfg_slot_array[i] == slot_type)
11451 {
11452 soundset = cfg_soundset_array[i];
11453 break;
11454 }
11455 }
11456 }
11457
11458 if (soundset != "")
11459 {
11460 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11462 }
11463 }
11464 }
11465 }
11466
11468 {
11469
11470 }
11471
11472 void OnApply(PlayerBase player);
11473
11475 {
11476 return 1.0;
11477 };
11478
11480 {
11482 }
11483
11485 {
11487 }
11488
11490
11492 {
11493 SetDynamicPhysicsLifeTime(0.01);
11495 }
11496
11498 {
11499 array<string> zone_names = new array<string>;
11500 GetDamageZones(zone_names);
11501 for (int i = 0; i < zone_names.Count(); i++)
11502 {
11503 SetHealthMax(zone_names.Get(i),"Health");
11504 }
11505 SetHealthMax("","Health");
11506 }
11507
11510 {
11511 float global_health = GetHealth01("","Health");
11512 array<string> zones = new array<string>;
11513 GetDamageZones(zones);
11514
11515 for (int i = 0; i < zones.Count(); i++)
11516 {
11517 SetHealth01(zones.Get(i),"Health",global_health);
11518 }
11519 }
11520
11523 {
11524 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11525 }
11526
11528 {
11529 if (!hasRootAsPlayer)
11530 {
11531 if (refParentIB)
11532 {
11533
11534 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11535 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11536
11537 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11538 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11539
11542 }
11543 else
11544 {
11545
11548 }
11549 }
11550 }
11551
11553 {
11555 {
11556 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11557 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11558 {
11559 float heatPermCoef = 1.0;
11561 while (ent)
11562 {
11563 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11564 ent = ent.GetHierarchyParent();
11565 }
11566
11567 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11568 }
11569 }
11570 }
11571
11573 {
11574
11575 EntityAI parent = GetHierarchyParent();
11576 if (!parent)
11577 {
11578 hasParent = false;
11579 hasRootAsPlayer = false;
11580 }
11581 else
11582 {
11583 hasParent = true;
11584 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11585 refParentIB =
ItemBase.Cast(parent);
11586 }
11587 }
11588
11589 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11590 {
11591
11592 }
11593
11595 {
11596
11597 return false;
11598 }
11599
11601 {
11602
11603
11604 return false;
11605 }
11606
11608 {
11609
11610 return false;
11611 }
11612
11615 {
11616 return !GetIsFrozen() &&
IsOpen();
11617 }
11618
11620 {
11621 bool hasParent = false, hasRootAsPlayer = false;
11623
11624 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11625 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11626
11627 if (wwtu || foodDecay)
11628 {
11632
11633 if (processWetness || processTemperature || processDecay)
11634 {
11636
11637 if (processWetness)
11638 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11639
11640 if (processTemperature)
11642
11643 if (processDecay)
11644 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11645 }
11646 }
11647 }
11648
11651 {
11653 }
11654
11656 {
11659
11660 return super.GetTemperatureFreezeThreshold();
11661 }
11662
11664 {
11667
11668 return super.GetTemperatureThawThreshold();
11669 }
11670
11672 {
11675
11676 return super.GetItemOverheatThreshold();
11677 }
11678
11680 {
11682 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11683
11684 return super.GetTemperatureFreezeTime();
11685 }
11686
11688 {
11690 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11691
11692 return super.GetTemperatureThawTime();
11693 }
11694
11699
11701 {
11702 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11703 }
11704
11706 {
11707 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11708 }
11709
11712 {
11714 }
11715
11717 {
11719 }
11720
11722 {
11724 }
11725
11728 {
11729 return null;
11730 }
11731
11734 {
11735 return false;
11736 }
11737
11739 {
11741 {
11744 if (!trg)
11745 {
11747 explosive = this;
11748 }
11749
11750 explosive.PairRemote(trg);
11752
11753 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11754 trg.SetPersistentPairID(persistentID);
11755 explosive.SetPersistentPairID(persistentID);
11756
11757 return true;
11758 }
11759 return false;
11760 }
11761
11764 {
11765 float ret = 1.0;
11768 ret *= GetHealth01();
11769
11770 return ret;
11771 }
11772
11773 #ifdef DEVELOPER
11774 override void SetDebugItem()
11775 {
11776 super.SetDebugItem();
11777 _itemBase = this;
11778 }
11779
11781 {
11782 string text = super.GetDebugText();
11783
11785 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11786
11787 return text;
11788 }
11789 #endif
11790
11792 {
11793 return true;
11794 }
11795
11797
11799
11801 {
11804 }
11805
11806
11814
11830}
11831
11833{
11835 if (entity)
11836 {
11837 bool is_item = entity.IsInherited(
ItemBase);
11838 if (is_item && full_quantity)
11839 {
11842 }
11843 }
11844 else
11845 {
11847 return NULL;
11848 }
11849 return entity;
11850}
11851
11853{
11854 if (item)
11855 {
11856 if (health > 0)
11857 item.SetHealth("", "", health);
11858
11859 if (item.CanHaveTemperature())
11860 {
11862 if (item.CanFreeze())
11863 item.SetFrozen(false);
11864 }
11865
11866 if (item.HasEnergyManager())
11867 {
11868 if (quantity >= 0)
11869 {
11870 item.GetCompEM().SetEnergy0To1(quantity);
11871 }
11872 else
11873 {
11875 }
11876 }
11877 else if (item.IsMagazine())
11878 {
11879 Magazine mag = Magazine.Cast(item);
11880 if (quantity >= 0)
11881 {
11882 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
11883 }
11884 else
11885 {
11887 }
11888
11889 }
11890 else
11891 {
11892 if (quantity >= 0)
11893 {
11894 item.SetQuantityNormalized(quantity, false);
11895 }
11896 else
11897 {
11899 }
11900
11901 }
11902 }
11903}
11904
11905#ifdef DEVELOPER
11907#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.