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

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

void ComposeLocalContextData (FishingActionData data)
 
override void WriteToContext (ParamsWriteContext ctx, ActionData action_data)
 
override bool ReadFromContext (ParamsReadContext ctx, out ActionReciveData action_recive_data)
 
override void HandleReciveData (ActionReciveData action_recive_data, ActionData action_data)
 
void CreateAndSetupActionCallback (ActionData action_data)
 
override void OnAnimationEvent (ActionData action_data)
 
override void OnUpdate (ActionData action_data)
 
void PlaySplashEffectSynced (FishingActionData actionDataFishing)
 
bool CheckForSea (ActionData action_data)
 
override void OnFinishProgress (ActionData action_data)
 
override void OnEndInput (ActionData action_data)
 
override void OnEnd (ActionData action_data)
 
int EvaluateFishingResult (ActionData action_data)
 Player input reaction evaluation.
 
void OnSignalStart (FishingActionData action_data)
 
void OnSignalEnd (FishingActionData action_data)
 
EntityAI TrySpawnCatch (FishingActionData action_data)
 

Закрытые члены

void ActionFishingNew ()
 
override void CreateConditionComponents ()
 
override bool HasTarget ()
 
override bool HasAlternativeInterrupt ()
 
override bool CanBeUsedInFreelook ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override ActionData CreateActionData ()
 
override bool SetupAction (PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=null)
 
- Закрытые члены унаследованные от ActionContinuousBase
void OnStartAnimationLoopServer (ActionData action_data)
 
void OnStartAnimationLoopClient (ActionData action_data)
 
void OnEndAnimationLoopServer (ActionData action_data)
 
void OnEndAnimationLoopClient (ActionData action_data)
 
void OnFinishProgressServer (ActionData action_data)
 
void OnFinishProgressClient (ActionData action_data)
 

Закрытые данные

const string ALLOWED_WATER_SURFACES = string.Format("%1|%2", UAWaterType.SEA, UAWaterType.FRESH)
 

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

Конструктор(ы)

◆ ActionFishingNew()

void ActionFishingNew ( )
inlineprivate
162 {
164 m_SpecialtyWeight = UASoftSkillsWeight.PRECISE_MEDIUM;
165 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_FISHING;
166 m_FullBody = true;
167 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
168 m_Text = "#start_fishing";
169 }
bool m_FullBody
Definition ActionBase.c:61
string m_Text
Definition ActionBase.c:58
float m_SpecialtyWeight
Definition ActionBase.c:77
int m_StanceMask
Definition ActionBase.c:62
Definition ActionFishingNew.c:70
int m_CommandUID
Definition AnimatedActionBase.c:143
m_CallbackClass
Definition AnimatedActionBase.c:145
Definition EntityAI.c:95
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки AnimatedActionBase::m_CallbackClass, AnimatedActionBase::m_CommandUID, ActionBase::m_FullBody, ActionBase::m_SpecialtyWeight, ActionBase::m_StanceMask и ActionBase::m_Text.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
193 {
195 hook = ItemBase.Cast(item.FindAttachmentBySlotName("Hook"));
196
197 return hook && !hook.IsRuined() && !hook.IsPendingDeletion();
198 }
Definition InventoryItem.c:731

◆ CanBeUsedInFreelook()

override bool CanBeUsedInFreelook ( )
inlineprivate
188 {
189 return false;
190 }

◆ CheckForSea()

bool CheckForSea ( ActionData action_data)
inlineprotected
332 {
333 bool ret = false;
334 vector cursorPosition = action_data.m_Target.GetCursorHitPos();
335
336 if (GetGame().SurfaceIsSea(cursorPosition[0], cursorPosition[2]))
337 {
338 ret = true;
339 }
340
341 return ret;
342 }
Definition EnConvert.c:106
proto native CGame GetGame()

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

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

◆ ComposeLocalContextData()

