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

◆ DoAmmoExplosion()

void DoAmmoExplosion ( )
private

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

1427 {
1428 Magazine magazine = Magazine.Cast(this);
1429 int pop_sounds_count = 6;
1430 string pop_sounds[ 6 ] = { "ammopops_1","ammopops_2","ammopops_3","ammopops_4","ammopops_5","ammopops_6" };
1431
1432 //play sound
1433 int sound_idx = Math.RandomInt(0, pop_sounds_count - 1);
1434 string sound_name = pop_sounds[ sound_idx ];
1435 g_Game.CreateSoundOnObject(this, sound_name, 20, false);
1436
1437 //remove ammo count
1438 magazine.ServerAddAmmoCount(-1);
1439
1440 //if condition then repeat -> ExplodeAmmo
1441 float min_temp_to_explode = 100; //min temperature for item to explode
1442
1443 if (magazine.GetAmmoCount() > 0 && GetTemperature() >= min_temp_to_explode) //TODO ? add check for parent -> fireplace
1444 {
1445 ExplodeAmmo();
1446 }
1447 }
DayZGame g_Game
Определения DayZGame.c:4074
void ExplodeAmmo()
Определения ItemBase.c:1413
Определения EnMath.c:7
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].

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