53 super.CreateResultDataStructure();
59 super.ClearCatchingItemData();
78 super.InitCatchingItemData();
103 Debug.
Log(
"---InitCatchingItemData---",
"Fishing");
121 if (item.IsRuined() || item.IsSetForDeletion())
127 if (
GetGame().ConfigIsExisting(
path +
" resultQuantityBaseMod"))
129 if (
GetGame().ConfigIsExisting(
path +
" resultQuantityDispersionMin"))
131 if (
GetGame().ConfigIsExisting(
path +
" resultQuantityDispersionMax"))
133 if (
GetGame().ConfigIsExisting(
path +
" hookLossChanceMod"))
135 if (
GetGame().ConfigIsExisting(
path +
" baitLossChanceMod"))
138 if (
GetGame().ConfigIsExisting(
path +
" signalDurationMin"))
144 if (
GetGame().ConfigIsExisting(
path +
" signalDurationMax"))
151 if (
GetGame().ConfigIsExisting(
path +
" signalCycleTargetAdjustment"))
153 if (
GetGame().ConfigIsExisting(
path +
" signalCycleTargetEndAdjustment"))
158 if (item.GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName))
191 Debug.
Log(
"---ModifySignalProbability---",
"Fishing");
193 Debug.
Log(
"easingTime: " + easingTime,
"Fishing");
194 Debug.
Log(
"probability: " + probability,
"Fishing");
208 bool ret = super.RollCatch();
230 return m_Result.GetYieldItemParticleId();
261 Debug.
Log(
"---RandomizeSignalDuration---",
"Fishing");
262 Debug.
Log(
"next signal duration: " + res,
"Fishing");
275 Debug.
Log(
"---RandomizeSignalStartTime---",
"Fishing");
276 Debug.
Log(
"next signal start time: " + res,
"Fishing");
292 if (lossChance >= 1 || roll < lossChance)
301 if (item && !
m_Player.IsQuickFishing())
303 item.SetPrepareToDelete();
318 if (lossChance >= 1 || roll < lossChance)
338 return super.SpawnAndSetupCatch(yItemIdx,v);
void UpdateCatchingItemData()
class BaitData m_MainItem
ref CatchingResultBasic m_Result
float m_QualityDispersionMinMod
ref array< int > m_ProbabilityArray
float m_QualityDispersionMaxMod
PlayerSpawnPreset slotName
static const int MASK_ENVIRO_POND
static const int MASK_METHOD_ROD
const float POISSON_CYCLE_MEAN_DEFAULT
static const int MASK_ENVIRO_SEA
proto native float ConfigGetFloat(string path)
Get float value from config on path.
float GetCurrentCycleTime(CatchingContextFishingRodAction ctx)
float m_SignalTargetEndProbability
void ResetSignalCounter()
void OnAfterSpawnSignalHit()
int GetResultParticleId()
float m_SignalPoissonMean
void RecalculateProcessingData()
override bool ModifySignalProbability(inout float probability)
void InitItemValues(EntityAI item)
float GetSignalPoissonMean()
Deprecated, left here due to inheritance change.
void RemoveItemSafe(EntityAI item)
float RandomizeSignalDuration()
void ClearCatchingItemData()
only clear stuff you need to update
float GetHookLossChanceModifierClamped()
void InitCatchEnviroMask()
void OnSignalMiss()
release without signal
float m_SignalDurationMax
float m_SignalStartTimeMin
float m_SignalStartTimeMax
override void InitCatchingItemData()
float RandomizeSignalStartTime()
void CreateResultDataStructure()
float GetActionCycleTime()
float m_SignalDurationMin
int GetSignalMax()
Deprecated, left here due to inheritance change.
float GetBaitLossChanceModifierClamped()
float m_SignalCycleEndTarget
void InitCatchMethodMask()
void OnBeforeSpawnSignalHit()
float m_SignalCycleTargetEndAdjustment
override EntityAI SpawnAndSetupCatch(out int yItemIdx, vector v=vector.Zero)
float m_SignalCycleTarget
float m_HookLossChanceMod
override bool RollCatch()
float m_BaitLossChanceMod
float m_SignalCycleTargetAdjustment
override void GenerateResult()
done locally on both sides, needs a synced random
float m_SignalTargetProbability
Super root of all classes in Enforce script.
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
static float EaseInExpo(float t)
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
const float DAMAGE_HOOK
modifies chance for every signal roll
const float SIGNAL_START_TIME_MAX_BASE
const float SIGNAL_START_TIME_MIN_BASE
const float SIGNAL_DURATION_MIN_BASE
const float SIGNAL_DURATION_MAX_BASE
const float SIGNAL_MEAN_CHANCE_DEFAULT
re-purposed as soft cycle target
const float SIGNAL_CYCLE_MEAN_DEFAULT
const float SIGNAL_CYCLE_HARD_TARGET_DEFAULT
chance at MEAN
const float SIGNAL_HARD_TARGET_CHANCE_DEFAULT
hard cycle target
const float SIGNAL_FISHING_CHANCE_COEF
chance at HARD_TARGET (we probably want close to 100% here, randomness being random....
proto native CGame GetGame()
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 InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
static proto float Ceil(float f)
Returns ceil of value.
proto native bool IsCLIParam(string param)
Returns if command line argument is present.