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

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

void Init (Param par)
 
void InitCatchMethodMask ()
 
void InitCatchEnviroMask ()
 
void CreateResultDataStructure ()
 
void ClearCatchingItemData ()
 only clear stuff you need to update
 
void InitItemValues (EntityAI item)
 
override void GenerateResult ()
 done locally on both sides, needs a synced random
 
int GetResultParticleId ()
 
void RecalculateProcessingData ()
 
float GetHookLossChanceModifierClamped ()
 
float GetBaitLossChanceModifierClamped ()
 
float GetActionCycleTime ()
 
float RandomizeSignalDuration ()
 
float RandomizeSignalStartTime ()
 
override float GetChanceCoef ()
 
void TryHookLoss ()
 
void RemoveItemSafe (EntityAI item)
 
void TryBaitLoss ()
 
void TryDamageItems ()
 
override EntityAI SpawnAndSetupCatch (out int yItemIdx, vector v=vector.Zero)
 
void OnBeforeSpawnSignalHit ()
 
void OnAfterSpawnSignalHit ()
 
void OnSignalMiss ()
 release without signal
 
void OnSignalPass ()
 

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

PlayerBase m_Player
 
float m_BaitLossChanceMod
 
float m_HookLossChanceMod
 
float m_SignalDurationMin
 
float m_SignalDurationMax
 
float m_SignalStartTimeMin
 
float m_SignalStartTimeMax
 
EntityAI m_Hook
 
EntityAI m_Bait
 
EntityAI m_Rod
 

Дополнительные унаследованные члены

- Закрытые члены унаследованные от CatchingContextFishingBase
void DeserializeData (Param par)
 

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

Методы

◆ ClearCatchingItemData()

void ClearCatchingItemData ( )
inlineprotected

only clear stuff you need to update

52 {
53 super.ClearCatchingItemData();
54
58 }
float m_HookLossChanceMod
Definition CatchingContextFishingRodAction.c:6
float m_BaitLossChanceMod
Definition CatchingContextFishingRodAction.c:5
float m_SignalPoissonMean
Definition CatchingContextPoissonBase.c:3
Definition EntityAI.c:95
Definition ActionConstants.c:174
const float SIGNAL_CYCLE_MEAN_DEFAULT
Definition ActionConstants.c:184

Перекрестные ссылки m_BaitLossChanceMod, m_HookLossChanceMod, CatchingContextPoissonBase::m_SignalPoissonMean и UAFishingConstants::SIGNAL_CYCLE_MEAN_DEFAULT.

◆ CreateResultDataStructure()

void CreateResultDataStructure ( )
inlineprotected
44 {
46
47 super.CreateResultDataStructure();
48 }
class BaitData m_MainItem
Definition ActionBase.c:36
ref CatchingResultBasic m_Result
Definition CatchingContextBase.c:27
Definition CarchingResultFishingAction.c:2

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

◆ GenerateResult()

override void GenerateResult ( )
inlineprotected

done locally on both sides, needs a synced random

102 {
104 int idx = m_Player.GetRandomGeneratorSyncManager().GetRandomInRange(RandomGeneratorSyncUsage.RGSAnimalCatching,0,m_ProbabilityArray.Count() - 1);
106 m_Result.SetYieldItem(yItem);
107 }
ref array< int > m_ProbabilityArray
Definition CatchingContextBase.c:26
YieldsMap m_YieldsMapAll
Definition CatchingContextBase.c:16
RandomGeneratorSyncUsage
Definition RandomGeneratorSyncManager.c:2
PlayerBase m_Player
Definition CatchingContextFishingRodAction.c:3
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition CatchYieldItemBase.c:2
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), m_Player, m_ProbabilityArray, m_Result и m_YieldsMapAll.

◆ GetActionCycleTime()

float GetActionCycleTime ( )
inlineprotected
133 {
135 }
float GetCurrentCycleTime(CatchingContextFishingRodAction ctx)
Definition CarchingResultFishingAction.c:14

Перекрестные ссылки CarchingResultFishingAction::GetCurrentCycleTime() и m_Result.

◆ GetBaitLossChanceModifierClamped()

float GetBaitLossChanceModifierClamped ( )
inlineprotected
128 {
129 return Math.Clamp(m_BaitLossChanceMod,0,1);
130 }
Definition EnMath.c:7
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() и m_BaitLossChanceMod.

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

