Actions Done

This commit is contained in:
icomrade
2016-02-29 10:45:53 -05:00
parent a47c3dc137
commit b667d01c1c
27 changed files with 1958 additions and 1094 deletions

View File

@@ -1,56 +1,80 @@
private ["_hasbottleitem","_hastinitem","_bottletext","_tin1text","_tin2text","_tintext","_qty","_dis","_sfx","_removed"];
private ["_bottletext","_tin1text","_tin2text","_tintext","_hasbottleitem","_hastinitem","_qty","_dis","_sfx"];
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_22") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;
player removeAction s_player_boil;
s_player_boil = 1;
_bottletext = getText (configFile >> "CfgMagazines" >> "ItemWaterBottle" >> "displayName");
_tin1text = getText (configFile >> "CfgMagazines" >> "TrashTinCan" >> "displayName");
_tin2text = getText (configFile >> "CfgMagazines" >> "ItemSodaEmpty" >> "displayName");
_tintext = format["%1 / %2",_tin1text,_tin2text];
_bottleInfected = false;
_hasbottleitem = "ItemWaterbottle" in magazines player;
_hasbottleitem = (("ItemWaterBottle" in magazines player) || ("ItemWaterBottleInfected" in magazines player) || ("ItemWaterBottleSafe" in magazines player));
_hastinitem = false;
a_player_boil = true;
player removeAction s_player_boil;
//s_player_boil = -1;
if ("ItemWaterBottleInfected" in magazines player) then {
_bottleInfected = true;
};
{
if (_x in magazines player) then {
_hastinitem = true;
};
} count boil_tin_cans;
} forEach boil_tin_cans;
_bottletext = getText (configFile >> "CfgMagazines" >> "ItemWaterbottle" >> "displayName");
_tin1text = getText (configFile >> "CfgMagazines" >> "TrashTinCan" >> "displayName");
_tin2text = getText (configFile >> "CfgMagazines" >> "ItemSodaEmpty" >> "displayName");
_tintext = format["%1 / %2",_tin1text,_tin2text];
if (!_hasbottleitem) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_player_31"),_bottletext,"fill"] , "PLAIN DOWN"]};
if (!_hastinitem) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_player_31"),_tintext,"fill"] , "PLAIN DOWN"]};
_removed = 0;
if (!_hasbottleitem) exitWith {cutText [DZE_ActionInProgress = false; format [localize "str_player_31",_bottletext,localize "str_player_31_fill"] , "PLAIN DOWN"]; a_player_boil = false;};
if (!_hastinitem) exitWith {DZE_ActionInProgress = false; cutText [format [localize "str_player_31",_tintext,localize "str_player_31_fill"] , "PLAIN DOWN"]; a_player_boil = false;};
if (_hasbottleitem && _hastinitem) then {
_qty = {_x == "ItemWaterbottle"} count magazines player;
if ("ItemWaterbottle" in magazines player) then {
_removed = _removed + ([player,"ItemWaterbottle",_qty] call BIS_fnc_invRemove);
[1,1] call dayz_HungerThirst;
player playActionNow "Medic";
uiSleep 1;
_dis=10;
_sfx = "cook";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
uiSleep 5;
// Add back only number of removed
for "_x" from 1 to _removed do {
player addMagazine "ItemWaterbottleBoiled";
if (_hasbottleitem and _hastinitem) then {
_qty = 0;
_qty = _qty + ({_x == "ItemWaterBottleInfected"} count magazines player);
_qty = _qty + ({_x == "ItemWaterBottle"} count magazines player);
_qty = _qty + ({_x == "ItemWaterBottleSafe"} count magazines player);
player playActionNow "Medic";
sleep 1;
_dis=10;
_sfx = "cook";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
uiSleep 5;
for "_x" from 1 to _qty do {
if ("ItemWaterBottleInfected" in magazines player) then {
player removeMagazine "ItemWaterBottleInfected";
} else {
if ("ItemWaterBottleSafe" in magazines player) then {
player removeMagazine "ItemWaterBottleSafe";
} else {
player removeMagazine "ItemWaterBottle";
};
};
cutText [format[(localize "str_player_01"),_qty], "PLAIN DOWN"];
} else {
cutText [(localize "str_player_02") , "PLAIN DOWN"];
//if ([0.1] call fn_chance) then {
//player addMagazine "ItemWaterBottleDmg";
//systemChat (localize ("str_waterbottle_broke"));
//_msg = localize "str_waterbottle_broke";
//_msg call dayz_rollingMessages;
//} else {
player addMagazine "ItemWaterBottleBoiled";
//};
};
//cutText [format [localize "str_player_boiledwater",_qty], "PLAIN DOWN"];
_msg = format [localize "str_player_boiledwater",_qty];
_msg call dayz_rollingMessages;
} else {
//cutText [localize "str_player_02", "PLAIN DOWN"];
_msg = format [localize "str_player_boiledwater",_qty];
_msg = localize "str_player_02";
_msg call dayz_rollingMessages;
};
s_player_boil = -1;
a_player_boil = false;
DZE_ActionInProgress = false;