0.996 released

+ Corrected some code related to moving crafting recipes to config.
+ Crafting system now checks for correct number of items.
This commit is contained in:
vbawol
2013-03-12 17:13:04 -05:00
parent 9768ca96f0
commit c4ea450657
6 changed files with 65 additions and 51 deletions

View File

@@ -38,8 +38,8 @@ class CfgMagazines {
{
text = "Craft Large Sandbag";
script = "spawn player_craftItem;";
output[] = {["ItemSandbagLarge",1]};
input[] = {["ItemSandbag",3],["ItemWire",1],["ItemTankTrap",1]};
output[] = {{"ItemSandbagLarge",1}};
input[] = {{"ItemSandbag",3},{"ItemWire",1},{"ItemTankTrap",1}};
};
};
};

View File

@@ -79,8 +79,8 @@ if (inflamed cursorTarget and _canDo) then {
diag_log format["Selected Recipe Input: %1", _selectedRecipeInput];
diag_log format["Selected Recipe Output: %1", _selectedRecipeOutput];
// Dry run to see if all parts are available.
_proceed = true;
{
_itemIn = _x select 0;
_countIn = _x select 1;
@@ -97,49 +97,63 @@ if (inflamed cursorTarget and _canDo) then {
} forEach _selectedRecipeInput;
// If all parts proceed
if (_proceed) then {
player playActionNow "Medic";
sleep 1;
[player,"repair",0,false] call dayz_zombieSpeak;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
sleep 5;
_removed = 0; // count total of removed items
_tobe_removed_total = 0; // count total of all to be removed items
// Take items
{
_itemIn = _x select 0;
_countIn = _x select 1;
diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn];
_removed = 0; // count of removed items
_tobe_removed_total = _tobe_removed_total + _countIn;
{
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
diag_log format["removing: %1 kindOf: %2", _x, _itemIn];
player removeMagazine _x;
_removed = _removed +1;
// diag_log format["removing: %1 kindOf: %2", _x, _itemIn];
// player removeMagazine _x;
_removed = _removed + ([player,_x] call BIS_fnc_invRemove);
};
} forEach magazines player;
} forEach _selectedRecipeInput;
// Put items
{
_itemOut = _x select 0;
_countOut = _x select 1;
diag_log format["Recipe Output: %1 %2", _itemOut,_countOut];
for "_x" from 1 to _countOut do {
player addMagazine _itemOut;
};
diag_log format["removing: %1 kindOf: %2", _removed, _tobe_removed_total];
// Only proceed if all parts were removed successfully
if(_removed == _tobe_removed_total) then {
player playActionNow "Medic";
sleep 1;
[player,"repair",0,false] call dayz_zombieSpeak;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
sleep 5;
// Put items
{
_itemOut = _x select 0;
_countOut = _x select 1;
diag_log format["Recipe Output: %1 %2", _itemOut,_countOut];
} forEach _selectedRecipeOutput;
for "_x" from 1 to _countOut do {
player addMagazine _itemOut;
};
} forEach _selectedRecipeOutput;
// get display name
_textCreate = getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName");
// get display name
_textCreate = getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName");
// Add crafted item
cutText [format["Crafted Item: %1 x %2",_textCreate,_countOut], "PLAIN DOWN"];
// Add crafted item
cutText [format["Crafted Item: %1 x %2",_textCreate,_countOut], "PLAIN DOWN"];
} else {
cutText [format["Missing Parts after first check Item: %1 / %2",_removed,_tobe_removed_total], "PLAIN DOWN"];
};
} else {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");

View File

@@ -40,7 +40,7 @@ class CfgMods
hidePicture = 0;
hideName = 0;
action = "http://www.dayzepoch.com";
version = "0.995";
version = "0.996";
hiveVersion = 0.96; //0.93
};
};

View File

