mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Add warm clothes and shivering
Warm Clothes can be adjusted in the configvariables with DZE_WarmClothes. Shivering can be enabled or disabled with the last value in the DZE_TempVars array. A temperature effect for snow was added too.
This commit is contained in:
@@ -17,7 +17,7 @@ Missing:
|
|||||||
|
|
||||||
Shivering Function need improments
|
Shivering Function need improments
|
||||||
*/
|
*/
|
||||||
private ["_difference","_isinvehicle","_isinbuilding","_daytime","_height_mod","_temp","_looptime","_vehicle_factor","_moving_factor","_fire_factor","_building_factor","_sun_factor","_water_factor","_rain_factor","_night_factor","_wind_factor","_raining","_sunrise","_fireplaces","_building"];
|
private ["_difference","_isinvehicle","_isinbuilding","_daytime","_height_mod","_temp","_looptime","_vehicle_factor","_moving_factor","_fire_factor","_building_factor","_sun_factor","_water_factor","_rain_factor","_night_factor","_wind_factor","_raining","_sunrise","_fireplaces","_building","_heatpack_factor","_warm_clothes","_stand_factor","_snow_factor","_pPos","_sleepTemperatur","_shivering"];
|
||||||
_looptime = _this;
|
_looptime = _this;
|
||||||
|
|
||||||
//Factors are equal to win/loss of factor*basic value
|
//Factors are equal to win/loss of factor*basic value
|
||||||
@@ -30,13 +30,18 @@ _looptime = _this;
|
|||||||
_moving_factor = DZE_TempVars select 3;
|
_moving_factor = DZE_TempVars select 3;
|
||||||
_sun_factor = DZE_TempVars select 4;
|
_sun_factor = DZE_TempVars select 4;
|
||||||
_heatpack_factor = DZE_TempVars select 5;
|
_heatpack_factor = DZE_TempVars select 5;
|
||||||
|
_warm_clothes = DZE_TempVars select 6;
|
||||||
|
|
||||||
//Negative effects
|
//Negative effects
|
||||||
_water_factor = DZE_TempVars select 6;
|
_water_factor = DZE_TempVars select 7;
|
||||||
_stand_factor = DZE_TempVars select 7;
|
_stand_factor = DZE_TempVars select 8;
|
||||||
_rain_factor = DZE_TempVars select 8;
|
_rain_factor = DZE_TempVars select 9;
|
||||||
_wind_factor = DZE_TempVars select 9;
|
_wind_factor = DZE_TempVars select 10;
|
||||||
_night_factor = DZE_TempVars select 10;
|
_night_factor = DZE_TempVars select 11;
|
||||||
|
_snow_factor = DZE_TempVars select 12;
|
||||||
|
|
||||||
|
//Shivering
|
||||||
|
_shivering = DZE_TempVars select 13; //Set this to 26 to disabled shivering
|
||||||
|
|
||||||
_difference = 0;
|
_difference = 0;
|
||||||
//_hasfireffect = false;
|
//_hasfireffect = false;
|
||||||
@@ -61,19 +66,21 @@ if((vehicle player) != player) then {
|
|||||||
//diag_log format["Moving - %1",_difference];
|
//diag_log format["Moving - %1",_difference];
|
||||||
|
|
||||||
//fire
|
//fire
|
||||||
_pPos = [player] call FNC_GetPos;
|
if !(_isinvehicle) then {
|
||||||
_fireplaces = nearestObjects [_pPos, ["flamable_DZ","Land_Fire","Land_Campfire"], 8];
|
_pPos = [player] call FNC_GetPos;
|
||||||
if(({inflamed _x} count _fireplaces) > 0 && !_isinvehicle ) then {
|
_fireplaces = nearestObjects [_pPos, ["flamable_DZ","Land_Fire","Land_Campfire"], 8];
|
||||||
|
if (({inflamed _x} count _fireplaces) > 0) then {
|
||||||
//Math: factor * 1 / (0.5*(distance max 1)^2) 0.5 = 12.5% of the factor effect in a distance o 4 meters
|
//Math: factor * 1 / (0.5*(distance max 1)^2) 0.5 = 12.5% of the factor effect in a distance o 4 meters
|
||||||
_difference = _difference + (_fire_factor /(0.5*((player distance (_fireplaces select 0)) max 1)^2));
|
_difference = _difference + (_fire_factor /(0.5*((player distance (_fireplaces select 0)) max 1)^2));
|
||||||
//_hasfireffect = true;
|
//_hasfireffect = true;
|
||||||
|
|
||||||
//diag_log format["fire - %1",_difference];
|
//diag_log format["fire - %1",_difference];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
//building
|
//building
|
||||||
_building = nearestObject [player, "HouseBase"];
|
_building = nearestObject [player, "HouseBase"];
|
||||||
if(!isNull _building) then {
|
if (!isNull _building) then {
|
||||||
if([player,_building] call fnc_isInsideBuilding) then {
|
if([player,_building] call fnc_isInsideBuilding) then {
|
||||||
//Make sure thate Fire and Building Effect can only appear single Not used at the moment
|
//Make sure thate Fire and Building Effect can only appear single Not used at the moment
|
||||||
//if(!_hasfireffect && _fire_factor > _building_factor) then {
|
//if(!_hasfireffect && _fire_factor > _building_factor) then {
|
||||||
@@ -89,7 +96,7 @@ if(!isNull _building) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//sun
|
//sun
|
||||||
if(daytime > _sunrise && daytime < (24 - _sunrise) && !_raining && overcast <= 0.6 && !_isinbuilding) then {
|
if (daytime > _sunrise && {daytime < (24 - _sunrise)} && {!_raining} && {overcast <= 0.6} && {!_isinbuilding}) then {
|
||||||
/*Mathematic Basic
|
/*Mathematic Basic
|
||||||
|
|
||||||
t = temperature effect
|
t = temperature effect
|
||||||
@@ -116,30 +123,32 @@ if(daytime > _sunrise && daytime < (24 - _sunrise) && !_raining && overcast <= 0
|
|||||||
};
|
};
|
||||||
|
|
||||||
//heatpack
|
//heatpack
|
||||||
if(r_player_warming_heatpack select 0) then {
|
if (r_player_warming_heatpack select 0) then {
|
||||||
_difference = _difference + _heatpack_factor;
|
_difference = _difference + _heatpack_factor;
|
||||||
if ((diag_tickTime - (r_player_warming_heatpack select 1)) >= r_player_warming_heatpack_time) then {
|
if ((diag_tickTime - (r_player_warming_heatpack select 1)) >= r_player_warming_heatpack_time) then {
|
||||||
r_player_warming_heatpack = [false,0];
|
r_player_warming_heatpack = [false,0];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//warm clothes
|
||||||
|
if ((typeOf player) in DZE_WarmClothes) then {
|
||||||
|
if (DZE_SnowFall) then {_warm_clothes = _warm_clothes + 14;};
|
||||||
|
_difference = _difference + _warm_clothes;
|
||||||
|
};
|
||||||
|
|
||||||
//NEGATIVE EFFECTS
|
//NEGATIVE EFFECTS
|
||||||
|
|
||||||
//water
|
if !(_isinvehicle) then {
|
||||||
if((surfaceIsWater getPosATL player || dayz_isSwimming) && !_isinvehicle) then {
|
|
||||||
|
//water
|
||||||
|
if ((surfaceIsWater getPosATL player) || dayz_isSwimming) then {
|
||||||
_difference = _difference - _water_factor;
|
_difference = _difference - _water_factor;
|
||||||
|
|
||||||
//diag_log format["water - %1",_difference];
|
//diag_log format["water - %1",_difference];
|
||||||
};
|
};
|
||||||
|
|
||||||
//rain
|
//night
|
||||||
if(_raining && !_isinvehicle && !_isinbuilding) then {
|
if((daytime < _sunrise || daytime > (24 - _sunrise)) ) then {
|
||||||
_difference = _difference - (rain * _rain_factor);
|
|
||||||
|
|
||||||
//diag_log format["night - %1",_difference];
|
|
||||||
};
|
|
||||||
|
|
||||||
//night
|
|
||||||
if((daytime < _sunrise || daytime > (24 - _sunrise)) && !_isinvehicle) then {
|
|
||||||
_daytime = if(daytime < 12) then {daytime + 24} else {daytime};
|
_daytime = if(daytime < 12) then {daytime + 24} else {daytime};
|
||||||
if(_isinbuilding) then {
|
if(_isinbuilding) then {
|
||||||
_difference = _difference - ((((_night_factor * -1) / (_sunrise^2)) * ((_daytime - 24)^2) + _night_factor)) / 2;
|
_difference = _difference - ((((_night_factor * -1) / (_sunrise^2)) * ((_daytime - 24)^2) + _night_factor)) / 2;
|
||||||
@@ -148,36 +157,58 @@ if((daytime < _sunrise || daytime > (24 - _sunrise)) && !_isinvehicle) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//diag_log format["night - %1",_difference];
|
//diag_log format["night - %1",_difference];
|
||||||
};
|
};
|
||||||
|
|
||||||
//wind
|
//height
|
||||||
if(((wind select 0) > 4 || (wind select 1) > 4) && !_isinvehicle && !_isinbuilding ) then {
|
if (overcast >= 0.6) then {
|
||||||
_difference = _difference - _wind_factor;
|
|
||||||
|
|
||||||
//diag_log format["Wind - %1",_difference];
|
|
||||||
};
|
|
||||||
|
|
||||||
//height
|
|
||||||
if (!_isinvehicle && overcast >= 0.6) then {
|
|
||||||
_height_mod = ((getPosASL player select 2) / 100) / 2;
|
_height_mod = ((getPosASL player select 2) / 100) / 2;
|
||||||
_difference = _difference - _height_mod;
|
_difference = _difference - _height_mod;
|
||||||
|
|
||||||
//diag_log format["height - %1",_difference];
|
//diag_log format["height - %1",_difference];
|
||||||
};
|
};
|
||||||
|
|
||||||
//Standing cooldown.
|
if !(_isinbuilding) then {
|
||||||
if ((speed player == 0) && !_isinvehicle && !_isinvehicle && !_isinbuilding) then {
|
//rain
|
||||||
|
if(_raining) then {
|
||||||
|
_difference = _difference - (rain * _rain_factor);
|
||||||
|
|
||||||
|
//diag_log format["night - %1",_difference];
|
||||||
|
};
|
||||||
|
//wind
|
||||||
|
if ((wind select 0) > 4 || (wind select 1) > 4) then {
|
||||||
|
_difference = _difference - _wind_factor;
|
||||||
|
|
||||||
|
//diag_log format["Wind - %1",_difference];
|
||||||
|
};
|
||||||
|
//Standing cooldown.
|
||||||
|
if (speed player == 0) then {
|
||||||
_difference = _difference - _stand_factor;
|
_difference = _difference - _stand_factor;
|
||||||
|
|
||||||
//diag_log format["Standing - %1",_difference];
|
//diag_log format["Standing - %1",_difference];
|
||||||
|
};
|
||||||
|
//Snow fall
|
||||||
|
if (!isNil "snow") then {
|
||||||
|
_difference = _difference - _snow_factor;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//Calculate Change Value Basic Factor Looptime Correction Adjust Value to current used temperatur scala
|
//Calculate Change Value Basic Factor Looptime Correction Adjust Value to current used temperatur scala
|
||||||
_difference = _difference * SleepTemperatur / (60 / _looptime) * ((dayz_temperaturmax - dayz_temperaturmin) / 100);
|
_sleepTemperatur = 90 / 100; //First value = Minutes until player reaches the coldest point at night (without other effects! night factor expected to be -1) //TeeChange
|
||||||
|
_difference = _difference * _sleepTemperatur / (60 / _looptime) * ((dayz_temperaturmax - dayz_temperaturmin) / 100);
|
||||||
|
|
||||||
if (dayz_temperature_override) then { _difference = 0; if (dayz_temperatur < 37) then { dayz_temperatur = 37; } };
|
if (dayz_temperature_override) then { _difference = 0; if (dayz_temperatur < 37) then { dayz_temperatur = 37; } };
|
||||||
|
|
||||||
//Change Temperatur Should be moved in a own Function to allow adding of Items which increase the Temp like "hot tea"
|
//Change Temperatur Should be moved in a own Function to allow adding of Items which increase the Temp like "hot tea"
|
||||||
r_player_temp_factor = _difference;
|
r_player_temp_factor = _difference;
|
||||||
dayz_temperatur = (((dayz_temperatur + _difference) max dayz_temperaturmin) min dayz_temperaturmax);
|
dayz_temperatur = (((dayz_temperatur + _difference) max dayz_temperaturmin) min dayz_temperaturmax);
|
||||||
|
|
||||||
|
//Add Shivering
|
||||||
|
// Percent when the Shivering will start
|
||||||
|
if (dayz_temperatur <= _shivering) then { // if the current players temperature is under 34, to disabled set _shivering to 26.
|
||||||
|
//CamShake as linear Function Maximum reached when Temp is at temp minimum. First Entry = Max Value
|
||||||
|
_temp = 0.6 * (dayz_temperaturmin / dayz_temperatur );
|
||||||
|
addCamShake [_temp,(_looptime + 1),30]; //[0.5,looptime,6] -> Maximum is 25% of the Pain Effect
|
||||||
|
} else {
|
||||||
|
addCamShake [0,0,0]; //Not needed at the Moment, but will be necesarry for possible Items
|
||||||
|
};
|
||||||
|
|||||||
@@ -10,8 +10,10 @@ dayz_waterBottleBreaking = false; // Water bottles have a chance to break when b
|
|||||||
dayz_tameDogs = false; // Allow taming dogs with raw meat. Note dog behavior is experimental and buggy.
|
dayz_tameDogs = false; // Allow taming dogs with raw meat. Note dog behavior is experimental and buggy.
|
||||||
dayz_townGenerator = false; // Spawn vanilla map junk instead of Epoch DynamicDebris. Currently only compatible with Chernarus. Also enables comfrey plant spawner which negatively impacts performance.
|
dayz_townGenerator = false; // Spawn vanilla map junk instead of Epoch DynamicDebris. Currently only compatible with Chernarus. Also enables comfrey plant spawner which negatively impacts performance.
|
||||||
dayz_townGeneratorBlackList = []; // If townGenerator is enabled it will not spawn junk within 150m of these positions. Example for Chernarus traders: [[4053,11668,0],[11463,11349,0],[6344,7806,0],[1606,7803,0],[12944,12766,0],[5075,9733,0],[12060,12638,0]]
|
dayz_townGeneratorBlackList = []; // If townGenerator is enabled it will not spawn junk within 150m of these positions. Example for Chernarus traders: [[4053,11668,0],[11463,11349,0],[6344,7806,0],[1606,7803,0],[12944,12766,0],[5075,9733,0],[12060,12638,0]]
|
||||||
DZE_TempVars = [7, 15, 4, 4, 2, 6, 3, 2, 0.25, 0.75, 0.5]; //[vehicle, fire, building, moving, sun, heatpack, water, standing, rain, wind, night] water, standing, rain, wind and night factors have a negative impact on temperature. The greater they are the quicker the player gets cold.
|
DZE_SnowFall = false; //Enables snowfall for Dynamic Weather Effects. Default: false, on all non winter maps. Enabled on all winter maps. _maximumOvercast in DZE_WeatherVariables must be over 0.75. This is set already for all winter maps.
|
||||||
DZE_WeatherVariables = [10, 20, 5, 10, 0, 0.2, 0, 0.7, 0, 0.6, 0, 8, 25, 30, 0, false]; //See DynamicWeatherEffects.sqf for info on these values.
|
DZE_WarmClothes = []; //Array of warm clothes, type of player model must be added: E.g. ["MVD_Soldier_DZ","GUE_Soldier_2_DZ"];
|
||||||
|
DZE_TempVars = [7, 15, 4, 4, 2, 6, 8, 3, 2, 0.25, 0.75, 0.5, 12, 33]; //[vehicle, fire, building, moving, sun, heatpack, warm clothes, water, standing, rain, wind, night, snow, shivering] water, standing, rain, wind and night factors have a negative impact on temperature. The greater they are the quicker the player gets cold. To disable shivering set it to 26.
|
||||||
|
DZE_WeatherVariables = [10, 20, 5, 10, 0, 0.2, 0, 0.7, 0, 0.6, 0, 8, 25, 30, 0, false, 0.8, 1, 100]; //See DynamicWeatherEffects.sqf for info on these values.
|
||||||
DZE_TwoPrimaries = 2; // 0 do not allow primary weapon on back. 1 allow primary weapon on back, but not when holding a primary weapon in hand. 2 allow player to hold two primary weapons, one on back and one in their hands.
|
DZE_TwoPrimaries = 2; // 0 do not allow primary weapon on back. 1 allow primary weapon on back, but not when holding a primary weapon in hand. 2 allow player to hold two primary weapons, one on back and one in their hands.
|
||||||
DZE_AntiWallLimit = 3; // Number of activations before player_antiWall kills player for glitching attempt. Lower is stricter, but may result in false positives.
|
DZE_AntiWallLimit = 3; // Number of activations before player_antiWall kills player for glitching attempt. Lower is stricter, but may result in false positives.
|
||||||
DZE_DamageBeforeMaint = 0.09; // Min damage built items must have before they can be maintained
|
DZE_DamageBeforeMaint = 0.09; // Min damage built items must have before they can be maintained
|
||||||
|
|||||||
@@ -526,7 +526,6 @@ if (!isDedicated) then {
|
|||||||
// Survival Variables
|
// Survival Variables
|
||||||
SleepFood = 2160; //minutes (48 hours)
|
SleepFood = 2160; //minutes (48 hours)
|
||||||
SleepWater = 1440; //minutes (24 hours)
|
SleepWater = 1440; //minutes (24 hours)
|
||||||
SleepTemperatur = 90 / 100; //First value = Minutes until player reaches the coldest point at night (without other effects! night factor expected to be -1) //TeeChange
|
|
||||||
|
|
||||||
// GUI
|
// GUI
|
||||||
Dayz_GUI_R = 0.38; // 0.7 .38
|
Dayz_GUI_R = 0.38; // 0.7 .38
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ _initialWind = [-1, -1];
|
|||||||
_initialSnow = 1;
|
_initialSnow = 1;
|
||||||
_debug = false;
|
_debug = false;
|
||||||
|
|
||||||
|
//Snowfall example: DZE_WeatherVariables = [10, 20, 5, 10, 0, 0.2, 0.5, 1, 0, 0.6, 0, 8, 25, 30, 0, false, 0.8, 1, 100];
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// The following variables can be changed to tweak weather behaviour
|
// The following variables can be changed to tweak weather behaviour
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
//cold
|
|
||||||
player_temp_calculation = compile preprocessFileLineNumbers "custom\fn_temperatur.sqf";
|
|
||||||
|
|
||||||
@@ -1,158 +0,0 @@
|
|||||||
|
|
||||||
private["_looptime","_pos","_vehicle_factor","_moving_factor","_fire_factor","_rain_factor","_night_factor","_wind_factor","_building_factor","_sun_factor","_water_factor","_difference","_hasfireffect","_isinbuilding","_isinvehicle","_raining","_sunrise","_vel","_speed","_fireplaces","_building","_daytime","_height_mod","_temp"];
|
|
||||||
|
|
||||||
_looptime = _this;
|
|
||||||
|
|
||||||
//Factors are equal to win/loss of factor*basic value
|
|
||||||
//All Values can be seen as x of 100: 100 / x = minutes from min temperetaure to max temperature (without other effects)
|
|
||||||
_vehicle_factor = 4;
|
|
||||||
_moving_factor = 7;
|
|
||||||
_fire_factor = 15; //Should be always: _rain_factor + _night_factor + _wind_factor OR higher !
|
|
||||||
_building_factor = 7;
|
|
||||||
_sun_factor = 4; //max sunfactor linear over the day. highest value in the middle of the day
|
|
||||||
_warm_clothes = 22;
|
|
||||||
|
|
||||||
_water_factor = -8;
|
|
||||||
_rain_factor = -3;
|
|
||||||
_night_factor = -1.5;
|
|
||||||
_wind_factor = -1;
|
|
||||||
_snow_factor = -12;
|
|
||||||
|
|
||||||
_difference = 0;
|
|
||||||
_hasfireffect = false;
|
|
||||||
_isinbuilding = false;
|
|
||||||
_isinvehicle = false;
|
|
||||||
|
|
||||||
_raining = (rain > 0);
|
|
||||||
_sunrise = call world_sunRise;
|
|
||||||
|
|
||||||
//POSITIV EFFECTS
|
|
||||||
|
|
||||||
//vehicle
|
|
||||||
if((vehicle player) != player) then {
|
|
||||||
_difference = _difference + _vehicle_factor;
|
|
||||||
_isinvehicle = true;
|
|
||||||
} else {
|
|
||||||
//speed factor
|
|
||||||
private["_vel","_speed"];
|
|
||||||
_vel = velocity player;
|
|
||||||
_speed = round((_vel distance [0,0,0]) * 3.5);
|
|
||||||
_difference = (_moving_factor * (_speed / 20)) min 7;
|
|
||||||
};
|
|
||||||
|
|
||||||
//fire
|
|
||||||
_pos = [player] call FNC_GetPos;
|
|
||||||
_fireplaces = nearestObjects [_pos, ["Land_Fire","Land_Campfire"], 8];
|
|
||||||
if(({inflamed _x} count _fireplaces) > 0 && !_isinvehicle ) then {
|
|
||||||
//Math: factor * 1 / (0.5*(distance max 1)^2) 0.5 = 12.5% of the factor effect in a distance o 4 meters
|
|
||||||
_difference = _difference + (_fire_factor /(0.5*((_pos distance (_fireplaces select 0)) max 1)^2));
|
|
||||||
_hasfireffect = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
//building
|
|
||||||
_building = nearestObject [_pos, "HouseBase"];
|
|
||||||
if(!isNull _building) then {
|
|
||||||
if([player,_building] call fnc_isInsideBuilding) then {
|
|
||||||
//Make sure thate Fire and Building Effect can only appear single Not used at the moment
|
|
||||||
//if(!_hasfireffect && _fire_factor > _building_factor) then {
|
|
||||||
_difference = _difference + _building_factor;
|
|
||||||
//};
|
|
||||||
_isinbuilding = true;
|
|
||||||
dayz_inside = true;
|
|
||||||
} else {
|
|
||||||
dayz_inside = false;
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
dayz_inside = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
//sun
|
|
||||||
if(daytime > _sunrise && daytime < (24 - _sunrise) && !_raining && overcast <= 0.6 && !_isinbuilding) then {
|
|
||||||
/*Mathematic Basic
|
|
||||||
|
|
||||||
t = temperature effect
|
|
||||||
|
|
||||||
a = calcfactor
|
|
||||||
f = sunfactor
|
|
||||||
s = sunrise
|
|
||||||
d = daytime
|
|
||||||
|
|
||||||
I: a = f / (12 - s)<29>
|
|
||||||
II: t = -a * (d - 12)<29> + f
|
|
||||||
|
|
||||||
I + II =>
|
|
||||||
|
|
||||||
t = -(f / (12 - s)<29>) * (d - 12)<29> + f
|
|
||||||
|
|
||||||
Parabel with highest Point( greatest Effect == _sun_factor) always at 12.00
|
|
||||||
Zero Points are always at sunrise and sunset -> Only Positiv Values Possible
|
|
||||||
*/
|
|
||||||
|
|
||||||
_difference = _difference + (-((_sun_factor / (12 - _sunrise)^2)) * ((daytime - 12)^2) + _sun_factor);
|
|
||||||
};
|
|
||||||
|
|
||||||
if ((typeOf player) == "Sniper1W_DZN") then {
|
|
||||||
_difference= _difference + _warm_clothes;
|
|
||||||
};
|
|
||||||
|
|
||||||
if ((typeOf player) == "CamoWinterW_DZN") then {
|
|
||||||
_difference= _difference + _warm_clothes;
|
|
||||||
};
|
|
||||||
|
|
||||||
if ((typeOf player) == "CamoWinter_DZN") then {
|
|
||||||
_difference= _difference + _warm_clothes;
|
|
||||||
};
|
|
||||||
|
|
||||||
//NEGATIVE EFFECTS
|
|
||||||
|
|
||||||
//water
|
|
||||||
if(surfaceIsWater getPosATL player || dayz_isSwimming) then {
|
|
||||||
_difference = _difference + _water_factor;
|
|
||||||
};
|
|
||||||
|
|
||||||
//rain
|
|
||||||
if(_raining && !_isinvehicle && !_isinbuilding) then {
|
|
||||||
_difference = _difference + (rain * _rain_factor);
|
|
||||||
};
|
|
||||||
|
|
||||||
//snow
|
|
||||||
if (!isNil "snow" && !_isinvehicle && !_isinbuilding) then {
|
|
||||||
_difference = _difference + _snow_factor;
|
|
||||||
};
|
|
||||||
|
|
||||||
//night
|
|
||||||
if((daytime < _sunrise || daytime > (24 - _sunrise)) && !_isinvehicle) then {
|
|
||||||
_daytime = if(daytime < 12) then {daytime + 24} else {daytime};
|
|
||||||
if(_isinbuilding) then {
|
|
||||||
_difference = _difference + ((((_night_factor * -1) / (_sunrise^2)) * ((_daytime - 24)^2) + _night_factor)) / 2;
|
|
||||||
} else {
|
|
||||||
_difference = _difference + (((_night_factor * -1) / (_sunrise^2)) * ((_daytime - 24)^2) + _night_factor);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
//wind
|
|
||||||
if(((wind select 0) > 4 || (wind select 1) > 4) && !_isinvehicle && !_isinbuilding ) then {
|
|
||||||
_difference = _difference + _wind_factor;
|
|
||||||
};
|
|
||||||
|
|
||||||
//height
|
|
||||||
if (!_isinvehicle && overcast >= 0.6) then {
|
|
||||||
_height_mod = ((getPosASL player select 2) / 100) / 2;
|
|
||||||
_difference = _difference - _height_mod;
|
|
||||||
};
|
|
||||||
|
|
||||||
//Calculate Change Value Basic Factor Looptime Correction Adjust Value to current used temperatur scala
|
|
||||||
_difference = _difference * SleepTemperatur / (60 / _looptime) * ((dayz_temperaturmax - dayz_temperaturmin) / 100);
|
|
||||||
|
|
||||||
//Change Temperatur Should be moved in a own Function to allow adding of Items which increase the Temp like "hot tea"
|
|
||||||
dayz_temperatur = (((dayz_temperatur + _difference) max dayz_temperaturmin) min dayz_temperaturmax);
|
|
||||||
|
|
||||||
//Add Shivering
|
|
||||||
// Percent when the Shivering will start
|
|
||||||
if(dayz_temperatur <= (0.600 * (dayz_temperaturmax - dayz_temperaturmin) + dayz_temperaturmin)) then {
|
|
||||||
//CamShake as linear Function Maximum reached when Temp is at temp minimum. First Entry = Max Value
|
|
||||||
_temp = 0.6 * (dayz_temperaturmin / dayz_temperatur );
|
|
||||||
addCamShake [_temp,(_looptime + 1),30]; //[0.5,looptime,6] -> Maximum is 25% of the Pain Effect
|
|
||||||
} else {
|
|
||||||
addCamShake [0,0,0]; //Not needed at the Moment, but will be necesarry for possible Items
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user