DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс CatchingContextTrapsBase
+ Граф наследования:CatchingContextTrapsBase:

Защищенные члены

void DeserializeData (Param par)
 
void CreateResultDataStructure ()
 
void ClearCatchingItemData ()
 
void InitItemValues (EntityAI item)
 
float AdjustBaitItemChance (EntityAI item)
 Allows for adjustment of all catch probabilities from item qualities (damage, qty...)
 
void InitCatchEnviroMask ()
 
void Init (Param par)
 
void SetupInitialTypes ()
 
void UpdateDataAndMasks ()
 
int UpdateTrapEnviroMask ()
 
void SetTrapEnviroMask (int value)
 
void UpdateUsedBait (ECatchingBaitCategories type)
 if non-empty bait type is used, some 'Bait' attachment is picked as an active bait (currently no direct link between item and sensitivity-weighted target probability)
 
override void UpdateBaseProbability (YieldItemBase yItem)
 
override bool ModifySignalProbability (inout float probability)
 
void RemoveBait ()
 
void ReduceBaitQty (float qtyNorm)
 

Защищенные данные

float m_CumulativeTrappingSuccess
 after N attempts, the chance to catch should be this. Only highest one applies. @NOTE: Take care, only way to achieve guaranteed 1.0 chance at the end is to have EVERY chance at 1.0.
 
int m_AttemptsCount
 
ItemBase m_Bait
 

Подробное описание

Методы

◆ AdjustBaitItemChance()

float AdjustBaitItemChance ( EntityAI item)
inlineprotected

Allows for adjustment of all catch probabilities from item qualities (damage, qty...)

