7121{
7123 {
7124 return true;
7125 }
7126};
7127
7128
7129
7131{
7135
7137
7140
7141
7142
7143
7144
7153
7159
7164
7169
7190 protected bool m_IsResultOfSplit
7191
7193
7198
7199
7200
7202
7206
7207
7208
7210
7213
7214
7215
7221
7222
7230
7233
7234
7236
7237
7239
7240
7245
7246
7251
7252
7254
7255
7257 {
7262
7263 if (!
GetGame().IsDedicatedServer())
7264 {
7266 {
7268
7270 {
7272 }
7273 }
7274
7277 }
7278
7279 m_OldLocation = null;
7280
7282 {
7284 }
7285
7286 if (ConfigIsExisting("headSelectionsToHide"))
7287 {
7290 }
7291
7293 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7294 {
7296 }
7297
7299
7300 m_IsResultOfSplit = false;
7301
7303 }
7304
7306 {
7307 super.InitItemVariables();
7308
7314 m_Count = ConfigGetInt(
"count");
7315
7318
7323
7326
7331
7343
7347
7348
7351 if (ConfigIsExisting("canBeSplit"))
7352 {
7355 }
7356
7358 if (ConfigIsExisting("itemBehaviour"))
7360
7361
7364 RegisterNetSyncVariableInt("m_VarLiquidType");
7365 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7366
7367 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7368 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7369 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7370
7371 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7372 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7373 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7374 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7375
7376 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7377 RegisterNetSyncVariableBool("m_IsTakeable");
7378 RegisterNetSyncVariableBool("m_IsHologram");
7379
7382 {
7385 }
7386
7388
7390 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7392
7393 }
7394
7396 {
7398 }
7399
7401 {
7404 {
7409 }
7410 }
7411
7412 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7413 {
7415 {
7418 }
7419
7421 }
7422
7424 {
7430 }
7431
7433
7435 {
7437
7438 if (!action)
7439 {
7440 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7441 return;
7442 }
7443
7445 if (!ai)
7446 {
7448 return;
7449 }
7450
7452 if (!action_array)
7453 {
7454 action_array = new array<ActionBase_Basic>;
7456 }
7457 if (LogManager.IsActionLogEnable())
7458 {
7459 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7460 }
7461
7462 if (action_array.Find(action) != -1)
7463 {
7464 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7465 }
7466 else
7467 {
7468 action_array.Insert(action);
7469 }
7470 }
7471
7473 {
7475 ActionBase action = player.GetActionManager().GetAction(actionName);
7478
7479 if (action_array)
7480 {
7481 action_array.RemoveItem(action);
7482 }
7483 }
7484
7485
7486
7488 {
7489 ActionOverrideData overrideData = new ActionOverrideData();
7493
7495 if (!actionMap)
7496 {
7499 }
7500
7501 actionMap.Insert(this.
Type(), overrideData);
7502
7503 }
7504
7506
7508
7509
7511 {
7514
7517
7518 string config_to_search = "CfgVehicles";
7519 string muzzle_owner_config;
7520
7522 {
7523 if (IsInherited(Weapon))
7524 config_to_search = "CfgWeapons";
7525
7526 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7527
7528 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7529
7531
7532 if (config_OnFire_subclass_count > 0)
7533 {
7534 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7535
7536 for (int i = 0; i < config_OnFire_subclass_count; i++)
7537 {
7538 string particle_class = "";
7540 string config_OnFire_entry = config_OnFire_class + particle_class;
7541 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7542 WPOF_array.Insert(WPOF);
7543 }
7544
7545
7547 }
7548 }
7549
7551 {
7552 config_to_search = "CfgWeapons";
7553 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7554
7555 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7556
7558
7559 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7560 {
7561 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7562
7563 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7564 {
7565 string particle_class2 = "";
7567 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7568 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7569 WPOBE_array.Insert(WPOBE);
7570 }
7571
7572
7574 }
7575 }
7576 }
7577
7578
7580 {
7583
7585 {
7586 string config_to_search = "CfgVehicles";
7587
7588 if (IsInherited(Weapon))
7589 config_to_search = "CfgWeapons";
7590
7591 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7592 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7593
7594 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7595 {
7596
7598
7600 {
7602 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7604 return;
7605 }
7606
7609
7610
7611
7613 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7614
7615 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7616 {
7617 string particle_class = "";
7619 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7621
7622 if (entry_type == CT_CLASS)
7623 {
7624 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7625 WPOOH_array.Insert(WPOF);
7626 }
7627 }
7628
7629
7631 }
7632 }
7633 }
7634
7636 {
7638 }
7639
7641 {
7643 {
7645
7648
7651
7652 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7653 }
7654 }
7655
7657 {
7659 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7660
7662 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7663
7665 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7666
7668 {
7670 }
7671 }
7672
7674 {
7676 }
7677
7679 {
7682 else
7684
7686 {
7689 }
7690 else
7691 {
7694
7697 }
7698
7700 }
7701
7703 {
7705 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7706 }
7707
7709 {
7711 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7713 }
7714
7716 {
7718 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7719 }
7720
7722 {
7725
7726 OverheatingParticle OP = new OverheatingParticle();
7731
7733 }
7734
7736 {
7739
7740 return -1;
7741 }
7742
7744 {
7746 {
7749
7750 for (int i = count; i > 0; --i)
7751 {
7752 int id = i - 1;
7755
7758
7759 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
7760 {
7761 if (p)
7762 {
7765 }
7766 }
7767 }
7768 }
7769 }
7770
7772 {
7774 {
7776 {
7777 int id = i - 1;
7779
7780 if (OP)
7781 {
7783
7784 if (p)
7785 {
7787 }
7788
7789 delete OP;
7790 }
7791 }
7792
7795 }
7796 }
7797
7800 {
7801 return 0.0;
7802 }
7803
7804
7806 {
7807 return 250;
7808 }
7809
7811 {
7812 return 0;
7813 }
7814
7817 {
7819 return true;
7820
7821 return false;
7822 }
7823
7826 {
7829
7831 {
7833 }
7834 else
7835 {
7836
7838 }
7839
7841 }
7842
7849 {
7850 return -1;
7851 }
7852
7853
7854
7855
7857 {
7859 {
7861 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
7862
7863 if (r_index >= 0)
7864 {
7865 InventoryLocation r_il = new InventoryLocation;
7866 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
7867
7868 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
7871 {
7872 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
7873 }
7875 {
7876 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
7877 }
7878
7879 }
7880
7881 player.GetHumanInventory().ClearUserReservedLocation(this);
7882 }
7883
7886 }
7887
7888
7889
7890
7892 {
7893 return ItemBase.m_DebugActionsMask;
7894 }
7895
7897 {
7898 return ItemBase.m_DebugActionsMask & mask;
7899 }
7900
7902 {
7903 ItemBase.m_DebugActionsMask = mask;
7904 }
7905
7907 {
7908 ItemBase.m_DebugActionsMask |= mask;
7909 }
7910
7912 {
7913 ItemBase.m_DebugActionsMask &= ~mask;
7914 }
7915
7917 {
7919 {
7921 }
7922 else
7923 {
7925 }
7926 }
7927
7928
7930 {
7931 if (GetEconomyProfile())
7932 {
7933 float q_max = GetEconomyProfile().GetQuantityMax();
7934 if (q_max > 0)
7935 {
7936 float q_min = GetEconomyProfile().GetQuantityMin();
7937 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
7938
7940 {
7941 ComponentEnergyManager comp = GetCompEM();
7943 {
7945 }
7946 }
7948 {
7950
7951 }
7952
7953 }
7954 }
7955 }
7956
7959 {
7960 EntityAI parent = GetHierarchyParent();
7961
7962 if (parent)
7963 {
7964 InventoryLocation inventory_location_to_lock = new InventoryLocation;
7965 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
7966 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
7967 }
7968 }
7969
7972 {
7973 EntityAI parent = GetHierarchyParent();
7974
7975 if (parent)
7976 {
7977 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
7978 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
7979 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
7980 }
7981 }
7982
7984 {
7985
7986
7987
7988
7990
7992 {
7993 if (ScriptInputUserData.CanStoreInputUserData())
7994 {
7995 ScriptInputUserData ctx = new ScriptInputUserData;
8001 ctx.
Write(use_stack_max);
8004
8006 {
8007 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8008 }
8009 }
8010 }
8011 else if (!
GetGame().IsMultiplayer())
8012 {
8014 }
8015 }
8016
8018 {
8020 }
8021
8023 {
8025 }
8026
8028 {
8030 }
8031
8033 {
8034
8035 return false;
8036 }
8037
8039 {
8040 return false;
8041 }
8042
8046 {
8047 return false;
8048 }
8049
8051 {
8052 return "";
8053 }
8054
8056
8058 {
8059 return false;
8060 }
8061
8063 {
8064 return true;
8065 }
8066
8067
8068
8070 {
8071 return true;
8072 }
8073
8075 {
8076 return true;
8077 }
8078
8080 {
8081 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8083 }
8084
8086 {
8088 }
8089
8091 {
8093 if (!is_being_placed)
8095 SetSynchDirty();
8096 }
8097
8098
8100
8102 {
8104 }
8105
8107 {
8109 }
8110
8112 {
8113 return 1;
8114 }
8115
8117 {
8118 return false;
8119 }
8120
8122 {
8124 SetSynchDirty();
8125 }
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8162 {
8163 super.OnMovedInsideCargo(container);
8164
8165 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8166 }
8167
8168 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8169 {
8170 super.EEItemLocationChanged(oldLoc,newLoc);
8171
8172 PlayerBase new_player = null;
8173 PlayerBase old_player = null;
8174
8175 if (newLoc.GetParent())
8176 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8177
8178 if (oldLoc.GetParent())
8179 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8180
8182 {
8183 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8184
8185 if (r_index >= 0)
8186 {
8187 InventoryLocation r_il = new InventoryLocation;
8188 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8189
8190 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8193 {
8194 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8195 }
8197 {
8198 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8199 }
8200
8201 }
8202 }
8203
8205 {
8206 if (new_player)
8207 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8208
8209 if (new_player == old_player)
8210 {
8211
8212 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8213 {
8215 {
8216 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8217 {
8218 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8219 }
8220 }
8221 else
8222 {
8223 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8224 }
8225 }
8226
8227 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8228 {
8229 int type = oldLoc.GetType();
8231 {
8232 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8233 }
8235 {
8236 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8237 }
8238 }
8239 if (!m_OldLocation)
8240 {
8241 m_OldLocation = new InventoryLocation;
8242 }
8243 m_OldLocation.Copy(oldLoc);
8244 }
8245 else
8246 {
8247 if (m_OldLocation)
8248 {
8249 m_OldLocation.Reset();
8250 }
8251 }
8252
8254 }
8255 else
8256 {
8257 if (new_player)
8258 {
8259 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8260 if (res_index >= 0)
8261 {
8262 InventoryLocation il = new InventoryLocation;
8263 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8265 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8268 {
8269 il.
GetParent().GetOnReleaseLock().Invoke(it);
8270 }
8272 {
8274 }
8275
8276 }
8277 }
8279 {
8280
8282 }
8283
8284 if (m_OldLocation)
8285 {
8286 m_OldLocation.Reset();
8287 }
8288 }
8289 }
8290
8291 override void EOnContact(IEntity other, Contact extra)
8292 {
8294 {
8295 int liquidType = -1;
8297 if (impactSpeed > 0.0)
8298 {
8300 #ifndef SERVER
8302 #else
8304 SetSynchDirty();
8305 #endif
8307 }
8308 }
8309
8310 #ifdef SERVER
8311 if (GetCompEM() && GetCompEM().IsPlugged())
8312 {
8313 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8314 GetCompEM().UnplugThis();
8315 }
8316 #endif
8317 }
8318
8320
8322 {
8324 }
8325
8327 {
8328
8329 }
8330
8332 {
8333 super.OnItemLocationChanged(old_owner, new_owner);
8334
8335 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8336 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8337
8338 if (!relatedPlayer && playerNew)
8339 relatedPlayer = playerNew;
8340
8341 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8342 {
8344 if (actionMgr)
8345 {
8346 ActionBase currentAction = actionMgr.GetRunningAction();
8347 if (currentAction)
8349 }
8350 }
8351
8352 Man ownerPlayerOld = null;
8353 Man ownerPlayerNew = null;
8354
8355 if (old_owner)
8356 {
8357 if (old_owner.
IsMan())
8358 {
8359 ownerPlayerOld = Man.Cast(old_owner);
8360 }
8361 else
8362 {
8363 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8364 }
8365 }
8366 else
8367 {
8369 {
8371
8372 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8373 {
8374 GetCompEM().UnplugThis();
8375 }
8376 }
8377 }
8378
8379 if (new_owner)
8380 {
8381 if (new_owner.
IsMan())
8382 {
8383 ownerPlayerNew = Man.Cast(new_owner);
8384 }
8385 else
8386 {
8387 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8388 }
8389 }
8390
8391 if (ownerPlayerOld != ownerPlayerNew)
8392 {
8393 if (ownerPlayerOld)
8394 {
8395 array<EntityAI> subItemsExit = new array<EntityAI>;
8397 for (int i = 0; i < subItemsExit.Count(); i++)
8398 {
8401 }
8402 }
8403
8404 if (ownerPlayerNew)
8405 {
8406 array<EntityAI> subItemsEnter = new array<EntityAI>;
8408 for (int j = 0; j < subItemsEnter.Count(); j++)
8409 {
8412 }
8413 }
8414 }
8415 else if (ownerPlayerNew != null)
8416 {
8417 PlayerBase nplayer;
8418 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8419 {
8420 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8422 for (int k = 0; k < subItemsUpdate.Count(); k++)
8423 {
8425 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8426 }
8427 }
8428 }
8429
8430 if (old_owner)
8431 old_owner.OnChildItemRemoved(this);
8432 if (new_owner)
8433 new_owner.OnChildItemReceived(this);
8434 }
8435
8436
8438 {
8439 super.EEDelete(parent);
8440 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8441 if (player)
8442 {
8444
8445 if (player.IsAlive())
8446 {
8447 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8448 if (r_index >= 0)
8449 {
8450 InventoryLocation r_il = new InventoryLocation;
8451 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8452
8453 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8456 {
8457 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8458 }
8460 {
8461 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8462 }
8463
8464 }
8465
8466 player.RemoveQuickBarEntityShortcut(this);
8467 }
8468 }
8469 }
8470
8472 {
8473 super.EEKilled(killer);
8474
8477 {
8478 if (
GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8479 {
8480 if (IsMagazine())
8481 {
8482 if (Magazine.Cast(this).GetAmmoCount() > 0)
8483 {
8485 }
8486 }
8487 else
8488 {
8490 }
8491 }
8492 }
8493 }
8494
8496 {
8497 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8498
8499 super.OnWasAttached(parent, slot_id);
8500
8503
8505 }
8506
8508 {
8509 super.OnWasDetached(parent, slot_id);
8510
8513 }
8514
8516 {
8517 int idx;
8520
8521 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8522 if (inventory_slots.Count() < 1)
8523 {
8524 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8525 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8526 }
8527 else
8528 {
8529 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8530 }
8531
8532 idx = inventory_slots.Find(slot);
8533 if (idx < 0)
8534 return "";
8535
8536 return attach_types.Get(idx);
8537 }
8538
8540 {
8541 int idx = -1;
8542 string slot;
8543
8546
8547 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8548 if (inventory_slots.Count() < 1)
8549 {
8550 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8551 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8552 }
8553 else
8554 {
8555 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8556 if (detach_types.Count() < 1)
8557 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8558 }
8559
8560 for (int i = 0; i < inventory_slots.Count(); i++)
8561 {
8562 slot = inventory_slots.Get(i);
8563 }
8564
8565 if (slot != "")
8566 {
8567 if (detach_types.Count() == 1)
8568 idx = 0;
8569 else
8570 idx = inventory_slots.Find(slot);
8571 }
8572 if (idx < 0)
8573 return "";
8574
8575 return detach_types.Get(idx);
8576 }
8577
8579 {
8580
8582
8583
8584 float min_time = 1;
8585 float max_time = 3;
8586 float delay = Math.RandomFloat(min_time, max_time);
8587
8588 explode_timer.Run(delay, this, "DoAmmoExplosion");
8589 }
8590
8592 {
8593 Magazine magazine = Magazine.Cast(this);
8594 int pop_sounds_count = 6;
8595 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8596
8597
8598 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8599 string sound_name = pop_sounds[ sound_idx ];
8601
8602
8603 magazine.ServerAddAmmoCount(-1);
8604
8605
8606 float min_temp_to_explode = 100;
8607
8608 if (magazine.GetAmmoCount() > 0 &&
GetTemperature() >= min_temp_to_explode)
8609 {
8611 }
8612 }
8613
8614
8615 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8616 {
8617 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8618
8619 const int CHANCE_DAMAGE_CARGO = 4;
8620 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8621 const int CHANCE_DAMAGE_NOTHING = 2;
8622
8624 {
8625 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8626 int chances;
8627 int rnd;
8628
8629 if (GetInventory().GetCargo())
8630 {
8631 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8632 rnd = Math.RandomInt(0,chances);
8633
8634 if (rnd < CHANCE_DAMAGE_CARGO)
8635 {
8637 }
8638 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8639 {
8641 }
8642 }
8643 else
8644 {
8645 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8646 rnd = Math.RandomInt(0,chances);
8647
8648 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8649 {
8651 }
8652 }
8653 }
8654 }
8655
8657 {
8658 if (GetInventory().GetCargo())
8659 {
8660 int item_count = GetInventory().GetCargo().GetItemCount();
8661 if (item_count > 0)
8662 {
8663 int random_pick = Math.RandomInt(0, item_count);
8665 if (!item.IsExplosive())
8666 {
8667 item.AddHealth("","",damage);
8668 return true;
8669 }
8670 }
8671 }
8672 return false;
8673 }
8674
8676 {
8677 int attachment_count = GetInventory().AttachmentCount();
8678 if (attachment_count > 0)
8679 {
8680 int random_pick = Math.RandomInt(0, attachment_count);
8681 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8682 if (!attachment.IsExplosive())
8683 {
8684 attachment.AddHealth("","",damage);
8685 return true;
8686 }
8687 }
8688 return false;
8689 }
8690
8692 {
8694 }
8695
8697 {
8699 return GetInventory().CanRemoveEntity();
8700
8701 return false;
8702 }
8703
8705 {
8706
8708 return false;
8709
8710
8712 return false;
8713
8714
8715
8717 if (delta == 0)
8718 return false;
8719
8720
8721 return true;
8722 }
8723
8725 {
8727 {
8728 if (ScriptInputUserData.CanStoreInputUserData())
8729 {
8730 ScriptInputUserData ctx = new ScriptInputUserData;
8735 ctx.
Write(destination_entity);
8739 }
8740 }
8741 else if (!
GetGame().IsMultiplayer())
8742 {
8744 }
8745 }
8746
8748 {
8749 float split_quantity_new;
8753 InventoryLocation loc = new InventoryLocation;
8754
8755 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8756 {
8758 split_quantity_new = stack_max;
8759 else
8761
8763 {
8764 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8765 if (new_item)
8766 {
8767 new_item.SetResultOfSplit(true);
8768 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8770 new_item.
SetQuantity(split_quantity_new,
false,
true);
8771 }
8772 }
8773 }
8774 else if (destination_entity && slot_id == -1)
8775 {
8776 if (quantity > stack_max)
8777 split_quantity_new = stack_max;
8778 else
8779 split_quantity_new = quantity;
8780
8782 {
8784 {
8787 }
8788
8789 if (new_item)
8790 {
8791 new_item.SetResultOfSplit(true);
8792 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8794 new_item.
SetQuantity(split_quantity_new,
false,
true);
8795 }
8796 }
8797 }
8798 else
8799 {
8800 if (stack_max != 0)
8801 {
8803 {
8805 }
8806
8807 if (split_quantity_new == 0)
8808 {
8809 if (!
GetGame().IsMultiplayer())
8810 player.PhysicalPredictiveDropItem(this);
8811 else
8812 player.ServerDropEntity(this);
8813 return;
8814 }
8815
8817 {
8819
8820 if (new_item)
8821 {
8822 new_item.SetResultOfSplit(true);
8823 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8826 new_item.PlaceOnSurface();
8827 }
8828 }
8829 }
8830 }
8831 }
8832
8834 {
8835 float split_quantity_new;
8839 InventoryLocation loc = new InventoryLocation;
8840
8841 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
8842 {
8844 split_quantity_new = stack_max;
8845 else
8847
8849 {
8850 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
8851 if (new_item)
8852 {
8853 new_item.SetResultOfSplit(true);
8854 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8856 new_item.
SetQuantity(split_quantity_new,
false,
true);
8857 }
8858 }
8859 }
8860 else if (destination_entity && slot_id == -1)
8861 {
8862 if (quantity > stack_max)
8863 split_quantity_new = stack_max;
8864 else
8865 split_quantity_new = quantity;
8866
8868 {
8870 {
8873 }
8874
8875 if (new_item)
8876 {
8877 new_item.SetResultOfSplit(true);
8878 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8880 new_item.
SetQuantity(split_quantity_new,
false,
true);
8881 }
8882 }
8883 }
8884 else
8885 {
8886 if (stack_max != 0)
8887 {
8889 {
8891 }
8892
8894 {
8896
8897 if (new_item)
8898 {
8899 new_item.SetResultOfSplit(true);
8900 MiscGameplayFunctions.TransferItemProperties(this, new_item);
8903 new_item.PlaceOnSurface();
8904 }
8905 }
8906 }
8907 }
8908 }
8909
8911 {
8913 {
8914 if (ScriptInputUserData.CanStoreInputUserData())
8915 {
8916 ScriptInputUserData ctx = new ScriptInputUserData;
8921 dst.WriteToContext(ctx);
8923 }
8924 }
8925 else if (!
GetGame().IsMultiplayer())
8926 {
8928 }
8929 }
8930
8932 {
8934 {
8935 if (ScriptInputUserData.CanStoreInputUserData())
8936 {
8937 ScriptInputUserData ctx = new ScriptInputUserData;
8942 ctx.
Write(destination_entity);
8948 }
8949 }
8950 else if (!
GetGame().IsMultiplayer())
8951 {
8953 }
8954 }
8955
8957 {
8959 }
8960
8962 {
8964 float split_quantity_new;
8966 if (dst.IsValid())
8967 {
8968 int slot_id = dst.GetSlot();
8970
8971 if (quantity > stack_max)
8972 split_quantity_new = stack_max;
8973 else
8974 split_quantity_new = quantity;
8975
8977 {
8979
8980 if (new_item)
8981 {
8982 new_item.SetResultOfSplit(true);
8983 MiscGameplayFunctions.TransferItemProperties(this,new_item);
8985 new_item.
SetQuantity(split_quantity_new,
false,
true);
8986 }
8987
8988 return new_item;
8989 }
8990 }
8991
8992 return null;
8993 }
8994
8996 {
8998 float split_quantity_new;
9000 if (destination_entity)
9001 {
9003 if (quantity > stackable)
9004 split_quantity_new = stackable;
9005 else
9006 split_quantity_new = quantity;
9007
9009 {
9010 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9011 if (new_item)
9012 {
9013 new_item.SetResultOfSplit(true);
9014 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9016 new_item.
SetQuantity(split_quantity_new,
false,
true);
9017 }
9018 }
9019 }
9020 }
9021
9023 {
9025 {
9026 if (ScriptInputUserData.CanStoreInputUserData())
9027 {
9028 ScriptInputUserData ctx = new ScriptInputUserData;
9033 ItemBase destination_entity =
this;
9034 ctx.
Write(destination_entity);
9038 }
9039 }
9040 else if (!
GetGame().IsMultiplayer())
9041 {
9043 }
9044 }
9045
9047 {
9049 float split_quantity_new;
9051 if (player)
9052 {
9054 if (quantity > stackable)
9055 split_quantity_new = stackable;
9056 else
9057 split_quantity_new = quantity;
9058
9060 {
9061 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9062 new_item =
ItemBase.Cast(in_hands);
9063 if (new_item)
9064 {
9065 new_item.SetResultOfSplit(true);
9066 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9068 new_item.SetQuantity(split_quantity_new, false, true);
9069 }
9070 }
9071 }
9072 }
9073
9075 {
9077 float split_quantity_new = Math.Floor(quantity * 0.5);
9078
9080 return;
9081
9083
9084 if (new_item)
9085 {
9086 if (new_item.GetQuantityMax() < split_quantity_new)
9087 {
9088 split_quantity_new = new_item.GetQuantityMax();
9089 }
9090
9091 new_item.SetResultOfSplit(true);
9092 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9093
9095 {
9098 }
9099 else
9100 {
9102 new_item.
SetQuantity(split_quantity_new,
false,
true);
9103 }
9104 }
9105 }
9106
9108 {
9110 float split_quantity_new = Math.Floor(quantity / 2);
9111
9113 return;
9114
9115 InventoryLocation invloc = new InventoryLocation;
9117
9119 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9120
9121 if (new_item)
9122 {
9123 if (new_item.GetQuantityMax() < split_quantity_new)
9124 {
9125 split_quantity_new = new_item.GetQuantityMax();
9126 }
9128 {
9131 }
9132 else if (split_quantity_new > 1)
9133 {
9135 new_item.
SetQuantity(split_quantity_new,
false,
true);
9136 }
9137 }
9138 }
9139
9142 {
9143 SetWeightDirty();
9145
9146 if (parent)
9147 parent.OnAttachmentQuantityChangedEx(this, delta);
9148
9150 {
9152 {
9154 }
9156 {
9157 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9159 }
9160 }
9161
9162 }
9163
9166 {
9167
9168 }
9169
9172 {
9174 }
9175
9177 {
9178 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9179
9181 {
9182 if (newLevel == GameConstants.STATE_RUINED)
9183 {
9185 EntityAI parent = GetHierarchyParent();
9186 if (parent && parent.IsFireplace())
9187 {
9188 CargoBase cargo = GetInventory().GetCargo();
9189 if (cargo)
9190 {
9192 {
9194 }
9195 }
9196 }
9197 }
9198
9200 {
9201
9203 return;
9204 }
9205
9206 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9207 {
9209 }
9210 }
9211 }
9212
9213
9215 {
9216 super.OnRightClick();
9217
9219 {
9221 {
9222 if (ScriptInputUserData.CanStoreInputUserData())
9223 {
9224 EntityAI root = GetHierarchyRoot();
9225 Man playerOwner = GetHierarchyRootPlayer();
9226 InventoryLocation dst = new InventoryLocation;
9227
9228
9229 if (!playerOwner && root && root == this)
9230 {
9232 }
9233 else
9234 {
9235
9236 GetInventory().GetCurrentInventoryLocation(dst);
9238 {
9241 {
9243 }
9244 else
9245 {
9247
9248
9249 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9250 {
9252 }
9253 else
9254 {
9255 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9256 }
9257 }
9258 }
9259 }
9260
9261 ScriptInputUserData ctx = new ScriptInputUserData;
9269 }
9270 }
9271 else if (!
GetGame().IsMultiplayer())
9272 {
9274 }
9275 }
9276 }
9277
9279 {
9280 if (root)
9281 {
9282 vector m4[4];
9283 root.GetTransform(m4);
9284 dst.SetGround(this, m4);
9285 }
9286 else
9287 {
9288 GetInventory().GetCurrentInventoryLocation(dst);
9289 }
9290 }
9291
9292 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9293 {
9294
9295 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9296 return false;
9297
9298 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9299 return false;
9300
9301
9303 return false;
9304
9305
9306 Magazine mag = Magazine.Cast(this);
9307 if (mag)
9308 {
9309 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9310 return false;
9311
9312 if (stack_max_limit)
9313 {
9314 Magazine other_mag = Magazine.Cast(other_item);
9315 if (other_item)
9316 {
9317 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9318 return false;
9319 }
9320
9321 }
9322 }
9323 else
9324 {
9325
9327 return false;
9328
9330 return false;
9331 }
9332
9333 PlayerBase player = null;
9334 if (CastTo(player, GetHierarchyRootPlayer()))
9335 {
9336 if (player.GetInventory().HasAttachment(this))
9337 return false;
9338
9339 if (player.IsItemsToDelete())
9340 return false;
9341 }
9342
9343 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9344 return false;
9345
9346 int slotID;
9348 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9349 return false;
9350
9351 return true;
9352 }
9353
9355 {
9357 }
9358
9360 {
9361 return m_IsResultOfSplit;
9362 }
9363
9365 {
9366 m_IsResultOfSplit = value;
9367 }
9368
9370 {
9372 }
9373
9375 {
9376 float other_item_quantity = other_item.GetQuantity();
9377 float this_free_space;
9378
9380
9382
9383 if (other_item_quantity > this_free_space)
9384 {
9385 return this_free_space;
9386 }
9387 else
9388 {
9389 return other_item_quantity;
9390 }
9391 }
9392
9394 {
9396 }
9397
9399 {
9401 return;
9402
9403 if (!IsMagazine() && other_item)
9404 {
9406 if (quantity_used != 0)
9407 {
9408 float hp1 = GetHealth01("","");
9409 float hp2 = other_item.GetHealth01("","");
9410 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9411 hpResult = hpResult / (
GetQuantity() + quantity_used);
9412
9413 hpResult *= GetMaxHealth();
9414 Math.Round(hpResult);
9415 SetHealth("", "Health", hpResult);
9416
9418 other_item.AddQuantity(-quantity_used);
9419 }
9420 }
9422 }
9423
9425 {
9426 #ifdef SERVER
9427 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9428 GetHierarchyParent().IncreaseLifetimeUp();
9429 #endif
9430 };
9431
9433 {
9434 PlayerBase p = PlayerBase.Cast(player);
9435
9436 array<int> recipesIds = p.m_Recipes;
9437 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9438 if (moduleRecipesManager)
9439 {
9440 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9441 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9442 }
9443
9444 for (int i = 0;i < recipesIds.Count(); i++)
9445 {
9446 int key = recipesIds.Get(i);
9447 string recipeName = moduleRecipesManager.GetRecipeName(key);
9449 }
9450 }
9451
9452
9453 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9454 {
9455 super.GetDebugActions(outputList);
9456
9457
9463
9464
9469
9474
9475
9479
9480
9482 {
9486 }
9487
9490
9491
9495
9497
9498 InventoryLocation loc = new InventoryLocation();
9499 GetInventory().GetCurrentInventoryLocation(loc);
9501 {
9502 if (Gizmo_IsSupported())
9505 }
9506
9508 }
9509
9510
9511
9512
9514 {
9515 super.OnAction(action_id, player, ctx);
9516
9518 {
9519 switch (action_id)
9520 {
9523 return true;
9526 return true;
9527 }
9528 }
9529
9531 {
9532 switch (action_id)
9533 {
9535 Delete();
9536 return true;
9537 }
9538 }
9539
9540 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9541 {
9542 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9543 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9544 PlayerBase p = PlayerBase.Cast(player);
9545 if (
EActions.RECIPES_RANGE_START < 1000)
9546 {
9547 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9548 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9549 }
9550 }
9551 #ifndef SERVER
9552 else if (action_id ==
EActions.WATCH_PLAYER)
9553 {
9554 PluginDeveloper.SetDeveloperItemClientEx(player);
9555 }
9556 #endif
9558 {
9559 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9560 {
9561 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9562 OnDebugButtonPressServer(id + 1);
9563 }
9564
9565 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9566 {
9567 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9569 }
9570
9571 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9572 {
9573 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9575 }
9576
9577 else if (action_id ==
EActions.ADD_QUANTITY)
9578 {
9579 if (IsMagazine())
9580 {
9581 Magazine mag = Magazine.Cast(this);
9582 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9583 }
9584 else
9585 {
9587 }
9588
9589 if (m_EM)
9590 {
9591 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9592 }
9593
9594 }
9595
9596 else if (action_id ==
EActions.REMOVE_QUANTITY)
9597 {
9598 if (IsMagazine())
9599 {
9600 Magazine mag2 = Magazine.Cast(this);
9601 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9602 }
9603 else
9604 {
9606 }
9607 if (m_EM)
9608 {
9609 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9610 }
9611
9612 }
9613
9614 else if (action_id ==
EActions.SET_QUANTITY_0)
9615 {
9617
9618 if (m_EM)
9619 {
9620 m_EM.SetEnergy(0);
9621 }
9622 }
9623
9624 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9625 {
9627
9628 if (m_EM)
9629 {
9630 m_EM.SetEnergy(m_EM.GetEnergyMax());
9631 }
9632 }
9633
9634 else if (action_id ==
EActions.ADD_HEALTH)
9635 {
9636 AddHealth("","",GetMaxHealth("","Health")/5);
9637 }
9638 else if (action_id ==
EActions.REMOVE_HEALTH)
9639 {
9640 AddHealth("","",-GetMaxHealth("","Health")/5);
9641 }
9642 else if (action_id ==
EActions.DESTROY_HEALTH)
9643 {
9644 SetHealth01("","",0);
9645 }
9646 else if (action_id ==
EActions.WATCH_ITEM)
9647 {
9649 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9650 #ifdef DEVELOPER
9651 SetDebugDeveloper_item(this);
9652 #endif
9653 }
9654
9655 else if (action_id ==
EActions.ADD_TEMPERATURE)
9656 {
9657 AddTemperature(20);
9658
9659 }
9660
9661 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9662 {
9663 AddTemperature(-20);
9664
9665 }
9666
9667 else if (action_id ==
EActions.FLIP_FROZEN)
9668 {
9669 SetFrozen(!GetIsFrozen());
9670
9671 }
9672
9673 else if (action_id ==
EActions.ADD_WETNESS)
9674 {
9676
9677 }
9678
9679 else if (action_id ==
EActions.REMOVE_WETNESS)
9680 {
9682
9683 }
9684
9685 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9686 {
9689
9690
9691 }
9692
9693 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9694 {
9697 }
9698
9699 else if (action_id ==
EActions.MAKE_SPECIAL)
9700 {
9701 auto debugParams = DebugSpawnParams.WithPlayer(player);
9702 OnDebugSpawnEx(debugParams);
9703 }
9704
9705 }
9706
9707
9708 return false;
9709 }
9710
9711
9712
9713
9717
9720
9721
9722
9724 {
9725 return false;
9726 }
9727
9728
9730 {
9731 return true;
9732 }
9733
9734
9736 {
9737 return true;
9738 }
9739
9740
9741
9743 {
9744 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9746 }
9747
9750 {
9751 return null;
9752 }
9753
9755 {
9756 return false;
9757 }
9758
9760 {
9761 return false;
9762 }
9763
9767
9768
9770 {
9771 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9772 return module_repairing.CanRepair(this, item_repair_kit);
9773 }
9774
9775
9776 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9777 {
9778 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9779 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9780 }
9781
9782
9784 {
9785
9786
9787
9788
9789
9790
9791
9792
9793 return 1;
9794 }
9795
9796
9797
9799 {
9801 }
9802
9803
9804
9806 {
9808 }
9809
9810
9819 {
9820 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9821
9822 if (player)
9823 {
9824 player.MessageStatus(text);
9825 }
9826 }
9827
9828
9837 {
9838 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9839
9840 if (player)
9841 {
9842 player.MessageAction(text);
9843 }
9844 }
9845
9846
9855 {
9856 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9857
9858 if (player)
9859 {
9860 player.MessageFriendly(text);
9861 }
9862 }
9863
9864
9873 {
9874 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
9875
9876 if (player)
9877 {
9878 player.MessageImportant(text);
9879 }
9880 }
9881
9883 {
9884 return true;
9885 }
9886
9887
9888 override bool KindOf(
string tag)
9889 {
9890 bool found = false;
9891 string item_name = this.
GetType();
9894
9895 int array_size = item_tag_array.Count();
9896 for (int i = 0; i < array_size; i++)
9897 {
9898 if (item_tag_array.Get(i) == tag)
9899 {
9900 found = true;
9901 break;
9902 }
9903 }
9904 return found;
9905 }
9906
9907
9909 {
9910
9911 super.OnRPC(sender, rpc_type,ctx);
9912
9913
9914 switch (rpc_type)
9915 {
9916 #ifndef SERVER
9917 case ERPCs.RPC_SOUND_LOCK_ATTACH:
9918 Param2<bool, string> p = new Param2<bool, string>(false, "");
9919
9921 return;
9922
9923 bool play = p.param1;
9924 string soundSet = p.param2;
9925
9926 if (play)
9927 {
9929 {
9931 {
9933 }
9934 }
9935 else
9936 {
9938 }
9939 }
9940 else
9941 {
9943 }
9944
9945 break;
9946 #endif
9947
9948 }
9949
9951 {
9953 }
9954 }
9955
9956
9957
9958
9960 {
9961 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9962 return plugin.GetID(
name);
9963 }
9964
9966 {
9967 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
9968 return plugin.GetName(id);
9969 }
9970
9973 {
9974
9975
9976 int varFlags;
9977 if (!ctx.
Read(varFlags))
9978 return;
9979
9980 if (varFlags & ItemVariableFlags.FLOAT)
9981 {
9983 }
9984 }
9985
9987 {
9988
9989 super.SerializeNumericalVars(floats_out);
9990
9991
9992
9994 {
9996 }
9997
9999 {
10001 }
10002
10004 {
10006 }
10007
10009 {
10014 }
10015
10017 {
10019 }
10020 }
10021
10023 {
10024
10025 super.DeSerializeNumericalVars(floats);
10026
10027
10028 int index = 0;
10029 int mask = Math.Round(floats.Get(index));
10030
10031 index++;
10032
10034 {
10036 {
10038 }
10039 else
10040 {
10041 float quantity = floats.Get(index);
10042 SetQuantity(quantity,
true,
false,
false,
false);
10043 }
10044 index++;
10045 }
10046
10048 {
10049 float wet = floats.Get(index);
10051 index++;
10052 }
10053
10055 {
10056 int liquidtype = Math.Round(floats.Get(index));
10058 index++;
10059 }
10060
10062 {
10064 index++;
10066 index++;
10068 index++;
10070 index++;
10071 }
10072
10074 {
10075 int cleanness = Math.Round(floats.Get(index));
10077 index++;
10078 }
10079 }
10080
10082 {
10083 super.WriteVarsToCTX(ctx);
10084
10085
10087 {
10089 }
10090
10092 {
10094 }
10095
10097 {
10099 }
10100
10102 {
10103 int r,g,b,a;
10109 }
10110
10112 {
10114 }
10115 }
10116
10118 {
10119 if (!super.ReadVarsFromCTX(ctx,version))
10120 return false;
10121
10122 int intValue;
10123 float value;
10124
10125 if (version < 140)
10126 {
10127 if (!ctx.
Read(intValue))
10128 return false;
10129
10130 m_VariablesMask = intValue;
10131 }
10132
10134 {
10135 if (!ctx.
Read(value))
10136 return false;
10137
10139 {
10141 }
10142 else
10143 {
10145 }
10146 }
10147
10148 if (version < 140)
10149 {
10151 {
10152 if (!ctx.
Read(value))
10153 return false;
10154 SetTemperatureDirect(value);
10155 }
10156 }
10157
10159 {
10160 if (!ctx.
Read(value))
10161 return false;
10163 }
10164
10166 {
10167 if (!ctx.
Read(intValue))
10168 return false;
10170 }
10171
10173 {
10174 int r,g,b,a;
10176 return false;
10178 return false;
10180 return false;
10182 return false;
10183
10185 }
10186
10188 {
10189 if (!ctx.
Read(intValue))
10190 return false;
10192 }
10193
10194 if (version >= 138 && version < 140)
10195 {
10197 {
10198 if (!ctx.
Read(intValue))
10199 return false;
10200 SetFrozen(intValue);
10201 }
10202 }
10203
10204 return true;
10205 }
10206
10207
10209 {
10212 {
10214 }
10215
10216 if (!super.OnStoreLoad(ctx, version))
10217 {
10219 return false;
10220 }
10221
10222 if (version >= 114)
10223 {
10224 bool hasQuickBarIndexSaved;
10225
10226 if (!ctx.
Read(hasQuickBarIndexSaved))
10227 {
10229 return false;
10230 }
10231
10232 if (hasQuickBarIndexSaved)
10233 {
10234 int itmQBIndex;
10235
10236
10237 if (!ctx.
Read(itmQBIndex))
10238 {
10240 return false;
10241 }
10242
10243 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10244 if (itmQBIndex != -1 && parentPlayer)
10245 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10246 }
10247 }
10248 else
10249 {
10250
10251 PlayerBase player;
10252 int itemQBIndex;
10253 if (version ==
int.
MAX)
10254 {
10255 if (!ctx.
Read(itemQBIndex))
10256 {
10258 return false;
10259 }
10260 }
10261 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10262 {
10263
10264 if (!ctx.
Read(itemQBIndex))
10265 {
10267 return false;
10268 }
10269 if (itemQBIndex != -1 && player)
10270 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10271 }
10272 }
10273
10274 if (version < 140)
10275 {
10276
10277 if (!LoadVariables(ctx, version))
10278 {
10280 return false;
10281 }
10282 }
10283
10284
10286 {
10288 return false;
10289 }
10290 if (version >= 132)
10291 {
10293 if (raib)
10294 {
10296 {
10298 return false;
10299 }
10300 }
10301 }
10302
10304 return true;
10305 }
10306
10307
10308
10310 {
10311 super.OnStoreSave(ctx);
10312
10313 PlayerBase player;
10314 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10315 {
10317
10318 int itemQBIndex = -1;
10319 itemQBIndex = player.FindQuickBarEntityIndex(this);
10320 ctx.
Write(itemQBIndex);
10321 }
10322 else
10323 {
10325 }
10326
10328
10330 if (raib)
10331 {
10333 }
10334 }
10335
10336
10338 {
10339 super.AfterStoreLoad();
10340
10342 {
10344 }
10345
10347 {
10350 }
10351 }
10352
10354 {
10355 super.EEOnAfterLoad();
10356
10358 {
10360 }
10361
10364 }
10365
10367 {
10368 return false;
10369 }
10370
10371
10372
10374 {
10376 {
10377 #ifdef PLATFORM_CONSOLE
10378
10380 {
10382 if (menu)
10383 {
10385 }
10386 }
10387 #endif
10388 }
10389
10391 {
10394 }
10395
10397 {
10398 SetWeightDirty();
10400 }
10402 {
10405 }
10406
10408 {
10411 }
10413 {
10416 }
10417
10418 super.OnVariablesSynchronized();
10419 }
10420
10421
10422
10424 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10425 {
10426 if (!IsServerCheck(allow_client))
10427 return false;
10428
10430 return false;
10431
10434
10435 if (value <= (min + 0.001))
10436 value = min;
10437
10438 if (value == min)
10439 {
10440 if (destroy_config)
10441 {
10442 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10443 if (dstr)
10444 {
10446 this.Delete();
10447 return true;
10448 }
10449 }
10450 else if (destroy_forced)
10451 {
10453 this.Delete();
10454 return true;
10455 }
10456
10458 }
10459
10462
10464 {
10466
10467 if (delta)
10469 }
10470
10472
10473 return false;
10474 }
10475
10476
10478 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10479 {
10481 }
10482
10484 {
10487 }
10488
10490 {
10493 }
10494
10496 override void SetQuantityNormalized(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10497 {
10498 float value_clamped = Math.Clamp(value, 0, 1);
10500 SetQuantity(result, destroy_config, destroy_forced);
10501 }
10502
10503
10506 {
10508 }
10509
10511 {
10513 }
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10525 {
10526 int slot = -1;
10527 if (GetInventory())
10528 {
10529 InventoryLocation il = new InventoryLocation;
10530 GetInventory().GetCurrentInventoryLocation(il);
10532 }
10533
10535 }
10536
10538 {
10539 float quantity_max = 0;
10540
10542 {
10543 if (attSlotID != -1)
10544 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10545
10546 if (quantity_max <= 0)
10548 }
10549
10550 if (quantity_max <= 0)
10552
10553 return quantity_max;
10554 }
10555
10557 {
10559 }
10560
10562 {
10564 }
10565
10566
10568 {
10570 }
10571
10573 {
10575 }
10576
10578 {
10580 }
10581
10582
10584 {
10585
10586 float weightEx = GetWeightEx();
10587 float special = GetInventoryAndCargoWeight();
10588 return weightEx - special;
10589 }
10590
10591
10593 {
10595 }
10596
10598 {
10600 {
10601 #ifdef DEVELOPER
10602 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10603 {
10604 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10606 }
10607 #endif
10608
10609 return GetQuantity() * GetConfigWeightModified();
10610 }
10611 else if (HasEnergyManager())
10612 {
10613 #ifdef DEVELOPER
10614 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10615 {
10616 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10617 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10618 }
10619 #endif
10620 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified();
10621 }
10622 else
10623 {
10624 #ifdef DEVELOPER
10625 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10626 {
10627 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10628 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10629 }
10630 #endif
10631 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified();
10632 }
10633 }
10634
10637 {
10638 int item_count = 0;
10640
10641 if (GetInventory().GetCargo() != NULL)
10642 {
10643 item_count = GetInventory().GetCargo().GetItemCount();
10644 }
10645
10646 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10647 {
10648 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10649 if (item)
10650 item_count += item.GetNumberOfItems();
10651 }
10652 return item_count;
10653 }
10654
10657 {
10658 float weight = 0;
10659 float wetness = 1;
10660 if (include_wetness)
10663 {
10664 weight = wetness * m_ConfigWeight;
10665 }
10667 {
10668 weight = 1;
10669 }
10670 return weight;
10671 }
10672
10673
10674
10676 {
10677 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10678 {
10679 GameInventory inv = GetInventory();
10680 array<EntityAI> items = new array<EntityAI>;
10682 for (int i = 0; i < items.Count(); i++)
10683 {
10685 if (item)
10686 {
10688 }
10689 }
10690 }
10691 }
10692
10693
10694
10695
10697 {
10698 float energy = 0;
10699 if (HasEnergyManager())
10700 {
10701 energy = GetCompEM().GetEnergy();
10702 }
10703 return energy;
10704 }
10705
10706
10708 {
10709 super.OnEnergyConsumed();
10710
10712 }
10713
10715 {
10716 super.OnEnergyAdded();
10717
10719 }
10720
10721
10723 {
10724 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10725 {
10727 {
10728 float energy_0to1 = GetCompEM().GetEnergy0To1();
10730 }
10731 }
10732 }
10733
10734
10736 {
10737 return ConfigGetFloat("heatIsolation");
10738 }
10739
10741 {
10743 }
10744
10746 {
10747 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10748 if (
GetGame().ConfigIsExisting(paramPath))
10750
10751 return 0.0;
10752 }
10753
10755 {
10756 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10757 if (
GetGame().ConfigIsExisting(paramPath))
10759
10760 return 0.0;
10761 }
10762
10763 override void SetWet(
float value,
bool allow_client =
false)
10764 {
10765 if (!IsServerCheck(allow_client))
10766 return;
10767
10770
10772
10773 m_VarWet = Math.Clamp(value, min, max);
10774
10776 {
10779 }
10780 }
10781
10782 override void AddWet(
float value)
10783 {
10785 }
10786
10788 {
10790 }
10791
10793 {
10795 }
10796
10798 {
10800 }
10801
10803 {
10805 }
10806
10808 {
10810 }
10811
10812 override void OnWetChanged(
float newVal,
float oldVal)
10813 {
10816 if (newLevel != oldLevel)
10817 {
10819 }
10820 }
10821
10823 {
10824 SetWeightDirty();
10825 }
10826
10828 {
10829 return GetWetLevelInternal(
m_VarWet);
10830 }
10831
10832
10833
10835 {
10837 }
10838
10840 {
10842 }
10843
10845 {
10847 }
10848
10850 {
10852 }
10853
10854
10855
10857 {
10858 if (ConfigIsExisting("itemModelLength"))
10859 {
10860 return ConfigGetFloat("itemModelLength");
10861 }
10862 return 0;
10863 }
10864
10866 {
10867 if (ConfigIsExisting("itemAttachOffset"))
10868 {
10869 return ConfigGetFloat("itemAttachOffset");
10870 }
10871 return 0;
10872 }
10873
10874 override void SetCleanness(
int value,
bool allow_client =
false)
10875 {
10876 if (!IsServerCheck(allow_client))
10877 return;
10878
10880
10882
10885 }
10886
10888 {
10890 }
10891
10893 {
10894 return true;
10895 }
10896
10897
10898
10899
10901 {
10903 }
10904
10906 {
10908 }
10909
10910
10911
10912
10913 override void SetColor(
int r,
int g,
int b,
int a)
10914 {
10920 }
10922 override void GetColor(out
int r,out
int g,out
int b,out
int a)
10923 {
10928 }
10929
10931 {
10933 }
10934
10937 {
10938 int r,g,b,a;
10940 r = r/255;
10941 g = g/255;
10942 b = b/255;
10943 a = a/255;
10944 return MiscGameplayFunctions.GetColorString(r, g, b, a);
10945 }
10946
10947
10948
10949 override void SetLiquidType(
int value,
bool allow_client =
false)
10950 {
10951 if (!IsServerCheck(allow_client))
10952 return;
10953
10958 }
10959
10961 {
10962 return ConfigGetInt("varLiquidTypeInit");
10963 }
10964
10966 {
10968 }
10969
10971 {
10973 SetFrozen(false);
10974 }
10975
10978 {
10979 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10980 }
10981
10982
10985 {
10986 PlayerBase nplayer;
10987 if (PlayerBase.CastTo(nplayer, player))
10988 {
10990
10991 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
10992 }
10993 }
10994
10995
10998 {
10999 PlayerBase nplayer;
11000 if (PlayerBase.CastTo(nplayer,player))
11001 {
11002
11003 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11004
11005 }
11006
11007
11008 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11009
11010
11011 if (HasEnergyManager())
11012 {
11013 GetCompEM().UpdatePlugState();
11014 }
11015 }
11016
11017
11019 {
11020 super.OnPlacementStarted(player);
11021
11023 }
11024
11025 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11026 {
11028 {
11029 m_AdminLog.OnPlacementComplete(player,
this);
11030 }
11031
11032 super.OnPlacementComplete(player, position, orientation);
11033 }
11034
11035
11036
11037
11038
11040 {
11042 {
11043 return true;
11044 }
11045 else
11046 {
11047 return false;
11048 }
11049 }
11050
11051
11053 {
11055 {
11057 }
11058 }
11059
11060
11062 {
11064 }
11065
11067 {
11069 }
11070
11071 override void InsertAgent(
int agent,
float count = 1)
11072 {
11073 if (count < 1)
11074 return;
11075
11077 }
11078
11081 {
11083 }
11084
11085
11087 {
11089 }
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11133 {
11135 return false;
11136 return true;
11137 }
11138
11140 {
11141
11143 }
11144
11145
11148 {
11149 super.CheckForRoofLimited(timeTresholdMS);
11150
11152 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11153 {
11154 m_PreviousRoofTestTime = time;
11155 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11156 }
11157 }
11158
11159
11161 {
11163 {
11164 return 0;
11165 }
11166
11167 if (GetInventory().GetAttachmentSlotsCount() != 0)
11168 {
11169 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11170 if (filter)
11171 return filter.GetProtectionLevel(type, false, system);
11172 else
11173 return 0;
11174 }
11175
11176 string subclassPath, entryName;
11177
11178 switch (type)
11179 {
11181 entryName = "biological";
11182 break;
11184 entryName = "chemical";
11185 break;
11186 default:
11187 entryName = "biological";
11188 break;
11189 }
11190
11191 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11192
11194 }
11195
11196
11197
11200 {
11201 if (!IsMagazine())
11203
11205 }
11206
11207
11208
11209
11210
11215 {
11216 return true;
11217 }
11218
11220 {
11222 }
11223
11224
11225
11226
11227
11229 {
11230 if (parent)
11231 {
11232 if (parent.IsInherited(DayZInfected))
11233 return true;
11234
11235 if (!parent.IsRuined())
11236 return true;
11237 }
11238
11239 return true;
11240 }
11241
11243 {
11244 if (!super.CanPutAsAttachment(parent))
11245 {
11246 return false;
11247 }
11248
11249 if (!IsRuined() && !parent.IsRuined())
11250 {
11251 return true;
11252 }
11253
11254 return false;
11255 }
11256
11258 {
11259
11260
11261
11262
11263 return super.CanReceiveItemIntoCargo(item);
11264 }
11265
11267 {
11268
11269
11270
11271
11272 GameInventory attachmentInv = attachment.GetInventory();
11274 {
11275 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11276 return false;
11277 }
11278
11279 InventoryLocation loc = new InventoryLocation();
11280 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11281 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11282 return false;
11283
11284 return super.CanReceiveAttachment(attachment, slotId);
11285 }
11286
11288 {
11289 if (!super.CanReleaseAttachment(attachment))
11290 return false;
11291
11292 return GetInventory().AreChildrenAccessible();
11293 }
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11316 {
11317 int id = muzzle_owner.GetMuzzleID();
11318 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11319
11320 if (WPOF_array)
11321 {
11322 for (int i = 0; i < WPOF_array.Count(); i++)
11323 {
11324 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11325
11326 if (WPOF)
11327 {
11328 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11329 }
11330 }
11331 }
11332 }
11333
11334
11336 {
11337 int id = muzzle_owner.GetMuzzleID();
11339
11340 if (WPOBE_array)
11341 {
11342 for (int i = 0; i < WPOBE_array.Count(); i++)
11343 {
11344 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11345
11346 if (WPOBE)
11347 {
11348 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11349 }
11350 }
11351 }
11352 }
11353
11354
11356 {
11357 int id = muzzle_owner.GetMuzzleID();
11358 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11359
11360 if (WPOOH_array)
11361 {
11362 for (int i = 0; i < WPOOH_array.Count(); i++)
11363 {
11364 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11365
11366 if (WPOOH)
11367 {
11368 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11369 }
11370 }
11371 }
11372 }
11373
11374
11376 {
11377 int id = muzzle_owner.GetMuzzleID();
11378 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11379
11380 if (WPOOH_array)
11381 {
11382 for (int i = 0; i < WPOOH_array.Count(); i++)
11383 {
11384 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11385
11386 if (WPOOH)
11387 {
11388 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11389 }
11390 }
11391 }
11392 }
11393
11394
11396 {
11397 int id = muzzle_owner.GetMuzzleID();
11398 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11399
11400 if (WPOOH_array)
11401 {
11402 for (int i = 0; i < WPOOH_array.Count(); i++)
11403 {
11404 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11405
11406 if (WPOOH)
11407 {
11408 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11409 }
11410 }
11411 }
11412 }
11413
11414
11415
11417 {
11419 {
11420 return true;
11421 }
11422
11423 return false;
11424 }
11425
11427 {
11429 {
11430 return true;
11431 }
11432
11433 return false;
11434 }
11435
11437 {
11439 {
11440 return true;
11441 }
11442
11443 return false;
11444 }
11445
11447 {
11448 return false;
11449 }
11450
11453 {
11454 return UATimeSpent.DEFAULT_DEPLOY;
11455 }
11456
11457
11458
11459
11461 {
11463 SetSynchDirty();
11464 }
11465
11467 {
11469 }
11470
11471
11473 {
11474 return false;
11475 }
11476
11479 {
11480 string att_type = "None";
11481
11482 if (ConfigIsExisting("soundAttType"))
11483 {
11484 att_type = ConfigGetString("soundAttType");
11485 }
11486
11488 }
11489
11491 {
11493 }
11494
11495
11496
11497
11498
11504
11506 {
11509
11511 }
11512
11513
11515 {
11517 return;
11518
11520
11523
11526
11527 SoundParameters params = new SoundParameters();
11531 }
11532
11533
11535 {
11537 return;
11538
11540 SetSynchDirty();
11541
11544 }
11545
11546
11548 {
11550 return;
11551
11553 SetSynchDirty();
11554
11557 }
11558
11560 {
11562 }
11563
11565 {
11567 }
11568
11571 {
11572 if (!
GetGame().IsDedicatedServer())
11573 {
11574 if (ConfigIsExisting("attachSoundSet"))
11575 {
11576 string cfg_path = "";
11577 string soundset = "";
11578 string type_name =
GetType();
11579
11582 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11583 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11584
11585 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11586 {
11587 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11588 {
11589 if (cfg_slot_array[i] == slot_type)
11590 {
11591 soundset = cfg_soundset_array[i];
11592 break;
11593 }
11594 }
11595 }
11596
11597 if (soundset != "")
11598 {
11599 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11601 }
11602 }
11603 }
11604 }
11605
11607 {
11608
11609 }
11610
11611 void OnApply(PlayerBase player);
11612
11614 {
11615 return 1.0;
11616 };
11617
11619 {
11621 }
11622
11624 {
11626 }
11627
11629
11631 {
11632 SetDynamicPhysicsLifeTime(0.01);
11634 }
11635
11637 {
11638 array<string> zone_names = new array<string>;
11639 GetDamageZones(zone_names);
11640 for (int i = 0; i < zone_names.Count(); i++)
11641 {
11642 SetHealthMax(zone_names.Get(i),"Health");
11643 }
11644 SetHealthMax("","Health");
11645 }
11646
11649 {
11650 float global_health = GetHealth01("","Health");
11651 array<string> zones = new array<string>;
11652 GetDamageZones(zones);
11653
11654 for (int i = 0; i < zones.Count(); i++)
11655 {
11656 SetHealth01(zones.Get(i),"Health",global_health);
11657 }
11658 }
11659
11662 {
11663 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11664 }
11665
11667 {
11668 if (!hasRootAsPlayer)
11669 {
11670 if (refParentIB)
11671 {
11672
11673 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11674 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11675
11676 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11677 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11678
11681 }
11682 else
11683 {
11684
11687 }
11688 }
11689 }
11690
11692 {
11694 {
11695 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11696 if (
GetTemperature() != target || !IsFreezeThawProgressFinished())
11697 {
11698 float heatPermCoef = 1.0;
11700 while (ent)
11701 {
11702 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11703 ent = ent.GetHierarchyParent();
11704 }
11705
11706 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11707 }
11708 }
11709 }
11710
11712 {
11713
11714 EntityAI parent = GetHierarchyParent();
11715 if (!parent)
11716 {
11717 hasParent = false;
11718 hasRootAsPlayer = false;
11719 }
11720 else
11721 {
11722 hasParent = true;
11723 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11724 refParentIB =
ItemBase.Cast(parent);
11725 }
11726 }
11727
11728 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11729 {
11730
11731 }
11732
11734 {
11735
11736 return false;
11737 }
11738
11740 {
11741
11742
11743 return false;
11744 }
11745
11747 {
11748
11749 return false;
11750 }
11751
11754 {
11755 return !GetIsFrozen() &&
IsOpen();
11756 }
11757
11759 {
11760 bool hasParent = false, hasRootAsPlayer = false;
11762
11763 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11764 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11765
11766 if (wwtu || foodDecay)
11767 {
11771
11772 if (processWetness || processTemperature || processDecay)
11773 {
11775
11776 if (processWetness)
11777 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11778
11779 if (processTemperature)
11781
11782 if (processDecay)
11783 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11784 }
11785 }
11786 }
11787
11790 {
11792 }
11793
11795 {
11798
11799 return super.GetTemperatureFreezeThreshold();
11800 }
11801
11803 {
11806
11807 return super.GetTemperatureThawThreshold();
11808 }
11809
11811 {
11814
11815 return super.GetItemOverheatThreshold();
11816 }
11817
11819 {
11821 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
11822
11823 return super.GetTemperatureFreezeTime();
11824 }
11825
11827 {
11829 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
11830
11831 return super.GetTemperatureThawTime();
11832 }
11833
11838
11840 {
11841 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
11842 }
11843
11845 {
11846 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
11847 }
11848
11851 {
11853 }
11854
11856 {
11858 }
11859
11861 {
11863 }
11864
11867 {
11868 return null;
11869 }
11870
11873 {
11874 return false;
11875 }
11876
11878 {
11880 {
11883 if (!trg)
11884 {
11886 explosive = this;
11887 }
11888
11889 explosive.PairRemote(trg);
11891
11892 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
11893 trg.SetPersistentPairID(persistentID);
11894 explosive.SetPersistentPairID(persistentID);
11895
11896 return true;
11897 }
11898 return false;
11899 }
11900
11903 {
11904 float ret = 1.0;
11907 ret *= GetHealth01();
11908
11909 return ret;
11910 }
11911
11912 #ifdef DEVELOPER
11913 override void SetDebugItem()
11914 {
11915 super.SetDebugItem();
11916 _itemBase = this;
11917 }
11918
11920 {
11921 string text = super.GetDebugText();
11922
11924 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
11925
11926 return text;
11927 }
11928 #endif
11929
11931 {
11932 return true;
11933 }
11934
11936
11938
11940 {
11943 }
11944
11945
11953
11969}
11970
11972{
11974 if (entity)
11975 {
11976 bool is_item = entity.IsInherited(
ItemBase);
11977 if (is_item && full_quantity)
11978 {
11981 }
11982 }
11983 else
11984 {
11986 return NULL;
11987 }
11988 return entity;
11989}
11990
11992{
11993 if (item)
11994 {
11995 if (health > 0)
11996 item.SetHealth("", "", health);
11997
11998 if (item.CanHaveTemperature())
11999 {
12001 if (item.CanFreeze())
12002 item.SetFrozen(false);
12003 }
12004
12005 if (item.HasEnergyManager())
12006 {
12007 if (quantity >= 0)
12008 {
12009 item.GetCompEM().SetEnergy0To1(quantity);
12010 }
12011 else
12012 {
12014 }
12015 }
12016 else if (item.IsMagazine())
12017 {
12018 Magazine mag = Magazine.Cast(item);
12019 if (quantity >= 0)
12020 {
12021 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12022 }
12023 else
12024 {
12026 }
12027
12028 }
12029 else
12030 {
12031 if (quantity >= 0)
12032 {
12033 item.SetQuantityNormalized(quantity, false);
12034 }
12035 else
12036 {
12038 }
12039
12040 }
12041 }
12042}
12043
12044#ifdef DEVELOPER
12046#endif
Param4< int, int, string, int > TSelectableActionInfoWithColor
Param3 TSelectableActionInfo
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
eBleedingSourceType GetType()
ItemSuppressor SuppressorBase
void ActionManagerBase(PlayerBase player)
map< typename, ref array< ActionBase_Basic > > TInputActionMap
void AddAction(typename actionName)
void RemoveAction(typename actionName)
TInputActionMap m_InputActionMap
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
const int ECE_PLACE_ON_SURFACE
proto native void SpawnEntity(string sClassName, vector vPos, float fRange, int iCount)
Spawn an entity through CE.
const int ECE_IN_INVENTORY
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PlayerSpawnPreset slotName
Open
Implementations only.
override void EEOnCECreate()
DamageType
exposed from C++ (do not change)
PluginAdminLog m_AdminLog
override bool IsExplosive()
override bool CanHaveTemperature()
class GP5GasMask extends MaskBase ItemBase
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocationType
types of Inventory Location
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
bool DamageItemInCargo(float damage)
static bool HasDebugActionsMask(int mask)
bool HidesSelectionBySlot()
void SplitItem(PlayerBase player)
void CopyScriptPropertiesFrom(EntityAI oldItem)
override void InsertAgent(int agent, float count=1)
override float GetQuantityNormalized()
Gets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
static void SetDebugActionsMask(int mask)
void SetIsDeploySound(bool is_deploy_sound)
void SplitItemToInventoryLocation(notnull InventoryLocation dst)
override bool IsHeavyBehaviour()
override void SetWetMax()
bool IsCoverFaceForShave(string slot_name)
DEPRECATED in use, but returns correct values nontheless. Check performed elsewhere.
void ClearStartItemSoundServer()
void ProcessItemTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
map< typename, ref ActionOverrideData > TActionAnimOverrideMap
override void RemoveAllAgentsExcept(int agent_to_keep)
static ref map< int, ref array< ref WeaponParticlesOnBulletCasingEject > > m_OnBulletCasingEjectEffect
bool CanBeMovedOverride()
override void SetWet(float value, bool allow_client=false)
ref TIntArray m_SingleUseActions
override void ProcessVariables()
ref TStringArray m_HeadHidingSelections
float GetWeightSpecialized(bool forceRecalc=false)
bool LoadAgents(ParamsReadContext ctx, int version)
void UpdateQuickbarShortcutVisibility(PlayerBase player)
To be called on moving item within character's inventory; 'player' should never be null.
void OverrideActionAnimation(typename action, int commandUID, int stanceMask=-1, int commandUIDProne=-1)
ref array< ref OverheatingParticle > m_OverheatingParticles
override float GetTemperatureFreezeThreshold()
bool m_IsSoundSynchRemote
void StopItemSoundServer(int id)
static void ToggleDebugActionsMask(int mask)
void IncreaseOverheating(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetTemperatureFreezeTime()
ref array< int > m_CompatibleLocks
override void CombineItemsClient(EntityAI entity2, bool use_stack_max=true)
float m_TemperaturePerQuantityWeight
bool m_RecipesInitialized
void SplitIntoStackMax(EntityAI destination_entity, int slot_id, PlayerBase player)
override float GetTemperatureThawThreshold()
override void OnEnergyConsumed()
void RefreshAudioVisualsOnClient(CookingMethodType cooking_method, bool is_done, bool is_empty, bool is_burned)
cooking-related effect methods
int GetNumberOfItems()
Returns the number of items in cargo, otherwise returns 0(non-cargo objects). Recursive.
override EWetnessLevel GetWetLevel()
float GetSingleInventoryItemWeight()
ref TIntArray m_InteractActions
void MessageToOwnerStatus(string text)
Send message to owner player in grey color.
bool CanPlayDeployLoopSound()
override float GetWetMax()
bool CanBeUsedForSuicide()
override void CombineItemsEx(EntityAI entity2, bool use_stack_max=true)
void OnItemInHandsPlayerSwimStart(PlayerBase player)
void SetIsHologram(bool is_hologram)
void OnSyncVariables(ParamsReadContext ctx)
DEPRECATED (most likely)
void StartItemSoundServer(int id)
static ref map< int, ref array< ref WeaponParticlesOnFire > > m_OnFireEffect
void SplitIntoStackMaxCargoClient(EntityAI destination_entity, int idx, int row, int col)
bool m_CanBeMovedOverride
override string ChangeIntoOnAttach(string slot)
void UpdateOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
ScriptedLightBase GetLight()
string GetPlaceSoundset()
bool AddQuantity(float value, bool destroy_config=true, bool destroy_forced=false)
add item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
override float GetQuantity()
int m_ShotsToStartOverheating
override void OnWetChanged(float newVal, float oldVal)
void StopOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
static void PlayFireParticles(ItemBase weapon, int muzzle_index, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void OnOverheatingDecay()
float GetDryingIncrement(string pIncrementName)
void SoundSynchRemoteReset()
bool HasMuzzle()
Returns true if this item has a muzzle (weapons, suppressors)
override bool CanReleaseAttachment(EntityAI attachment)
override void OnMovedInsideCargo(EntityAI container)
void SetCEBasedQuantity()
bool m_CanPlayImpactSound
override string GetAttachmentSoundType()
float GetOverheatingCoef()
array< string > GetHeadHidingSelection()
void PlayAttachSound(string slot_type)
Plays sound on item attach. Be advised, the config structure may slightly change in 1....
override bool IsStoreLoad()
int ComputeQuantityUsed(ItemBase other_item, bool use_stack_max=true)
void SetResultOfSplit(bool value)
void SplitIntoStackMaxCargo(EntityAI destination_entity, int idx, int row, int col)
void OnAttachmentQuantityChanged(ItemBase item)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
void UpdateAllOverheatingParticles()
float GetSoakingIncrement(string pIncrementName)
static void StopOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override float GetStoreLoadedQuantity()
const int ITEM_SOUNDS_MAX
float GetItemModelLength()
override bool ReadVarsFromCTX(ParamsReadContext ctx, int version=-1)
override void CheckForRoofLimited(float timeTresholdMS=3000)
Roof check for entity, limited by time (anti-spam solution)
void CombineItems(ItemBase other_item, bool use_stack_max=true)
void TransferModifiers(PlayerBase reciever)
appears to be deprecated, legacy code
float GetTemperaturePerQuantityWeight()
Used in heat comfort calculations only!
void TransferAgents(int agents)
transfer agents from another item
bool CanBeConsumed(ConsumeConditionData data=null)
Items cannot be consumed if frozen by default. Override for exceptions.
float GetHeatIsolationInit()
void SetCanBeMovedOverride(bool setting)
override bool HasQuantity()
bool IsCargoException4x3(EntityAI item)
ref TIntArray m_ContinuousActions
int GetMuzzleID()
Returns global muzzle ID. If not found, then it gets automatically registered.
void LoadParticleConfigOnFire(int id)
void PreLoadSoundAttachmentType()
Attachment Sound Type getting from config file.
override float GetWetInit()
int m_ImpactSoundSurfaceHash
int m_MaxOverheatingValue
void SetupSpawnedItem(ItemBase item, float health, float quantity)
bool ShouldSplitQuantity(float quantity)
static ref map< string, int > m_WeaponTypeToID
string GetColorString()
Returns item's PROCEDURAL color as formated string, i.e. "#(argb,8,8,3)color(0.15,...
array< int > GetValidFinishers()
returns an array of possible finishers
void OnAttachmentQuantityChangedEx(ItemBase item, float delta)
Called on server side when some attachment's quantity is changed. Call super.OnAttachmentQuantityChan...
class ItemBase extends InventoryItem SpawnItemOnLocation(string object_name, notnull InventoryLocation loc, bool full_quantity)
ItemSoundHandler GetItemSoundHandler()
override int GetQuantityMin()
void SplitIntoStackMaxToInventoryLocationClient(notnull InventoryLocation dst)
override int GetQuickBarBonus()
override void SetTakeable(bool pState)
float m_OverheatingDecayInterval
void SetIsPlaceSound(bool is_place_sound)
override void SplitIntoStackMaxClient(EntityAI destination_entity, int slot_id)
void HierarchyCheck(out bool hasParent, out bool hasRootAsPlayer, out ItemBase refParentIB)
void RemoveAudioVisualsOnClient()
static void AddDebugActionsMask(int mask)
void PlayDeployLoopSoundEx()
void RemoveLightSourceItem()
bool CanRepair(ItemBase item_repair_kit)
bool can_this_be_combined
EffectSound m_SoundDeploy
float GetBaitEffectivity()
generic effectivity as a bait for animal catching
float GetDeployTime()
how long it takes to deploy this item in seconds
override bool IsSplitable()
bool DamageItemAttachments(float damage)
override void WriteVarsToCTX(ParamsWriteContext ctx)
void ConvertEnergyToQuantity()
override void RemoveAllAgents()
override void SetQuantityToMinimum()
bool m_WantPlayImpactSound
override float GetTemperatureThawTime()
ref map< int, ref array< ref WeaponParticlesOnOverheating > > m_OnOverheatingEffect
float m_StoreLoadedQuantity
void MessageToOwnerAction(string text)
Send message to owner player in yellow color.
float GetFilterDamageRatio()
override void SetLiquidType(int value, bool allow_client=false)
void OnQuantityChanged(float delta)
Called on server side when this item's quantity is changed. Call super.OnQuantityChanged(); first whe...
void OnApply(PlayerBase player)
override void SetQuantityNormalized(float value, bool destroy_config=true, bool destroy_forced=false)
Sets quantity in normalized 0..1 form between the item's Min a Max values as defined by item's config...
bool m_HideSelectionsBySlot
bool IsOverheatingEffectActive()
void SetIsBeingPlaced(bool is_being_placed)
int GetLiquidContainerMask()
void SetInventoryLocationToVicinityOrCurrent(EntityAI root, inout InventoryLocation dst)
ref Timer m_CheckOverheating
void RegisterOverheatingParticle(Particle p, float min_heat_coef, float max_heat_coef, int particle_id, Object parent, vector local_pos, vector local_ori)
bool GetActionWidgetOverride(out typename name)
If we need a different (handheld)item action widget displayed, the logic goes in here.
float GetUnitWeight(bool include_wetness=true)
Obsolete, use GetWeightEx instead.
void SetZoneDamageCEInit()
Sets zone damages to match randomized global health set by CE (CE spawn only)
static void PlayOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override bool IsOneHandedBehaviour()
void AddLightSourceItem(ItemBase lightsource)
Adds a light source child.
FoodStage GetFoodStage()
overridden on Edible_Base; so we don't have to parse configs all the time
override float GetSingleInventoryItemWeightEx()
void SaveAgents(ParamsWriteContext ctx)
override int GetTargetQuantityMax(int attSlotID=-1)
float GetDisinfectQuantity(int system=0, Param param1=null)
override bool IsHologram()
float GetItemAttachOffset()
static int GetDebugActionsMask()
void ProcessDecay(float delta, bool hasRootAsPlayer)
override bool IsItemBase()
override bool IsTwoHandedBehaviour()
bool IsCombineAll(ItemBase other_item, bool use_stack_max=false)
float GetProtectionLevel(int type, bool consider_filter=false, int system=0)
static void PlayBulletCasingEjectParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
override void OnEnergyAdded()
void AffectLiquidContainerOnFill(int liquid_type, float amount)
from enviro source
void AffectLiquidContainerOnTransfer(int liquidType, float amount, float sourceLiquidTemperature)
from other liquid container source
string GetExplosiveTriggerSlotName()
EffectSound m_DeployLoopSoundEx
override void DeSerializeNumericalVars(array< float > floats)
void StopItemDynamicPhysics()
override void SetStoreLoad(bool value)
float GetOverheatingValue()
bool ContainsAgent(int agent_id)
override void AddWet(float value)
override void EOnContact(IEntity other, Contact extra)
void SplitIntoStackMaxHands(PlayerBase player)
void SplitIntoStackMaxHandsClient(PlayerBase player)
ref Timer m_PhysDropTimer
void MessageToOwnerFriendly(string text)
Send message to owner player in green color.
override void SetStoreLoadedQuantity(float value)
bool m_IsResultOfSplit string m_SoundAttType
distinguish if item has been created as new or it came from splitting (server only flag)
void CheckOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void UnlockFromParent()
Unlocks this item from its attachment slot of its parent.
bool Repair(PlayerBase player, ItemBase item_repair_kit, float specialty_weight)
void OnLiquidTypeChanged(int oldType, int newType)
void StartOverheating(ItemBase weapon=null, string ammoType="", ItemBase muzzle_owner=null, ItemBase suppressor=null, string config_to_search="")
void PlayDeployFinishSound()
bool AllowFoodConsumption()
bool m_IsOverheatingEffectActive
int m_LiquidContainerMask
void ProcessItemWetness(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override int GetCleanness()
bool PairWithDevice(notnull ItemBase otherDevice)
static void RemoveDebugActionsMask(int mask)
static void UpdateOverheatingParticles(ItemBase weapon, string ammoType, ItemBase muzzle_owner, ItemBase suppressor, string config_to_search)
void PerformDamageSystemReinit()
override void ClearInventory()
static int m_LastRegisteredWeaponID
ItemBase GetLightSourceItem()
void MessageToOwnerImportant(string text)
Send message to owner player in red color.
override float GetItemOverheatThreshold()
void StopDeployLoopSoundEx()
override void SerializeNumericalVars(array< float > floats_out)
ItemBase SplitIntoStackMaxToInventoryLocationEx(notnull InventoryLocation dst)
static int m_DebugActionsMask
void KillAllOverheatingParticles()
bool CanBeCookedOnStick()
override int GetQuantityMax()
void GetRecipesActions(Man player, out TSelectableActionInfoArray outputList)
void OnActivatedByTripWire()
override void RemoveAgent(int agent_id)
bool m_ItemBeingDroppedPhys
override bool CanPutAsAttachment(EntityAI parent)
void PlayDetachSound(string slot_type)
static ref map< typename, ref TInputActionMap > m_ItemTypeActionsMap
void ProcessItemWetnessAndTemperature(float delta, bool hasParent, bool hasRootAsPlayer, ItemBase refParentIB)
override bool IsBeingPlaced()
float ComputeQuantityUsedEx(ItemBase other_item, bool use_stack_max=true)
bool m_FixDamageSystemInit
string GetDeployFinishSoundset()
ItemBase m_LightSourceItem
void LockToParent()
Locks this item in it's current attachment slot of its parent. This makes the "locked" icon visible i...
override void SplitIntoStackMaxEx(EntityAI destination_entity, int slot_id)
void LoadParticleConfigOnOverheating(int id)
bool IsSoundSynchRemote()
override void OnRightClick()
static ref map< typename, ref TActionAnimOverrideMap > m_ItemActionOverrides
bool IsActionTargetVisible()
override void OnItemAttachmentSlotChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
int NameToID(string name)
override void OnWetLevelChanged(EWetnessLevel newLevel, EWetnessLevel oldLevel)
void ClearStopItemSoundServer()
override string ChangeIntoOnDetach()
void SplitIntoStackMaxToInventoryLocation(notnull InventoryLocation dst)
EffectSound m_SoundDeployFinish
float GetQuantityNormalizedScripted()
override void SetCleanness(int value, bool allow_client=false)
override float GetWetMin()
ref ItemSoundHandler m_ItemSoundHandler
override bool KindOf(string tag)
void ItemSoundHandler(ItemBase parent)
EffectSound m_LockingSound
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
override RemotelyActivatedItemBehaviour GetRemotelyActivatedItemBehaviour()
void RemoteDetonatorTrigger()
override void OnActivatedByItem(notnull ItemBase item)
Called when this item is activated by other.
override void Explode(int damageType, string ammoType="")
void OnItemLocationChanged(ItemBase item)
void OnItemAttachedAtPlayer(EntityAI item, string slot_name)
proto native UIManager GetUIManager()
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override ScriptCallQueue GetCallQueue(int call_category)
proto native void GizmoSelectObject(Object object)
proto native bool ConfigIsExisting(string path)
proto native void ConfigGetTextArray(string path, out TStringArray values)
Get array of strings from config on path.
proto native DayZPlayer GetPlayer()
proto native void GizmoSelectPhysics(Physics physics)
proto int GetTime()
returns mission time in milliseconds
proto native int ConfigGetType(string path)
Returns type of config value.
AnalyticsManagerClient GetAnalyticsClient()
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
proto native void ObjectDelete(Object obj)
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
void SetEnergy0To1(float energy01)
Energy manager: Sets stored energy for this device between 0 and MAX based on relative input value be...
float GetEnergyMaxPristine()
Energy manager: Returns the maximum amount of energy this device can store. It's damage is NOT taken ...
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
bool IsSoundPlaying()
Get whether EffectSound is currently playing.
proto native bool EnumerateInventory(InventoryTraversalType tt, out array< EntityAI > items)
enumerate inventory using traversal type and filling items array
proto native CargoBase GetCargo()
cargo
proto native bool IsValid()
verify current set inventory location
proto native EntityAI GetParent()
returns parent of current inventory location
proto native int GetSlot()
returns slot id if current type is Attachment
proto native int GetCol()
returns column of cargo if current type is Cargo / ProxyCargo
proto native int GetRow()
returns row of cargo if current type is Cargo / ProxyCargo
bool WriteToContext(ParamsWriteContext ctx)
proto native int GetType()
returns type of InventoryLocation
proto native int GetIdx()
returns index of cargo if current type is Cargo / ProxyCargo
proto native void SetCargo(notnull EntityAI parent, EntityAI e, int idx, int row, int col, bool flip)
sets current inventory location type to Cargo with coordinates (idx, row, col)
proto native bool GetFlip()
returns flip status of cargo
proto native EntityAI GetItem()
returns item of current inventory location
override bool CanDisplayCargo()
override void OnInventoryEnter(Man player)
override string GetFoldSoundset()
override bool CanPutAsAttachment(EntityAI parent)
override bool CanReceiveItemIntoCargo(EntityAI item)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnWasDetached(EntityAI parent, int slot_id)
override void EEOnAfterLoad()
override void EEDelete(EntityAI parent)
override bool CanBeRepairedByCrafting()
override void OnPlacementStarted(Man player)
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
override bool IsElectricAppliance()
override bool IsItemTent()
override void SetActions()
override string GetLoopFoldSoundset()
override bool CanMakeGardenplot()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
override WrittenNoteData GetWrittenNoteData()
override int GetDamageSystemVersionChange()
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
override void InitItemVariables()
override void SetActionAnimOverrides()
override void OnCreatePhysics()
override string GetDeploySoundset()
override float GetBandagingEffectivity()
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
override void OnStoreSave(ParamsWriteContext ctx)
override void AfterStoreLoad()
override int GetOnDigWormsAmount()
override bool IsSelfAdjustingTemperature()
override bool IsPlayerInside(PlayerBase player, string selection)
override void OnVariablesSynchronized()
override void RefreshPhysics()
override bool CanObstruct()
override void OnWasAttached(EntityAI parent, int slot_id)
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override bool CanPutInCargo(EntityAI parent)
override string GetLoopDeploySoundset()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
override void OnInventoryExit(Man player)
override bool IsTakeable()
override bool IsIgnoredByConstruction()
override void InitItemSounds()
override void EEKilled(Object killer)
override void OnCombine(ItemBase other_item)
override bool CanExplodeInFire()
override bool IsFacingPlayer(PlayerBase player, string selection)
override bool CanBeCombined(EntityAI other_item, bool reservation_check=true, bool stack_max_limit=false)
override bool IsBloodContainer()
override bool IsClothing()
override bool CanBeSplit()
override bool IsDeployable()
override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
override bool CanBeDisinfected()
override float GetInfectionChance(int system=0, Param param=null)
override void OnEndPlacement()
float GetOverheatingLimitMax()
void SetOverheatingLimitMax(float max)
void SetParticleParams(int particle_id, Object parent, vector local_pos, vector local_ori)
float GetOverheatingLimitMin()
void SetOverheatingLimitMin(float min)
void RegisterParticle(Particle p)
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
void SetControlledDevice(EntityAI pDevice)
bool OnStoreLoad(ParamsReadContext ctx, int version)
void OnStoreSave(ParamsWriteContext ctx)
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
proto native float GetDamage(string zoneName, string healthType)
UIScriptedMenu FindMenu(int id)
Returns menu with specific ID if it is open (see MenuID)
void SetCalcDetails(string details)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Serializer ParamsReadContext
InventoryTraversalType
tree traversal type, for more see http://en.wikipedia.org/wiki/Tree_traversal
proto native CGame GetGame()
Serializer ParamsWriteContext
const int COMP_TYPE_ENERGY_MANAGER
void Error(string err)
Messagebox with error message.
proto native void SetColor(int color)
array< string > TStringArray
EntityEvent
Entity events for event-mask, or throwing event from code.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
const int VARIABLE_LIQUIDTYPE
const int VARIABLE_CLEANNESS
const int VARIABLE_TEMPERATURE
const int VARIABLE_QUANTITY
static proto float AbsFloat(float f)
Returns absolute value.
proto native bool dBodyIsDynamic(notnull IEntity ent)
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.