DayZ 1.24
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
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;
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 SetAnimationPhase(camo_on, is_ruined);
117 else
118 SetAnimationPhase(camo_off, is_ruined);
119 }
120 }
121
122 SetAnimationPhase("Camo_Roof", hide);
123 }
124
126 {
127 if (!m_CamoNet)
128 return;
129
130 bool is_closed = m_OpeningMask & toggle.GetOpeningBit();
131 string camo_off = "Camo" + toggle.GetToggleOff().Substring(4, 2);
132 string camo_on = "Camo" + toggle.GetToggleOn().Substring(4, 2);
133
134 SetAnimationPhase(camo_off, is_closed);
135 SetAnimationPhase(camo_on, !is_closed);
136 }
137
138 //on part destroy
140 {
141 string camo = "Camo" + opening_selection.Substring(4, 2);
142 SetAnimationPhase(camo, 1);
143 }
144};
145
146class PartyTent_Blue extends PartyTent {};
147class PartyTent_Brown extends PartyTent {};
148class PartyTent_Lunapark extends PartyTent {};
149
150//placing classes
151class PartyTentPlacing extends PartyTent {};
const int ECE_PLACE_ON_SURFACE
Container_Base m_HalfExtents
Object m_ClutterCutter
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
override string GetSoundClose()
Definition PartyTent.c:31
override void AnimateCamonetToggle(ToggleAnimations toggle)
Definition PartyTent.c:125
override string GetClutterCutter()
Definition PartyTent.c:51
void PartyTent()
Definition PartyTent.c:3
override string GetSoundOpen()
Definition PartyTent.c:26
override string GetSoundCloseWindow()
Definition PartyTent.c:41
override void AnimateCamonetByOpeningSelection(string opening_selection)
Definition PartyTent.c:139
override void HandleCamoNetAttachment(bool hide)
Definition PartyTent.c:86
override bool HasClutterCutter()
Definition PartyTent.c:46
override string GetDeploySoundset()
Definition PartyTent.c:76
override string GetSoundOpenWindow()
Definition PartyTent.c:36
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Definition PartyTent.c:60
override string GetLoopDeploySoundset()
Definition PartyTent.c:81
proto native CGame GetGame()
const int STATE_RUINED
Definition constants.c:757
proto native vector Vector(float x, float y, float z)
Vector constructor from components.