7391{
7393 {
7394 return true;
7395 }
7396};
7397
7398
7399
7401{
7405
7407
7410
7411
7412
7413
7414
7423
7429
7434
7439
7460 protected bool m_IsResultOfSplit
7461
7463
7468
7469
7470
7472
7476
7477
7478
7480
7483
7484
7485
7491
7492
7500
7503
7504
7506
7507
7509
7510
7515
7516
7521
7522
7524
7525
7527 {
7532
7533 if (!
GetGame().IsDedicatedServer())
7534 {
7536 {
7538
7540 {
7542 }
7543 }
7544
7547 }
7548
7549 m_OldLocation = null;
7550
7552 {
7554 }
7555
7556 if (ConfigIsExisting("headSelectionsToHide"))
7557 {
7560 }
7561
7563 if (ConfigIsExisting("hideSelectionsByinventorySlot"))
7564 {
7566 }
7567
7569
7570 m_IsResultOfSplit = false;
7571
7573 }
7574
7576 {
7577 super.InitItemVariables();
7578
7584 m_Count = ConfigGetInt(
"count");
7585
7588
7593
7596
7601
7613
7617
7618
7621 if (ConfigIsExisting("canBeSplit"))
7622 {
7625 }
7626
7628 if (ConfigIsExisting("itemBehaviour"))
7630
7631
7634 RegisterNetSyncVariableInt("m_VarLiquidType");
7635 RegisterNetSyncVariableInt("m_Cleanness",0,1);
7636
7637 RegisterNetSyncVariableBoolSignal("m_WantPlayImpactSound");
7638 RegisterNetSyncVariableFloat("m_ImpactSpeed");
7639 RegisterNetSyncVariableInt("m_ImpactSoundSurfaceHash");
7640
7641 RegisterNetSyncVariableInt("m_ColorComponentR", 0, 255);
7642 RegisterNetSyncVariableInt("m_ColorComponentG", 0, 255);
7643 RegisterNetSyncVariableInt("m_ColorComponentB", 0, 255);
7644 RegisterNetSyncVariableInt("m_ColorComponentA", 0, 255);
7645
7646 RegisterNetSyncVariableBool("m_IsBeingPlaced");
7647 RegisterNetSyncVariableBool("m_IsTakeable");
7648 RegisterNetSyncVariableBool("m_IsHologram");
7649
7652 {
7655 }
7656
7658
7660 if (ConfigIsExisting("temperaturePerQuantityWeight"))
7662
7663 }
7664
7666 {
7668 }
7669
7671 {
7674 {
7679 }
7680 }
7681
7682 override void GetActions(
typename action_input_type, out array<ActionBase_Basic> actions)
7683 {
7685 {
7688 }
7689
7691 }
7692
7694 {
7700 }
7701
7703
7705 {
7707
7708 if (!action)
7709 {
7710 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
7711 return;
7712 }
7713
7715 if (!ai)
7716 {
7718 return;
7719 }
7720
7722 if (!action_array)
7723 {
7724 action_array = new array<ActionBase_Basic>;
7726 }
7727 if (LogManager.IsActionLogEnable())
7728 {
7729 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action");
7730 }
7731
7732 if (action_array.Find(action) != -1)
7733 {
7734 Debug.Log(
"Action " + action.Type() +
" already added to " +
this +
", skipping!");
7735 }
7736 else
7737 {
7738 action_array.Insert(action);
7739 }
7740 }
7741
7743 {
7745 ActionBase action = player.GetActionManager().GetAction(actionName);
7748
7749 if (action_array)
7750 {
7751 action_array.RemoveItem(action);
7752 }
7753 }
7754
7755
7756
7758 {
7759 ActionOverrideData overrideData = new ActionOverrideData();
7763
7765 if (!actionMap)
7766 {
7769 }
7770
7771 actionMap.Insert(this.
Type(), overrideData);
7772
7773 }
7774
7776
7778
7779
7781 {
7784
7787
7788 string config_to_search = "CfgVehicles";
7789 string muzzle_owner_config;
7790
7792 {
7793 if (IsInherited(Weapon))
7794 config_to_search = "CfgWeapons";
7795
7796 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7797
7798 string config_OnFire_class = muzzle_owner_config + "Particles " + "OnFire ";
7799
7801
7802 if (config_OnFire_subclass_count > 0)
7803 {
7804 array<ref WeaponParticlesOnFire> WPOF_array = new array<ref WeaponParticlesOnFire>;
7805
7806 for (int i = 0; i < config_OnFire_subclass_count; i++)
7807 {
7808 string particle_class = "";
7810 string config_OnFire_entry = config_OnFire_class + particle_class;
7811 WeaponParticlesOnFire WPOF = new WeaponParticlesOnFire(this, config_OnFire_entry);
7812 WPOF_array.Insert(WPOF);
7813 }
7814
7815
7817 }
7818 }
7819
7821 {
7822 config_to_search = "CfgWeapons";
7823 muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7824
7825 string config_OnBulletCasingEject_class = muzzle_owner_config + "Particles " + "OnBulletCasingEject ";
7826
7828
7829 if (config_OnBulletCasingEject_count > 0 && IsInherited(Weapon))
7830 {
7831 array<ref WeaponParticlesOnBulletCasingEject> WPOBE_array = new array<ref WeaponParticlesOnBulletCasingEject>;
7832
7833 for (i = 0; i < config_OnBulletCasingEject_count; i++)
7834 {
7835 string particle_class2 = "";
7837 string config_OnBulletCasingEject_entry = config_OnBulletCasingEject_class + particle_class2;
7838 WeaponParticlesOnBulletCasingEject WPOBE = new WeaponParticlesOnBulletCasingEject(this, config_OnBulletCasingEject_entry);
7839 WPOBE_array.Insert(WPOBE);
7840 }
7841
7842
7844 }
7845 }
7846 }
7847
7848
7850 {
7853
7855 {
7856 string config_to_search = "CfgVehicles";
7857
7858 if (IsInherited(Weapon))
7859 config_to_search = "CfgWeapons";
7860
7861 string muzzle_owner_config = config_to_search +
" " +
GetType() +
" ";
7862 string config_OnOverheating_class = muzzle_owner_config + "Particles " + "OnOverheating ";
7863
7864 if (
GetGame().ConfigIsExisting(config_OnOverheating_class))
7865 {
7866
7868
7870 {
7872 string error =
"Error reading config " +
GetType() +
">Particles>OnOverheating - Parameter shotsToStartOverheating is configured wrong or is missing! Its value must be 1 or higher!";
7874 return;
7875 }
7876
7879
7880
7881
7883 array<ref WeaponParticlesOnOverheating> WPOOH_array = new array<ref WeaponParticlesOnOverheating>;
7884
7885 for (int i = 0; i < config_OnOverheating_subclass_count; i++)
7886 {
7887 string particle_class = "";
7889 string config_OnOverheating_entry = config_OnOverheating_class + particle_class;
7891
7892 if (entry_type == CT_CLASS)
7893 {
7894 WeaponParticlesOnOverheating WPOF = new WeaponParticlesOnOverheating(this, config_OnOverheating_entry);
7895 WPOOH_array.Insert(WPOF);
7896 }
7897 }
7898
7899
7901 }
7902 }
7903 }
7904
7906 {
7908 }
7909
7911 {
7913 {
7915
7918
7921
7922 CheckOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7923 }
7924 }
7925
7927 {
7929 UpdateOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7930
7932 StartOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7933
7935 StopOverheating(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7936
7938 {
7940 }
7941 }
7942
7944 {
7946 }
7947
7949 {
7952 else
7954
7956 {
7959 }
7960 else
7961 {
7964
7967 }
7968
7970 }
7971
7973 {
7975 ItemBase.PlayOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7976 }
7977
7979 {
7981 ItemBase.UpdateOverheatingParticles(
this, ammoType,
this, suppressor,
"CfgWeapons");
7983 }
7984
7986 {
7988 ItemBase.StopOverheatingParticles(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
7989 }
7990
7992 {
7995
7996 OverheatingParticle OP = new OverheatingParticle();
8001
8003 }
8004
8006 {
8009
8010 return -1;
8011 }
8012
8014 {
8016 {
8019
8020 for (int i = count; i > 0; --i)
8021 {
8022 int id = i - 1;
8025
8028
8029 if (overheat_coef < overheat_min && overheat_coef >= overheat_max)
8030 {
8031 if (p)
8032 {
8035 }
8036 }
8037 }
8038 }
8039 }
8040
8042 {
8044 {
8046 {
8047 int id = i - 1;
8049
8050 if (OP)
8051 {
8053
8054 if (p)
8055 {
8057 }
8058
8059 delete OP;
8060 }
8061 }
8062
8065 }
8066 }
8067
8070 {
8071 return 0.0;
8072 }
8073
8074
8076 {
8077 return 250;
8078 }
8079
8081 {
8082 return 0;
8083 }
8084
8087 {
8089 return true;
8090
8091 return false;
8092 }
8093
8096 {
8099
8101 {
8103 }
8104 else
8105 {
8106
8108 }
8109
8111 }
8112
8119 {
8120 return -1;
8121 }
8122
8123
8124
8125
8127 {
8129 {
8131 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8132
8133 if (r_index >= 0)
8134 {
8135 InventoryLocation r_il = new InventoryLocation;
8136 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8137
8138 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8141 {
8142 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8143 }
8145 {
8146 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8147 }
8148
8149 }
8150
8151 player.GetHumanInventory().ClearUserReservedLocation(this);
8152 }
8153
8156 }
8157
8158
8159
8160
8162 {
8163 return ItemBase.m_DebugActionsMask;
8164 }
8165
8167 {
8168 return ItemBase.m_DebugActionsMask & mask;
8169 }
8170
8172 {
8173 ItemBase.m_DebugActionsMask = mask;
8174 }
8175
8177 {
8178 ItemBase.m_DebugActionsMask |= mask;
8179 }
8180
8182 {
8183 ItemBase.m_DebugActionsMask &= ~mask;
8184 }
8185
8187 {
8189 {
8191 }
8192 else
8193 {
8195 }
8196 }
8197
8198
8200 {
8201 if (GetEconomyProfile())
8202 {
8203 float q_max = GetEconomyProfile().GetQuantityMax();
8204 if (q_max > 0)
8205 {
8206 float q_min = GetEconomyProfile().GetQuantityMin();
8207 float quantity_randomized = Math.RandomFloatInclusive(q_min, q_max);
8208
8210 {
8211 ComponentEnergyManager comp = GetCompEM();
8213 {
8215 }
8216 }
8218 {
8220
8221 }
8222
8223 }
8224 }
8225 }
8226
8229 {
8230 EntityAI parent = GetHierarchyParent();
8231
8232 if (parent)
8233 {
8234 InventoryLocation inventory_location_to_lock = new InventoryLocation;
8235 GetInventory().GetCurrentInventoryLocation(inventory_location_to_lock);
8236 parent.GetInventory().SetSlotLock(inventory_location_to_lock.
GetSlot(),
true);
8237 }
8238 }
8239
8242 {
8243 EntityAI parent = GetHierarchyParent();
8244
8245 if (parent)
8246 {
8247 InventoryLocation inventory_location_to_unlock = new InventoryLocation;
8248 GetInventory().GetCurrentInventoryLocation(inventory_location_to_unlock);
8249 parent.GetInventory().SetSlotLock(inventory_location_to_unlock.
GetSlot(),
false);
8250 }
8251 }
8252
8254 {
8255
8256
8257
8258
8260
8262 {
8263 if (ScriptInputUserData.CanStoreInputUserData())
8264 {
8265 ScriptInputUserData ctx = new ScriptInputUserData;
8271 ctx.
Write(use_stack_max);
8274
8276 {
8277 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(item2,null,GameInventory.c_InventoryReservationTimeoutShortMS);
8278 }
8279 }
8280 }
8281 else if (!
GetGame().IsMultiplayer())
8282 {
8284 }
8285 }
8286
8288 {
8290 }
8291
8293 {
8295 }
8296
8298 {
8300 }
8301
8303 {
8304
8305 return false;
8306 }
8307
8309 {
8310 return false;
8311 }
8312
8316 {
8317 return false;
8318 }
8319
8321 {
8322 return "";
8323 }
8324
8326
8328 {
8329 return false;
8330 }
8331
8333 {
8334 return true;
8335 }
8336
8337
8338
8340 {
8341 return true;
8342 }
8343
8345 {
8346 return true;
8347 }
8348
8350 {
8351 PlayerBase player = PlayerBase.Cast(
g_Game.GetPlayer());
8353 }
8354
8356 {
8358 }
8359
8361 {
8363 if (!is_being_placed)
8365 SetSynchDirty();
8366 }
8367
8368
8370
8372 {
8374 }
8375
8377 {
8379 }
8380
8382 {
8383 return 1;
8384 }
8385
8387 {
8388 return false;
8389 }
8390
8392 {
8394 SetSynchDirty();
8395 }
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8432 {
8433 super.OnMovedInsideCargo(container);
8434
8435 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8436 }
8437
8438 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
8439 {
8440 super.EEItemLocationChanged(oldLoc,newLoc);
8441
8442 PlayerBase new_player = null;
8443 PlayerBase old_player = null;
8444
8445 if (newLoc.GetParent())
8446 new_player = PlayerBase.Cast(newLoc.GetParent().GetHierarchyRootPlayer());
8447
8448 if (oldLoc.GetParent())
8449 old_player = PlayerBase.Cast(oldLoc.GetParent().GetHierarchyRootPlayer());
8450
8452 {
8453 int r_index = old_player.GetHumanInventory().FindUserReservedLocationIndex(this);
8454
8455 if (r_index >= 0)
8456 {
8457 InventoryLocation r_il = new InventoryLocation;
8458 old_player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8459
8460 old_player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8463 {
8464 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8465 }
8467 {
8468 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8469 }
8470
8471 }
8472 }
8473
8475 {
8476 if (new_player)
8477 new_player.ForceStandUpForHeavyItems(newLoc.GetItem());
8478
8479 if (new_player == old_player)
8480 {
8481
8482 if (oldLoc.GetParent() && new_player.GetHumanInventory().LocationGetEntity(oldLoc) == NULL)
8483 {
8485 {
8486 if (oldLoc.GetParent().GetInventory().TestAddEntityInCargoExLoc(oldLoc, false, false, false, true, false, false))
8487 {
8488 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8489 }
8490 }
8491 else
8492 {
8493 new_player.GetHumanInventory().SetUserReservedLocation(this,oldLoc);
8494 }
8495 }
8496
8497 if (new_player.GetHumanInventory().FindUserReservedLocationIndex(this) >= 0)
8498 {
8499 int type = oldLoc.GetType();
8501 {
8502 oldLoc.GetParent().GetOnSetLock().Invoke(this);
8503 }
8505 {
8506 oldLoc.GetParent().GetOnAttachmentSetLock().Invoke(this, oldLoc.GetSlot());
8507 }
8508 }
8509 if (!m_OldLocation)
8510 {
8511 m_OldLocation = new InventoryLocation;
8512 }
8513 m_OldLocation.Copy(oldLoc);
8514 }
8515 else
8516 {
8517 if (m_OldLocation)
8518 {
8519 m_OldLocation.Reset();
8520 }
8521 }
8522
8524 }
8525 else
8526 {
8527 if (new_player)
8528 {
8529 int res_index = new_player.GetHumanInventory().FindCollidingUserReservedLocationIndex(this, newLoc);
8530 if (res_index >= 0)
8531 {
8532 InventoryLocation il = new InventoryLocation;
8533 new_player.GetHumanInventory().GetUserReservedLocation(res_index,il);
8535 new_player.GetHumanInventory().ClearUserReservedLocationAtIndex(res_index);
8538 {
8539 il.
GetParent().GetOnReleaseLock().Invoke(it);
8540 }
8542 {
8544 }
8545
8546 }
8547 }
8549 {
8550
8552 }
8553
8554 if (m_OldLocation)
8555 {
8556 m_OldLocation.Reset();
8557 }
8558 }
8559 }
8560
8561 override void EOnContact(IEntity other, Contact extra)
8562 {
8564 {
8565 int liquidType = -1;
8567 if (impactSpeed > 0.0)
8568 {
8570 #ifndef SERVER
8572 #else
8574 SetSynchDirty();
8575 #endif
8577 }
8578 }
8579
8580 #ifdef SERVER
8581 if (GetCompEM() && GetCompEM().IsPlugged())
8582 {
8583 if (GetCompEM().GetCordLength() < vector.Distance(
GetPosition(), GetCompEM().GetEnergySource().
GetPosition()))
8584 GetCompEM().UnplugThis();
8585 }
8586 #endif
8587 }
8588
8590
8592 {
8594 }
8595
8597 {
8598
8599 }
8600
8602 {
8603 super.OnItemLocationChanged(old_owner, new_owner);
8604
8605 PlayerBase relatedPlayer = PlayerBase.Cast(old_owner);
8606 PlayerBase playerNew = PlayerBase.Cast(new_owner);
8607
8608 if (!relatedPlayer && playerNew)
8609 relatedPlayer = playerNew;
8610
8611 if (relatedPlayer && relatedPlayer.GetPerformedActionID() != -1)
8612 {
8614 if (actionMgr)
8615 {
8616 ActionBase currentAction = actionMgr.GetRunningAction();
8617 if (currentAction)
8619 }
8620 }
8621
8622 Man ownerPlayerOld = null;
8623 Man ownerPlayerNew = null;
8624
8625 if (old_owner)
8626 {
8627 if (old_owner.
IsMan())
8628 {
8629 ownerPlayerOld = Man.Cast(old_owner);
8630 }
8631 else
8632 {
8633 ownerPlayerOld = Man.Cast(old_owner.GetHierarchyRootPlayer());
8634 }
8635 }
8636 else
8637 {
8639 {
8641
8642 if (!action || !playerNew || playerNew.GetPerformedActionID() != action.
GetID())
8643 {
8644 GetCompEM().UnplugThis();
8645 }
8646 }
8647 }
8648
8649 if (new_owner)
8650 {
8651 if (new_owner.
IsMan())
8652 {
8653 ownerPlayerNew = Man.Cast(new_owner);
8654 }
8655 else
8656 {
8657 ownerPlayerNew = Man.Cast(new_owner.GetHierarchyRootPlayer());
8658 }
8659 }
8660
8661 if (ownerPlayerOld != ownerPlayerNew)
8662 {
8663 if (ownerPlayerOld)
8664 {
8665 array<EntityAI> subItemsExit = new array<EntityAI>;
8667 for (int i = 0; i < subItemsExit.Count(); i++)
8668 {
8671 }
8672 }
8673
8674 if (ownerPlayerNew)
8675 {
8676 array<EntityAI> subItemsEnter = new array<EntityAI>;
8678 for (int j = 0; j < subItemsEnter.Count(); j++)
8679 {
8682 }
8683 }
8684 }
8685 else if (ownerPlayerNew != null)
8686 {
8687 PlayerBase nplayer;
8688 if (PlayerBase.CastTo(nplayer, ownerPlayerNew))
8689 {
8690 array<EntityAI> subItemsUpdate = new array<EntityAI>;
8692 for (int k = 0; k < subItemsUpdate.Count(); k++)
8693 {
8695 itemUpdate.UpdateQuickbarShortcutVisibility(nplayer);
8696 }
8697 }
8698 }
8699
8700 if (old_owner)
8701 old_owner.OnChildItemRemoved(this);
8702 if (new_owner)
8703 new_owner.OnChildItemReceived(this);
8704 }
8705
8706
8708 {
8709 super.EEDelete(parent);
8710 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
8711 if (player)
8712 {
8714
8715 if (player.IsAlive())
8716 {
8717 int r_index = player.GetHumanInventory().FindUserReservedLocationIndex(this);
8718 if (r_index >= 0)
8719 {
8720 InventoryLocation r_il = new InventoryLocation;
8721 player.GetHumanInventory().GetUserReservedLocation(r_index,r_il);
8722
8723 player.GetHumanInventory().ClearUserReservedLocationAtIndex(r_index);
8726 {
8727 r_il.
GetParent().GetOnReleaseLock().Invoke(
this);
8728 }
8730 {
8731 r_il.
GetParent().GetOnAttachmentReleaseLock().Invoke(
this, r_il.
GetSlot());
8732 }
8733
8734 }
8735
8736 player.RemoveQuickBarEntityShortcut(this);
8737 }
8738 }
8739 }
8740
8742 {
8743 super.EEKilled(killer);
8744
8747 {
8748 if (GetTemperature() >= GameConstants.ITEM_TEMPERATURE_TO_EXPLODE_MIN)
8749 {
8750 if (IsMagazine())
8751 {
8752 if (Magazine.Cast(this).GetAmmoCount() > 0)
8753 {
8755 }
8756 }
8757 else
8758 {
8760 }
8761 }
8762 }
8763 }
8764
8766 {
8767 MiscGameplayFunctions.RemoveAllAttachedChildrenByTypename(this, {Bolt_Base});
8768
8769 super.OnWasAttached(parent, slot_id);
8770
8773
8775 }
8776
8778 {
8779 super.OnWasDetached(parent, slot_id);
8780
8783 }
8784
8786 {
8787 int idx;
8790
8791 ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8792 if (inventory_slots.Count() < 1)
8793 {
8794 inventory_slots.Insert(ConfigGetString("ChangeInventorySlot"));
8795 attach_types.Insert(ConfigGetString("ChangeIntoOnAttach"));
8796 }
8797 else
8798 {
8799 ConfigGetTextArray("ChangeIntoOnAttach",attach_types);
8800 }
8801
8802 idx = inventory_slots.Find(slot);
8803 if (idx < 0)
8804 return "";
8805
8806 return attach_types.Get(idx);
8807 }
8808
8810 {
8811 int idx = -1;
8812 string slot;
8813
8816
8817 this.ConfigGetTextArray("ChangeInventorySlot",inventory_slots);
8818 if (inventory_slots.Count() < 1)
8819 {
8820 inventory_slots.Insert(this.ConfigGetString("ChangeInventorySlot"));
8821 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8822 }
8823 else
8824 {
8825 this.ConfigGetTextArray("ChangeIntoOnDetach",detach_types);
8826 if (detach_types.Count() < 1)
8827 detach_types.Insert(this.ConfigGetString("ChangeIntoOnDetach"));
8828 }
8829
8830 for (int i = 0; i < inventory_slots.Count(); i++)
8831 {
8832 slot = inventory_slots.Get(i);
8833 }
8834
8835 if (slot != "")
8836 {
8837 if (detach_types.Count() == 1)
8838 idx = 0;
8839 else
8840 idx = inventory_slots.Find(slot);
8841 }
8842 if (idx < 0)
8843 return "";
8844
8845 return detach_types.Get(idx);
8846 }
8847
8849 {
8850
8852
8853
8854 float min_time = 1;
8855 float max_time = 3;
8856 float delay = Math.RandomFloat(min_time, max_time);
8857
8858 explode_timer.Run(delay, this, "DoAmmoExplosion");
8859 }
8860
8862 {
8863 Magazine magazine = Magazine.Cast(this);
8864 int pop_sounds_count = 6;
8865 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
8866
8867
8868 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
8869 string sound_name = pop_sounds[ sound_idx ];
8871
8872
8873 magazine.ServerAddAmmoCount(-1);
8874
8875
8876 float min_temp_to_explode = 100;
8877
8878 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode)
8879 {
8881 }
8882 }
8883
8884
8885 override void EEHitBy(TotalDamageResult damageResult,
int damageType,
EntityAI source,
int component,
string dmgZone,
string ammo, vector modelPos,
float speedCoef)
8886 {
8887 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
8888
8889 const int CHANCE_DAMAGE_CARGO = 4;
8890 const int CHANCE_DAMAGE_ATTACHMENT = 1;
8891 const int CHANCE_DAMAGE_NOTHING = 2;
8892
8894 {
8895 float dmg = damageResult.
GetDamage(
"",
"Health") * -0.5;
8896 int chances;
8897 int rnd;
8898
8899 if (GetInventory().GetCargo())
8900 {
8901 chances = CHANCE_DAMAGE_CARGO + CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8902 rnd = Math.RandomInt(0,chances);
8903
8904 if (rnd < CHANCE_DAMAGE_CARGO)
8905 {
8907 }
8908 else if (rnd < (chances - CHANCE_DAMAGE_NOTHING))
8909 {
8911 }
8912 }
8913 else
8914 {
8915 chances = CHANCE_DAMAGE_ATTACHMENT + CHANCE_DAMAGE_NOTHING;
8916 rnd = Math.RandomInt(0,chances);
8917
8918 if (rnd < CHANCE_DAMAGE_ATTACHMENT)
8919 {
8921 }
8922 }
8923 }
8924 }
8925
8927 {
8928 if (GetInventory().GetCargo())
8929 {
8930 int item_count = GetInventory().GetCargo().GetItemCount();
8931 if (item_count > 0)
8932 {
8933 int random_pick = Math.RandomInt(0, item_count);
8935 if (!item.IsExplosive())
8936 {
8937 item.AddHealth("","",damage);
8938 return true;
8939 }
8940 }
8941 }
8942 return false;
8943 }
8944
8946 {
8947 int attachment_count = GetInventory().AttachmentCount();
8948 if (attachment_count > 0)
8949 {
8950 int random_pick = Math.RandomInt(0, attachment_count);
8951 ItemBase attachment =
ItemBase.Cast(GetInventory().GetAttachmentFromIndex(random_pick));
8952 if (!attachment.IsExplosive())
8953 {
8954 attachment.AddHealth("","",damage);
8955 return true;
8956 }
8957 }
8958 return false;
8959 }
8960
8962 {
8964 }
8965
8967 {
8969 return GetInventory().CanRemoveEntity();
8970
8971 return false;
8972 }
8973
8975 {
8977 return;
8978
8980 {
8981 if (ScriptInputUserData.CanStoreInputUserData())
8982 {
8983 ScriptInputUserData ctx = new ScriptInputUserData;
8988 ctx.
Write(destination_entity);
8992 }
8993 }
8994 else if (!
GetGame().IsMultiplayer())
8995 {
8997 }
8998 }
8999
9001 {
9003 return;
9004
9005 float split_quantity_new;
9009 InventoryLocation loc = new InventoryLocation;
9010
9011 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9012 {
9014 split_quantity_new = stack_max;
9015 else
9017
9018 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9019 if (new_item)
9020 {
9021 new_item.SetResultOfSplit(true);
9022 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9024 new_item.SetQuantity(split_quantity_new);
9025 }
9026 }
9027 else if (destination_entity && slot_id == -1)
9028 {
9029 if (quantity > stack_max)
9030 split_quantity_new = stack_max;
9031 else
9032 split_quantity_new = quantity;
9033
9035 {
9038 }
9039
9040 if (new_item)
9041 {
9042 new_item.SetResultOfSplit(true);
9043 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9045 new_item.SetQuantity(split_quantity_new);
9046 }
9047 }
9048 else
9049 {
9050 if (stack_max != 0)
9051 {
9053 {
9055 }
9056
9057 if (split_quantity_new == 0)
9058 {
9059 if (!
GetGame().IsMultiplayer())
9060 player.PhysicalPredictiveDropItem(this);
9061 else
9062 player.ServerDropEntity(this);
9063 return;
9064 }
9065
9067
9068 if (new_item)
9069 {
9070 new_item.SetResultOfSplit(true);
9071 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9073 new_item.SetQuantity(stack_max);
9074 new_item.PlaceOnSurface();
9075 }
9076 }
9077 }
9078 }
9079
9081 {
9083 return;
9084
9085 float split_quantity_new;
9089 InventoryLocation loc = new InventoryLocation;
9090
9091 if (destination_entity && slot_id != -1 && InventorySlots.IsSlotIdValid(slot_id))
9092 {
9094 split_quantity_new = stack_max;
9095 else
9097
9098 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateAttachmentEx(
this.GetType(), slot_id));
9099 if (new_item)
9100 {
9101 new_item.SetResultOfSplit(true);
9102 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9104 new_item.SetQuantity(split_quantity_new);
9105 }
9106 }
9107 else if (destination_entity && slot_id == -1)
9108 {
9109 if (quantity > stack_max)
9110 split_quantity_new = stack_max;
9111 else
9112 split_quantity_new = quantity;
9113
9115 {
9118 }
9119
9120 if (new_item)
9121 {
9122 new_item.SetResultOfSplit(true);
9123 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9125 new_item.SetQuantity(split_quantity_new);
9126 }
9127 }
9128 else
9129 {
9130 if (stack_max != 0)
9131 {
9133 {
9135 }
9136
9138
9139 if (new_item)
9140 {
9141 new_item.SetResultOfSplit(true);
9142 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9144 new_item.SetQuantity(stack_max);
9145 new_item.PlaceOnSurface();
9146 }
9147 }
9148 }
9149 }
9150
9152 {
9154 return;
9155
9157 {
9158 if (ScriptInputUserData.CanStoreInputUserData())
9159 {
9160 ScriptInputUserData ctx = new ScriptInputUserData;
9165 dst.WriteToContext(ctx);
9167 }
9168 }
9169 else if (!
GetGame().IsMultiplayer())
9170 {
9172 }
9173 }
9174
9176 {
9178 return;
9179
9181 {
9182 if (ScriptInputUserData.CanStoreInputUserData())
9183 {
9184 ScriptInputUserData ctx = new ScriptInputUserData;
9189 ctx.
Write(destination_entity);
9195 }
9196 }
9197 else if (!
GetGame().IsMultiplayer())
9198 {
9200 }
9201 }
9202
9204 {
9206 }
9207
9209 {
9211 return this;
9212
9214 float split_quantity_new;
9216 if (dst.IsValid())
9217 {
9218 int slot_id = dst.GetSlot();
9220
9221 if (quantity > stack_max)
9222 split_quantity_new = stack_max;
9223 else
9224 split_quantity_new = quantity;
9225
9227
9228 if (new_item)
9229 {
9230 new_item.SetResultOfSplit(true);
9231 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9234 }
9235
9236 return new_item;
9237 }
9238
9239 return null;
9240 }
9241
9243 {
9245 return;
9246
9248 float split_quantity_new;
9250 if (destination_entity)
9251 {
9253 if (quantity > stackable)
9254 split_quantity_new = stackable;
9255 else
9256 split_quantity_new = quantity;
9257
9258 new_item =
ItemBase.Cast(destination_entity.GetInventory().CreateEntityInCargoEx(
this.GetType(), idx, row, col,
false));
9259 if (new_item)
9260 {
9261 new_item.SetResultOfSplit(true);
9262 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9264 new_item.SetQuantity(split_quantity_new);
9265 }
9266 }
9267 }
9268
9270 {
9272 return;
9273
9275 {
9276 if (ScriptInputUserData.CanStoreInputUserData())
9277 {
9278 ScriptInputUserData ctx = new ScriptInputUserData;
9283 ItemBase destination_entity =
this;
9284 ctx.
Write(destination_entity);
9288 }
9289 }
9290 else if (!
GetGame().IsMultiplayer())
9291 {
9293 }
9294 }
9295
9297 {
9299 return;
9300
9302 float split_quantity_new;
9304 if (player)
9305 {
9307 if (quantity > stackable)
9308 split_quantity_new = stackable;
9309 else
9310 split_quantity_new = quantity;
9311
9312 EntityAI in_hands = player.GetHumanInventory().CreateInHands(this.
GetType());
9313 new_item =
ItemBase.Cast(in_hands);
9314 if (new_item)
9315 {
9316 new_item.SetResultOfSplit(true);
9317 MiscGameplayFunctions.TransferItemProperties(this,new_item);
9319 new_item.SetQuantity(split_quantity_new);
9320 }
9321 }
9322 }
9323
9325 {
9327 return;
9328
9330 float split_quantity_new = Math.Floor(quantity * 0.5);
9331
9333
9334 if (new_item)
9335 {
9336 if (new_item.GetQuantityMax() < split_quantity_new)
9337 {
9338 split_quantity_new = new_item.GetQuantityMax();
9339 }
9340
9341 new_item.SetResultOfSplit(true);
9342 MiscGameplayFunctions.TransferItemProperties(this, new_item);
9343
9345 {
9348 }
9349 else
9350 {
9353 }
9354 }
9355 }
9356
9358 {
9360 return;
9361
9363 float split_quantity_new = Math.Floor(quantity / 2);
9364
9365 InventoryLocation invloc = new InventoryLocation;
9367
9369 new_item = player.CreateCopyOfItemInInventoryOrGroundEx(this, true);
9370
9371 if (new_item)
9372 {
9373 if (new_item.GetQuantityMax() < split_quantity_new)
9374 {
9375 split_quantity_new = new_item.GetQuantityMax();
9376 }
9378 {
9381 }
9382 else
9383 {
9386 }
9387 }
9388 }
9389
9392 {
9393 SetWeightDirty();
9395
9396 if (parent)
9397 parent.OnAttachmentQuantityChangedEx(this, delta);
9398
9400 {
9402 {
9404 }
9406 {
9407 ErrorEx(
"Undefined liquid type quantity changed, please define liquid type first! Using init value.",
ErrorExSeverity.INFO);
9409 }
9410 }
9411
9412 }
9413
9416 {
9417
9418 }
9419
9422 {
9424 }
9425
9427 {
9428 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
9429
9431 {
9432 if (newLevel == GameConstants.STATE_RUINED)
9433 {
9435 EntityAI parent = GetHierarchyParent();
9436 if (parent && parent.IsFireplace())
9437 {
9438 CargoBase cargo = GetInventory().GetCargo();
9439 if (cargo)
9440 {
9442 {
9444 }
9445 }
9446 }
9447 }
9448
9450 {
9451
9453 return;
9454 }
9455
9456 if (
m_Cleanness != 0 && oldLevel < newLevel && newLevel != 0)
9457 {
9459 }
9460 }
9461 }
9462
9463
9465 {
9466 super.OnRightClick();
9467
9469 {
9471 {
9472 if (ScriptInputUserData.CanStoreInputUserData())
9473 {
9474 vector m4[4];
9476
9477 EntityAI root = GetHierarchyRoot();
9478
9479 InventoryLocation dst = new InventoryLocation;
9481 {
9482 if (root)
9483 {
9484 root.GetTransform(m4);
9486 }
9487 else
9488 GetInventory().GetCurrentInventoryLocation(dst);
9489 }
9490 else
9491 {
9493
9494
9495 if (
GetGame().
GetPlayer().GetInventory().HasInventoryReservation(
this, dst))
9496 {
9497 if (root)
9498 {
9499 root.GetTransform(m4);
9501 }
9502 else
9503 GetInventory().GetCurrentInventoryLocation(dst);
9504 }
9505 else
9506 {
9507 GetGame().
GetPlayer().GetInventory().AddInventoryReservationEx(null, dst, GameInventory.c_InventoryReservationTimeoutShortMS);
9508 }
9509 }
9510
9511 ScriptInputUserData ctx = new ScriptInputUserData;
9519 }
9520 }
9521 else if (!
GetGame().IsMultiplayer())
9522 {
9524 }
9525 }
9526 }
9527
9528 override bool CanBeCombined(
EntityAI other_item,
bool reservation_check =
true,
bool stack_max_limit =
false)
9529 {
9530
9531 if (!other_item ||
GetType() != other_item.GetType() || (
IsFullQuantity() && other_item.GetQuantity() > 0) || other_item ==
this)
9532 return false;
9533
9534 if (GetHealthLevel() == GameConstants.STATE_RUINED || other_item.GetHealthLevel() == GameConstants.STATE_RUINED)
9535 return false;
9536
9537
9539 return false;
9540
9541
9542 Magazine mag = Magazine.Cast(this);
9543 if (mag)
9544 {
9545 if (mag.GetAmmoCount() >= mag.GetAmmoMax())
9546 return false;
9547
9548 if (stack_max_limit)
9549 {
9550 Magazine other_mag = Magazine.Cast(other_item);
9551 if (other_item)
9552 {
9553 if (mag.GetAmmoCount() + other_mag.GetAmmoCount() > mag.GetAmmoMax())
9554 return false;
9555 }
9556
9557 }
9558 }
9559 else
9560 {
9561
9563 return false;
9564
9566 return false;
9567 }
9568
9569 PlayerBase player = null;
9570 if (CastTo(player, GetHierarchyRootPlayer()))
9571 {
9572 if (player.GetInventory().HasAttachment(this))
9573 return false;
9574
9575 if (player.IsItemsToDelete())
9576 return false;
9577 }
9578
9579 if (reservation_check && (GetInventory().HasInventoryReservation(this, null) || other_item.GetInventory().HasInventoryReservation(other_item, null)))
9580 return false;
9581
9582 int slotID;
9584 if (GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName) && GetHierarchyParent().GetInventory().GetSlotLock(slotID))
9585 return false;
9586
9587 return true;
9588 }
9589
9591 {
9593 }
9594
9596 {
9597 return m_IsResultOfSplit;
9598 }
9599
9601 {
9602 m_IsResultOfSplit = value;
9603 }
9604
9606 {
9608 }
9609
9611 {
9612 float other_item_quantity = other_item.GetQuantity();
9613 float this_free_space;
9614
9616
9618
9619 if (other_item_quantity > this_free_space)
9620 {
9621 return this_free_space;
9622 }
9623 else
9624 {
9625 return other_item_quantity;
9626 }
9627 }
9628
9630 {
9632 }
9633
9635 {
9637 return;
9638
9639 if (!IsMagazine() && other_item)
9640 {
9642 if (quantity_used != 0)
9643 {
9644 float hp1 = GetHealth01("","");
9645 float hp2 = other_item.GetHealth01("","");
9646 float hpResult = ((hp1*
GetQuantity()) + (hp2*quantity_used));
9647 hpResult = hpResult / (
GetQuantity() + quantity_used);
9648
9649 hpResult *= GetMaxHealth();
9650 Math.Round(hpResult);
9651 SetHealth("", "Health", hpResult);
9652
9654 other_item.AddQuantity(-quantity_used);
9655 }
9656 }
9658 }
9659
9661 {
9662 #ifdef SERVER
9663 if (!GetHierarchyRootPlayer() && GetHierarchyParent())
9664 GetHierarchyParent().IncreaseLifetimeUp();
9665 #endif
9666 };
9667
9669 {
9670 PlayerBase p = PlayerBase.Cast(player);
9671
9672 array<int> recipesIds = p.m_Recipes;
9673 PluginRecipesManager moduleRecipesManager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9674 if (moduleRecipesManager)
9675 {
9676 EntityAI itemInHands = player.GetHumanInventory().GetEntityInHands();
9677 moduleRecipesManager.GetValidRecipes(
ItemBase.Cast(
this),
ItemBase.Cast(itemInHands), recipesIds, p);
9678 }
9679
9680 for (int i = 0;i < recipesIds.Count(); i++)
9681 {
9682 int key = recipesIds.Get(i);
9683 string recipeName = moduleRecipesManager.GetRecipeName(key);
9685 }
9686 }
9687
9688
9689 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
9690 {
9691 super.GetDebugActions(outputList);
9692
9693
9698
9699
9703
9707
9708
9711
9712
9714 {
9717 }
9718
9720
9723
9727 }
9728
9729
9730
9731
9733 {
9734 super.OnAction(action_id, player, ctx);
9735 if (action_id >=
EActions.RECIPES_RANGE_START && action_id <
EActions.RECIPES_RANGE_END)
9736 {
9737 PluginRecipesManager plugin_recipes_manager = PluginRecipesManager.Cast(
GetPlugin(PluginRecipesManager));
9738 int idWithoutOffset = action_id -
EActions.RECIPES_RANGE_START;
9739 PlayerBase p = PlayerBase.Cast(player);
9740 if (
EActions.RECIPES_RANGE_START < 1000)
9741 {
9742 float anim_length = plugin_recipes_manager.GetRecipeLengthInSecs(idWithoutOffset);
9743 float specialty_weight = plugin_recipes_manager.GetRecipeSpecialty(idWithoutOffset);
9744 }
9745 }
9746 #ifndef SERVER
9747 else if (action_id ==
EActions.WATCH_PLAYER)
9748 {
9749 PluginDeveloper.SetDeveloperItemClientEx(player);
9750 }
9751 #endif
9753 {
9754 if (action_id >=
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START && action_id <
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_END)
9755 {
9756 int id = action_id -
EActions.DEBUG_ITEM_WATCH_BUTTON_RANGE_START;
9757 OnDebugButtonPressServer(id + 1);
9758 }
9759
9760 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_INJECT_START && action_id <
EActions.DEBUG_AGENTS_RANGE_INJECT_END)
9761 {
9762 int agent_id = action_id -
EActions.DEBUG_AGENTS_RANGE_INJECT_START;
9764 }
9765
9766 else if (action_id >=
EActions.DEBUG_AGENTS_RANGE_REMOVE_START && action_id <
EActions.DEBUG_AGENTS_RANGE_REMOVE_END)
9767 {
9768 int agent_id2 = action_id -
EActions.DEBUG_AGENTS_RANGE_REMOVE_START;
9770 }
9771
9772 else if (action_id ==
EActions.ADD_QUANTITY)
9773 {
9774 if (IsMagazine())
9775 {
9776 Magazine mag = Magazine.Cast(this);
9777 mag.ServerSetAmmoCount(mag.GetAmmoCount() + mag.GetAmmoMax() * 0.2);
9778 }
9779 else
9780 {
9782 }
9783
9784 if (m_EM)
9785 {
9786 m_EM.AddEnergy(m_EM.GetEnergyMax() * 0.2);
9787 }
9788
9789 }
9790
9791 else if (action_id ==
EActions.REMOVE_QUANTITY)
9792 {
9793 if (IsMagazine())
9794 {
9795 Magazine mag2 = Magazine.Cast(this);
9796 mag2.ServerSetAmmoCount(mag2.GetAmmoCount() - mag2.GetAmmoMax() * 0.2);
9797 }
9798 else
9799 {
9801 }
9802 if (m_EM)
9803 {
9804 m_EM.AddEnergy(- m_EM.GetEnergyMax() * 0.2);
9805 }
9806
9807 }
9808
9809 else if (action_id ==
EActions.SET_QUANTITY_0)
9810 {
9812
9813 if (m_EM)
9814 {
9815 m_EM.SetEnergy(0);
9816 }
9817 }
9818
9819 else if (action_id ==
EActions.SET_MAX_QUANTITY)
9820 {
9822
9823 if (m_EM)
9824 {
9825 m_EM.SetEnergy(m_EM.GetEnergyMax());
9826 }
9827 }
9828
9829 else if (action_id ==
EActions.ADD_HEALTH)
9830 {
9831 AddHealth("","",GetMaxHealth("","Health")/5);
9832 }
9833 else if (action_id ==
EActions.REMOVE_HEALTH)
9834 {
9835 AddHealth("","",-GetMaxHealth("","Health")/5);
9836 }
9837 else if (action_id ==
EActions.DESTROY_HEALTH)
9838 {
9839 SetHealth01("","",0);
9840 }
9841 else if (action_id ==
EActions.WATCH_ITEM)
9842 {
9844 mid.RegisterDebugItem(
ItemBase.Cast(
this), PlayerBase.Cast(player));
9845 #ifdef DEVELOPER
9846 SetDebugDeveloper_item(this);
9847 #endif
9848 }
9849
9850 else if (action_id ==
EActions.ADD_TEMPERATURE)
9851 {
9852 AddTemperature(20);
9853
9854 }
9855
9856 else if (action_id ==
EActions.REMOVE_TEMPERATURE)
9857 {
9858 AddTemperature(-20);
9859
9860 }
9861
9862 else if (action_id ==
EActions.FLIP_FROZEN)
9863 {
9864 SetFrozen(!GetIsFrozen());
9865
9866 }
9867
9868 else if (action_id ==
EActions.ADD_WETNESS)
9869 {
9871
9872 }
9873
9874 else if (action_id ==
EActions.REMOVE_WETNESS)
9875 {
9877
9878 }
9879
9880 else if (action_id ==
EActions.LIQUIDTYPE_UP)
9881 {
9884
9885
9886 }
9887
9888 else if (action_id ==
EActions.LIQUIDTYPE_DOWN)
9889 {
9892 }
9893
9894 else if (action_id ==
EActions.MAKE_SPECIAL)
9895 {
9896 auto debugParams = DebugSpawnParams.WithPlayer(player);
9897 OnDebugSpawnEx(debugParams);
9898 }
9899
9900 else if (action_id ==
EActions.DELETE)
9901 {
9902 Delete();
9903 }
9904
9905 }
9906
9907
9908 return false;
9909 }
9910
9911
9912
9913
9917
9920
9921
9922
9924 {
9925 return false;
9926 }
9927
9928
9930 {
9931 return true;
9932 }
9933
9934
9936 {
9937 return true;
9938 }
9939
9940
9941
9943 {
9944 string config_path =
string.Format(
"CfgVehicles %1 Food FoodStages",
GetType());
9946 }
9947
9950 {
9951 return null;
9952 }
9953
9955 {
9956 return false;
9957 }
9958
9960 {
9961 return false;
9962 }
9963
9967
9968
9970 {
9971 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9972 return module_repairing.CanRepair(this, item_repair_kit);
9973 }
9974
9975
9976 bool Repair(PlayerBase player,
ItemBase item_repair_kit,
float specialty_weight)
9977 {
9978 PluginRepairing module_repairing = PluginRepairing.Cast(
GetPlugin(PluginRepairing));
9979 return module_repairing.Repair(player, this, item_repair_kit, specialty_weight);
9980 }
9981
9982
9984 {
9985
9986
9987
9988
9989
9990
9991
9992
9993 return 1;
9994 }
9995
9996
9997
9999 {
10001 }
10002
10003
10004
10006 {
10008 }
10009
10010
10019 {
10020 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10021
10022 if (player)
10023 {
10024 player.MessageStatus(text);
10025 }
10026 }
10027
10028
10037 {
10038 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10039
10040 if (player)
10041 {
10042 player.MessageAction(text);
10043 }
10044 }
10045
10046
10055 {
10056 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10057
10058 if (player)
10059 {
10060 player.MessageFriendly(text);
10061 }
10062 }
10063
10064
10073 {
10074 PlayerBase player = PlayerBase.Cast(this.GetHierarchyRootPlayer());
10075
10076 if (player)
10077 {
10078 player.MessageImportant(text);
10079 }
10080 }
10081
10083 {
10084 return true;
10085 }
10086
10087
10088 override bool KindOf(
string tag)
10089 {
10090 bool found = false;
10091 string item_name = this.
GetType();
10094
10095 int array_size = item_tag_array.Count();
10096 for (int i = 0; i < array_size; i++)
10097 {
10098 if (item_tag_array.Get(i) == tag)
10099 {
10100 found = true;
10101 break;
10102 }
10103 }
10104 return found;
10105 }
10106
10107
10109 {
10110
10111 super.OnRPC(sender, rpc_type,ctx);
10112
10113
10114 switch (rpc_type)
10115 {
10116 #ifndef SERVER
10117 case ERPCs.RPC_SOUND_LOCK_ATTACH:
10118 Param2<bool, string> p = new Param2<bool, string>(false, "");
10119
10121 return;
10122
10123 bool play = p.param1;
10124 string soundSet = p.param2;
10125
10126 if (play)
10127 {
10129 {
10131 {
10133 }
10134 }
10135 else
10136 {
10138 }
10139 }
10140 else
10141 {
10143 }
10144
10145 break;
10146 #endif
10147
10148 }
10149
10151 {
10153 }
10154 }
10155
10156
10157
10158
10160 {
10161 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10162 return plugin.GetID(
name);
10163 }
10164
10166 {
10167 PluginVariables plugin = PluginVariables.Cast(
GetPlugin(PluginVariables));
10168 return plugin.GetName(id);
10169 }
10170
10173 {
10174
10175
10176 int varFlags;
10177 if (!ctx.
Read(varFlags))
10178 return;
10179
10180 if (varFlags & ItemVariableFlags.FLOAT)
10181 {
10183 }
10184 }
10185
10187 {
10188
10189 super.SerializeNumericalVars(floats_out);
10190
10191
10192
10194 {
10196 }
10197
10199 {
10201 }
10202
10204 {
10206 }
10207
10209 {
10214 }
10215
10217 {
10219 }
10220 }
10221
10223 {
10224
10225 super.DeSerializeNumericalVars(floats);
10226
10227
10228 int index = 0;
10229 int mask = Math.Round(floats.Get(index));
10230
10231 index++;
10232
10234 {
10236 {
10238 }
10239 else
10240 {
10241 float quantity = floats.Get(index);
10242 SetQuantity(quantity,
true,
false,
false,
false);
10243 }
10244 index++;
10245 }
10246
10248 {
10249 float wet = floats.Get(index);
10251 index++;
10252 }
10253
10255 {
10256 int liquidtype = Math.Round(floats.Get(index));
10258 index++;
10259 }
10260
10262 {
10264 index++;
10266 index++;
10268 index++;
10270 index++;
10271 }
10272
10274 {
10275 int cleanness = Math.Round(floats.Get(index));
10277 index++;
10278 }
10279 }
10280
10282 {
10283 super.WriteVarsToCTX(ctx);
10284
10285
10287 {
10289 }
10290
10292 {
10294 }
10295
10297 {
10299 }
10300
10302 {
10303 int r,g,b,a;
10309 }
10310
10312 {
10314 }
10315 }
10316
10318 {
10319 if (!super.ReadVarsFromCTX(ctx,version))
10320 return false;
10321
10322 int intValue;
10323 float value;
10324
10325 if (version < 140)
10326 {
10327 if (!ctx.
Read(intValue))
10328 return false;
10329
10330 m_VariablesMask = intValue;
10331 }
10332
10334 {
10335 if (!ctx.
Read(value))
10336 return false;
10337
10339 {
10341 }
10342 else
10343 {
10345 }
10346 }
10347
10348 if (version < 140)
10349 {
10351 {
10352 if (!ctx.
Read(value))
10353 return false;
10354 SetTemperatureDirect(value);
10355 }
10356 }
10357
10359 {
10360 if (!ctx.
Read(value))
10361 return false;
10363 }
10364
10366 {
10367 if (!ctx.
Read(intValue))
10368 return false;
10370 }
10371
10373 {
10374 int r,g,b,a;
10376 return false;
10378 return false;
10380 return false;
10382 return false;
10383
10385 }
10386
10388 {
10389 if (!ctx.
Read(intValue))
10390 return false;
10392 }
10393
10394 if (version >= 138 && version < 140)
10395 {
10397 {
10398 if (!ctx.
Read(intValue))
10399 return false;
10400 SetFrozen(intValue);
10401 }
10402 }
10403
10404 return true;
10405 }
10406
10407
10409 {
10412 {
10414 }
10415
10416 if (!super.OnStoreLoad(ctx, version))
10417 {
10419 return false;
10420 }
10421
10422 if (version >= 114)
10423 {
10424 bool hasQuickBarIndexSaved;
10425
10426 if (!ctx.
Read(hasQuickBarIndexSaved))
10427 {
10429 return false;
10430 }
10431
10432 if (hasQuickBarIndexSaved)
10433 {
10434 int itmQBIndex;
10435
10436
10437 if (!ctx.
Read(itmQBIndex))
10438 {
10440 return false;
10441 }
10442
10443 PlayerBase parentPlayer = PlayerBase.Cast(GetHierarchyRootPlayer());
10444 if (itmQBIndex != -1 && parentPlayer)
10445 parentPlayer.SetLoadedQuickBarItemBind(this, itmQBIndex);
10446 }
10447 }
10448 else
10449 {
10450
10451 PlayerBase player;
10452 int itemQBIndex;
10453 if (version ==
int.
MAX)
10454 {
10455 if (!ctx.
Read(itemQBIndex))
10456 {
10458 return false;
10459 }
10460 }
10461 else if (Class.CastTo(player, GetHierarchyRootPlayer()))
10462 {
10463
10464 if (!ctx.
Read(itemQBIndex))
10465 {
10467 return false;
10468 }
10469 if (itemQBIndex != -1 && player)
10470 player.SetLoadedQuickBarItemBind(this,itemQBIndex);
10471 }
10472 }
10473
10474 if (version < 140)
10475 {
10476
10477 if (!LoadVariables(ctx, version))
10478 {
10480 return false;
10481 }
10482 }
10483
10484
10486 {
10488 return false;
10489 }
10490 if (version >= 132)
10491 {
10493 if (raib)
10494 {
10496 {
10498 return false;
10499 }
10500 }
10501 }
10502
10504 return true;
10505 }
10506
10507
10508
10510 {
10511 super.OnStoreSave(ctx);
10512
10513 PlayerBase player;
10514 if (PlayerBase.CastTo(player,GetHierarchyRootPlayer()))
10515 {
10517
10518 int itemQBIndex = -1;
10519 itemQBIndex = player.FindQuickBarEntityIndex(this);
10520 ctx.
Write(itemQBIndex);
10521 }
10522 else
10523 {
10525 }
10526
10528
10530 if (raib)
10531 {
10533 }
10534 }
10535
10536
10538 {
10539 super.AfterStoreLoad();
10540
10542 {
10544 }
10545
10547 {
10550 }
10551 }
10552
10554 {
10555 super.EEOnAfterLoad();
10556
10558 {
10560 }
10561
10564 }
10565
10567 {
10568 return false;
10569 }
10570
10571
10572
10574 {
10576 {
10577 #ifdef PLATFORM_CONSOLE
10578
10580 {
10582 if (menu)
10583 {
10585 }
10586 }
10587 #endif
10588 }
10589
10591 {
10594 }
10595
10597 {
10598 SetWeightDirty();
10600 }
10602 {
10605 }
10606
10608 {
10611 }
10613 {
10616 }
10617
10618 super.OnVariablesSynchronized();
10619 }
10620
10621
10622
10624 override bool SetQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false,
bool allow_client =
false,
bool clamp_to_stack_max =
true)
10625 {
10626 if (!IsServerCheck(allow_client))
10627 return false;
10628
10630 return false;
10631
10634
10635 if (value <= (min + 0.001))
10636 value = min;
10637
10638 if (value == min)
10639 {
10640 if (destroy_config)
10641 {
10642 bool dstr = ConfigGetBool("varQuantityDestroyOnMin");
10643 if (dstr)
10644 {
10646 this.Delete();
10647 return true;
10648 }
10649 }
10650 else if (destroy_forced)
10651 {
10653 this.Delete();
10654 return true;
10655 }
10656
10658 }
10659
10662
10664 {
10666
10667 if (delta)
10669 }
10670
10672
10673 return false;
10674 }
10675
10676
10678 bool AddQuantity(
float value,
bool destroy_config =
true,
bool destroy_forced =
false)
10679 {
10681 }
10682
10684 {
10687 }
10688
10690 {
10693 }
10694
10697 {
10698 float value_clamped = Math.Clamp(value, 0, 1);
10700 SetQuantity(result, destroy_config, destroy_forced);
10701 }
10702
10703
10706 {
10708 }
10709
10711 {
10713 }
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10725 {
10726 int slot = -1;
10727 if (GetInventory())
10728 {
10729 InventoryLocation il = new InventoryLocation;
10730 GetInventory().GetCurrentInventoryLocation(il);
10732 }
10733
10735 }
10736
10738 {
10739 float quantity_max = 0;
10740
10742 {
10743 if (attSlotID != -1)
10744 quantity_max = InventorySlots.GetStackMaxForSlotId(attSlotID);
10745
10746 if (quantity_max <= 0)
10748 }
10749
10750 if (quantity_max <= 0)
10752
10753 return quantity_max;
10754 }
10755
10757 {
10759 }
10760
10762 {
10764 }
10765
10766
10768 {
10770 }
10771
10773 {
10775 }
10776
10778 {
10780 }
10781
10782
10784 {
10785
10786 float weightEx = GetWeightEx();
10787 float special = GetInventoryAndCargoWeight();
10788 return weightEx - special;
10789 }
10790
10791
10793 {
10795 }
10796
10798 {
10800 {
10801 #ifdef DEVELOPER
10802 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10803 {
10804 WeightDebugData data1 = WeightDebug.GetWeightDebug(this);
10806 }
10807 #endif
10808
10809 return GetQuantity() * GetConfigWeightModified();
10810 }
10811 else if (HasEnergyManager())
10812 {
10813 #ifdef DEVELOPER
10814 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10815 {
10816 WeightDebugData data2 = WeightDebug.GetWeightDebug(this);
10817 data2.
SetCalcDetails(
"TIB2: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " + GetCompEM().
GetEnergy()+
"(energy) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit)");
10818 }
10819 #endif
10820 return super.GetWeightSpecialized(forceRecalc) + (GetCompEM().GetEnergy() * ConfigGetFloat("weightPerQuantityUnit")) + GetConfigWeightModified());
10821 }
10822 else
10823 {
10824 #ifdef DEVELOPER
10825 if (WeightDebug.m_VerbosityFlags & WeightDebugType.RECALC_FORCED)
10826 {
10827 WeightDebugData data3 = WeightDebug.GetWeightDebug(this);
10828 data3.
SetCalcDetails(
"TIB3: "+super.GetWeightSpecialized(forceRecalc)+
"(contents weight) + " + GetConfigWeightModifiedDebugText() +
" + " +
GetQuantity()+
"(quantity) * " + ConfigGetFloat(
"weightPerQuantityUnit") +
"(weightPerQuantityUnit))");
10829 }
10830 #endif
10831 return super.GetWeightSpecialized(forceRecalc) + (
GetQuantity() * ConfigGetFloat(
"weightPerQuantityUnit")) + GetConfigWeightModified());
10832 }
10833 }
10834
10837 {
10838 int item_count = 0;
10840
10841 if (GetInventory().GetCargo() != NULL)
10842 {
10843 item_count = GetInventory().GetCargo().GetItemCount();
10844 }
10845
10846 for (int i = 0; i < GetInventory().AttachmentCount(); i++)
10847 {
10848 Class.CastTo(item,GetInventory().GetAttachmentFromIndex(i));
10849 if (item)
10850 item_count += item.GetNumberOfItems();
10851 }
10852 return item_count;
10853 }
10854
10857 {
10858 float weight = 0;
10859 float wetness = 1;
10860 if (include_wetness)
10863 {
10864 weight = wetness * m_ConfigWeight;
10865 }
10867 {
10868 weight = 1;
10869 }
10870 return weight;
10871 }
10872
10873
10874
10876 {
10877 if ((
GetGame().IsServer() || !
GetGame().IsMultiplayer()) && GetInventory())
10878 {
10879 GameInventory inv = GetInventory();
10880 array<EntityAI> items = new array<EntityAI>;
10882 for (int i = 0; i < items.Count(); i++)
10883 {
10885 if (item)
10886 {
10888 }
10889 }
10890 }
10891 }
10892
10893
10894
10895
10897 {
10898 float energy = 0;
10899 if (HasEnergyManager())
10900 {
10901 energy = GetCompEM().GetEnergy();
10902 }
10903 return energy;
10904 }
10905
10906
10908 {
10909 super.OnEnergyConsumed();
10910
10912 }
10913
10915 {
10916 super.OnEnergyAdded();
10917
10919 }
10920
10921
10923 {
10924 if (
GetGame().IsServer() && HasEnergyManager() && GetCompEM().HasConversionOfEnergyToQuantity())
10925 {
10927 {
10928 float energy_0to1 = GetCompEM().GetEnergy0To1();
10930 }
10931 }
10932 }
10933
10934
10936 {
10937 return ConfigGetFloat("heatIsolation");
10938 }
10939
10941 {
10943 }
10944
10946 {
10947 string paramPath =
string.Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Drying %2",
GetType(), pIncrementName);
10948 if (
GetGame().ConfigIsExisting(paramPath))
10950
10951 return 0.0;
10952 }
10953
10955 {
10956 string paramPath =
string.
Format(
"CfgVehicles %1 EnvironmentWetnessIncrements Soaking %2",
GetType(), pIncrementName);
10957 if (
GetGame().ConfigIsExisting(paramPath))
10959
10960 return 0.0;
10961 }
10962
10963 override void SetWet(
float value,
bool allow_client =
false)
10964 {
10965 if (!IsServerCheck(allow_client))
10966 return;
10967
10970
10972
10973 m_VarWet = Math.Clamp(value, min, max);
10974
10976 {
10979 }
10980 }
10981
10982 override void AddWet(
float value)
10983 {
10985 }
10986
10988 {
10990 }
10991
10993 {
10995 }
10996
10998 {
11000 }
11001
11003 {
11005 }
11006
11008 {
11010 }
11011
11012 override void OnWetChanged(
float newVal,
float oldVal)
11013 {
11016 if (newLevel != oldLevel)
11017 {
11019 }
11020 }
11021
11023 {
11024 SetWeightDirty();
11025 }
11026
11028 {
11029 return GetWetLevelInternal(
m_VarWet);
11030 }
11031
11032
11033
11035 {
11037 }
11038
11040 {
11042 }
11043
11045 {
11047 }
11048
11050 {
11052 }
11053
11054
11055
11057 {
11058 if (ConfigIsExisting("itemModelLength"))
11059 {
11060 return ConfigGetFloat("itemModelLength");
11061 }
11062 return 0;
11063 }
11064
11066 {
11067 if (ConfigIsExisting("itemAttachOffset"))
11068 {
11069 return ConfigGetFloat("itemAttachOffset");
11070 }
11071 return 0;
11072 }
11073
11074 override void SetCleanness(
int value,
bool allow_client =
false)
11075 {
11076 if (!IsServerCheck(allow_client))
11077 return;
11078
11080
11082
11085 }
11086
11088 {
11090 }
11091
11093 {
11094 return true;
11095 }
11096
11097
11098
11099
11101 {
11103 }
11104
11106 {
11108 }
11109
11110
11111
11112
11113 override void SetColor(
int r,
int g,
int b,
int a)
11114 {
11120 }
11122 override void GetColor(out
int r,out
int g,out
int b,out
int a)
11123 {
11128 }
11129
11131 {
11133 }
11134
11137 {
11138 int r,g,b,a;
11140 r = r/255;
11141 g = g/255;
11142 b = b/255;
11143 a = a/255;
11144 return MiscGameplayFunctions.GetColorString(r, g, b, a);
11145 }
11146
11147
11148
11149 override void SetLiquidType(
int value,
bool allow_client =
false)
11150 {
11151 if (!IsServerCheck(allow_client))
11152 return;
11153
11158 }
11159
11161 {
11162 return ConfigGetInt("varLiquidTypeInit");
11163 }
11164
11166 {
11168 }
11169
11171 {
11173 SetFrozen(false);
11174 }
11175
11178 {
11179 player.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11180 }
11181
11182
11185 {
11186 PlayerBase nplayer;
11187 if (PlayerBase.CastTo(nplayer, player))
11188 {
11190
11191 nplayer.SetEnableQuickBarEntityShortcut(this,!GetHierarchyParent() || GetHierarchyParent().GetInventory().AreChildrenAccessible());
11192 }
11193 }
11194
11195
11198 {
11199 PlayerBase nplayer;
11200 if (PlayerBase.CastTo(nplayer,player))
11201 {
11202
11203 nplayer.SetEnableQuickBarEntityShortcut(this,false);
11204
11205 }
11206
11207
11208 player.GetHumanInventory().ClearUserReservedLocationForContainer(this);
11209
11210
11211 if (HasEnergyManager())
11212 {
11213 GetCompEM().UpdatePlugState();
11214 }
11215 }
11216
11217
11219 {
11220 super.OnPlacementStarted(player);
11221
11223 }
11224
11225 override void OnPlacementComplete(Man player, vector position =
"0 0 0", vector orientation =
"0 0 0")
11226 {
11228 {
11229 m_AdminLog.OnPlacementComplete(player,
this);
11230 }
11231
11232 super.OnPlacementComplete(player, position, orientation);
11233 }
11234
11235
11236
11237
11238
11240 {
11242 {
11243 return true;
11244 }
11245 else
11246 {
11247 return false;
11248 }
11249 }
11250
11251
11253 {
11255 {
11257 }
11258 }
11259
11260
11262 {
11264 }
11265
11267 {
11269 }
11270
11271 override void InsertAgent(
int agent,
float count = 1)
11272 {
11273 if (count < 1)
11274 return;
11275
11277 }
11278
11281 {
11283 }
11284
11285
11287 {
11289 }
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11333 {
11335 return false;
11336 return true;
11337 }
11338
11340 {
11341
11343 }
11344
11345
11348 {
11349 super.CheckForRoofLimited(timeTresholdMS);
11350
11352 if ((time - m_PreviousRoofTestTime) >= timeTresholdMS)
11353 {
11354 m_PreviousRoofTestTime = time;
11355 SetRoofAbove(MiscGameplayFunctions.IsUnderRoof(this));
11356 }
11357 }
11358
11359
11361 {
11363 {
11364 return 0;
11365 }
11366
11367 if (GetInventory().GetAttachmentSlotsCount() != 0)
11368 {
11369 ItemBase filter =
ItemBase.Cast(FindAttachmentBySlotName(
"GasMaskFilter"));
11370 if (filter)
11371 return filter.GetProtectionLevel(type, false, system);
11372 else
11373 return 0;
11374 }
11375
11376 string subclassPath, entryName;
11377
11378 switch (type)
11379 {
11381 entryName = "biological";
11382 break;
11384 entryName = "chemical";
11385 break;
11386 default:
11387 entryName = "biological";
11388 break;
11389 }
11390
11391 subclassPath =
"CfgVehicles " + this.
GetType() +
" Protection ";
11392
11394 }
11395
11396
11397
11400 {
11401 if (!IsMagazine())
11403
11405 }
11406
11407
11408
11409
11410
11415 {
11416 return true;
11417 }
11418
11420 {
11422 }
11423
11424
11425
11426
11427
11429 {
11430 if (parent)
11431 {
11432 if (parent.IsInherited(DayZInfected))
11433 return true;
11434
11435 if (!parent.IsRuined())
11436 return true;
11437 }
11438
11439 return true;
11440 }
11441
11443 {
11444 if (!super.CanPutAsAttachment(parent))
11445 {
11446 return false;
11447 }
11448
11449 if (!IsRuined() && !parent.IsRuined())
11450 {
11451 return true;
11452 }
11453
11454 return false;
11455 }
11456
11458 {
11459
11460
11461
11462
11463 return super.CanReceiveItemIntoCargo(item);
11464 }
11465
11467 {
11468
11469
11470
11471
11472 GameInventory attachmentInv = attachment.GetInventory();
11474 {
11475 if (GetHierarchyParent() && !GetHierarchyParent().IsInherited(PlayerBase))
11476 return false;
11477 }
11478
11479 InventoryLocation loc = new InventoryLocation();
11480 attachment.GetInventory().GetCurrentInventoryLocation(loc);
11481 if (loc && loc.
IsValid() && !GetInventory().AreChildrenAccessible())
11482 return false;
11483
11484 return super.CanReceiveAttachment(attachment, slotId);
11485 }
11486
11488 {
11489 if (!super.CanReleaseAttachment(attachment))
11490 return false;
11491
11492 return GetInventory().AreChildrenAccessible();
11493 }
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11516 {
11517 int id = muzzle_owner.GetMuzzleID();
11518 array<ref WeaponParticlesOnFire> WPOF_array =
m_OnFireEffect.Get(
id);
11519
11520 if (WPOF_array)
11521 {
11522 for (int i = 0; i < WPOF_array.Count(); i++)
11523 {
11524 WeaponParticlesOnFire WPOF = WPOF_array.Get(i);
11525
11526 if (WPOF)
11527 {
11528 WPOF.OnActivate(weapon, muzzle_index, ammoType, muzzle_owner, suppressor, config_to_search);
11529 }
11530 }
11531 }
11532 }
11533
11534
11536 {
11537 int id = muzzle_owner.GetMuzzleID();
11539
11540 if (WPOBE_array)
11541 {
11542 for (int i = 0; i < WPOBE_array.Count(); i++)
11543 {
11544 WeaponParticlesOnBulletCasingEject WPOBE = WPOBE_array.Get(i);
11545
11546 if (WPOBE)
11547 {
11548 WPOBE.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11549 }
11550 }
11551 }
11552 }
11553
11554
11556 {
11557 int id = muzzle_owner.GetMuzzleID();
11558 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11559
11560 if (WPOOH_array)
11561 {
11562 for (int i = 0; i < WPOOH_array.Count(); i++)
11563 {
11564 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11565
11566 if (WPOOH)
11567 {
11568 WPOOH.OnActivate(weapon, 0, ammoType, muzzle_owner, suppressor, config_to_search);
11569 }
11570 }
11571 }
11572 }
11573
11574
11576 {
11577 int id = muzzle_owner.GetMuzzleID();
11578 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11579
11580 if (WPOOH_array)
11581 {
11582 for (int i = 0; i < WPOOH_array.Count(); i++)
11583 {
11584 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11585
11586 if (WPOOH)
11587 {
11588 WPOOH.OnUpdate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11589 }
11590 }
11591 }
11592 }
11593
11594
11596 {
11597 int id = muzzle_owner.GetMuzzleID();
11598 array<ref WeaponParticlesOnOverheating> WPOOH_array = weapon.m_OnOverheatingEffect.Get(id);
11599
11600 if (WPOOH_array)
11601 {
11602 for (int i = 0; i < WPOOH_array.Count(); i++)
11603 {
11604 WeaponParticlesOnOverheating WPOOH = WPOOH_array.Get(i);
11605
11606 if (WPOOH)
11607 {
11608 WPOOH.OnDeactivate(weapon, ammoType, muzzle_owner, suppressor, config_to_search);
11609 }
11610 }
11611 }
11612 }
11613
11614
11615
11617 {
11619 {
11620 return true;
11621 }
11622
11623 return false;
11624 }
11625
11627 {
11629 {
11630 return true;
11631 }
11632
11633 return false;
11634 }
11635
11637 {
11639 {
11640 return true;
11641 }
11642
11643 return false;
11644 }
11645
11647 {
11648 return false;
11649 }
11650
11653 {
11654 return UATimeSpent.DEFAULT_DEPLOY;
11655 }
11656
11657
11658
11659
11661 {
11663 SetSynchDirty();
11664 }
11665
11667 {
11669 }
11670
11671
11673 {
11674 return false;
11675 }
11676
11679 {
11680 string att_type = "None";
11681
11682 if (ConfigIsExisting("soundAttType"))
11683 {
11684 att_type = ConfigGetString("soundAttType");
11685 }
11686
11688 }
11689
11691 {
11693 }
11694
11695
11696
11697
11698
11702
11704 {
11707
11709 }
11710
11711
11713 {
11715 return;
11716
11718
11721
11724
11725 SoundParameters params = new SoundParameters();
11729 }
11730
11731
11733 {
11735 return;
11736
11738 SetSynchDirty();
11739
11742 }
11743
11744
11746 {
11748 return;
11749
11751 SetSynchDirty();
11752
11755 }
11756
11758 {
11760 }
11761
11763 {
11765 }
11766
11769 {
11770 if (!
GetGame().IsDedicatedServer())
11771 {
11772 if (ConfigIsExisting("attachSoundSet"))
11773 {
11774 string cfg_path = "";
11775 string soundset = "";
11776 string type_name =
GetType();
11777
11780 ConfigGetTextArray("attachSoundSet",cfg_soundset_array);
11781 ConfigGetTextArray("attachSoundSlot",cfg_slot_array);
11782
11783 if (cfg_soundset_array.Count() > 0 && cfg_soundset_array.Count() == cfg_slot_array.Count())
11784 {
11785 for (int i = 0; i < cfg_soundset_array.Count(); i++)
11786 {
11787 if (cfg_slot_array[i] == slot_type)
11788 {
11789 soundset = cfg_soundset_array[i];
11790 break;
11791 }
11792 }
11793 }
11794
11795 if (soundset != "")
11796 {
11797 EffectSound sound = SEffectManager.PlaySound(soundset,
GetPosition());
11799 }
11800 }
11801 }
11802 }
11803
11805 {
11806
11807 }
11808
11809 void OnApply(PlayerBase player);
11810
11812 {
11813 return 1.0;
11814 };
11815
11817 {
11819 }
11820
11822 {
11824 }
11825
11827
11829 {
11830 SetDynamicPhysicsLifeTime(0.01);
11832 }
11833
11835 {
11836 array<string> zone_names = new array<string>;
11837 GetDamageZones(zone_names);
11838 for (int i = 0; i < zone_names.Count(); i++)
11839 {
11840 SetHealthMax(zone_names.Get(i),"Health");
11841 }
11842 SetHealthMax("","Health");
11843 }
11844
11847 {
11848 float global_health = GetHealth01("","Health");
11849 array<string> zones = new array<string>;
11850 GetDamageZones(zones);
11851
11852 for (int i = 0; i < zones.Count(); i++)
11853 {
11854 SetHealth01(zones.Get(i),"Health",global_health);
11855 }
11856 }
11857
11860 {
11861 return IsExclusionFlagPresent(PlayerBase.GetFaceCoverageShaveValues());
11862 }
11863
11865 {
11866 if (!hasRootAsPlayer)
11867 {
11868 if (refParentIB)
11869 {
11870
11871 if ((refParentIB.GetWet() >= GameConstants.STATE_SOAKING_WET) && (
m_VarWet <
m_VarWetMax))
11872 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_INSIDE);
11873
11874 else if ((refParentIB.GetLiquidType() != 0) && (refParentIB.GetQuantity() > 0) && (
m_VarWet <
m_VarWetMax))
11875 AddWet(delta * GameConstants.WETNESS_RATE_WETTING_LIQUID);
11876
11879 }
11880 else
11881 {
11882
11885 }
11886 }
11887 }
11888
11890 {
11892 {
11893 float target =
g_Game.GetMission().GetWorldData().GetBaseEnvTemperatureAtObject(
this);
11894 if (GetTemperature() != target || !IsFreezeThawProgressFinished())
11895 {
11896 float heatPermCoef = 1.0;
11898 while (ent)
11899 {
11900 heatPermCoef *= ent.GetHeatPermeabilityCoef();
11901 ent = ent.GetHierarchyParent();
11902 }
11903
11904 SetTemperatureEx(
new TemperatureDataInterpolated(target,
ETemperatureAccessTypes.ACCESS_WORLD,delta,GameConstants.TEMP_COEF_WORLD,heatPermCoef));
11905 }
11906 }
11907 }
11908
11910 {
11911
11912 EntityAI parent = GetHierarchyParent();
11913 if (!parent)
11914 {
11915 hasParent = false;
11916 hasRootAsPlayer = false;
11917 }
11918 else
11919 {
11920 hasParent = true;
11921 hasRootAsPlayer = (GetHierarchyRootPlayer() != null);
11922 refParentIB =
ItemBase.Cast(parent);
11923 }
11924 }
11925
11926 protected void ProcessDecay(
float delta,
bool hasRootAsPlayer)
11927 {
11928
11929 }
11930
11932 {
11933
11934 return false;
11935 }
11936
11938 {
11939
11940
11941 return false;
11942 }
11943
11945 {
11946
11947 return false;
11948 }
11949
11952 {
11953 return !GetIsFrozen() &&
IsOpen();
11954 }
11955
11957 {
11958 bool hasParent = false, hasRootAsPlayer = false;
11960
11961 bool wwtu =
g_Game.IsWorldWetTempUpdateEnabled();
11962 bool foodDecay =
g_Game.IsFoodDecayEnabled();
11963
11964 if (wwtu || foodDecay)
11965 {
11969
11970 if (processWetness || processTemperature || processDecay)
11971 {
11973
11974 if (processWetness)
11975 ProcessItemWetness(m_ElapsedSinceLastUpdate, hasParent, hasRootAsPlayer, refParentIB);
11976
11977 if (processTemperature)
11979
11980 if (processDecay)
11981 ProcessDecay(m_ElapsedSinceLastUpdate, hasRootAsPlayer);
11982 }
11983 }
11984 }
11985
11988 {
11990 }
11991
11993 {
11996
11997 return super.GetTemperatureFreezeThreshold();
11998 }
11999
12001 {
12004
12005 return super.GetTemperatureThawThreshold();
12006 }
12007
12009 {
12012
12013 return super.GetItemOverheatThreshold();
12014 }
12015
12017 {
12019 return Math.Lerp(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureFreezeTime()),
GetQuantityNormalized());
12020
12021 return super.GetTemperatureFreezeTime();
12022 }
12023
12025 {
12027 return Math.Lerp(GameConstants.TEMPERATURE_TIME_THAW_MIN,Math.Max(GameConstants.TEMPERATURE_TIME_FREEZE_MIN,super.GetTemperatureThawTime()),
GetQuantityNormalized());
12028
12029 return super.GetTemperatureThawTime();
12030 }
12031
12036
12038 {
12039 return (item.IsKindOf("Cauldron") || item.IsKindOf("Pot") || item.IsKindOf("FryingPan") || item.IsKindOf("SmallProtectorCase") || (item.IsKindOf("PortableGasStove") && item.FindAttachmentBySlotName("CookingEquipment")));
12040 }
12041
12043 {
12044 MiscGameplayFunctions.TransferItemProperties(oldItem, this);
12045 }
12046
12049 {
12051 }
12052
12054 {
12056 }
12057
12059 {
12061 }
12062
12065 {
12066 return null;
12067 }
12068
12071 {
12072 return false;
12073 }
12074
12076 {
12078 {
12081 if (!trg)
12082 {
12084 explosive = this;
12085 }
12086
12087 explosive.PairRemote(trg);
12089
12090 int persistentID = RemotelyActivatedItemBehaviour.GeneratePersistentID();
12091 trg.SetPersistentPairID(persistentID);
12092 explosive.SetPersistentPairID(persistentID);
12093
12094 return true;
12095 }
12096 return false;
12097 }
12098
12101 {
12102 float ret = 1.0;
12105 ret *= GetHealth01();
12106
12107 return ret;
12108 }
12109
12110 #ifdef DEVELOPER
12111 override void SetDebugItem()
12112 {
12113 super.SetDebugItem();
12114 _itemBase = this;
12115 }
12116
12118 {
12119 string text = super.GetDebugText();
12120
12122 text +=
string.
Format(
"Heat isolation(modified): %1\n", MiscGameplayFunctions.GetCurrentItemHeatIsolation(
this));
12123
12124 return text;
12125 }
12126 #endif
12127
12129 {
12130 return true;
12131 }
12132
12134
12136
12138 {
12141 }
12142
12143
12151
12167}
12168
12170{
12172 if (entity)
12173 {
12174 bool is_item = entity.IsInherited(
ItemBase);
12175 if (is_item && full_quantity)
12176 {
12179 }
12180 }
12181 else
12182 {
12184 return NULL;
12185 }
12186 return entity;
12187}
12188
12190{
12191 if (item)
12192 {
12193 if (health > 0)
12194 item.SetHealth("", "", health);
12195
12196 if (item.CanHaveTemperature())
12197 {
12199 if (item.CanFreeze())
12200 item.SetFrozen(false);
12201 }
12202
12203 if (item.HasEnergyManager())
12204 {
12205 if (quantity >= 0)
12206 {
12207 item.GetCompEM().SetEnergy0To1(quantity);
12208 }
12209 else
12210 {
12212 }
12213 }
12214 else if (item.IsMagazine())
12215 {
12216 Magazine mag = Magazine.Cast(item);
12217 if (quantity >= 0)
12218 {
12219 mag.ServerSetAmmoCount(mag.GetAmmoMax() * quantity);
12220 }
12221 else
12222 {
12224 }
12225
12226 }
12227 else
12228 {
12229 if (quantity >= 0)
12230 {
12231 item.SetQuantityNormalized(quantity, false);
12232 }
12233 else
12234 {
12236 }
12237
12238 }
12239 }
12240}
12241
12242#ifdef DEVELOPER
12244#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.