<commit_before>// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
//@file Version: 1.0
//@file Name: init.sqf
//@file Author: MercyfulFate
//@file Created: 21/7/2013 16:00
//@file Description: Initialize Jerrycans
//@file Argument: The path of the directory holding this file.

MF_ITEMS_JERRYCAN_EMPTY = "jerrycanempty";
MF_ITEMS_JERRYCAN_FULL = "jerrycanfull";
MF_ITEMS_SYPHON_HOSE = "syphonhose";
MF_ITEMS_JERRYCAN_MAX = ["config_items_jerrycans_max", 1] call getPublicVar;
MF_ITEMS_SYHON_HOSE_MAX = ["config_items_syphon_hose_max", 1] call getPublicVar;
#define build(file) format["%1\%2", _path, file] call mf_compile;

private ["_path","_refill", "_refuel", "_icon"];
_path = _this;

_refill = [_path, "refill.sqf"] call mf_compile;
_refuel = [_path, "refuel.sqf"] call mf_compile;
_syphon = [_path, "syphon.sqf"] call mf_compile;
_icon = "client\icons\jerrycan.paa";

_max = {
	private ["_empty", "_full"];
	_empty = MF_ITEMS_JERRYCAN_EMPTY call mf_inventory_count;
	_full = MF_ITEMS_JERRYCAN_FULL call mf_inventory_count;
	(_empty + _full) >= MF_ITEMS_JERRYCAN_MAX;
};

mf_jerrycan_nearest_pump = {
	_pump_objects = ["Land_FuelStation_Feed_F", "Land_MetalBarrel_F", "Land_fs_feed_F", "Land_Tank_rust_F"];
	_objects = nearestobjects [player, _pump_objects,  3];
	_object = objNull;
	if (count _objects > 0) then {_object = _objects select 0;};
	_object;
} call mf_compile;

mf_jerrycan_nearest_vehicle = {
	["LandVehicle", "Air", "Ship"] call mf_nearest_vehicle
} call mf_compile;

mf_jerrycan_fuel_amount = {
	private ["_vehicle", "_fuel_amount", "_config", "_type"];
	_vehicle = _this select 0;
	_fuel_amount = ["config_refuel_amount_default", 0.25] call getPublicVar;
	{
		_type = _x select 0;
		if (_vehicle isKindOf _type ) exitWith
		{
			_fuel_amount = _x select 1;
		};
	} forEach (["config_refuel_amounts", []] call getPublicVar);
	_fuel_amount;
} call mf_compile;

mf_remote_refuel = {
	private ["_vehicle", "_qty", "_fuel"];
	_vehicle = objectFromNetId (_this select 0);
	_fuel = fuel _vehicle + ([_vehicle] call mf_jerrycan_fuel_amount);
	_vehicle setFuel (_fuel min 1);
} call mf_compile;

mf_remote_syphon = {
	private ["_vehicle", "_qty", "_fuel"];
	_vehicle = objectFromNetId (_this select 0);
	_fuel = fuel _vehicle - ([_vehicle] call mf_jerrycan_fuel_amount);
	_vehicle setFuel (_fuel max 0);
} call mf_compile;


[MF_ITEMS_JERRYCAN_EMPTY, "Empty Jerrycan", _refill, "Land_CanisterFuel_F", _icon, _max] call mf_inventory_create;
[MF_ITEMS_JERRYCAN_FULL, "Full Jerrycan", _refuel, "Land_CanisterFuel_F", _icon, _max] call mf_inventory_create;
[MF_ITEMS_SYPHON_HOSE, "Syphon Hose", _syphon, "Land_CanisterOil_F", _icon, MF_ITEMS_SYHON_HOSE_MAX] call mf_inventory_create;

mf_jerrycan_can_refill = [_path, "can_refill.sqf"] call mf_compile;
mf_jerrycan_can_refuel = [_path, "can_refuel.sqf"] call mf_compile;
mf_jerrycan_can_syphon = [_path, "can_syphon.sqf"] call mf_compile;

// Setting up refill action.
private ["_label1", "_execute1", "_condition1", "_action1"];
_label1 = format["<img image='%1'/> Fill Jerry Can", _icon];
_execute1 = {MF_ITEMS_JERRYCAN_EMPTY call mf_inventory_use};
_condition1 = format["[] call %1 == ''", mf_jerrycan_can_refill];
_action1 = [_label1, _execute1, [], 1, false, false, "", _condition1];
["jerrycan-refill", _action1] call mf_player_actions_set;
<commit_msg>Update init.sqf<commit_after>// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
//@file Version: 1.0
//@file Name: init.sqf
//@file Author: MercyfulFate
//@file Created: 21/7/2013 16:00
//@file Description: Initialize Jerrycans
//@file Argument: The path of the directory holding this file.

