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

◆ ThrowAllItemsInInventoryEx()

static void ThrowAllItemsInInventoryEx ( notnull EntityAI parent,
int flags,
vector force )
staticprotected

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

1250 {
1251 vector position = parent.GetPosition();
1252 vector orientation = parent.GetOrientation();
1253 vector rotation_matrix[3];
1254 float direction[4];
1255 vector randomPos;
1256 vector minmax[2];
1257 parent.GetCollisionBox(minmax);
1258
1259 Math3D.YawPitchRollMatrix( orientation, rotation_matrix );
1260 Math3D.MatrixToQuat( rotation_matrix, direction );
1261
1262 //gather entities first
1264 int count, i;
1265 //atts
1266 GameInventory parentInventory = parent.GetInventory();
1267 if (parentInventory)
1268 {
1269 count = parentInventory.AttachmentCount();
1270 for (i = 0; i < count; ++i)
1271 {
1272 ents.Insert(parentInventory.GetAttachmentFromIndex(i));
1273 }
1274 }
1275
1276 //cargo
1277 CargoBase parentCargo = parentInventory.GetCargo();
1278 if (parentCargo)
1279 {
1280 count = parentCargo.GetItemCount();
1281 for (i = 0; i < count; ++i)
1282 {
1283 ents.Insert(parentCargo.GetItem(i));
1284 }
1285 }
1286
1287 //now throw them all
1288 foreach (EntityAI ent : ents)
1289 {
1290 randomPos = Vector(position[0] + Math.RandomFloat(minmax[0][0], minmax[1][0]),
1291 position[1] + Math.RandomFloat(minmax[0][1], minmax[1][1]),
1292 position[2] + Math.RandomFloat(minmax[0][2], minmax[1][2]));
1293 ThrowEntityFromInventory(ent, randomPos, direction, force, ThrowEntityFlags.NONE);
1294 }
1295 }
vector position
Определения DustKickupEffects.c:20
vector orientation
Определения DustKickupEffects.c:21
ThrowEntityFlags
Определения MiscGameplayFunctions.c:208
static void ThrowEntityFromInventory(notnull EntityAI entity, vector position, float direction[4], vector force, int flags)
Определения MiscGameplayFunctions.c:1297
proto native int GetItemCount()
proto native EntityAI GetItem(int index)
represents base for cargo storage for entities
Определения Cargo.c:7
proto native EntityAI GetAttachmentFromIndex(int index)
proto native CargoBase GetCargo()
cargo
proto native int AttachmentCount()
Returns count of attachments attached to this item.
script counterpart to engine's class Inventory
Определения EnMath3D.c:28
Определения EnMath.c:7
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения EnConvert.c:119
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto void MatrixToQuat(vector mat[3], out float d[4])
Converts rotation matrix to quaternion.
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].

Перекрестные ссылки GameInventory::AttachmentCount(), GameInventory::GetAttachmentFromIndex(), GameInventory::GetCargo(), CargoBase::GetItem(), CargoBase::GetItemCount(), Math3D::MatrixToQuat(), orientation, position, Math::RandomFloat(), ThrowEntityFromInventory(), Vector() и Math3D::YawPitchRollMatrix().

Используется в ThrowAllItemsInInventory().