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

◆ DamageItemAttachments()

bool DamageItemAttachments ( float damage)
private

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

1512 {
1513 GameInventory inventory = GetInventory();
1514 int attachment_count = inventory.AttachmentCount();
1515 if (attachment_count > 0)
1516 {
1517 int random_pick = Math.RandomInt(0, attachment_count);
1518 ItemBase attachment = ItemBase.Cast(inventory.GetAttachmentFromIndex(random_pick));
1519 if (!attachment.IsExplosive())
1520 {
1521 attachment.AddHealth("","",damage);
1522 return true;
1523 }
1524 }
1525 return false;
1526 }
proto native EntityAI GetAttachmentFromIndex(int index)
proto native int AttachmentCount()
Returns count of attachments attached to this item.
script counterpart to engine's class Inventory
Определения EnMath.c:7
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].

Перекрестные ссылки GameInventory::AttachmentCount(), GameInventory::GetAttachmentFromIndex() и Math::RandomInt().

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