Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
partytent.c
Go to the documentation of this file.
1class PartyTent extends TentBase
2{
3 void PartyTent()
4 {
5 m_ToggleAnimations.Insert( new ToggleAnimations("Door1o", "Door1c", OPENING_0), 0 );
6 m_ToggleAnimations.Insert( new ToggleAnimations("Door2o", "Door2c", OPENING_1), 0 );
7 m_ToggleAnimations.Insert( new ToggleAnimations("Door3o", "Door3c", OPENING_2), 0 );
8 m_ToggleAnimations.Insert( new ToggleAnimations("Door4o", "Door4c", OPENING_3), 0 );
9 m_ToggleAnimations.Insert( new ToggleAnimations("Door5o", "Door5c", OPENING_4), 0 );
10 m_ToggleAnimations.Insert( new ToggleAnimations("Door6o", "Door6c", OPENING_5), 0 );
11
12 m_ShowAnimationsWhenPitched.Insert( "Body" );
13 m_ShowAnimationsWhenPitched.Insert( "Pack" );
14 /*m_ShowAnimationsWhenPitched.Insert( "Door1o" );
15 m_ShowAnimationsWhenPitched.Insert( "Door2o" );
16 m_ShowAnimationsWhenPitched.Insert( "Door3o" );
17 m_ShowAnimationsWhenPitched.Insert( "Door4o" );
18 m_ShowAnimationsWhenPitched.Insert( "Door5o" );
19 m_ShowAnimationsWhenPitched.Insert( "Door6o" );*/
20
21 m_ShowAnimationsWhenPacked.Insert( "Inventory" );
22
23 m_HalfExtents = Vector(1.3, 0.35, 2.7);
24 }
25
26 override string GetSoundOpen()
27 {
28 return "LargeTent_Door_Open_SoundSet";
29 }
30
31 override string GetSoundClose()
32 {
33 return "LargeTent_Door_Close_SoundSet";
34 }
35
36 override string GetSoundOpenWindow()
37 {
38 return "LargeTent_Window_Open_SoundSet";
39 }
40
41 override string GetSoundCloseWindow()
42 {
43 return "LargeTent_Window_Close_SoundSet";
44 }
45
46 override bool HasClutterCutter()
47 {
48 return true;
49 }
50
51 override string GetClutterCutter()
52 {
53 return "LargeTentClutterCutter"; //TODO add custom clutter cutter?
54 }
55
56 //================================================================
57 // ADVANCED PLACEMENT
58 //================================================================
59
60 override void OnPlacementComplete( Man player, vector position = "0 0 0", vector orientation = "0 0 0" )
61 {
62 super.OnPlacementComplete( player, position, orientation );
63
64 PlayerBase pb = PlayerBase.Cast( player );
65
66 if ( GetGame().IsServer() )
67 {
68 if ( !m_ClutterCutter )
69 {
70 m_ClutterCutter = GetGame().CreateObjectEx( "LargeTentClutterCutter", pb.GetLocalProjectionPosition(), ECE_PLACE_ON_SURFACE );
71 m_ClutterCutter.SetOrientation( pb.GetLocalProjectionOrientation() );
72 }
73 }
74 }
75
76 override string GetDeploySoundset()
77 {
78 return "placeLargeTent_SoundSet";
79 }
80
81 override string GetLoopDeploySoundset()
82 {
83 return "largetent_deploy_SoundSet";
84 }
85
86 override void HandleCamoNetAttachment(bool hide)
87 {
88 bool is_closed;
89 bool is_ruined;
90 string component;
91 string zone;
92 string camo_off;
93 string camo_on;
94 ToggleAnimations toggle;
95
96 for (int i = 0; i < m_ToggleAnimations.Count(); i++)
97 {
98 toggle = m_ToggleAnimations.GetKey(i);
99 camo_off = "Camo" + toggle.GetToggleOff().Substring(4,2);
100 camo_on = "Camo" + toggle.GetToggleOn().Substring(4,2);
101
102 if (hide)
103 {
104 SetAnimationPhase( camo_off, hide );
105 SetAnimationPhase( camo_on, hide );
106 }
107 else
108 {
109 component = toggle.GetToggleOff(); //either one works
110 component.ToLower();
111 DamageSystem.GetDamageZoneFromComponentName(this,component,zone);
112 is_ruined = GetHealthLevel(zone) == GameConstants.STATE_RUINED;
113 is_closed = m_OpeningMask & toggle.GetOpeningBit();
114
115 if (is_closed)
116 {
117 SetAnimationPhase( camo_on, is_ruined );
118 }
119 else
120 {
121 SetAnimationPhase( camo_off, is_ruined );
122 }
123 }
124 }
125
126 SetAnimationPhase( "Camo_Roof", hide );
127 }
128
129 override void AnimateCamonetToggle(ToggleAnimations toggle)
130 {
131 if (!m_CamoNet)
132 return;
133
134 bool is_closed = m_OpeningMask & toggle.GetOpeningBit();
135 string camo_off = "Camo" + toggle.GetToggleOff().Substring(4,2);
136 string camo_on = "Camo" + toggle.GetToggleOn().Substring(4,2);
137
138 SetAnimationPhase( camo_off, is_closed );
139 SetAnimationPhase( camo_on, !is_closed );
140 }
141
142 //on part destroy
143 override void AnimateCamonetByOpeningSelection(string opening_selection)
144 {
145 string camo = "Camo" + opening_selection.Substring(4,2);
146 SetAnimationPhase(camo,1);
147 }
148};
149
150class PartyTent_Blue extends PartyTent {};
151class PartyTent_Brown extends PartyTent {};
152class PartyTent_Lunapark extends PartyTent {};
153
154//placing classes
155class PartyTentPlacing extends PartyTent {};
156class PartyTent_BluePlacing extends PartyTentPlacing {};
157class PartyTent_BrownPlacing extends PartyTentPlacing {};
158class PartyTent_LunaparkPlacing extends PartyTentPlacing {};
const int ECE_PLACE_ON_SURFACE
Container_Base m_HalfExtents
int m_OpeningMask
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Object m_ClutterCutter
proto native CGame GetGame()
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
string GetDeploySoundset()
string GetLoopDeploySoundset()
Definition largetent.c:151
override bool HasClutterCutter()
Definition largetent.c:116
override string GetSoundClose()
Definition largetent.c:101
override string GetClutterCutter()
Definition largetent.c:121
override string GetSoundOpen()
Definition largetent.c:96
override string GetSoundCloseWindow()
Definition largetent.c:111
override string GetSoundOpenWindow()
Definition largetent.c:106