mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Add weight for backpacks
This commit is contained in:
@@ -64,8 +64,7 @@ while {true} do {
|
||||
|
||||
_posATL = (getPosATL player) select 2;
|
||||
|
||||
|
||||
if((vehicle player == player) && (_posATL < 100)) then {
|
||||
if ((vehicle player == player) && {_posATL < 100}) then {
|
||||
R3F_TIRED_Accumulator = R3F_TIRED_Accumulator
|
||||
+ (R3F_TIRED_POIDS_TOTAL_PLAYER * R3F_TIRED_vitesse_de_mon_joueur * R3F_TIRED_Ratio_Position * R3F_TIRED_WEIGHT_SPEED_RATIO*R3F_TIRED_Ratio_Overweight)
|
||||
+ (R3F_TIRED_POIDS_TOTAL_PLAYER * R3F_TIRED_coeff_mon_elevation_en_z * R3F_TIRED_WEIGHT_LEVEL2);
|
||||
@@ -94,8 +93,8 @@ while {true} do {
|
||||
};
|
||||
|
||||
if (R3F_TIRED_GLOBAL_TIRING
|
||||
&& R3F_TIRED_vitesse_de_mon_joueur > 4
|
||||
&& R3F_TIRED_Ratio_Recovery > R3F_TIRED_RATIO_RECOVERING
|
||||
&& {R3F_TIRED_vitesse_de_mon_joueur > 4}
|
||||
&& {R3F_TIRED_Ratio_Recovery > R3F_TIRED_RATIO_RECOVERING}
|
||||
) then {
|
||||
R3F_TIRED_Counter_Time= R3F_TIRED_Counter_Time + 1;
|
||||
};
|
||||
@@ -126,4 +125,3 @@ while {true} do {
|
||||
};
|
||||
|
||||
//[_voil] call R3F_TIRED_FNCT_Effect_Off;
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ FNC_PrintToRPT = {
|
||||
};
|
||||
|
||||
R3F_TIRED_FNCT_Voile_Noir = {
|
||||
private "_level";
|
||||
|
||||
_level = _this select 0;
|
||||
if(_level < R3F_TIRED_SHORTNESS_THRESHOLD ) then{
|
||||
playSound "heartbeat_1";
|
||||
|
||||
@@ -9,17 +9,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*****************************************************************************/
|
||||
#include "R3F_WEIGHT_Configuration.sqf"
|
||||
R3F_WEIGHT_FNCT_MakeSingleArray = {
|
||||
private ["_arr_i","_arr_n", "_arr", "_n", "_nb", "_x"];
|
||||
private ["_arr_i","_arr_n", "_arr", "_n", "_nb"];
|
||||
|
||||
_arr_i = (_this select 0) select 0;
|
||||
_arr_n = (_this select 0) select 1;
|
||||
|
||||
_arr = [];
|
||||
|
||||
_n = 0;
|
||||
{
|
||||
_nb = _arr_n select _n;
|
||||
for [{_i = 0}, {_i < _nb}, {_i = _i + 1}] do{
|
||||
_arr = _arr + [_x];
|
||||
|
||||
for "_i" from 1 to _nb do{
|
||||
_arr set [count _arr,_x];
|
||||
};
|
||||
_n = _n + 1;
|
||||
|
||||
@@ -29,9 +30,10 @@ R3F_WEIGHT_FNCT_MakeSingleArray = {
|
||||
};
|
||||
|
||||
R3F_WEIGHT_FNCT_GetItemWeight = {
|
||||
private ["_arr_class", "_total_weight", "_weight"];
|
||||
private ["_arr_class", "_total_weight", "_weight","_bagpack","_type"];
|
||||
|
||||
_arr_class = (_this select 0) + (_this select 1);
|
||||
if (dayz_onBack != "" && count _this > 2) then {
|
||||
if (dayz_onBack != "" && {count _this > 2}) then {
|
||||
_arr_class set [count _arr_class, dayz_onBack];
|
||||
};
|
||||
_total_weight = 0;
|
||||
@@ -56,11 +58,21 @@ R3F_WEIGHT_FNCT_GetItemWeight = {
|
||||
_total_weight = _total_weight + _weight;
|
||||
} else {
|
||||
// log only if not found
|
||||
//diag_log format["No R3F weight config for: %1", _x];
|
||||
diag_log format["No R3F weight config for: %1", _x];
|
||||
};
|
||||
};
|
||||
};
|
||||
}count _arr_class;
|
||||
|
||||
_bagpack = unitBackpack player;
|
||||
if (!isNull _bagpack) then {
|
||||
_type = typeof _bagpack;
|
||||
if (isclass(CfgWeight >> "Backpacks" >> _type)) then {
|
||||
_weight = getNumber(CfgWeight >> "Backpacks" >> _type >> "weight");
|
||||
_total_weight = _total_weight + _weight;
|
||||
};
|
||||
};
|
||||
|
||||
_total_weight;
|
||||
};
|
||||
|
||||
@@ -81,4 +93,3 @@ R3F_WEIGHT_FNCT_GetWeight = {
|
||||
};
|
||||
_return;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user