Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл FishingRod_Base.c

См. исходные тексты.

Структуры данных

class  FishingRod_Base_New
 

Функции

void FishingRod_Base ()
 
void Init ()
 Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)
 
bool IsFishingActive ()
 
void ActivateFishing ()
 
void DeactivateFishing ()
 
void FishPull ()
 
void Catching ()
 
void Pulling ()
 
void End (int result)
 
void AddPull (float delta)
 
void DisplayState ()
 
override bool CanPutInCargo (EntityAI parent)
 
override void SetActions ()
 
float GetFishingEffectivityBonus ()
 

Переменные

FishingRod_Base_New ANIM_PHASE_OPENED = "OpenRod"
 
const string ANIM_PHASE_CLOSED = "CloseRod"
 
const float BREAK_PULL = 36
 
const float TOO_MUCH_PULL = 32
 
const float HIGH_PULL = 22
 
const float LOW_PULL = 18
 
const float TOO_FEW_PULL = 8
 
const float LOOSE_PULL = 0
 
const int LOSS_BREAK = 0
 
const int LOSS_LOOSE = 1
 
const int WIN = 2
 
const int INTERUPTED = 3
 
const float INIT_LINE_STRETCH = 15
 
const float MIN_FISHING_TIME = 100
 
const float MAX_FISHING_TIME = 150
 
const int FISH_PULL_CHANCE = 15
 
const int FISH_AGILITY = 15
 
int m_FishProximity
 
bool m_Fishing
 
ref Timer m_CyclerCatching
 
ref Timer m_Cycler
 
float m_Pull
 
float m_DeltaT
 
bool m_WasPulled
 
bool m_IsFishPulling
 
float m_PullTime
 
float m_FishPull
 
int m_FishingTime
 
PlayerBase m_Player
 
int m_ChanceRange
 

Функции

◆ ActivateFishing()

void ActivateFishing ( )
104 {
105 m_Fishing = true;
106 //Init();
107 }
bool m_Fishing
Definition FishingRod_Base.c:58

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

◆ AddPull()

void AddPull ( float delta)
288 {
289 m_DeltaT = delta;
290 m_WasPulled = true;
291 }
bool m_WasPulled
Definition FishingRod_Base.c:63
float m_DeltaT
Definition FishingRod_Base.c:62
Definition EntityAI.c:95

Перекрестные ссылки m_DeltaT и m_WasPulled.

◆ CanPutInCargo()

override bool CanPutInCargo ( EntityAI parent)
331 {
332 if( !super.CanPutInCargo(parent) ) {return false;}
333 if ( GetAnimationPhase(ANIM_PHASE_CLOSED) > 0.5 )
334 {
335 return true;
336 }
337 return false;
338 }
const string ANIM_PHASE_CLOSED
Definition FishingRod_Base.c:39

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

◆ Catching()

void Catching ( )
148 {
149 if(m_FishProximity == 0 && m_WasPulled)
150 {
151 m_CyclerCatching.Stop();
152 m_Cycler.Run(0.3, this, "Pulling", NULL,true);
153 }
154 else
155 {
156 if (m_WasPulled)
157 {
158 m_WasPulled = false;
160 }
161 //TIMERDEPRECATED - randomized proximity of fish to
163 string fline = "";
164 for (int i = 0; i < m_FishProximity; i++)
165 {
166 fline += " .";
167 }
168 m_Player.Message("", "colorStatusChannel");
169 m_Player.Message("HOLD right mouse button to pull the fishing line", "colorAction");
170 m_Player.Message("", "colorStatusChannel");
171 m_Player.Message("", "colorStatusChannel");
172 m_Player.Message("", "colorStatusChannel");
173 m_Player.Message("Start pulling when J and <*)))>< meet:", "colorStatusChannel");
174 m_Player.Message("", "colorStatusChannel");
175 m_Player.Message("J"+fline+" <*)))><", "colorImportant");
176 if(m_ChanceRange > 0)
177 {
179 }
180 }
181 }
ref Timer m_CyclerCatching
Definition FishingRod_Base.c:59
PlayerBase m_Player
Definition FishingRod_Base.c:68
int m_FishProximity
Definition FishingRod_Base.c:57
int m_ChanceRange
Definition FishingRod_Base.c:69
ref Timer m_Cycler
Definition FishingRod_Base.c:60
Definition EnMath.c:7
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].