@@ -137,7 +137,7 @@ class RscDisplayMain : RscStandardDisplay
class DAYZ_Version : CA_Version
{
idc = -1;
text = "DayZ Epoch 0.995 (1.7.6.1)";
text = "DayZ Epoch 0.996 (1.7.6.1)";
y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)";
};
delete CA_TitleMainMenu;

View File

@@ -1392,8 +1392,8 @@ class CfgMagazines
{
text = "Smelt 10oz bar";
script = "spawn player_craftItem;";
output[] = {["ItemGoldBar10oz",1]};
input[] = {["ItemGoldBar",10]};
output[] = {{"ItemGoldBar10oz",1}};
input[] = {{"ItemGoldBar",10}};
};
};
@@ -1413,8 +1413,8 @@ class CfgMagazines
{
text = "Smelt 1oz bars";
script = "spawn player_craftItem;";
output[] = {["ItemGoldBar",10]};
input[] = {["ItemGoldBar10oz",1]};
output[] = {{"ItemGoldBar",10}};
input[] = {{"ItemGoldBar10oz",1}};
};
};
};
@@ -1433,8 +1433,8 @@ class CfgMagazines
{
text = "Smelt 10oz bar";
script = "spawn player_craftItem;";
output[] = {["ItemSilverBar10oz"1]};
input[] = {["ItemSilverBar",10]};
output[] = {{"ItemSilverBar10oz",1}};
input[] = {{"ItemSilverBar",10}};
};
};
};
@@ -1454,8 +1454,8 @@ class CfgMagazines
{
text = "Smelt 1oz bars";
script = "spawn player_craftItem;";
output[] = {["ItemSilverBar",10]};
input[] = {["ItemSilverBar10oz",1]};
output[] = {{"ItemSilverBar",10}};
input[] = {{"ItemSilverBar10oz",1}};
};
};
};
@@ -1474,8 +1474,8 @@ class CfgMagazines
{
text = "Smelt 10oz bar";
script = "spawn player_craftItem;";
output[] = {["ItemCopperBar10oz",1]};
input[] = {["ItemCopperBar",10]};
output[] = {{"ItemCopperBar10oz",1}};
input[] = {{"ItemCopperBar",10}};
};
};
};
@@ -1495,8 +1495,8 @@ class CfgMagazines
{
text = "Smelt 1oz bars";
script = "spawn player_craftItem;";
output[] = {["ItemCopperBar",10]};
input[] = {["ItemCopperBar10oz",1]};
output[] = {{"ItemCopperBar",10}};
input[] = {{"ItemCopperBar10oz",1}};
};
};
};
@@ -1537,8 +1537,8 @@ class CfgMagazines
{
text = "Smelt 1oz bars";
script = "spawn player_craftItem;";
output[] = {["ItemAluminumBar",10]};
input[] = {["ItemAluminumBar10oz",1]};
output[] = {{"ItemAluminumBar",10}};
input[] = {{"ItemAluminumBar10oz",1}};
};
};
};
@@ -1568,8 +1568,8 @@ class CfgMagazines
{
text = "Smelt 1oz bars";
script = "spawn player_craftItem;";
output[] = {["ItemTinBar",10]};
input[] = {["ItemTinBar10oz",1]};
output[] = {{"ItemTinBar",10}};
input[] = {{"ItemTinBar10oz",1}};
};
};
};

View File

@@ -650,8 +650,8 @@ class cfgMagazines
{
text = "Melt into Bars";
script = "spawn player_craftItem;";
output[] = {["ItemTinBar",1]};
input[] = {["TrashTinCan",6]};
output[] = {{"ItemTinBar",1}};
input[] = {{"TrashTinCan",6}};
};
};
};
@@ -669,8 +669,8 @@ class cfgMagazines
{
text = "Melt into Bars";
script = "spawn player_craftItem;";
output[] = {["ItemAluminumBar",1]};
input[] = {["ItemSodaEmpty",6]};
output[] = {{"ItemAluminumBar",1}};
input[] = {{"ItemSodaEmpty",6}};
};
};
};