mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-04-17 17:56:40 +03:00
Missing Files
This commit is contained in:
43
SQF/dayz_code/medical/bloodCalc.sqf
Normal file
43
SQF/dayz_code/medical/bloodCalc.sqf
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
Created exclusively for ArmA2:OA - DayZMod.
|
||||
permission is required to use/alter/distribute from project leader (R4Z0R49) AND the author (icomrade).
|
||||
|
||||
breakdown of blood type distribution (based on world population)
|
||||
O A B AB
|
||||
39% 32% 23% 6%
|
||||
|
||||
We use realistic RH distribution per blood type as well
|
||||
Ex. CID = 13... _randType = 31... Blood Type = A
|
||||
*/
|
||||
private ["_playerObj","_randRh","_randType","_bt_val","_rh_val"];
|
||||
|
||||
_playerObj = _this;
|
||||
|
||||
_randRh = random 100;
|
||||
_randType = random 100;
|
||||
_bt_val = nil;
|
||||
_rh_val = nil;
|
||||
switch true do {
|
||||
case (_randType >= 61) : {
|
||||
_bt_val = "O";
|
||||
_rh_val = if (_randRh >= 89) then { false } else { true };
|
||||
};
|
||||
case (_randType >= 29) : {
|
||||
_bt_val = "A";
|
||||
_rh_val = if (_randRh >= 89) then { false } else { true };
|
||||
};
|
||||
case (_randType >= 6) : {
|
||||
_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 };
|
||||
};
|
||||
};
|
||||
//diag_log ["_playerObj BLOOD CALC: Blood Type,Rh Type=", _bt_val, _rh_val];
|
||||
|
||||
//RH type
|
||||
_playerObj setVariable ["rh_factor", _rh_val, true];
|
||||
//blood type
|
||||
_playerObj setVariable ["blood_type", _bt_val, true];
|
||||
319
SQF/dayz_code/medical/blood_test.sqf
Normal file
319
SQF/dayz_code/medical/blood_test.sqf
Normal file
@@ -0,0 +1,319 @@
|
||||
/* ********************************************************
|
||||
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"];
|
||||
disableSerialization;
|
||||
|
||||
//remove option
|
||||
call fnc_usec_medic_removeActions;
|
||||
r_action = false;
|
||||
|
||||
_unit = (_this select 3) select 0;
|
||||
if (dialog) then {
|
||||
_abc = findDisplay 106;
|
||||
_abc closeDisplay 0;
|
||||
};
|
||||
|
||||
_hasTester = "bloodTester" in magazines player;
|
||||
_antiA_displayed = false;
|
||||
_antiB_displayed = false;
|
||||
_antiD_displayed = false;
|
||||
_control_displayed = false;
|
||||
_water_displayed = false;
|
||||
_opened = false;
|
||||
_isDone = false;
|
||||
_A_Watered = false;
|
||||
_B_Watered = false;
|
||||
_D_Watered = false;
|
||||
_control_Watered = false;
|
||||
_results_shown = false;
|
||||
_needleOpened = false;
|
||||
_needleRed = false;
|
||||
_antiABlooded = false;
|
||||
_antiBBlooded = false;
|
||||
_antiDBlooded = false;
|
||||
_needleRest = false;
|
||||
_allClicked = 0;
|
||||
if (!_hasTester) exitWith {};
|
||||
|
||||
_dialog = createDialog "bloodTest";
|
||||
|
||||
sleep 0.02;
|
||||
|
||||
_display = uiNamespace getVariable 'DayZ_Blood_Test';
|
||||
_resultsCard_hidden = _display displayCtrl 1288;
|
||||
_antiA = _display displayCtrl 1293;
|
||||
_AntiB = _display displayCtrl 1294;
|
||||
_AntiD = _display displayCtrl 1295;
|
||||
_Control = _display displayCtrl 1296;
|
||||
_waterBottle = _display displayCtrl 1297;
|
||||
_needle = _display displayCtrl 1298;
|
||||
_name = _display displayCtrl 1289;
|
||||
_resultsCard_front = _display displayCtrl 1299;
|
||||
_resultsCard_front ctrlShow false;
|
||||
_antiAUntested = "\z\addons\dayz_code\gui\blood\bloodtest_t_antiA.paa";
|
||||
_antiBUntested = "\z\addons\dayz_code\gui\blood\bloodtest_t_antiB.paa";
|
||||
_antiDUntested = "\z\addons\dayz_code\gui\blood\bloodtest_t_antiD.paa";
|
||||
_controlUntested = "\z\addons\dayz_code\gui\blood\bloodtest_t_control.paa";
|
||||
_waterBottleImage ="\z\addons\dayz_code\gui\blood\bloodtest_button_water.paa";
|
||||
_waterBottleClickedImage = "\z\addons\dayz_code\gui\blood\bloodtest_button_water_enabled.paa";
|
||||
_needleClosedImage = "\z\addons\dayz_code\gui\blood\bloodtest_button_drawblood_closed.paa";
|
||||
_needleOpenImage = "\z\addons\dayz_code\gui\blood\bloodtest_button_drawblood_open.paa";
|
||||
_watered_image = "\z\addons\dayz_code\gui\blood\bloodtest_waterdrop.paa";
|
||||
_needleRedImage = "\z\addons\dayz_code\gui\blood\bloodtest_button_drawblood_enabled.paa";
|
||||
_bloodTypeCard = "\z\addons\dayz_code\gui\blood\bloodtest_results.paa";
|
||||
_bloodTypeCardHidden = "\z\addons\dayz_code\gui\blood\bloodtest_button_results.paa";
|
||||
_controlImage = "\z\addons\dayz_code\gui\blood\bloodtest_blood_waiting.paa";
|
||||
_RBWhole1 = "\z\addons\dayz_code\gui\blood\bloodtest_blood1.paa";
|
||||
_RBWhole2 = "\z\addons\dayz_code\gui\blood\bloodtest_blood2.paa";
|
||||
_RBWhole3 = "\z\addons\dayz_code\gui\blood\bloodtest_blood3.paa";
|
||||
_RBWhole4 = "\z\addons\dayz_code\gui\blood\bloodtest_blood4.paa";
|
||||
_RBWhole5 = "\z\addons\dayz_code\gui\blood\bloodtest_blood5.paa";
|
||||
_Aglut1 = "\z\addons\dayz_code\gui\blood\bloodtest_blood_true1.paa";
|
||||
_Aglut2 = "\z\addons\dayz_code\gui\blood\bloodtest_blood_true2.paa";
|
||||
_Aglut3 = "\z\addons\dayz_code\gui\blood\bloodtest_blood_true3.paa";
|
||||
_Aglut4 = "\z\addons\dayz_code\gui\blood\bloodtest_blood_true4.paa";
|
||||
_Aglut5 = "\z\addons\dayz_code\gui\blood\bloodtest_blood_true5.paa";
|
||||
_wholeArray = [_RBWhole1,_RBWhole2,_RBWhole3,_RBWhole4,_RBWhole5];
|
||||
_aglutArray = [_Aglut1,_Aglut2,_Aglut3, _Aglut4,_Aglut5];
|
||||
_allDisplayed = false;
|
||||
_water_closed = false;
|
||||
|
||||
r_interrupt = false;
|
||||
r_doLoop = true;
|
||||
r_A_watered = false;
|
||||
r_B_watered = false;
|
||||
r_D_watered = false;
|
||||
r_control_watered = false;
|
||||
r_canClick_resultsCard = false;
|
||||
r_resultsCard_Clicked = false;
|
||||
r_water_clicked = false;
|
||||
r_needleclicked = 0;
|
||||
r_control_done = false;
|
||||
r_antiA_done = false;
|
||||
r_antiB_done = false;
|
||||
r_antiD_done = false;
|
||||
_watered_complete = 0;
|
||||
_rnd1 = round(random 4);
|
||||
_rnd2 = floor(random 4);
|
||||
_rnd3 = ceil(random 4);
|
||||
|
||||
_type = _unit getVariable ["blood_type", false];
|
||||
_rh = _unit getVariable ["rh_factor", false];
|
||||
|
||||
while {!_isDone and r_doLoop} do {
|
||||
_watered = r_A_watered or r_B_watered or r_D_watered or r_control_watered;
|
||||
|
||||
//display untested images
|
||||
if (!_opened) then {
|
||||
if (alive _unit) then {
|
||||
_name ctrlSetText (name _unit);
|
||||
};
|
||||
_antiA ctrlSetText _antiAUntested;
|
||||
_antiB ctrlSetText _antiBUntested;
|
||||
_antiD ctrlSetText _antiDUntested;
|
||||
_Control ctrlSetText _controlUntested;
|
||||
_waterBottle ctrlSetText _waterBottleImage;
|
||||
_needle ctrlSetText _needleClosedImage;
|
||||
_resultsCard_hidden ctrlSetText _bloodTypeCardHidden;
|
||||
_opened = true;
|
||||
};
|
||||
|
||||
//display clicked water bottle image
|
||||
if (r_water_clicked and !_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 {
|
||||
_antiA ctrlSetText _watered_image;
|
||||
_A_Watered = true;
|
||||
_watered_complete = _watered_complete + 1;
|
||||
};
|
||||
if (r_B_watered and !_B_Watered) then {
|
||||
_antiB ctrlSetText _watered_image;
|
||||
_B_Watered = true;
|
||||
_watered_complete = _watered_complete + 1;
|
||||
};
|
||||
if (r_D_watered and !_D_Watered) then {
|
||||
_antiD ctrlSetText _watered_image;
|
||||
_D_Watered = true;
|
||||
_watered_complete = _watered_complete + 1;
|
||||
};
|
||||
if (r_control_watered and !_control_Watered) then {
|
||||
_Control ctrlSetText _watered_image;
|
||||
_control_Watered = true;
|
||||
_watered_complete = _watered_complete + 1;
|
||||
};
|
||||
};
|
||||
|
||||
//open needle
|
||||
if ((r_needleclicked == 1) and !_needleOpened) then {
|
||||
_needle ctrlSetText _needleOpenImage;
|
||||
_needleOpened = true;
|
||||
};
|
||||
|
||||
|
||||
//close water
|
||||
if ((_watered_complete >= 4) and !_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 {
|
||||
_needle ctrlSetText _needleRedImage;
|
||||
_needleRed = true;
|
||||
};
|
||||
|
||||
//reset needle
|
||||
if (_needleRed and r_needleReset) then {
|
||||
_needle ctrlSetText _needleOpenImage;
|
||||
_needleRed = false;
|
||||
};
|
||||
|
||||
//fill with blood
|
||||
if (r_antiA_done and !_antiABlooded and _needleRed) then {
|
||||
r_needleReset = true;
|
||||
_antiA ctrlSetText _controlImage;
|
||||
_antiABlooded = true;
|
||||
_allClicked = _allClicked + 1;
|
||||
};
|
||||
if (r_antiB_done and !_antiBBlooded and _needleRed) then {
|
||||
r_needleReset = true;
|
||||
_antiB ctrlSetText _controlImage;
|
||||
_antiBBlooded = true;
|
||||
_allClicked = _allClicked + 1;
|
||||
};
|
||||
if (r_antiD_done and !_antiDBlooded and _needleRed) then {
|
||||
r_needleReset = true;
|
||||
_antiD ctrlSetText _controlImage;
|
||||
_antiDBlooded = true;
|
||||
_allClicked = _allClicked + 1;
|
||||
};
|
||||
if (r_control_done and !_control_displayed and _needleRed) then {
|
||||
r_needleReset = true;
|
||||
_Control ctrlSetText _controlImage;
|
||||
_control_displayed = true;
|
||||
_allClicked = _allClicked + 1;
|
||||
};
|
||||
|
||||
_isClose = ((player distance _unit) < ((sizeOf typeOf _unit) / 2));
|
||||
if (r_interrupt or !_isClose) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
//The magic happens
|
||||
if (_allClicked == 4) then {
|
||||
switch (_type) do {
|
||||
case "A" : {
|
||||
if (!_allDisplayed) then {
|
||||
sleep 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);
|
||||
};
|
||||
_antiD_displayed = true;
|
||||
};
|
||||
_allDisplayed = true;
|
||||
};
|
||||
};
|
||||
case "B" : {
|
||||
if (!_allDisplayed) then {
|
||||
sleep 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);
|
||||
};
|
||||
_antiD_displayed = true;
|
||||
};
|
||||
_allDisplayed = true;
|
||||
};
|
||||
};
|
||||
case "AB" : {
|
||||
if (!_allDisplayed) then {
|
||||
sleep 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);
|
||||
};
|
||||
_antiD_displayed = true;
|
||||
};
|
||||
_allDisplayed = true;
|
||||
};
|
||||
};
|
||||
case "O" : {
|
||||
if (!_allDisplayed) then {
|
||||
sleep 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);
|
||||
};
|
||||
_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 {
|
||||
_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 {
|
||||
r_doLoop = false;
|
||||
_isDone = true;
|
||||
[] spawn {
|
||||
sleep 7;
|
||||
player setVariable["blood_testDone",true,true];
|
||||
player setVariable["medForceUpdate",true];
|
||||
};
|
||||
};
|
||||
sleep 0.01;
|
||||
};
|
||||
65
SQF/dayz_code/medical/brokeBones.sqf
Normal file
65
SQF/dayz_code/medical/brokeBones.sqf
Normal file
@@ -0,0 +1,65 @@
|
||||
private ["_started","_finished","_animState","_isMedic","_id","_unit","_item"];
|
||||
|
||||
_unit = (_this select 3) select 0;
|
||||
_item = (_this select 3) select 1;
|
||||
|
||||
player removeMagazine _item;
|
||||
|
||||
_unit setVariable ["hit_legs",0];
|
||||
_unit setVariable ["hit_hands",0];
|
||||
|
||||
if (vehicle player == player) then {
|
||||
//not in a vehicle
|
||||
player playActionNow "Medic";
|
||||
};
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
if (vehicle player != player) then {
|
||||
sleep 3;
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (_finished) then {
|
||||
if (_unit == player) then {
|
||||
//give to player, Ie the player fixed himself
|
||||
|
||||
//Self Healing
|
||||
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
|
||||
} else {
|
||||
//give to remote player, ie the player fixed another player
|
||||
|
||||
//Give humanity reward to player giving the morphine to another player.
|
||||
if (_item in ["ItemMorphine"]) then {
|
||||
[player,50] call player_humanityChange;
|
||||
};
|
||||
};
|
||||
|
||||
PVDZ_send = [_unit,"Morphine",[_unit,player]];
|
||||
publicVariableServer "PVDZ_send";
|
||||
} else {
|
||||
player addMagazine _item;
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
128
SQF/dayz_code/medical/fillBloodBag.sqf
Normal file
128
SQF/dayz_code/medical/fillBloodBag.sqf
Normal file
@@ -0,0 +1,128 @@
|
||||
private ["_victim","_started","_UID","_hasEmptyBag","_bloodDrained","_bloodLevel","_forceExit","_bloodType","_rh","_timer","_i","_complete","_animState","_isMedic","_blood","_bloodAfter","_isClose"];
|
||||
/* ********************************************************
|
||||
Used to fill blood bags with whole blood, only 4k per bag.
|
||||
By icomrade for DayZ Mod
|
||||
********************************************************* */
|
||||
|
||||
call fnc_usec_medic_removeActions;
|
||||
call gear_ui_init;
|
||||
closeDialog 0;
|
||||
r_interrupt = false;
|
||||
_victim = (_this select 3) select 0;
|
||||
_hasEmptyBag = "emptyBloodBag" in magazines player;
|
||||
_bloodLevel = _victim getVariable ["USEC_BloodQty", 0];
|
||||
_bloodType = _victim getVariable ["blood_type", false];
|
||||
_rh = _victim getVariable ["rh_factor", false];
|
||||
r_doLoop = true;
|
||||
_i = 0;
|
||||
_started= false;
|
||||
_timer = diag_tickTime;
|
||||
_complete = false;
|
||||
_bloodDrained = false;
|
||||
_forceExit = false;
|
||||
_UID = getPlayerUID player;
|
||||
if ((isNil "_UID") or (_UID == "0")) exitWith {};
|
||||
if (!_hasEmptyBag) exitWith { cutText [localize "str_actions_medical_bagEmpty", "PLAIN DOWN"]; };
|
||||
|
||||
if (_bloodLevel <= 4200) exitWith {cutText [localize "str_actions_medical_bagMissingBlood", "PLAIN DOWN"];};
|
||||
|
||||
if (!(alive _victim)) then {
|
||||
_bloodDrained = _victim getVariable ["bloodTaken", false];
|
||||
if (_bloodDrained) exitWith {_forceExit = true;};
|
||||
_victim setVariable ["bloodTaken", true, true];
|
||||
};
|
||||
|
||||
if (_forceExit) exitWith {cutText [localize "str_actions_medical_bagMissingBlood", "PLAIN DOWN"];};
|
||||
|
||||
if (vehicle player == player) then {
|
||||
//not in a vehicle
|
||||
player playActionNow "Medic";
|
||||
};
|
||||
|
||||
while {r_doLoop and (_i < 25)} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
|
||||
if (_isMedic and !_started) then {
|
||||
player removeMagazine "emptyBloodBag";
|
||||
cutText [localize "str_actions_medical_transfusion_start", "PLAIN DOWN"];
|
||||
[player,_victim,"loc",rTITLETEXT,localize "str_actions_medical_transfusion_start","PLAIN DOWN"] call RE;
|
||||
_started = true;
|
||||
};
|
||||
|
||||
if (_started) then {
|
||||
if ((diag_tickTime - _timer) >= 1) then {
|
||||
_timer = diag_tickTime;
|
||||
r_player_blood = r_player_blood - 160;
|
||||
//PVDZ_send = [_victim,"Transfuse",[_victim,player,-160,_UID]];
|
||||
//publicVariableServer "PVDZ_send";
|
||||
_i = _i + 1;
|
||||
};
|
||||
|
||||
if (!_isMedic) then {
|
||||
player playActionNow "Medic";
|
||||
};
|
||||
};
|
||||
|
||||
_blood = _victim getVariable ["USEC_BloodQty", 0];
|
||||
_bloodAfter = (_blood - 4000);
|
||||
|
||||
if ((_blood <= _bloodAfter) or (_i == 25)) then {
|
||||
cutText [localize "str_actions_medical_bagDone", "PLAIN DOWN"];
|
||||
[player,_victim,"loc",rTITLETEXT,localize "str_actions_medical_bagDone","PLAIN DOWN"] call RE;
|
||||
//_victim setVariable ["USEC_BloodQty", _bloodAfter, true];
|
||||
r_doLoop = false;
|
||||
_complete = true;
|
||||
};
|
||||
|
||||
_isClose = ((player distance _victim) < ((sizeOf typeOf _victim) / 2));
|
||||
|
||||
if (!_isClose) then {
|
||||
r_doLoop = false;
|
||||
r_interrupt = true;
|
||||
cutText [localize "str_actions_medical_bagInterrupted", "PLAIN DOWN"];
|
||||
[player,_victim,"loc",rTITLETEXT,localize "str_actions_medical_bagInterrupted","PLAIN DOWN"] call RE;
|
||||
};
|
||||
};
|
||||
|
||||
if (r_interrupt) exitWith {
|
||||
r_interrupt = false;
|
||||
};
|
||||
|
||||
if (_complete) then {
|
||||
switch (_bloodType) do {
|
||||
case "A" : {
|
||||
if (_rh) then {
|
||||
player addMagazine "wholeBloodBagAPOS";
|
||||
} else {
|
||||
player addMagazine "wholeBloodBagANEG";
|
||||
};
|
||||
};
|
||||
|
||||
case "B" : {
|
||||
if (_rh) then {
|
||||
player addMagazine "wholeBloodBagBPOS";
|
||||
} else {
|
||||
player addMagazine "wholeBloodBagBNEG";
|
||||
};
|
||||
};
|
||||
|
||||
case "AB" : {
|
||||
if (_rh) then {
|
||||
player addMagazine "wholeBloodBagABPOS";
|
||||
} else {
|
||||
player addMagazine "wholeBloodBagABNEG";
|
||||
};
|
||||
};
|
||||
|
||||
case "O" : {
|
||||
if (_rh) then {
|
||||
player addMagazine "wholeBloodBagOPOS";
|
||||
} else {
|
||||
player addMagazine "wholeBloodBagONEG";
|
||||
};
|
||||
};
|
||||
};
|
||||
} else {
|
||||
diag_log format ["Fill Bag: Something went wrong and the bloodBag was not added!"];
|
||||
};
|
||||
52
SQF/dayz_code/medical/load_wounded.sqf
Normal file
52
SQF/dayz_code/medical/load_wounded.sqf
Normal file
@@ -0,0 +1,52 @@
|
||||
// Load_wounded.sqf
|
||||
// OCTOBER 2010 - norrin
|
||||
|
||||
private ["_wounded","_vcl","_group"];
|
||||
|
||||
_wounded = _this select 0;
|
||||
|
||||
if (!local _wounded) exitWith {};
|
||||
|
||||
r_action = false;
|
||||
|
||||
sleep 1;
|
||||
_vcl = _wounded getVariable "NORRN_loadVcl";
|
||||
_wounded setVariable ["NORRN_unit_dragged", true, true];
|
||||
|
||||
_wounded assignAsCargo _vcl;
|
||||
_wounded moveInCargo _vcl;
|
||||
sleep 1;
|
||||
//["PVDZ_drg_RaLW",_wounded] call broadcastRpcCallAll;
|
||||
PVDZ_drg_RaLW = _wounded;
|
||||
publicVariable "PVDZ_drg_RaLW";
|
||||
|
||||
if (local _wounded) then
|
||||
{
|
||||
waitUntil {!(_wounded getVariable "NORRN_unconscious")|| !alive _wounded || vehicle _wounded == _wounded || (assignedVehicleRole _wounded) select 0 != "Cargo"};
|
||||
|
||||
if (vehicle _wounded == _wounded || (assignedVehicleRole _wounded) select 0 != "Cargo") exitWith
|
||||
{
|
||||
if (_wounded getVariable "NORRN_AIunconscious") then
|
||||
{
|
||||
if (vehicle _wounded != _wounded) then
|
||||
{
|
||||
unassignVehicle _wounded;
|
||||
sleep 0.05;
|
||||
_wounded action ["EJECT", _vcl];
|
||||
sleep 1;
|
||||
};
|
||||
// PVDZ_drg_RAlie = _wounded; // not used
|
||||
// publicVariable "PVDZ_drg_RAlie"; // not used
|
||||
_wounded switchMove "ainjppnemstpsnonwrfldnon";
|
||||
_wounded setVariable ["NORRN_unit_dragged", false, true];
|
||||
sleep 1;
|
||||
};
|
||||
};
|
||||
|
||||
if (vehicle _wounded != _wounded && alive _wounded) then
|
||||
{
|
||||
_wounded playMove "BasicDriver";
|
||||
};
|
||||
};
|
||||
sleep 0.01;
|
||||
if (true) exitWith {};
|
||||
9
SQF/dayz_code/medical/publicEH/medAntibiotics.sqf
Normal file
9
SQF/dayz_code/medical/publicEH/medAntibiotics.sqf
Normal file
@@ -0,0 +1,9 @@
|
||||
private ["_array","_unit","_medic"];
|
||||
_array = _this; //_this select 0;
|
||||
_unit = _array select 0;
|
||||
_medic = _array select 1;
|
||||
|
||||
if ((_unit == player) or (vehicle player != player)) then {
|
||||
r_player_infected = false;
|
||||
_unit setVariable["USEC_infected",false,true];
|
||||
};
|
||||
5
SQF/dayz_code/medical/publicEH/promptRName.sqf
Normal file
5
SQF/dayz_code/medical/publicEH/promptRName.sqf
Normal file
@@ -0,0 +1,5 @@
|
||||
// promptRName.sqf
|
||||
|
||||
_unit = _this select 0;
|
||||
|
||||
call compile format ["server globalChat reviver_%1", _unit];
|
||||
147
SQF/dayz_code/medical/selfbloodbag.sqf
Normal file
147
SQF/dayz_code/medical/selfbloodbag.sqf
Normal file
@@ -0,0 +1,147 @@
|
||||
private ["_unit","_blood","_lowBlood","_injured","_inPain","_lastused","_animState","_started","_finished","_timer","_i","_isMedic","_isClose","_duration","_rhVal","_bloodBagArrayNeeded","_BBneeded","_bbselect","_bloodBagNeeded","_badBag","_wholeBag","_bagFound","_bagToRemove","_forceClose","_bloodType","_rh","_bloodBagArray","_bbarray_length","_bloodBagWholeNeeded","_haswholebag","_r"];
|
||||
// bleed.sqf
|
||||
_unit = _this select 0;
|
||||
_bagUsed = _this select 1;
|
||||
|
||||
_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];
|
||||
|
||||
call gear_ui_init;
|
||||
closeDialog 0;
|
||||
|
||||
_bloodType = _unit getVariable ["blood_type", false];
|
||||
_rh = _unit getVariable ["rh_factor", false];
|
||||
|
||||
_badBag = false;
|
||||
_wholeBag = false;
|
||||
_bagFound = false;
|
||||
_BBneeded = false;
|
||||
_forceClose = false;
|
||||
|
||||
|
||||
if (_blood <= 4000) then {
|
||||
_duration = 3;
|
||||
} else {
|
||||
_duration = 2;
|
||||
};
|
||||
|
||||
_bloodBagArray = ["wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"];
|
||||
|
||||
if (_rh) then {_rhVal = "POS";} else {_rhVal = "NEG";};
|
||||
|
||||
|
||||
//No subs for whole blood :(
|
||||
_bloodBagWholeNeeded = "wholeBloodBag" + _bloodType + _rhVal;
|
||||
_haswholebag = _bloodBagWholeNeeded in magazines player;
|
||||
|
||||
if (_haswholebag) then {
|
||||
_wholeBag = true;
|
||||
} else {
|
||||
_badBag = true;
|
||||
};
|
||||
|
||||
call fnc_usec_medic_removeActions;
|
||||
r_action = false;
|
||||
|
||||
if (vehicle player == player) then {
|
||||
//not in a vehicle
|
||||
player playActionNow "Medic";
|
||||
};
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
_timer = diag_tickTime;
|
||||
_i = 0;
|
||||
_r = 0;
|
||||
|
||||
while {r_doLoop and (_i < 12)} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
|
||||
if (_isMedic and !_started) then {
|
||||
closeDialog 0;
|
||||
diag_log format ["TRANSFUSION: starting blood transfusion (%1 > %2)", name player, name _unit];
|
||||
if (_badBag) then {
|
||||
for "_r" from 0 to 15 do {
|
||||
_bagToRemove = _bagUsed;
|
||||
if (_bagToRemove in magazines player) exitWith { //TODO: add separate action menu options so the removed bag isn't random
|
||||
_bagFound = true;
|
||||
if (_r >= 8) then {
|
||||
_wholeBag = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
} else {
|
||||
if (_wholeBag) then {_bagToRemove = _bloodBagWholeNeeded; };
|
||||
if (_bagToRemove in magazines player) then { _bagFound = true; };
|
||||
};
|
||||
if (!_bagFound) then {_forceClose = true;} else { player removeMagazine _bagToRemove;};
|
||||
cutText [localize "str_actions_medical_transfusion_start", "PLAIN DOWN"];
|
||||
[player,_unit,"loc",rTITLETEXT,localize "str_actions_medical_transfusion_start","PLAIN DOWN"] call RE;
|
||||
_started = true;
|
||||
};
|
||||
|
||||
if (_started) then {
|
||||
if ((diag_tickTime - _timer) >= 1) then {
|
||||
_timer = diag_tickTime;
|
||||
_i = _i + 3;
|
||||
if (!_badBag) then {
|
||||
if (!_forceClose) then {
|
||||
if (!_wholeBag) then {
|
||||
_randomamount = round(random 60);
|
||||
r_player_blood = r_player_blood + 100 + _randomamount;
|
||||
} else {
|
||||
_randomamount = round(random 200);
|
||||
r_player_blood = r_player_blood + 800 + _randomamount;
|
||||
};
|
||||
|
||||
//PVDZ_send = [_unit,"Transfuse",[_unit,player,1000]];
|
||||
//publicVariableServer "PVDZ_send";
|
||||
};
|
||||
} else {
|
||||
if (!_forceClose and (_i >= 12)) then {
|
||||
[_unit, _duration] call fnc_usec_damageUnconscious;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (!_isMedic) then {
|
||||
player playActionNow "Medic";
|
||||
};
|
||||
};
|
||||
|
||||
_blood = _unit getVariable ["USEC_BloodQty", 0];
|
||||
|
||||
if (((_blood >= r_player_bloodTotal) and !_badBag and _bagFound) or (_i == 12)) then {
|
||||
diag_log format ["TRANSFUSION: completed blood transfusion successfully (_i = %1)", _i];
|
||||
cutText [localize "str_actions_medical_transfusion_successful", "PLAIN DOWN"];
|
||||
[player,_unit,"loc",rTITLETEXT,localize "str_actions_medical_transfusion_successful","PLAIN DOWN"] call RE;
|
||||
[player,25] call player_humanityChange;
|
||||
r_doLoop = false;
|
||||
};
|
||||
|
||||
_isClose = ((player distance _unit) < ((sizeOf typeOf _unit) / 2));
|
||||
|
||||
if (r_interrupt or !_isClose or _forceClose) then {
|
||||
diag_log format ["TRANSFUSION: transfusion was interrupted (r_interrupt: %1 | distance: %2 (%3) | _i = %4)", r_interrupt, player distance _unit, _isClose, _i];
|
||||
cutText [localize "str_actions_medical_transfusion_interrupted", "PLAIN DOWN"];
|
||||
[player,_unit,"loc",rTITLETEXT,localize "str_actions_medical_transfusion_interrupted","PLAIN DOWN"] call RE;
|
||||
r_doLoop = false;
|
||||
};
|
||||
|
||||
sleep 0.1;
|
||||
};
|
||||
|
||||
r_doLoop = false;
|
||||
|
||||
if (r_interrupt) then {
|
||||
r_interrupt = false;
|
||||
player switchMove "";
|
||||
player playActionNow "stop";
|
||||
};
|
||||
59
SQF/dayz_code/medical/wipes.sqf
Normal file
59
SQF/dayz_code/medical/wipes.sqf
Normal file
@@ -0,0 +1,59 @@
|
||||
private ["_started","_finished","_animState","_isMedic","_id","_unit"];
|
||||
_unit = (_this select 3) select 0;
|
||||
player removeMagazine "ItemAntibacterialWipe";
|
||||
|
||||
call fnc_usec_medic_removeActions;
|
||||
r_action = false;
|
||||
|
||||
if (vehicle player == player) then {
|
||||
//not in a vehicle
|
||||
player playActionNow "Medic";
|
||||
};
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
[player,"bandage",0,false] call dayz_zombieSpeak;
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
if (vehicle player != player) then {
|
||||
sleep 3;
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (_finished) then {
|
||||
//["PVCDZ_hlt_Bandage",[_unit,player]] call broadcastRpcCallAll;
|
||||
//PVCDZ_hlt_Bandage = [_unit,player];
|
||||
//publicVariable "PVCDZ_hlt_Bandage";
|
||||
//PVDZ_send = [_unit,"Bandage",[_unit,player]];
|
||||
//publicVariableServer "PVDZ_send";
|
||||
|
||||
|
||||
if ((_unit == player) or (vehicle player != player)) then {
|
||||
r_player_Sepsis = [false, 0];
|
||||
player setVariable ["USEC_Sepsis", false, true];
|
||||
player setVariable ["sepsisStarted", nil];
|
||||
};
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
player addMagazine "ItemAntibacterialWipe";
|
||||
};
|
||||
Reference in New Issue
Block a user