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

◆ DoAmmoExplosion()

void InventoryItem::DoAmmoExplosion ( )
inlineprivate

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

1476 {
1477 Magazine magazine = Magazine.Cast(this);
1478 int pop_sounds_count = 6;
1479 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
1480
1481 //play sound
1482 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
1483 string sound_name = pop_sounds[ sound_idx ];
1484 GetGame().CreateSoundOnObject(this, sound_name, 20, false);
1485
1486 //remove ammo count
1487 magazine.ServerAddAmmoCount(-1);
1488
1489 //if condition then repeat -> ExplodeAmmo
1490 float min_temp_to_explode = 100; //min temperature for item to explode
1491
1492 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode) //TODO ? add check for parent -> fireplace
1493 {
1494 ExplodeAmmo();
1495 }
1496 }
proto native SoundOnVehicle CreateSoundOnObject(Object source, string sound_name, float distance, bool looped, bool create_local=false)
void ExplodeAmmo()
Определения ItemBase.c:1462
proto native CGame GetGame()

Перекрестные ссылки CGame::CreateSoundOnObject(), ExplodeAmmo(), GetGame() и Math::RandomInt().