◆ GetChanceCoef()

override float GetChanceCoef ( )
inlineprotected
148 {
150 }
const float SIGNAL_FISHING_CHANCE_COEF
Definition ActionConstants.c:185

Перекрестные ссылки UAFishingConstants::SIGNAL_FISHING_CHANCE_COEF.

◆ GetHookLossChanceModifierClamped()

float GetHookLossChanceModifierClamped ( )
inlineprotected
123 {
124 return Math.Clamp(m_HookLossChanceMod,0.001,1);
125 }

Перекрестные ссылки Math::Clamp() и m_HookLossChanceMod.

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

◆ GetResultParticleId()

int GetResultParticleId ( )
inlineprotected
110 {
111 if (m_Result)
112 return m_Result.GetYieldItemParticleId();
113
114 return ParticleList.INVALID;
115 }
Definition ParticleList.c:12
static const int INVALID
Definition ParticleList.c:20

Перекрестные ссылки ParticleList::INVALID и m_Result.

◆ Init()

void Init ( Param par)
inlineprotected
19 {
20 super.Init(par);
21
22 m_Rod = m_MainItem; //only stable one, rest initialized on 'InitItemValues' periodically
23 m_Player = PlayerBase.Cast(m_MainItem.GetHierarchyRootPlayer());
28 }
EntityAI m_Rod
Definition CatchingContextFishingRodAction.c:16
float m_SignalDurationMax
Definition CatchingContextFishingRodAction.c:9
float m_SignalStartTimeMin
Definition CatchingContextFishingRodAction.c:10
float m_SignalStartTimeMax
Definition CatchingContextFishingRodAction.c:11
float m_SignalDurationMin
Definition CatchingContextFishingRodAction.c:8
Definition PlayerBaseClient.c:2
const float SIGNAL_START_TIME_MAX_BASE
Definition ActionConstants.c:181
const float SIGNAL_DURATION_MAX_BASE
Definition ActionConstants.c:179
const float SIGNAL_START_TIME_MIN_BASE
Definition ActionConstants.c:180
const float SIGNAL_DURATION_MIN_BASE
Definition ActionConstants.c:178

Перекрестные ссылки m_MainItem, m_Player, m_Rod, m_SignalDurationMax, m_SignalDurationMin, m_SignalStartTimeMax, m_SignalStartTimeMin, UAFishingConstants::SIGNAL_DURATION_MAX_BASE, UAFishingConstants::SIGNAL_DURATION_MIN_BASE, UAFishingConstants::SIGNAL_START_TIME_MAX_BASE и UAFishingConstants::SIGNAL_START_TIME_MIN_BASE.

◆ InitCatchEnviroMask()

void InitCatchEnviroMask ( )
inlineprotected
36 {
37 if (m_IsSea)
39 else
41 }
int m_EnviroMask
Definition CatchingContextBase.c:19
Definition CatchingConstants.c:2
static const int MASK_ENVIRO_SEA
Definition CatchingConstants.c:12
static const int MASK_ENVIRO_POND
Definition CatchingConstants.c:11
bool m_IsSea
Definition CatchingContextFishingBase.c:3

Перекрестные ссылки m_EnviroMask, CatchingContextFishingBase::m_IsSea, AnimalCatchingConstants::MASK_ENVIRO_POND и AnimalCatchingConstants::MASK_ENVIRO_SEA.

◆ InitCatchMethodMask()

void InitCatchMethodMask ( )
inlineprotected
31 {
33 }
int m_MethodMask
Definition CatchingContextBase.c:18
static const int MASK_METHOD_ROD
Definition CatchingConstants.c:19

Перекрестные ссылки m_MethodMask и AnimalCatchingConstants::MASK_METHOD_ROD.

◆ InitItemValues()

