Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
trap_smallfish.c
Go to the documentation of this file.
1
class
Trap_SmallFish
extends
TrapSpawnBase
2
{
3
override
void
InitTrapValues
()
4
{
5
super.InitTrapValues();
6
7
m_DefectRate
= 2.5;
//Added damage after trap activation
8
9
m_InitWaitTimeMin = 120;
10
m_InitWaitTimeMax = 180;
11
m_UpdateWaitTime = 30;
12
m_SpawnUpdateWaitTime = 30;
13
m_MaxActiveTime = 1200;
14
15
m_MinimalDistanceFromPlayersToCatch = 15;
16
17
m_AnimationPhaseSet
=
"inventory"
;
18
m_AnimationPhaseTriggered
=
"placing"
;
19
m_AnimationPhaseUsed =
"triggered"
;
20
}
21
22
override
void
InitCatchingComponent
()
23
{
24
if
(!m_CatchingContext)
25
{
26
int
updateCount = m_MaxActiveTime/m_UpdateWaitTime;
27
Param2<EntityAI,int>
par =
new
Param2<EntityAI,int>
(
this
,updateCount);
28
m_CatchingContext =
new
CatchingContextTrapFishSmall(par);
29
}
30
31
super.InitCatchingComponent();
32
}
33
34
//========================================================
35
//============= PLACING AND INVENTORY EVENTS =============
36
//========================================================
37
38
override
bool
IsPlaceableAtPosition
(
vector
position )
39
{
40
return
IsSurfaceWater( position );
41
}
42
43
override
bool
CanReceiveAttachment
(
EntityAI
attachment,
int
slotId )
44
{
45
if
( !attachment.IsInherited( Worm ) )
46
return
false
;
47
48
return
super.CanReceiveAttachment( attachment, slotId );
49
}
50
51
#ifdef PLATFORM_WINDOWS
52
// How one sees the tripwire when in vicinity
53
override
int
GetViewIndex()
54
{
55
if
( MemoryPointExists(
"invView2"
) )
56
{
57
InventoryLocation
il =
new
InventoryLocation
;
58
GetInventory().GetCurrentInventoryLocation( il );
59
InventoryLocationType
type = il.
GetType
();
60
switch
( type )
61
{
62
case
InventoryLocationType
.CARGO:
63
{
64
return
0;
65
}
66
case
InventoryLocationType
.ATTACHMENT:
67
{
68
return
1;
69
}
70
case
InventoryLocationType
.HANDS:
71
{
72
return
0;
73
}
74
case
InventoryLocationType
.GROUND:
75
{
76
// Different view index depending on deployment state
77
if
( IsDeployed() )
78
return
1;
79
80
// When folded
81
return
0;
82
}
83
case
InventoryLocationType
.PROXYCARGO:
84
{
85
return
0;
86
}
87
default
:
88
{
89
if
( IsDeployed() )
90
return
1;
91
92
// When folded
93
return
0;
94
}
95
}
96
}
97
return
0;
98
}
99
#endif
100
}
101
102
class
SmallFishTrap
extends
Trap_SmallFish
103
{
104
// DEPRECATED
105
ref
RainProcurementManager
m_RainProcurement
;
106
107
//================================================================
108
// ADVANCED PLACEMENT
109
//================================================================
110
override
bool
IsDeployable
()
111
{
112
return
true
;
113
}
114
115
override
string
GetDeploySoundset
()
116
{
117
return
"placeSmallFishTrap_SoundSet"
;
118
}
119
120
override
string
GetLoopDeploySoundset
()
121
{
122
return
"fishtrap_deploy_SoundSet"
;
123
}
124
125
override
bool
DoPlacingHeightCheck
()
126
{
127
return
true
;
//has to be able to catch rain, default distance raycast
128
}
129
}
EntityAI
Definition
inventoryitem.c:2
InventoryLocation
InventoryLocation.
Definition
inventorylocation.c:30
InventoryLocation::GetType
proto native int GetType()
returns type of InventoryLocation
Param2
Definition
ppeconstants.c:68
RainProcurementManager
DEPRECATED, done through the RainProcurementHandler / component instead.
Definition
rainprocurementmanager.c:3
TrapSpawnBase
Definition
trap_fishnet.c:2
TrapSpawnBase::InitTrapValues
override void InitTrapValues()
Definition
trap_smallfish.c:3
TrapSpawnBase::CanReceiveAttachment
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Definition
trap_smallfish.c:43
TrapSpawnBase::InitCatchingComponent
override void InitCatchingComponent()
Definition
trap_smallfish.c:22
TrapSpawnBase::IsPlaceableAtPosition
override bool IsPlaceableAtPosition(vector position)
Definition
trap_smallfish.c:38
vector
Definition
enconvert.c:119
InventoryLocationType
InventoryLocationType
types of Inventory Location
Definition
inventorylocation.c:4
IsDeployable
bool IsDeployable()
Definition
itembase.c:9270
GetLoopDeploySoundset
string GetLoopDeploySoundset()
Definition
largetent.c:151
GetDeploySoundset
string GetDeploySoundset()
Definition
fireplacebase.c:2611
m_RainProcurement
class Trap_SmallFish extends TrapSpawnBase m_RainProcurement
DoPlacingHeightCheck
override bool DoPlacingHeightCheck()
Definition
trap_smallfish.c:125
m_AnimationPhaseTriggered
string m_AnimationPhaseTriggered
Definition
trapbase.c:34
m_DefectRate
float m_DefectRate
Definition
trapbase.c:19
m_AnimationPhaseSet
string m_AnimationPhaseSet
Definition
trapbase.c:33
Games
Dayz
scripts
4_world
entities
itembase
trapspawnbase
trap_smallfish.c
Generated by
1.17.0