mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Update medical functions
This updates the medical functions for the new player_humanityChange call and updates the code where it was needed.
This commit is contained in:
@@ -42,7 +42,7 @@ if !(isNil "_medsUsed") then {
|
||||
publicVariableServer "PVDZ_send";
|
||||
|
||||
//Give humnaity for good deeds
|
||||
[20,0] call player_humanityChange;
|
||||
20 call player_humanityChange;
|
||||
|
||||
_msg = format[localize "str_actions_medical_gave_antibiotics", (name _unit)];
|
||||
};
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
private ["_msg","_finished","_unit","_item"];
|
||||
|
||||
_unit = (_this select 3) select 0;
|
||||
_item = (_this select 3) select 1;
|
||||
|
||||
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
player removeMagazine _item;
|
||||
closedialog 0;
|
||||
|
||||
@@ -26,7 +26,7 @@ if (_finished) then {
|
||||
//Self Healing
|
||||
//Self Healing
|
||||
[player, player, if (_item == "ItemSepsisBandage") then {true} else {false}] call player_medBandage;
|
||||
_msg = if (_item == "ItemSepsisBandage") then {"str_actions_medical_sepsisbandage_self"} else {"str_actions_medical_bandage_self"};
|
||||
_msg = ["str_actions_medical_bandage_self","str_actions_medical_sepsisbandage_self"] select (_item == "ItemSepsisBandage");
|
||||
localize _msg call dayz_rollingMessages;
|
||||
} else {
|
||||
// Heal another player
|
||||
@@ -34,9 +34,9 @@ if (_finished) then {
|
||||
publicVariableServer "PVDZ_send";
|
||||
|
||||
//Give humanity
|
||||
[20,0] call player_humanityChange;
|
||||
20 call player_humanityChange;
|
||||
|
||||
_msg = if (_item == "ItemSepsisBandage") then {"str_actions_medical_gave_sepsisbandage"} else {"str_actions_medical_gave_bandage"};
|
||||
_msg = ["str_actions_medical_gave_bandage","str_actions_medical_gave_sepsisbandage"] select (_item == "ItemSepsisBandage");
|
||||
format[localize _msg,(name _unit)] call dayz_rollingMessages;
|
||||
};
|
||||
} else {
|
||||
|
||||
@@ -17,23 +17,22 @@ _randRh = random 100;
|
||||
_randType = random 100;
|
||||
_bt_val = nil;
|
||||
_rh_val = nil;
|
||||
switch true do {
|
||||
case (_randType >= 61) : {
|
||||
|
||||
call {
|
||||
if (_randType >= 61) exitwith {
|
||||
_bt_val = "O";
|
||||
_rh_val = if (_randRh >= 89) then { false } else { true };
|
||||
_rh_val = [true,false] select (_randRh >= 89);
|
||||
};
|
||||
case (_randType >= 29) : {
|
||||
if (_randType >= 29) exitwith {
|
||||
_bt_val = "A";
|
||||
_rh_val = if (_randRh >= 89) then { false } else { true };
|
||||
_rh_val = [true,false] select (_randRh >= 89);
|
||||
};
|
||||
case (_randType >= 6) : {
|
||||
if (_randType >= 6) exitwith {
|
||||
_bt_val = "B";
|
||||
_rh_val = if (_randRh >= 94) then { false } else { true };
|
||||
};
|
||||
default {
|
||||
_bt_val = "AB";
|
||||
_rh_val = if (_randRh >= 91) then { false } else { true };
|
||||
_rh_val = [true,false] select (_randRh >= 94);
|
||||
};
|
||||
_bt_val = "AB";
|
||||
_rh_val = [true,false] select (_randRh >= 91);
|
||||
};
|
||||
//diag_log ["_playerObj BLOOD CALC: Blood Type,Rh Type=", _bt_val, _rh_val];
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Used to check and display blood type + Rh
|
||||
By icomrade for DayZ Mod
|
||||
********************************************************* */
|
||||
private ["_unit","_abc","_opened","_water_displayed","_A_Watered","_B_Watered","_allDisplayed","_water_closed","_D_Watered","_control_Watered","_needleOpened","_needleRed","_needleRest","_antiABlooded","_allClicked","_antiBBlooded","_antiDBlooded","_control_displayed","_antiA_displayed","_antiB_displayed","_antiD_displayed","_results_shown","_isDone","_watered","_watered_complete","_isClose","_unit","_hasTester","_dialog","_display","_resultsCard_hidden","_antiA","_AntiB","_AntiD","_Control","_waterBottle","_needle","_name","_resultsCard_front","_antiAUntested","_antiBUntested","_antiDUntested","_controlUntested","_waterBottleImage","_waterBottleClickedImage","_needleClosedImage","_needleOpenImage","_watered_image","_needleRedImage","_bloodTypeCard","_bloodTypeCardHidden","_controlImage","_RBWhole1","_RBWhole2","_RBWhole3","_RBWhole4","_RBWhole5","_Aglut1","_Aglut2","_Aglut3","_Aglut4","_Aglut5","_wholeArray","_aglutArray","_rnd1","_rnd2","_rnd3","_type","_rh"];
|
||||
private ["_unit","_abc","_opened","_water_displayed","_A_Watered","_B_Watered","_allDisplayed","_water_closed","_D_Watered","_control_Watered","_needleOpened","_needleRed","_antiABlooded","_allClicked","_antiBBlooded","_antiDBlooded","_control_displayed","_antiA_displayed","_antiB_displayed","_antiD_displayed","_results_shown","_isDone","_watered","_watered_complete","_isClose","_unit","_hasTester","_display","_resultsCard_hidden","_antiA","_AntiB","_AntiD","_Control","_waterBottle","_needle","_name","_resultsCard_front","_antiAUntested","_antiBUntested","_antiDUntested","_controlUntested","_waterBottleImage","_waterBottleClickedImage","_needleClosedImage","_needleOpenImage","_watered_image","_needleRedImage","_bloodTypeCard","_bloodTypeCardHidden","_controlImage","_RBWhole1","_RBWhole2","_RBWhole3","_RBWhole4","_RBWhole5","_Aglut1","_Aglut2","_Aglut3","_Aglut4","_Aglut5","_wholeArray","_aglutArray","_rnd1","_rnd2","_rnd3","_type","_rh"];
|
||||
disableSerialization;
|
||||
|
||||
//remove option
|
||||
@@ -33,11 +33,10 @@ _needleRed = false;
|
||||
_antiABlooded = false;
|
||||
_antiBBlooded = false;
|
||||
_antiDBlooded = false;
|
||||
_needleRest = false;
|
||||
_allClicked = 0;
|
||||
if (!_hasTester) exitWith {};
|
||||
|
||||
_dialog = createDialog "bloodTest";
|
||||
createDialog "bloodTest";
|
||||
|
||||
uiSleep 0.02;
|
||||
|
||||
@@ -102,7 +101,7 @@ _rnd3 = ceil(random 4);
|
||||
_type = _unit getVariable ["blood_type", false];
|
||||
_rh = _unit getVariable ["rh_factor", false];
|
||||
|
||||
while {!_isDone and r_doLoop} do {
|
||||
while {!_isDone && r_doLoop} do {
|
||||
_watered = r_A_watered or r_B_watered or r_D_watered or r_control_watered;
|
||||
|
||||
//display untested images
|
||||
@@ -121,30 +120,30 @@ _watered = r_A_watered or r_B_watered or r_D_watered or r_control_watered;
|
||||
};
|
||||
|
||||
//display clicked water bottle image
|
||||
if (r_water_clicked and !_water_displayed) then {
|
||||
if (r_water_clicked && {!_water_displayed}) then {
|
||||
_waterBottle ctrlSetText _waterBottleClickedImage;
|
||||
_water_displayed = true;
|
||||
player removeMagazine "bloodTester";
|
||||
};
|
||||
|
||||
//display water marks
|
||||
if (r_water_clicked and _watered and (_watered_complete <= 4)) then {
|
||||
if (r_A_watered and !_A_Watered) then {
|
||||
if (r_water_clicked && {_watered} && {_watered_complete <= 4}) then {
|
||||
if (r_A_watered && {!_A_Watered}) then {
|
||||
_antiA ctrlSetText _watered_image;
|
||||
_A_Watered = true;
|
||||
_watered_complete = _watered_complete + 1;
|
||||
};
|
||||
if (r_B_watered and !_B_Watered) then {
|
||||
if (r_B_watered && {!_B_Watered}) then {
|
||||
_antiB ctrlSetText _watered_image;
|
||||
_B_Watered = true;
|
||||
_watered_complete = _watered_complete + 1;
|
||||
};
|
||||
if (r_D_watered and !_D_Watered) then {
|
||||
if (r_D_watered && {!_D_Watered}) then {
|
||||
_antiD ctrlSetText _watered_image;
|
||||
_D_Watered = true;
|
||||
_watered_complete = _watered_complete + 1;
|
||||
};
|
||||
if (r_control_watered and !_control_Watered) then {
|
||||
if (r_control_watered && {!_control_Watered}) then {
|
||||
_Control ctrlSetText _watered_image;
|
||||
_control_Watered = true;
|
||||
_watered_complete = _watered_complete + 1;
|
||||
@@ -152,49 +151,49 @@ _watered = r_A_watered or r_B_watered or r_D_watered or r_control_watered;
|
||||
};
|
||||
|
||||
//open needle
|
||||
if ((r_needleclicked == 1) and !_needleOpened) then {
|
||||
if ((r_needleclicked == 1) && {!_needleOpened}) then {
|
||||
_needle ctrlSetText _needleOpenImage;
|
||||
_needleOpened = true;
|
||||
};
|
||||
|
||||
|
||||
//close water
|
||||
if ((_watered_complete >= 4) and !_water_closed) then {
|
||||
if ((_watered_complete >= 4) && {!_water_closed}) then {
|
||||
_water_closed = true;
|
||||
_waterBottle ctrlSetText _waterBottleImage;
|
||||
};
|
||||
//needle clicked
|
||||
if ((r_needleclicked >= 2) and !_needleRed and _needleOpened and (_watered_complete >= 4) and !r_needleReset) then {
|
||||
if ((r_needleclicked >= 2) && {!_needleRed && {_needleOpened} && {_watered_complete >= 4} && {!r_needleReset}}) then {
|
||||
_needle ctrlSetText _needleRedImage;
|
||||
_needleRed = true;
|
||||
};
|
||||
|
||||
//reset needle
|
||||
if (_needleRed and r_needleReset) then {
|
||||
if (_needleRed && {r_needleReset}) then {
|
||||
_needle ctrlSetText _needleOpenImage;
|
||||
_needleRed = false;
|
||||
};
|
||||
|
||||
//fill with blood
|
||||
if (r_antiA_done and !_antiABlooded and _needleRed) then {
|
||||
if (r_antiA_done && {!_antiABlooded} && {_needleRed}) then {
|
||||
r_needleReset = true;
|
||||
_antiA ctrlSetText _controlImage;
|
||||
_antiABlooded = true;
|
||||
_allClicked = _allClicked + 1;
|
||||
};
|
||||
if (r_antiB_done and !_antiBBlooded and _needleRed) then {
|
||||
if (r_antiB_done && {!_antiBBlooded} && {_needleRed}) then {
|
||||
r_needleReset = true;
|
||||
_antiB ctrlSetText _controlImage;
|
||||
_antiBBlooded = true;
|
||||
_allClicked = _allClicked + 1;
|
||||
};
|
||||
if (r_antiD_done and !_antiDBlooded and _needleRed) then {
|
||||
if (r_antiD_done && {!_antiDBlooded} && {_needleRed}) then {
|
||||
r_needleReset = true;
|
||||
_antiD ctrlSetText _controlImage;
|
||||
_antiDBlooded = true;
|
||||
_allClicked = _allClicked + 1;
|
||||
};
|
||||
if (r_control_done and !_control_displayed and _needleRed) then {
|
||||
if (r_control_done && {!_control_displayed} && {_needleRed}) then {
|
||||
r_needleReset = true;
|
||||
_Control ctrlSetText _controlImage;
|
||||
_control_displayed = true;
|
||||
@@ -207,106 +206,106 @@ _watered = r_A_watered or r_B_watered or r_D_watered or r_control_watered;
|
||||
};
|
||||
//The magic happens
|
||||
if (_allClicked == 4) then {
|
||||
switch (_type) do {
|
||||
case "A" : {
|
||||
if (!_allDisplayed) then {
|
||||
uiSleep 2;
|
||||
if (r_antiA_done and !_antiA_displayed) then {
|
||||
_antiA ctrlSetText (_aglutArray select _rnd1);
|
||||
_antiA_displayed = true;
|
||||
};
|
||||
if (r_antiB_done and !_antiB_displayed) then {
|
||||
_AntiB ctrlSetText (_wholeArray select _rnd2);
|
||||
_antiB_displayed = true;
|
||||
};
|
||||
if (r_antiD_done and !_antiD_displayed) then {
|
||||
if (_rh) then {
|
||||
_AntiD ctrlSetText (_aglutArray select _rnd3);
|
||||
} else {
|
||||
_AntiD ctrlSetText (_wholeArray select _rnd3);
|
||||
call {
|
||||
if (_type == "A") exitwith {
|
||||
if (!_allDisplayed) then {
|
||||
uiSleep 2;
|
||||
if (r_antiA_done && {!_antiA_displayed}) then {
|
||||
_antiA ctrlSetText (_aglutArray select _rnd1);
|
||||
_antiA_displayed = true;
|
||||
};
|
||||
_antiD_displayed = true;
|
||||
};
|
||||
_allDisplayed = true;
|
||||
};
|
||||
};
|
||||
case "B" : {
|
||||
if (!_allDisplayed) then {
|
||||
uiSleep 2;
|
||||
if (r_antiA_done and !_antiA_displayed) then {
|
||||
_antiA ctrlSetText (_wholeArray select _rnd1);
|
||||
_antiA_displayed = true;
|
||||
};
|
||||
if (r_antiB_done and !_antiB_displayed) then {
|
||||
_AntiB ctrlSetText (_aglutArray select _rnd2);
|
||||
_antiB_displayed = true;
|
||||
};
|
||||
if (r_antiD_done and !_antiD_displayed) then {
|
||||
if (_rh) then {
|
||||
_AntiD ctrlSetText (_aglutArray select _rnd3);
|
||||
} else {
|
||||
_AntiD ctrlSetText (_wholeArray select _rnd3);
|
||||
if (r_antiB_done && {!_antiB_displayed}) then {
|
||||
_AntiB ctrlSetText (_wholeArray select _rnd2);
|
||||
_antiB_displayed = true;
|
||||
};
|
||||
_antiD_displayed = true;
|
||||
};
|
||||
_allDisplayed = true;
|
||||
};
|
||||
};
|
||||
case "AB" : {
|
||||
if (!_allDisplayed) then {
|
||||
uiSleep 2;
|
||||
if (r_antiA_done and !_antiA_displayed) then {
|
||||
_antiA ctrlSetText (_aglutArray select _rnd1);
|
||||
_antiA_displayed = true;
|
||||
};
|
||||
if (r_antiB_done and !_antiB_displayed) then {
|
||||
_AntiB ctrlSetText (_aglutArray select _rnd2);
|
||||
_antiB_displayed = true;
|
||||
};
|
||||
if (r_antiD_done and !_antiD_displayed) then {
|
||||
if (_rh) then {
|
||||
_AntiD ctrlSetText (_aglutArray select _rnd3);
|
||||
} else {
|
||||
_AntiD ctrlSetText (_wholeArray select _rnd3);
|
||||
if (r_antiD_done && {!_antiD_displayed}) then {
|
||||
if (_rh) then {
|
||||
_AntiD ctrlSetText (_aglutArray select _rnd3);
|
||||
} else {
|
||||
_AntiD ctrlSetText (_wholeArray select _rnd3);
|
||||
};
|
||||
_antiD_displayed = true;
|
||||
};
|
||||
_antiD_displayed = true;
|
||||
_allDisplayed = true;
|
||||
};
|
||||
_allDisplayed = true;
|
||||
};
|
||||
};
|
||||
case "O" : {
|
||||
if (!_allDisplayed) then {
|
||||
uiSleep 2;
|
||||
if (r_antiA_done and !_antiA_displayed) then {
|
||||
_antiA ctrlSetText (_wholeArray select _rnd1);
|
||||
_antiA_displayed = true;
|
||||
};
|
||||
if (r_antiB_done and !_antiB_displayed) then {
|
||||
_AntiB ctrlSetText (_wholeArray select _rnd2);
|
||||
_antiB_displayed = true;
|
||||
};
|
||||
if (r_antiD_done and !_antiD_displayed) then {
|
||||
if (_rh) then {
|
||||
_AntiD ctrlSetText (_aglutArray select _rnd3);
|
||||
} else {
|
||||
_AntiD ctrlSetText (_wholeArray select _rnd3);
|
||||
if (_type == "B") exitwith {
|
||||
if (!_allDisplayed) then {
|
||||
uiSleep 2;
|
||||
if (r_antiA_done && {!_antiA_displayed}) then {
|
||||
_antiA ctrlSetText (_wholeArray select _rnd1);
|
||||
_antiA_displayed = true;
|
||||
};
|
||||
_antiD_displayed = true;
|
||||
if (r_antiB_done && {!_antiB_displayed}) then {
|
||||
_AntiB ctrlSetText (_aglutArray select _rnd2);
|
||||
_antiB_displayed = true;
|
||||
};
|
||||
if (r_antiD_done && {!_antiD_displayed}) then {
|
||||
if (_rh) then {
|
||||
_AntiD ctrlSetText (_aglutArray select _rnd3);
|
||||
} else {
|
||||
_AntiD ctrlSetText (_wholeArray select _rnd3);
|
||||
};
|
||||
_antiD_displayed = true;
|
||||
};
|
||||
_allDisplayed = true;
|
||||
};
|
||||
_allDisplayed = true;
|
||||
};
|
||||
if (_type == "AB") exitwith {
|
||||
if (!_allDisplayed) then {
|
||||
uiSleep 2;
|
||||
if (r_antiA_done && {!_antiA_displayed}) then {
|
||||
_antiA ctrlSetText (_aglutArray select _rnd1);
|
||||
_antiA_displayed = true;
|
||||
};
|
||||
if (r_antiB_done && {!_antiB_displayed}) then {
|
||||
_AntiB ctrlSetText (_aglutArray select _rnd2);
|
||||
_antiB_displayed = true;
|
||||
};
|
||||
if (r_antiD_done && {!_antiD_displayed}) then {
|
||||
if (_rh) then {
|
||||
_AntiD ctrlSetText (_aglutArray select _rnd3);
|
||||
} else {
|
||||
_AntiD ctrlSetText (_wholeArray select _rnd3);
|
||||
};
|
||||
_antiD_displayed = true;
|
||||
};
|
||||
_allDisplayed = true;
|
||||
};
|
||||
};
|
||||
if (_type == "O") exitwith {
|
||||
if (!_allDisplayed) then {
|
||||
uiSleep 2;
|
||||
if (r_antiA_done && {!_antiA_displayed}) then {
|
||||
_antiA ctrlSetText (_wholeArray select _rnd1);
|
||||
_antiA_displayed = true;
|
||||
};
|
||||
if (r_antiB_done && {!_antiB_displayed}) then {
|
||||
_AntiB ctrlSetText (_wholeArray select _rnd2);
|
||||
_antiB_displayed = true;
|
||||
};
|
||||
if (r_antiD_done && {!_antiD_displayed}) then {
|
||||
if (_rh) then {
|
||||
_AntiD ctrlSetText (_aglutArray select _rnd3);
|
||||
} else {
|
||||
_AntiD ctrlSetText (_wholeArray select _rnd3);
|
||||
};
|
||||
_antiD_displayed = true;
|
||||
};
|
||||
_allDisplayed = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
r_canClick_resultsCard = true;
|
||||
if (r_resultsCard_Clicked and _antiD_displayed and _antiB_displayed and _antiA_displayed and _control_displayed and !_results_shown) then {
|
||||
if (r_resultsCard_Clicked && {_antiD_displayed && {_antiB_displayed} && {_antiA_displayed} && {_control_displayed} && {!_results_shown}}) then {
|
||||
_resultsCard_hidden ctrlShow false;
|
||||
_resultsCard_front ctrlShow true;
|
||||
_resultsCard_front ctrlSetText _bloodTypeCard;
|
||||
_results_shown = true;
|
||||
};
|
||||
};
|
||||
if (_antiD_displayed and _antiB_displayed and _antiA_displayed and _control_displayed and _results_shown) then {
|
||||
if (_antiD_displayed && {_antiB_displayed && {_antiA_displayed} && {_control_displayed} && {_results_shown}}) then {
|
||||
r_doLoop = false;
|
||||
_isDone = true;
|
||||
[] spawn {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
private ["_msg","_finished","_id","_unit","_item","_humanityGain"];
|
||||
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
private ["_msg","_finished","_unit","_item","_humanityGain"];
|
||||
|
||||
_unit = (_this select 3) select 0;
|
||||
_item = (_this select 3) select 1;
|
||||
|
||||
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
player removeMagazine _item;
|
||||
|
||||
call fnc_usec_medic_removeActions;
|
||||
@@ -18,7 +18,7 @@ if (vehicle player == player) then {
|
||||
_finished = true;
|
||||
};
|
||||
|
||||
_msg = if (_item == "equip_woodensplint") then {"STR_ITEM_NAME_WOODENSPLINT"} else {"STR_EQUIP_NAME_15"};
|
||||
_msg = ["STR_EQUIP_NAME_15","STR_ITEM_NAME_WOODENSPLINT"] select (_item == "equip_woodensplint");
|
||||
|
||||
if (_finished) then {
|
||||
if (_unit == player) then {
|
||||
@@ -28,8 +28,8 @@ if (_finished) then {
|
||||
format [localize "str_actions_medical_general_self", (localize _msg)] call dayz_rollingMessages;
|
||||
} else {
|
||||
//Give humanity reward to player giving the morphine to another player.
|
||||
_humanityGain = if (_item == "ItemMorphine") then {50} else {25};
|
||||
[_humanityGain,0] call player_humanityChange;
|
||||
_humanityGain = [25,50] select (_item == "ItemMorphine");
|
||||
_humanityGain call player_humanityChange;
|
||||
|
||||
PVDZ_send = [_unit,"Morphine",[_unit,player,_item]];
|
||||
publicVariableServer "PVDZ_send";
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
private ["_finished","_isDead","_unit"];
|
||||
|
||||
_unit = (_this select 3) select 0;
|
||||
call fnc_usec_medic_removeActions;
|
||||
|
||||
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
player removeMagazine "ItemEpinephrine";
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
|
||||
@@ -13,7 +13,7 @@ _isDead = _unit getVariable["USEC_isDead",false];
|
||||
|
||||
if (!_isDead && {_finished}) then {
|
||||
//give humanity
|
||||
[25,0] call player_humanityChange;
|
||||
25 call player_humanityChange;
|
||||
|
||||
PVDZ_send = [_unit,"Epinephrine",[_unit,player]];
|
||||
publicVariableServer "PVDZ_send";
|
||||
|
||||
@@ -39,11 +39,11 @@ if (vehicle player == player) then {
|
||||
player playActionNow "Medic";
|
||||
};
|
||||
|
||||
while {r_doLoop and (_i < 25)} do {
|
||||
while {r_doLoop && (_i < 25)} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
|
||||
if (_isMedic and !_started) then {
|
||||
if (_isMedic && {!_started}) then {
|
||||
player removeMagazine "emptyBloodBag";
|
||||
localize "str_actions_medical_transfusion_start" call dayz_rollingMessages;
|
||||
//[player,_victim,"loc",rTITLETEXT,localize "str_actions_medical_transfusion_start","PLAIN DOWN"] call RE;
|
||||
@@ -93,8 +93,8 @@ if (_complete) then {
|
||||
if (dayz_classicBloodBagSystem) then {
|
||||
player addMagazine "ItemBloodbag";
|
||||
} else {
|
||||
switch (_bloodType) do {
|
||||
case "A" : {
|
||||
call {
|
||||
if (_bloodType == "A") exitwith {
|
||||
if (_rh) then {
|
||||
player addMagazine "wholeBloodBagAPOS";
|
||||
} else {
|
||||
@@ -102,7 +102,7 @@ if (_complete) then {
|
||||
};
|
||||
};
|
||||
|
||||
case "B" : {
|
||||
if (_bloodType == "B") exitwith {
|
||||
if (_rh) then {
|
||||
player addMagazine "wholeBloodBagBPOS";
|
||||
} else {
|
||||
@@ -110,7 +110,7 @@ if (_complete) then {
|
||||
};
|
||||
};
|
||||
|
||||
case "AB" : {
|
||||
if (_bloodType == "AB") exitwith {
|
||||
if (_rh) then {
|
||||
player addMagazine "wholeBloodBagABPOS";
|
||||
} else {
|
||||
@@ -118,7 +118,7 @@ if (_complete) then {
|
||||
};
|
||||
};
|
||||
|
||||
case "O" : {
|
||||
if (_bloodType == "O") exitwith {
|
||||
if (_rh) then {
|
||||
player addMagazine "wholeBloodBagOPOS";
|
||||
} else {
|
||||
|
||||
@@ -21,7 +21,7 @@ if (_unit == player) then {
|
||||
publicVariableServer "PVDZ_send";
|
||||
|
||||
// Give humanity
|
||||
[20,0] call player_humanityChange;
|
||||
20 call player_humanityChange;
|
||||
|
||||
format [localize "str_actions_medical_painkillers_give",(name _unit)] call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
private ["_msg","_unit","_bagUsed","_duration","_rhVal","_badBag","_bloodType","_bloodBagWholeNeeded","_wholeBag","_transfusionInfection","_finished","_bloodAmount"];
|
||||
|
||||
// Check to see if enough time has passed since the last self-transfusion.
|
||||
if (time - dayz_lastSelfTransfusion <= DZE_selfTransfuse_Values select 2) exitWith {localize "str_actions_medical_18" call dayz_rollingMessages;};
|
||||
|
||||
private ["_msg","_unit","_bagUsed","_duration","_rhVal","_badBag","_bloodType","_bloodBagWholeNeeded","_wholeBag","_transfusionInfection","_finished","_bloodAmount"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_bagUsed = _this select 1;
|
||||
|
||||
@@ -26,7 +26,7 @@ if (!dayz_classicBloodBagSystem) then {
|
||||
if (!_wholeBag) then {_badBag = true;};
|
||||
};
|
||||
|
||||
_bloodAmount = if (!_wholeBag) then {(DZE_selfTransfuse_Values select 0)} else {4000};
|
||||
_bloodAmount = [4000,(DZE_selfTransfuse_Values select 0)] select (!_wholeBag);
|
||||
|
||||
localize "str_actions_medical_transfusion_start" call dayz_rollingMessages;
|
||||
_unit removeMagazine _bagUsed;
|
||||
|
||||
@@ -4,7 +4,7 @@ fnc_usec_damageHandle = {
|
||||
- Function
|
||||
- [unit] call fnc_usec_damageHandle;
|
||||
************************************************************/
|
||||
//private["_unit","_eh"];
|
||||
private "_unit";
|
||||
_unit = _this select 0;
|
||||
mydamage_eh1 = _unit addeventhandler ["HandleDamage",{_this call fnc_usec_damageHandler;} ];
|
||||
mydamage_eh2 = _unit addEventHandler ["Fired", {_this call player_fired;}];
|
||||
@@ -12,6 +12,8 @@ fnc_usec_damageHandle = {
|
||||
};
|
||||
|
||||
fnc_usec_pitchWhine = {
|
||||
private ["_visual", "_sound"];
|
||||
|
||||
_visual = _this select 0;
|
||||
_sound = _this select 1;
|
||||
//affect the player
|
||||
@@ -33,7 +35,8 @@ fnc_usec_pitchWhine = {
|
||||
};
|
||||
|
||||
fnc_usec_damageUnconscious = {
|
||||
private["_unit","_damage"];
|
||||
private["_unit","_damage","_inVehicle"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_damage = _this select 1;
|
||||
|
||||
@@ -54,7 +57,8 @@ fnc_usec_damageUnconscious = {
|
||||
private["_veh","_unit"];
|
||||
_veh = vehicle _this;
|
||||
_unit = _this;
|
||||
waitUntil{(((getPosATL _veh select 2 < 1) and (speed _veh < 1)) or (!r_player_unconscious))};
|
||||
waitUntil {(((getPosATL _veh select 2 < 1) && {speed _veh < 1}) || (!r_player_unconscious))};
|
||||
|
||||
if (r_player_unconscious) then {
|
||||
_unit action ["eject", _veh];
|
||||
waitUntil{((vehicle _this) != _this)};
|
||||
@@ -70,7 +74,8 @@ fnc_usec_damageUnconscious = {
|
||||
//Action Handlers added to init file
|
||||
|
||||
fnc_usec_bulletHit = {
|
||||
//private["_commit"];
|
||||
private "_commit";
|
||||
|
||||
_commit = _this;
|
||||
if (!r_player_unconscious) then {
|
||||
"colorCorrections" ppEffectEnable true; "colorCorrections" ppEffectAdjust [1, 1.1, -0.02, [0.4,-0.2,-0.2, .04], [1,1,1,0], [1,1,1, 0]]; "colorCorrections" ppEffectCommit 0;
|
||||
@@ -83,7 +88,8 @@ fnc_usec_bulletHit = {
|
||||
};
|
||||
|
||||
fnc_usec_damageGetWound = {
|
||||
//private["_wound"];
|
||||
private ["_hit", "_sPoint", "_options", "_rnd", "_wound"];
|
||||
|
||||
_hit = format["%1",_this];
|
||||
_sPoint = USEC_woundHit find _hit;
|
||||
_options = USEC_woundPoint select _sPoint;
|
||||
@@ -93,6 +99,8 @@ fnc_usec_damageGetWound = {
|
||||
};
|
||||
|
||||
fnc_usec_medic_removeActions = {
|
||||
private "_obj";
|
||||
|
||||
_obj = player;
|
||||
{
|
||||
_obj = _x;
|
||||
@@ -105,7 +113,8 @@ fnc_usec_medic_removeActions = {
|
||||
};
|
||||
|
||||
fnc_usec_calculateBloodPerSec = {
|
||||
private["_bloodLossPerSec","_bloodGainPerSec","_bloodPerSec"];
|
||||
private["_bloodLossPerSec","_bloodGainPerSec","_bloodPerSec","_wounded","_time"];
|
||||
|
||||
_bloodLossPerSec = 0;
|
||||
_bloodGainPerSec = 0;
|
||||
|
||||
@@ -145,7 +154,7 @@ fnc_usec_calculateBloodPerSec = {
|
||||
};
|
||||
};
|
||||
|
||||
if ((_time < 1) and (isNil "sepsisStarted")) then {
|
||||
if ((_time < 1) && {isNil "sepsisStarted"}) then {
|
||||
//if (isNil "sepsisStarted") then {
|
||||
localize "str_medical_sepsis_warning" call dayz_rollingMessages;
|
||||
//systemChat (localize "str_medical_sepsis_warning");
|
||||
@@ -202,25 +211,26 @@ _tempVal = round(100*(1 - ((dayz_temperatur - dayz_temperaturmin)/(dayz_temperat
|
||||
r_player_foodstack
|
||||
];
|
||||
*/
|
||||
dayz_lastMedicalSource = switch (true) do {
|
||||
case (dayz_thirst >= SleepWater): {"dehyd"}; //10
|
||||
case (dayz_hunger >= SleepFood): {"starve"}; //10
|
||||
case (r_player_infected): {"sick"}; //3
|
||||
default {"none"}; //reset
|
||||
dayz_lastMedicalSource = call {
|
||||
if (dayz_thirst >= SleepWater) exitwith {"dehyd"}; //10
|
||||
if (dayz_hunger >= SleepFood) exitwith {"starve"}; //10
|
||||
if (r_player_infected) exitwith {"sick"}; //3
|
||||
"none"; //reset
|
||||
};
|
||||
if (_bloodPerSec < 0 && dayz_lastMedicalSource != "none") then {dayz_lastMedicalTime = diag_tickTime;};
|
||||
if (_bloodPerSec < 0 && {dayz_lastMedicalSource != "none"}) then {dayz_lastMedicalTime = diag_tickTime;};
|
||||
|
||||
r_player_bloodpersec = _bloodPerSec;
|
||||
_bloodPerSec
|
||||
};
|
||||
|
||||
fnc_usec_playerHandleBlood = {
|
||||
private["_bloodPerSec","_elapsedTime"];
|
||||
private["_bloodPerSec","_elapsedTime","_bleedTime","_bloodDiff"];
|
||||
|
||||
if (r_player_injured) then { // bleeding
|
||||
_bleedTime = (random 500) + 100;
|
||||
_elapsedTime = 0;
|
||||
|
||||
while {(r_player_injured) and (r_player_blood > 0)} do {
|
||||
while {(r_player_injured) && (r_player_blood > 0)} do {
|
||||
_bloodPerSec = [] call fnc_usec_calculateBloodPerSec;
|
||||
r_player_blood = r_player_blood + _bloodPerSec;
|
||||
_elapsedTime = _elapsedTime + 1;
|
||||
@@ -268,43 +278,38 @@ fnc_usec_damageBleed = {
|
||||
- Function fnc_usec_damageBleed: Draw a creepy blood stream from a player limb
|
||||
- [_unit, _wound] call fnc_usec_damageBleed;
|
||||
************************************************************/
|
||||
private["_wound","_modelPos","_point","_source"];
|
||||
private["_unit","_wound","_modelPos","_point","_source","_rndX"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_wound = _this select 1;
|
||||
_point = objNull;
|
||||
_source = objNull;
|
||||
|
||||
if (isServer) exitWith{}; // no graphical effects on server!
|
||||
/*
|
||||
if ((dayz_bleedingeffect == 1) or (dayz_bleedingeffect == 3)) then {
|
||||
[] spawn fnc_blooddrops;
|
||||
};*/
|
||||
//diag_log format ["%1::fnc_usec_damageBleed %2", __FILE__, _this];
|
||||
|
||||
_modelPos = [0,0,0];
|
||||
|
||||
switch (_wound) do {
|
||||
case "Pelvis": {
|
||||
_modelPos = [0,0,0.2];
|
||||
};
|
||||
case "aimpoint": {
|
||||
_rndX = (0.1 - random 0.2);
|
||||
_modelPos = [_rndX,0,0.2];
|
||||
};
|
||||
case "RightShoulder": {
|
||||
_modelPos = [0,0,0.2];
|
||||
};
|
||||
case "LeftShoulder": {
|
||||
_modelPos = [0,0,0.2];
|
||||
};
|
||||
//added visual wounds to foots
|
||||
case "RightFoot": {
|
||||
_modelPos = [0,0,0.2];
|
||||
};
|
||||
case "LeftFoot": {
|
||||
_modelPos = [0,0,0.2];
|
||||
};
|
||||
_modelPos = call {
|
||||
if (_wound == "Pelvis") exitwith {
|
||||
[0,0,0.2]
|
||||
};
|
||||
if (_wound == "aimpoint") exitwith {
|
||||
_rndX = (0.1 - random 0.2);
|
||||
[_rndX,0,0.2]
|
||||
};
|
||||
if (_wound == "RightShoulder") exitwith {
|
||||
[0,0,0.2]
|
||||
};
|
||||
if (_wound == "LeftShoulder") exitwith {
|
||||
[0,0,0.2]
|
||||
};
|
||||
//added visual wounds to foots
|
||||
if (_wound == "RightFoot") exitwith {
|
||||
[0,0,0.2]
|
||||
};
|
||||
if (_wound == "LeftFoot") exitwith {
|
||||
[0,0,0.2]
|
||||
};
|
||||
[0,0,0];
|
||||
};
|
||||
|
||||
while {1 == 1} do {
|
||||
scopeName "main";
|
||||
@@ -337,7 +342,7 @@ fnc_usec_damageBleed = {
|
||||
|
||||
uiSleep 5;
|
||||
|
||||
while {((_unit getVariable["USEC_injured",true]) and (alive _unit))} do {
|
||||
while {((_unit getVariable["USEC_injured",true]) && {alive _unit})} do {
|
||||
scopeName "loop";
|
||||
if (vehicle _unit != _unit) then {
|
||||
BreakOut "loop";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
private ["_msg","_bagUsed","_bloodResult","_bloodAmount","_unit","_hasTransfusionKit","_timer","_i","_isClose","_duration","_rhVal","_bloodBagArrayNeeded","_bloodBagNeeded","_badBag","_wholeBag","_bagFound","_bloodType","_rh","_bloodBagWholeNeeded","_wholeBagFound","_bloodTestdone"];// bleed.sqf
|
||||
private ["_msg","_bagUsed","_bloodResult","_bloodAmount","_unit","_humanityAwarded","_timer","_i","_isClose","_duration","_rhVal","_bloodBagArrayNeeded","_badBag","_wholeBag","_bagFound","_bloodType","_rh","_bloodBagWholeNeeded","_wholeBagFound","_bloodTestdone"];// bleed.sqf
|
||||
|
||||
_unit = (_this select 3) select 0;
|
||||
_bagUsed = (_this select 3) select 1;
|
||||
@@ -26,7 +26,7 @@ if (!dayz_classicBloodBagSystem) then {
|
||||
//if (!_hasTransfusionKit) exitWith { localize "str_actions_medical_transfusion_failed_transfusionkit" call dayz_rollingMessages; };
|
||||
|
||||
//Unconscious timeout for receiving unit
|
||||
_duration = if ((_unit getVariable ["USEC_BloodQty", 0]) <= 4000) then { 3 } else { 2 };
|
||||
_duration = [2,3] select (_unit getVariable ["USEC_BloodQty", 0]);
|
||||
_bloodBagArrayNeeded = ["bloodBagONEG"];
|
||||
|
||||
if (_bloodTestdone) then { // if the recipient does not know his blood type, only O- can apply
|
||||
@@ -61,8 +61,7 @@ _timer = diag_tickTime;
|
||||
_i = 0;
|
||||
_humanityAwarded = 0;
|
||||
_msg = "";
|
||||
|
||||
_bloodAmount = if (!_wholeBag) then { r_player_bloodTotal/*Full bloodbag*/ } else { 4000 /*Whole blood only gives 4k*/ };
|
||||
_bloodAmount = [4000 /*Whole blood only gives 4k*/,r_player_bloodTotal/*Full bloodbag*/] select (!_wholeBag);
|
||||
|
||||
//diag_log format ["TRANSFUSION: starting blood transfusion (%1 > %2)", name player, name _unit];
|
||||
|
||||
@@ -118,7 +117,7 @@ while {r_doLoop} do {
|
||||
dayz_bloodBagHumanity = dayz_bloodBagHumanity / 2; //Diminish humanity reward for subsequent transfusions. Resets to full reward after two minutes.
|
||||
dayz_lastTransfusion = time;
|
||||
if (!_badBag) then {
|
||||
[_humanityAwarded,0] call player_humanityChange;
|
||||
_humanityAwarded call player_humanityChange;
|
||||
_msg = "str_actions_medical_transfusion_successful";
|
||||
};
|
||||
r_doLoop = false;
|
||||
@@ -126,7 +125,7 @@ while {r_doLoop} do {
|
||||
|
||||
_isClose = ((player distance _unit) < ((sizeOf typeOf _unit) / 2));
|
||||
|
||||
if (r_interrupt or !_isClose) then {
|
||||
if (r_interrupt || {!_isClose}) then {
|
||||
//diag_log format ["TRANSFUSION: transfusion was interrupted (r_interrupt: %1 | distance: %2 (%3) | _i = %4)", r_interrupt, player distance _unit, _isClose, _i];
|
||||
_msg = "str_actions_medical_transfusion_interrupted";
|
||||
r_doLoop = false;
|
||||
@@ -147,8 +146,3 @@ if (r_interrupt) then {
|
||||
waitUntil {uiSleep .5; (!(["medic",animationState player] call fnc_inString))};
|
||||
|
||||
localize _msg call dayz_rollingMessages;
|
||||
|
||||
/*
|
||||
Note 1 - 1.8 system sending way too much info upto 12 times to the server on top of each call RE also being sent upto 12 times. System removed
|
||||
|
||||
*/
|
||||
|
||||
@@ -33,7 +33,7 @@ if (_finished) then {
|
||||
publicVariableServer "PVDZ_send";
|
||||
|
||||
// Give humanity
|
||||
[20,0] call player_humanityChange;
|
||||
20 call player_humanityChange;
|
||||
|
||||
format[localize "str_actions_medical_gave_wipes",(name _unit)] call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user