84 {
85 float ret = 1.0;
87 if (Class.CastTo(ib,item))
88 {
89 //ret *= ib.GetBaitEffectivity(); //disconnected for the Time Being
90 }
91
92 return ret;
93 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition InventoryItem.c:731
Definition EntityAI.c:95
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo().

Используется в InitItemValues().

◆ ClearCatchingItemData()

void ClearCatchingItemData ( )
inlineprotected
29 {
30 super.ClearCatchingItemData();
31
33 m_QualityBaseMod = 0.0;
36 }
float m_QualityBaseMod
Definition CatchingContextBase.c:20
float m_QualityDispersionMinMod
Definition CatchingContextBase.c:21
float m_QualityDispersionMaxMod
Definition CatchingContextBase.c:22
float m_CumulativeTrappingSuccess
after N attempts, the chance to catch should be this. Only highest one applies. @NOTE: Take care,...
Definition CatchingContextTraps.c:7

Перекрестные ссылки m_CumulativeTrappingSuccess, m_QualityBaseMod, m_QualityDispersionMaxMod и m_QualityDispersionMinMod.

◆ CreateResultDataStructure()

void CreateResultDataStructure ( )
inlineprotected
22 {
24
25 super.CreateResultDataStructure();
26 }
class BaitData m_MainItem
Definition ActionBase.c:36
ref CatchingResultBasic m_Result
Definition CatchingContextBase.c:27
Definition CarchingResultTrapBase.c:2

Перекрестные ссылки m_MainItem и m_Result.

◆ DeserializeData()

void DeserializeData ( Param par)
inlineprotected
12 {
14 if (Class.CastTo(p,par))
15 {
16 m_MainItem = p.param1;
17 m_AttemptsCount = p.param2;
18 }
19 }
int m_AttemptsCount
Definition CatchingContextTraps.c:8

Перекрестные ссылки Class::CastTo(), m_AttemptsCount и m_MainItem.

◆ Init()

void Init ( Param par)
inlineprotected
107 {
108 super.Init(par);
109
111 }
void GenerateResult()
Definition CatchingContextBase.c:257

Перекрестные ссылки GenerateResult().

◆ InitCatchEnviroMask()

void InitCatchEnviroMask ( )
inlineprotected
96 {
97 vector pos = m_MainItem.GetPosition();
98 if (GetGame().SurfaceIsSea(pos[0], pos[2]))
100 else if (GetGame().SurfaceIsPond( pos[0], pos[2]))
102 else
104 }
int m_EnviroMask
Definition CatchingContextBase.c:19
Definition CatchingConstants.c:2
static const int MASK_ENVIRO_LAND_ALL
Definition CatchingConstants.c:16
static const int MASK_ENVIRO_SEA
Definition CatchingConstants.c:12
static const int MASK_ENVIRO_POND
Definition CatchingConstants.c:11
Definition EnConvert.c:106
proto native CGame GetGame()

Перекрестные ссылки GetGame(), m_EnviroMask, m_MainItem, AnimalCatchingConstants::MASK_ENVIRO_LAND_ALL, AnimalCatchingConstants::MASK_ENVIRO_POND и AnimalCatchingConstants::MASK_ENVIRO_SEA.

Используется в UpdateTrapEnviroMask().

◆ InitItemValues()

void InitItemValues ( EntityAI item)
inlineprotected
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 {
51 GetGame().ConfigGetIntArray(path + " baitTypes",CachedObjectsArrays.ARRAY_INT);
52 GetGame().ConfigGetFloatArray(path + " baitTypeChances",CachedObjectsArrays.ARRAY_FLOAT);
55 {
56 int key;
57 float value;
58 for (int i = 0; i < count; i++)
59 {
62 if (!m_BaitCompatibilityMap.Contains(key) || (m_BaitCompatibilityMap.Get(key).m_BaseProbability < value))
63 {
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 }
ref map< int, ref BaitData > m_BaitCompatibilityMap
Definition CatchingContextBase.c:23
string path
Definition OptionSelectorMultistate.c:142
Definition CatchingContextBase.c:2
Definition UtilityClasses.c:41
static ref TIntArray ARRAY_INT
Definition UtilityClasses.c:51
static ref TFloatArray ARRAY_FLOAT
Definition UtilityClasses.c:50
float AdjustBaitItemChance(EntityAI item)
Allows for adjustment of all catch probabilities from item qualities (damage, qty....
Definition CatchingContextTraps.c:83
ErrorExSeverity
Definition EnDebug.c:62
enum ShapeType ErrorEx
const string CFG_VEHICLESPATH
Definition constants.c:217

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

◆ ModifySignalProbability()

override bool ModifySignalProbability ( inout float probability)
inlineprotected
221 {
223
224 return true;
225 }
Definition EnMath.c:7
static proto float Pow(float v, float power)
Return power of v ^ power.

Перекрестные ссылки m_AttemptsCount, m_CumulativeTrappingSuccess и Math::Pow().

Используется в UpdateBaseProbability().

◆ ReduceBaitQty()

void ReduceBaitQty ( float qtyNorm)
inlineprotected
234 {
235 if (m_Bait)
236 {
237 if (m_Bait.HasQuantity() && !m_Bait.CanBeSplit())
238 m_Bait.SetQuantityNormalized((m_Bait.GetQuantityNormalized() - qtyNorm));
239 else
240 m_Bait.DeleteSafe();
241 }
242 }
ItemBase m_Bait
Definition CatchingContextTraps.c:9
override bool CanBeSplit()
Definition Rag.c:34

Перекрестные ссылки ItemBase::CanBeSplit() и m_Bait.

◆ RemoveBait()

void RemoveBait ( )
inlineprotected
228 {
229 if (m_Bait)
230 m_Bait.DeleteSafe();
231 }

Перекрестные ссылки m_Bait.

◆ SetTrapEnviroMask()

void SetTrapEnviroMask ( int value)
inlineprotected
150 {
152 }

Перекрестные ссылки m_EnviroMask.

◆ SetupInitialTypes()

void SetupInitialTypes ( )
inlineprotected
114 {
115 #ifdef DEVELOPER
116 if (IsCLIParam("catchingLogs"))
117 {
118 Print("********************"); //just for debug purposes to track the start
119 Print("dbgTrapz | START");
120 Print("********************");
121 }
122 #endif
123
124 super.SetupInitialTypes();
125
126 #ifdef DEVELOPER
127 if (IsCLIParam("catchingLogs"))
128 {
129 Print("***"); //just for debug purposes to track the start
130 }
131 #endif
132 }
proto void Print(void var)
Prints content of variable to console/log.
proto native bool IsCLIParam(string param)
Returns if command line argument is present.

Перекрестные ссылки IsCLIParam() и Print().

Используется в UpdateDataAndMasks().

◆ UpdateBaseProbability()

override void UpdateBaseProbability ( YieldItemBase yItem)
inlineprotected
183 {
184 int baitType = ECatchingBaitCategories.BAIT_TYPE_EMPTY;
185 int usedType = -1;
186 float probability = -1;
187 float highestProbability = 0.0;
188 int count = m_BaitCompatibilityMap.Count();
189 for (int i = 0; i < count; i++)
190 {
192 probability = m_BaitCompatibilityMap.Get(baitType).m_BaseProbability * yItem.GetBaitTypeSensitivity(baitType);
194 {
197 }
198 }
199
201 #ifdef DEVELOPER
202 if (IsCLIParam("catchingLogs"))
203 {
204 //Print("********************");
205 Print("dbgTrapz | using bait type: " + baitType + " to catch: " + yItem);
206 }
207 #endif
209
210 #ifdef DEVELOPER
211 if (IsCLIParam("catchingLogs"))
212 {
213 float dbgProb;
215 Print("dbgTrapz | starting catching of " + yItem + " | at probability: " + dbgProb + " | with target success: " + m_CumulativeTrappingSuccess);
216 }
217 #endif
218 }
override bool ModifySignalProbability(inout float probability)
Definition CatchingContextTraps.c:220
void UpdateUsedBait(ECatchingBaitCategories type)
if non-empty bait type is used, some 'Bait' attachment is picked as an active bait (currently no dire...
Definition CatchingContextTraps.c:155
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.

Перекрестные ссылки Math::Clamp(), IsCLIParam(), m_BaitCompatibilityMap, m_CumulativeTrappingSuccess, ModifySignalProbability(), Print() и UpdateUsedBait().

◆ UpdateDataAndMasks()

void UpdateDataAndMasks ( )
inlineprotected
135 {
137 InitCatchMethodMask(); //bait check
138 //InitCatchEnviroMask(); //skipping, raycasts are unreliable outside network bubbles
141 }
void InitCatchingItemData()
Definition CatchingContextBase.c:217
void SetupProbabilityArray()
Definition CatchingContextBase.c:97
CatchingContextTrapsBase CatchingContextBase InitCatchMethodMask()
Definition CatchingContextTraps.c:247
void SetupInitialTypes()
Definition CatchingContextTraps.c:113

Перекрестные ссылки InitCatchingItemData(), InitCatchMethodMask(), SetupInitialTypes() и SetupProbabilityArray().

◆ UpdateTrapEnviroMask()

int UpdateTrapEnviroMask ( )
inlineprotected
144 {
146 return GetCatchEnviroMask();
147 }
int GetCatchEnviroMask()
Definition CatchingContextBase.c:164
void InitCatchEnviroMask()
Definition CatchingContextTraps.c:95

Перекрестные ссылки GetCatchEnviroMask() и InitCatchEnviroMask().

◆ UpdateUsedBait()

void UpdateUsedBait ( ECatchingBaitCategories type)
inlineprotected

if non-empty bait type is used, some 'Bait' attachment is picked as an active bait (currently no direct link between item and sensitivity-weighted target probability)

156 {
157 m_Bait = null;
158 if (type != ECatchingBaitCategories.BAIT_TYPE_EMPTY)
159 {
161 if (dta)
162 {
163 ItemBase potentialBait = ItemBase.Cast(dta.m_Owner);
166 }
167 else
168 ErrorEx("failed to acquire BaitData from type: " + type);
169 }
170
171 #ifdef DEVELOPER
172 if (IsCLIParam("catchingLogs"))
173 {
174 if (m_Bait)
175 Print("dbgTrapz | UpdateUsedBait to: " + m_Bait + " | with base bait probability used: " + m_BaitCompatibilityMap.Get(type).m_BaseProbability);
176 else
177 Print("dbgTrapz | UpdateUsedBait to 'null'!");
178 }
179 #endif
180 }

Перекрестные ссылки ErrorEx, IsCLIParam(), m_Bait, m_BaitCompatibilityMap, m_MainItem и Print().

Используется в UpdateBaseProbability().

Поля

◆ m_AttemptsCount

int m_AttemptsCount
protected

Используется в DeserializeData() и ModifySignalProbability().

◆ m_Bait

ItemBase m_Bait
protected

Используется в ReduceBaitQty(), RemoveBait() и UpdateUsedBait().

◆ m_CumulativeTrappingSuccess

m_CumulativeTrappingSuccess
protected

after N attempts, the chance to catch should be this. Only highest one applies. @NOTE: Take care, only way to achieve guaranteed 1.0 chance at the end is to have EVERY chance at 1.0.

Используется в ClearCatchingItemData(), ModifySignalProbability() и UpdateBaseProbability().


Объявления и описания членов класса находятся в файле: