Finish Medical and Sleep to UiSleep

This commit is contained in:
icomrade
2016-03-05 22:34:09 -05:00
parent eadb3566c4
commit 68da397c52
87 changed files with 1320 additions and 1056 deletions

View File

@@ -1,13 +1,46 @@
private ["_hasMeds","_med"];
_med = "ItemAntibiotic";
_hasMeds = _med in magazines player;
if (_hasMeds) then {
player removeMagazine _med;
};
//remove option
// player removeAction s_player_antiobiotic;
//s_player_antiobiotic = -1;
#include "\z\addons\dayz_code\util\array.hpp";
//remove infection
r_player_infected = false;
player setVariable["USEC_infected",false,true];
private ["_msg","_antibiotics","_hasAntibiotics","_id","_hasMeds","_unit"];
_unit = _this select 0;
_medsUsed = _this select 1;
_antibiotics =["ItemAntibiotic","ItemAntibiotic1","ItemAntibiotic2","ItemAntibiotic3","ItemAntibiotic4","ItemAntibiotic5","ItemAntibiotic6"];
_hasAntibiotics = Array_Any(magazines player, {_this in _antibiotics});
_msg = "You seem to have misplaced your antibiotics.";
if (_hasAntibiotics) then {
//Remove one table from the box.
[_medsUsed,"medical"] call dayz_reduceItems;
//remove infection
r_player_infected = false;
_unit setVariable["USEC_infected",false,true];
//remove option
call fnc_usec_medic_removeActions;
r_action = false;
//player removeAction s_player_antiobiotic;
//s_player_antiobiotic = -1;
if ((_unit == player) or (vehicle player != player)) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medAntibiotics.sqf";
_msg = "You have taken antibiotics.";
} else {
//Send request to other player
PVDZE_send = [_unit,"Antibiotics",[_unit,player]];
publicVariableServer "PVDZE_send";
//Give humnaity for good deeds
[player,20] call player_humanityChange;
_msg = "You gave antibiotics.";
};
};
_msg call dayz_rollingMessages;

View File

@@ -1,10 +1,10 @@
// bleed.sqf
private ["_started","_finished","_animState","_isMedic","_id","_unit","_display"];
disableserialization;
private ["_started","_finished","_animState","_isMedic","_id","_unit","_item"];
_unit = (_this select 3) select 0;
_item = (_this select 3) select 1;
player removeMagazine _item;
closedialog 0;
call fnc_usec_medic_removeActions;
r_action = false;
@@ -14,21 +14,20 @@ if (vehicle player == player) then {
player playActionNow "Medic";
};
[1,1] call dayz_HungerThirst;
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 && !_isMedic) then {
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -40,39 +39,27 @@ while {r_doLoop} do {
r_doLoop = false;
_finished = true;
};
uiSleep 0.1;
uisleep 0.1;
};
r_doLoop = false;
if (_finished) then {
_num_removed = ([player,"ItemBandage"] call BIS_fnc_invRemove);
if(_num_removed == 1) then {
if (vehicle player != player) then {
_display = findDisplay 106;
_display closeDisplay 0;
};
if ((_unit == player) || (vehicle player != player)) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
dayz_sourceBleeding = objNull;
} else {
/* PVS/PVC - Skaronator */
PVDZE_send = [_unit,"Bandage",[_unit,player]];
publicVariableServer "PVDZE_send";
[player,20] call player_humanityChange;
if ((_unit == player) or (vehicle player != player)) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
if (_item=="ItemSepsisBandage") then {
r_player_Sepsis = [false, 0];
player setVariable ["USEC_Sepsis", false, true];
player setVariable ["sepsisStarted", nil];
};
{_unit setVariable[_x,false,true];} count USEC_typeOfWounds;
_unit setVariable ["USEC_injured",false,true];
} else {
PVDZE_send = [_unit,"Bandage",[_unit,player]];
publicVariableServer "PVDZE_send";
[player,20] call player_humanityChange;
};
} else {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
};
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
player addMagazine _item;
};

View File

@@ -39,7 +39,7 @@ if (!_hasTester) exitWith {};
_dialog = createDialog "bloodTest";
sleep 0.02;
uiSleep 0.02;
_display = uiNamespace getVariable 'DayZ_Blood_Test';
_resultsCard_hidden = _display displayCtrl 1288;
@@ -210,7 +210,7 @@ if (_allClicked == 4) then {
switch (_type) do {
case "A" : {
if (!_allDisplayed) then {
sleep 2;
uiSleep 2;
if (r_antiA_done and !_antiA_displayed) then {
_antiA ctrlSetText (_aglutArray select _rnd1);
_antiA_displayed = true;
@@ -232,7 +232,7 @@ if (_allClicked == 4) then {
};
case "B" : {
if (!_allDisplayed) then {
sleep 2;
uiSleep 2;
if (r_antiA_done and !_antiA_displayed) then {
_antiA ctrlSetText (_wholeArray select _rnd1);
_antiA_displayed = true;
@@ -254,7 +254,7 @@ if (_allClicked == 4) then {
};
case "AB" : {
if (!_allDisplayed) then {
sleep 2;
uiSleep 2;
if (r_antiA_done and !_antiA_displayed) then {
_antiA ctrlSetText (_aglutArray select _rnd1);
_antiA_displayed = true;
@@ -276,7 +276,7 @@ if (_allClicked == 4) then {
};
case "O" : {
if (!_allDisplayed) then {
sleep 2;
uiSleep 2;
if (r_antiA_done and !_antiA_displayed) then {
_antiA ctrlSetText (_wholeArray select _rnd1);
_antiA_displayed = true;
@@ -310,10 +310,10 @@ if (_allClicked == 4) then {
r_doLoop = false;
_isDone = true;
[] spawn {
sleep 7;
uiSleep 7;
player setVariable["blood_testDone",true,true];
player setVariable["medForceUpdate",true];
};
};
sleep 0.01;
uiSleep 0.01;
};

View File

@@ -32,11 +32,11 @@ while {r_doLoop} do {
r_doLoop = false;
};
if (vehicle player != player) then {
sleep 3;
uiSleep 3;
r_doLoop = false;
_finished = true;
};
sleep 0.1;
uiSleep 0.1;
};
r_doLoop = false;

View File

@@ -1,56 +1,59 @@
/*
CARRY BODY SCRIPT
Allows players to carry unconscious bodies
Allows players to carry unconscious bodies
JULY 2010 - norrin
*****************************************************************************************************************************
Start carry.sqf
*/
private ["_unit","_dragee","_anim_name","_can_be_revived","_can_be_revived_2"];
_dragee = _this select 3;
_can_be_revived = NORRN_revive_array select 20;
private ["_unit","_dragee","_pos","_dir"];
_dragee = _this select 3;
_can_be_revived = NORRN_revive_array select 20;
_can_be_revived_2 = NORRN_revive_array select 21;
_unit = player;
r_carry_sqf = true;
r_drag_sqf = false;
_unit = player;
r_carry_sqf = true;
r_drag_sqf = false;
_unit removeAction Norrn_carryAction;
if (isNull _dragee) exitWith {};
_dragee setVariable ["NORRN_unit_dragged", true, true];
if (isNull _dragee) exitWith {};
_dragee setVariable ["NORRN_unit_dragged", true, true];
detach _dragee;
uiSleep 1.5;
// public EH
//DayZ CE: PublicVariables are removed in DayZ CE -> Could we also do here - Commit by Skaronator
norrnRACarUp = _dragee;
publicVariable "norrnRACarUp";
_dragee switchMove "ainjpfalmstpsnonwrfldnon_carried_up";
norrnRAPicUp = _unit;
publicVariable "norrnRAPicUp";
//PVDZ_drg_RACarUp = _dragee; // not used
//publicVariable "PVDZ_drg_RACarUp"; // not used
//_dragee switchMove "ainjpfalmstpsnonwrfldnon_carried_up";
//PVDZ_drg_RAPicUp = _unit; // not used
//publicVariable "PVDZ_drg_RAPicUp"; // not used
_unit switchMove "acinpknlmstpsraswrfldnon_acinpercmrunsraswrfldnon";
uiSleep 10;
_dragee switchmove "ainjpfalmstpsnonwrfldnon_carried_still";
_dragee attachto [_unit,[-0.2, 0.2, 0]];
while {r_carry_sqf} do
while {r_carry_sqf} do
{
_anim_name = animationstate _unit;
_anim_name = animationstate _unit;
if (!(_dragee getVariable "NORRN_unconscious")) exitWith
{
{
detach _dragee;
_unit switchMove "";
player removeAction Norrn_dropAction;
r_carry_sqf = false;
};
};
//check that dragged unit still exists
if (!alive _unit || _anim_name != "acinpknlmstpsraswrfldnon_acinpercmrunsraswrfldnon" && _anim_name != "acinpercmstpsraswrfldnon" && _anim_name != "acinpercmrunsraswrfldf") exitWith
{
if (!alive _unit || _anim_name != "acinpknlmstpsraswrfldnon_acinpercmrunsraswrfldnon" && _anim_name != "acinpercmstpsraswrfldnon" && _anim_name != "acinpercmrunsraswrfldf") exitWith
{
player removeAction NORRN_dropAction;
detach _dragee;
_unit switchMove "";
r_carry_sqf = false;
};
};
uiSleep 0.1;
};
if (true) exitWith {};

View File

@@ -2,58 +2,59 @@
CARRY BODY SCRIPT
Allows players to carry unconscious bodies
Allows players to carry unconscious bodies
JULY 2010 - norrin
*****************************************************************************************************************************
Start carry.sqf
*/
private ["_unit","_dragee","_anim_name","_can_be_revived","_can_be_revived_2"];
_dragee = _this select 3;
_can_be_revived = NORRN_revive_array select 20;
_can_be_revived_2 = NORRN_revive_array select 21;
_unit = player;
r_carry_sqf = true;
r_drag_sqf = false;
_unit removeAction Norrn_carryAction;
if (isNull _dragee) exitWith {};
_dragee setVariable ["NORRN_unit_dragged", true, true];
detach _dragee;
uiSleep 1.5;
// public EH
norrnRACarUp = _dragee;
publicVariable "norrnRACarUp";
_dragee switchMove "ainjpfalmstpsnonwrfldnon_carried_up";
norrnRAPicUp = _unit;
publicVariable "norrnRAPicUp";
_unit switchMove "acinpknlmstpsraswrfldnon_acinpercmrunsraswrfldnon";
uiSleep 10;
_dragee switchmove "ainjpfalmstpsnonwrfldnon_carried_still";
_dragee attachto [_unit,[-0.2, 0.2, 0]];
while {r_carry_sqf} do
{
_anim_name = animationstate _unit;
if (!(_dragee getVariable "NORRN_unconscious")) exitWith
{
detach _dragee;
_unit switchMove "";
player removeAction Norrn_dropAction;
r_carry_sqf = false;
};
//check that dragged unit still exists
if (!alive _unit || _anim_name != "acinpknlmstpsraswrfldnon_acinpercmrunsraswrfldnon" && _anim_name != "acinpercmstpsraswrfldnon" && _anim_name != "acinpercmrunsraswrfldf") exitWith
{
player removeAction NORRN_dropAction;
detach _dragee;
_unit switchMove "";
r_carry_sqf = false;
};
uiSleep 0.1;
};
_dragee playActionNow "Die";
// private ["_unit","_dragee","_pos","_dir"];
// _dragee = _this select 3;
// _can_be_revived = NORRN_revive_array select 20;
// _can_be_revived_2 = NORRN_revive_array select 21;
// _unit = player;
// r_carry_sqf = true;
// r_drag_sqf = false;
//
// _unit removeAction Norrn_carryAction;
// if (isNull _dragee) exitWith {};
// _dragee setVariable ["NORRN_unit_dragged", true, true];
// detach _dragee;
// uiSleep 1.5;
// // public EH
// PVDZ_drg_RACarUp = _dragee;
// publicVariable "PVDZ_drg_RACarUp";
// _dragee switchMove "ainjpfalmstpsnonwrfldnon_carried_up";
// PVDZ_drg_RAPicUp = _unit;
// publicVariable "PVDZ_drg_RAPicUp";
// _unit switchMove "acinpknlmstpsraswrfldnon_acinpercmrunsraswrfldnon";
// uiSleep 10;
// _dragee switchmove "ainjpfalmstpsnonwrfldnon_carried_still";
// _dragee attachto [_unit,[-0.2, 0.2, 0]];
//
//
// while {r_carry_sqf} do
// {
// _anim_name = animationstate _unit;
// if (!(_dragee getVariable "NORRN_unconscious")) exitWith
// {
// detach _dragee;
// _unit switchMove "";
// player removeAction Norrn_dropAction;
// r_carry_sqf = false;
// };
//
// //check that dragged unit still exists
// if (!alive _unit || _anim_name != "acinpknlmstpsraswrfldnon_acinpercmrunsraswrfldnon" && _anim_name != "acinpercmstpsraswrfldnon" && _anim_name != "acinpercmrunsraswrfldf") exitWith
// {
// player removeAction NORRN_dropAction;
// detach _dragee;
// _unit switchMove "";
// r_carry_sqf = false;
// };
// uiSleep 0.1;
// };
// _dragee playActionNow "Die";
// if (true) exitWith {};
//

View File

@@ -2,43 +2,63 @@
DRAG BODY SCRIPT
Allows players to drag unconscious bodies
Allows players to drag unconscious bodies
JULY 2010 - norrin
*****************************************************************************************************************************
Start drag.sqf
*/
private ["_unit","_dragee","_unconscious"];
_dragee = _this select 3;
_unit = player;
_unconscious = _dragee getVariable ["NORRN_unconscious", false];
private ["_unit","_dragee","_pos","_dir","_addAction"];
_dragee = _this select 3;
_unit = player;
_unconscious = _dragee getVariable ["NORRN_unconscious", false];
_addAction = false;
if (isNull _dragee) exitWith {};
if (!_unconscious) exitWith {};
if (isNull _dragee) exitWith {};
if (!_unconscious) exitWith {};
//player assumes dragging posture
_dragee setVariable ["NORRN_unit_dragged", true, true];
_unit playActionNow "grabDrag";
uiSleep 2;
r_drag_sqf = true;
//unconscious unit assumes dragging posture
//public EH
//["norrnRaDrag",_dragee] call broadcastRpcCallAll;
norrnRaDrag = [_dragee];
publicVariable "norrnRaDrag";
_dragee attachto [_unit,[0.1, 1.01, 0]];
uiSleep 0.02;
while {r_drag_sqf} do {
if (!_addAction) then {
_dragee setVariable ["NORRN_unit_dragged", true, true];
//rotate wounded units so that it is facing the correct direction
norrnR180 = _dragee;
publicVariable "norrnR180";
_dragee setDir 180;
r_drag_sqf = true;
_unit playActionNow "grabDrag";
uiSleep 2;
//Uneccesary actions removed & drop body added
call fnc_usec_medic_removeActions;
//unconscious unit assumes dragging posture
//public EH
//PVDZ_drg_RaDrag = _dragee;
PVDZ_drg_RaDrag = [_dragee];
publicVariable "PVDZ_drg_RaDrag";
//_dragee switchmove "ainjppnemstpsnonwrfldb_still";
_dragee attachto [_unit,[0.1, 1.01, 0]];
uiSleep 0.02;
NORRN_dropAction = player addAction ["Drop body", "\z\addons\dayz_code\medical\drop_body.sqf",_dragee, 0, false, true];
//NORRN_carryAction = player addAction ["Carry body", "\z\addons\dayz_code\medical\carry.sqf",_dragee, 0, false, true];
uiSleep 1;
//rotate wounded units so that it is facing the correct direction
//PVDZ_drg_R180 = _dragee; // not used
//publicVariable "PVDZ_drg_R180"; // not used
_dragee setDir 180;
//Uneccesary actions removed & drop body added
call fnc_usec_medic_removeActions;
NORRN_dropAction = player addAction [localize "str_actions_medical_dropbody", "\z\addons\dayz_code\medical\drop_body.sqf",_dragee, 0, false, true];
//NORRN_carryAction = player addAction ["Carry body", "\z\addons\dayz_code\medical\carry.sqf",_dragee, 0, false, true];
uiSleep 1;
_addAction = true;
};
if (force_dropBody) then {
[cursorTarget, _unit, _unconscious, _dragee] execVM "\z\addons\dayz_code\medical\drop_body.sqf";
};
if (vehicle player != player) then {
player action ["eject", vehicle player];
cutText [localize "str_actions_medical_dragbody_veh","PLAIN DOWN"];
[cursorTarget, _unit, _unconscious, _dragee] execVM "\z\addons\dayz_code\medical\drop_body.sqf";
};
if (!r_drag_sqf) exitWith {};
};

View File

@@ -8,12 +8,11 @@
Start drop_body.sqf
*/
private ["_dragee","_unit"];
_dragee = _this select 3;
_dragee = _this select 3;
player removeAction NORRN_dropAction;
player removeAction NORRN_carryAction;
NORRN_remove_drag = true;
//player removeAction NORRN_carryAction;
NORRN_remove_drag = true;
r_drag_sqf = false;
r_carry_sqf = false;
r_action = false;
@@ -24,9 +23,12 @@ detach _dragee;
_unit switchMove "";
_dragee switchMove "";
NORRN_Dragged_body = objNull;
_dragee setVariable ["NORRN_unit_dragged", false, true];
_dragee setVariable ["NORRN_unit_dragged", false, true];
//lie on back
_dragee playMoveNow "ainjppnemstpsnonwrfldnon";
norrnRalie = _dragee;
publicVariable "norrnRalie";
//PVDZ_drg_Ralie = _dragee; // not used
//publicVariable "PVDZ_drg_Ralie"; // not used
force_dropBody = false;
if (true) exitWith {};

View File

@@ -4,7 +4,7 @@ private ["_unit","_isDead"];
_unit = (_this select 3) select 0;
_isDead = _unit getVariable["USEC_isDead",false];
call fnc_usec_medic_removeActions;
[1,1] call dayz_HungerThirst;
player playActionNow "Medic";
player removeMagazine "ItemEpinephrine";

View File

@@ -90,36 +90,40 @@ r_interrupt = false;
};
if (_complete) then {
switch (_bloodType) do {
case "A" : {
if (_rh) then {
player addMagazine "wholeBloodBagAPOS";
} else {
player addMagazine "wholeBloodBagANEG";
if (!DZE_UseBloodTypes) then {
player addMagazine "ItemBloodbag";
} else {
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 "B" : {
if (_rh) then {
player addMagazine "wholeBloodBagBPOS";
} else {
player addMagazine "wholeBloodBagBNEG";
};
};
};
case "AB" : {
if (_rh) then {
player addMagazine "wholeBloodBagABPOS";
} else {
player addMagazine "wholeBloodBagABNEG";
case "AB" : {
if (_rh) then {
player addMagazine "wholeBloodBagABPOS";
} else {
player addMagazine "wholeBloodBagABNEG";
};
};
};
case "O" : {
if (_rh) then {
player addMagazine "wholeBloodBagOPOS";
} else {
player addMagazine "wholeBloodBagONEG";
case "O" : {
if (_rh) then {
player addMagazine "wholeBloodBagOPOS";
} else {
player addMagazine "wholeBloodBagONEG";
};
};
};
};

View File

@@ -1,66 +1,6 @@
// init_related_scripts.sqf ArmA2 revive
// <20> AUGUST 2010 - norrin
// moved to dayz_code/system/scheduler/sched_medical.sqf
// Functions
// Added pvEH - scripts modified to remove the need for sending long strings via setVehicleInit to reduce network traffic && JIP load - 04072010
// INCLUDE REQUIRED GAME CODES
#include "\ca\editor\Data\Scripts\dikCodes.h"
//Settings
private ["_id","_rnd","_lowBlood"];
usec_bandage_recovery = 5; //time to recover after bandaging
//"colorCorrections" ppEffectEnable true;
//"dynamicBlur" ppEffectEnable true;
//[man2] call fnc_usec_damageHandle;
//[player] call fnc_usec_damageHandle;
//random morphine chance
//Epi pen not working chance
//Water Unconscious handling
// localize "CLIENT: Medical System Initiated";
while {true} do {
//hintSilent format["Injured: %1\nUnconscious: %2 (%7)\nBlood: %5\nPain: %6\nMust Evac: %8\nHandler: %3\nAction: %4\nLeg Damage: %9\nArm Damage: %10\nInfected: %11",r_player_injured,r_player_unconscious,r_player_handler,r_action,r_player_blood,r_player_inpain,r_player_timeout,r_player_dead, player getVariable ["hit_legs",0], player getVariable ["hit_arms",0],r_player_infected];
if (r_player_blood <= 0) then {
[player,900] call fnc_usec_damageUnconscious;
_id = [dayz_sourceBleeding,"bled"] spawn player_death;
};
if ((r_player_blood <= 3000) && !r_player_unconscious) then {
_rnd = random 100;
if (_rnd > 99) then {
[player,((random 0.1) + 0.2)] call fnc_usec_damageUnconscious;
};
};
//Handle Unconscious player
if ((r_player_unconscious) && (!r_player_handler1)) then {
//localize "CLIENT: Start Unconscious Function";
[] spawn fnc_usec_unconscious;
};
//Handle player bleeding
if ((r_player_injured) && (!r_player_handler)) then {
r_player_handler = true;
uiSleep 1;
//localize "CLIENT: Start Player Bleeding";
[] spawn fnc_usec_playerBleed; //publicizes the blood value at regular intervals
[] spawn fnc_med_publicBlood;
};
//Handle player infection
if ((r_player_infected) && (!r_player_handler)) then {
r_player_handler = true;
uiSleep 1;
[] spawn fnc_med_publicBlood;
};
while {1==1} do {
//Low Blood Effects
if (!r_player_unconscious) then {
if (((r_player_blood/r_player_bloodTotal) < 0.35)) then {
@@ -77,11 +17,10 @@ while {true} do {
};
uiSleep 0.5;
_lowBlood = player getVariable ["USEC_lowBlood", false];
if ((r_player_blood < r_player_bloodTotal) && !_lowBlood) then {
if ((r_player_blood < r_player_bloodTotal) and !_lowBlood) then {
player setVariable["USEC_lowBlood",true,true];
};
};
};
uiSleep 1;
};
endLoadingScreen;
};

View File

@@ -3,29 +3,29 @@
private ["_args","_dragger","_vcl","_wounded"];
_args = _this select 3;
_dragger = _args select 0;
_vcl = _args select 1;
_wounded = _args select 2;
r_drag_sqf = false;
_args = _this select 3;
_dragger = _args select 0;
_vcl = _args select 1;
_wounded = _args select 2;
r_drag_sqf = false;
r_action = false;
r_action_load = false;
call fnc_usec_medic_removeActions;
//_dragger removeAction NORRN_loadWoundedAction;
_dragger removeAction NORRN_loadWoundedAction;
if ((_vcl emptyPositions "cargo") > 0) then
{
{
detach _wounded;
_dragger switchMove "";
_dragger switchMove "";
_wounded setVariable ["NORRN_LoadVcl", _vcl, true];
uiSleep 1;
//["norrnRLact",_wounded] call broadcastRpcCallAll;
norrnRLact = [_wounded];
[_wounded] execVM "\z\addons\dayz_code\medical\load\load_wounded.sqf";
norrnRLact = _wounded;
publicVariable "norrnRLact";
player removeAction NORRN_dropAction;
}else{
hint "No space left in vehicle";
} else {
cutText [localize "str_dragnospace", "PLAIN DOWN"];//hint "No space left in vehicle";
};
NORRN_load_wounded_action = true;
NORRN_load_wounded_action = true;

View File

@@ -1,9 +1,9 @@
// Load_wounded.sqf
// OCTOBER 2010 - norrin
private ["_wounded","_vcl"];
private ["_wounded","_vcl","_group"];
_wounded = _this select 0;
_wounded = _this select 0;
if (!local _wounded) exitWith {};
@@ -11,21 +11,22 @@ uiSleep 1;
_vcl = _wounded getVariable "NORRN_loadVcl";
_wounded setVariable ["NORRN_unit_dragged", true, true];
_wounded assignAsCargo _vcl;
_wounded assignAsCargo _vcl;
_wounded moveInCargo _vcl;
uiSleep 1;
//["norrnRALW",_wounded] call broadcastRpcCallAll;
norrnRALW = [_wounded];
publicVariable "norrnRALW";
//["norrnRaLW",_wounded] call broadcastRpcCallAll;
norrnRaLW = _wounded;
publicVariable "norrnRaLW";
_wounded switchMove "kia_hmmwv_driver";
if (local _wounded) then
{
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 ((vehicle _wounded == _wounded) || (assignedVehicleRole _wounded) select 0 != "Cargo") exitWith
{
if (_wounded getVariable "NORRN_AIunconscious") then
{
{
if (vehicle _wounded != _wounded) then
{
unassignVehicle _wounded;
@@ -33,17 +34,19 @@ if (local _wounded) then
_wounded action ["EJECT", _vcl];
uiSleep 1;
};
norrinRAlie = _wounded;
publicVariable "norrinRAlie";
// PVDZ_drg_RAlie = _wounded; // not used
// publicVariable "PVDZ_drg_RAlie"; // not used
_wounded switchMove "ainjppnemstpsnonwrfldnon";
_wounded setVariable ["NORRN_unit_dragged", false, true];
uiSleep 1;
};
};
if (vehicle _wounded != _wounded && alive _wounded) then
{
_wounded playMove "BasicDriver";
{
_wounded playMove "BasicDriver";
};
};
uiSleep 0.01;
uiSleep 0.01;
if (true) exitWith {};

View File

@@ -1,18 +1,18 @@
// unLoad_act.sqf
// AUGUST 2010 - norrin
private ["_args","_vcl","_loop","_unit","_name","_crewVcl"];
private ["_args","_dragger","_vcl","_wounded"];
_args = _this select 3;
_name = _args select 0;
_vcl = _args select 1;
_crewVcl = crew _vcl;
_args = _this select 3;
_name = _args select 0;
_vcl = _args select 1;
_crewVcl = crew _vcl;
_name removeAction (_this select 2);
//_name removeAction NORRN_pullOutAction; // NORRN_pullOutAction is defined anywhere
for [{ _loop = 0 },{ _loop < count _crewVcl },{ _loop = _loop + 1}] do
{
_unit = _crewVcl select _loop;
_unit = _crewVcl select _loop;
if (_unit getVariable "NORRN_unconscious") then
{
@@ -20,11 +20,18 @@ for [{ _loop = 0 },{ _loop < count _crewVcl },{ _loop = _loop + 1}] do
uiSleep 0.05;
_unit action ["EJECT", _vcl];
uiSleep 1;
_position = getPosATL _unit;
_isOnDeck = getPosASL _unit in LHA_Deck;
if (_isOnDeck) then {
_unit setPosAsl [(_position select 0), (_position select 1), (LHA_height+1)];
};
_unit switchMove "";
_unit switchMove "ainjppnemstpsnonwrfldnon";
uiSleep 0.2;
norrnRalie = _unit;
publicVariable "norrnRalie";
// PVDZ_drg_Ralie = _unit; // not used
// publicVariable "PVDZ_drg_Ralie"; // not used
};
uiSleep 0.1;
};
};
if (true) exitWith {};

View File

@@ -9,13 +9,13 @@ if (!local _wounded) exitWith {};
r_action = false;
sleep 1;
uiSleep 1;
_vcl = _wounded getVariable "NORRN_loadVcl";
_wounded setVariable ["NORRN_unit_dragged", true, true];
_wounded assignAsCargo _vcl;
_wounded moveInCargo _vcl;
sleep 1;
uiSleep 1;
//["PVDZ_drg_RaLW",_wounded] call broadcastRpcCallAll;
norrnRaLW = _wounded;
publicVariable "norrnRaLW";
@@ -31,15 +31,15 @@ if (local _wounded) then
if (vehicle _wounded != _wounded) then
{
unassignVehicle _wounded;
sleep 0.05;
uiSleep 0.05;
_wounded action ["EJECT", _vcl];
sleep 1;
uiSleep 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;
uiSleep 1;
};
};
@@ -48,5 +48,5 @@ if (local _wounded) then
_wounded playMove "BasicDriver";
};
};
sleep 0.01;
uiSleep 0.01;
if (true) exitWith {};

View File

@@ -1,17 +1,14 @@
// bleed.sqf
private ["_started","_finished","_animState","_isMedic","_id","_num_removed","_unit"];
disableserialization;
private ["_started","_finished","_animState","_isMedic","_id","_unit"];
_unit = (_this select 3) select 0;
player removeMagazine "ItemMorphine";
_unit setVariable ["hit_legs",0];
_unit setVariable ["hit_hands",0];
call fnc_usec_medic_removeActions;
r_action = false;
[1,1] call dayz_HungerThirst;
if (vehicle player == player) then {
//not in a vehicle
player playActionNow "Medic";
@@ -27,7 +24,7 @@ while {r_doLoop} do {
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -44,29 +41,22 @@ while {r_doLoop} do {
r_doLoop = false;
if (_finished) then {
_num_removed = ([player,"ItemMorphine"] call BIS_fnc_invRemove);
if(_num_removed == 1) then {
if (vehicle player != player) then {
_display = findDisplay 106;
_display closeDisplay 0;
};
if ((_unit == player) || (vehicle player != player)) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
} else {
[player,50] call player_humanityChange;
};
/* PVS/PVC - Skaronator */
PVDZE_send = [_unit,"Morphine",[_unit,player]];
publicVariableServer "PVDZE_send";
if ((_unit == player) or (vehicle player != player)) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
} else {
//PVCDZ_plr_Humanity = [player,50];
[player,50] call player_humanityChange;
};
//["PVCDZ_hlt_Morphine",[_unit,player]] call broadcastRpcCallAll;
//PVCDZ_hlt_Morphine = [_unit,player];
//publicVariable "PVCDZ_hlt_Morphine";
PVDZE_send = [_unit,"Morphine",[_unit,player]];
publicVariableServer "PVDZE_send";
} else {
player addMagazine "ItemMorphine";
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};

View File

@@ -1,39 +1,27 @@
// bleed.sqf
private ["_id","_unit","_num_removed"];
disableserialization;
private ["_id","_unit"];
_unit = (_this select 3) select 0;
_unit setVariable ["USEC_inPain", false, true];
call fnc_usec_medic_removeActions;
r_action = false;
_num_removed = ([player,"ItemPainkiller"] call BIS_fnc_invRemove);
if(_num_removed == 1) then {
if (vehicle player != player) then {
_display = findDisplay 106;
_display closeDisplay 0;
};
_unit setVariable ["USEC_inPain", false, true];
if (vehicle player == player) then {
//not in a vehicle
player playActionNow "Gear";
};
if ((_unit == player) || (vehicle player != player)) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf";
} else {
[player,20] call player_humanityChange;
};
uiSleep 1;
//clear the healed player's vision
/* PVS/PVC - Skaronator */
PVDZE_send = [_unit,"Painkiller",[_unit,player]];
publicVariableServer "PVDZE_send";
if (vehicle player == player) then {
//not in a vehicle
player playActionNow "Gear";
};
if ((_unit == player) or (vehicle player != player)) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf";
} else {
//PVCDZ_plr_Humanity = [player,20];
[player,20] call player_humanityChange;
};
player removeMagazine "ItemPainkiller";
uiSleep 1;
PVDZE_send = [_unit,"Painkiller",[_unit,player]];
publicVariableServer "PVDZE_send";

View File

@@ -5,15 +5,19 @@ _array = _this; //_this select 0;
_unit = _array select 0;
_medic = _array select 1;
if ((_unit == player) || (vehicle player != player)) then {
if ((_unit == player) or (vehicle player != player)) then {
r_player_injured = false;
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;
r_player_handler = false;
if (r_player_blood == r_player_bloodTotal) then {
player setVariable["USEC_lowBlood",false,true];
};
dayz_sourceBleeding = objNull;
call fnc_usec_resetWoundPoints;
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1303;
_control = _display displayCtrl 1303;
_control ctrlShow false;
};

View File

@@ -1,61 +0,0 @@
// medBreakLegs.sqf
private ["_array","_unit","_attacker","_cnt","_index","_hit","_damage","_wound","_isInjured","_lowBlood"];
disableserialization;
_array = _this; //_this select 0;
_unit = _array select 0;
_attacker = _array select 1;
if (_unit == player && player distance _attacker < 5) then {
player setVariable["startcombattimer", 1];
// Make bleed
if (random 2 < 1) then {
// Find hit
_cnt = count (DAYZ_woundHit_ok select 1);
_index = floor (random _cnt);
_index = (DAYZ_woundHit_ok select 1) select _index;
_hit = (DAYZ_woundHit_ok select 0) select _index;
_damage = 0.1 + random (1.2);
//Record Damage to Minor parts (legs, arms)
if (_hit in USEC_MinorWounds) then {
[_unit,_hit,_damage] call object_processHit;
};
player setVariable["medForceUpdate",true,true];
1 call fnc_usec_bulletHit;
_wound = _hit call fnc_usec_damageGetWound;
//Create Wound
_unit setVariable[_wound,true,true];
[_unit,_wound,_hit] spawn fnc_usec_damageBleed;
usecBleed = [_unit,_wound,_hit];
publicVariable "usecBleed"; //Not sure if this can used over a PVS way, maybe with a rangeCheck like in gutObject.sqf?
//Set Injured if not already
_isInjured = _unit getVariable["USEC_injured",false];
if (!_isInjured) then {
_unit setVariable["USEC_injured",true,true];
dayz_sourceBleeding = _attacker;
};
//Set ability to give blood
_lowBlood = _unit getVariable["USEC_lowBlood",false];
if (!_lowBlood) then {
_unit setVariable["USEC_lowBlood",true,true];
};
r_player_injured = true;
// reduce blood
r_player_blood = r_player_blood - 50;
// Make player infected
if (random 5 < 1) then {
r_player_infected = true;
player setVariable["USEC_infected",true,true];
};
};
[_unit,"hit",2,false] call dayz_zombieSpeak;
};

View File

@@ -1,23 +1,15 @@
// animHealed.sqf
private ["_array","_unit","_medic","_isDead"];
// called by PublicVariableEventHandler "PVCDZ_hlt_Epi", received from the server,
// because another player sent a PVDZ_send = [_unit,"Epinephrine",[_unit,player,"ItemEpinephrine"]];
_array = _this; //_this select 0;
_unit = _array select 0;
_medic = _array select 1;
_unit = _array select 0; // healed
_medic = _array select 1; // healer
_isDead = _unit getVariable["USEC_isDead",false];
if (local _unit) then {_unit setCaptive false};
//if (local _unit) then {_unit setCaptive false}; // captive ????
if (!_isDead) then {
_unit switchMove "AmovPpneMstpSnonWnonDnon_healed";
//no need to public broadcast the variables since this runs on every peer
_unit setVariable ["NORRN_unconscious", false, false];
_unit setVariable ["USEC_isCardiac",false, false];
if (_unit == player) then {
r_player_unconscious = false;
disableUserInput false;
r_player_cardiac = false;
r_player_handler1 = false;
};
if (_unit == player and !(_unit getVariable["USEC_isDead",false]) and _medic != _unit and _medic distance _unit < 5) then {
_unit setVariable ["NORRN_unconscious", false, false]; r_player_unconscious = false;
_unit setVariable ["USEC_isCardiac",false, false]; r_player_cardiac = false;
//AmovPpneMstpSnonWnonDnon_healed
};

View File

@@ -1,20 +1,22 @@
// animHealed.sqf
private ["_array","_unit","_medic","_display","_control","_id"];
private ["_array","_unit","_medic","_display","_control"];
disableserialization;
_array = _this; //_this select 0;
_unit = _array select 0;
_medic = _array select 1;
if ((_unit == player) || (vehicle player != player)) then {
if ((_unit == player) or (vehicle player != player)) then {
r_fracture_legs = false;
r_fracture_arms = false;
_unit setHit["legs",0];
_unit setHit["hands",0];
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1203;
_control = _display displayCtrl 1203;
_control ctrlShow false;
// _id = false spawn dayz_disableRespawn;
};
//_id = false spawn dayz_disableRespawn;
};
_unit setVariable ["hit_legs",0,true];
_unit setVariable ["hit_hands",0,true];

View File

@@ -1,12 +1,8 @@
// animHealed.sqf
private ["_array","_unit","_medic"];
_array = _this; //_this select 0;
_unit = _array select 0;
_medic = _array select 1;
if ((_unit == player) || (vehicle player != player)) then {
if ((_unit == player) or (vehicle player != player)) then {
r_player_inpain = false;
R3F_TIRED_Accumulator = 0;
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;
};

View File

@@ -1,19 +1,15 @@
// bleed.sqf
private ["_unit","_isDead","_isCardiac"];
_unit = (_this select 3);
private["_unit","_isDead","_isCardiac"];
_unit = _this select 3;
_isDead = _unit getVariable["USEC_isDead",false];
_isCardiac = _unit getVariable["USEC_isCardiac",false];
uiSleep 1;
if (_isDead) then {
TitleText[(localize "str_epoch_player_3"),"PLAIN DOWN",3];
cutText [localize "str_pulse_extremely_weak","PLAIN DOWN"];
} else {
if (_isCardiac) then {
TitleText[(localize "str_epoch_player_4"),"PLAIN DOWN",3];
cutText [localize "str_pulse_weak","PLAIN DOWN"];
} else {
TitleText[(localize "str_epoch_player_5"),"PLAIN DOWN",3];
cutText [localize "str_pulse_strong","PLAIN DOWN"];
};
};
//r_action = false;

View File

@@ -11,7 +11,7 @@ r_action = false;
if (vehicle player == player) then {
player playActionNow "Medic";
};
[1,1] call dayz_HungerThirst;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;

View File

@@ -7,7 +7,10 @@ _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 = _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"]};
call gear_ui_init;
closeDialog 0;
@@ -66,7 +69,7 @@ while {r_doLoop and (_i < 12)} do {
if (_isMedic and !_started) then {
closeDialog 0;
diag_log format ["TRANSFUSION: starting blood transfusion (%1 > %2)", name player, name _unit];
//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;
@@ -119,7 +122,9 @@ while {r_doLoop and (_i < 12)} do {
_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];
//diag_log format ["TRANSFUSION: completed blood transfusion successfully (_i = %1)", _i];
selfTransfusionTime = time;
[_unit, DZE_selfTransfuse_Values] call player_medTransfuse;
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;
@@ -129,13 +134,12 @@ while {r_doLoop and (_i < 12)} do {
_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"];
//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;
uiSleep 0.1;
};
r_doLoop = false;

View File

@@ -4,20 +4,14 @@ fnc_usec_damageHandle = {
- Function
- [unit] call fnc_usec_damageHandle;
************************************************************/
private ["_unit"];
//private["_unit","_eh"];
_unit = _this select 0;
// Remove handle damage override
// _unit removeEventHandler ["HandleDamage",temp_handler];
mydamage_eh1 = _unit addeventhandler ["HandleDamage",{_this call fnc_usec_damageHandler;} ];
mydamage_eh2 = _unit addEventHandler ["Fired", {_this call player_fired;}];
mydamage_eh3 = _unit addEventHandler ["Killed", {_id = [] spawn player_death;}];
};
fnc_usec_pitchWhine = {
private ["_visual","_sound"];
_visual = _this select 0;
_sound = _this select 1;
//affect the player
@@ -34,33 +28,51 @@ fnc_usec_pitchWhine = {
};
};
fnc_usec_damageUnconscious = {
private ["_unit","_damage","_inVehicle"];
/*
//Old system 1.8.6
fnc_usec_damageUnconscious1 = {
private["_unit","_damage"];
_unit = _this select 0;
_damage = _this select 1;
_inVehicle = (vehicle _unit != _unit);
if ((_unit == player) || (vehicle player != player)) then {
r_player_timeout = round((((random 2) max 0.1) * _damage) * 20);
diag_log format["fnc_usec_damageUnconscious: %1,%2,%3",_unit,_damage, player];
if (_unit == player) then {
r_player_timeout = 120 min (round((((random 2) max 0.1) * _damage) * 20));
r_player_unconscious = true;
player setVariable["medForceUpdate",true,true];
};
};
*/
fnc_usec_damageUnconscious = {
private["_unit","_damage"];
_unit = _this select 0;
_damage = _this select 1;
diag_log format["fnc_usec_damageUnconscious: %1,%2,%3",_unit,_damage, player];
_inVehicle = (vehicle _unit != _unit);
if (_unit == player) then {
r_player_timeout = 120 min (round((((random 2) max 0.1) * _damage) * 20));
r_player_unconscious = true;
player setVariable["medForceUpdate",true];
player setVariable ["unconsciousTime", r_player_timeout, true];
};
if (_inVehicle) then {
_unit spawn {
private["_veh","_unit"];
_veh = vehicle _this;
_unit = _this;
waitUntil{(((([_veh] call FNC_GetPos) select 2 < 1) && (speed _veh < 1)) || (!r_player_unconscious))};
waitUntil{(((getPosATL _veh select 2 < 1) and (speed _veh < 1)) or (!r_player_unconscious))};
if (r_player_unconscious) then {
_unit action ["eject", _veh];
waitUntil{((vehicle _this) != _this)};
uiSleep 1;
_unit setVariable ["NORRN_unconscious", true, true];
_unit playActionNow "Die";
};
};
} else {
_unit setVariable ["NORRN_unconscious", true, true];
_unit playActionNow "Die";
};
};
@@ -68,17 +80,300 @@ 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, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.1], [1, 1, 1, 0.0]];"colorCorrections" ppEffectCommit 0;
"dynamicBlur" ppEffectEnable true;"dynamicBlur" ppEffectAdjust [2]; "dynamicBlur" ppEffectCommit 0;
addCamShake [5, 0.5, 25];
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 0.0]];"colorCorrections" ppEffectCommit _commit;
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit _commit;
"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;
"dynamicBlur" ppEffectEnable true;"dynamicBlur" ppEffectAdjust [1]; "dynamicBlur" ppEffectCommit 0;
setCamShakeParams [0.05, 4, 1, 3, true]; addCamShake [5, 0.5, 25];
"colorCorrections" ppEffectAdjust [1, 1, 0, [0,0,0,0], [1, 1, 1, 1], [1, 1, 1, 1]]; "colorCorrections" ppEffectCommit _commit;
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit _commit;
};
};
fnc_usec_damageGetWound = {
//private["_wound"];
_hit = format["%1",_this];
_sPoint = USEC_woundHit find _hit;
_options = USEC_woundPoint select _sPoint;
_rnd = floor(random(count _options));
_wound = _options select _rnd;
_wound
};
fnc_usec_medic_removeActions = {
_obj = player;
{
_obj = _x;
{
_obj removeAction _x;
} forEach r_player_actions;
} forEach r_action_targets;
r_player_actions = [];
r_action_targets = [];
};
fnc_usec_self_removeActions = {
{
player removeAction _x;
} forEach r_self_actions;
r_self_actions = [];
};
fnc_usec_calculateBloodPerSec = {
private["_bloodLossPerSec","_bloodGainPerSec","_bloodPerSec"];
_bloodLossPerSec = 0;
_bloodGainPerSec = 0;
if (dayz_thirst >= SleepWater) then {
_bloodLossPerSec = _bloodLossPerSec + 10;
};
if (dayz_hunger >= SleepFood) then {
_bloodLossPerSec = _bloodLossPerSec + 10;
};
if (r_player_injured) then {
_bloodLossPerSec = 10;
{
_wounded = player getVariable["hit_"+_x,false];
if (_wounded) then {
_bloodLossPerSec = _bloodLossPerSec + 10;
};
} forEach USEC_typeOfWounds;
};
//Sepsis
if (!r_player_infected) then {
if (r_player_Sepsis select 0) then {
_time = diag_tickTime - (r_player_Sepsis select 1);
if (_time > 900) then {
if (_time < 1800) then {
_time = ((_time - 900) max 1) min 900;
_bloodLossPerSec = _bloodLossPerSec + (_time / 450) + 1;
_bloodLossPerSec = _bloodLossPerSec - (_bloodLossPerSec % 1);
//hintSilent (format["SetupMedFNCS: Blood Level: %2/12000 bloodLossPerSec %1",_bloodLossPerSec,r_player_blood]);
} else {
r_player_Sepsis = [false, 0];
r_player_infected = true;
player setVariable["USEC_infected",true,true];
};
};
if ((_time < 1) and (isNil "sepsisStarted")) then {
//if (isNil "sepsisStarted") then {
//cutText [localize "str_medical_sepsis_warning","PLAIN DOWN",5];
systemChat (localize "str_medical_sepsis_warning");
player setVariable ["sepsisStarted", _time];
};
};
};
if (r_player_infected) then {
_bloodLossPerSec = _bloodLossPerSec + 3;
};
//_golbalNutrition = 1200 / (r_player_Nutrition select 0);
if (r_player_bloodregen > 0) then {
_bloodGainPerSec = r_player_bloodregen * 0.1;
/*
if ((r_player_bloodregen) < 30) then {
_bloodGainPerSec = r_player_bloodregen * _golbalNutrition;
};
if ((r_player_bloodregen)< 60) then {
_bloodGainPerSec = r_player_bloodregen * _golbalNutrition;
};
*/
r_player_bloodregen = (0 max r_player_bloodregen) - (0 max _bloodGainPerSec);
};
r_player_bloodlosspersec = _bloodLossPerSec;
r_player_bloodgainpersec = _bloodGainPerSec;
_bloodPerSec = _bloodGainPerSec - _bloodLossPerSec;
/*
private [ "_foodVal", "_thirstVal", "_tempVal"];
_foodVal = round(100*(1 - (dayz_hunger / SleepFood)));
_thirstVal = round(100*(1 - (dayz_thirst / SleepWater)));
_tempVal = round(100*(1 - ((dayz_temperatur - dayz_temperaturmin)/(dayz_temperaturmax - dayz_temperaturmin))));
hintSilent format [ "blood/s: %1\ngain/s: %2\nloss/s: %3\nbloodregen: %4\ninjured: %5\ninfected: %6\nsepsis: %7\ninpain:%15\nblood: %8\nthirst: %9 (%12%%)\nhunger: %10 (%13%%)\ntemp: %11 (%14%%)\nFoodstack: %16\n",
_bloodPerSec,
r_player_bloodgainpersec,
r_player_bloodlosspersec,
r_player_bloodregen,
r_player_injured,
r_player_infected,
r_player_Sepsis,
r_player_blood,
dayz_thirst,
dayz_hunger,
dayz_temperatur,
_thirstVal,
_foodVal,
_tempVal,
r_player_inpain,
r_player_foodstack
];
*/
r_player_bloodpersec = _bloodPerSec;
_bloodPerSec
};
fnc_usec_playerHandleBlood = {
private["_bloodPerSec","_elapsedTime"];
if (r_player_injured) then { // bleeding
_bleedTime = (random 500) + 100;
_elapsedTime = 0;
while {(r_player_injured) and (r_player_blood > 0)} do {
_bloodPerSec = [] call fnc_usec_calculateBloodPerSec;
r_player_blood = r_player_blood + _bloodPerSec;
_elapsedTime = _elapsedTime + 1;
if (_elapsedTime > _bleedTime) then {
r_player_injured = false;
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
dayz_sourceBleeding = objNull;
call fnc_usec_resetWoundPoints;
};
_bloodDiff = r_player_blood - (player getVariable["USEC_BloodQty", 12000]);
if ((_bloodDiff >= 500) or (_bloodDiff <= -500)) then {
player setVariable["USEC_BloodQty",r_player_blood,true];
player setVariable["medForceUpdate",true];
};
uiSleep 1;
};
} else { // not bleeding
_bloodPerSec = [] call fnc_usec_calculateBloodPerSec;
if (_bloodPerSec != 0) then {
r_player_blood = r_player_blood + _bloodPerSec;
};
_bloodDiff = r_player_blood - (player getVariable["USEC_BloodQty", 12000]);
if ((_bloodDiff >= 500) or (_bloodDiff <= -500)) then {
player setVariable["USEC_BloodQty",r_player_blood,true];
player setVariable["medForceUpdate",true];
};
};
};
fnc_usec_resetWoundPoints = {
{
player setVariable["hit_"+_x,false,true];
} forEach USEC_typeOfWounds;
player setVariable ["USEC_injured",false,true];
};
fnc_usec_damageBleed = {
/***********************************************************
PROCESS DAMAGE TO A UNIT
- Function fnc_usec_damageBleed: Draw a creepy blood stream from a player limb
- [_unit, _wound, _injury] call fnc_usec_damageBleed;
************************************************************/
private["_wound","_modelPos","_point","_source"];
_unit = _this select 0;
_wound = _this select 1;
//_injury = _this select 2; // not used. damage% ???
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];
};
};
while {1 == 1} do {
scopeName "main";
waitUntil {(vehicle _unit == _unit)};
if ((dayz_bleedingeffect == 2) or (dayz_bleedingeffect == 3)) then {
//Blood partical
_point = "Logic" createVehicleLocal getPosATL _unit;
_source = "#particlesource" createVehicleLocal getPosATL _unit;
_source setParticleParams
/* Sprite */ [["\Ca\Data\ParticleEffects\Universal\Universal", 16, 13, 1],"", // File,Ntieth,Index,Count,Loop(Bool)
/* Type */ "Billboard",
/* TimmerPer */ 1,
/* Lifetime */ 0.2,
/* Position */ [0,0,0],
/* MoveVelocity */ [0,0,0.5],
/* Simulation */ 1,0.32,0.1,0.05, //rotationVel,weight,volume,rubbing
/* Scale */ [0.05,0.25],
/* Color */ [[0.2,0.01,0.01,1],[0.2,0.01,0.01,0]],
/* AnimSpeed */ [0.1],
/* randDirPeriod */ 0,
/* randDirIntesity */ 0,
/* onTimerScript */ "",
/* DestroyScript */ "",
/* Follow */ _point];
_source setParticleRandom [2, [0, 0, 0], [0.0, 0.0, 0.0], 0, 0.5, [0, 0, 0, 0.1], 0, 0, 10];
_source setDropInterval 0.02;
_point attachTo [_unit,_modelPos,_wound];
};
uiSleep 5;
while {((_unit getVariable["USEC_injured",true]) and (alive _unit))} do {
scopeName "loop";
if (vehicle _unit != _unit) then {
BreakOut "loop";
};
uiSleep 1;
};
deleteVehicle _source;
deleteVehicle _point;
if (!(_unit getVariable["USEC_injured",false])) then {
BreakOut "main";
};
};
deleteVehicle _source;
deleteVehicle _point;
};
//LEGACY BELOW HERE, LEFT IN FOR SCRIPTS THAT MAY REQUIRE THESE FUNCTIONS
fnc_usec_damageType = {
private["_damage","_ammo","_type"];
_damage = _this select 0;
@@ -97,156 +392,6 @@ fnc_usec_damageType = {
_type;
};
fnc_usec_damageGetWound = {
private["_hit","_sPoint","_options","_rnd","_wound"];
_hit = format["%1",_this];
_sPoint = USEC_woundHit find _hit;
_options = USEC_woundPoint select _sPoint;
_rnd = floor(random(count _options));
_wound = _options select _rnd;
_wound;
};
fnc_usec_medic_removeActions = {
private ["_obj"];
_obj = player;
{
_obj = _x;
{
_obj removeAction _x;
} forEach r_player_actions;
} forEach r_action_targets;
r_player_actions = [];
r_action_targets = [];
};
fnc_usec_self_removeActions = {
{
player removeAction _x;
} count r_self_actions;
r_self_actions = [];
};
fnc_med_publicBlood = {
while {(r_player_injured || r_player_infected) && r_player_blood > 0} do {
player setVariable["USEC_BloodQty",r_player_blood,true];
player setVariable["medForceUpdate",true];
uiSleep 5;
};
};
fnc_usec_playerBleed = {
private ["_bleedTime","_bleedPerSec","_total","_bTime","_myBleedTime","_id"];
_bleedTime = 400; //seconds
_total = r_player_bloodTotal;
r_player_injured = true;
_myBleedTime = (random 300) + 30;
_bTime = 0;
while {r_player_injured} do {
_bleedPerSec = 30;
// If kneeling || crawling reduce bleeding
if (dayz_isKneeling && !r_player_unconscious) then{
_bleedPerSec = 15;
};
if (dayz_isCrawling && !r_player_unconscious) then{
_bleedPerSec = 7.5;
};
//bleed out
if (r_player_blood > 0) then {
r_player_blood = r_player_blood - _bleedPerSec;
};
_bTime = _bTime + 1;
if (_bTime > _myBleedTime) then {
r_player_injured = false;
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
dayz_sourceBleeding = objNull;
{player setVariable[_x,false,true];} count USEC_woundHit;
player setVariable ["USEC_injured",false,true];
};
uiSleep 1;
};
};
fnc_usec_damageBleed = {
/***********************************************************
PROCESS DAMAGE TO A UNIT
- Function
- [_unit, _wound, _injury] call fnc_usec_damageBleed;
************************************************************/
private ["_unit","_wound","_injury","_modelPos","_point","_source","_rndX"];
_unit = _this select 0;
_wound = _this select 1;
_injury = _this select 2;
_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];
};
};
while {true} do {
scopeName "main";
waitUntil {(vehicle _unit == _unit)};
_point = "Logic" createVehicleLocal getPosATL _unit;
_source = "#particlesource" createVehicleLocal getPosATL _unit;
_source setParticleParams
/*Sprite*/ [["\Ca\Data\ParticleEffects\Universal\Universal", 16, 13, 1],"",// File,Ntieth,Index,Count,Loop(Bool)
/*Type*/ "Billboard",
/*TimmerPer*/ 1,
/*Lifetime*/ 0.2,
/*Position*/ [0,0,0],
/*MoveVelocity*/ [0,0,0.5],
/*Simulation*/ 1,0.32,0.1,0.05,//rotationVel,weight,volume,rubbing
/*Scale*/ [0.05,0.25],
/*Color*/ [[0.2,0.01,0.01,1],[0.2,0.01,0.01,0]],
/*AnimSpeed*/ [0.1],
/*randDirPeriod*/ 0,
/*randDirIntesity*/ 0,
/*onTimerScript*/ "",
/*DestroyScript*/ "",
/*Follow*/ _point];
_source setParticleRandom [2, [0, 0, 0], [0.0, 0.0, 0.0], 0, 0.5, [0, 0, 0, 0.1], 0, 0, 10];
_source setDropInterval 0.02;
_point attachTo [_unit,_modelPos,_wound];
uiSleep 5;
while {((_unit getVariable["USEC_injured",true]) && (alive _unit))} do {
scopeName "loop";
if (vehicle _unit != _unit) then {
BreakOut "loop";
};
uiSleep 1;
};
deleteVehicle _source;
deleteVehicle _point;
if (!(_unit getVariable["USEC_injured",false])) then {
BreakOut "main";
};
};
deleteVehicle _source;
deleteVehicle _point;
};
fnc_usec_recoverUncons = {
player setVariable ["NORRN_unconscious",false,true];
player setVariable ["unconsciousTime",0,true];
@@ -265,4 +410,44 @@ fnc_usec_recoverUncons = {
player switchMove "AinjPpneMstpSnonWnonDnon";
player playMoveNow "AmovPpneMstpSnonWnonDnon_healed";
};
};
fnc_med_publicBlood = {
while {(r_player_injured || r_player_infected) && r_player_blood > 0} do {
player setVariable["USEC_BloodQty",r_player_blood,true];
player setVariable["medForceUpdate",true];
uiSleep 5;
};
};
fnc_usec_playerBleed = {
private ["_bleedTime","_bleedPerSec","_total","_bTime","_myBleedTime","_id"];
_bleedTime = 400; //seconds
_total = r_player_bloodTotal;
r_player_injured = true;
_myBleedTime = (random 300) + 30;
_bTime = 0;
while {r_player_injured} do {}
_bleedPerSec = 30;
// If kneeling || crawling reduce bleeding
if (dayz_isKneeling && !r_player_unconscious) then{
_bleedPerSec = 15;
};
if (dayz_isCrawling && !r_player_unconscious) then{
_bleedPerSec = 7.5;
};
//bleed out
if (r_player_blood > 0) then {
r_player_blood = r_player_blood - _bleedPerSec;
};
_bTime = _bTime + 1;
if (_bTime > _myBleedTime) then {
r_player_injured = false;
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
dayz_sourceBleeding = objNull;
{player setVariable[_x,false,true];} count USEC_woundHit;
player setVariable ["USEC_injured",false,true];
};
uiSleep 1;
};
};

View File

@@ -1,59 +1,223 @@
private ["_started","_finished","_animState","_isMedic","_num_removed","_unit","_lastused"];
// bleed.sqf
private ["_bloodAmount","_unit","_blood","_lowBlood","_injured","_inPain","_lastused","_hasTransfusionKit","_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","_bloodTestdone","_sentRequest"];// bleed.sqf
//Get receving unit
_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];
// if (_lastused - time < 60) exitwith {cutText [format[(localize "str_actions_medical_18"),_text] , "PLAIN DOWN"]};
//Does the player have a transfusionKit
//_hasTransfusionKit = "transfusionKit" in magazines player;
//Get receving units blood value
_blood = _unit getVariable ["USEC_BloodQty", 0];
//Get receving units bloodtype
_bloodType = _unit getVariable ["blood_type", ""];
//Get the receving units RH type
_rh = _unit getVariable ["rh_factor", false];
//Get status of bloodtest of receving unit
_bloodTestdone = _unit getVariable ["blood_testdone", false];
r_interrupt = false;
_badBag = false;
_wholeBag = false;
_bagFound = false;
_forceClose = false;
//End if the player does not have a transfusion kit
//if (!_hasTransfusionKit) exitWith { cutText [localize "str_actions_medical_transfusion_failed_transfusionkit", "PLAIN DOWN"]; };
//Unconscious timeout for receving unit
_duration = if (_blood <= 4000) then { 3 } else { 2 };
_bloodBagArray = ["bloodBagANEG","bloodBagAPOS","bloodBagBNEG","bloodBagBPOS","bloodBagABNEG","bloodBagABPOS","bloodBagONEG","bloodBagOPOS","wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"];
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagONEG"];
if (_bloodTestdone) then { // if the recipient does not know his blood type, only O- can apply
switch (_bloodType) do {
case "A" : {
if (_rh) then {
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagAPOS","bloodBagANEG","bloodBagONEG","bloodBagOPOS"];
} else {
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagANEG","bloodBagONEG"];
};
};
case "B" : {
if (_rh) then {
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagBPOS","bloodBagBNEG","bloodBagONEG","bloodBagOPOS"];
} else {
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagBNEG","bloodBagONEG"];
};
};
case "AB" : {
if (_rh) then {
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagABPOS","bloodBagABNEG","bloodBagANEG","bloodBagAPOS","bloodBagBNEG","bloodBagBPOS","bloodBagONEG","bloodBagOPOS"];
} else {
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagABNEG","bloodBagANEG","bloodBagBNEG","bloodBagONEG"];
};
};
case "O" : {
if (_rh) then {
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagOPOS","bloodBagONEG"];
} else {
_bloodBagArrayNeeded = ["ItemBloodbag","bloodBagONEG"];
};
};
};
};
_BBneeded = false;
{ if (_x in magazines player) exitWith { _BBneeded = true; _bbselect = _x; }; } count _bloodBagArrayNeeded;
//No subs for whole blood :(
_rhVal = if (_rh) then { "POS" } else { "NEG" };
_bloodBagWholeNeeded = "wholeBloodBag" + _bloodType + _rhVal;
_haswholebag = _bloodBagWholeNeeded in magazines player;
if (!_BBneeded and !_haswholebag) then {
_badBag = true;
};
//use packed/separated bags first
if (_BBneeded) then {
_wholeBag = false;
} else {
if (_haswholebag) then {
_wholeBag = true;
};
};
call fnc_usec_medic_removeActions;
r_action = false;
// not possible to transfuse while in a vehicle
if (vehicle player != player) exitWith { };
player playActionNow "Medic";
[1,1] call dayz_HungerThirst;
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;
_sentRequest = false;
_timer = diag_tickTime;
_i = 0;
_r = 0;
_humanityAwarded = 0;
_bloodAmount = if (!_wholeBag) then { 12000/*Full bloodbag*/ } else { 4000 /*Whole blood only gives 4k*/ };
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
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 {
//select random bloodbag if the player has more then one of the required types
_bagToRemove = _bloodBagArray select _r;
//TODO: add separate action menu options so the removed bag isn't random
if (_bagToRemove in magazines player) exitWith {
_bagFound = true;
if (_r >= 8) then {
_wholeBag = true;
};
};
};
} else {
_bagToRemove = if (_wholeBag) then { _bloodBagWholeNeeded } else { _bbselect };
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"];
//see Note 1
//[player,_unit,"loc",rTITLETEXT,format["Transfusion of %1 in progress, remain still...",_bagToRemove],"PLAIN DOWN"] call RE;
_started = true;
};
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
if (_started) then {
//_sentRequest var stops the pvs running more then once as it's no longer needs too 1.8.4
if ((!_sentRequest) And (!_badBag)) then {
PVDZ_send = [_unit,"Transfuse",[_unit,player,_bloodAmount]];
publicVariableServer "PVDZ_send";
_sentRequest = true;
};
if ((diag_tickTime - _timer) >= 1) then {
_timer = diag_tickTime;
//see Note 1
//PVCDZ_hlt_Transfuse = [_unit,player,1000];
//publicVariable "PVCDZ_hlt_Transfuse";
if (!_wholeBag) then {
_i = _i + 1; //Full bloodbag
} else {
_i = _i + 3; //Whole blood only gives 4k
};
if (!_badBag) then {
if (!_forceClose) then {
_bloodAmount = _bloodAmount - 500;
//see Note 1
//PVDZ_send = [_unit,"Transfuse",[_unit,player,500]];
//publicVariableServer "PVDZ_send";
// 25 points to be givin upto a maximum of 300 points if the player stays for the full duration
//This should be better this way to keep calculus simple and prevent people getting points for giving blood transfusions to healthy players (and less humanity for only very small amounts of blood)
//Pulled from pullrequest from ILoveBeans
if ( _humanityAwarded < 300 ) then {
_humanityAwarded = _humanityAwarded + 25 ;
};
};
} else {
if (!_forceClose and (_i >= 12)) then {
_bloodAmount = 0;
PVDZ_sendUnconscious = [_unit,_duration];
publicVariableServer "PVDZ_sendUnconscious";
diag_log ("Transfusion: "+str(PVDZ_sendUnconscious));
};
};
cutText [localize "str_actions_medical_transfusion_start", "PLAIN DOWN"];
//see Note 1
//[player,_unit,"loc",rTITLETEXT,format["Transfusion of %1 in progress, remain still...",_bagToRemove],"PLAIN DOWN"] call RE;
};
if (!_isMedic) then {
player playActionNow "Medic";
};
};
if (r_interrupt) then {
_blood = _unit getVariable ["USEC_BloodQty", 0];
if (_blood >= r_player_bloodTotal or _bloodAmount == 0) then {
//diag_log format ["TRANSFUSION: completed blood transfusion successfully (_i = %1)", _i];
cutText [localize "str_actions_medical_transfusion_successful", "PLAIN DOWN"];
//see Note 1
//[player,_unit,"loc",rTITLETEXT,localize "str_actions_medical_transfusion_successful","PLAIN DOWN"] call RE;
if (!_badBag and _bagFound) then { [player,_humanityAwarded] call player_humanityChange; };
r_doLoop = false;
};
uiSleep 0.1;
_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"];
//see Note 1
//[player,_unit,"loc",rTITLETEXT,localize "str_actions_medical_transfusion_interrupted","PLAIN DOWN"] call RE;
r_doLoop = false;
};
uiSleep 1;
};
r_doLoop = false;
if (_finished) then {
//_unit setVariable["LastTransfusion",time,true]; //reserve for self transfusion
_unit setVariable["USEC_lowBlood",false,true];
_num_removed = ([player,"ItemBloodbag"] call BIS_fnc_invRemove);
if(_num_removed == 1) then {
/* PVS/PVC - Skaronator */
PVDZE_send = [_unit,"Transfuse",[_unit,player]];
publicVariableServer "PVDZE_send";
[player,100] call player_humanityChange;
};
} else {
if (r_interrupt) then {
r_interrupt = false;
player switchMove "";
player playActionNow "stop";
};
};
/*
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
*/

View File

@@ -30,11 +30,11 @@ while {r_doLoop} do {
r_doLoop = false;
};
if (vehicle player != player) then {
sleep 3;
uiSleep 3;
r_doLoop = false;
_finished = true;
};
sleep 0.1;
uiSleep 0.1;
};
r_doLoop = false;