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

◆ DoAmmoExplosion()

void InventoryItem::DoAmmoExplosion ( )
inlineprivate

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

1499 {
1500 Magazine magazine = Magazine.Cast(this);
1501 int pop_sounds_count = 6;
1502 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
1503
1504 //play sound
1505 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
1506 string sound_name = pop_sounds[ sound_idx ];
1507 g_Game.CreateSoundOnObject(this, sound_name, 20, false);
1508
1509 //remove ammo count
1510 magazine.ServerAddAmmoCount(-1);
1511
1512 //if condition then repeat -> ExplodeAmmo
1513 float min_temp_to_explode = 100; //min temperature for item to explode
1514
1515 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode) //TODO ? add check for parent -> fireplace
1516 {
1517 ExplodeAmmo();
1518 }
1519 }
DayZGame g_Game
Определения DayZGame.c:3942
float GetTemperature()
Определения Environment.c:500
void ExplodeAmmo()
Определения ItemBase.c:1485

Перекрестные ссылки ExplodeAmmo(), g_Game, GetTemperature() и Math::RandomInt().