mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-24 09:29:21 +03:00
Merge selfbloodbag and self_transfuse
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
// allowDamage.sqf
|
||||
|
||||
private ["_unit"];
|
||||
_unit = _this select 0;
|
||||
|
||||
_unit switchMove "AmovPpneMstpSnonWnonDnon_healed";
|
||||
_unit allowDamage true;
|
||||
_unit switchMove "AmovPpneMstpSnonWnonDnon_healed";
|
||||
_unit allowDamage true;
|
||||
_unit setCaptive false;
|
||||
@@ -1,6 +1,5 @@
|
||||
// animDrag.sqf
|
||||
|
||||
private ["_dragee"];
|
||||
_dragee = _this select 0;
|
||||
|
||||
_dragee switchmove "ainjppnemstpsnonwrfldb_still";
|
||||
@@ -1,10 +1,9 @@
|
||||
// animHealed.sqf
|
||||
|
||||
private ["_unit"];
|
||||
_unit = _this select 0;
|
||||
|
||||
_unit switchMove "AmovPpneMstpSnonWnonDnon_healed";
|
||||
if ((_unit == player) || (vehicle player != player)) then {
|
||||
if (_unit == player) then {
|
||||
r_player_unconscious = false;
|
||||
r_player_injured = false;
|
||||
};
|
||||
@@ -1,5 +1,4 @@
|
||||
//carriedUp.sqf
|
||||
|
||||
private ["_dragee"];
|
||||
_dragee = _this select 0;
|
||||
_dragee switchmove "ainjpfalmstpsnonwrfldnon_carried_up";
|
||||
@@ -1,6 +1,6 @@
|
||||
//deadState.sqf
|
||||
|
||||
private ["_unit"];
|
||||
_unit = _this select 0;
|
||||
|
||||
_unit switchMove "deadState";
|
||||
_unit switchMove "deadState";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//lieStill.sqf
|
||||
|
||||
private ["_dragee"];
|
||||
_dragee = _this select 0;
|
||||
|
||||
_dragee playMoveNow "ainjppnemstpsnonwrfldnon";
|
||||
_dragee playMoveNow "ainjppnemstpsnonwrfldnon";
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// load_wounded.sqf
|
||||
|
||||
private ["_unit"];
|
||||
_unit = _this select 0;
|
||||
|
||||
_unit switchMove "kia_hmmwv_driver";
|
||||
@@ -1,5 +1,6 @@
|
||||
// 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; // healed
|
||||
_medic = _array select 1; // healer
|
||||
@@ -12,4 +13,4 @@ if (_unit == player and !(_unit getVariable["USEC_isDead",false]) and _medic !=
|
||||
_unit setVariable ["NORRN_unconscious", false, false]; r_player_unconscious = false;
|
||||
_unit setVariable ["USEC_isCardiac",false, false]; r_player_cardiac = false;
|
||||
//AmovPpneMstpSnonWnonDnon_healed
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,35 +1,76 @@
|
||||
private ["_selfTransValues","_unit","_display","_control","_rndInfection","_TransfusionInfection"];
|
||||
// animHealed.sqf
|
||||
private["_array","_unit","_medic","_amount","_display","_control","_lowBlood"];
|
||||
disableserialization;
|
||||
_unit = _this select 0;
|
||||
//[_unit,player,_bloodAmount]
|
||||
_array = _this; //_this select 0;
|
||||
_unit = _array select 0; //Player receving the blood
|
||||
_medic = _array select 1; //Player sending the blood
|
||||
_amount = _array select 2; //total amount of blood given
|
||||
|
||||
_rndInfection = (random 15);
|
||||
_TransfusionInfection = (_rndInfection < 1);
|
||||
if (_unit == player) then {
|
||||
if (((count _this) > 1) && {(typeName (_this select 1)) == "ARRAY"}) then { //DO NOT TOUCH THE CODE BRACKETS!
|
||||
_selfTransValues = _this select 1;
|
||||
r_player_blood = (r_player_blood + (_selfTransValues select 0)) min r_player_bloodTotal;
|
||||
if ((_selfTransValues select 1) < 0) then {
|
||||
_TransfusionInfection = false;
|
||||
} else {
|
||||
_TransfusionInfection = ((random (_selfTransValues select 1)) < 1);
|
||||
_timer = diag_tickTime;
|
||||
r_doLoop = true;
|
||||
r_interrupt = false;
|
||||
|
||||
if (_amount < 0) exitWith { /* someone is trying to kill the player */ };
|
||||
|
||||
//Start the loop to mimic the transfusion to cut back on issues flooding the server
|
||||
while {r_doLoop} do {
|
||||
|
||||
if ((diag_tickTime - _timer) >= 1) then {
|
||||
_timer = diag_tickTime;
|
||||
|
||||
//Infection chance
|
||||
_rndInfection = (random 20);
|
||||
_TransfusionInfection = (_rndInfection < 0.3);
|
||||
|
||||
//Mimic the transfer of the blood (cut out the server)
|
||||
if (_amount > 0) then {
|
||||
_amount = _amount - 500;
|
||||
};
|
||||
cutText [localize "str_actions_medical_transfusion_start", "PLAIN DOWN"];
|
||||
|
||||
//Make sure the unit is a player and update stats based on whats being sent (should mimic 500 units of blood being sent)
|
||||
if (_unit == player) then {
|
||||
if ((r_player_blood + 500) >= r_player_bloodTotal) then {
|
||||
r_player_blood = r_player_bloodTotal;
|
||||
player setVariable["USEC_BloodQty",r_player_bloodTotal,true];
|
||||
} else {
|
||||
r_player_blood = r_player_blood + 500;
|
||||
player setVariable["USEC_BloodQty",r_player_blood,true];
|
||||
};
|
||||
|
||||
if (((r_player_blood / r_player_bloodTotal) >= 0.35) and (r_player_lowblood)) then {
|
||||
r_player_lowblood = false;
|
||||
player setVariable["USEC_lowBlood",false,true];
|
||||
};
|
||||
|
||||
if (_TransfusionInfection) then {
|
||||
r_player_infected = true;
|
||||
player setVariable["USEC_infected",true,true];
|
||||
};
|
||||
|
||||
//Ensure Control is visible
|
||||
_display = uiNamespace getVariable 'DAYZ_GUI_display';
|
||||
_control = _display displayCtrl 1300;
|
||||
_control ctrlShow true;
|
||||
};
|
||||
} else {
|
||||
r_player_blood = r_player_bloodTotal;
|
||||
};
|
||||
r_player_lowblood = false;
|
||||
10 fadeSound 1;
|
||||
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;
|
||||
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5;
|
||||
|
||||
if (_TransfusionInfection) then {
|
||||
r_player_infected = true;
|
||||
player setVariable["USEC_infected",true,true];
|
||||
};
|
||||
|
||||
//Ensure Control is visible
|
||||
_display = uiNamespace getVariable 'DAYZ_GUI_display';
|
||||
_control = _display displayCtrl 1300;
|
||||
_control ctrlShow true;
|
||||
//If the players blood is equals too or aboue 12000 stop or if the blood mimic amount reaches 0 end the loop.
|
||||
_blood = _unit getVariable ["USEC_BloodQty", 0];
|
||||
|
||||
player setVariable["USEC_BloodQty",r_player_blood,true];
|
||||
};
|
||||
//diag_log format["Player Blood %1 - %2, - %3, - %4",_blood,_unit,_medic,(_unit getVariable "USEC_BloodQty")];
|
||||
|
||||
if (_blood >= r_player_bloodTotal or _amount == 0) then {
|
||||
cutText [localize "str_actions_medical_transfusion_successful", "PLAIN DOWN"];
|
||||
r_doLoop = false;
|
||||
};
|
||||
|
||||
if (r_interrupt) then {
|
||||
cutText [localize "str_actions_medical_transfusion_interrupted", "PLAIN DOWN"];
|
||||
r_doLoop = false;
|
||||
};
|
||||
|
||||
//Rerun the loop
|
||||
sleep 1;
|
||||
};
|
||||
@@ -1,6 +1,4 @@
|
||||
// animHealed.sqf
|
||||
|
||||
private ["_array","_unit","_medic","_item"];
|
||||
_array = _this; //_this select 0;
|
||||
_unit = _array select 0;
|
||||
_medic = _array select 1;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
//noAnim.sqf
|
||||
|
||||
private ["_unit"];
|
||||
_unit = _this select 0;
|
||||
|
||||
_unit switchMove "";
|
||||
@@ -1,9 +1,8 @@
|
||||
// noDamage.sqf
|
||||
|
||||
private ["_unit"];
|
||||
_unit = _this select 0;
|
||||
|
||||
_unit setCaptive 3;
|
||||
_unit switchMove "AmovPpneMstpSnonWnonDnon_healed";
|
||||
_unit allowDamage false;
|
||||
uiSleep 0.01;
|
||||
_unit switchMove "AmovPpneMstpSnonWnonDnon_healed";
|
||||
_unit allowDamage false;
|
||||
sleep 0.01;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// pickUp.sqf
|
||||
|
||||
private ["_unit"];
|
||||
_unit = _this select 0;
|
||||
|
||||
_unit switchMove "acinpknlmstpsraswrfldnon_acinpercmrunsraswrfldnon";
|
||||
@@ -1,6 +1,6 @@
|
||||
// rolltoback.sqf
|
||||
|
||||
private ["_unit"];
|
||||
_unit = _this select 0;
|
||||
|
||||
_unit switchMove "ainjppnemstpsnonwrfldnon_rolltoback";
|
||||
_unit switchMove "ainjppnemstpsnonwrfldnon_rolltoback";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// rolltofront.sqf
|
||||
|
||||
private ["_unit"];
|
||||
_unit = _this select 0;
|
||||
|
||||
_unit switchMove "ainjppnemstpsnonwrfldnon_rolltofront";
|
||||
_unit switchMove "ainjppnemstpsnonwrfldnon_rolltofront";
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// set180.sqf
|
||||
//set180.sqf
|
||||
|
||||
private ["_dragee"];
|
||||
_dragee = _this select 0;
|
||||
|
||||
_dragee setDir 180;
|
||||
_dragee setDir 180;
|
||||
Reference in New Issue
Block a user