25 super.CreateResultDataStructure();
30 super.ClearCatchingItemData();
41 if (item.IsRuined() || item.IsSetForDeletion())
47 if (
GetGame().ConfigIsExisting(
path +
" baitTypes") &&
GetGame().ConfigIsExisting(
path +
" baitTypeChances"))
58 for (
int i = 0; i < count; i++)
70 ErrorEx(
"'baitTypes' and 'baitTypeChances' arrray counts of " + item.GetType() +
" do not match!",
ErrorExSeverity.INFO);
73 if (
GetGame().ConfigIsExisting(
path +
" resultQuantityBaseMod"))
75 if (
GetGame().ConfigIsExisting(
path +
" resultQuantityDispersionMin"))
77 if (
GetGame().ConfigIsExisting(
path +
" resultQuantityDispersionMax"))
98 if (
GetGame().SurfaceIsSea(pos[0], pos[2]))
100 else if (
GetGame().SurfaceIsPond( pos[0], pos[2]))
118 Print(
"********************");
119 Print(
"dbgTrapz | START");
120 Print(
"********************");
124 super.SetupInitialTypes();
158 if (type != ECatchingBaitCategories.BAIT_TYPE_EMPTY)
168 ErrorEx(
"failed to acquire BaitData from type: " + type);
177 Print(
"dbgTrapz | UpdateUsedBait to 'null'!");
184 int baitType = ECatchingBaitCategories.BAIT_TYPE_EMPTY;
186 float probability = -1;
187 float highestProbability = 0.0;
189 for (
int i = 0; i < count; i++)
193 if (probability > highestProbability)
195 highestProbability = probability;
205 Print(
"dbgTrapz | using bait type: " + baitType +
" to catch: " + yItem);
238 m_Bait.SetQuantityNormalized((
m_Bait.GetQuantityNormalized() - qtyNorm));
249 m_MethodMask = AnimalCatchingConstants.MASK_METHOD_FISHTRAP_SMALL;
265 m_MethodMask = AnimalCatchingConstants.MASK_METHOD_LANDTRAP_SNARE;
ref map< int, ref BaitData > m_BaitCompatibilityMap
class BaitData m_MainItem
ref CatchingResultBasic m_Result
float m_QualityDispersionMinMod
void InitCatchingItemData()
void CatchingContextBase(Param par)
float m_QualityDispersionMaxMod
void SetupProbabilityArray()
CatchingContextTrapsBase CatchingContextBase InitCatchMethodMask()
static const int MASK_ENVIRO_POND
static const int MASK_METHOD_FISHTRAP_LARGE
static const int MASK_ENVIRO_LAND_ALL
static const int MASK_ENVIRO_SEA
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.
static ref TIntArray ARRAY_INT
static ref TFloatArray ARRAY_FLOAT
void InitCatchMethodMask()
float AdjustBaitItemChance(EntityAI item)
Allows for adjustment of all catch probabilities from item qualities (damage, qty....
void InitCatchEnviroMask()
void DeserializeData(Param par)
void ClearCatchingItemData()
void ReduceBaitQty(float qtyNorm)
float m_CumulativeTrappingSuccess
after N attempts, the chance to catch should be this. Only highest one applies. @NOTE: Take care,...
void InitItemValues(EntityAI item)
override void UpdateBaseProbability(YieldItemBase yItem)
int UpdateTrapEnviroMask()
void UpdateDataAndMasks()
override bool ModifySignalProbability(inout float probability)
void CreateResultDataStructure()
void UpdateUsedBait(ECatchingBaitCategories type)
if non-empty bait type is used, some 'Bait' attachment is picked as an active bait (currently no dire...
void SetTrapEnviroMask(int value)
Super root of all classes in Enforce script.
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
float GetBaitTypeSensitivity(ECatchingBaitCategories type)
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
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'.
static proto float Pow(float v, float power)
Return power of v ^ power.
proto native bool IsCLIParam(string param)
Returns if command line argument is present.