Перекрестные ссылки m_ChanceRange, m_Cycler, m_CyclerCatching, m_FishProximity, m_Player, m_WasPulled и Math::RandomInt().

◆ DeactivateFishing()

void DeactivateFishing ( )
110 {
112 }
void End()
called on surrender end request end
const int INTERUPTED
Definition FishingRod_Base.c:50

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

◆ DisplayState()

void DisplayState ( )
294 {
295 string fline = "";
296 for (int i = 0; i < m_Pull; i++)
297 {
298 fline += "-";
299 }
300 m_Player.Message("", "colorStatusChannel");
301 m_Player.Message("HOLD right mouse button to pull the fishing line", "colorAction");
302 m_Player.Message("RELEASE right mouse button to loosen the fishing line", "colorAction");
303 m_Player.Message("", "colorStatusChannel");
304 m_Player.Message("", "colorStatusChannel");
305 m_Player.Message("Fishing line stretch :", "colorStatusChannel");
306 m_Player.Message("", "colorStatusChannel");
307 if (m_Pull >= TOO_MUCH_PULL)
308 {
309 m_Player.Message("<"+fline+">", "colorImportant");
310 }
312 {
313 m_Player.Message("<"+fline+">", "colorAction");
314 }
316 {
317 m_Player.Message("<"+fline+">", "colorFriendly");
318 }
320 {
321 m_Player.Message("<"+fline+">", "colorStatusChannel");
322 }
323 if (m_Pull <= TOO_FEW_PULL)
324 {
325 m_Player.Message("<"+fline+">", "colorImportant");
326 }
327 }
const float TOO_FEW_PULL
Definition FishingRod_Base.c:45
const float TOO_MUCH_PULL
Definition FishingRod_Base.c:42
float m_Pull
Definition FishingRod_Base.c:61
const float LOW_PULL
Definition FishingRod_Base.c:44
const float HIGH_PULL
Definition FishingRod_Base.c:43

Перекрестные ссылки HIGH_PULL, LOW_PULL, m_Player, m_Pull, TOO_FEW_PULL и TOO_MUCH_PULL.

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

◆ End()

void End ( int result)
230 {
231 m_Cycler.Stop();
232 m_CyclerCatching.Stop();
233 m_Fishing = false;
234
235 switch (result)
236 {
237 case LOSS_BREAK:
238 m_Player.Message("", "colorStatusChannel");
239 m_Player.Message("", "colorStatusChannel");
240 m_Player.Message("", "colorStatusChannel");
241 m_Player.Message("The fish had broken the fishing line and swam away.", "colorImportant");
242 m_Player.Message("", "colorStatusChannel");
243 m_Player.Message("", "colorStatusChannel");
244 m_Player.Message("", "colorStatusChannel");
245 m_Player.Message("", "colorStatusChannel");
246 break;
247
248 case LOSS_LOOSE:
249 m_Player.Message("", "colorStatusChannel");
250 m_Player.Message("", "colorStatusChannel");
251 m_Player.Message("", "colorStatusChannel");
252 m_Player.Message("The fish escaped.", "colorImportant");
253 m_Player.Message("", "colorStatusChannel");
254 m_Player.Message("", "colorStatusChannel");
255 m_Player.Message("", "colorStatusChannel");
256 m_Player.Message("", "colorStatusChannel");
257 break;
258
259 case WIN:
260 m_Player.Message("", "colorStatusChannel");
261 m_Player.Message("", "colorStatusChannel");
262 m_Player.Message("", "colorStatusChannel");
263 m_Player.Message("I caught the fish!", "colorFriendly");
264 m_Player.Message("", "colorStatusChannel");
265 m_Player.Message("", "colorStatusChannel");
266 m_Player.Message("", "colorStatusChannel");
267 m_Player.Message("", "colorStatusChannel");
268 break;
269
270 case INTERUPTED:
271 m_Player.Message("", "colorStatusChannel");
272 m_Player.Message("", "colorStatusChannel");
273 m_Player.Message("", "colorStatusChannel");
274 m_Player.Message("Fishing time is over.", "colorFriendly");
275 m_Player.Message("", "colorStatusChannel");
276 m_Player.Message("", "colorStatusChannel");
277 m_Player.Message("", "colorStatusChannel");
278 m_Player.Message("", "colorStatusChannel");
279 break;
280
281 default:
282 Print("Wrong number");
283 break;
284 }
285 }
const int LOSS_LOOSE
Definition FishingRod_Base.c:48
const int LOSS_BREAK
Definition FishingRod_Base.c:47
const int WIN
Definition FishingRod_Base.c:49
proto void Print(void var)
Prints content of variable to console/log.

