Allows for adjustment of all catch probabilities from item qualities (damage, qty...)
328 : CatchingContextBase
329{
333
337
339 {
342 {
345 }
346 }
347
349 {
351
352 super.CreateResultDataStructure();
353 }
354
356 {
357 super.ClearCatchingItemData();
358
363 }
364
366 {
367
368 if (
item.IsRuined() ||
item.IsSetForDeletion())
369 return;
370
373 {
374 if (
GetGame().ConfigIsExisting(
path +
" baitTypes") &&
GetGame().ConfigIsExisting(
path +
" baitTypeChances"))
375 {
382 {
386 {
390 {
392 }
393 }
394 }
395 else
396 {
398 }
399 }
400 if (
GetGame().ConfigIsExisting(
path +
" resultQuantityBaseMod"))
402 if (
GetGame().ConfigIsExisting(
path +
" resultQuantityDispersionMin"))
404 if (
GetGame().ConfigIsExisting(
path +
" resultQuantityDispersionMax"))
406 }
407 }
408
411 {
415 {
416
417 }
418
420 }
421
423 {
425 if (
GetGame().SurfaceIsSea(pos[0], pos[2]))
427 else if (
GetGame().SurfaceIsPond( pos[0], pos[2]))
429 else
431 }
432
434 {
436
438 }
439
441 {
442 #ifdef DEVELOPER
444 {
445 Print(
"********************");
446 Print(
"dbgTrapz | START");
447 Print(
"********************");
448 }
449 #endif
450
451 super.SetupInitialTypes();
452
453 #ifdef DEVELOPER
455 {
457 }
458 #endif
459 }
460
462 {
465
468 }
469
471 {
474 }
475
477 {
479 }
480
483 {
486 {
489 {
493 }
494 else
495 ErrorEx(
"failed to acquire BaitData from type: " + type);
496 }
497
498 #ifdef DEVELOPER
500 {
503 else
504 Print(
"dbgTrapz | UpdateUsedBait to 'null'!");
505 }
506 #endif
507 }
508
510 {
517 {
521 {
524 }
525 }
526
528 #ifdef DEVELOPER
530 {
531
533 }
534 #endif
536
537 #ifdef DEVELOPER
539 {
543 }
544 #endif
545 }
546
548 {
550
551 return true;
552 }
553
555 {
558 }
559
561 {
563 {
566 else
568 }
569 }
570}
571
573{
575 {
577 }
578}
579
581{
583 {
585 }
586}
587
589{
591 {
593 }
594}
int GetCatchEnviroMask()
Definition CatchingContextBase.c:164
float m_QualityBaseMod
Definition CatchingContextBase.c:20
void InitCatchMethodMask()
Definition CatchingContextBase.c:148
ref map< int, ref BaitData > m_BaitCompatibilityMap
Definition CatchingContextBase.c:23
class BaitData m_MainItem
Definition ActionBase.c:36
ref CatchingResultBasic m_Result
Definition CatchingContextBase.c:27
void GenerateResult()
Definition CatchingContextBase.c:257
int m_MethodMask
Definition CatchingContextBase.c:18
float m_QualityDispersionMinMod
Definition CatchingContextBase.c:21
void InitCatchingItemData()
Definition CatchingContextBase.c:217
float m_QualityDispersionMaxMod
Definition CatchingContextBase.c:22
int m_EnviroMask
Definition CatchingContextBase.c:19
void SetupProbabilityArray()
Definition CatchingContextBase.c:97
void SetupInitialTypes()
Definition CatchingContextTraps.c:358
void ClearCatchingItemData()
Definition CatchingContextTraps.c:273
ItemBase m_Bait
Definition CatchingContextTraps.c:254
void DeserializeData(Param par)
Definition CatchingContextTraps.c:256
override bool ModifySignalProbability(inout float probability)
Definition CatchingContextTraps.c:465
int UpdateTrapEnviroMask()
Definition CatchingContextTraps.c:388
CatchingContextTrapsBase CatchingContextBase InitCatchMethodMask()
Definition CatchingContextTraps.c:247
void UpdateUsedBait(ECatchingBaitCategories type)
if non-empty bait type is used, some 'Bait' attachment is picked as an active bait (currently no dire...
Definition CatchingContextTraps.c:400
void InitItemValues(EntityAI item)
override to init context-specific values
Definition CatchingContextTraps.c:283
float m_CumulativeTrappingSuccess
after N attempts, the chance to catch should be this. Only highest one applies. @NOTE: Take care,...
Definition CatchingContextTraps.c:252
void UpdateDataAndMasks()
Definition CatchingContextTraps.c:379
void ReduceBaitQty(float qtyNorm)
Definition CatchingContextTraps.c:478
void CreateResultDataStructure()
Definition CatchingContextTraps.c:266
override void UpdateBaseProbability(YieldItemBase yItem)
updates base probability when catching the specific item (some context subclasses only)
Definition CatchingContextTraps.c:427
int m_AttemptsCount
Definition CatchingContextTraps.c:253
void InitCatchEnviroMask()
Definition CatchingContextTraps.c:340
float AdjustBaitItemChance(EntityAI item)
Allows for adjustment of all catch probabilities from item qualities (damage, qty....
Definition CatchingContextTraps.c:328
void RemoveBait()
Definition CatchingContextTraps.c:472
void SetTrapEnviroMask(int value)
Definition CatchingContextTraps.c:394
override Widget Init()
Definition DayZGame.c:122
string path
Definition OptionSelectorMultistate.c:142
Definition CatchingConstants.c:2
static const int MASK_ENVIRO_LAND_ALL
Definition CatchingConstants.c:16
static const int MASK_METHOD_FISHTRAP_LARGE
Definition CatchingConstants.c:20
static const int MASK_METHOD_LANDTRAP_SNARE
Definition CatchingConstants.c:22
static const int MASK_ENVIRO_SEA
Definition CatchingConstants.c:12
static const int MASK_ENVIRO_POND
Definition CatchingConstants.c:11
static const int MASK_METHOD_FISHTRAP_SMALL
Definition CatchingConstants.c:21
Definition CatchingContextBase.c:2
Definition UtilityClasses.c:41
static ref TIntArray ARRAY_INT
Definition UtilityClasses.c:51
static ref TFloatArray ARRAY_FLOAT
Definition UtilityClasses.c:50
Definition CatchingContextTraps.c:254
void InitCatchMethodMask()
Definition CatchingContextTraps.c:255
Definition CatchingContextTraps.c:2
Definition CarchingResultTrapBase.c:2
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition InventoryItem.c:731
override bool CanBeSplit()
Definition Rag.c:34
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
Definition CatchYieldItemBase.c:2
Definition EnConvert.c:106
proto native CGame GetGame()
ErrorExSeverity
Definition EnDebug.c:62
proto void Print(void var)
Prints content of variable to console/log.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Pow(float v, float power)
Return power of v ^ power.
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'.
proto native bool IsCLIParam(string param)
Returns if command line argument is present.