<commit_before>scriptName "fn_destroyCity.sqf";
/*
	Author: <NAME>

	Description:
	Destroys building in given area based on input seed.

	Parameter(s):
	_this select 0: OBJECT - Destruction center
	_this select 1 (Optional): NUMBER - Destruction area diameter
	_this select 2 (Optional): NUMBER - Random seed
	_this select 3 (Optional): ARRAY - Array of blacklisted objects

	Returns:
	ARRAY - Particle sources
*/
//if (!isserver) exitwith {debuglog "Log: [Functions] ERROR: 'BIS_fnc_destroyCity' cannot run on client.";};

private ["_center","_areaSize","_seed","_blacklist","_fire","_debug","_buildings","_pos","_posX","_posY","_posTotal","_seedLocal","_marker","_centre","_size"];
_debug = false;
_center = _this select 0;
_areaSize = if (count _this > 1) then {_this select 1} else {1000};
_seed = if (count _this > 2) then {_this select 2} else {1138};
_blacklist = if (count _this > 3) then {_this select 3} else {[]};
_fire = if (count _this > 4) then {_this select 4} else {true;};
_debug = if (isnil "_debug") then {false} else {_debug};

if (typename _center == typename "") then {_center = markerpos _center};
if (typename _center == typename objnull) then {_center = position _center};

if (_areaSize < 0) then {_areaSize = 1000;};
if (_seed < 0) then {_seed = 1138;};

_seed =  round(_seed % 42);
if (_seed == 0) then {_seed = 42;};

_buildings = _center nearobjects ["house",_areaSize];
_buildings = _buildings - _blacklist;
{
	_pos = position _x;
	_posX = _pos select 0;
	_posY = _pos select 1;
	_posTotal = _posX + _posY;
	_seedLocal = (_posTotal % _seed) / _seed;
        //_bc = boundingCenter _x;

//	_pos = [(_pos select 0) + (_bc select 0), (_pos select 1) + (_bc select 2), (_pos select 2) + (_bc select 1)];
	_size = (boundingBox _x) select 1;

	if (_seedLocal < 0.5) then {
		//_x setdamage 0.8;
		for "_i" from 1 to 7 do {
			_x sethit [format ["dam%1",_i],1];
			_x sethit [format ["dam %1",_i],1];
		};
		if (_debug) then {_marker = createMarker ["X" + str _posTotal, position _x]; _marker setmarkertype "Dot"; _marker setmarkercolor "colorred";};
	} else {
		if (_seedLocal > 0.9) then {
			//_x hideobject true;
			_x setdamage 1;
			if (_debug) then {_marker = createMarker ["X" + str _posTotal, position _x]; _marker setmarkertype "Dot"; _marker setmarkercolor "colorblue";};
                        if(_fire && !isDedicated) then {
                                _centre = "HeliHEmpty" createVehicleLocal _pos;
			_centre setPos _pos;
			0 = [_centre, exp((_size select 0) * (_size select 1) * (_size select 2) / 500) min 10, time, false, false] spawn BIS_Effects_Burn;
                        };
		} else {
			_x setdamage 0.5;
			if (_debug) then {_marker = createMarker ["X" + str _posTotal, position _x]; _marker setmarkertype "Dot"; _marker setmarkercolor "colorgreen";};
		};
	};
} foreach _buildings;

true<commit_msg>- HeliHEmpty broke Ambient Air - reverted back to SkeetDisk<commit_after>scriptName "fn_destroyCity.sqf";
/*
	Author: <NAME>

	Description:
	Destroys building in given area based on input seed.

	Parameter(s):
	_this select 0: OBJECT - Destruction center
	_this select 1 (Optional): NUMBER - Destruction area diameter
	_this select 2 (Optional): NUMBER - Random seed
	_this select 3 (Optional): ARRAY - Array of blacklisted objects

	Returns:
	ARRAY - Particle sources
*/
//if (!isserver) exitwith {debuglog "Log: [Functions] ERROR: 'BIS_fnc_destroyCity' cannot run on client.";};

private ["_center","_areaSize","_seed","_blacklist","_fire","_debug","_buildings","_pos","_posX","_posY","_posTotal","_seedLocal","_marker","_centre","_size"];
_debug = false;
_center = _this select 0;
_areaSize = if (count _this > 1) then {_this select 1} else {1000};
_seed = if (count _this > 2) then {_this select 2} else {1138};
_blacklist = if (count _this > 3) then {_this select 3} else {[]};
_fire = if (count _this > 4) then {_this select 4} else {true;};
_debug = if (isnil "_debug") then {false} else {_debug};

if (typename _center == typename "") then {_center = markerpos _center};
if (typename _center == typename objnull) then {_center = position _center};

if (_areaSize < 0) then {_areaSize = 1000;};
if (_seed < 0) then {_seed = 1138;};

_seed =  round(_seed % 42);
if (_seed == 0) then {_seed = 42;};

_buildings = _center nearobjects ["house",_areaSize];
_buildings = _buildings - _blacklist;
{
	_pos = position _x;
	_posX = _pos select 0;
	_posY = _pos select 1;
	_posTotal = _posX + _posY;
	_seedLocal = (_posTotal % _seed) / _seed;
        //_bc = boundingCenter _x;

//	_pos = [(_pos select 0) + (_bc select 0), (_pos select 1) + (_bc select 2), (_pos select 2) + (_bc select 1)];
	_size = (boundingBox _x) select 1;

	if (_seedLocal < 0.5) then {
		//_x setdamage 0.8;
		for "_i" from 1 to 7 do {
			_x sethit [format ["dam%1",_i],1];
			_x sethit [format ["dam %1",_i],1];
		};
		if (_debug) then {_marker = createMarker ["X" + str _posTotal, position _x]; _marker setmarkertype "Dot"; _marker setmarkercolor "colorred";};
	} else {
		if (_seedLocal > 0.9) then {
			//_x hideobject true;
			_x setdamage 1;
			if (_debug) then {_marker = createMarker ["X" + str _posTotal, position _x]; _marker setmarkertype "Dot"; _marker setmarkercolor "colorblue";};
                        if(_fire && !isDedicated) then {
                                _centre = "SkeetDisk" createVehicleLocal _pos;
			_centre setPos _pos;
			0 = [_centre, exp((_size select 0) * (_size select 1) * (_size select 2) / 500) min 10, time, false, false] spawn BIS_Effects_Burn;
                        };
		} else {
			_x setdamage 0.5;
			if (_debug) then {_marker = createMarker ["X" + str _posTotal, position _x]; _marker setmarkertype "Dot"; _marker setmarkercolor "colorgreen";};
		};
	};
} foreach _buildings;

true
{'fraction_non_alphanumeric': 0.13644828169967835, 'fraction_numerical': 0.023362112747587607, 'mean_word_length': 3.4023845007451565, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1557061', 'n_tokens_mistral': 2222, 'n_tokens_neox': 2017, 'n_words': 665}