void InitItemValues ( EntityAI item)
inlineprotected
61 {
62 //skip ruined or deleted items entirely
63 if (item.IsRuined() || item.IsSetForDeletion())
64 return;
65
66 string path = "" + CFG_VEHICLESPATH + " " + item.GetType() + " Fishing";
67 if (GetGame().ConfigIsExisting(path))
68 {
69 if (GetGame().ConfigIsExisting(path + " signalCycleTarget"))
70 m_SignalPoissonMean = Math.Min(m_SignalPoissonMean,GetGame().ConfigGetFloat(path + " signalCycleTarget"));
71 if (GetGame().ConfigIsExisting(path + " resultQuantityBaseMod"))
72 m_QualityBaseMod += GetGame().ConfigGetFloat(path + " resultQuantityBaseMod");
73 if (GetGame().ConfigIsExisting(path + " resultQuantityDispersionMin"))
74 m_QualityDispersionMinMod += GetGame().ConfigGetFloat(path + " resultQuantityDispersionMin");
75 if (GetGame().ConfigIsExisting(path + " resultQuantityDispersionMax"))
76 m_QualityDispersionMaxMod += GetGame().ConfigGetFloat(path + " resultQuantityDispersionMax");
77 if (GetGame().ConfigIsExisting(path + " hookLossChanceMod"))
78 m_HookLossChanceMod += GetGame().ConfigGetFloat(path + " hookLossChanceMod");
79 if (GetGame().ConfigIsExisting(path + " baitLossChanceMod"))
80 m_BaitLossChanceMod += GetGame().ConfigGetFloat(path + " baitLossChanceMod");
81
82 int slotID;
83 string slotName;
84 if (item.GetInventory().GetCurrentAttachmentSlotInfo(slotID,slotName))
85 {
86 switch (slotName)
87 {
88 case "Bait":
89 m_Bait = item;
90 break;
91
92 case "Hook":
93 m_Hook = item;
94 break;
95 }
96 }
97 }
98 }
float m_QualityBaseMod
Definition CatchingContextBase.c:20
float m_QualityDispersionMinMod
Definition CatchingContextBase.c:21
float m_QualityDispersionMaxMod
Definition CatchingContextBase.c:22
PlayerSpawnPreset slotName
string path
Definition OptionSelectorMultistate.c:142
EntityAI m_Hook
Definition CatchingContextFishingRodAction.c:14
EntityAI m_Bait
Definition CatchingContextFishingRodAction.c:15
proto native CGame GetGame()
static proto float Min(float x, float y)
Returns smaller of two given values.
const string CFG_VEHICLESPATH
Definition constants.c:217

Перекрестные ссылки CFG_VEHICLESPATH, GetGame(), m_Bait, m_BaitLossChanceMod, m_Hook, m_HookLossChanceMod, m_QualityBaseMod, m_QualityDispersionMaxMod, m_QualityDispersionMinMod, CatchingContextPoissonBase::m_SignalPoissonMean, Math::Min(), path и slotName.

◆ OnAfterSpawnSignalHit()

void OnAfterSpawnSignalHit ( )
inlineprotected
219 {
223 }
void UpdateCatchingItemData()
Definition CatchingContextBase.c:211
void TryDamageItems()
Definition CatchingContextFishingRodAction.c:195
void RemoveItemSafe(EntityAI item)
Definition CatchingContextFishingRodAction.c:169

Перекрестные ссылки m_Bait, RemoveItemSafe(), TryDamageItems() и UpdateCatchingItemData().

◆ OnBeforeSpawnSignalHit()

void OnBeforeSpawnSignalHit ( )
inlineprotected
214 {
215 TryHookLoss();
216 }
void TryHookLoss()
Definition CatchingContextFishingRodAction.c:152

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

◆ OnSignalMiss()

void OnSignalMiss ( )
inlineprotected

release without signal

227 {
228 TryHookLoss();
229 TryBaitLoss();
230 //RemoveItemSafe(m_Bait);
231 //TryDamageItems();
233 }
void TryBaitLoss()
Definition CatchingContextFishingRodAction.c:178

Перекрестные ссылки TryBaitLoss(), TryHookLoss() и UpdateCatchingItemData().

◆ OnSignalPass()

void OnSignalPass ( )
inlineprotected
236 {
237 //TryBaitLoss();
241 }

Перекрестные ссылки m_Bait, RemoveItemSafe(), TryDamageItems() и UpdateCatchingItemData().

◆ RandomizeSignalDuration()

float RandomizeSignalDuration ( )
inlineprotected
138 {
139 return m_Player.GetRandomGeneratorSyncManager().GetRandomInRange(RandomGeneratorSyncUsage.RGSAnimalCatching,m_SignalDurationMin,m_SignalDurationMax);
140 }