Перекрестные ссылки INTERUPTED, LOSS_BREAK, LOSS_LOOSE, m_Cycler, m_CyclerCatching, m_Fishing, m_Player, Print() и WIN.

◆ FishingRod_Base()

void FishingRod_Base ( )
72 {
73 m_Fishing = false;
74 }

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

◆ FishPull()

void FishPull ( )
117 {
118 if ( !m_IsFishPulling )
119 {
122 {
123 //TIMERDEPRECATED - randomizing timeframe to pull fish out
124 if ( Math.RandomInt(0, 1) )
125 {
127 }
128 else
129 {
130 m_FishPull = -rand;
131 }
132 //TIMERDEPRECATED - randomizing timeframe to pull fish out
133 m_PullTime = Math.RandomInt(2, 6);
134 m_IsFishPulling = true;
135 }
136 }
137 else
138 {
139 m_PullTime--;
140 if (m_PullTime == 0)
141 {
142 m_IsFishPulling = false;
143 }
144 }
145 }
float m_PullTime
Definition FishingRod_Base.c:65
float m_FishPull
Definition FishingRod_Base.c:66
bool m_IsFishPulling
Definition FishingRod_Base.c:64
const int FISH_PULL_CHANCE
Definition FishingRod_Base.c:54

Перекрестные ссылки FISH_PULL_CHANCE, m_FishPull, m_IsFishPulling, m_PullTime, Math::RandomInt() и TOO_FEW_PULL.

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

◆ GetFishingEffectivityBonus()

float GetFishingEffectivityBonus ( )
350 {
351 return 0.0;
352 }

◆ Init()

void Init ( )

Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)

pre-init arrays

77 {
80 m_IsFishPulling = false;
81 //TIMERDEPRECATED - randomized time of fishing
85 //TIMERDEPRECATED
86 if(!m_Cycler)
87 {
88 m_Cycler = new Timer();
89 }
91 {
92 m_CyclerCatching = new Timer();
93 }
94 m_CyclerCatching.Run(4, this, "Catching", NULL,true);
95 m_Player.Message("I have started fishing.", "colorFriendly");
96 }
const float MIN_FISHING_TIME
Definition FishingRod_Base.c:52
const int FISH_AGILITY
Definition FishingRod_Base.c:55
int m_FishingTime
Definition FishingRod_Base.c:67
const float MAX_FISHING_TIME
Definition FishingRod_Base.c:53
const float INIT_LINE_STRETCH
Definition FishingRod_Base.c:51
PlayerBase GetPlayer()
Definition ModifierBase.c:47
Definition PlayerBaseClient.c:2
Definition DayZPlayerImplement.c:63
proto native CGame GetGame()

Перекрестные ссылки FISH_AGILITY, GetGame(), GetPlayer(), INIT_LINE_STRETCH, m_ChanceRange, m_Cycler, m_CyclerCatching, m_FishingTime, m_FishProximity, m_IsFishPulling, m_Player, m_Pull, MAX_FISHING_TIME, MIN_FISHING_TIME и Math::RandomInt().

◆ IsFishingActive()

bool IsFishingActive ( )
99 {
100 return m_Fishing;
101 }

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

◆ Pulling()

