53 super.CreateResultDataStructure();
59 super.ClearCatchingItemData();
78 super.InitCatchingItemData();
103 Debug.
Log(
"---InitCatchingItemData---",
"Fishing");
121 if (item.IsRuined() || item.IsSetForDeletion())
127 if (
g_Game.ConfigIsExisting(
path +
" resultQuantityBaseMod"))
129 if (
g_Game.ConfigIsExisting(
path +
" resultQuantityDispersionMin"))
131 if (
g_Game.ConfigIsExisting(
path +
" resultQuantityDispersionMax"))
133 if (
g_Game.ConfigIsExisting(
path +
" hookLossChanceMod"))
135 if (
g_Game.ConfigIsExisting(
path +
" baitLossChanceMod"))
138 if (
g_Game.ConfigIsExisting(
path +
" signalDurationMin"))
144 if (
g_Game.ConfigIsExisting(
path +
" signalDurationMax"))
151 if (
g_Game.ConfigIsExisting(
path +
" signalCycleTargetAdjustment"))
153 if (
g_Game.ConfigIsExisting(
path +
" signalCycleTargetEndAdjustment"))
158 if (item.GetInventory().GetCurrentAttachmentSlotInfo(slotID,
slotName))
195 Debug.
Log(
"---ModifySignalProbability---",
"Fishing");
197 Debug.
Log(
"easingTime: " + easingTime,
"Fishing");
198 Debug.
Log(
"probability: " + probability,
"Fishing");
212 bool ret = super.RollCatch();
234 return m_Result.GetYieldItemParticleId();
265 Debug.
Log(
"---RandomizeSignalDuration---",
"Fishing");
266 Debug.
Log(
"next signal duration: " + res,
"Fishing");
279 Debug.
Log(
"---RandomizeSignalStartTime---",
"Fishing");
280 Debug.
Log(
"next signal start time: " + res,
"Fishing");
296 if (lossChance >= 1 || roll < lossChance)
305 if (item && !
m_Player.IsQuickFishing())
307 item.SetPrepareToDelete();
322 if (lossChance >= 1 || roll < lossChance)
331 if (!
g_Game.IsMultiplayer() ||
g_Game.IsDedicatedServer())
342 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_METHOD_ROD
const float POISSON_CYCLE_MEAN_DEFAULT
static const int MASK_ENVIRO_SEA
static const int MASK_ENVIRO_POND
float GetCurrentCycleTime(CatchingContextFishingRodAction ctx)
float m_SignalPoissonMean
float GetBaitLossChanceModifierClamped()
void ClearCatchingItemData()
only clear stuff you need to update
float RandomizeSignalStartTime()
override void GenerateResult()
done locally on both sides, needs a synced random
float m_SignalDurationMax
float m_SignalTargetProbability
float m_SignalStartTimeMin
override bool RollCatch()
void RemoveItemSafe(EntityAI item)
float GetActionCycleTime()
void InitCatchMethodMask()
override bool ModifySignalProbability(inout float probability)
override void InitCatchingItemData()
float m_HookLossChanceMod
float m_SignalCycleTargetAdjustment
float m_SignalCycleTargetEndAdjustment
float GetSignalPoissonMean()
Deprecated, left here due to inheritance change.
void InitItemValues(EntityAI item)
float GetHookLossChanceModifierClamped()
float m_SignalCycleEndTarget
float m_SignalTargetEndProbability
void CreateResultDataStructure()
int GetSignalMax()
Deprecated, left here due to inheritance change.
void OnBeforeSpawnSignalHit()
float m_SignalCycleTarget
int GetResultParticleId()
float m_SignalStartTimeMax
float RandomizeSignalDuration()
void ResetSignalCounter()
void OnSignalMiss()
release without signal
override EntityAI SpawnAndSetupCatch(out int yItemIdx, vector v=vector.Zero)
float m_BaitLossChanceMod
void InitCatchEnviroMask()
void RecalculateProcessingData()
float m_SignalDurationMin
void OnAfterSpawnSignalHit()
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.
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
static float EaseInExpo(float t)
Base Param Class with no parameters.
const float SIGNAL_START_TIME_MAX_BASE
const float DAMAGE_HOOK
modifies chance for every signal roll
const float SIGNAL_DURATION_MAX_BASE
const float SIGNAL_START_TIME_MIN_BASE
const float SIGNAL_DURATION_MIN_BASE
const float SIGNAL_CYCLE_MEAN_DEFAULT
const float SIGNAL_CYCLE_HARD_TARGET_DEFAULT
chance at MEAN
const float SIGNAL_MEAN_CHANCE_DEFAULT
re-purposed as soft cycle target
const float SIGNAL_FISHING_CHANCE_COEF
chance at HARD_TARGET (we probably want close to 100% here, randomness being random....
const float SIGNAL_HARD_TARGET_CHANCE_DEFAULT
hard cycle target
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.