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

◆ GetProtectionLevel()

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

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

3975 {
3976 if (IsDamageDestroyed() || (HasQuantity() && GetQuantity() <= 0))
3977 {
3978 return 0;
3979 }
3980
3981 if (GetInventory().GetAttachmentSlotsCount() != 0)//is it an item with attachable filter ?
3982 {
3983 ItemBase filter = ItemBase.Cast(FindAttachmentBySlotName("GasMaskFilter"));
3984 if (filter)
3985 return filter.GetProtectionLevel(type, false, system);//it's a valid filter, return the protection
3986 else
3987 return 0;//otherwise return 0 when no filter attached
3988 }
3989
3990 string subclassPath, entryName;
3991
3992 switch (type)
3993 {
3994 case DEF_BIOLOGICAL:
3995 entryName = "biological";
3996 break;
3997 case DEF_CHEMICAL:
3998 entryName = "chemical";
3999 break;
4000 default:
4001 entryName = "biological";
4002 break;
4003 }
4004
4005 subclassPath = "CfgVehicles " + this.GetType() + " Protection ";
4006
4007 return GetGame().ConfigGetFloat(subclassPath + entryName);
4008 }
eBleedingSourceType GetType()
Определения BleedingSource.c:63
proto native float ConfigGetFloat(string path)
Get float value from config on path.
override float GetQuantity()
Определения ItemBase.c:3386
override bool HasQuantity()
Определения ItemBase.c:3381
void ItemBase()
Определения ItemBase.c:140
proto native CGame GetGame()
const int DEF_BIOLOGICAL
Определения constants.c:510
const int DEF_CHEMICAL
Определения constants.c:511

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