DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ Deconstruct()

void GetShelterVariant::Deconstruct ( )

См. определение в файле Shelter.c строка 124

125{
126 static const string SITE_OBJECT_TYPE = "ShelterSite";
127
128 void ShelterBase()
129 {
130 m_ShowAnimationsWhenPitched.Insert("Body");
131 m_ShowAnimationsWhenPacked.Insert("Body");
132
133 m_HalfExtents = Vector(0.8, 0.15, 1.3);
134 }
135
136 override void SetActions()
137 {
138 super.SetActions();
139
144
146 }
147
148 override void EEInit()
149 {
150 super.EEInit();
151
152 TryPitch(true, true);
153 }
154
155 void Deconstruct()
156 {
158 SpawnKit();
159 Delete();
160 }
161
162 string GetMaterialPath()
163 {
164 return string.Format("%1 %2 Construction site %3 Materials", CFG_VEHICLESPATH, SITE_OBJECT_TYPE, GetShelterVariant());
165 }
166
167 string GetShelterVariant()
168 {
169 return "";
170 }
171
172 void SpawnKit()
173 {
174 ItemBase constructionKit = ItemBase.Cast(GetGame().CreateObjectEx("ShelterKit", GetPosition(), ECE_PLACE_ON_SURFACE));
175 constructionKit.SetHealth01("", "", GetHealth01());
176 }
177
178 override bool IsPlayerInside(PlayerBase player, string selection)
179 {
180 vector player_pos = player.GetPosition();
181 vector shelter_pos = GetPosition();
182 vector ref_dir = GetDirection();
183 ref_dir[1] = 0;
184 ref_dir.Normalize();
185
186 vector x[2];
187 vector b1,b2;
188 GetCollisionBox(x);
189 b1 = x[0];
190 b2 = x[1];
191
192 vector dir_to_shelter = shelter_pos - player_pos;
193 dir_to_shelter[1] = 0;
194 float len = dir_to_shelter.Length();
195
196 dir_to_shelter.Normalize();
197
198 vector ref_dir_angle = ref_dir.VectorToAngles();
199 vector dir_to_shelter_angle = dir_to_shelter.VectorToAngles();
200 vector test_angles = dir_to_shelter_angle - ref_dir_angle;
201
202 vector test_position = test_angles.AnglesToVector() * len;
203
204 if (test_position[0] < b1[0] || test_position[0] > b2[0] || test_position[2] < 0.2 || test_position[2] > 2.2 )
205 {
206 return false;
207 }
208 else
209 {
210 return true;
211 }
212 }
213}
214
215class ShelterFabric extends ShelterBase
216{
217 override string GetShelterVariant()
218 {
219 return "fabric";
220 }
221}
222
223class ShelterLeather extends ShelterBase
224{
225 override string GetShelterVariant()
226 {
227 return "leather";
228 }
229}
230
231class ShelterStick extends ShelterBase
232{
233 override string GetShelterVariant()
234 {
235 return "stick";
236 }
237}
PlaceObjectActionReciveData ActionReciveData ActionDeployObject()
Определения ActionDeployObject.c:9
ActionPackTentCB ActionContinuousBaseCB ActionPackTent()
Определения ActionPackTent.c:11
void AddAction(typename actionName)
Определения AdvancedCommunication.c:220
void RemoveAction(typename actionName)
Определения AdvancedCommunication.c:252
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
Container_Base m_HalfExtents
Icon x
class ShelterBase extends TentBase GetShelterVariant()
Определения Shelter.c:94
override bool IsPlayerInside(PlayerBase player, string selection)
Определения Shelter.c:147
static const string SITE_OBJECT_TYPE
Определения Shelter.c:95
void SpawnKit()
Определения Shelter.c:141
void Deconstruct()
Определения Shelter.c:124
override void EEInit()
Определения Shelter.c:117
override void SetActions()
Определения Shelter.c:105
string GetMaterialPath()
Определения Shelter.c:131
void ShelterBase()
Определения Shelter.c:97
Определения InventoryItem.c:731
Определения PlayerBaseClient.c:2
override string GetShelterVariant()
Определения Shelter.c:102
Определения Shelter.c:101
static void SpawnConstructionMaterialPiles(notnull EntityAI entity, Man player, string cfg_path, string main_part_name, string damagezone_name="", bool is_base=false)
spawns material from any construction; 'player' parameter optional
Определения Construction.c:1233
proto native float Length()
Returns length of vector (magnitude)
proto float Normalize()
Normalizes vector. Returns length.
proto vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.
proto vector AnglesToVector()
Converts spherical coordinates (yaw, pitch, roll in degrees) to unit length vector.
Определения EnConvert.c:106
proto native CGame GetGame()
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
const string CFG_VEHICLESPATH
Определения constants.c:220
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.