This commit is contained in:
vbawol
2013-01-26 17:13:46 -06:00
parent fbb55f318c
commit bae5ba2d72
5 changed files with 128 additions and 93 deletions

View File

@@ -67,7 +67,7 @@ _qty = {_x == "FoodrabbitRaw"} count magazines player;
_hasFoodMeat = "FoodrabbitRaw" in magazines player;
if (!_hasFoodMeat) exitWith {cutText [format[(localize "str_player_31"),_text,"cook"] , "PLAIN DOWN"]};
player removeMagazine "FoodrabbitRaw";
player addMagazine "FoodBaconCooked";
player addMagazine "FoodRabbitCooked";
sleep 1;
};
cutText [format[(localize "str_success_cooked"),_qty,(localize "STR_EQUIP_NAME_24")], "PLAIN DOWN"];
@@ -84,7 +84,7 @@ _qty = {_x == "FoodbaconRaw"} count magazines player;
_hasFoodMeat = "FoodbaconRaw" in magazines player;
if (!_hasFoodMeat) exitWith {cutText [format[(localize "str_player_31"),_text,"cook"] , "PLAIN DOWN"]};
player removeMagazine "FoodbaconRaw";
player addMagazine "FoodRabbitCooked";
player addMagazine "FoodBaconCooked";
sleep 1;
};
cutText [format[(localize "str_success_cooked"),_qty,(localize "STR_EQUIP_NAME_24")], "PLAIN DOWN"];

View File

@@ -1,89 +1,98 @@
private["_item","_id","_regen","_isAnimal","_animalType","_isMan","_config","_isListed","_qty"];
private["_item","_id","_regen","_isAnimal","_animalType","_isMan","_config","_isListed","_qty","_ent"];
_item = _this select 3;
_ent = _item;
player removeAction s_player_butcher;
_item setDammage 1;
// wait until dead
waitUntil {not alive _item};
s_player_butcher = -1;
// player playActionNow "PutDown";
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
[player,"gut",0,false] call dayz_zombieSpeak;
_item setVariable["meatHarvested",true,true];
sleep 1;
_regen = 200;
_isAnimal = _item isKindOf "Animal";
_animalType = typeOf _item;
_isMan = _item isKindOf "Man";
if(_isAnimal) then {
_config = configFile >> "CfgSurvival" >> "Meat" >> _animalType;
_isListed = isClass (_config);
_qty = 1;
if (_isListed) then {
_qty = getNumber (_config >> "yield");
_regen = _qty * 200;
};
if (_ent isKindOf "Animal") then {
_ent setDamage 1;
} else {
_ent setHit ["legs",1];
_ent setVariable ["hit_legs",2,true];
};
if(_isMan) then {
_regen == 12000;
_rnd = round(random 4) + 1;
_move = "ZombieFeed" + str(_rnd);
[nil, player, rSWITCHMOVE,_move] call RE;
sleep 5;
if(not alive _item) then {
// player playActionNow "PutDown";
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
[player,"gut",0,false] call dayz_zombieSpeak;
_item setVariable["meatHarvested",true,true];
sleep 1;
_regen = 200;
_isAnimal = _item isKindOf "Animal";
_animalType = typeOf _item;
_isMan = _item isKindOf "Man";
if(_isAnimal) then {
_config = configFile >> "CfgSurvival" >> "Meat" >> _animalType;
_isListed = isClass (_config);
_qty = 1;
if (_isListed) then {
_qty = getNumber (_config >> "yield");
_regen = _qty * 200;
};
} else {
if(_isMan) then {
_regen == 12000;
};
};
r_player_blood = r_player_blood + _regen;
if (r_player_blood > r_player_bloodTotal) then {
r_player_blood = r_player_bloodTotal;
};
player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
player setVariable["USEC_BloodQty",r_player_blood,true];
player setVariable["medForceUpdate",true];
dayz_lastDrink = time;
dayz_thirst = 0;
dayz_lastMeal = time;
dayz_hunger = 0;
["dayzPlayerSave",[player,[],true]] call callRpcProcedure;
[player,"eat",0,false] call dayz_zombieSpeak;
// todo: dump loot on ground and then remove
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1301;
_control ctrlShow true;
_bloodVal = r_player_blood / r_player_bloodTotal;
if (_bloodVal >= 0.2) then {
_ctrlBlood ctrlShow true;
};
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1302;
_control ctrlShow true;
cutText [format[(localize "str_player_consumed"),_item, "PLAIN DOWN"];
};
r_player_blood = r_player_blood + _regen;
if (r_player_blood > r_player_bloodTotal) then {
r_player_blood = r_player_bloodTotal;
};
player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
player setVariable["USEC_BloodQty",r_player_blood,true];
player setVariable["medForceUpdate",true];
dayz_lastDrink = time;
dayz_thirst = 0;
dayz_lastMeal = time;
dayz_hunger = 0;
["dayzPlayerSave",[player,[],true]] call callRpcProcedure;
[player,"eat",0,false] call dayz_zombieSpeak;
// todo: dump loot on ground and then remove
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1301;
_control ctrlShow true;
_bloodVal = r_player_blood / r_player_bloodTotal;
if (_bloodVal >= 0.2) then {
_ctrlBlood ctrlShow true;
};
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1302;
_control ctrlShow true;
// Remove body
["dayzHideBody",_item] call broadcastRpcCallAll;
cutText [format[(localize "str_player_consumed"),_item, "PLAIN DOWN"];
sleep 10;
deleteVehicle _item;
s_player_butcher = -1;