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

◆ InitItemValues()

void CatchingContextTrapsBase::InitItemValues ( EntityAI item)
inlineprotected

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

39 {
40 //skip ruined or deleted items entirely
41 if (item.IsRuined() || item.IsSetForDeletion())
42 return;
43
44 string path = "" + CFG_VEHICLESPATH + " " + item.GetType() + " Trapping";
45 if (GetGame().ConfigIsExisting(path))
46 {
47 if (GetGame().ConfigIsExisting(path + " baitTypes") && GetGame().ConfigIsExisting(path + " baitTypeChances"))
48 {
49 CachedObjectsArrays.ARRAY_INT.Clear();
50 CachedObjectsArrays.ARRAY_FLOAT.Clear();
51 GetGame().ConfigGetIntArray(path + " baitTypes",CachedObjectsArrays.ARRAY_INT);
52 GetGame().ConfigGetFloatArray(path + " baitTypeChances",CachedObjectsArrays.ARRAY_FLOAT);
53 int count = CachedObjectsArrays.ARRAY_INT.Count();
54 if (count == CachedObjectsArrays.ARRAY_FLOAT.Count())
55 {
56 int key;
57 float value;
58 for (int i = 0; i < count; i++)
59 {
60 key = CachedObjectsArrays.ARRAY_INT[i];
61 value = AdjustBaitItemChance(item) * CachedObjectsArrays.ARRAY_FLOAT[i];
62 if (!m_BaitCompatibilityMap.Contains(key) || (m_BaitCompatibilityMap.Get(key).m_BaseProbability < value))
63 {
64 m_BaitCompatibilityMap.Set(key,new BaitData(value,item));
65 }
66 }
67 }
68 else
69 {
70 ErrorEx("'baitTypes' and 'baitTypeChances' arrray counts of " + item.GetType() + " do not match!",ErrorExSeverity.INFO);
71 }
72 }
73 if (GetGame().ConfigIsExisting(path + " resultQuantityBaseMod"))
74 m_QualityBaseMod += GetGame().ConfigGetFloat(path + " resultQuantityBaseMod");
75 if (GetGame().ConfigIsExisting(path + " resultQuantityDispersionMin"))
76 m_QualityDispersionMinMod += GetGame().ConfigGetFloat(path + " resultQuantityDispersionMin");
77 if (GetGame().ConfigIsExisting(path + " resultQuantityDispersionMax"))
78 m_QualityDispersionMaxMod += GetGame().ConfigGetFloat(path + " resultQuantityDispersionMax");
79 }
80 }
float m_QualityBaseMod
Определения CatchingContextBase.c:20
ref map< int, ref BaitData > m_BaitCompatibilityMap
Определения CatchingContextBase.c:23
float m_QualityDispersionMinMod
Определения CatchingContextBase.c:21
float m_QualityDispersionMaxMod
Определения CatchingContextBase.c:22
string path
Определения OptionSelectorMultistate.c:142
proto native float ConfigGetFloat(string path)
Get float value from config on path.
proto native void ConfigGetIntArray(string path, out TIntArray values)
Get array of integers from config on path.
proto native void ConfigGetFloatArray(string path, out TFloatArray values)
Get array of floats from config on path.
float AdjustBaitItemChance(EntityAI item)
Allows for adjustment of all catch probabilities from item qualities (damage, qty....
Определения CatchingContextTraps.c:83
proto native CGame GetGame()
ErrorExSeverity
Определения EnDebug.c:62
enum ShapeType ErrorEx
const string CFG_VEHICLESPATH
Определения constants.c:220

Перекрестные ссылки AdjustBaitItemChance(), CachedObjectsArrays::ARRAY_FLOAT, CachedObjectsArrays::ARRAY_INT, CFG_VEHICLESPATH, CGame::ConfigGetFloat(), CGame::ConfigGetFloatArray(), CGame::ConfigGetIntArray(), ErrorEx, GetGame(), m_BaitCompatibilityMap, m_QualityBaseMod, m_QualityDispersionMaxMod, m_QualityDispersionMinMod и path.