mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-04 15:22:53 +03:00
Merge pull request #1098 from Fank/patch-6
Added Config Crafting inputstrict
This commit is contained in:
@@ -16,6 +16,7 @@ class ItemMixOil : CA_Magazine {
|
|||||||
requiretools[] = {};
|
requiretools[] = {};
|
||||||
output[] = {{"ItemJerryMixed",1}};
|
output[] = {{"ItemJerryMixed",1}};
|
||||||
input[] = {{"ItemMixOil",1},{"ItemJerrycan",1}};
|
input[] = {{"ItemMixOil",1},{"ItemJerrycan",1}};
|
||||||
|
inputstrict = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,12 +14,13 @@ class ItemActions
|
|||||||
requiretools[] = {"ItemToolbox","ItemKnife"}; // (cfgweapons only)
|
requiretools[] = {"ItemToolbox","ItemKnife"}; // (cfgweapons only)
|
||||||
output[] = {{"ItemTent",1}}; // (CfgMagazines, qty)
|
output[] = {{"ItemTent",1}}; // (CfgMagazines, qty)
|
||||||
input[] = {{"ItemCanvas",2},{"ItemPole",2}}; // (CfgMagazines, qty)
|
input[] = {{"ItemCanvas",2},{"ItemPole",2}}; // (CfgMagazines, qty)
|
||||||
|
inputstrict = true; // (CfgMagazines input without inheritsFrom) Optional
|
||||||
inputweapons[] = {"ItemToolbox"}; // consume toolbox (cfgweapons only)
|
inputweapons[] = {"ItemToolbox"}; // consume toolbox (cfgweapons only)
|
||||||
outputweapons[] = {"ItemToolbox"}; // return toolbox (cfgweapons only)
|
outputweapons[] = {"ItemToolbox"}; // return toolbox (cfgweapons only)
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
private ["_tradeComplete","_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_item","_baseClass","_num_removed_weapons","_outputWeapons","_inputWeapons","_randomOutput","_craft_doLoop","_selectedWeapon","_selectedMag","_sfx"];
|
private ["_tradeComplete","_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_selectedRecipeInputStrict","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_item","_baseClass","_num_removed_weapons","_outputWeapons","_inputWeapons","_randomOutput","_craft_doLoop","_selectedWeapon","_selectedMag","_sfx"];
|
||||||
|
|
||||||
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_63") , "PLAIN DOWN"]; };
|
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_63") , "PLAIN DOWN"]; };
|
||||||
DZE_ActionInProgress = true;
|
DZE_ActionInProgress = true;
|
||||||
@@ -68,6 +69,7 @@ if (_canDo) then {
|
|||||||
_selectedRecipeTools = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "requiretools");
|
_selectedRecipeTools = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "requiretools");
|
||||||
_selectedRecipeOutput = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "output");
|
_selectedRecipeOutput = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "output");
|
||||||
_selectedRecipeInput = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "input");
|
_selectedRecipeInput = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "input");
|
||||||
|
_selectedRecipeInputStrict = if ((isNumber (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputstrict")) && (getNumber (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputstrict") > 0)) then {true} else {false};
|
||||||
_outputWeapons = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "outputweapons");
|
_outputWeapons = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "outputweapons");
|
||||||
_inputWeapons = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputweapons");
|
_inputWeapons = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputweapons");
|
||||||
|
|
||||||
@@ -105,7 +107,7 @@ if (_canDo) then {
|
|||||||
_itemIn = _x select 0;
|
_itemIn = _x select 0;
|
||||||
_countIn = _x select 1;
|
_countIn = _x select 1;
|
||||||
|
|
||||||
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
|
_qty = { (_x == _itemIn) || (!_selectedRecipeInputStrict && configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
|
||||||
|
|
||||||
if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
|
if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
|
||||||
|
|
||||||
@@ -160,7 +162,7 @@ if (_canDo) then {
|
|||||||
|
|
||||||
{
|
{
|
||||||
_configParent = configName(inheritsFrom(configFile >> "cfgMagazines" >> _x));
|
_configParent = configName(inheritsFrom(configFile >> "cfgMagazines" >> _x));
|
||||||
if( (_removed < _countIn) && ((_x == _itemIn) || _configParent == _itemIn)) then {
|
if( (_removed < _countIn) && ((_x == _itemIn) || (!_selectedRecipeInputStrict && _configParent == _itemIn))) then {
|
||||||
_num_removed = ([player,_x] call BIS_fnc_invRemove);
|
_num_removed = ([player,_x] call BIS_fnc_invRemove);
|
||||||
_removed = _removed + _num_removed;
|
_removed = _removed + _num_removed;
|
||||||
_removed_total = _removed_total + _num_removed;
|
_removed_total = _removed_total + _num_removed;
|
||||||
|
|||||||
Reference in New Issue
Block a user