MF_ITEMS_JERRYCAN_EMPTY = "jerrycanempty";
MF_ITEMS_JERRYCAN_FULL = "jerrycanfull";
MF_ITEMS_SYPHON_HOSE = "syphonhose";
MF_ITEMS_JERRYCAN_MAX = ["config_items_jerrycans_max", 1] call getPublicVar;
MF_ITEMS_SYHON_HOSE_MAX = ["config_items_syphon_hose_max", 1] call getPublicVar;
#define build(file) format["%1\%2", _path, file] call mf_compile;

private ["_path","_refill", "_refuel", "_icon"];
_path = _this;

_refill = [_path, "refill.sqf"] call mf_compile;
_refuel = [_path, "refuel.sqf"] call mf_compile;
_syphon = [_path, "syphon.sqf"] call mf_compile;
_icon = "client\icons\jerrycan.paa";

_max = {
	private ["_empty", "_full"];
	_empty = MF_ITEMS_JERRYCAN_EMPTY call mf_inventory_count;
	_full = MF_ITEMS_JERRYCAN_FULL call mf_inventory_count;
	(_empty + _full) >= MF_ITEMS_JERRYCAN_MAX;
};

mf_jerrycan_nearest_pump = {
	_pump_objects = ["Land_FuelStation_Feed_F", "Land_MetalBarrel_F", "Land_fs_feed_F", "Land_Tank_rust_F"];
	_objects = nearestobjects [player, _pump_objects,  3];
	_object = objNull;
	if (count _objects > 0) then {_object = _objects select 0;};
	_object;
} call mf_compile;

mf_jerrycan_nearest_vehicle = {
	["LandVehicle", "Air", "Ship"] call mf_nearest_vehicle
} call mf_compile;

mf_jerrycan_fuel_amount = {
	private ["_vehicle", "_fuel_amount", "_config", "_type"];
	_vehicle = _this select 0;
	_fuel_amount = ["config_refuel_amount_default", 0.25] call getPublicVar;
	{
		_type = _x select 0;
		if (_vehicle isKindOf _type ) exitWith
		{
			_fuel_amount = _x select 1;
		};
	} forEach (["config_refuel_amounts", []] call getPublicVar);
	_fuel_amount;
} call mf_compile;

mf_remote_refuel = {
	private ["_vehicle", "_qty", "_fuel"];
	_vehicle = objectFromNetId (_this select 0);
	_fuel = fuel _vehicle + ([_vehicle] call mf_jerrycan_fuel_amount);
	_vehicle setFuel (_fuel min 1);
} call mf_compile;

mf_remote_syphon = {
	private ["_vehicle", "_qty", "_fuel"];
	_vehicle = objectFromNetId (_this select 0);
	_fuel = fuel _vehicle - ([_vehicle] call mf_jerrycan_fuel_amount);
	_vehicle setFuel (_fuel max 0);
} call mf_compile;


[MF_ITEMS_JERRYCAN_EMPTY, "Bidón de gasolina vacío", _refill, "Land_CanisterFuel_F", _icon, _max] call mf_inventory_create;
[MF_ITEMS_JERRYCAN_FULL, "Bidón de gasolina lleno", _refuel, "Land_CanisterFuel_F", _icon, _max] call mf_inventory_create;
[MF_ITEMS_SYPHON_HOSE, "Sifón", _syphon, "Land_CanisterOil_F", _icon, MF_ITEMS_SYHON_HOSE_MAX] call mf_inventory_create;

mf_jerrycan_can_refill = [_path, "can_refill.sqf"] call mf_compile;
mf_jerrycan_can_refuel = [_path, "can_refuel.sqf"] call mf_compile;
mf_jerrycan_can_syphon = [_path, "can_syphon.sqf"] call mf_compile;

// Setting up refill action.
private ["_label1", "_execute1", "_condition1", "_action1"];
_label1 = format["<img image='%1'/> Rellenar bidón de gasolina", _icon];
_execute1 = {MF_ITEMS_JERRYCAN_EMPTY call mf_inventory_use};
_condition1 = format["[] call %1 == ''", mf_jerrycan_can_refill];
_action1 = [_label1, _execute1, [], 1, false, false, "", _condition1];
["jerrycan-refill", _action1] call mf_player_actions_set;

{'fraction_non_alphanumeric': 0.1744561403508772, 'fraction_numerical': 0.01431578947368421, 'mean_word_length': 6.737242128121607, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '337155', 'n_tokens_mistral': 2882, 'n_tokens_neox': 2708, 'n_words': 595}