DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ GetProtectionLevel()

float InventoryItem::GetProtectionLevel ( int type,
bool consider_filter = false,
int system = 0 )
inlineprotected

См. определение в файле ItemBase.c строка 4044

4045 {
4046 if (IsDamageDestroyed() || (HasQuantity() && GetQuantity() <= 0))
4047 {
4048 return 0;
4049 }
4050
4051 if (GetInventory().GetAttachmentSlotsCount() != 0)//is it an item with attachable filter ?
4052 {
4053 ItemBase filter = ItemBase.Cast(FindAttachmentBySlotName("GasMaskFilter"));
4054 if (filter)
4055 return filter.GetProtectionLevel(type, false, system);//it's a valid filter, return the protection
4056 else
4057 return 0;//otherwise return 0 when no filter attached
4058 }
4059
4060 string subclassPath, entryName;
4061
4062 switch (type)
4063 {
4064 case DEF_BIOLOGICAL:
4065 entryName = "biological";
4066 break;
4067 case DEF_CHEMICAL:
4068 entryName = "chemical";
4069 break;
4070 default:
4071 entryName = "biological";
4072 break;
4073 }
4074
4075 subclassPath = "CfgVehicles " + this.GetType() + " Protection ";
4076
4077 return GetGame().ConfigGetFloat(subclassPath + entryName);
4078 }
eBleedingSourceType GetType()
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override float GetQuantity()
Определения ItemBase.c:3456
override bool HasQuantity()
Определения ItemBase.c:3451
void ItemBase()
Определения ItemBase.c:140
proto native CGame GetGame()
const int DEF_BIOLOGICAL
Определения 3_Game/constants.c:512
const int DEF_CHEMICAL
Определения 3_Game/constants.c:513

Перекрестные ссылки CGame::ConfigGetFloat(), DEF_BIOLOGICAL, DEF_CHEMICAL, GetGame(), GetQuantity(), GetType(), HasQuantity() и ItemBase().