Перекрестные ссылки m_Player, m_SignalDurationMax и m_SignalDurationMin.

◆ RandomizeSignalStartTime()

float RandomizeSignalStartTime ( )
inlineprotected
143 {
144 return m_Player.GetRandomGeneratorSyncManager().GetRandomInRange(RandomGeneratorSyncUsage.RGSAnimalCatching,m_SignalStartTimeMin,m_SignalStartTimeMax);
145 }

Перекрестные ссылки m_Player, m_SignalStartTimeMax и m_SignalStartTimeMin.

◆ RecalculateProcessingData()

void RecalculateProcessingData ( )
inlineprotected
118 {
119 m_Result.UpdateCatchChance(this);
120 }

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

◆ RemoveItemSafe()

void RemoveItemSafe ( EntityAI item)
inlineprotected
170 {
171 if (item && !m_Player.IsQuickFishing())
172 {
173 item.SetPrepareToDelete(); //should probably flag the bait too, but the action terminates anyway
174 item.DeleteSafe();
175 }
176 }

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

Используется в OnAfterSpawnSignalHit(), OnSignalPass(), TryBaitLoss() и TryHookLoss().

◆ SpawnAndSetupCatch()

override EntityAI SpawnAndSetupCatch ( out int yItemIdx,
vector v = vector.Zero )
inlineprotected
205 {
206 //hook check on catch
207 if (m_Hook && !m_Hook.IsSetForDeletion())
208 return super.SpawnAndSetupCatch(yItemIdx,v);
209 return null;
210 }

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

◆ TryBaitLoss()

void TryBaitLoss ( )
inlineprotected
179 {
180 if (m_Bait && !m_Bait.IsSetForDeletion())
181 {
183 if (lossChance <= 0)
184 return;
185
186 float roll = m_Player.GetRandomGeneratorSyncManager().GetRandom01(RandomGeneratorSyncUsage.RGSAnimalCatching);
187
188 if (lossChance >= 1 || roll < lossChance)
189 {
191 }
192 }
193 }
float GetBaitLossChanceModifierClamped()
Definition CatchingContextFishingRodAction.c:127

Перекрестные ссылки GetBaitLossChanceModifierClamped(), m_Bait, m_Player и RemoveItemSafe().

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

◆ TryDamageItems()

void TryDamageItems ( )
inlineprotected
196 {
197 if (!GetGame().IsMultiplayer() || GetGame().IsDedicatedServer())
198 {
199 if (m_Hook && !m_Hook.IsSetForDeletion())
200 m_Hook.AddHealth("","Health",-UAFishingConstants.DAMAGE_HOOK);
201 }
202 }
const float DAMAGE_HOOK
Definition ActionConstants.c:187

Перекрестные ссылки UAFishingConstants::DAMAGE_HOOK, GetGame() и m_Hook.

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

◆ TryHookLoss()

void TryHookLoss ( )
inlineprotected
153 {
154 if (m_Hook && !m_Hook.IsSetForDeletion())
155 {
157 if (lossChance <= 0)
158 return;
159
160 float roll = m_Player.GetRandomGeneratorSyncManager().GetRandom01(RandomGeneratorSyncUsage.RGSAnimalCatching);
161
162 if (lossChance >= 1 || roll < lossChance)
163 {
165 }
166 }
167 }
float GetHookLossChanceModifierClamped()
Definition CatchingContextFishingRodAction.c:122

Перекрестные ссылки GetHookLossChanceModifierClamped(), m_Hook, m_Player и RemoveItemSafe().

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

Поля

◆ m_Bait

EntityAI m_Bait
protected

◆ m_BaitLossChanceMod

float m_BaitLossChanceMod
protected

◆ m_Hook

EntityAI m_Hook
protected

◆ m_HookLossChanceMod

float m_HookLossChanceMod
protected

◆ m_Player

◆ m_Rod

EntityAI m_Rod
protected

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

◆ m_SignalDurationMax

float m_SignalDurationMax
protected

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

◆ m_SignalDurationMin

float m_SignalDurationMin
protected

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

◆ m_SignalStartTimeMax

float m_SignalStartTimeMax
protected

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

◆ m_SignalStartTimeMin

float m_SignalStartTimeMin
protected

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


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