void Pulling ( )
184 {
185 float agent_speed_distance = vector.Distance("0 0 0",m_Player.GetModelSpeed());
186 if (m_Player.GetItemInHands() != this || !m_Player.IsInWater() || agent_speed_distance > 1 )
187 {
189 }
190 else
191 {
192 if ( m_FishingTime <= 0)
193 {
194 ItemBase pcatch = ItemBase.Cast( m_Player.GetInventory().CreateInInventory("Carp") );
195 //ItemBase pcatch = ItemBase.Cast( m_Player.CreateInInventory("Carp","cargo_bait") );
196 pcatch.SetQuantity(800,false);
197 End(WIN);
198 }
199 else
200 {
201 FishPull();
202 if ( m_IsFishPulling )
203 {
205 }
206 if (m_WasPulled)
207 {
208 m_Pull += 1;
209 }
210 else
211 {
212 m_Pull -= 1;
213 }
214 m_WasPulled = false;
216 DisplayState();
217 if ( m_Pull <= LOOSE_PULL)
218 {
220 }
221 if ( m_Pull >= BREAK_PULL)
222 {
224 }
225 }
226 }
227 }
void FishPull()
Definition FishingRod_Base.c:116
const float BREAK_PULL
Definition FishingRod_Base.c:41
void DisplayState()
Definition FishingRod_Base.c:293
const float LOOSE_PULL
Definition FishingRod_Base.c:46
Definition InventoryItem.c:731
Definition EnConvert.c:106
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.

Перекрестные ссылки BREAK_PULL, DisplayState(), vector::Distance(), End(), FishPull(), INTERUPTED, LOOSE_PULL, LOSS_BREAK, LOSS_LOOSE, m_FishingTime, m_FishPull, m_IsFishPulling, m_Player, m_Pull, m_WasPulled и WIN.

◆ SetActions()

override void SetActions ( )
341 {
342 super.SetActions();
343
344 //AddAction(ActionToggleFishing);
345 //AddAction(ActionFishing);
346 //AddAction(ActionFishingNew);
347 }

Переменные

◆ ANIM_PHASE_CLOSED

const string ANIM_PHASE_CLOSED = "CloseRod"

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

◆ ANIM_PHASE_OPENED

FishingRod_Base_New ANIM_PHASE_OPENED = "OpenRod"

◆ BREAK_PULL

const float BREAK_PULL = 36

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

◆ FISH_AGILITY

const int FISH_AGILITY = 15

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

◆ FISH_PULL_CHANCE

const int FISH_PULL_CHANCE = 15

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

◆ HIGH_PULL

const float HIGH_PULL = 22

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

◆ INIT_LINE_STRETCH

const float INIT_LINE_STRETCH = 15

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

◆ INTERUPTED

const int INTERUPTED = 3

Используется в DeactivateFishing(), End() и Pulling().

◆ LOOSE_PULL

const float LOOSE_PULL = 0

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

◆ LOSS_BREAK

const int LOSS_BREAK = 0

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

◆ LOSS_LOOSE

const int LOSS_LOOSE = 1

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

◆ LOW_PULL

const float LOW_PULL = 18

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

◆ m_ChanceRange

int m_ChanceRange

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

◆ m_Cycler

ref Timer m_Cycler

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

◆ m_CyclerCatching

ref Timer m_CyclerCatching

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

◆ m_DeltaT

float m_DeltaT

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

◆ m_Fishing

bool m_Fishing

Используется в ActivateFishing(), End(), FishingRod_Base() и IsFishingActive().

◆ m_FishingTime

int m_FishingTime

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

◆ m_FishProximity

int m_FishProximity

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

◆ m_FishPull

float m_FishPull

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

◆ m_IsFishPulling

bool m_IsFishPulling

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

◆ m_Player

PlayerBase m_Player

◆ m_Pull

float m_Pull

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

◆ m_PullTime

float m_PullTime

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

◆ m_WasPulled

bool m_WasPulled

Используется в AddPull(), Catching() и Pulling().

◆ MAX_FISHING_TIME

const float MAX_FISHING_TIME = 150

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

◆ MIN_FISHING_TIME

const float MIN_FISHING_TIME = 100

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

◆ TOO_FEW_PULL

const float TOO_FEW_PULL = 8

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

◆ TOO_MUCH_PULL

const float TOO_MUCH_PULL = 32

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

◆ WIN

const int WIN = 2

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