void ComposeLocalContextData ( FishingActionData data)
inlineprotected
221 {
222 #ifndef SERVER
223 data.m_IsSurfaceSea = CheckForSea(data); //already synced from client by this point
224 #endif
225 Param2<EntityAI,bool> par = new Param2<EntityAI,bool>(data.m_MainItem,data.m_IsSurfaceSea);
226 data.m_ContextData = new CatchingContextFishingRodAction(par);
227
228 data.m_ContextData.GenerateResult(); //call only once
229
230 #ifdef DEVELOPER
231 data.m_ContextData.SetResultChanceOverride(data.m_Player.IsQuickFishing(),1.0); //active override sets chance to 100% for the action duration
232 #endif
233 }
bool CheckForSea(ActionData action_data)
Definition ActionFishingNew.c:331
Definition CatchingContextFishingRodAction.c:2

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

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

◆ CreateActionData()

override ActionData CreateActionData ( )
inlineprivate
201 {
203 return actionData;
204 }

◆ CreateAndSetupActionCallback()

void CreateAndSetupActionCallback ( ActionData action_data)
inlineprotected
277 {
278 super.CreateAndSetupActionCallback(action_data);
279
282 {
283 data.RollNextResultChance(); //performed here so that component exists
284 }
285 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo().

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
172 {
175 }
void CCTWaterSurfaceEx(float maximal_target_distance, int allowedLiquidSource)
Definition CCTWaterSurface.c:62
ref CCIBase m_ConditionItem
Definition ActionBase.c:64
ref CCTBase m_ConditionTarget
Definition ActionBase.c:65
Definition CCINonRuined.c:2
const int LIQUID_FRESHWATER
Definition constants.c:528
const int LIQUID_SALTWATER
Definition constants.c:527

Перекрестные ссылки CCTWaterSurfaceEx(), LIQUID_FRESHWATER, LIQUID_SALTWATER, ActionBase::m_ConditionItem и ActionBase::m_ConditionTarget.

◆ EvaluateFishingResult()

int EvaluateFishingResult ( ActionData action_data)
inlineprotected

Player input reaction evaluation.

395 {
398 {
399 //legacy stuff
401 if (fad.m_IsSignalActive)//catch
402 {
403 fad.m_ContextData.OnBeforeSpawnSignalHit();
404
405 if (!GetGame().IsMultiplayer() || GetGame().IsDedicatedServer())
407
408 fad.m_ContextData.OnAfterSpawnSignalHit();
409 if (legacyCB)
410 legacyCB.HandleFishingResultSuccess();
411
412 EntityAI hookCheck = action_data.m_MainItem.FindAttachmentBySlotName("Hook");
413 return hookCheck != null && !hookCheck.IsPendingDeletion(); //success animation only if hook loss didn't prevent catch (local)
414 }
415 else//fail
416 {
417 fad.m_ContextData.OnSignalMiss();
418 if (legacyCB)
419 legacyCB.HandleFishingResultFailure();
420
421 return false;
422 }
423 }
424
425 return -1;
426 }
EntityAI TrySpawnCatch(FishingActionData action_data)
Definition ActionFishingNew.c:447
Definition Building.c:6

Перекрестные ссылки Class::CastTo(), GetGame() и TrySpawnCatch().

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

◆ HandleReciveData()

override void HandleReciveData ( ActionReciveData action_recive_data,
ActionData action_data )
inlineprotected
267 {
268 super.HandleReciveData(action_recive_data, action_data);
269
272
273 fishingData.m_IsSurfaceSea = receiveDataFishing.m_IsSurfaceSea;
274 }
Definition ActionFishingNew.c:2

◆ HasAlternativeInterrupt()

override bool HasAlternativeInterrupt ( )
inlineprivate
183 {
184 return true;
185 }

◆ HasTarget()

override bool HasTarget ( )
inlineprivate
178 {
179 return true;
180 }

◆ OnAnimationEvent()

override void OnAnimationEvent ( ActionData action_data)
inlineprotected
288 {
289 super.OnAnimationEvent(action_data);
291
292 switch (action_data.m_DelayedAnimationEventID)
293 {
296 break;
297
299 actionDataFishing.AnimateRod(false,false);
300 break;
301 }
302 }
void PlaySplashEffectSynced(FishingActionData actionDataFishing)
Definition ActionFishingNew.c:314
Definition ActionConstants.c:174
const int EVENT_ANIMATE_ROD_CLOSE
Definition ActionConstants.c:190
const int EVENT_SPLASH_SIGNAL
Definition ActionConstants.c:189

Перекрестные ссылки UAFishingConstants::EVENT_ANIMATE_ROD_CLOSE, UAFishingConstants::EVENT_SPLASH_SIGNAL и PlaySplashEffectSynced().

◆ OnEnd()

override void OnEnd ( ActionData action_data)
inlineprotected
385 {
386 super.OnEnd(action_data);
387
390 fad.AnimateRod(false,true); //just in case
391 }

Перекрестные ссылки Class::CastTo().

◆ OnEndInput()

override void OnEndInput ( ActionData action_data)
inlineprotected
358 {
360 if (Class.CastTo(callback, action_data.m_Callback))
361 {
362 switch (callback.GetState())
363 {
364 case HumanCommandActionCallback.STATE_LOOP_ACTION:
365 case HumanCommandActionCallback.STATE_LOOP_LOOP:
366 case HumanCommandActionCallback.STATE_LOOP_LOOP2:
369 {
370 data.m_FishingResult = EvaluateFishingResult(action_data);
371 if (data.m_FishingResult != -1)
372 data.m_State = UA_FINISHED;
373 }
374 break;
375
376 default:
377 super.OnEndInput(action_data);
378 callback.EndActionComponent(); //think about putting this everywhere, interrupts HumanCommandActionCallback.STATE_LOOP_IN neatly
379 break;
380 }
381 }
382 }
Definition ActionContinuousBase.c:2
int EvaluateFishingResult(ActionData action_data)
Player input reaction evaluation.
Definition ActionFishingNew.c:394
Definition StateCB.c:2
const int UA_FINISHED
Definition constants.c:443

Перекрестные ссылки Class::CastTo(), EvaluateFishingResult() и UA_FINISHED.

◆ OnFinishProgress()

override void OnFinishProgress ( ActionData action_data)
inlineprotected
347 {
348 super.OnFinishProgress(action_data);
349
352 {
353 data.RollNextResultChance();
354 }
355 }

Перекрестные ссылки Class::CastTo().

◆ OnSignalEnd()

void OnSignalEnd ( FishingActionData action_data)
inlineprotected
438 {
439 action_data.m_IsSignalActive = false;
441 if (Class.CastTo(fishingCB,action_data.m_Callback))
442 fishingCB.ToggleFishBiting();
443
444 action_data.m_ContextData.OnSignalPass();
445 }

Перекрестные ссылки Class::CastTo().

◆ OnSignalStart()

void OnSignalStart ( FishingActionData action_data)
inlineprotected
430 {
431 action_data.m_IsSignalActive = true;
433 if (Class.CastTo(fishingCB,action_data.m_Callback))
434 fishingCB.ToggleFishBiting();
435 }

Перекрестные ссылки Class::CastTo().

◆ OnUpdate()

override void OnUpdate ( ActionData action_data)
inlineprotected
305 {
306 super.OnUpdate(action_data);
307
308 vector dir = vector.Direction(action_data.m_Player.GetPosition(), action_data.m_Target.GetCursorHitPos());
309 dir[1] = 0;
310 dir.Normalize();
311 action_data.m_Player.AlignDirectionWS(dir);
312 }
proto float Normalize()
Normalizes vector. Returns length.
static vector Direction(vector p1, vector p2)
Returns direction vector from point p1 to point p2.
Definition EnConvert.c:220

Перекрестные ссылки vector::Direction() и vector::Normalize().

◆ PlaySplashEffectSynced()

void PlaySplashEffectSynced ( FishingActionData actionDataFishing)
inlineprotected
315 {
316 if (GetGame().IsServer())
317 {
318 int particleId = actionDataFishing.m_ContextData.GetResultParticleId();
319 if (actionDataFishing.m_SplashUniqueID < 0)
320 {
321 actionDataFishing.m_SplashUniqueID = SEffectManager.CreateParticleServer(actionDataFishing.m_Target.GetCursorHitPos(), new ParticleEffecterParameters("ParticleEffecter", EffecterBase.NOT_DEFINED_LIFESPAN, particleId));
322 }
323 else
324 {
325 SEffectManager.ReinitParticleServer(actionDataFishing.m_SplashUniqueID, new ParticleEffecterParameters("ParticleEffecter", EffecterBase.NOT_DEFINED_LIFESPAN, particleId)); //reinit here, since particleId might differ
327 }
328 }
329 }
Definition EffectManager.c:673
Manager class for managing Effect (EffectParticle, EffectSound)
Definition EffectManager.c:6
static void ReinitParticleServer(int effecterID, EffecterParameters parameters)
allows re-initializing existing effecter with new parameters (extept m_EffecterType,...
Definition EffectManager.c:593
static void ReactivateParticleServer(int effecterID)
Definition EffectManager.c:602
static int CreateParticleServer(vector pos, EffecterParameters parameters)
returns unique effecter ID
Definition EffectManager.c:577

Перекрестные ссылки SEffectManager::CreateParticleServer(), GetGame(), SEffectManager::ReactivateParticleServer() и SEffectManager::ReinitParticleServer().

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

◆ ReadFromContext()

override bool ReadFromContext ( ParamsReadContext ctx,
out ActionReciveData action_recive_data )
inlineprotected
246 {
248 {
250 }
251
252 super.ReadFromContext(ctx, action_recive_data);
253
256 {
257 if (!ctx.Read(receiveDataFishing.m_IsSurfaceSea))
258 return false;
259
260 return true;
261 }
262
263 return false;
264 }

Перекрестные ссылки Class::CastTo().

◆ SetupAction()

override bool SetupAction ( PlayerBase player,
ActionTarget target,
ItemBase item,
out ActionData action_data,
Param extra_data = null )
inlineprivate
207 {
208 if (super.SetupAction(player, target, item, action_data, extra_data))
209 {
212 {
214 return true;
215 }
216 }
217 return false;
218 }
void ComposeLocalContextData(FishingActionData data)
Definition ActionFishingNew.c:220

Перекрестные ссылки Class::CastTo() и ComposeLocalContextData().

◆ TrySpawnCatch()

EntityAI TrySpawnCatch ( FishingActionData action_data)
inlineprotected
448 {
449 vector spawnPos = vector.Direction(action_data.m_Player.GetPosition(),action_data.m_Target.GetCursorHitPos()); //direction first
450 spawnPos = MiscGameplayFunctions.GetRandomizedPositionVerified(action_data.m_Player.GetPosition(),action_data.m_Player.GetPosition() + spawnPos * 0.1,0.15,action_data.m_Player);
451
452 int idx;
453 return action_data.m_ContextData.SpawnAndSetupCatch(idx,spawnPos);
454 }

Перекрестные ссылки vector::Direction().

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

◆ WriteToContext()

override void WriteToContext ( ParamsWriteContext ctx,
ActionData action_data )
inlineprotected
236 {
237 super.WriteToContext(ctx, action_data);
240 {
241 ctx.Write(data.m_IsSurfaceSea);
242 }
243 }

Перекрестные ссылки Class::CastTo().

Поля

◆ ALLOWED_WATER_SURFACES

const string ALLOWED_WATER_SURFACES = string.Format("%1|%2", UAWaterType.SEA, UAWaterType.FRESH)
private

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