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

◆ IsPlayerInside()

override bool GetShelterVariant::IsPlayerInside ( PlayerBase player,
string selection )

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

148{
149 static const string SITE_OBJECT_TYPE = "ShelterSite";
150
151 void ShelterBase()
152 {
153 m_ShowAnimationsWhenPitched.Insert("Body");
154 m_ShowAnimationsWhenPacked.Insert("Body");
155
156 m_HalfExtents = Vector(0.8, 0.15, 1.3);
157 }
158
159 override void SetActions()
160 {
161 super.SetActions();
162
167
169 }
170
171 override void EEInit()
172 {
173 super.EEInit();
174
175 TryPitch(true, true);
176 }
177
178 void Deconstruct()
179 {
181 SpawnKit();
182 Delete();
183 }
184
185 string GetMaterialPath()
186 {
187 return string.Format("%1 %2 Construction site %3 Materials", CFG_VEHICLESPATH, SITE_OBJECT_TYPE, GetShelterVariant());
188 }
189
190 string GetShelterVariant()
191 {
192 return "";
193 }
194
195 void SpawnKit()
196 {
197 ItemBase constructionKit = ItemBase.Cast(GetGame().CreateObjectEx("ShelterKit", GetPosition(), ECE_PLACE_ON_SURFACE));
198 constructionKit.SetHealth01("", "", GetHealth01());
199 }
200
201 override bool IsPlayerInside(PlayerBase player, string selection)
202 {
203 vector player_pos = player.GetPosition();
204 vector shelter_pos = GetPosition();
205 vector ref_dir = GetDirection();
206 ref_dir[1] = 0;
207 ref_dir.Normalize();
208
209 vector x[2];
210 vector b1,b2;
211 GetCollisionBox(x);
212 b1 = x[0];
213 b2 = x[1];
214
215 vector dir_to_shelter = shelter_pos - player_pos;
216 dir_to_shelter[1] = 0;
217 float len = dir_to_shelter.Length();
218
219 dir_to_shelter.Normalize();
220
221 vector ref_dir_angle = ref_dir.VectorToAngles();
222 vector dir_to_shelter_angle = dir_to_shelter.VectorToAngles();
223 vector test_angles = dir_to_shelter_angle - ref_dir_angle;
224
225 vector test_position = test_angles.AnglesToVector() * len;
226
227 if (test_position[0] < b1[0] || test_position[0] > b2[0] || test_position[2] < 0.2 || test_position[2] > 2.2 )
228 {
229 return false;
230 }
231 else
232 {
233 return true;
234 }
235 }
236}
237
238class ShelterFabric extends ShelterBase
239{
240 override string GetShelterVariant()
241 {
242 return "fabric";
243 }
244}
245
246class ShelterLeather extends ShelterBase
247{
248 override string GetShelterVariant()
249 {
250 return "leather";
251 }
252}
253
254class ShelterStick extends ShelterBase
255{
256 override string GetShelterVariant()
257 {
258 return "stick";
259 }
260}
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.