Swap bloodbags in traders and loot for classic system

This commit is contained in:
ebaydayz
2016-04-15 16:11:17 -04:00
parent 0b290d8fec
commit 110befba7f
37 changed files with 86 additions and 104 deletions

View File

@@ -90,7 +90,7 @@ r_interrupt = false;
};
if (_complete) then {
if (!DZE_UseBloodTypes) then {
if (dayz_classicBloodBagSystem) then {
player addMagazine "ItemBloodbag";
} else {
switch (_bloodType) do {

View File

@@ -8,10 +8,9 @@ _blood = _unit getVariable ["USEC_BloodQty", 0];
_lowBlood = _unit getVariable ["USEC_lowBlood", false];
_injured = _unit getVariable ["USEC_injured", false];
_inPain = _unit getVariable ["USEC_inPain", false];
//_lastused = _unit getVariable ["LastTransfusion", time];
_lastused = selfTransfusionTime;
_timeout = DZE_selfTransfuse_Values select 2;
if ((round(time - _lastused)) <= _timeout) exitWith {cutText [format[(localize "str_actions_medical_18"),(_timeout - (round(time - _lastused)))] , "PLAIN DOWN"]};
_lastused = _unit getVariable ["LastTransfusion", -(DZE_selfTransfuse_Values select 2)];
if (round(time - _lastused) <= DZE_selfTransfuse_Values select 2) exitWith {cutText [localize "str_actions_medical_18","PLAIN DOWN"]};
call gear_ui_init;
closeDialog 0;
@@ -41,9 +40,8 @@ if (_rh) then {_rhVal = "POS";} else {_rhVal = "NEG";};
//No subs for whole blood :(
_bloodBagWholeNeeded = "wholeBloodBag" + _bloodType + _rhVal;
_haswholebag = _bloodBagWholeNeeded in magazines player;
_hasUniversal = "ItemBloodbag" in magazines player;
if (_haswholebag or (!DZE_UseBloodTypes && _hasUniversal)) then {
if (_haswholebag or (dayz_classicBloodBagSystem && "ItemBloodbag" in magazines player)) then {
_wholeBag = true;
} else {
_badBag = true;
@@ -84,7 +82,7 @@ while {r_doLoop and (_i < 12)} do {
};
};
} else {
if (_wholeBag) then { _bagToRemove = if (!DZE_UseBloodTypes) then {"ItemBloodbag"} else {_bloodBagWholeNeeded}; };
if (_wholeBag) then { _bagToRemove = if (dayz_classicBloodBagSystem) then {"ItemBloodbag"} else {_bloodBagWholeNeeded}; };
if (_bagToRemove in magazines player) then { _bagFound = true; };
};
if (!_bagFound) then {_forceClose = true;} else { player removeMagazine _bagToRemove;};
@@ -131,7 +129,7 @@ while {r_doLoop and (_i < 12)} do {
if (((_blood >= r_player_bloodTotal) and !_badBag and _bagFound) or (_i == 12)) then {
diag_log format ["TRANSFUSION: completed blood transfusion successfully (_i = %1)", _i];
selfTransfusionTime = time;
_unit setVariable ["LastTransfusion",time];
if (_TransfusionInfection) then {r_player_infected = true; player setVariable["USEC_infected",true,true];};
cutText [localize "str_actions_medical_transfusion_successful", "PLAIN DOWN"];
[player,_unit,"loc",rTITLETEXT,localize "str_actions_medical_transfusion_successful","PLAIN DOWN"] call RE;

View File

@@ -4,7 +4,7 @@ _unit = (_this select 3) select 0;
//_lowBlood = _unit getVariable ["USEC_lowBlood", false];
//_injured = _unit getVariable ["USEC_injured", false];
//_inPain = _unit getVariable ["USEC_inPain", false];
//_lastused = _unit getVariable ["LastTransfusion", time];
//_lastused = _unit getVariable ["LastTransfusion", -(DZE_selfTransfuse_Values select 2)];
// if (_lastused - time < 60) exitwith {cutText [format[(localize "str_actions_medical_18"),_text] , "PLAIN DOWN"]};
@@ -39,7 +39,7 @@ while {r_doLoop} do {
r_doLoop = false;
if (_finished) then {
//_unit setVariable["LastTransfusion",time,true]; //reserve for self transfusion
//_unit setVariable["LastTransfusion",time]; //reserve for self transfusion
_unit setVariable["USEC_lowBlood",false,true];
_num_removed = ([player,"ItemBloodbag"] call BIS_fnc_invRemove);
if(_num_removed == 1) then {