mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
Actions cleanup
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
private ["_playArray","_lastRest","_blood"];
|
||||
private ["_playArray","_lastRest","_blood","_timesincedrink","_bloodinc","_Moves","_sleepArray","_animState","_started","_finished","_timer","_i","_r","_cureAttempt","_isAsleep","_cureChance","_infectedStatus","_randomamount"];
|
||||
//_timesincedrink = time - dayz_lastDrink;
|
||||
//_bloodinc =100; Removed for now(untested) due to it not needed yet
|
||||
|
||||
//http://community.bistudio.com/wiki/ArmA2:_Moves
|
||||
|
||||
_sleepArray = ["aidlppnemstpsnonwnondnon_sleepc_laydown","aidlppnemstpsnonwnondnon_sleepc_lookaround","aidlppnemstpsnonwnondnon_sleepc_scratch","aidlppnemstpsnonwnondnon_sleepc_sleep","aidlppnemstpsnonwnondnon_sleepc_sleep0"];
|
||||
@@ -24,15 +23,10 @@ _lastRest = player getVariable ["lastRest", 0];
|
||||
|
||||
while {r_doLoop} do {
|
||||
_isAsleep = (animationState player) in _sleepArray;
|
||||
|
||||
if (_isAsleep and !_started) then {
|
||||
|
||||
_started = true;
|
||||
};
|
||||
if (_isAsleep && !_started) then {_started = true;};
|
||||
|
||||
if (_started) then {
|
||||
if (!r_player_unconscious) then {
|
||||
|
||||
if (r_player_infected) then {
|
||||
//every 30 seconds run Random Chance to cure infection
|
||||
if (diag_ticktime - _lastRest > 30) then {
|
||||
@@ -58,7 +52,7 @@ while {r_doLoop} do {
|
||||
};
|
||||
|
||||
//make sure player isnt infected or inpain.
|
||||
if (!r_player_injured AND !r_player_infected AND !(r_player_Sepsis select 0)) then {
|
||||
if (!r_player_injured && !r_player_infected && !(r_player_Sepsis select 0)) then {
|
||||
//Give 53 + random amount of blood every 16 secs if player isn't injured.
|
||||
if ((diag_tickTime - _timer) >= 16) then {
|
||||
if (r_player_blood < 12000) then {
|
||||
@@ -67,7 +61,7 @@ while {r_doLoop} do {
|
||||
_blood = 53 + _randomamount; //Max Possible 153.
|
||||
};
|
||||
|
||||
//Lets make sure we do go over the max amount
|
||||
//Make sure we don't go over the max amount
|
||||
if ((r_player_blood - 12000) < _blood) then {
|
||||
r_player_bloodregen = r_player_bloodregen + _blood;
|
||||
} else {
|
||||
@@ -77,8 +71,7 @@ while {r_doLoop} do {
|
||||
_timer = diag_tickTime;
|
||||
_infectedStatus = if (r_player_infected) then { "Yes" } else { "Cured" };
|
||||
cutText [format [localize "str_sleepStats",_blood,r_player_blood], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
if (!_isAsleep) then {
|
||||
@@ -97,7 +90,7 @@ while {r_doLoop} do {
|
||||
r_doLoop = false;
|
||||
|
||||
if (r_interrupt) then {
|
||||
systemChat(localize ("str_endSleepStandUp"));
|
||||
systemChat (localize "str_endSleepStandUp");
|
||||
r_interrupt = false;
|
||||
player playmoveNow "";
|
||||
player playActionNow "stop";
|
||||
@@ -106,5 +99,4 @@ if (r_interrupt) then {
|
||||
//Removed due to player sync returning []
|
||||
//PVDZ_plr_Save = [player,nil,true,dayz_playerAchievements];
|
||||
//publicVariableServer "PVDZ_plr_Save";
|
||||
R3F_TIRED_Accumulator = 0;
|
||||
|
||||
R3F_TIRED_Accumulator = 0;
|
||||
Reference in New Issue
Block a user